From owner-svn-src-all@FreeBSD.ORG Sun Nov 22 05:17:23 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 11237106566C; Sun, 22 Nov 2009 05:17:23 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 000558FC15; Sun, 22 Nov 2009 05:17:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAM5HMa7007327; Sun, 22 Nov 2009 05:17:22 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAM5HMHY007326; Sun, 22 Nov 2009 05:17:22 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <200911220517.nAM5HMHY007326@svn.freebsd.org> From: Edwin Groothuis Date: Sun, 22 Nov 2009 05:17:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199642 - head/usr.bin/perror X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Nov 2009 05:17:23 -0000 Author: edwin Date: Sun Nov 22 05:17:22 2009 New Revision: 199642 URL: http://svn.freebsd.org/changeset/base/199642 Log: The output of perror(1) is now showing local messages for locales supported by libc/nls PR: bin/140499 Approved by: gnn@ Modified: head/usr.bin/perror/perror.c Modified: head/usr.bin/perror/perror.c ============================================================================== --- head/usr.bin/perror/perror.c Sat Nov 21 20:44:34 2009 (r199641) +++ head/usr.bin/perror/perror.c Sun Nov 22 05:17:22 2009 (r199642) @@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include static void usage(void); @@ -43,6 +44,7 @@ main(int argc, char **argv) char *errstr; long errnum; + (void) setlocale(LC_MESSAGES, ""); if (argc != 2) usage(); From owner-svn-src-all@FreeBSD.ORG Sun Nov 22 10:53:26 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F2B021065672; Sun, 22 Nov 2009 10:53:26 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E160F8FC15; Sun, 22 Nov 2009 10:53:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAMArQqd016033; Sun, 22 Nov 2009 10:53:26 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAMArQhw016031; Sun, 22 Nov 2009 10:53:26 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200911221053.nAMArQhw016031@svn.freebsd.org> From: Alexander Motin Date: Sun, 22 Nov 2009 10:53:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199644 - head/sbin/atacontrol X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Nov 2009 10:53:27 -0000 Author: mav Date: Sun Nov 22 10:53:26 2009 New Revision: 199644 URL: http://svn.freebsd.org/changeset/base/199644 Log: Add some missing WDMA/UDMA modes. Modified: head/sbin/atacontrol/atacontrol.c Modified: head/sbin/atacontrol/atacontrol.c ============================================================================== --- head/sbin/atacontrol/atacontrol.c Sun Nov 22 09:27:13 2009 (r199643) +++ head/sbin/atacontrol/atacontrol.c Sun Nov 22 10:53:26 2009 (r199644) @@ -49,8 +49,13 @@ mode2str(int mode) case ATA_PIO2: return "PIO2"; case ATA_PIO3: return "PIO3"; case ATA_PIO4: return "PIO4"; + case ATA_WDMA0: return "WDMA0"; + case ATA_WDMA1: return "WDMA1"; case ATA_WDMA2: return "WDMA2"; + case ATA_UDMA0: return "UDMA0"; + case ATA_UDMA1: return "UDMA1"; case ATA_UDMA2: return "UDMA33"; + case ATA_UDMA3: return "UDMA44"; case ATA_UDMA4: return "UDMA66"; case ATA_UDMA5: return "UDMA100"; case ATA_UDMA6: return "UDMA133"; @@ -73,9 +78,15 @@ str2mode(char *str) if (!strcasecmp(str, "PIO2")) return ATA_PIO2; if (!strcasecmp(str, "PIO3")) return ATA_PIO3; if (!strcasecmp(str, "PIO4")) return ATA_PIO4; + if (!strcasecmp(str, "WDMA0")) return ATA_WDMA0; + if (!strcasecmp(str, "WDMA1")) return ATA_WDMA1; if (!strcasecmp(str, "WDMA2")) return ATA_WDMA2; + if (!strcasecmp(str, "UDMA0")) return ATA_UDMA0; + if (!strcasecmp(str, "UDMA1")) return ATA_UDMA1; if (!strcasecmp(str, "UDMA2")) return ATA_UDMA2; if (!strcasecmp(str, "UDMA33")) return ATA_UDMA2; + if (!strcasecmp(str, "UDMA3")) return ATA_UDMA3; + if (!strcasecmp(str, "UDMA44")) return ATA_UDMA3; if (!strcasecmp(str, "UDMA4")) return ATA_UDMA4; if (!strcasecmp(str, "UDMA66")) return ATA_UDMA4; if (!strcasecmp(str, "UDMA5")) return ATA_UDMA5; From owner-svn-src-all@FreeBSD.ORG Sun Nov 22 11:17:31 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8ED16106566C; Sun, 22 Nov 2009 11:17:31 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7DC9B8FC23; Sun, 22 Nov 2009 11:17:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAMBHVLt016592; Sun, 22 Nov 2009 11:17:31 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAMBHVcB016590; Sun, 22 Nov 2009 11:17:31 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200911221117.nAMBHVcB016590@svn.freebsd.org> From: Alexander Motin Date: Sun, 22 Nov 2009 11:17:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199645 - head/sys/dev/ata/chipsets X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Nov 2009 11:17:31 -0000 Author: mav Date: Sun Nov 22 11:17:31 2009 New Revision: 199645 URL: http://svn.freebsd.org/changeset/base/199645 Log: Fix Intel PATA UDMA timings setting, affecting write performance. Binary divider value 10 specified in datasheet is not a hex 0x10. UDMA2 should be 33/2 instead of 66/4, which is documented as reverved, UDMA4 should be 66/2 instead of 66/4, which is definitely wrong. Modified: head/sys/dev/ata/chipsets/ata-intel.c Modified: head/sys/dev/ata/chipsets/ata-intel.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-intel.c Sun Nov 22 10:53:26 2009 (r199644) +++ head/sys/dev/ata/chipsets/ata-intel.c Sun Nov 22 11:17:31 2009 (r199645) @@ -319,7 +319,7 @@ ata_intel_new_setmode(device_t dev, int ata_mode2str(mode), ctlr->chip->text); if (!error) { if (mode >= ATA_UDMA0) { - u_int8_t utimings[] = { 0x00, 0x01, 0x10, 0x01, 0x10, 0x01, 0x10 }; + u_int8_t utimings[] = { 0x00, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02 }; pci_write_config(gparent, 0x48, reg48 | (0x0001 << devno), 2); pci_write_config(gparent, 0x4a, @@ -331,7 +331,7 @@ ata_intel_new_setmode(device_t dev, int pci_write_config(gparent, 0x4a, (reg4a & ~(0x3 << (devno << 2))),2); } reg54 |= 0x0400; - if (mode >= ATA_UDMA2) + if (mode >= ATA_UDMA3) reg54 |= (0x1 << devno); else reg54 &= ~(0x1 << devno); From owner-svn-src-all@FreeBSD.ORG Sun Nov 22 12:19:50 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 90AEB1065670; Sun, 22 Nov 2009 12:19:50 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7F84B8FC19; Sun, 22 Nov 2009 12:19:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAMCJoeL017900; Sun, 22 Nov 2009 12:19:50 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAMCJotb017898; Sun, 22 Nov 2009 12:19:50 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200911221219.nAMCJotb017898@svn.freebsd.org> From: Alexander Motin Date: Sun, 22 Nov 2009 12:19:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199646 - head/sys/dev/ata/chipsets X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Nov 2009 12:19:50 -0000 Author: mav Date: Sun Nov 22 12:19:50 2009 New Revision: 199646 URL: http://svn.freebsd.org/changeset/base/199646 Log: Release over-agressive WDMA0 mode timings as close to spec as chip can. Modified: head/sys/dev/ata/chipsets/ata-intel.c Modified: head/sys/dev/ata/chipsets/ata-intel.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-intel.c Sun Nov 22 11:17:31 2009 (r199645) +++ head/sys/dev/ata/chipsets/ata-intel.c Sun Nov 22 12:19:50 2009 (r199646) @@ -301,7 +301,7 @@ ata_intel_new_setmode(device_t dev, int u_int32_t mask40 = 0, new40 = 0; u_int8_t mask44 = 0, new44 = 0; int error; - u_int8_t timings[] = { 0x00, 0x00, 0x10, 0x21, 0x23, 0x10, 0x21, 0x23, + u_int8_t timings[] = { 0x00, 0x00, 0x10, 0x21, 0x23, 0x00, 0x21, 0x23, 0x23, 0x23, 0x23, 0x23, 0x23, 0x23 }; mode = ata_limit_mode(dev, mode, ctlr->chip->max_dma); From owner-svn-src-all@FreeBSD.ORG Sun Nov 22 14:04:21 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EF4EA106568D; Sun, 22 Nov 2009 14:04:20 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DD3D58FC1E; Sun, 22 Nov 2009 14:04:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAME4KiG020050; Sun, 22 Nov 2009 14:04:20 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAME4KF6020049; Sun, 22 Nov 2009 14:04:20 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <200911221404.nAME4KF6020049@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 22 Nov 2009 14:04:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199647 - in head: bin/sh tools/regression/bin/sh/builtins X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Nov 2009 14:04:21 -0000 Author: jilles Date: Sun Nov 22 14:04:20 2009 New Revision: 199647 URL: http://svn.freebsd.org/changeset/base/199647 Log: sh: Ensure the same command input file is on top after executing a builtin. This avoids weirdness when 'fc -e vi' or the like is done and there is a syntax error in the file. Formerly an interactive shell tried to execute stuff after the syntax error and exited. This should also avoid similar issues with 'command eval' and 'command .' when 'command' is implemented properly as in NetBSD sh. Special builtins did not have this problem since errors in them cause the shell to exit or to reset various state such as the current command input file. Added: head/tools/regression/bin/sh/builtins/fc1.0 (contents, props changed) Modified: head/bin/sh/eval.c head/bin/sh/input.c head/bin/sh/input.h Modified: head/bin/sh/eval.c ============================================================================== --- head/bin/sh/eval.c Sun Nov 22 12:19:50 2009 (r199646) +++ head/bin/sh/eval.c Sun Nov 22 14:04:20 2009 (r199647) @@ -593,6 +593,7 @@ evalcommand(union node *cmd, int flags, char *savecmdname; struct shparam saveparam; struct localvar *savelocalvars; + struct parsefile *savetopfile; volatile int e; char *lastarg; int realstatus; @@ -833,6 +834,7 @@ evalcommand(union node *cmd, int flags, mode |= REDIR_BACKQ; } savecmdname = commandname; + savetopfile = getcurrentfile(); cmdenviron = varlist.list; e = -1; savehandler = handler; @@ -867,6 +869,7 @@ cmddone: if ((e != EXERROR && e != EXEXEC) || cmdentry.special) exraise(e); + popfilesupto(savetopfile); FORCEINTON; } if (cmdentry.u.index != EXECCMD) Modified: head/bin/sh/input.c ============================================================================== --- head/bin/sh/input.c Sun Nov 22 12:19:50 2009 (r199646) +++ head/bin/sh/input.c Sun Nov 22 14:04:20 2009 (r199647) @@ -509,6 +509,32 @@ popfile(void) /* + * Return current file (to go back to it later using popfilesupto()). + */ + +struct parsefile * +getcurrentfile(void) +{ + return parsefile; +} + + +/* + * Pop files until the given file is on top again. Useful for regular + * builtins that read shell commands from files or strings. + * If the given file is not an active file, an error is raised. + */ + +void +popfilesupto(struct parsefile *file) +{ + while (parsefile != file && parsefile != &basepf) + popfile(); + if (parsefile != file) + error("popfilesupto() misused"); +} + +/* * Return to top level. */ Modified: head/bin/sh/input.h ============================================================================== --- head/bin/sh/input.h Sun Nov 22 12:19:50 2009 (r199646) +++ head/bin/sh/input.h Sun Nov 22 14:04:20 2009 (r199647) @@ -45,6 +45,8 @@ extern int parsenleft; /* number of cha extern char *parsenextc; /* next character in input buffer */ extern int init_editline; /* 0 == not setup, 1 == OK, -1 == failed */ +struct parsefile; + char *pfgets(char *, int); int pgetc(void); int preadbuffer(void); @@ -56,6 +58,8 @@ void setinputfile(char *, int); void setinputfd(int, int); void setinputstring(char *, int); void popfile(void); +struct parsefile *getcurrentfile(void); +void popfilesupto(struct parsefile *); void popallfiles(void); void closescript(void); Added: head/tools/regression/bin/sh/builtins/fc1.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/builtins/fc1.0 Sun Nov 22 14:04:20 2009 (r199647) @@ -0,0 +1,27 @@ +# $FreeBSD$ +set -e +trap 'echo Broken pipe -- test failed' pipe + +P=${TMPDIR:-/tmp} +cd $P +T=$(mktemp -d sh-test.XXXXXX) +cd $T + +mkfifo input output error +HISTFILE=/dev/null sh -i output 2>error & +{ + # Syntax error + echo ')' >&3 + # Read error message, shell will read new input now + read dummy <&5 + # Execute bad command again + echo 'fc -e true' >&3 + # Verify that the shell is still running + echo 'echo continued' >&3 || rc=3 + echo 'exit' >&3 || rc=3 + read line <&4 && [ "$line" = continued ] && : ${rc:=0} +} 3>input 4 Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5290F1065676; Sun, 22 Nov 2009 14:32:33 +0000 (UTC) (envelope-from kuriyama@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 36E4C8FC12; Sun, 22 Nov 2009 14:32:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAMEWXc3020713; Sun, 22 Nov 2009 14:32:33 GMT (envelope-from kuriyama@svn.freebsd.org) Received: (from kuriyama@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAMEWXsV020708; Sun, 22 Nov 2009 14:32:33 GMT (envelope-from kuriyama@svn.freebsd.org) Message-Id: <200911221432.nAMEWXsV020708@svn.freebsd.org> From: Jun Kuriyama Date: Sun, 22 Nov 2009 14:32:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199648 - in stable/8/sys: amd64/amd64 amd64/include i386/i386 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Nov 2009 14:32:33 -0000 Author: kuriyama Date: Sun Nov 22 14:32:32 2009 New Revision: 199648 URL: http://svn.freebsd.org/changeset/base/199648 Log: - MFC r199067,199215,199253 - Add hw.clflush_disable loader tunable to avoid panic (trap 9) at map_invalidate_cache_range() even if CPU is not Intel. - This tunable can be set to -1 (default), 0 and 1. -1 is same as current behavior, which automatically disable CLFLUSH on Intel CPUs without CPUID_SS (should be occured on Xen only). You can specify 1 when this panic happened on non-Intel CPUs (such as AMD's). Because disabling CLFLUSH may reduce performance, you can try with setting 0 on Intel CPUs without SS to use CLFLUSH feature. - Amd64 init_secondary() calls initializecpu() while curthread is still not properly set up. r199067 added the call to TUNABLE_INT_FETCH() to initializecpu() that results in hang because AP are started when kernel environment is already dynamic and thus needs to acquire mutex, that is too early in AP start sequence to work. Extract the code that should be executed only once, because it sets up global variables, from initializecpu() to initializecpucache(), and call the later only from hammer_time() executed on BSP. Now, TUNABLE_INT_FETCH() is done only once at BSP at the early boot stage. Modified: stable/8/sys/amd64/amd64/initcpu.c stable/8/sys/amd64/amd64/machdep.c stable/8/sys/amd64/include/md_var.h stable/8/sys/i386/i386/initcpu.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/amd64/amd64/initcpu.c ============================================================================== --- stable/8/sys/amd64/amd64/initcpu.c Sun Nov 22 14:04:20 2009 (r199647) +++ stable/8/sys/amd64/amd64/initcpu.c Sun Nov 22 14:32:32 2009 (r199648) @@ -47,6 +47,12 @@ __FBSDID("$FreeBSD$"); static int hw_instruction_sse; SYSCTL_INT(_hw, OID_AUTO, instruction_sse, CTLFLAG_RD, &hw_instruction_sse, 0, "SIMD/MMX2 instructions available in CPU"); +/* + * -1: automatic (default) + * 0: keep enable CLFLUSH + * 1: force disable CLFLUSH + */ +static int hw_clflush_disable = -1; int cpu; /* Are we 386, 386sx, 486, etc? */ u_int cpu_feature; /* Feature flags */ @@ -157,6 +163,11 @@ initializecpu(void) CPUID_TO_FAMILY(cpu_id) == 0x6 && CPUID_TO_MODEL(cpu_id) >= 0xf) init_via(); +} + +void +initializecpucache() +{ /* * CPUID with %eax = 1, %ebx returns @@ -169,6 +180,15 @@ initializecpu(void) * XXXKIB: (temporary) hack to work around traps generated when * CLFLUSHing APIC registers window. */ - if (cpu_vendor_id == CPU_VENDOR_INTEL && !(cpu_feature & CPUID_SS)) + TUNABLE_INT_FETCH("hw.clflush_disable", &hw_clflush_disable); + if (cpu_vendor_id == CPU_VENDOR_INTEL && !(cpu_feature & CPUID_SS) && + hw_clflush_disable == -1) + cpu_feature &= ~CPUID_CLFSH; + /* + * Allow to disable CLFLUSH feature manually by + * hw.clflush_disable tunable. This may help Xen guest on some AMD + * CPUs. + */ + if (hw_clflush_disable == 1) cpu_feature &= ~CPUID_CLFSH; } Modified: stable/8/sys/amd64/amd64/machdep.c ============================================================================== --- stable/8/sys/amd64/amd64/machdep.c Sun Nov 22 14:04:20 2009 (r199647) +++ stable/8/sys/amd64/amd64/machdep.c Sun Nov 22 14:32:32 2009 (r199648) @@ -1667,6 +1667,7 @@ hammer_time(u_int64_t modulep, u_int64_t identify_cpu(); /* Final stage of CPU initialization */ initializecpu(); /* Initialize CPU registers */ + initializecpucache(); /* make an initial tss so cpu can get interrupt stack on syscall! */ common_tss[0].tss_rsp0 = thread0.td_kstack + \ Modified: stable/8/sys/amd64/include/md_var.h ============================================================================== --- stable/8/sys/amd64/include/md_var.h Sun Nov 22 14:04:20 2009 (r199647) +++ stable/8/sys/amd64/include/md_var.h Sun Nov 22 14:32:32 2009 (r199648) @@ -89,6 +89,7 @@ void gs_load_fault(void) __asm(__STRING( void dump_add_page(vm_paddr_t); void dump_drop_page(vm_paddr_t); void initializecpu(void); +void initializecpucache(void); void fillw(int /*u_short*/ pat, void *base, size_t cnt); void fpstate_drop(struct thread *td); int is_physical_memory(vm_paddr_t addr); Modified: stable/8/sys/i386/i386/initcpu.c ============================================================================== --- stable/8/sys/i386/i386/initcpu.c Sun Nov 22 14:04:20 2009 (r199647) +++ stable/8/sys/i386/i386/initcpu.c Sun Nov 22 14:32:32 2009 (r199648) @@ -75,6 +75,12 @@ static void init_mendocino(void); static int hw_instruction_sse; SYSCTL_INT(_hw, OID_AUTO, instruction_sse, CTLFLAG_RD, &hw_instruction_sse, 0, "SIMD/MMX2 instructions available in CPU"); +/* + * -1: automatic (default) + * 0: keep enable CLFLUSH + * 1: force disable CLFLUSH + */ +static int hw_clflush_disable = -1; /* Must *NOT* be BSS or locore will bzero these after setting them */ int cpu = 0; /* Are we 386, 386sx, 486, etc? */ @@ -721,7 +727,16 @@ initializecpu(void) * XXXKIB: (temporary) hack to work around traps generated when * CLFLUSHing APIC registers window. */ - if (cpu_vendor_id == CPU_VENDOR_INTEL && !(cpu_feature & CPUID_SS)) + TUNABLE_INT_FETCH("hw.clflush_disable", &hw_clflush_disable); + if (cpu_vendor_id == CPU_VENDOR_INTEL && !(cpu_feature & CPUID_SS) && + hw_clflush_disable == -1) + cpu_feature &= ~CPUID_CLFSH; + /* + * Allow to disable CLFLUSH feature manually by + * hw.clflush_disable tunable. This may help Xen guest on some AMD + * CPUs. + */ + if (hw_clflush_disable == 1) cpu_feature &= ~CPUID_CLFSH; #if defined(PC98) && !defined(CPU_UPGRADE_HW_CACHE) From owner-svn-src-all@FreeBSD.ORG Sun Nov 22 15:53:41 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 64D64106566B; Sun, 22 Nov 2009 15:53:41 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 52F928FC14; Sun, 22 Nov 2009 15:53:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAMFrdum022398; Sun, 22 Nov 2009 15:53:39 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAMFrd8K022397; Sun, 22 Nov 2009 15:53:39 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <200911221553.nAMFrd8K022397@svn.freebsd.org> From: Attilio Rao Date: Sun, 22 Nov 2009 15:53:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199649 - stable/8/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Nov 2009 15:53:41 -0000 Author: attilio Date: Sun Nov 22 15:53:39 2009 New Revision: 199649 URL: http://svn.freebsd.org/changeset/base/199649 Log: MFC r199209: Fix a potential buffer boundaries overflow in devclass_add_device() by using all available int lenghts digits for storing the information. Sponsored by: Sandvine Incorporated Modified: stable/8/sys/kern/subr_bus.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/kern/subr_bus.c ============================================================================== --- stable/8/sys/kern/subr_bus.c Sun Nov 22 14:32:32 2009 (r199648) +++ stable/8/sys/kern/subr_bus.c Sun Nov 22 15:53:39 2009 (r199649) @@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -1584,7 +1585,7 @@ devclass_add_device(devclass_t dc, devic PDEBUG(("%s in devclass %s", DEVICENAME(dev), DEVCLANAME(dc))); - buflen = snprintf(NULL, 0, "%s%d$", dc->name, dev->unit); + buflen = snprintf(NULL, 0, "%s%d$", dc->name, INT_MAX); if (buflen < 0) return (ENOMEM); dev->nameunit = malloc(buflen, M_BUS, M_NOWAIT|M_ZERO); From owner-svn-src-all@FreeBSD.ORG Sun Nov 22 15:57:08 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7B414106568D; Sun, 22 Nov 2009 15:57:08 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4F3C38FC0A; Sun, 22 Nov 2009 15:57:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAMFv8R2022536; Sun, 22 Nov 2009 15:57:08 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAMFv8Mg022533; Sun, 22 Nov 2009 15:57:08 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <200911221557.nAMFv8Mg022533@svn.freebsd.org> From: Attilio Rao Date: Sun, 22 Nov 2009 15:57:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199650 - stable/8/sys/boot/common X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Nov 2009 15:57:08 -0000 Author: attilio Date: Sun Nov 22 15:57:08 2009 New Revision: 199650 URL: http://svn.freebsd.org/changeset/base/199650 Log: MFC r199210: Introduce the new loader compile-time option BOOT_PROMPT_123 which allows to enter the loader prompt just after entering the sequence "123". Sponsored by: Sandvine Incorporated Modified: stable/8/sys/boot/common/Makefile.inc stable/8/sys/boot/common/boot.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/boot/common/Makefile.inc ============================================================================== --- stable/8/sys/boot/common/Makefile.inc Sun Nov 22 15:53:39 2009 (r199649) +++ stable/8/sys/boot/common/Makefile.inc Sun Nov 22 15:57:08 2009 (r199650) @@ -38,4 +38,8 @@ MAN+= ../forth/loader.conf.5 MAN+= ../forth/loader.4th.8 .endif +.if defined(BOOT_PROMPT_123) +CFLAGS+= -DBOOT_PROMPT_123 +.endif + MAN+= loader.8 Modified: stable/8/sys/boot/common/boot.c ============================================================================== --- stable/8/sys/boot/common/boot.c Sun Nov 22 15:53:39 2009 (r199649) +++ stable/8/sys/boot/common/boot.c Sun Nov 22 15:57:08 2009 (r199650) @@ -162,6 +162,9 @@ autoboot(int timeout, char *prompt) int c, yes; char *argv[2], *cp, *ep; char *kernelname; +#ifdef BOOT_PROMPT_123 + const char *seq = "123", *p = seq; +#endif autoboot_tried = 1; @@ -192,14 +195,29 @@ autoboot(int timeout, char *prompt) yes = 0; +#ifdef BOOT_PROMPT_123 + printf("%s\n", (prompt == NULL) ? "Hit [Enter] to boot immediately, or " + "1 2 3 sequence for command prompt." : prompt); +#else printf("%s\n", (prompt == NULL) ? "Hit [Enter] to boot immediately, or any other key for command prompt." : prompt); +#endif for (;;) { if (ischar()) { c = getchar(); +#ifdef BOOT_PROMPT_123 + if ((c == '\r') || (c == '\n')) { + yes = 1; + break; + } else if (c != *p++) + p = seq; + if (*p == 0) + break; +#else if ((c == '\r') || (c == '\n')) yes = 1; break; +#endif } ntime = time(NULL); if (ntime >= when) { From owner-svn-src-all@FreeBSD.ORG Sun Nov 22 16:04:49 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7B98C1065676; Sun, 22 Nov 2009 16:04:49 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6794A8FC14; Sun, 22 Nov 2009 16:04:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAMG4nM2022760; Sun, 22 Nov 2009 16:04:49 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAMG4nBE022754; Sun, 22 Nov 2009 16:04:49 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <200911221604.nAMG4nBE022754@svn.freebsd.org> From: Attilio Rao Date: Sun, 22 Nov 2009 16:04:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199651 - in stable/8/sys: conf contrib/rdma/krping libkern netinet netinet/libalias X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Nov 2009 16:04:49 -0000 Author: attilio Date: Sun Nov 22 16:04:49 2009 New Revision: 199651 URL: http://svn.freebsd.org/changeset/base/199651 Log: MFC r199208, r199223: Move inet_aton() (specular to inet_ntoa(), already present in libkern) into libkern in order to made it usable by other modules than alias_proxy. Sponsored by: Sandvine Incorporated Added: stable/8/sys/libkern/inet_aton.c - copied unchanged from r199208, head/sys/libkern/inet_aton.c Modified: stable/8/sys/conf/files stable/8/sys/contrib/rdma/krping/krping.c stable/8/sys/netinet/in.h stable/8/sys/netinet/libalias/alias_proxy.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/conf/files ============================================================================== --- stable/8/sys/conf/files Sun Nov 22 15:57:08 2009 (r199650) +++ stable/8/sys/conf/files Sun Nov 22 16:04:49 2009 (r199651) @@ -2162,6 +2162,7 @@ libkern/iconv_converter_if.m optional li libkern/iconv_xlat.c optional libiconv libkern/iconv_xlat16.c optional libiconv libkern/index.c standard +libkern/inet_aton.c standard libkern/inet_ntoa.c standard libkern/mcount.c optional profiling-routine libkern/memcmp.c standard Modified: stable/8/sys/contrib/rdma/krping/krping.c ============================================================================== --- stable/8/sys/contrib/rdma/krping/krping.c Sun Nov 22 15:57:08 2009 (r199650) +++ stable/8/sys/contrib/rdma/krping/krping.c Sun Nov 22 16:04:49 2009 (r199651) @@ -112,109 +112,6 @@ struct krping_cb_list krping_cbs; #define RPING_BUFSIZE 128*1024 #define RPING_SQ_DEPTH 32 - -/* lifted from netinet/libalias/alias_proxy.c */ -static int inet_aton(const char *cp, struct in_addr *addr); -static int -inet_aton(cp, addr) - const char *cp; - struct in_addr *addr; -{ - u_long parts[4]; - in_addr_t val; - const char *c; - char *endptr; - int gotend, n; - - c = (const char *)cp; - n = 0; - /* - * Run through the string, grabbing numbers until - * the end of the string, or some error - */ - gotend = 0; - while (!gotend) { - unsigned long l; - - l = strtoul(c, &endptr, 0); - - if (l == ULONG_MAX || (l == 0 && endptr == c)) - return (0); - - val = (in_addr_t)l; - /* - * If the whole string is invalid, endptr will equal - * c.. this way we can make sure someone hasn't - * gone '.12' or something which would get past - * the next check. - */ - if (endptr == c) - return (0); - parts[n] = val; - c = endptr; - - /* Check the next character past the previous number's end */ - switch (*c) { - case '.' : - /* Make sure we only do 3 dots .. */ - if (n == 3) /* Whoops. Quit. */ - return (0); - n++; - c++; - break; - - case '\0': - gotend = 1; - break; - - default: - if (isspace((unsigned char)*c)) { - gotend = 1; - break; - } else - return (0); /* Invalid character, so fail */ - } - - } - - /* - * Concoct the address according to - * the number of parts specified. - */ - - switch (n) { - case 0: /* a -- 32 bits */ - /* - * Nothing is necessary here. Overflow checking was - * already done in strtoul(). - */ - break; - case 1: /* a.b -- 8.24 bits */ - if (val > 0xffffff || parts[0] > 0xff) - return (0); - val |= parts[0] << 24; - break; - - case 2: /* a.b.c -- 8.8.16 bits */ - if (val > 0xffff || parts[0] > 0xff || parts[1] > 0xff) - return (0); - val |= (parts[0] << 24) | (parts[1] << 16); - break; - - case 3: /* a.b.c.d -- 8.8.8.8 bits */ - if (val > 0xff || parts[0] > 0xff || parts[1] > 0xff || - parts[2] > 0xff) - return (0); - val |= (parts[0] << 24) | (parts[1] << 16) | (parts[2] << 8); - break; - } - - if (addr != NULL) - addr->s_addr = htonl(val); - return (1); -} - - static void krping_wait(struct krping_cb *cb, int state) { int rc; Copied: stable/8/sys/libkern/inet_aton.c (from r199208, head/sys/libkern/inet_aton.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/sys/libkern/inet_aton.c Sun Nov 22 16:04:49 2009 (r199651, copy of r199208, head/sys/libkern/inet_aton.c) @@ -0,0 +1,136 @@ +/*- + * Copyright (c) 2001 Charles Mott + * 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 + +int +inet_aton(const char *cp, struct in_addr *addr) +{ + u_long parts[4]; + in_addr_t val; + const char *c; + char *endptr; + int gotend, n; + + c = (const char *)cp; + n = 0; + + /* + * Run through the string, grabbing numbers until + * the end of the string, or some error + */ + gotend = 0; + while (!gotend) { + unsigned long l; + + l = strtoul(c, &endptr, 0); + + if (l == ULONG_MAX || (l == 0 && endptr == c)) + return (0); + + val = (in_addr_t)l; + + /* + * If the whole string is invalid, endptr will equal + * c.. this way we can make sure someone hasn't + * gone '.12' or something which would get past + * the next check. + */ + if (endptr == c) + return (0); + parts[n] = val; + c = endptr; + + /* Check the next character past the previous number's end */ + switch (*c) { + case '.' : + + /* Make sure we only do 3 dots .. */ + if (n == 3) /* Whoops. Quit. */ + return (0); + n++; + c++; + break; + + case '\0': + gotend = 1; + break; + + default: + if (isspace((unsigned char)*c)) { + gotend = 1; + break; + } else { + + /* Invalid character, then fail. */ + return (0); + } + } + + } + + /* Concoct the address according to the number of parts specified. */ + switch (n) { + case 0: /* a -- 32 bits */ + + /* + * Nothing is necessary here. Overflow checking was + * already done in strtoul(). + */ + break; + case 1: /* a.b -- 8.24 bits */ + if (val > 0xffffff || parts[0] > 0xff) + return (0); + val |= parts[0] << 24; + break; + + case 2: /* a.b.c -- 8.8.16 bits */ + if (val > 0xffff || parts[0] > 0xff || parts[1] > 0xff) + return (0); + val |= (parts[0] << 24) | (parts[1] << 16); + break; + + case 3: /* a.b.c.d -- 8.8.8.8 bits */ + if (val > 0xff || parts[0] > 0xff || parts[1] > 0xff || + parts[2] > 0xff) + return (0); + val |= (parts[0] << 24) | (parts[1] << 16) | (parts[2] << 8); + break; + } + + if (addr != NULL) + addr->s_addr = htonl(val); + return (1); +} + Modified: stable/8/sys/netinet/in.h ============================================================================== --- stable/8/sys/netinet/in.h Sun Nov 22 15:57:08 2009 (r199650) +++ stable/8/sys/netinet/in.h Sun Nov 22 16:04:49 2009 (r199651) @@ -733,6 +733,7 @@ int in_broadcast(struct in_addr, struct int in_canforward(struct in_addr); int in_localaddr(struct in_addr); int in_localip(struct in_addr); +int inet_aton(const char *, struct in_addr *); /* in libkern */ char *inet_ntoa(struct in_addr); /* in libkern */ char *inet_ntoa_r(struct in_addr ina, char *buf); /* in libkern */ void in_ifdetach(struct ifnet *); Modified: stable/8/sys/netinet/libalias/alias_proxy.c ============================================================================== --- stable/8/sys/netinet/libalias/alias_proxy.c Sun Nov 22 15:57:08 2009 (r199650) +++ stable/8/sys/netinet/libalias/alias_proxy.c Sun Nov 22 16:04:49 2009 (r199651) @@ -137,9 +137,6 @@ struct proxy_entry { destination of a proxied IP packet */ -#ifdef _KERNEL /* XXX: can it be moved to libkern? */ -static int inet_aton(const char *cp, struct in_addr *addr); -#endif static int IpMask(int, struct in_addr *); static int IpAddr(char *, struct in_addr *); static int IpPort(char *, int, int *); @@ -149,107 +146,6 @@ static int RuleNumberDelete(struct libal static void ProxyEncodeTcpStream(struct alias_link *, struct ip *, int); static void ProxyEncodeIpHeader(struct ip *, int); -#ifdef _KERNEL -static int -inet_aton(cp, addr) - const char *cp; - struct in_addr *addr; -{ - u_long parts[4]; - in_addr_t val; - const char *c; - char *endptr; - int gotend, n; - - c = (const char *)cp; - n = 0; - /* - * Run through the string, grabbing numbers until - * the end of the string, or some error - */ - gotend = 0; - while (!gotend) { - unsigned long l; - - l = strtoul(c, &endptr, 0); - - if (l == ULONG_MAX || (l == 0 && endptr == c)) - return (0); - - val = (in_addr_t)l; - /* - * If the whole string is invalid, endptr will equal - * c.. this way we can make sure someone hasn't - * gone '.12' or something which would get past - * the next check. - */ - if (endptr == c) - return (0); - parts[n] = val; - c = endptr; - - /* Check the next character past the previous number's end */ - switch (*c) { - case '.' : - /* Make sure we only do 3 dots .. */ - if (n == 3) /* Whoops. Quit. */ - return (0); - n++; - c++; - break; - - case '\0': - gotend = 1; - break; - - default: - if (isspace((unsigned char)*c)) { - gotend = 1; - break; - } else - return (0); /* Invalid character, so fail */ - } - - } - - /* - * Concoct the address according to - * the number of parts specified. - */ - - switch (n) { - case 0: /* a -- 32 bits */ - /* - * Nothing is necessary here. Overflow checking was - * already done in strtoul(). - */ - break; - case 1: /* a.b -- 8.24 bits */ - if (val > 0xffffff || parts[0] > 0xff) - return (0); - val |= parts[0] << 24; - break; - - case 2: /* a.b.c -- 8.8.16 bits */ - if (val > 0xffff || parts[0] > 0xff || parts[1] > 0xff) - return (0); - val |= (parts[0] << 24) | (parts[1] << 16); - break; - - case 3: /* a.b.c.d -- 8.8.8.8 bits */ - if (val > 0xff || parts[0] > 0xff || parts[1] > 0xff || - parts[2] > 0xff) - return (0); - val |= (parts[0] << 24) | (parts[1] << 16) | (parts[2] << 8); - break; - } - - if (addr != NULL) - addr->s_addr = htonl(val); - return (1); -} -#endif - static int IpMask(int nbits, struct in_addr *mask) { From owner-svn-src-all@FreeBSD.ORG Sun Nov 22 16:09:28 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 490131065670; Sun, 22 Nov 2009 16:09:28 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1DE3B8FC12; Sun, 22 Nov 2009 16:09:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAMG9RNe022882; Sun, 22 Nov 2009 16:09:27 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAMG9REa022880; Sun, 22 Nov 2009 16:09:27 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <200911221609.nAMG9REa022880@svn.freebsd.org> From: Attilio Rao Date: Sun, 22 Nov 2009 16:09:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199652 - stable/8/sys/fs/fifofs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Nov 2009 16:09:28 -0000 Author: attilio Date: Sun Nov 22 16:09:27 2009 New Revision: 199652 URL: http://svn.freebsd.org/changeset/base/199652 Log: MFC r199007: Fix a memory leak. Modified: stable/8/sys/fs/fifofs/fifo_vnops.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/fs/fifofs/fifo_vnops.c ============================================================================== --- stable/8/sys/fs/fifofs/fifo_vnops.c Sun Nov 22 16:04:49 2009 (r199651) +++ stable/8/sys/fs/fifofs/fifo_vnops.c Sun Nov 22 16:09:27 2009 (r199652) @@ -78,6 +78,10 @@ struct fileops fifo_ops_f = { /* * This structure is associated with the FIFO vnode and stores * the state associated with the FIFO. + * Notes about locking: + * - fi_readsock and fi_writesock are invariant since init time. + * - fi_readers and fi_writers are vnode lock protected. + * - fi_wgen is fif_mtx lock protected. */ struct fifoinfo { struct socket *fi_readsock; @@ -215,14 +219,9 @@ fail1: } /* - * General access to fi_readers and fi_writers is protected using - * the vnode lock. - * - * Protect the increment of fi_readers and fi_writers and the - * associated calls to wakeup() with the fifo mutex in addition - * to the vnode lock. This allows the vnode lock to be dropped - * for the msleep() calls below, and using the fifo mutex with - * msleep() prevents the wakeup from being missed. + * Use the fifo_mtx lock here, in addition to the vnode lock, + * in order to allow vnode lock dropping before msleep() calls + * and still avoiding missed wakeups. */ mtx_lock(&fifo_mtx); if (ap->a_mode & FREAD) { @@ -241,6 +240,8 @@ fail1: if (ap->a_mode & FWRITE) { if ((ap->a_mode & O_NONBLOCK) && fip->fi_readers == 0) { mtx_unlock(&fifo_mtx); + if (fip->fi_writers == 0) + fifo_cleanup(vp); return (ENXIO); } fip->fi_writers++; From owner-svn-src-all@FreeBSD.ORG Sun Nov 22 16:11:20 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DBF2B106566C; Sun, 22 Nov 2009 16:11:20 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CA6BF8FC1B; Sun, 22 Nov 2009 16:11:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAMGBKsp022982; Sun, 22 Nov 2009 16:11:20 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAMGBKpO022980; Sun, 22 Nov 2009 16:11:20 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <200911221611.nAMGBKpO022980@svn.freebsd.org> From: Attilio Rao Date: Sun, 22 Nov 2009 16:11:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199653 - stable/8/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Nov 2009 16:11:21 -0000 Author: attilio Date: Sun Nov 22 16:11:20 2009 New Revision: 199653 URL: http://svn.freebsd.org/changeset/base/199653 Log: MFC r199008: Track lockmgr_disown() in the stack. Modified: stable/8/sys/kern/kern_lock.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/kern/kern_lock.c ============================================================================== --- stable/8/sys/kern/kern_lock.c Sun Nov 22 16:09:27 2009 (r199652) +++ stable/8/sys/kern/kern_lock.c Sun Nov 22 16:11:20 2009 (r199653) @@ -1083,6 +1083,7 @@ _lockmgr_disown(struct lock *lk, const c LOCK_LOG_LOCK("XDISOWN", &lk->lock_object, 0, 0, file, line); WITNESS_UNLOCK(&lk->lock_object, LOP_EXCLUSIVE, file, line); TD_LOCKS_DEC(curthread); + STACK_SAVE(lk); /* * In order to preserve waiters flags, just spin. From owner-svn-src-all@FreeBSD.ORG Sun Nov 22 16:13:16 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B661D106566B; Sun, 22 Nov 2009 16:13:16 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A497F8FC08; Sun, 22 Nov 2009 16:13:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAMGDGkk023060; Sun, 22 Nov 2009 16:13:16 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAMGDGtb023058; Sun, 22 Nov 2009 16:13:16 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <200911221613.nAMGDGtb023058@svn.freebsd.org> From: Attilio Rao Date: Sun, 22 Nov 2009 16:13:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199654 - stable/8/usr.bin/kdump X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Nov 2009 16:13:16 -0000 Author: attilio Date: Sun Nov 22 16:13:16 2009 New Revision: 199654 URL: http://svn.freebsd.org/changeset/base/199654 Log: MFC r199024: Use a safety belt for cases where corrupted narg can be passed to the ktrsyscall(). Modified: stable/8/usr.bin/kdump/kdump.c Directory Properties: stable/8/usr.bin/kdump/ (props changed) Modified: stable/8/usr.bin/kdump/kdump.c ============================================================================== --- stable/8/usr.bin/kdump/kdump.c Sun Nov 22 16:11:20 2009 (r199653) +++ stable/8/usr.bin/kdump/kdump.c Sun Nov 22 16:13:16 2009 (r199654) @@ -799,7 +799,7 @@ ktrsyscall(struct ktr_syscall *ktr) narg--; } } - while (narg) { + while (narg > 0) { print_number(ip,narg,c); } (void)putchar(')'); From owner-svn-src-all@FreeBSD.ORG Sun Nov 22 16:51:44 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 590C110656C3; Sun, 22 Nov 2009 16:51:44 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 486878FC16; Sun, 22 Nov 2009 16:51:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAMGpiEp023875; Sun, 22 Nov 2009 16:51:44 GMT (envelope-from ume@svn.freebsd.org) Received: (from ume@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAMGpiIO023873; Sun, 22 Nov 2009 16:51:44 GMT (envelope-from ume@svn.freebsd.org) Message-Id: <200911221651.nAMGpiIO023873@svn.freebsd.org> From: Hajimu UMEMOTO Date: Sun, 22 Nov 2009 16:51:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199655 - head/usr.bin/w X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Nov 2009 16:51:44 -0000 Author: ume Date: Sun Nov 22 16:51:44 2009 New Revision: 199655 URL: http://svn.freebsd.org/changeset/base/199655 Log: When -n is specified, attempt to turn hostnames found in utmp into IP addresses, again. However, change a hostname into an IP address, only when a host has just one A/AAAA RR. Requested by: candy__at__kgc.co.jp MFC after: 2 weeks Modified: head/usr.bin/w/w.c Modified: head/usr.bin/w/w.c ============================================================================== --- head/usr.bin/w/w.c Sun Nov 22 16:13:16 2009 (r199654) +++ head/usr.bin/w/w.c Sun Nov 22 16:51:44 2009 (r199655) @@ -348,6 +348,7 @@ main(int argc, char *argv[]) for (ep = ehead; ep != NULL; ep = ep->next) { char host_buf[UT_HOSTSIZE + 1]; + struct addrinfo hints, *res; struct sockaddr_storage ss; struct sockaddr *sa = (struct sockaddr *)&ss; struct sockaddr_in *lsin = (struct sockaddr_in *)&ss; @@ -365,23 +366,42 @@ main(int argc, char *argv[]) else x_suffix = NULL; } + + isaddr = 0; + memset(&ss, '\0', sizeof(ss)); + if (inet_pton(AF_INET6, p, &lsin6->sin6_addr) == 1) { + lsin6->sin6_len = sizeof(*lsin6); + lsin6->sin6_family = AF_INET6; + isaddr = 1; + } else if (inet_pton(AF_INET, p, &lsin->sin_addr) == 1) { + lsin->sin_len = sizeof(*lsin); + lsin->sin_family = AF_INET; + isaddr = 1; + } if (!nflag) { /* Attempt to change an IP address into a name */ - isaddr = 0; - memset(&ss, '\0', sizeof(ss)); - if (inet_pton(AF_INET6, p, &lsin6->sin6_addr) == 1) { - lsin6->sin6_len = sizeof(*lsin6); - lsin6->sin6_family = AF_INET6; - isaddr = 1; - } else if (inet_pton(AF_INET, p, &lsin->sin_addr) == 1) { - lsin->sin_len = sizeof(*lsin); - lsin->sin_family = AF_INET; - isaddr = 1; - } if (isaddr && realhostname_sa(fn, sizeof(fn), sa, sa->sa_len) == HOSTNAME_FOUND) p = fn; + } else if (!isaddr) { + /* + * If a host has only one A/AAAA RR, change a + * name into an IP address + */ + memset(&hints, 0, sizeof(hints)); + hints.ai_flags = AI_PASSIVE; + hints.ai_family = AF_UNSPEC; + hints.ai_socktype = SOCK_STREAM; + if (getaddrinfo(p, NULL, &hints, &res) == 0) { + if (res->ai_next == NULL && + getnameinfo(res->ai_addr, res->ai_addrlen, + fn, sizeof(fn), NULL, 0, + NI_NUMERICHOST) == 0) + p = fn; + freeaddrinfo(res); + } } + if (x_suffix) { (void)snprintf(buf, sizeof(buf), "%s:%s", p, x_suffix); p = buf; From owner-svn-src-all@FreeBSD.ORG Sun Nov 22 17:05:46 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A20941065672; Sun, 22 Nov 2009 17:05:46 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 902588FC13; Sun, 22 Nov 2009 17:05:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAMH5khn024225; Sun, 22 Nov 2009 17:05:46 GMT (envelope-from ume@svn.freebsd.org) Received: (from ume@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAMH5kP4024222; Sun, 22 Nov 2009 17:05:46 GMT (envelope-from ume@svn.freebsd.org) Message-Id: <200911221705.nAMH5kP4024222@svn.freebsd.org> From: Hajimu UMEMOTO Date: Sun, 22 Nov 2009 17:05:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199656 - in stable/8/lib/libc: net nls X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Nov 2009 17:05:46 -0000 Author: ume Date: Sun Nov 22 17:05:46 2009 New Revision: 199656 URL: http://svn.freebsd.org/changeset/base/199656 Log: MFC r199083: Add NLS catalogs support to gai_strerror(3). Controlled by NLS define. Modified: stable/8/lib/libc/net/gai_strerror.c stable/8/lib/libc/nls/C.msg Directory Properties: stable/8/lib/libc/ (props changed) stable/8/lib/libc/stdtime/ (props changed) Modified: stable/8/lib/libc/net/gai_strerror.c ============================================================================== --- stable/8/lib/libc/net/gai_strerror.c Sun Nov 22 16:51:44 2009 (r199655) +++ stable/8/lib/libc/net/gai_strerror.c Sun Nov 22 17:05:46 2009 (r199656) @@ -30,7 +30,17 @@ #include __FBSDID("$FreeBSD$"); +#include "namespace.h" #include +#if defined(NLS) +#include +#include +#include +#include +#include +#include "reentrant.h" +#endif +#include "un-namespace.h" /* Entries EAI_ADDRFAMILY (1) and EAI_NODATA (7) are obsoleted, but left */ /* for backward compatibility with userland code prior to 2553bis-02 */ @@ -52,9 +62,57 @@ static const char *ai_errlist[] = { "Argument buffer overflow" /* EAI_OVERFLOW */ }; +#if defined(NLS) +static char gai_buf[NL_TEXTMAX]; +static once_t gai_init_once = ONCE_INITIALIZER; +static thread_key_t gai_key; +static int gai_keycreated = 0; + +static void +gai_keycreate(void) +{ + gai_keycreated = (thr_keycreate(&gai_key, free) == 0); +} +#endif + const char * gai_strerror(int ecode) { +#if defined(NLS) + nl_catd catd; + char *buf; + + if (thr_main() != 0) + buf = gai_buf; + else { + if (thr_once(&gai_init_once, gai_keycreate) != 0 || + !gai_keycreated) + goto thr_err; + if ((buf = thr_getspecific(gai_key)) == NULL) { + if ((buf = malloc(sizeof(gai_buf))) == NULL) + goto thr_err; + if (thr_setspecific(gai_key, buf) != 0) { + free(buf); + goto thr_err; + } + } + } + + catd = catopen("libc", NL_CAT_LOCALE); + if (ecode > 0 && ecode < EAI_MAX) + strlcpy(buf, catgets(catd, 3, ecode, ai_errlist[ecode]), + sizeof(gai_buf)); + else if (ecode == 0) + strlcpy(buf, catgets(catd, 3, NL_MSGMAX - 1, "Success"), + sizeof(gai_buf)); + else + strlcpy(buf, catgets(catd, 3, NL_MSGMAX, "Unknown error"), + sizeof(gai_buf)); + catclose(catd); + return buf; + +thr_err: +#endif if (ecode >= 0 && ecode < EAI_MAX) return ai_errlist[ecode]; return "Unknown error"; Modified: stable/8/lib/libc/nls/C.msg ============================================================================== --- stable/8/lib/libc/nls/C.msg Sun Nov 22 16:51:44 2009 (r199655) +++ stable/8/lib/libc/nls/C.msg Sun Nov 22 17:05:46 2009 (r199656) @@ -247,3 +247,39 @@ $ SIGUSR1 30 User defined signal 1 $ SIGUSR2 31 User defined signal 2 +$ +$ gai_strerror() support catalog +$ +$set 3 +$ 1 (obsolete) +1 Address family for hostname not supported +$ EAI_AGAIN +2 Temporary failure in name resolution +$ EAI_BADFLAGS +3 Invalid value for ai_flags +$ EAI_FAIL +4 Non-recoverable failure in name resolution +$ EAI_FAMILY +5 ai_family not supported +$ EAI_MEMORY +6 Memory allocation failure +$ 7 (obsolete) +7 No address associated with hostname +$ EAI_NONAME +8 hostname nor servname provided, or not known +$ EAI_SERVICE +9 servname not supported for ai_socktype +$ EAI_SOCKTYPE +10 ai_socktype not supported +$ EAI_SYSTEM +11 System error returned in errno +$ EAI_BADHINTS +12 Invalid value for hints +$ EAI_PROTOCOL +13 Resolved protocol is unknown +$ EAI_OVERFLOW +14 Argument buffer overflow +$ 0 +32766 Success +$ NL_MSGMAX +32767 Unknown error From owner-svn-src-all@FreeBSD.ORG Sun Nov 22 17:08:53 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 15D781065670; Sun, 22 Nov 2009 17:08:53 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DEBD98FC1D; Sun, 22 Nov 2009 17:08:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAMH8qv1024319; Sun, 22 Nov 2009 17:08:52 GMT (envelope-from ume@svn.freebsd.org) Received: (from ume@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAMH8qQu024316; Sun, 22 Nov 2009 17:08:52 GMT (envelope-from ume@svn.freebsd.org) Message-Id: <200911221708.nAMH8qQu024316@svn.freebsd.org> From: Hajimu UMEMOTO Date: Sun, 22 Nov 2009 17:08:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199657 - stable/8/lib/libc/nls X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Nov 2009 17:08:53 -0000 Author: ume Date: Sun Nov 22 17:08:52 2009 New Revision: 199657 URL: http://svn.freebsd.org/changeset/base/199657 Log: MFC r199092: Add gai_strerror() catalog for ja_JP.UTF-8 and ja_JP.eucJP. Modified: stable/8/lib/libc/nls/ja_JP.UTF-8.msg stable/8/lib/libc/nls/ja_JP.eucJP.msg Directory Properties: stable/8/lib/libc/ (props changed) stable/8/lib/libc/stdtime/ (props changed) Modified: stable/8/lib/libc/nls/ja_JP.UTF-8.msg ============================================================================== --- stable/8/lib/libc/nls/ja_JP.UTF-8.msg Sun Nov 22 17:05:46 2009 (r199656) +++ stable/8/lib/libc/nls/ja_JP.UTF-8.msg Sun Nov 22 17:08:52 2009 (r199657) @@ -247,3 +247,39 @@ $ SIGUSR1 30 ユーザ定義シグナル 1 $ SIGUSR2 31 ユーザ定義シグナル 2 +$ +$ gai_strerror() support catalog +$ +$set 3 +$ 1 (obsolete) +1 ホストåã®ã‚¢ãƒ‰ãƒ¬ã‚¹ãƒ•ã‚¡ãƒŸãƒªãƒ¼ã¯ã‚µãƒãƒ¼ãƒˆã•ã‚Œã¾ã›ã‚“ +$ EAI_AGAIN +2 åå‰è§£æ±ºã§ã®ä¸€æ™‚çš„ãªå¤±æ•— +$ EAI_BADFLAGS +3 ai_flags ã®å€¤ãŒç„¡åŠ¹ +$ EAI_FAIL +4 åå‰è§£æ±ºã§ã®å›žå¾©ä¸èƒ½ãªå¤±æ•— +$ EAI_FAMILY +5 ai_family ã¯ã‚µãƒãƒ¼ãƒˆã•ã‚Œã¾ã›ã‚“ +$ EAI_MEMORY +6 メモリ割り当ã¦å¤±æ•— +$ 7 (obsolete) +7 ホストåã«å¯¾å¿œã™ã‚‹ã‚¢ãƒ‰ãƒ¬ã‚¹ã¯ã‚ã‚Šã¾ã›ã‚“ +$ EAI_NONAME +8 ホストåã‹ã‚µãƒ¼ãƒ“スåãŒæŒ‡å®šã•ã‚Œãªã„ã€ã¾ãŸã¯ä¸æ˜Ž +$ EAI_SERVICE +9 サービスå㯠ai_socktype ã«å¯¾ã—ã¦ã‚µãƒãƒ¼ãƒˆã•ã‚Œã¾ã›ã‚“ +$ EAI_SOCKTYPE +10 ai_socktype ã¯ã‚µãƒãƒ¼ãƒˆã•ã‚Œã¾ã›ã‚“ +$ EAI_SYSTEM +11 システムエラーã€errno å‚ç…§ +$ EAI_BADHINTS +12 hints ã®å€¤ãŒç„¡åŠ¹ +$ EAI_PROTOCOL +13 解決ã•ã‚ŒãŸãƒ—ロトコルã¯ä¸æ˜Žã§ã™ +$ EAI_OVERFLOW +14 引数ãƒãƒƒãƒ•ã‚¡ã‚ªãƒ¼ãƒãƒ•ãƒ­ãƒ¼ +$ 0 +32766 æˆåŠŸ +$ NL_MSGMAX +32767 ä¸æ˜Žãªã‚¨ãƒ©ãƒ¼ Modified: stable/8/lib/libc/nls/ja_JP.eucJP.msg ============================================================================== --- stable/8/lib/libc/nls/ja_JP.eucJP.msg Sun Nov 22 17:05:46 2009 (r199656) +++ stable/8/lib/libc/nls/ja_JP.eucJP.msg Sun Nov 22 17:08:52 2009 (r199657) @@ -247,3 +247,39 @@ $ SIGUSR1 30 ¥æ¡¼¥¶ÄêµÁ¥·¥°¥Ê¥ë 1 $ SIGUSR2 31 ¥æ¡¼¥¶ÄêµÁ¥·¥°¥Ê¥ë 2 +$ +$ gai_strerror() support catalog +$ +$set 3 +$ 1 (obsolete) +1 ¥Û¥¹¥È̾¤Î¥¢¥É¥ì¥¹¥Õ¥¡¥ß¥ê¡¼¤Ï¥µ¥Ý¡¼¥È¤µ¤ì¤Þ¤»¤ó +$ EAI_AGAIN +2 ̾Á°²ò·è¤Ç¤Î°ì»þŪ¤Ê¼ºÇÔ +$ EAI_BADFLAGS +3 ai_flags ¤ÎÃͤ¬Ìµ¸ú +$ EAI_FAIL +4 ̾Á°²ò·è¤Ç¤Î²óÉüÉÔǽ¤Ê¼ºÇÔ +$ EAI_FAMILY +5 ai_family ¤Ï¥µ¥Ý¡¼¥È¤µ¤ì¤Þ¤»¤ó +$ EAI_MEMORY +6 ¥á¥â¥ê³ä¤êÅö¤Æ¼ºÇÔ +$ 7 (obsolete) +7 ¥Û¥¹¥È̾¤ËÂбþ¤¹¤ë¥¢¥É¥ì¥¹¤Ï¤¢¤ê¤Þ¤»¤ó +$ EAI_NONAME +8 ¥Û¥¹¥È̾¤«¥µ¡¼¥Ó¥¹Ì¾¤¬»ØÄꤵ¤ì¤Ê¤¤¡¢¤Þ¤¿¤ÏÉÔÌÀ +$ EAI_SERVICE +9 ¥µ¡¼¥Ó¥¹Ì¾¤Ï ai_socktype ¤ËÂФ·¤Æ¥µ¥Ý¡¼¥È¤µ¤ì¤Þ¤»¤ó +$ EAI_SOCKTYPE +10 ai_socktype ¤Ï¥µ¥Ý¡¼¥È¤µ¤ì¤Þ¤»¤ó +$ EAI_SYSTEM +11 ¥·¥¹¥Æ¥à¥¨¥é¡¼¡¢errno »²¾È +$ EAI_BADHINTS +12 hints ¤ÎÃͤ¬Ìµ¸ú +$ EAI_PROTOCOL +13 ²ò·è¤µ¤ì¤¿¥×¥í¥È¥³¥ë¤ÏÉÔÌÀ¤Ç¤¹ +$ EAI_OVERFLOW +14 °ú¿ô¥Ð¥Ã¥Õ¥¡¥ª¡¼¥Ð¥Õ¥í¡¼ +$ 0 +32766 À®¸ù +$ NL_MSGMAX +32767 ÉÔÌÀ¤Ê¥¨¥é¡¼ From owner-svn-src-all@FreeBSD.ORG Sun Nov 22 17:16:38 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 209AC1065670; Sun, 22 Nov 2009 17:16:38 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0F69C8FC08; Sun, 22 Nov 2009 17:16:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAMHGb4q024535; Sun, 22 Nov 2009 17:16:37 GMT (envelope-from ume@svn.freebsd.org) Received: (from ume@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAMHGbKK024532; Sun, 22 Nov 2009 17:16:37 GMT (envelope-from ume@svn.freebsd.org) Message-Id: <200911221716.nAMHGbKK024532@svn.freebsd.org> From: Hajimu UMEMOTO Date: Sun, 22 Nov 2009 17:16:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199658 - stable/8/usr.bin/systat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Nov 2009 17:16:38 -0000 Author: ume Date: Sun Nov 22 17:16:37 2009 New Revision: 199658 URL: http://svn.freebsd.org/changeset/base/199658 Log: MFC r199242: Use ncursesw to output the date field of vmstat display with multi-byte string, correctly. Modified: stable/8/usr.bin/systat/Makefile stable/8/usr.bin/systat/main.c Directory Properties: stable/8/usr.bin/systat/ (props changed) Modified: stable/8/usr.bin/systat/Makefile ============================================================================== --- stable/8/usr.bin/systat/Makefile Sun Nov 22 17:08:52 2009 (r199657) +++ stable/8/usr.bin/systat/Makefile Sun Nov 22 17:16:37 2009 (r199658) @@ -15,6 +15,6 @@ CFLAGS+= -DINET6 .endif DPADD= ${LIBCURSES} ${LIBM} ${LIBDEVSTAT} ${LIBKVM} -LDADD= -lcurses -lm -ldevstat -lkvm +LDADD= -lcursesw -lm -ldevstat -lkvm .include Modified: stable/8/usr.bin/systat/main.c ============================================================================== --- stable/8/usr.bin/systat/main.c Sun Nov 22 17:08:52 2009 (r199657) +++ stable/8/usr.bin/systat/main.c Sun Nov 22 17:16:37 2009 (r199658) @@ -87,7 +87,7 @@ main(int argc, char **argv) char errbuf[_POSIX2_LINE_MAX], dummy; size_t size; - (void) setlocale(LC_TIME, ""); + (void) setlocale(LC_ALL, ""); argc--, argv++; while (argc > 0) { From owner-svn-src-all@FreeBSD.ORG Sun Nov 22 17:25:11 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 987BC106566C; Sun, 22 Nov 2009 17:25:11 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6D2798FC13; Sun, 22 Nov 2009 17:25:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAMHPBd3024767; Sun, 22 Nov 2009 17:25:11 GMT (envelope-from ume@svn.freebsd.org) Received: (from ume@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAMHPBaf024763; Sun, 22 Nov 2009 17:25:11 GMT (envelope-from ume@svn.freebsd.org) Message-Id: <200911221725.nAMHPBaf024763@svn.freebsd.org> From: Hajimu UMEMOTO Date: Sun, 22 Nov 2009 17:25:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199659 - stable/8/share/timedef X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Nov 2009 17:25:11 -0000 Author: ume Date: Sun Nov 22 17:25:11 2009 New Revision: 199659 URL: http://svn.freebsd.org/changeset/base/199659 Log: MFC r199179, r199271: - Add unit to the short month names for Japanese locales. Without unit, the output of the application like ls(1) is complicated. - Since %b contains unit, %b is not suitable for c_fmt, now. Use %_m instead. Modified: stable/8/share/timedef/ja_JP.SJIS.src stable/8/share/timedef/ja_JP.UTF-8.src stable/8/share/timedef/ja_JP.eucJP.src Directory Properties: stable/8/share/timedef/ (props changed) Modified: stable/8/share/timedef/ja_JP.SJIS.src ============================================================================== --- stable/8/share/timedef/ja_JP.SJIS.src Sun Nov 22 17:16:37 2009 (r199658) +++ stable/8/share/timedef/ja_JP.SJIS.src Sun Nov 22 17:25:11 2009 (r199659) @@ -5,18 +5,18 @@ # # Short month names # - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 -10 -11 -12 + 1ŒŽ + 2ŒŽ + 3ŒŽ + 4ŒŽ + 5ŒŽ + 6ŒŽ + 7ŒŽ + 8ŒŽ + 9ŒŽ +10ŒŽ +11ŒŽ +12ŒŽ # # Long month names (as in a date) # @@ -65,7 +65,7 @@ # # just following tradition... # %a %b %e %H:%M:%S %Y -%a %b/%e %T %Y +%a %_m/%e %T %Y # # am # Modified: stable/8/share/timedef/ja_JP.UTF-8.src ============================================================================== --- stable/8/share/timedef/ja_JP.UTF-8.src Sun Nov 22 17:16:37 2009 (r199658) +++ stable/8/share/timedef/ja_JP.UTF-8.src Sun Nov 22 17:25:11 2009 (r199659) @@ -4,18 +4,18 @@ # WARNING: empty lines are essential too # # Short month names - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 -10 -11 -12 + 1月 + 2月 + 3月 + 4月 + 5月 + 6月 + 7月 + 8月 + 9月 +10月 +11月 +12月 # # Long month names (as in a date) # @@ -64,7 +64,7 @@ # # just following tradition... # %a %b %e %H:%M:%S %Y -%a %b/%e %T %Y +%a %_m/%e %T %Y # # am # Modified: stable/8/share/timedef/ja_JP.eucJP.src ============================================================================== --- stable/8/share/timedef/ja_JP.eucJP.src Sun Nov 22 17:16:37 2009 (r199658) +++ stable/8/share/timedef/ja_JP.eucJP.src Sun Nov 22 17:25:11 2009 (r199659) @@ -4,18 +4,18 @@ # WARNING: empty lines are essential too # # Short month names - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 -10 -11 -12 + 1·î + 2·î + 3·î + 4·î + 5·î + 6·î + 7·î + 8·î + 9·î +10·î +11·î +12·î # # Long month names (as in a date) # @@ -64,7 +64,7 @@ # # just following tradition... # %a %b %e %H:%M:%S %Y -%a %b/%e %T %Y +%a %_m/%e %T %Y # # am # From owner-svn-src-all@FreeBSD.ORG Sun Nov 22 18:23:31 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4AB12106566C; Sun, 22 Nov 2009 18:23:31 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 39A2F8FC0C; Sun, 22 Nov 2009 18:23:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAMINV9O025965; Sun, 22 Nov 2009 18:23:31 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAMINVL5025958; Sun, 22 Nov 2009 18:23:31 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <200911221823.nAMINVL5025958@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 22 Nov 2009 18:23:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199660 - head/bin/sh X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Nov 2009 18:23:31 -0000 Author: jilles Date: Sun Nov 22 18:23:30 2009 New Revision: 199660 URL: http://svn.freebsd.org/changeset/base/199660 Log: Fix various things about SIGINT handling: * exception handlers are now run with interrupts disabled, which avoids many race conditions * fix some cases where SIGINT only aborts one command and continues the script, in particular if a SIGINT causes an EINTR error which trumped the interrupt. Example: sh -c 'echo < /some/fifo; echo This should not be printed' The fifo should not have writers. When pressing ctrl+c to abort the open, the shell used to continue with the next command. Example: sh -c '/bin/echo < /some/fifo; echo This should not be printed' Similar. Note, however, that this particular case did not and does not work in interactive mode with job control enabled. Modified: head/bin/sh/error.c head/bin/sh/error.h head/bin/sh/eval.c head/bin/sh/parser.c head/bin/sh/redir.c head/bin/sh/var.c Modified: head/bin/sh/error.c ============================================================================== --- head/bin/sh/error.c Sun Nov 22 17:25:11 2009 (r199659) +++ head/bin/sh/error.c Sun Nov 22 18:23:30 2009 (r199660) @@ -73,11 +73,15 @@ static void exverror(int, const char *, * Called to raise an exception. Since C doesn't include exceptions, we * just do a longjmp to the exception handler. The type of exception is * stored in the global variable "exception". + * + * Interrupts are disabled; they should be reenabled when the exception is + * caught. */ void exraise(int e) { + INTOFF; if (handler == NULL) abort(); exception = e; @@ -138,8 +142,15 @@ onint(void) static void exverror(int cond, const char *msg, va_list ap) { - CLEAR_PENDING_INT; - INTOFF; + /* + * An interrupt trumps an error. Certain places catch error + * exceptions or transform them to a plain nonzero exit code + * in child processes, and if an error exception can be handled, + * an interrupt can be handled as well. + * + * exraise() will disable interrupts for the exception handler. + */ + FORCEINTON; #ifdef DEBUG if (msg) Modified: head/bin/sh/error.h ============================================================================== --- head/bin/sh/error.h Sun Nov 22 17:25:11 2009 (r199659) +++ head/bin/sh/error.h Sun Nov 22 18:23:30 2009 (r199660) @@ -72,6 +72,8 @@ extern volatile sig_atomic_t intpending; #define INTOFF suppressint++ #define INTON { if (--suppressint == 0 && intpending) onint(); } +#define is_int_on() suppressint +#define SETINTON(s) suppressint = (s) #define FORCEINTON {suppressint = 0; if (intpending) onint();} #define CLEAR_PENDING_INT intpending = 0 #define int_pending() intpending Modified: head/bin/sh/eval.c ============================================================================== --- head/bin/sh/eval.c Sun Nov 22 17:25:11 2009 (r199659) +++ head/bin/sh/eval.c Sun Nov 22 18:23:30 2009 (r199660) @@ -782,7 +782,6 @@ evalcommand(union node *cmd, int flags, savelocalvars = localvars; localvars = NULL; reffunc(cmdentry.u.func); - INTON; savehandler = handler; if (setjmp(jmploc.loc)) { if (exception == EXSHELLPROC) @@ -798,6 +797,7 @@ evalcommand(union node *cmd, int flags, longjmp(handler->loc, 1); } handler = &jmploc; + INTON; for (sp = varlist.list ; sp ; sp = sp->next) mklocal(sp->text); funcnest++; Modified: head/bin/sh/parser.c ============================================================================== --- head/bin/sh/parser.c Sun Nov 22 17:25:11 2009 (r199659) +++ head/bin/sh/parser.c Sun Nov 22 18:23:30 2009 (r199660) @@ -1312,6 +1312,7 @@ parsebackq: { int saveprompt; const int bq_startlinno = plinno; + str = NULL; if (setjmp(jmploc.loc)) { if (str) ckfree(str); @@ -1323,7 +1324,6 @@ parsebackq: { longjmp(handler->loc, 1); } INTOFF; - str = NULL; savelen = out - stackblock(); if (savelen > 0) { str = ckmalloc(savelen); Modified: head/bin/sh/redir.c ============================================================================== --- head/bin/sh/redir.c Sun Nov 22 17:25:11 2009 (r199659) +++ head/bin/sh/redir.c Sun Nov 22 18:23:30 2009 (r199660) @@ -166,8 +166,11 @@ openredirect(union node *redir, char mem /* * We suppress interrupts so that we won't leave open file - * descriptors around. This may not be such a good idea because - * an open of a device or a fifo can block indefinitely. + * descriptors around. Because the signal handler remains + * installed and we do not use system call restart, interrupts + * will still abort blocking opens such as fifos (they will fail + * with EINTR). There is, however, a race condition if an interrupt + * arrives after INTOFF and before open blocks. */ INTOFF; memory[fd] = 0; Modified: head/bin/sh/var.c ============================================================================== --- head/bin/sh/var.c Sun Nov 22 17:25:11 2009 (r199659) +++ head/bin/sh/var.c Sun Nov 22 18:23:30 2009 (r199660) @@ -195,7 +195,9 @@ setvarsafe(char *name, char *val, int fl struct jmploc jmploc; struct jmploc *const savehandler = handler; int err = 0; + int inton; + inton = is_int_on(); if (setjmp(jmploc.loc)) err = 1; else { @@ -203,6 +205,7 @@ setvarsafe(char *name, char *val, int fl setvar(name, val, flags); } handler = savehandler; + SETINTON(inton); return err; } From owner-svn-src-all@FreeBSD.ORG Sun Nov 22 18:30:19 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C1FAA1065670; Sun, 22 Nov 2009 18:30:19 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B0C2B8FC12; Sun, 22 Nov 2009 18:30:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAMIUJYJ026129; Sun, 22 Nov 2009 18:30:19 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAMIUJpx026126; Sun, 22 Nov 2009 18:30:19 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200911221830.nAMIUJpx026126@svn.freebsd.org> From: Pyun YongHyeon Date: Sun, 22 Nov 2009 18:30:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199661 - head/sys/dev/bge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Nov 2009 18:30:19 -0000 Author: yongari Date: Sun Nov 22 18:30:19 2009 New Revision: 199661 URL: http://svn.freebsd.org/changeset/base/199661 Log: Remove extra white space. Modified: head/sys/dev/bge/if_bge.c head/sys/dev/bge/if_bgereg.h Modified: head/sys/dev/bge/if_bge.c ============================================================================== --- head/sys/dev/bge/if_bge.c Sun Nov 22 18:23:30 2009 (r199660) +++ head/sys/dev/bge/if_bge.c Sun Nov 22 18:30:19 2009 (r199661) @@ -238,7 +238,7 @@ static const struct bge_vendor { { 0, NULL } }; - + static const struct bge_revision { uint32_t br_chipid; const char *br_name; @@ -295,7 +295,7 @@ static const struct bge_revision { { BGE_CHIPID_BCM5784_A0, "BCM5784 A0" }, { BGE_CHIPID_BCM5784_A1, "BCM5784 A1" }, /* 5754 and 5787 share the same ASIC ID */ - { BGE_CHIPID_BCM5787_A0, "BCM5754/5787 A0" }, + { BGE_CHIPID_BCM5787_A0, "BCM5754/5787 A0" }, { BGE_CHIPID_BCM5787_A1, "BCM5754/5787 A1" }, { BGE_CHIPID_BCM5787_A2, "BCM5754/5787 A2" }, { BGE_CHIPID_BCM5906_A1, "BCM5906 A1" }, @@ -1284,11 +1284,11 @@ bge_sig_post_reset(sc, type) if (sc->bge_asf_mode & ASF_NEW_HANDSHAKE) { switch (type) { case BGE_RESET_START: - bge_writemem_ind(sc, BGE_SDI_STATUS, 0x80000001); + bge_writemem_ind(sc, BGE_SDI_STATUS, 0x80000001); /* START DONE */ break; case BGE_RESET_STOP: - bge_writemem_ind(sc, BGE_SDI_STATUS, 0x80000002); + bge_writemem_ind(sc, BGE_SDI_STATUS, 0x80000002); break; } } @@ -1680,7 +1680,7 @@ bge_blockinit(struct bge_softc *sc) RCB_WRITE_4(sc, vrcb, bge_hostaddr.bge_addr_lo, taddr.bge_addr_lo); RCB_WRITE_4(sc, vrcb, bge_nicaddr, 0x00000000); RCB_WRITE_4(sc, vrcb, bge_maxlen_flags, - BGE_RCB_MAXLEN_FLAGS(sc->bge_return_ring_cnt, 0)); + BGE_RCB_MAXLEN_FLAGS(sc->bge_return_ring_cnt, 0)); /* Set random backoff seed for TX */ CSR_WRITE_4(sc, BGE_TX_RANDOM_BACKOFF, @@ -1910,7 +1910,7 @@ bge_lookup_vendor(uint16_t vid) for (v = bge_vendors; v->v_name != NULL; v++) if (v->v_id == vid) return (v); - + panic("%s: unknown vendor %d", __func__, vid); return (NULL); } @@ -2995,7 +2995,7 @@ bge_reset(struct bge_softc *sc) } } - /* + /* * Set GPHY Power Down Override to leave GPHY * powered up in D0 uninitialized. */ @@ -3630,7 +3630,7 @@ bge_cksum_pad(struct mbuf *m) last = n; } } - + /* Now zero the pad area, to avoid the bge cksum-assist bug. */ memset(mtod(last, caddr_t) + last->m_len, 0, padlen); last->m_len += padlen; @@ -3984,7 +3984,7 @@ bge_init_locked(struct bge_softc *sc) BGE_CLRBIT(sc, BGE_PCI_MISC_CTL, BGE_PCIMISCCTL_MASK_PCI_INTR); bge_writembx(sc, BGE_MBX_IRQ0_LO, 0); } - + bge_ifmedia_upd_locked(ifp); ifp->if_drv_flags |= IFF_DRV_RUNNING; @@ -4367,7 +4367,7 @@ bge_stop(struct bge_softc *sc) bge_sig_legacy(sc, BGE_RESET_STOP); bge_sig_post_reset(sc, BGE_RESET_STOP); - /* + /* * Keep the ASF firmware running if up. */ if (sc->bge_asf_mode & ASF_STACKUP) @@ -4707,7 +4707,7 @@ bge_add_sysctls(struct bge_softc *sc) BGE_SYSCTL_STAT(sc, ctx, "Multiple Collision Frames", children, txstats.dot3StatsMultipleCollisionFrames, "MultipleCollisionFrames"); - BGE_SYSCTL_STAT(sc, ctx, "Deferred Transmissions", + BGE_SYSCTL_STAT(sc, ctx, "Deferred Transmissions", children, txstats.dot3StatsDeferredTransmissions, "DeferredTransmissions"); BGE_SYSCTL_STAT(sc, ctx, "Excessive Collisions", @@ -4716,7 +4716,7 @@ bge_add_sysctls(struct bge_softc *sc) BGE_SYSCTL_STAT(sc, ctx, "Late Collisions", children, txstats.dot3StatsLateCollisions, "LateCollisions"); - BGE_SYSCTL_STAT(sc, ctx, "Outbound Unicast Packets", + BGE_SYSCTL_STAT(sc, ctx, "Outbound Unicast Packets", children, txstats.ifHCOutUcastPkts, "UcastPkts"); BGE_SYSCTL_STAT(sc, ctx, "Outbound Multicast Packets", children, txstats.ifHCOutMulticastPkts, "MulticastPkts"); Modified: head/sys/dev/bge/if_bgereg.h ============================================================================== --- head/sys/dev/bge/if_bgereg.h Sun Nov 22 18:23:30 2009 (r199660) +++ head/sys/dev/bge/if_bgereg.h Sun Nov 22 18:30:19 2009 (r199661) @@ -1907,7 +1907,7 @@ /* * This magic number is written to the firmware mailbox at 0xb50 * before a software reset is issued. After the internal firmware - * has completed its initialization it will write the opposite of + * has completed its initialization it will write the opposite of * this value, ~BGE_MAGIC_NUMBER, to the same location, allowing the * driver to synchronize with the firmware. */ From owner-svn-src-all@FreeBSD.ORG Sun Nov 22 18:34:16 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4BE79106566C; Sun, 22 Nov 2009 18:34:16 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3B67D8FC08; Sun, 22 Nov 2009 18:34:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAMIYFx3026250; Sun, 22 Nov 2009 18:34:15 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAMIYFAS026248; Sun, 22 Nov 2009 18:34:15 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200911221834.nAMIYFAS026248@svn.freebsd.org> From: Pyun YongHyeon Date: Sun, 22 Nov 2009 18:34:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199662 - head/sys/dev/bge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Nov 2009 18:34:16 -0000 Author: yongari Date: Sun Nov 22 18:34:15 2009 New Revision: 199662 URL: http://svn.freebsd.org/changeset/base/199662 Log: Fix typo introduced in r199011. Pointed out by: marius Modified: head/sys/dev/bge/if_bge.c Modified: head/sys/dev/bge/if_bge.c ============================================================================== --- head/sys/dev/bge/if_bge.c Sun Nov 22 18:30:19 2009 (r199661) +++ head/sys/dev/bge/if_bge.c Sun Nov 22 18:34:15 2009 (r199662) @@ -2261,7 +2261,7 @@ bge_dma_alloc(device_t dev) 0, &sc->bge_cdata.bge_rx_jumbo_sparemap); if (error) { device_printf(sc->bge_dev, - "can't create sapre DMA map for jumbo RX\n"); + "can't create spare DMA map for jumbo RX\n"); return (ENOMEM); } for (i = 0; i < BGE_JUMBO_RX_RING_CNT; i++) { From owner-svn-src-all@FreeBSD.ORG Sun Nov 22 18:47:56 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D0A2F106566C; Sun, 22 Nov 2009 18:47:56 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 55B9B8FC08; Sun, 22 Nov 2009 18:47:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAMIluhr026534; Sun, 22 Nov 2009 18:47:56 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAMIlupu026532; Sun, 22 Nov 2009 18:47:56 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200911221847.nAMIlupu026532@svn.freebsd.org> From: Pyun YongHyeon Date: Sun, 22 Nov 2009 18:47:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199663 - head/sys/dev/bge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Nov 2009 18:47:57 -0000 Author: yongari Date: Sun Nov 22 18:47:56 2009 New Revision: 199663 URL: http://svn.freebsd.org/changeset/base/199663 Log: Due to newly added PCIe capabilities fallback code for finding the PCIe capability did not work right on recent controllers. Remove FreeBSD 6.x support code. Reviewed by: marius Modified: head/sys/dev/bge/if_bge.c Modified: head/sys/dev/bge/if_bge.c ============================================================================== --- head/sys/dev/bge/if_bge.c Sun Nov 22 18:34:15 2009 (r199662) +++ head/sys/dev/bge/if_bge.c Sun Nov 22 18:47:56 2009 (r199663) @@ -2413,7 +2413,6 @@ bge_dma_alloc(device_t dev) return (0); } -#if __FreeBSD_version > 602105 /* * Return true if this device has more than one port. */ @@ -2462,7 +2461,6 @@ bge_can_use_msi(struct bge_softc *sc) } return (can_use_msi); } -#endif static int bge_attach(device_t dev) @@ -2471,7 +2469,7 @@ bge_attach(device_t dev) struct bge_softc *sc; uint32_t hwcfg = 0, misccfg; u_char eaddr[ETHER_ADDR_LEN]; - int error, reg, rid, trys; + int error, msicount, reg, rid, trys; sc = device_get_softc(dev); sc->bge_dev = dev; @@ -2580,7 +2578,6 @@ bge_attach(device_t dev) /* * Check if this is a PCI-X or PCI Express device. */ -#if __FreeBSD_version > 602101 if (pci_find_extcap(dev, PCIY_EXPRESS, ®) == 0) { /* * Found a PCI Express capabilities register, this @@ -2588,13 +2585,6 @@ bge_attach(device_t dev) */ if (reg != 0) { sc->bge_flags |= BGE_FLAG_PCIE; -#else - if (BGE_IS_5705_PLUS(sc)) { - reg = pci_read_config(dev, BGE_PCIE_CAPID_REG, 4); - if ((reg & 0xFF) == BGE_PCIE_CAPID) { - sc->bge_flags |= BGE_FLAG_PCIE; - reg = BGE_PCIE_CAPID; -#endif bge_set_max_readrq(sc, reg); } } else { @@ -2607,30 +2597,22 @@ bge_attach(device_t dev) sc->bge_flags |= BGE_FLAG_PCIX; } -#if __FreeBSD_version > 602105 - { - int msicount; - - /* - * Allocate the interrupt, using MSI if possible. These devices - * support 8 MSI messages, but only the first one is used in - * normal operation. - */ - if (bge_can_use_msi(sc)) { - msicount = pci_msi_count(dev); - if (msicount > 1) - msicount = 1; - } else - msicount = 0; - if (msicount == 1 && pci_alloc_msi(dev, &msicount) == 0) { - rid = 1; - sc->bge_flags |= BGE_FLAG_MSI; - } else - rid = 0; - } -#else - rid = 0; -#endif + /* + * Allocate the interrupt, using MSI if possible. These devices + * support 8 MSI messages, but only the first one is used in + * normal operation. + */ + if (bge_can_use_msi(sc)) { + msicount = pci_msi_count(dev); + if (msicount > 1) + msicount = 1; + } else + msicount = 0; + if (msicount == 1 && pci_alloc_msi(dev, &msicount) == 0) { + rid = 1; + sc->bge_flags |= BGE_FLAG_MSI; + } else + rid = 0; sc->bge_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, RF_SHAREABLE | RF_ACTIVE); @@ -2921,10 +2903,8 @@ bge_release_resources(struct bge_softc * bus_release_resource(dev, SYS_RES_IRQ, sc->bge_flags & BGE_FLAG_MSI ? 1 : 0, sc->bge_irq); -#if __FreeBSD_version > 602105 if (sc->bge_flags & BGE_FLAG_MSI) pci_release_msi(dev); -#endif if (sc->bge_res != NULL) bus_release_resource(dev, SYS_RES_MEMORY, From owner-svn-src-all@FreeBSD.ORG Sun Nov 22 19:11:35 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0EF8D106566B; Sun, 22 Nov 2009 19:11:35 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F20968FC14; Sun, 22 Nov 2009 19:11:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAMJBYRO027110; Sun, 22 Nov 2009 19:11:34 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAMJBYYQ027107; Sun, 22 Nov 2009 19:11:34 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200911221911.nAMJBYYQ027107@svn.freebsd.org> From: Pyun YongHyeon Date: Sun, 22 Nov 2009 19:11:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199664 - head/sys/dev/bge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Nov 2009 19:11:35 -0000 Author: yongari Date: Sun Nov 22 19:11:34 2009 New Revision: 199664 URL: http://svn.freebsd.org/changeset/base/199664 Log: Use capability pointer to access PCIe registers rather than directly access them at fixed address. While I'm here don't touch other bits of PCIe device control register except max payload size. Reviewed by: marius Modified: head/sys/dev/bge/if_bge.c head/sys/dev/bge/if_bgereg.h Modified: head/sys/dev/bge/if_bge.c ============================================================================== --- head/sys/dev/bge/if_bge.c Sun Nov 22 18:47:56 2009 (r199663) +++ head/sys/dev/bge/if_bge.c Sun Nov 22 19:11:34 2009 (r199664) @@ -414,7 +414,7 @@ static uint32_t bge_readreg_ind(struct b #endif static void bge_writemem_direct(struct bge_softc *, int, int); static void bge_writereg_ind(struct bge_softc *, int, int); -static void bge_set_max_readrq(struct bge_softc *, int); +static void bge_set_max_readrq(struct bge_softc *); static int bge_miibus_readreg(device_t, int, int); static int bge_miibus_writereg(device_t, int, int, int); @@ -558,25 +558,23 @@ bge_writemem_ind(struct bge_softc *sc, i * PCI Express only */ static void -bge_set_max_readrq(struct bge_softc *sc, int expr_ptr) +bge_set_max_readrq(struct bge_softc *sc) { device_t dev; uint16_t val; - KASSERT((sc->bge_flags & BGE_FLAG_PCIE) && expr_ptr != 0, - ("%s: not applicable", __func__)); - dev = sc->bge_dev; - val = pci_read_config(dev, expr_ptr + BGE_PCIE_DEVCTL, 2); - if ((val & BGE_PCIE_DEVCTL_MAX_READRQ_MASK) != + val = pci_read_config(dev, sc->bge_expcap + PCIR_EXPRESS_DEVICE_CTL, 2); + if ((val & PCIM_EXP_CTL_MAX_READ_REQUEST) != BGE_PCIE_DEVCTL_MAX_READRQ_4096) { if (bootverbose) device_printf(dev, "adjust device control 0x%04x ", val); - val &= ~BGE_PCIE_DEVCTL_MAX_READRQ_MASK; + val &= ~PCIM_EXP_CTL_MAX_READ_REQUEST; val |= BGE_PCIE_DEVCTL_MAX_READRQ_4096; - pci_write_config(dev, expr_ptr + BGE_PCIE_DEVCTL, val, 2); + pci_write_config(dev, sc->bge_expcap + PCIR_EXPRESS_DEVICE_CTL, + val, 2); if (bootverbose) printf("-> 0x%04x\n", val); } @@ -2583,15 +2581,16 @@ bge_attach(device_t dev) * Found a PCI Express capabilities register, this * must be a PCI Express device. */ - if (reg != 0) { - sc->bge_flags |= BGE_FLAG_PCIE; - bge_set_max_readrq(sc, reg); - } + sc->bge_flags |= BGE_FLAG_PCIE; + sc->bge_expcap = reg; + bge_set_max_readrq(sc); } else { /* * Check if the device is in PCI-X Mode. * (This bit is not valid on PCI Express controllers.) */ + if (pci_find_extcap(dev, PCIY_PCIX, ®) == 0) + sc->bge_pcixcap = reg; if ((pci_read_config(dev, BGE_PCI_PCISTATE, 4) & BGE_PCISTATE_PCI_BUSMODE) == 0) sc->bge_flags |= BGE_FLAG_PCIX; @@ -2602,17 +2601,20 @@ bge_attach(device_t dev) * support 8 MSI messages, but only the first one is used in * normal operation. */ - if (bge_can_use_msi(sc)) { - msicount = pci_msi_count(dev); - if (msicount > 1) - msicount = 1; - } else - msicount = 0; - if (msicount == 1 && pci_alloc_msi(dev, &msicount) == 0) { - rid = 1; - sc->bge_flags |= BGE_FLAG_MSI; - } else - rid = 0; + rid = 0; + if (pci_find_extcap(sc->bge_dev, PCIY_MSI, ®) != 0) { + sc->bge_msicap = reg; + if (bge_can_use_msi(sc)) { + msicount = pci_msi_count(dev); + if (msicount > 1) + msicount = 1; + } else + msicount = 0; + if (msicount == 1 && pci_alloc_msi(dev, &msicount) == 0) { + rid = 1; + sc->bge_flags |= BGE_FLAG_MSI; + } + } sc->bge_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, RF_SHAREABLE | RF_ACTIVE); @@ -2925,6 +2927,7 @@ bge_reset(struct bge_softc *sc) device_t dev; uint32_t cachesize, command, pcistate, reset, val; void (*write_op)(struct bge_softc *, int, int); + uint16_t devctl; int i; dev = sc->bge_dev; @@ -3003,11 +3006,17 @@ bge_reset(struct bge_softc *sc) val = pci_read_config(dev, 0xC4, 4); pci_write_config(dev, 0xC4, val | (1 << 15), 4); } - /* - * Set PCIE max payload size to 128 bytes and clear error - * status. - */ - pci_write_config(dev, 0xD8, 0xF5000, 4); + devctl = pci_read_config(dev, + sc->bge_expcap + PCIR_EXPRESS_DEVICE_CTL, 2); + /* Clear enable no snoop and disable relaxed ordering. */ + devctl &= ~(0x0010 | 0x0800); + /* Set PCIE max payload size to 128. */ + devctl &= ~PCIM_EXP_CTL_MAX_PAYLOAD; + pci_write_config(dev, sc->bge_expcap + PCIR_EXPRESS_DEVICE_CTL, + devctl, 2); + /* Clear error status. */ + pci_write_config(dev, sc->bge_expcap + PCIR_EXPRESS_DEVICE_STA, + 0, 2); } /* Reset some of the PCI state that got zapped by reset. */ @@ -3022,8 +3031,10 @@ bge_reset(struct bge_softc *sc) if (BGE_IS_5714_FAMILY(sc)) { /* This chip disables MSI on reset. */ if (sc->bge_flags & BGE_FLAG_MSI) { - val = pci_read_config(dev, BGE_PCI_MSI_CTL, 2); - pci_write_config(dev, BGE_PCI_MSI_CTL, + val = pci_read_config(dev, + sc->bge_msicap + PCIR_MSI_CTRL, 2); + pci_write_config(dev, + sc->bge_msicap + PCIR_MSI_CTRL, val | PCIM_MSICTRL_MSI_ENABLE, 2); val = CSR_READ_4(sc, BGE_MSI_MODE); CSR_WRITE_4(sc, BGE_MSI_MODE, Modified: head/sys/dev/bge/if_bgereg.h ============================================================================== --- head/sys/dev/bge/if_bgereg.h Sun Nov 22 18:47:56 2009 (r199663) +++ head/sys/dev/bge/if_bgereg.h Sun Nov 22 19:11:34 2009 (r199664) @@ -2584,6 +2584,9 @@ struct bge_softc { struct resource *bge_irq; struct resource *bge_res; struct ifmedia bge_ifmedia; /* TBI media info */ + int bge_expcap; + int bge_msicap; + int bge_pcixcap; uint32_t bge_flags; #define BGE_FLAG_TBI 0x00000001 #define BGE_FLAG_JUMBO 0x00000002 From owner-svn-src-all@FreeBSD.ORG Sun Nov 22 19:17:32 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A0B28106566C; Sun, 22 Nov 2009 19:17:32 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 902658FC15; Sun, 22 Nov 2009 19:17:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAMJHWJO027247; Sun, 22 Nov 2009 19:17:32 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAMJHWMa027245; Sun, 22 Nov 2009 19:17:32 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200911221917.nAMJHWMa027245@svn.freebsd.org> From: Pyun YongHyeon Date: Sun, 22 Nov 2009 19:17:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199665 - head/sys/dev/bge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Nov 2009 19:17:32 -0000 Author: yongari Date: Sun Nov 22 19:17:32 2009 New Revision: 199665 URL: http://svn.freebsd.org/changeset/base/199665 Log: Controller does not write Rx descriptors, remove BUS_DMASYNC_PREREAD. Modified: head/sys/dev/bge/if_bge.c Modified: head/sys/dev/bge/if_bge.c ============================================================================== --- head/sys/dev/bge/if_bge.c Sun Nov 22 19:11:34 2009 (r199664) +++ head/sys/dev/bge/if_bge.c Sun Nov 22 19:17:32 2009 (r199665) @@ -1053,8 +1053,7 @@ bge_init_rx_ring_std(struct bge_softc *s }; bus_dmamap_sync(sc->bge_cdata.bge_rx_std_ring_tag, - sc->bge_cdata.bge_rx_std_ring_map, - BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); + sc->bge_cdata.bge_rx_std_ring_map, BUS_DMASYNC_PREWRITE); sc->bge_std = i - 1; bge_writembx(sc, BGE_MBX_RX_STD_PROD_LO, sc->bge_std); @@ -1097,8 +1096,7 @@ bge_init_rx_ring_jumbo(struct bge_softc }; bus_dmamap_sync(sc->bge_cdata.bge_rx_jumbo_ring_tag, - sc->bge_cdata.bge_rx_jumbo_ring_map, - BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); + sc->bge_cdata.bge_rx_jumbo_ring_map, BUS_DMASYNC_PREWRITE); sc->bge_jumbo = i - 1; From owner-svn-src-all@FreeBSD.ORG Sun Nov 22 19:44:11 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8B3A41065672; Sun, 22 Nov 2009 19:44:11 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7121A8FC1C; Sun, 22 Nov 2009 19:44:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAMJiBd8027752; Sun, 22 Nov 2009 19:44:11 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAMJiBkD027750; Sun, 22 Nov 2009 19:44:11 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200911221944.nAMJiBkD027750@svn.freebsd.org> From: Pyun YongHyeon Date: Sun, 22 Nov 2009 19:44:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199666 - head/sys/dev/bge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Nov 2009 19:44:11 -0000 Author: yongari Date: Sun Nov 22 19:44:11 2009 New Revision: 199666 URL: http://svn.freebsd.org/changeset/base/199666 Log: Rearrange bge_start_locked to see we can send more frames by checking IFF_DRV_RUNNING and IFF_DRV_OACTIVE flags. Also if we have less than 16 free send BDs set IFF_DRV_OACTIVE and try it later. Previously bge(4) used to reserve 16 free send BDs after loading dma maps but hardware just need one reserved send BD. If prouder index has the same value of consumer index it means the Tx queue is empty. While I'm here check IFQ_DRV_IS_EMPTY first to save one lock operation. Modified: head/sys/dev/bge/if_bge.c Modified: head/sys/dev/bge/if_bge.c ============================================================================== --- head/sys/dev/bge/if_bge.c Sun Nov 22 19:17:32 2009 (r199665) +++ head/sys/dev/bge/if_bge.c Sun Nov 22 19:44:11 2009 (r199666) @@ -3683,11 +3683,8 @@ bge_encap(struct bge_softc *sc, struct m } else if (error != 0) return (error); - /* - * Sanity check: avoid coming within 16 descriptors - * of the end of the ring. - */ - if (nsegs > (BGE_TX_RING_CNT - sc->bge_txcnt - 16)) { + /* Check if we have enough free send BDs. */ + if (sc->bge_txcnt + nsegs >= BGE_TX_RING_CNT) { bus_dmamap_unload(sc->bge_cdata.bge_tx_mtag, map); return (ENOBUFS); } @@ -3752,18 +3749,25 @@ static void bge_start_locked(struct ifnet *ifp) { struct bge_softc *sc; - struct mbuf *m_head = NULL; + struct mbuf *m_head; uint32_t prodidx; - int count = 0; + int count; sc = ifp->if_softc; + BGE_LOCK_ASSERT(sc); - if (!sc->bge_link || IFQ_DRV_IS_EMPTY(&ifp->if_snd)) + if (!sc->bge_link || + (ifp->if_drv_flags & (IFF_DRV_RUNNING | IFF_DRV_OACTIVE)) != + IFF_DRV_RUNNING) return; prodidx = sc->bge_tx_prodidx; - while(sc->bge_cdata.bge_tx_chain[prodidx] == NULL) { + for (count = 0; !IFQ_DRV_IS_EMPTY(&ifp->if_snd);) { + if (sc->bge_txcnt > BGE_TX_RING_CNT - 16) { + ifp->if_drv_flags |= IFF_DRV_OACTIVE; + break; + } IFQ_DRV_DEQUEUE(&ifp->if_snd, m_head); if (m_head == NULL) break; @@ -3816,24 +3820,22 @@ bge_start_locked(struct ifnet *ifp) #endif } - if (count == 0) - /* No packets were dequeued. */ - return; - - bus_dmamap_sync(sc->bge_cdata.bge_tx_ring_tag, - sc->bge_cdata.bge_tx_ring_map, BUS_DMASYNC_PREWRITE); - /* Transmit. */ - bge_writembx(sc, BGE_MBX_TX_HOST_PROD0_LO, prodidx); - /* 5700 b2 errata */ - if (sc->bge_chiprev == BGE_CHIPREV_5700_BX) + if (count > 0) { + bus_dmamap_sync(sc->bge_cdata.bge_tx_ring_tag, + sc->bge_cdata.bge_tx_ring_map, BUS_DMASYNC_PREWRITE); + /* Transmit. */ bge_writembx(sc, BGE_MBX_TX_HOST_PROD0_LO, prodidx); + /* 5700 b2 errata */ + if (sc->bge_chiprev == BGE_CHIPREV_5700_BX) + bge_writembx(sc, BGE_MBX_TX_HOST_PROD0_LO, prodidx); - sc->bge_tx_prodidx = prodidx; + sc->bge_tx_prodidx = prodidx; - /* - * Set a timeout in case the chip goes out to lunch. - */ - sc->bge_timer = 5; + /* + * Set a timeout in case the chip goes out to lunch. + */ + sc->bge_timer = 5; + } } /* From owner-svn-src-all@FreeBSD.ORG Sun Nov 22 20:02:13 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B3B771065694; Sun, 22 Nov 2009 20:02:13 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A30008FC12; Sun, 22 Nov 2009 20:02:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAMK2DH2028127; Sun, 22 Nov 2009 20:02:13 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAMK2Dt3028125; Sun, 22 Nov 2009 20:02:13 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200911222002.nAMK2Dt3028125@svn.freebsd.org> From: Pyun YongHyeon Date: Sun, 22 Nov 2009 20:02:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199667 - head/sys/dev/bge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Nov 2009 20:02:13 -0000 Author: yongari Date: Sun Nov 22 20:02:13 2009 New Revision: 199667 URL: http://svn.freebsd.org/changeset/base/199667 Log: Cache Rx producer/Tx consumer index as soon as we know status block update and then clear status block. Previously it used to access these index without synchronization which may cause problems when bounce buffers are used. Also add missing bus_dmamap_sync(9) in polling handler. Since we now update status block in driver, adjust bus_dmamap_sync(9) for status block. Modified: head/sys/dev/bge/if_bge.c Modified: head/sys/dev/bge/if_bge.c ============================================================================== --- head/sys/dev/bge/if_bge.c Sun Nov 22 19:44:11 2009 (r199666) +++ head/sys/dev/bge/if_bge.c Sun Nov 22 20:02:13 2009 (r199667) @@ -361,8 +361,8 @@ static int bge_get_eaddr_nvram(struct bg static int bge_get_eaddr_eeprom(struct bge_softc *, uint8_t[]); static int bge_get_eaddr(struct bge_softc *, uint8_t[]); -static void bge_txeof(struct bge_softc *); -static int bge_rxeof(struct bge_softc *); +static void bge_txeof(struct bge_softc *, uint16_t); +static int bge_rxeof(struct bge_softc *, uint16_t); static void bge_asf_driver_up (struct bge_softc *); static void bge_tick(void *); @@ -3135,15 +3135,14 @@ bge_reset(struct bge_softc *sc) */ static int -bge_rxeof(struct bge_softc *sc) +bge_rxeof(struct bge_softc *sc, uint16_t rx_prod) { struct ifnet *ifp; int rx_npkts = 0, stdcnt = 0, jumbocnt = 0; - uint16_t rx_prod, rx_cons; + uint16_t rx_cons; BGE_LOCK_ASSERT(sc); rx_cons = sc->bge_rx_saved_considx; - rx_prod = sc->bge_ldata.bge_status_block->bge_idx[0].bge_rx_prod_idx; /* Nothing to do. */ if (rx_cons == rx_prod) @@ -3296,7 +3295,7 @@ bge_rxeof(struct bge_softc *sc) } static void -bge_txeof(struct bge_softc *sc) +bge_txeof(struct bge_softc *sc, uint16_t tx_cons) { struct bge_tx_bd *cur_tx = NULL; struct ifnet *ifp; @@ -3304,8 +3303,7 @@ bge_txeof(struct bge_softc *sc) BGE_LOCK_ASSERT(sc); /* Nothing to do. */ - if (sc->bge_tx_saved_considx == - sc->bge_ldata.bge_status_block->bge_idx[0].bge_tx_cons_idx) + if (sc->bge_tx_saved_considx == tx_cons) return; ifp = sc->bge_ifp; @@ -3316,8 +3314,7 @@ bge_txeof(struct bge_softc *sc) * Go through our tx ring and free mbufs for those * frames that have been sent. */ - while (sc->bge_tx_saved_considx != - sc->bge_ldata.bge_status_block->bge_idx[0].bge_tx_cons_idx) { + while (sc->bge_tx_saved_considx != tx_cons) { uint32_t idx = 0; idx = sc->bge_tx_saved_considx; @@ -3348,6 +3345,7 @@ static int bge_poll(struct ifnet *ifp, enum poll_cmd cmd, int count) { struct bge_softc *sc = ifp->if_softc; + uint16_t rx_prod, tx_cons; uint32_t statusword; int rx_npkts = 0; @@ -3358,13 +3356,17 @@ bge_poll(struct ifnet *ifp, enum poll_cm } bus_dmamap_sync(sc->bge_cdata.bge_status_tag, - sc->bge_cdata.bge_status_map, BUS_DMASYNC_POSTREAD); + sc->bge_cdata.bge_status_map, + BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); + rx_prod = sc->bge_ldata.bge_status_block->bge_idx[0].bge_rx_prod_idx; + tx_cons = sc->bge_ldata.bge_status_block->bge_idx[0].bge_tx_cons_idx; statusword = atomic_readandclear_32( &sc->bge_ldata.bge_status_block->bge_status); bus_dmamap_sync(sc->bge_cdata.bge_status_tag, - sc->bge_cdata.bge_status_map, BUS_DMASYNC_PREREAD); + sc->bge_cdata.bge_status_map, + BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); /* Note link event. It will be processed by POLL_AND_CHECK_STATUS. */ if (statusword & BGE_STATFLAG_LINKSTATE_CHANGED) @@ -3377,12 +3379,12 @@ bge_poll(struct ifnet *ifp, enum poll_cm bge_link_upd(sc); sc->rxcycles = count; - rx_npkts = bge_rxeof(sc); + rx_npkts = bge_rxeof(sc, rx_prod); if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) { BGE_UNLOCK(sc); return (rx_npkts); } - bge_txeof(sc); + bge_txeof(sc, tx_cons); if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) bge_start_locked(ifp); @@ -3397,6 +3399,7 @@ bge_intr(void *xsc) struct bge_softc *sc; struct ifnet *ifp; uint32_t statusword; + uint16_t rx_prod, tx_cons; sc = xsc; @@ -3440,7 +3443,14 @@ bge_intr(void *xsc) /* Make sure the descriptor ring indexes are coherent. */ bus_dmamap_sync(sc->bge_cdata.bge_status_tag, - sc->bge_cdata.bge_status_map, BUS_DMASYNC_POSTREAD); + sc->bge_cdata.bge_status_map, + BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); + rx_prod = sc->bge_ldata.bge_status_block->bge_idx[0].bge_rx_prod_idx; + tx_cons = sc->bge_ldata.bge_status_block->bge_idx[0].bge_tx_cons_idx; + sc->bge_ldata.bge_status_block->bge_status = 0; + bus_dmamap_sync(sc->bge_cdata.bge_status_tag, + sc->bge_cdata.bge_status_map, + BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); if ((sc->bge_asicrev == BGE_ASICREV_BCM5700 && sc->bge_chipid != BGE_CHIPID_BCM5700_B2) || @@ -3449,21 +3459,18 @@ bge_intr(void *xsc) if (ifp->if_drv_flags & IFF_DRV_RUNNING) { /* Check RX return ring producer/consumer. */ - bge_rxeof(sc); + bge_rxeof(sc, rx_prod); } if (ifp->if_drv_flags & IFF_DRV_RUNNING) { /* Check TX ring producer/consumer. */ - bge_txeof(sc); + bge_txeof(sc, tx_cons); } if (ifp->if_drv_flags & IFF_DRV_RUNNING && !IFQ_DRV_IS_EMPTY(&ifp->if_snd)) bge_start_locked(ifp); - bus_dmamap_sync(sc->bge_cdata.bge_status_tag, - sc->bge_cdata.bge_status_map, BUS_DMASYNC_PREREAD); - BGE_UNLOCK(sc); } From owner-svn-src-all@FreeBSD.ORG Sun Nov 22 20:31:40 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7114A1065670; Sun, 22 Nov 2009 20:31:40 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 603028FC13; Sun, 22 Nov 2009 20:31:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAMKVeU9028737; Sun, 22 Nov 2009 20:31:40 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAMKVeNE028734; Sun, 22 Nov 2009 20:31:40 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200911222031.nAMKVeNE028734@svn.freebsd.org> From: Pyun YongHyeon Date: Sun, 22 Nov 2009 20:31:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199668 - head/sys/dev/bge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Nov 2009 20:31:40 -0000 Author: yongari Date: Sun Nov 22 20:31:40 2009 New Revision: 199668 URL: http://svn.freebsd.org/changeset/base/199668 Log: For MSI case, interrupt is not shared and we don't need to force PCI flush to get correct status block update. Add an optimized interrupt handler that is activated for MSI case. Actual interrupt handling is done by taskqueue such that the handler does not require driver lock for Rx path. The MSI capable bge(4) controllers automatically disables further interrupt once it enters interrupt state so we don't need PIO access to disable interrupt in interrupt handler. Modified: head/sys/dev/bge/if_bge.c head/sys/dev/bge/if_bgereg.h Modified: head/sys/dev/bge/if_bge.c ============================================================================== --- head/sys/dev/bge/if_bge.c Sun Nov 22 20:02:13 2009 (r199667) +++ head/sys/dev/bge/if_bge.c Sun Nov 22 20:31:40 2009 (r199668) @@ -80,6 +80,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -362,7 +363,7 @@ static int bge_get_eaddr_eeprom(struct b static int bge_get_eaddr(struct bge_softc *, uint8_t[]); static void bge_txeof(struct bge_softc *, uint16_t); -static int bge_rxeof(struct bge_softc *, uint16_t); +static int bge_rxeof(struct bge_softc *, uint16_t, int); static void bge_asf_driver_up (struct bge_softc *); static void bge_tick(void *); @@ -371,6 +372,8 @@ static void bge_stats_update_regs(struct static int bge_encap(struct bge_softc *, struct mbuf **, uint32_t *); static void bge_intr(void *); +static int bge_msi_intr(void *); +static void bge_intr_task(void *, int); static void bge_start_locked(struct ifnet *); static void bge_start(struct ifnet *); static int bge_ioctl(struct ifnet *, u_long, caddr_t); @@ -2470,6 +2473,8 @@ bge_attach(device_t dev) sc = device_get_softc(dev); sc->bge_dev = dev; + TASK_INIT(&sc->bge_intr_task, 0, bge_intr_task, sc); + /* * Map control/status registers. */ @@ -2832,8 +2837,27 @@ again: * Hookup IRQ last. */ #if __FreeBSD_version > 700030 - error = bus_setup_intr(dev, sc->bge_irq, INTR_TYPE_NET | INTR_MPSAFE, - NULL, bge_intr, sc, &sc->bge_intrhand); + if (BGE_IS_5755_PLUS(sc) && sc->bge_flags & BGE_FLAG_MSI) { + /* Take advantage of single-shot MSI. */ + sc->bge_tq = taskqueue_create_fast("bge_taskq", M_WAITOK, + taskqueue_thread_enqueue, &sc->bge_tq); + if (sc->bge_tq == NULL) { + device_printf(dev, "could not create taskqueue.\n"); + ether_ifdetach(ifp); + error = ENXIO; + goto fail; + } + taskqueue_start_threads(&sc->bge_tq, 1, PI_NET, "%s taskq", + device_get_nameunit(sc->bge_dev)); + error = bus_setup_intr(dev, sc->bge_irq, + INTR_TYPE_NET | INTR_MPSAFE, bge_msi_intr, NULL, sc, + &sc->bge_intrhand); + if (error) + ether_ifdetach(ifp); + } else + error = bus_setup_intr(dev, sc->bge_irq, + INTR_TYPE_NET | INTR_MPSAFE, NULL, bge_intr, sc, + &sc->bge_intrhand); #else error = bus_setup_intr(dev, sc->bge_irq, INTR_TYPE_NET | INTR_MPSAFE, bge_intr, sc, &sc->bge_intrhand); @@ -2875,6 +2899,8 @@ bge_detach(device_t dev) callout_drain(&sc->bge_stat_ch); + if (sc->bge_tq) + taskqueue_drain(sc->bge_tq, &sc->bge_intr_task); ether_ifdetach(ifp); if (sc->bge_flags & BGE_FLAG_TBI) { @@ -2896,6 +2922,9 @@ bge_release_resources(struct bge_softc * dev = sc->bge_dev; + if (sc->bge_tq != NULL) + taskqueue_free(sc->bge_tq); + if (sc->bge_intrhand != NULL) bus_teardown_intr(dev, sc->bge_irq, sc->bge_intrhand); @@ -3135,13 +3164,12 @@ bge_reset(struct bge_softc *sc) */ static int -bge_rxeof(struct bge_softc *sc, uint16_t rx_prod) +bge_rxeof(struct bge_softc *sc, uint16_t rx_prod, int holdlck) { struct ifnet *ifp; int rx_npkts = 0, stdcnt = 0, jumbocnt = 0; uint16_t rx_cons; - BGE_LOCK_ASSERT(sc); rx_cons = sc->bge_rx_saved_considx; /* Nothing to do. */ @@ -3258,9 +3286,12 @@ bge_rxeof(struct bge_softc *sc, uint16_t #endif } - BGE_UNLOCK(sc); - (*ifp->if_input)(ifp, m); - BGE_LOCK(sc); + if (holdlck != 0) { + BGE_UNLOCK(sc); + (*ifp->if_input)(ifp, m); + BGE_LOCK(sc); + } else + (*ifp->if_input)(ifp, m); rx_npkts++; if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) @@ -3379,7 +3410,7 @@ bge_poll(struct ifnet *ifp, enum poll_cm bge_link_upd(sc); sc->rxcycles = count; - rx_npkts = bge_rxeof(sc, rx_prod); + rx_npkts = bge_rxeof(sc, rx_prod, 1); if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) { BGE_UNLOCK(sc); return (rx_npkts); @@ -3393,6 +3424,69 @@ bge_poll(struct ifnet *ifp, enum poll_cm } #endif /* DEVICE_POLLING */ +static int +bge_msi_intr(void *arg) +{ + struct bge_softc *sc; + + sc = (struct bge_softc *)arg; + /* + * This interrupt is not shared and controller already + * disabled further interrupt. + */ + taskqueue_enqueue(sc->bge_tq, &sc->bge_intr_task); + return (FILTER_HANDLED); +} + +static void +bge_intr_task(void *arg, int pending) +{ + struct bge_softc *sc; + struct ifnet *ifp; + uint32_t status; + uint16_t rx_prod, tx_cons; + + sc = (struct bge_softc *)arg; + ifp = sc->bge_ifp; + + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) + return; + + /* Get updated status block. */ + bus_dmamap_sync(sc->bge_cdata.bge_status_tag, + sc->bge_cdata.bge_status_map, + BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); + + /* Save producer/consumer indexess. */ + rx_prod = sc->bge_ldata.bge_status_block->bge_idx[0].bge_rx_prod_idx; + tx_cons = sc->bge_ldata.bge_status_block->bge_idx[0].bge_tx_cons_idx; + status = sc->bge_ldata.bge_status_block->bge_status; + sc->bge_ldata.bge_status_block->bge_status = 0; + bus_dmamap_sync(sc->bge_cdata.bge_status_tag, + sc->bge_cdata.bge_status_map, + BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); + /* Let controller work. */ + bge_writembx(sc, BGE_MBX_IRQ0_LO, 0); + + if ((status & BGE_STATFLAG_LINKSTATE_CHANGED) != 0) { + BGE_LOCK(sc); + bge_link_upd(sc); + BGE_UNLOCK(sc); + } + if (ifp->if_drv_flags & IFF_DRV_RUNNING) { + /* Check RX return ring producer/consumer. */ + bge_rxeof(sc, rx_prod, 0); + } + if (ifp->if_drv_flags & IFF_DRV_RUNNING) { + BGE_LOCK(sc); + /* Check TX ring producer/consumer. */ + bge_txeof(sc, tx_cons); + if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) + bge_start_locked(ifp); + BGE_UNLOCK(sc); + } +} + static void bge_intr(void *xsc) { @@ -3459,7 +3553,7 @@ bge_intr(void *xsc) if (ifp->if_drv_flags & IFF_DRV_RUNNING) { /* Check RX return ring producer/consumer. */ - bge_rxeof(sc, rx_prod); + bge_rxeof(sc, rx_prod, 1); } if (ifp->if_drv_flags & IFF_DRV_RUNNING) { Modified: head/sys/dev/bge/if_bgereg.h ============================================================================== --- head/sys/dev/bge/if_bgereg.h Sun Nov 22 20:02:13 2009 (r199667) +++ head/sys/dev/bge/if_bgereg.h Sun Nov 22 20:31:40 2009 (r199668) @@ -2641,6 +2641,8 @@ struct bge_softc { #ifdef DEVICE_POLLING int rxcycles; #endif /* DEVICE_POLLING */ + struct task bge_intr_task; + struct taskqueue *bge_tq; }; #define BGE_LOCK_INIT(_sc, _name) \ From owner-svn-src-all@FreeBSD.ORG Sun Nov 22 20:45:15 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E3CDB1065670; Sun, 22 Nov 2009 20:45:15 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D366E8FC15; Sun, 22 Nov 2009 20:45:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAMKjFdw029012; Sun, 22 Nov 2009 20:45:15 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAMKjF1N029010; Sun, 22 Nov 2009 20:45:15 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <200911222045.nAMKjF1N029010@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 22 Nov 2009 20:45:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199669 - head/sys/powerpc/aim X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Nov 2009 20:45:16 -0000 Author: nwhitehorn Date: Sun Nov 22 20:45:15 2009 New Revision: 199669 URL: http://svn.freebsd.org/changeset/base/199669 Log: Garbage collect some code that was never compiled in to handle Altivec during traps. It predates actual Altivec support and was never used. Modified: head/sys/powerpc/aim/trap.c Modified: head/sys/powerpc/aim/trap.c ============================================================================== --- head/sys/powerpc/aim/trap.c Sun Nov 22 20:31:40 2009 (r199668) +++ head/sys/powerpc/aim/trap.c Sun Nov 22 20:45:15 2009 (r199669) @@ -236,12 +236,6 @@ trap(struct trapframe *frame) trap_fatal(frame); } -#ifdef ALTIVEC - if (td != PCPU_GET(vecthread) || - td->td_pcb->pcb_veccpu != PCPU_GET(cpuid)) - frame->srr1 &= ~PSL_VEC; -#endif /* ALTIVEC */ - if (sig != 0) { if (p->p_sysent->sv_transtrap != NULL) sig = (p->p_sysent->sv_transtrap)(sig, type); From owner-svn-src-all@FreeBSD.ORG Sun Nov 22 20:50:27 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D8845106568F; Sun, 22 Nov 2009 20:50:27 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C82BC8FC0A; Sun, 22 Nov 2009 20:50:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAMKoRpq029144; Sun, 22 Nov 2009 20:50:27 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAMKoRYh029141; Sun, 22 Nov 2009 20:50:27 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200911222050.nAMKoRYh029141@svn.freebsd.org> From: Pyun YongHyeon Date: Sun, 22 Nov 2009 20:50:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199670 - head/sys/dev/bge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Nov 2009 20:50:28 -0000 Author: yongari Date: Sun Nov 22 20:50:27 2009 New Revision: 199670 URL: http://svn.freebsd.org/changeset/base/199670 Log: Fix two long standing bugs on bge(4). Most pre BCM5755 controllers have a DMA bug when buffer address crosses a multiple of the 4GB boundary(e.g. 4GB, 8GB, 12GB etc). Limit DMA address to be within 4GB address for these controllers. The second DMA bug limits DMA address to be within 40bit address space. This bug applies to BCM5714 and BCM5715 and 5708(bce(4) controller). This is not actually a MAC controller bug but an issue with the embedded PCIe to PCI-X bridge in the device. So for BCM5714/BCM5715 controllers also limit the DMA address to be within 40bit address space. Special thanks to davidch@ who gave me detailed errata information. I think this change will fix long standing bge(4) instability issues on systems with more than 4GB memory. Reviewed by: davidch Modified: head/sys/dev/bge/if_bge.c head/sys/dev/bge/if_bgereg.h Modified: head/sys/dev/bge/if_bge.c ============================================================================== --- head/sys/dev/bge/if_bge.c Sun Nov 22 20:45:15 2009 (r199669) +++ head/sys/dev/bge/if_bge.c Sun Nov 22 20:50:27 2009 (r199670) @@ -2104,15 +2104,21 @@ bge_dma_alloc(device_t dev) { struct bge_dmamap_arg ctx; struct bge_softc *sc; + bus_addr_t lowaddr; int i, error; sc = device_get_softc(dev); + lowaddr = BUS_SPACE_MAXADDR; + if ((sc->bge_flags & BGE_FLAG_40BIT_BUG) != 0) + lowaddr = BGE_DMA_MAXADDR; + if ((sc->bge_flags & BGE_FLAG_4G_BNDRY_BUG) != 0) + lowaddr = BUS_SPACE_MAXADDR_32BIT; /* * Allocate the parent bus DMA tag appropriate for PCI. */ error = bus_dma_tag_create(bus_get_dma_tag(sc->bge_dev), - 1, 0, BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL, + 1, 0, lowaddr, BUS_SPACE_MAXADDR, NULL, NULL, BUS_SPACE_MAXSIZE_32BIT, 0, BUS_SPACE_MAXSIZE_32BIT, 0, NULL, NULL, &sc->bge_cdata.bge_parent_tag); @@ -2566,6 +2572,16 @@ bge_attach(device_t dev) sc->bge_flags |= BGE_FLAG_BER_BUG; } + /* + * All controllers that are not 5755 or higher have 4GB + * boundary DMA bug. + * Whenever an address crosses a multiple of the 4GB boundary + * (including 4GB, 8Gb, 12Gb, etc.) and makes the transition + * from 0xX_FFFF_FFFF to 0x(X+1)_0000_0000 an internal DMA + * state machine will lockup and cause the device to hang. + */ + if (BGE_IS_5755_PLUS(sc) == 0) + sc->bge_flags |= BGE_FLAG_4G_BNDRY_BUG; /* * We could possibly check for BCOM_DEVICEID_BCM5788 in bge_probe() @@ -2729,6 +2745,13 @@ bge_attach(device_t dev) #ifdef DEVICE_POLLING ifp->if_capabilities |= IFCAP_POLLING; #endif + /* + * The 40bit DMA bug applies to the 5714/5715 controllers and is + * not actually a MAC controller bug but an issue with the embedded + * PCIe to PCI-X bridge in the device. Use 40bit DMA workaround. + */ + if (BGE_IS_5714_FAMILY(sc) && (sc->bge_flags & BGE_FLAG_PCIX)) + sc->bge_flags |= BGE_FLAG_40BIT_BUG; /* * 5700 B0 chips do not support checksumming correctly due Modified: head/sys/dev/bge/if_bgereg.h ============================================================================== --- head/sys/dev/bge/if_bgereg.h Sun Nov 22 20:45:15 2009 (r199669) +++ head/sys/dev/bge/if_bgereg.h Sun Nov 22 20:50:27 2009 (r199670) @@ -2484,6 +2484,13 @@ struct bge_gib { #define BGE_NSEG_JUMBO 4 #define BGE_NSEG_NEW 32 +/* Maximum DMA address for controllers that have 40bit DMA address bug. */ +#if (BUS_SPACE_MAXADDR < 0xFFFFFFFFFF) +#define BGE_DMA_MAXADDR BUS_SPACE_MAXADDR +#else +#define BGE_DMA_MAXADDR 0xFFFFFFFFFF +#endif + /* * Ring structures. Most of these reside in host memory and we tell * the NIC where they are via the ring control blocks. The exceptions @@ -2600,6 +2607,8 @@ struct bge_softc { #define BGE_FLAG_5714_FAMILY 0x00004000 #define BGE_FLAG_575X_PLUS 0x00008000 #define BGE_FLAG_5755_PLUS 0x00010000 +#define BGE_FLAG_40BIT_BUG 0x00020000 +#define BGE_FLAG_4G_BNDRY_BUG 0x00040000 #define BGE_FLAG_RX_ALIGNBUG 0x00100000 #define BGE_FLAG_NO_3LED 0x00200000 #define BGE_FLAG_ADC_BUG 0x00400000 From owner-svn-src-all@FreeBSD.ORG Sun Nov 22 21:16:31 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3596C1065693; Sun, 22 Nov 2009 21:16:31 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 243528FC14; Sun, 22 Nov 2009 21:16:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAMLGVM7029690; Sun, 22 Nov 2009 21:16:31 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAMLGUdC029687; Sun, 22 Nov 2009 21:16:30 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200911222116.nAMLGUdC029687@svn.freebsd.org> From: Pyun YongHyeon Date: Sun, 22 Nov 2009 21:16:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199671 - head/sys/dev/bge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Nov 2009 21:16:31 -0000 Author: yongari Date: Sun Nov 22 21:16:30 2009 New Revision: 199671 URL: http://svn.freebsd.org/changeset/base/199671 Log: Implement TSO for BCM5755 or newer controllers. Some controllers seem to require a special firmware to use TSO. But the firmware is not available to FreeBSD and Linux claims that the TSO performed by the firmware is slower than hardware based TSO. Moreover the firmware based TSO has one known bug which can't handle TSO if ethernet header + IP/TCP header is greater than 80 bytes. The workaround for the TSO bug exist but it seems it's too expensive than not using TSO at all. Some hardwares also have the TSO bug so limit the TSO to the controllers that are not affected TSO issues (e.g. 5755 or higher). While I'm here set VLAN tag bit to all descriptors that belengs to a frame instead of the first descriptor of a frame. The datasheet is not clear how to handle VLAN tag bit but it worked either way in my testing. This makes it simplify TSO configuration a little bit. Big thanks to davidch@ who sent me detailed TSO information. Without this I was not able to implement it. Tested by: current Modified: head/sys/dev/bge/if_bge.c head/sys/dev/bge/if_bgereg.h Modified: head/sys/dev/bge/if_bge.c ============================================================================== --- head/sys/dev/bge/if_bge.c Sun Nov 22 20:50:27 2009 (r199670) +++ head/sys/dev/bge/if_bge.c Sun Nov 22 21:16:30 2009 (r199671) @@ -96,6 +96,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -1811,6 +1812,8 @@ bge_blockinit(struct bge_softc *sc) BGE_RDMAMODE_MBUF_SBD_CRPT_ATTN; if (sc->bge_flags & BGE_FLAG_PCIE) val |= BGE_RDMAMODE_FIFO_LONG_BURST; + if (sc->bge_flags & BGE_FLAG_TSO) + val |= BGE_RDMAMODE_TSO4_ENABLE; CSR_WRITE_4(sc, BGE_RDMA_MODE, val); DELAY(40); @@ -1837,7 +1840,10 @@ bge_blockinit(struct bge_softc *sc) CSR_WRITE_4(sc, BGE_SDC_MODE, val); /* Turn on send data initiator state machine */ - CSR_WRITE_4(sc, BGE_SDI_MODE, BGE_SDIMODE_ENABLE); + if (sc->bge_flags & BGE_FLAG_TSO) + CSR_WRITE_4(sc, BGE_SDI_MODE, BGE_SDIMODE_ENABLE | 0x08); + else + CSR_WRITE_4(sc, BGE_SDI_MODE, BGE_SDIMODE_ENABLE); /* Turn on send BD initiator state machine */ CSR_WRITE_4(sc, BGE_SBDI_MODE, BGE_SBDIMODE_ENABLE); @@ -2105,6 +2111,7 @@ bge_dma_alloc(device_t dev) struct bge_dmamap_arg ctx; struct bge_softc *sc; bus_addr_t lowaddr; + bus_size_t txsegsz, txmaxsegsz; int i, error; sc = device_get_softc(dev); @@ -2131,10 +2138,17 @@ bge_dma_alloc(device_t dev) /* * Create tag for Tx mbufs. */ + if (sc->bge_flags & BGE_FLAG_TSO) { + txsegsz = BGE_TSOSEG_SZ; + txmaxsegsz = 65535 + sizeof(struct ether_vlan_header); + } else { + txsegsz = MCLBYTES; + txmaxsegsz = MCLBYTES * BGE_NSEG_NEW; + } error = bus_dma_tag_create(sc->bge_cdata.bge_parent_tag, 1, - 0, BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL, - NULL, MCLBYTES * BGE_NSEG_NEW, BGE_NSEG_NEW, MCLBYTES, - BUS_DMA_ALLOCNOW, NULL, NULL, &sc->bge_cdata.bge_tx_mtag); + 0, BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL, NULL, + txmaxsegsz, BGE_NSEG_NEW, txsegsz, 0, NULL, NULL, + &sc->bge_cdata.bge_tx_mtag); if (error) { device_printf(sc->bge_dev, "could not allocate TX dma tag\n"); @@ -2146,7 +2160,7 @@ bge_dma_alloc(device_t dev) */ error = bus_dma_tag_create(sc->bge_cdata.bge_parent_tag, 1, 0, BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL, NULL, MCLBYTES, 1, - MCLBYTES, BUS_DMA_ALLOCNOW, NULL, NULL, &sc->bge_cdata.bge_rx_mtag); + MCLBYTES, 0, NULL, NULL, &sc->bge_cdata.bge_rx_mtag); if (error) { device_printf(sc->bge_dev, "could not allocate RX dma tag\n"); @@ -2592,6 +2606,21 @@ bge_attach(device_t dev) misccfg == BGE_MISCCFG_BOARD_ID_5788M) sc->bge_flags |= BGE_FLAG_5788; + /* + * Some controllers seem to require a special firmware to use + * TSO. But the firmware is not available to FreeBSD and Linux + * claims that the TSO performed by the firmware is slower than + * hardware based TSO. Moreover the firmware based TSO has one + * known bug which can't handle TSO if ethernet header + IP/TCP + * header is greater than 80 bytes. The workaround for the TSO + * bug exist but it seems it's too expensive than not using + * TSO at all. Some hardwares also have the TSO bug so limit + * the TSO to the controllers that are not affected TSO issues + * (e.g. 5755 or higher). + */ + if (BGE_IS_5755_PLUS(sc)) + sc->bge_flags |= BGE_FLAG_TSO; + /* * Check if this is a PCI-X or PCI Express device. */ @@ -2738,6 +2767,10 @@ bge_attach(device_t dev) ifp->if_hwassist = BGE_CSUM_FEATURES; ifp->if_capabilities = IFCAP_HWCSUM | IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_MTU; + if ((sc->bge_flags & BGE_FLAG_TSO) != 0) { + ifp->if_hwassist |= CSUM_TSO; + ifp->if_capabilities |= IFCAP_TSO4; + } #ifdef IFCAP_VLAN_HWCSUM ifp->if_capabilities |= IFCAP_VLAN_HWCSUM; #endif @@ -3752,6 +3785,72 @@ bge_cksum_pad(struct mbuf *m) return (0); } +static struct mbuf * +bge_setup_tso(struct bge_softc *sc, struct mbuf *m, uint16_t *mss) +{ + struct ether_header *eh; + struct ip *ip; + struct tcphdr *tcp; + struct mbuf *n; + uint16_t hlen; + uint32_t ip_off, poff; + + if (M_WRITABLE(m) == 0) { + /* Get a writable copy. */ + n = m_dup(m, M_DONTWAIT); + m_freem(m); + if (n == NULL) + return (NULL); + m = n; + } + ip_off = sizeof(struct ether_header); + m = m_pullup(m, ip_off); + if (m == NULL) + return (NULL); + eh = mtod(m, struct ether_header *); + /* Check the existence of VLAN tag. */ + if (eh->ether_type == htons(ETHERTYPE_VLAN)) { + ip_off = sizeof(struct ether_vlan_header); + m = m_pullup(m, ip_off); + if (m == NULL) + return (NULL); + } + m = m_pullup(m, ip_off + sizeof(struct ip)); + if (m == NULL) + return (NULL); + ip = (struct ip *)(mtod(m, char *) + ip_off); + poff = ip_off + (ip->ip_hl << 2); + m = m_pullup(m, poff + sizeof(struct tcphdr)); + if (m == NULL) + return (NULL); + tcp = (struct tcphdr *)(mtod(m, char *) + poff); + m = m_pullup(m, poff + sizeof(struct tcphdr) + tcp->th_off); + if (m == NULL) + return (NULL); + /* + * It seems controller doesn't modify IP length and TCP pseudo + * checksum. These checksum computed by upper stack should be 0. + */ + *mss = m->m_pkthdr.tso_segsz; + ip->ip_sum = 0; + ip->ip_len = htons(*mss + (ip->ip_hl << 2) + (tcp->th_off << 2)); + /* Clear pseudo checksum computed by TCP stack. */ + tcp->th_sum = 0; + /* + * Broadcom controllers uses different descriptor format for + * TSO depending on ASIC revision. Due to TSO-capable firmware + * license issue and lower performance of firmware based TSO + * we only support hardware based TSO which is applicable for + * BCM5755 or newer controllers. Hardware based TSO uses 11 + * bits to store MSS and upper 5 bits are used to store IP/TCP + * header length(including IP/TCP options). The header length + * is expressed as 32 bits unit. + */ + hlen = ((ip->ip_hl << 2) + (tcp->th_off << 2)) >> 2; + *mss |= (hlen << 11); + return (m); +} + /* * Encapsulate an mbuf chain in the tx ring by coupling the mbuf data * pointers to descriptors. @@ -3764,11 +3863,19 @@ bge_encap(struct bge_softc *sc, struct m struct bge_tx_bd *d; struct mbuf *m = *m_head; uint32_t idx = *txidx; - uint16_t csum_flags; + uint16_t csum_flags, mss, vlan_tag; int nsegs, i, error; csum_flags = 0; - if (m->m_pkthdr.csum_flags) { + mss = 0; + vlan_tag = 0; + if ((m->m_pkthdr.csum_flags & CSUM_TSO) != 0) { + *m_head = m = bge_setup_tso(sc, m, &mss); + if (*m_head == NULL) + return (ENOBUFS); + csum_flags |= BGE_TXBDFLAG_CPU_PRE_DMA | + BGE_TXBDFLAG_CPU_POST_DMA; + } else if ((m->m_pkthdr.csum_flags & BGE_CSUM_FEATURES) != 0) { if (m->m_pkthdr.csum_flags & CSUM_IP) csum_flags |= BGE_TXBDFLAG_IP_CSUM; if (m->m_pkthdr.csum_flags & (CSUM_TCP | CSUM_UDP)) { @@ -3815,12 +3922,29 @@ bge_encap(struct bge_softc *sc, struct m bus_dmamap_sync(sc->bge_cdata.bge_tx_mtag, map, BUS_DMASYNC_PREWRITE); +#if __FreeBSD_version > 700022 + if (m->m_flags & M_VLANTAG) { + csum_flags |= BGE_TXBDFLAG_VLAN_TAG; + vlan_tag = m->m_pkthdr.ether_vtag; + } +#else + { + struct m_tag *mtag; + + if ((mtag = VLAN_OUTPUT_TAG(sc->bge_ifp, m)) != NULL) { + csum_flags |= BGE_TXBDFLAG_VLAN_TAG; + vlan_tag = VLAN_TAG_VALUE(mtag); + } + } +#endif for (i = 0; ; i++) { d = &sc->bge_ldata.bge_tx_ring[idx]; d->bge_addr.bge_addr_lo = BGE_ADDR_LO(segs[i].ds_addr); d->bge_addr.bge_addr_hi = BGE_ADDR_HI(segs[i].ds_addr); d->bge_len = segs[i].ds_len; d->bge_flags = csum_flags; + d->bge_vlan_tag = vlan_tag; + d->bge_mss = mss; if (i == nsegs - 1) break; BGE_INC(idx, BGE_TX_RING_CNT); @@ -3829,26 +3953,6 @@ bge_encap(struct bge_softc *sc, struct m /* Mark the last segment as end of packet... */ d->bge_flags |= BGE_TXBDFLAG_END; - /* ... and put VLAN tag into first segment. */ - d = &sc->bge_ldata.bge_tx_ring[*txidx]; -#if __FreeBSD_version > 700022 - if (m->m_flags & M_VLANTAG) { - d->bge_flags |= BGE_TXBDFLAG_VLAN_TAG; - d->bge_vlan_tag = m->m_pkthdr.ether_vtag; - } else - d->bge_vlan_tag = 0; -#else - { - struct m_tag *mtag; - - if ((mtag = VLAN_OUTPUT_TAG(sc->bge_ifp, m)) != NULL) { - d->bge_flags |= BGE_TXBDFLAG_VLAN_TAG; - d->bge_vlan_tag = VLAN_TAG_VALUE(mtag); - } else - d->bge_vlan_tag = 0; - } -#endif - /* * Insure that the map for this transmission * is placed at the array index of the last descriptor @@ -4355,14 +4459,23 @@ bge_ioctl(struct ifnet *ifp, u_long comm ifp->if_capenable ^= IFCAP_HWCSUM; if (IFCAP_HWCSUM & ifp->if_capenable && IFCAP_HWCSUM & ifp->if_capabilities) - ifp->if_hwassist = BGE_CSUM_FEATURES; + ifp->if_hwassist |= BGE_CSUM_FEATURES; else - ifp->if_hwassist = 0; + ifp->if_hwassist &= ~BGE_CSUM_FEATURES; #ifdef VLAN_CAPABILITIES VLAN_CAPABILITIES(ifp); #endif } + if ((mask & IFCAP_TSO4) != 0 && + (ifp->if_capabilities & IFCAP_TSO4) != 0) { + ifp->if_capenable ^= IFCAP_TSO4; + if ((ifp->if_capenable & IFCAP_TSO4) != 0) + ifp->if_hwassist |= CSUM_TSO; + else + ifp->if_hwassist &= ~CSUM_TSO; + } + if (mask & IFCAP_VLAN_MTU) { ifp->if_capenable ^= IFCAP_VLAN_MTU; ifp->if_drv_flags &= ~IFF_DRV_RUNNING; Modified: head/sys/dev/bge/if_bgereg.h ============================================================================== --- head/sys/dev/bge/if_bgereg.h Sun Nov 22 20:50:27 2009 (r199670) +++ head/sys/dev/bge/if_bgereg.h Sun Nov 22 21:16:30 2009 (r199671) @@ -1402,6 +1402,8 @@ #define BGE_RDMAMODE_MBUF_SBD_CRPT_ATTN 0x00002000 #define BGE_RDMAMODE_FIFO_SIZE_128 0x00020000 #define BGE_RDMAMODE_FIFO_LONG_BURST 0x00030000 +#define BGE_RDMAMODE_TSO4_ENABLE 0x08000000 +#define BGE_RDMAMODE_TSO6_ENABLE 0x10000000 /* Read DMA status register */ #define BGE_RDMASTAT_PCI_TGT_ABRT_ATTN 0x00000004 @@ -1949,11 +1951,11 @@ struct bge_tx_bd { uint16_t bge_flags; uint16_t bge_len; uint16_t bge_vlan_tag; - uint16_t bge_rsvd; + uint16_t bge_mss; #else uint16_t bge_len; uint16_t bge_flags; - uint16_t bge_rsvd; + uint16_t bge_mss; uint16_t bge_vlan_tag; #endif }; @@ -2482,7 +2484,8 @@ struct bge_gib { #define BGE_JSLOTS 384 #define BGE_NSEG_JUMBO 4 -#define BGE_NSEG_NEW 32 +#define BGE_NSEG_NEW 32 +#define BGE_TSOSEG_SZ 4096 /* Maximum DMA address for controllers that have 40bit DMA address bug. */ #if (BUS_SPACE_MAXADDR < 0xFFFFFFFFFF) @@ -2602,6 +2605,7 @@ struct bge_softc { #define BGE_FLAG_MSI 0x00000100 #define BGE_FLAG_PCIX 0x00000200 #define BGE_FLAG_PCIE 0x00000400 +#define BGE_FLAG_TSO 0x00000800 #define BGE_FLAG_5700_FAMILY 0x00001000 #define BGE_FLAG_5705_PLUS 0x00002000 #define BGE_FLAG_5714_FAMILY 0x00004000 From owner-svn-src-all@FreeBSD.ORG Sun Nov 22 21:16:44 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EE3D310656A6; Sun, 22 Nov 2009 21:16:43 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DCD1D8FC1D; Sun, 22 Nov 2009 21:16:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAMLGh1v029737; Sun, 22 Nov 2009 21:16:43 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAMLGhej029729; Sun, 22 Nov 2009 21:16:43 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200911222116.nAMLGhej029729@svn.freebsd.org> From: Andrew Thompson Date: Sun, 22 Nov 2009 21:16:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199672 - in head/sys/dev/usb: . controller X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Nov 2009 21:16:44 -0000 Author: thompsa Date: Sun Nov 22 21:16:43 2009 New Revision: 199672 URL: http://svn.freebsd.org/changeset/base/199672 Log: Improve High Speed slot allocation mechanism by moving the computation to the endpoint rather than per xfer and provide functions around get/free of resources. Submitted by: Hans Petter Selasky Modified: head/sys/dev/usb/controller/ehci.c head/sys/dev/usb/usb_core.h head/sys/dev/usb/usb_device.c head/sys/dev/usb/usb_hub.c head/sys/dev/usb/usb_hub.h head/sys/dev/usb/usb_transfer.c head/sys/dev/usb/usbdi.h Modified: head/sys/dev/usb/controller/ehci.c ============================================================================== --- head/sys/dev/usb/controller/ehci.c Sun Nov 22 21:16:30 2009 (r199671) +++ head/sys/dev/usb/controller/ehci.c Sun Nov 22 21:16:43 2009 (r199672) @@ -2016,8 +2016,8 @@ ehci_setup_standard_chain(struct usb_xfe qh_endphub = (EHCI_QH_SET_MULT(xfer->max_packet_count & 3) | - EHCI_QH_SET_CMASK(xfer->usb_cmask) | - EHCI_QH_SET_SMASK(xfer->usb_smask) | + EHCI_QH_SET_CMASK(xfer->endpoint->usb_cmask) | + EHCI_QH_SET_SMASK(xfer->endpoint->usb_smask) | EHCI_QH_SET_HUBA(xfer->xroot->udev->hs_hub_addr) | EHCI_QH_SET_PORT(xfer->xroot->udev->hs_port_no)); @@ -2162,7 +2162,7 @@ ehci_isoc_hs_done(ehci_softc_t *sc, stru DPRINTFN(2, "status=0x%08x, len=%u\n", status, len); - if (xfer->usb_smask & (1 << td_no)) { + if (xfer->endpoint->usb_smask & (1 << td_no)) { if (*plen >= len) { /* @@ -2348,22 +2348,8 @@ ehci_device_intr_open(struct usb_xfer *x uint16_t best; uint16_t bit; uint16_t x; - uint8_t slot; - /* Allocate a microframe slot first: */ - - slot = usb_intr_schedule_adjust - (xfer->xroot->udev, xfer->max_frame_size, USB_HS_MICRO_FRAMES_MAX); - - if (usbd_get_speed(xfer->xroot->udev) == USB_SPEED_HIGH) { - xfer->usb_uframe = slot; - xfer->usb_smask = (1 << slot) & 0xFF; - xfer->usb_cmask = 0; - } else { - xfer->usb_uframe = slot; - xfer->usb_smask = (1 << slot) & 0x3F; - xfer->usb_cmask = (-(4 << slot)) & 0xFE; - } + usb_hs_bandwidth_alloc(xfer); /* * Find the best QH position corresponding to the given interval: @@ -2399,12 +2385,12 @@ ehci_device_intr_close(struct usb_xfer * { ehci_softc_t *sc = EHCI_BUS2SC(xfer->xroot->bus); - usb_intr_schedule_adjust(xfer->xroot->udev, - -(xfer->max_frame_size), xfer->usb_uframe); - sc->sc_intr_stat[xfer->qh_pos]--; ehci_device_done(xfer, USB_ERR_CANCELLED); + + /* bandwidth must be freed after device done */ + usb_hs_bandwidth_free(xfer); } static void @@ -2726,28 +2712,8 @@ ehci_device_isoc_hs_open(struct usb_xfer ehci_itd_t *td; uint32_t temp; uint8_t ds; - uint8_t slot; - - slot = usb_intr_schedule_adjust(xfer->xroot->udev, xfer->max_frame_size, - USB_HS_MICRO_FRAMES_MAX); - xfer->usb_uframe = slot; - xfer->usb_cmask = 0; - - switch (usbd_xfer_get_fps_shift(xfer)) { - case 0: - xfer->usb_smask = 0xFF; - break; - case 1: - xfer->usb_smask = 0x55 << (slot & 1); - break; - case 2: - xfer->usb_smask = 0x11 << (slot & 3); - break; - default: - xfer->usb_smask = 0x01 << (slot & 7); - break; - } + usb_hs_bandwidth_alloc(xfer); /* initialize all TD's */ @@ -2791,11 +2757,10 @@ ehci_device_isoc_hs_open(struct usb_xfer static void ehci_device_isoc_hs_close(struct usb_xfer *xfer) { - - usb_intr_schedule_adjust(xfer->xroot->udev, - -(xfer->max_frame_size), xfer->usb_uframe); - ehci_device_done(xfer, USB_ERR_CANCELLED); + + /* bandwidth must be freed after device done */ + usb_hs_bandwidth_free(xfer); } static void @@ -2905,7 +2870,7 @@ ehci_device_isoc_hs_enter(struct usb_xfe *plen = xfer->max_frame_size; } - if (xfer->usb_smask & (1 << td_no)) { + if (xfer->endpoint->usb_smask & (1 << td_no)) { status = (EHCI_ITD_SET_LEN(*plen) | EHCI_ITD_ACTIVE | EHCI_ITD_SET_PG(0)); Modified: head/sys/dev/usb/usb_core.h ============================================================================== --- head/sys/dev/usb/usb_core.h Sun Nov 22 21:16:30 2009 (r199671) +++ head/sys/dev/usb/usb_core.h Sun Nov 22 21:16:43 2009 (r199672) @@ -161,9 +161,6 @@ struct usb_xfer { uint8_t address; /* physical USB address */ uint8_t endpointno; /* physical USB endpoint */ uint8_t max_packet_count; - uint8_t usb_smask; - uint8_t usb_cmask; - uint8_t usb_uframe; uint8_t usb_state; uint8_t fps_shift; /* down shift of FPS, 0..3 */ Modified: head/sys/dev/usb/usb_device.c ============================================================================== --- head/sys/dev/usb/usb_device.c Sun Nov 22 21:16:30 2009 (r199671) +++ head/sys/dev/usb/usb_device.c Sun Nov 22 21:16:43 2009 (r199672) @@ -665,7 +665,7 @@ usb_config_parse(struct usb_device *udev /* look for matching endpoints */ if ((iface_index == USB_IFACE_INDEX_ANY) || (iface_index == ep->iface_index)) { - if (ep->refcount != 0) { + if (ep->refcount_alloc != 0) { /* * This typically indicates a * more serious error. Modified: head/sys/dev/usb/usb_hub.c ============================================================================== --- head/sys/dev/usb/usb_hub.c Sun Nov 22 21:16:30 2009 (r199671) +++ head/sys/dev/usb/usb_hub.c Sun Nov 22 21:16:43 2009 (r199672) @@ -1106,43 +1106,62 @@ done: * The best Transaction Translation slot for an interrupt endpoint. *------------------------------------------------------------------------*/ static uint8_t -usb_intr_find_best_slot(usb_size_t *ptr, uint8_t start, uint8_t end) +usb_intr_find_best_slot(usb_size_t *ptr, uint8_t start, + uint8_t end, uint8_t mask) { - usb_size_t max = 0 - 1; + usb_size_t min = 0 - 1; + usb_size_t sum; uint8_t x; uint8_t y; + uint8_t z; y = 0; /* find the last slot with lesser used bandwidth */ for (x = start; x < end; x++) { - if (max >= ptr[x]) { - max = ptr[x]; + + sum = 0; + + /* compute sum of bandwidth */ + for (z = x; z < end; z++) { + if (mask & (1U << (z - x))) + sum += ptr[z]; + } + + /* check if the current multi-slot is more optimal */ + if (min >= sum) { + min = sum; y = x; } + + /* check if the mask is about to be shifted out */ + if (mask & (1U << (end - 1 - x))) + break; } return (y); } /*------------------------------------------------------------------------* - * usb_intr_schedule_adjust + * usb_hs_bandwidth_adjust * * This function will update the bandwith usage for the microframe * having index "slot" by "len" bytes. "len" can be negative. If the * "slot" argument is greater or equal to "USB_HS_MICRO_FRAMES_MAX" * the "slot" argument will be replaced by the slot having least used - * bandwidth. + * bandwidth. The "mask" argument is used for multi-slot allocations. * * Returns: - * The slot on which the bandwidth update was done. + * The slot in which the bandwidth update was done: 0..7 *------------------------------------------------------------------------*/ -uint8_t -usb_intr_schedule_adjust(struct usb_device *udev, int16_t len, uint8_t slot) +static uint8_t +usb_hs_bandwidth_adjust(struct usb_device *udev, int16_t len, + uint8_t slot, uint8_t mask) { struct usb_bus *bus = udev->bus; struct usb_hub *hub; enum usb_dev_speed speed; + uint8_t x; USB_BUS_LOCK_ASSERT(bus, MA_OWNED); @@ -1164,23 +1183,157 @@ usb_intr_schedule_adjust(struct usb_devi hub = udev->parent_hs_hub->hub; if (slot >= USB_HS_MICRO_FRAMES_MAX) { slot = usb_intr_find_best_slot(hub->uframe_usage, - USB_FS_ISOC_UFRAME_MAX, 6); + USB_FS_ISOC_UFRAME_MAX, 6, mask); + } + for (x = slot; x < 8; x++) { + if (mask & (1U << (x - slot))) { + hub->uframe_usage[x] += len; + bus->uframe_usage[x] += len; + } } - hub->uframe_usage[slot] += len; - bus->uframe_usage[slot] += len; break; default: if (slot >= USB_HS_MICRO_FRAMES_MAX) { slot = usb_intr_find_best_slot(bus->uframe_usage, 0, - USB_HS_MICRO_FRAMES_MAX); + USB_HS_MICRO_FRAMES_MAX, mask); + } + for (x = slot; x < 8; x++) { + if (mask & (1U << (x - slot))) { + bus->uframe_usage[x] += len; + } } - bus->uframe_usage[slot] += len; break; } return (slot); } /*------------------------------------------------------------------------* + * usb_hs_bandwidth_alloc + * + * This function is a wrapper function for "usb_hs_bandwidth_adjust()". + *------------------------------------------------------------------------*/ +void +usb_hs_bandwidth_alloc(struct usb_xfer *xfer) +{ + struct usb_device *udev; + uint8_t slot; + uint8_t mask; + uint8_t speed; + + udev = xfer->xroot->udev; + + if (udev->flags.usb_mode != USB_MODE_HOST) + return; /* not supported */ + + xfer->endpoint->refcount_bw++; + if (xfer->endpoint->refcount_bw != 1) + return; /* already allocated */ + + speed = usbd_get_speed(udev); + + switch (xfer->endpoint->edesc->bmAttributes & UE_XFERTYPE) { + case UE_INTERRUPT: + /* allocate a microframe slot */ + + mask = 0x01; + slot = usb_hs_bandwidth_adjust(udev, + xfer->max_frame_size, USB_HS_MICRO_FRAMES_MAX, mask); + + xfer->endpoint->usb_uframe = slot; + xfer->endpoint->usb_smask = mask << slot; + + if ((speed != USB_SPEED_FULL) && + (speed != USB_SPEED_LOW)) { + xfer->endpoint->usb_cmask = 0x00 ; + } else { + xfer->endpoint->usb_cmask = (-(0x04 << slot)) & 0xFE; + } + break; + + case UE_ISOCHRONOUS: + switch (usbd_xfer_get_fps_shift(xfer)) { + case 0: + mask = 0xFF; + break; + case 1: + mask = 0x55; + break; + case 2: + mask = 0x11; + break; + default: + mask = 0x01; + break; + } + + /* allocate a microframe multi-slot */ + + slot = usb_hs_bandwidth_adjust(udev, + xfer->max_frame_size, USB_HS_MICRO_FRAMES_MAX, mask); + + xfer->endpoint->usb_uframe = slot; + xfer->endpoint->usb_cmask = 0; + xfer->endpoint->usb_smask = mask << slot; + break; + + default: + xfer->endpoint->usb_uframe = 0; + xfer->endpoint->usb_cmask = 0; + xfer->endpoint->usb_smask = 0; + break; + } + + DPRINTFN(11, "slot=%d, mask=0x%02x\n", + xfer->endpoint->usb_uframe, + xfer->endpoint->usb_smask >> xfer->endpoint->usb_uframe); +} + +/*------------------------------------------------------------------------* + * usb_hs_bandwidth_free + * + * This function is a wrapper function for "usb_hs_bandwidth_adjust()". + *------------------------------------------------------------------------*/ +void +usb_hs_bandwidth_free(struct usb_xfer *xfer) +{ + struct usb_device *udev; + uint8_t slot; + uint8_t mask; + + udev = xfer->xroot->udev; + + if (udev->flags.usb_mode != USB_MODE_HOST) + return; /* not supported */ + + xfer->endpoint->refcount_bw--; + if (xfer->endpoint->refcount_bw != 0) + return; /* still allocated */ + + switch (xfer->endpoint->edesc->bmAttributes & UE_XFERTYPE) { + case UE_INTERRUPT: + case UE_ISOCHRONOUS: + + slot = xfer->endpoint->usb_uframe; + mask = xfer->endpoint->usb_smask; + + /* free microframe slot(s): */ + usb_hs_bandwidth_adjust(udev, + -xfer->max_frame_size, slot, mask >> slot); + + DPRINTFN(11, "slot=%d, mask=0x%02x\n", + slot, mask >> slot); + + xfer->endpoint->usb_uframe = 0; + xfer->endpoint->usb_cmask = 0; + xfer->endpoint->usb_smask = 0; + break; + + default: + break; + } +} + +/*------------------------------------------------------------------------* * usbd_fs_isoc_schedule_init_sub * * This function initialises an USB FULL speed isochronous schedule Modified: head/sys/dev/usb/usb_hub.h ============================================================================== --- head/sys/dev/usb/usb_hub.h Sun Nov 22 21:16:30 2009 (r199671) +++ head/sys/dev/usb/usb_hub.h Sun Nov 22 21:16:43 2009 (r199672) @@ -66,8 +66,8 @@ struct usb_hub { /* function prototypes */ -uint8_t usb_intr_schedule_adjust(struct usb_device *udev, int16_t len, - uint8_t slot); +void usb_hs_bandwidth_alloc(struct usb_xfer *xfer); +void usb_hs_bandwidth_free(struct usb_xfer *xfer); void usbd_fs_isoc_schedule_init_all(struct usb_fs_isoc_schedule *fss); void usb_bus_port_set_device(struct usb_bus *bus, struct usb_port *up, struct usb_device *udev, uint8_t device_index); Modified: head/sys/dev/usb/usb_transfer.c ============================================================================== --- head/sys/dev/usb/usb_transfer.c Sun Nov 22 21:16:30 2009 (r199671) +++ head/sys/dev/usb/usb_transfer.c Sun Nov 22 21:16:43 2009 (r199672) @@ -942,10 +942,18 @@ usbd_transfer_setup(struct usb_device *u * configuration and alternate setting * when USB transfers are in use on * the given interface. Search the USB - * code for "endpoint->refcount" if you + * code for "endpoint->refcount_alloc" if you * want more information. */ - xfer->endpoint->refcount++; + USB_BUS_LOCK(info->bus); + if (xfer->endpoint->refcount_alloc >= USB_EP_REF_MAX) + parm.err = USB_ERR_INVAL; + + xfer->endpoint->refcount_alloc++; + + if (xfer->endpoint->refcount_alloc == 0) + panic("usbd_transfer_setup(): Refcount wrapped to zero\n"); + USB_BUS_UNLOCK(info->bus); /* * Whenever we set ppxfer[] then we @@ -960,6 +968,10 @@ usbd_transfer_setup(struct usb_device *u */ ppxfer[n] = xfer; } + + /* check for error */ + if (parm.err) + goto done; } if (buf || parm.err) { @@ -1179,7 +1191,9 @@ usbd_transfer_unsetup(struct usb_xfer ** * NOTE: default endpoint does not have an * interface, even if endpoint->iface_index == 0 */ - xfer->endpoint->refcount--; + USB_BUS_LOCK(info->bus); + xfer->endpoint->refcount_alloc--; + USB_BUS_UNLOCK(info->bus); usb_callout_drain(&xfer->timeout_handle); Modified: head/sys/dev/usb/usbdi.h ============================================================================== --- head/sys/dev/usb/usbdi.h Sun Nov 22 21:16:30 2009 (r199671) +++ head/sys/dev/usb/usbdi.h Sun Nov 22 21:16:43 2009 (r199672) @@ -130,13 +130,22 @@ struct usb_endpoint { struct usb_pipe_methods *methods; /* set by HC driver */ uint16_t isoc_next; - uint16_t refcount; uint8_t toggle_next:1; /* next data toggle value */ uint8_t is_stalled:1; /* set if endpoint is stalled */ uint8_t is_synced:1; /* set if we a synchronised */ uint8_t unused:5; uint8_t iface_index; /* not used by "default endpoint" */ + + uint8_t refcount_alloc; /* allocation refcount */ + uint8_t refcount_bw; /* bandwidth refcount */ +#define USB_EP_REF_MAX 0x3f + + /* High-Speed resource allocation (valid if "refcount_bw" > 0) */ + + uint8_t usb_smask; /* USB start mask */ + uint8_t usb_cmask; /* USB complete mask */ + uint8_t usb_uframe; /* USB microframe */ }; /* From owner-svn-src-all@FreeBSD.ORG Sun Nov 22 21:19:02 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 39485106566C; Sun, 22 Nov 2009 21:19:02 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 28D068FC15; Sun, 22 Nov 2009 21:19:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAMLJ2uO029819; Sun, 22 Nov 2009 21:19:02 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAMLJ1rp029813; Sun, 22 Nov 2009 21:19:01 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200911222119.nAMLJ1rp029813@svn.freebsd.org> From: Andrew Thompson Date: Sun, 22 Nov 2009 21:19:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199673 - head/sys/dev/usb/controller X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Nov 2009 21:19:02 -0000 Author: thompsa Date: Sun Nov 22 21:19:01 2009 New Revision: 199673 URL: http://svn.freebsd.org/changeset/base/199673 Log: Initialise variable before use. Submitted by: Hans Petter Selasky 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/musb_otg.c head/sys/dev/usb/controller/uss820dci.c Modified: head/sys/dev/usb/controller/at91dci.c ============================================================================== --- head/sys/dev/usb/controller/at91dci.c Sun Nov 22 21:16:43 2009 (r199672) +++ head/sys/dev/usb/controller/at91dci.c Sun Nov 22 21:19:01 2009 (r199673) @@ -894,6 +894,7 @@ at91dci_setup_standard_chain(struct usb_ /* setup temp */ + temp.pc = NULL; temp.td = NULL; temp.td_next = xfer->td_start[0]; temp.offset = 0; Modified: head/sys/dev/usb/controller/atmegadci.c ============================================================================== --- head/sys/dev/usb/controller/atmegadci.c Sun Nov 22 21:16:43 2009 (r199672) +++ head/sys/dev/usb/controller/atmegadci.c Sun Nov 22 21:19:01 2009 (r199673) @@ -797,6 +797,7 @@ atmegadci_setup_standard_chain(struct us /* setup temp */ + temp.pc = NULL; temp.td = NULL; temp.td_next = xfer->td_start[0]; temp.offset = 0; Modified: head/sys/dev/usb/controller/avr32dci.c ============================================================================== --- head/sys/dev/usb/controller/avr32dci.c Sun Nov 22 21:16:43 2009 (r199672) +++ head/sys/dev/usb/controller/avr32dci.c Sun Nov 22 21:19:01 2009 (r199673) @@ -767,6 +767,7 @@ avr32dci_setup_standard_chain(struct usb /* setup temp */ + temp.pc = NULL; temp.td = NULL; temp.td_next = xfer->td_start[0]; temp.offset = 0; Modified: head/sys/dev/usb/controller/musb_otg.c ============================================================================== --- head/sys/dev/usb/controller/musb_otg.c Sun Nov 22 21:16:43 2009 (r199672) +++ head/sys/dev/usb/controller/musb_otg.c Sun Nov 22 21:19:01 2009 (r199673) @@ -1144,6 +1144,7 @@ musbotg_setup_standard_chain(struct usb_ /* setup temp */ + temp.pc = NULL; temp.td = NULL; temp.td_next = xfer->td_start[0]; temp.offset = 0; Modified: head/sys/dev/usb/controller/uss820dci.c ============================================================================== --- head/sys/dev/usb/controller/uss820dci.c Sun Nov 22 21:16:43 2009 (r199672) +++ head/sys/dev/usb/controller/uss820dci.c Sun Nov 22 21:19:01 2009 (r199673) @@ -858,6 +858,7 @@ uss820dci_setup_standard_chain(struct us /* setup temp */ + temp.pc = NULL; temp.td = NULL; temp.td_next = xfer->td_start[0]; temp.offset = 0; From owner-svn-src-all@FreeBSD.ORG Sun Nov 22 21:20:26 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B5B19106568D; Sun, 22 Nov 2009 21:20:26 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A586E8FC19; Sun, 22 Nov 2009 21:20:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAMLKQoT029885; Sun, 22 Nov 2009 21:20:26 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAMLKQ1g029883; Sun, 22 Nov 2009 21:20:26 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200911222120.nAMLKQ1g029883@svn.freebsd.org> From: Pyun YongHyeon Date: Sun, 22 Nov 2009 21:20:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199674 - head/sys/dev/bge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Nov 2009 21:20:26 -0000 Author: yongari Date: Sun Nov 22 21:20:26 2009 New Revision: 199674 URL: http://svn.freebsd.org/changeset/base/199674 Log: Add missing function prototype in r199671. Modified: head/sys/dev/bge/if_bge.c Modified: head/sys/dev/bge/if_bge.c ============================================================================== --- head/sys/dev/bge/if_bge.c Sun Nov 22 21:19:01 2009 (r199673) +++ head/sys/dev/bge/if_bge.c Sun Nov 22 21:20:26 2009 (r199674) @@ -370,6 +370,8 @@ static void bge_asf_driver_up (struct bg static void bge_tick(void *); static void bge_stats_update(struct bge_softc *); static void bge_stats_update_regs(struct bge_softc *); +static struct mbuf *bge_setup_tso(struct bge_softc *, struct mbuf *, + uint16_t *); static int bge_encap(struct bge_softc *, struct mbuf **, uint32_t *); static void bge_intr(void *); From owner-svn-src-all@FreeBSD.ORG Sun Nov 22 21:21:23 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3F7D71065672; Sun, 22 Nov 2009 21:21:23 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 24D128FC19; Sun, 22 Nov 2009 21:21:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAMLLNsb029951; Sun, 22 Nov 2009 21:21:23 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAMLLMjZ029940; Sun, 22 Nov 2009 21:21:22 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200911222121.nAMLLMjZ029940@svn.freebsd.org> From: Andrew Thompson Date: Sun, 22 Nov 2009 21:21:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199675 - in head/sys/dev/usb: . controller input storage X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Nov 2009 21:21:23 -0000 Author: thompsa Date: Sun Nov 22 21:21:22 2009 New Revision: 199675 URL: http://svn.freebsd.org/changeset/base/199675 Log: Provide tunables for some of the usb sysctls that affect boot behaviour. Submitted by: Andriy Gapon Modified: head/sys/dev/usb/controller/ehci.c head/sys/dev/usb/controller/ohci.c head/sys/dev/usb/controller/uhci.c head/sys/dev/usb/input/ukbd.c head/sys/dev/usb/storage/umass.c head/sys/dev/usb/usb_debug.c head/sys/dev/usb/usb_dev.c head/sys/dev/usb/usb_generic.c head/sys/dev/usb/usb_hub.c head/sys/dev/usb/usb_process.c Modified: head/sys/dev/usb/controller/ehci.c ============================================================================== --- head/sys/dev/usb/controller/ehci.c Sun Nov 22 21:20:26 2009 (r199674) +++ head/sys/dev/usb/controller/ehci.c Sun Nov 22 21:21:22 2009 (r199675) @@ -99,6 +99,9 @@ SYSCTL_INT(_hw_usb_ehci, OID_AUTO, debug SYSCTL_INT(_hw_usb_ehci, OID_AUTO, no_hs, CTLFLAG_RW, &ehcinohighspeed, 0, "Disable High Speed USB"); +TUNABLE_INT("hw.usb.ehci.debug", &ehcidebug); +TUNABLE_INT("hw.usb.ehci.no_hs", &ehcinohighspeed); + static void ehci_dump_regs(ehci_softc_t *sc); static void ehci_dump_sqh(ehci_softc_t *sc, ehci_qh_t *sqh); Modified: head/sys/dev/usb/controller/ohci.c ============================================================================== --- head/sys/dev/usb/controller/ohci.c Sun Nov 22 21:20:26 2009 (r199674) +++ head/sys/dev/usb/controller/ohci.c Sun Nov 22 21:21:22 2009 (r199675) @@ -84,6 +84,9 @@ static int ohcidebug = 0; SYSCTL_NODE(_hw_usb, OID_AUTO, ohci, CTLFLAG_RW, 0, "USB ohci"); SYSCTL_INT(_hw_usb_ohci, OID_AUTO, debug, CTLFLAG_RW, &ohcidebug, 0, "ohci debug level"); + +TUNABLE_INT("hw.usb.ohci.debug", &ohcidebug); + static void ohci_dumpregs(ohci_softc_t *); static void ohci_dump_tds(ohci_td_t *); static uint8_t ohci_dump_td(ohci_td_t *); Modified: head/sys/dev/usb/controller/uhci.c ============================================================================== --- head/sys/dev/usb/controller/uhci.c Sun Nov 22 21:20:26 2009 (r199674) +++ head/sys/dev/usb/controller/uhci.c Sun Nov 22 21:21:22 2009 (r199675) @@ -91,6 +91,10 @@ SYSCTL_INT(_hw_usb_uhci, OID_AUTO, debug &uhcidebug, 0, "uhci debug level"); SYSCTL_INT(_hw_usb_uhci, OID_AUTO, loop, CTLFLAG_RW, &uhcinoloop, 0, "uhci noloop"); + +TUNABLE_INT("hw.usb.uhci.debug", &uhcidebug); +TUNABLE_INT("hw.usb.uhci.loop", &uhcinoloop); + static void uhci_dumpregs(uhci_softc_t *sc); static void uhci_dump_tds(uhci_td_t *td); Modified: head/sys/dev/usb/input/ukbd.c ============================================================================== --- head/sys/dev/usb/input/ukbd.c Sun Nov 22 21:20:26 2009 (r199674) +++ head/sys/dev/usb/input/ukbd.c Sun Nov 22 21:21:22 2009 (r199675) @@ -105,6 +105,8 @@ SYSCTL_INT(_hw_usb_ukbd, OID_AUTO, debug SYSCTL_INT(_hw_usb_ukbd, OID_AUTO, no_leds, CTLFLAG_RW, &ukbd_no_leds, 0, "Disables setting of keyboard leds"); +TUNABLE_INT("hw.usb.ukbd.debug", &ukbd_debug); +TUNABLE_INT("hw.usb.ukbd.no_leds", &ukbd_no_leds); #endif #define UPROTO_BOOT_KEYBOARD 1 Modified: head/sys/dev/usb/storage/umass.c ============================================================================== --- head/sys/dev/usb/storage/umass.c Sun Nov 22 21:20:26 2009 (r199674) +++ head/sys/dev/usb/storage/umass.c Sun Nov 22 21:21:22 2009 (r199675) @@ -175,6 +175,8 @@ static int umass_debug = 0; SYSCTL_NODE(_hw_usb, OID_AUTO, umass, CTLFLAG_RW, 0, "USB umass"); SYSCTL_INT(_hw_usb_umass, OID_AUTO, debug, CTLFLAG_RW, &umass_debug, 0, "umass debug level"); + +TUNABLE_INT("hw.usb.umass.debug", &umass_debug); #else #define DIF(...) do { } while (0) #define DPRINTF(...) do { } while (0) Modified: head/sys/dev/usb/usb_debug.c ============================================================================== --- head/sys/dev/usb/usb_debug.c Sun Nov 22 21:20:26 2009 (r199674) +++ head/sys/dev/usb/usb_debug.c Sun Nov 22 21:21:22 2009 (r199675) @@ -67,6 +67,8 @@ SYSCTL_NODE(_hw, OID_AUTO, usb, CTLFLAG_ SYSCTL_INT(_hw_usb, OID_AUTO, debug, CTLFLAG_RW, &usb_debug, 0, "Debug level"); +TUNABLE_INT("hw.usb.debug", &usb_debug); + /*------------------------------------------------------------------------* * usb_dump_iface * Modified: head/sys/dev/usb/usb_dev.c ============================================================================== --- head/sys/dev/usb/usb_dev.c Sun Nov 22 21:20:26 2009 (r199674) +++ head/sys/dev/usb/usb_dev.c Sun Nov 22 21:21:22 2009 (r199675) @@ -85,6 +85,8 @@ static int usb_fifo_debug = 0; SYSCTL_NODE(_hw_usb, OID_AUTO, dev, CTLFLAG_RW, 0, "USB device"); SYSCTL_INT(_hw_usb_dev, OID_AUTO, debug, CTLFLAG_RW, &usb_fifo_debug, 0, "Debug Level"); + +TUNABLE_INT("hw.usb.dev.debug", &usb_fifo_debug); #endif #if ((__FreeBSD_version >= 700001) || (__FreeBSD_version == 0) || \ Modified: head/sys/dev/usb/usb_generic.c ============================================================================== --- head/sys/dev/usb/usb_generic.c Sun Nov 22 21:20:26 2009 (r199674) +++ head/sys/dev/usb/usb_generic.c Sun Nov 22 21:21:22 2009 (r199675) @@ -130,6 +130,8 @@ static int ugen_debug = 0; SYSCTL_NODE(_hw_usb, OID_AUTO, ugen, CTLFLAG_RW, 0, "USB generic"); SYSCTL_INT(_hw_usb_ugen, OID_AUTO, debug, CTLFLAG_RW, &ugen_debug, 0, "Debug level"); + +TUNABLE_INT("hw.usb.ugen.debug", &ugen_debug); #endif Modified: head/sys/dev/usb/usb_hub.c ============================================================================== --- head/sys/dev/usb/usb_hub.c Sun Nov 22 21:20:26 2009 (r199674) +++ head/sys/dev/usb/usb_hub.c Sun Nov 22 21:21:22 2009 (r199675) @@ -79,6 +79,8 @@ static int uhub_debug = 0; SYSCTL_NODE(_hw_usb, OID_AUTO, uhub, CTLFLAG_RW, 0, "USB HUB"); SYSCTL_INT(_hw_usb_uhub, OID_AUTO, debug, CTLFLAG_RW, &uhub_debug, 0, "Debug level"); + +TUNABLE_INT("hw.usb.uhub.debug", &uhub_debug); #endif #if USB_HAVE_POWERD Modified: head/sys/dev/usb/usb_process.c ============================================================================== --- head/sys/dev/usb/usb_process.c Sun Nov 22 21:20:26 2009 (r199674) +++ head/sys/dev/usb/usb_process.c Sun Nov 22 21:21:22 2009 (r199675) @@ -83,6 +83,8 @@ static int usb_proc_debug; SYSCTL_NODE(_hw_usb, OID_AUTO, proc, CTLFLAG_RW, 0, "USB process"); SYSCTL_INT(_hw_usb_proc, OID_AUTO, debug, CTLFLAG_RW, &usb_proc_debug, 0, "Debug level"); + +TUNABLE_INT("hw.usb.proc.debug", &usb_proc_debug); #endif /*------------------------------------------------------------------------* From owner-svn-src-all@FreeBSD.ORG Sun Nov 22 21:24:39 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 104121065670; Sun, 22 Nov 2009 21:24:39 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F3B4D8FC12; Sun, 22 Nov 2009 21:24:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAMLOcIJ030056; Sun, 22 Nov 2009 21:24:38 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAMLOc0m030054; Sun, 22 Nov 2009 21:24:38 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200911222124.nAMLOc0m030054@svn.freebsd.org> From: Andrew Thompson Date: Sun, 22 Nov 2009 21:24:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199676 - head/sys/dev/usb/controller X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Nov 2009 21:24:39 -0000 Author: thompsa Date: Sun Nov 22 21:24:38 2009 New Revision: 199676 URL: http://svn.freebsd.org/changeset/base/199676 Log: Correct register access for USB device side operation on the musb controller. Submitted by: Hans Petter Selasky Modified: head/sys/dev/usb/controller/musb_otg.c Modified: head/sys/dev/usb/controller/musb_otg.c ============================================================================== --- head/sys/dev/usb/controller/musb_otg.c Sun Nov 22 21:21:22 2009 (r199675) +++ head/sys/dev/usb/controller/musb_otg.c Sun Nov 22 21:24:38 2009 (r199676) @@ -1539,18 +1539,18 @@ musbotg_clear_stall_sub(struct musbotg_s /* Configure endpoint */ switch (ep_type) { case UE_INTERRUPT: - MUSB2_WRITE_1(sc, MUSB2_REG_TXMAXP, wMaxPacket); + MUSB2_WRITE_2(sc, MUSB2_REG_TXMAXP, wMaxPacket); MUSB2_WRITE_1(sc, MUSB2_REG_TXCSRH, MUSB2_MASK_CSRH_TXMODE | temp); break; case UE_ISOCHRONOUS: - MUSB2_WRITE_1(sc, MUSB2_REG_TXMAXP, wMaxPacket); + MUSB2_WRITE_2(sc, MUSB2_REG_TXMAXP, wMaxPacket); MUSB2_WRITE_1(sc, MUSB2_REG_TXCSRH, MUSB2_MASK_CSRH_TXMODE | MUSB2_MASK_CSRH_TXISO | temp); break; case UE_BULK: - MUSB2_WRITE_1(sc, MUSB2_REG_TXMAXP, wMaxPacket); + MUSB2_WRITE_2(sc, MUSB2_REG_TXMAXP, wMaxPacket); MUSB2_WRITE_1(sc, MUSB2_REG_TXCSRH, MUSB2_MASK_CSRH_TXMODE | temp); break; @@ -1600,18 +1600,18 @@ musbotg_clear_stall_sub(struct musbotg_s /* Configure endpoint */ switch (ep_type) { case UE_INTERRUPT: - MUSB2_WRITE_1(sc, MUSB2_REG_RXMAXP, wMaxPacket); + MUSB2_WRITE_2(sc, MUSB2_REG_RXMAXP, wMaxPacket); MUSB2_WRITE_1(sc, MUSB2_REG_RXCSRH, MUSB2_MASK_CSRH_RXNYET | temp); break; case UE_ISOCHRONOUS: - MUSB2_WRITE_1(sc, MUSB2_REG_RXMAXP, wMaxPacket); + MUSB2_WRITE_2(sc, MUSB2_REG_RXMAXP, wMaxPacket); MUSB2_WRITE_1(sc, MUSB2_REG_RXCSRH, MUSB2_MASK_CSRH_RXNYET | MUSB2_MASK_CSRH_RXISO | temp); break; case UE_BULK: - MUSB2_WRITE_1(sc, MUSB2_REG_RXMAXP, wMaxPacket); + MUSB2_WRITE_2(sc, MUSB2_REG_RXMAXP, wMaxPacket); MUSB2_WRITE_1(sc, MUSB2_REG_RXCSRH, temp); break; default: @@ -1688,12 +1688,14 @@ usb_error_t musbotg_init(struct musbotg_softc *sc) { struct usb_hw_ep_profile *pf; + uint16_t offset; uint8_t nrx; uint8_t ntx; uint8_t temp; uint8_t fsize; uint8_t frx; uint8_t ftx; + uint8_t dynfifo; DPRINTFN(1, "start\n"); @@ -1776,11 +1778,20 @@ musbotg_init(struct musbotg_softc *sc) DPRINTFN(2, "Config Data: 0x%02x\n", sc->sc_conf_data); + dynfifo = (sc->sc_conf_data & MUSB2_MASK_CD_DYNFIFOSZ) ? 1 : 0; + + if (dynfifo) { + DPRINTFN(0, "Dynamic FIFO sizing detected! " + "Assuming 16Kbytes of FIFO RAM\n"); + } + DPRINTFN(2, "HW version: 0x%04x\n", MUSB2_READ_1(sc, MUSB2_REG_HWVERS)); /* initialise endpoint profiles */ + offset = 0; + for (temp = 1; temp <= sc->sc_ep_max; temp++) { pf = sc->sc_hw_ep_profile + temp; @@ -1791,9 +1802,45 @@ musbotg_init(struct musbotg_softc *sc) frx = (fsize & MUSB2_MASK_RX_FSIZE) / 16;; ftx = (fsize & MUSB2_MASK_TX_FSIZE); - DPRINTF("Endpoint %u FIFO size: IN=%u, OUT=%u\n", - temp, pf->max_in_frame_size, - pf->max_out_frame_size); + DPRINTF("Endpoint %u FIFO size: IN=%u, OUT=%u, DYN=%d\n", + temp, ftx, frx, dynfifo); + + if (dynfifo) { + if (frx && (temp <= nrx)) { + if (temp < 8) { + frx = 10; /* 1K */ + MUSB2_WRITE_1(sc, MUSB2_REG_RXFIFOSZ, + MUSB2_VAL_FIFOSZ_512 | + MUSB2_MASK_FIFODB); + } else { + frx = 7; /* 128 bytes */ + MUSB2_WRITE_1(sc, MUSB2_REG_RXFIFOSZ, + MUSB2_VAL_FIFOSZ_128); + } + + MUSB2_WRITE_2(sc, MUSB2_REG_RXFIFOADD, + offset >> 3); + + offset += (1 << frx); + } + if (ftx && (temp <= ntx)) { + if (temp < 8) { + ftx = 10; /* 1K */ + MUSB2_WRITE_1(sc, MUSB2_REG_TXFIFOSZ, + MUSB2_VAL_FIFOSZ_512 | + MUSB2_MASK_FIFODB); + } else { + ftx = 7; /* 128 bytes */ + MUSB2_WRITE_1(sc, MUSB2_REG_TXFIFOSZ, + MUSB2_VAL_FIFOSZ_128); + } + + MUSB2_WRITE_2(sc, MUSB2_REG_TXFIFOADD, + offset >> 3); + + offset += (1 << ftx); + } + } if (frx && ftx && (temp <= nrx) && (temp <= ntx)) { pf->max_in_frame_size = 1 << ftx; @@ -1824,6 +1871,8 @@ musbotg_init(struct musbotg_softc *sc) } } + DPRINTFN(2, "Dynamic FIFO size = %d bytes\n", offset); + /* turn on default interrupts */ MUSB2_WRITE_1(sc, MUSB2_REG_INTUSBE, From owner-svn-src-all@FreeBSD.ORG Sun Nov 22 21:26:28 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6ED5A1065676; Sun, 22 Nov 2009 21:26:28 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5E8E08FC13; Sun, 22 Nov 2009 21:26:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAMLQSGh030127; Sun, 22 Nov 2009 21:26:28 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAMLQS5R030125; Sun, 22 Nov 2009 21:26:28 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200911222126.nAMLQS5R030125@svn.freebsd.org> From: Andrew Thompson Date: Sun, 22 Nov 2009 21:26:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199677 - head/sys/dev/sound/usb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Nov 2009 21:26:28 -0000 Author: thompsa Date: Sun Nov 22 21:26:27 2009 New Revision: 199677 URL: http://svn.freebsd.org/changeset/base/199677 Log: add support for MIDI devices without audio control stream. Submitted by: Hans Petter Selasky Modified: head/sys/dev/sound/usb/uaudio.c Modified: head/sys/dev/sound/usb/uaudio.c ============================================================================== --- head/sys/dev/sound/usb/uaudio.c Sun Nov 22 21:24:38 2009 (r199676) +++ head/sys/dev/sound/usb/uaudio.c Sun Nov 22 21:26:27 2009 (r199677) @@ -559,6 +559,13 @@ uaudio_probe(device_t dev) else return (0); } + + /* check for MIDI stream */ + + if ((uaa->info.bInterfaceClass == UICLASS_AUDIO) && + (uaa->info.bInterfaceSubClass == UISUBCLASS_MIDISTREAM)) { + return (0); + } return (ENXIO); } From owner-svn-src-all@FreeBSD.ORG Sun Nov 22 21:31:31 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7F88A1065679; Sun, 22 Nov 2009 21:31:31 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6F36F8FC2D; Sun, 22 Nov 2009 21:31:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAMLVVOj030249; Sun, 22 Nov 2009 21:31:31 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAMLVVUB030247; Sun, 22 Nov 2009 21:31:31 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200911222131.nAMLVVUB030247@svn.freebsd.org> From: Andrew Thompson Date: Sun, 22 Nov 2009 21:31:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199678 - head/sys/dev/usb/controller X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Nov 2009 21:31:31 -0000 Author: thompsa Date: Sun Nov 22 21:31:31 2009 New Revision: 199678 URL: http://svn.freebsd.org/changeset/base/199678 Log: Add missed register change in r199676. Submitted by: Hans Petter Selasky Modified: head/sys/dev/usb/controller/musb_otg.h Modified: head/sys/dev/usb/controller/musb_otg.h ============================================================================== --- head/sys/dev/usb/controller/musb_otg.h Sun Nov 22 21:26:27 2009 (r199677) +++ head/sys/dev/usb/controller/musb_otg.h Sun Nov 22 21:31:31 2009 (r199678) @@ -191,7 +191,7 @@ #define MUSB2_REG_EPFIFO(n) (0x0020 + (4*(n))) -#define MUSB2_REG_CONFDATA 0x000F /* EPN=0 */ +#define MUSB2_REG_CONFDATA (0x000F + MUSB2_REG_INDEXED_CSR) /* EPN=0 */ #define MUSB2_MASK_CD_UTMI_DW 0x01 #define MUSB2_MASK_CD_SOFTCONE 0x02 #define MUSB2_MASK_CD_DYNFIFOSZ 0x04 From owner-svn-src-all@FreeBSD.ORG Sun Nov 22 21:45:55 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B98551065693; Sun, 22 Nov 2009 21:45:55 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9F0F98FC12; Sun, 22 Nov 2009 21:45:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAMLjtuN030610; Sun, 22 Nov 2009 21:45:55 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAMLjtgf030608; Sun, 22 Nov 2009 21:45:55 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200911222145.nAMLjtgf030608@svn.freebsd.org> From: Pyun YongHyeon Date: Sun, 22 Nov 2009 21:45:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199679 - head/sys/dev/bge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Nov 2009 21:45:55 -0000 Author: yongari Date: Sun Nov 22 21:45:55 2009 New Revision: 199679 URL: http://svn.freebsd.org/changeset/base/199679 Log: Reduce status block size DMAed by controller. bge(4) uses single Tx/Rx/Rx return ring such that large part of status block was not used at all. All bge(4) controllers except BCM5700 AX/BX has a feature to control the size of status block. So use minimum status block size allowed in controller. This reduces number of DMAed status block size to 32 bytes from 80 bytes. Modified: head/sys/dev/bge/if_bge.c Modified: head/sys/dev/bge/if_bge.c ============================================================================== --- head/sys/dev/bge/if_bge.c Sun Nov 22 21:31:31 2009 (r199678) +++ head/sys/dev/bge/if_bge.c Sun Nov 22 21:45:55 2009 (r199679) @@ -1757,8 +1757,15 @@ bge_blockinit(struct bge_softc *sc) sc->bge_ldata.bge_status_block->bge_idx[0].bge_rx_prod_idx = 0; sc->bge_ldata.bge_status_block->bge_idx[0].bge_tx_cons_idx = 0; + /* Set up status block size. */ + if (sc->bge_asicrev == BGE_ASICREV_BCM5700 && + sc->bge_chipid != BGE_CHIPID_BCM5700_C0) + val = BGE_STATBLKSZ_FULL; + else + val = BGE_STATBLKSZ_32BYTE; + /* Turn on host coalescing state machine */ - CSR_WRITE_4(sc, BGE_HCC_MODE, BGE_HCCMODE_ENABLE); + CSR_WRITE_4(sc, BGE_HCC_MODE, val | BGE_HCCMODE_ENABLE); /* Turn on RX BD completion state machine and enable attentions */ CSR_WRITE_4(sc, BGE_RBDC_MODE, @@ -2113,7 +2120,7 @@ bge_dma_alloc(device_t dev) struct bge_dmamap_arg ctx; struct bge_softc *sc; bus_addr_t lowaddr; - bus_size_t txsegsz, txmaxsegsz; + bus_size_t sbsz, txsegsz, txmaxsegsz; int i, error; sc = device_get_softc(dev); @@ -2365,14 +2372,25 @@ bge_dma_alloc(device_t dev) sc->bge_ldata.bge_tx_ring_paddr = ctx.bge_busaddr; - /* Create tag for status block. */ + /* + * Create tag for status block. + * Because we only use single Tx/Rx/Rx return ring, use + * minimum status block size except BCM5700 AX/BX which + * seems to want to see full status block size regardless + * of configured number of ring. + */ + if (sc->bge_asicrev == BGE_ASICREV_BCM5700 && + sc->bge_chipid != BGE_CHIPID_BCM5700_C0) + sbsz = BGE_STATUS_BLK_SZ; + else + sbsz = 32; error = bus_dma_tag_create(sc->bge_cdata.bge_parent_tag, PAGE_SIZE, 0, BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL, - NULL, BGE_STATUS_BLK_SZ, 1, BGE_STATUS_BLK_SZ, 0, - NULL, NULL, &sc->bge_cdata.bge_status_tag); + NULL, sbsz, 1, sbsz, 0, NULL, NULL, &sc->bge_cdata.bge_status_tag); if (error) { - device_printf(sc->bge_dev, "could not allocate dma tag\n"); + device_printf(sc->bge_dev, + "could not allocate status dma tag\n"); return (ENOMEM); } @@ -2383,7 +2401,7 @@ bge_dma_alloc(device_t dev) if (error) return (ENOMEM); - bzero((char *)sc->bge_ldata.bge_status_block, BGE_STATUS_BLK_SZ); + bzero((char *)sc->bge_ldata.bge_status_block, sbsz); /* Load the address of the status block. */ ctx.sc = sc; @@ -2391,7 +2409,7 @@ bge_dma_alloc(device_t dev) error = bus_dmamap_load(sc->bge_cdata.bge_status_tag, sc->bge_cdata.bge_status_map, sc->bge_ldata.bge_status_block, - BGE_STATUS_BLK_SZ, bge_dma_map_addr, &ctx, BUS_DMA_NOWAIT); + sbsz, bge_dma_map_addr, &ctx, BUS_DMA_NOWAIT); if (error) return (ENOMEM); From owner-svn-src-all@FreeBSD.ORG Sun Nov 22 21:53:10 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2639B106566B; Sun, 22 Nov 2009 21:53:10 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 155ED8FC16; Sun, 22 Nov 2009 21:53:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAMLr9DV030983; Sun, 22 Nov 2009 21:53:09 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAMLr99Z030981; Sun, 22 Nov 2009 21:53:09 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200911222153.nAMLr99Z030981@svn.freebsd.org> From: Andrew Thompson Date: Sun, 22 Nov 2009 21:53:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199680 - head/sys/dev/usb/input X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Nov 2009 21:53:10 -0000 Author: thompsa Date: Sun Nov 22 21:53:09 2009 New Revision: 199680 URL: http://svn.freebsd.org/changeset/base/199680 Log: Make the mode setting transfer asynchronous. Submitted by: Rohit Grover Modified: head/sys/dev/usb/input/atp.c Modified: head/sys/dev/usb/input/atp.c ============================================================================== --- head/sys/dev/usb/input/atp.c Sun Nov 22 21:45:55 2009 (r199679) +++ head/sys/dev/usb/input/atp.c Sun Nov 22 21:53:09 2009 (r199680) @@ -341,6 +341,7 @@ typedef struct atp_stroke { enum { ATP_INTR_DT, + ATP_RESET, ATP_N_TRANSFER, }; @@ -421,6 +422,7 @@ static struct usb_fifo_methods atp_fifo_ /* device initialization and shutdown */ static usb_error_t atp_req_get_report(struct usb_device *udev, void *data); static int atp_set_device_mode(device_t dev, interface_mode mode); +static void atp_reset_callback(struct usb_xfer *, usb_error_t); static int atp_enable(struct atp_softc *sc); static void atp_disable(struct atp_softc *sc); static int atp_softc_populate(struct atp_softc *); @@ -501,6 +503,40 @@ atp_set_device_mode(device_t dev, interf return (0); } +void +atp_reset_callback(struct usb_xfer *xfer, usb_error_t error) +{ + usb_device_request_t req; + struct usb_page_cache *pc; + struct atp_softc *sc = usbd_xfer_softc(xfer); + + switch (USB_GET_STATE(xfer)) { + case USB_ST_SETUP: + sc->sc_mode_bytes[0] = RAW_SENSOR_MODE; + req.bmRequestType = UT_WRITE_CLASS_INTERFACE; + req.bRequest = UR_SET_REPORT; + USETW2(req.wValue, + (uint8_t)0x03 /* type */, (uint8_t)0x00 /* id */); + USETW(req.wIndex, 0); + USETW(req.wLength, MODE_LENGTH); + + pc = usbd_xfer_get_frame(xfer, 0); + usbd_copy_in(pc, 0, &req, sizeof(req)); + pc = usbd_xfer_get_frame(xfer, 1); + usbd_copy_in(pc, 0, sc->sc_mode_bytes, MODE_LENGTH); + + usbd_xfer_set_frame_len(xfer, 0, sizeof(req)); + usbd_xfer_set_frame_len(xfer, 1, MODE_LENGTH); + usbd_xfer_set_frames(xfer, 2); + usbd_transfer_submit(xfer); + break; + + case USB_ST_TRANSFERRED: + default: + break; + } +} + static int atp_enable(struct atp_softc *sc) { @@ -1515,6 +1551,14 @@ static const struct usb_config atp_confi .bufsize = 0, /* use wMaxPacketSize */ .callback = &atp_intr, }, + [ATP_RESET] = { + .type = UE_CONTROL, + .endpoint = 0, /* Control pipe */ + .direction = UE_DIR_ANY, + .bufsize = sizeof(struct usb_device_request) + MODE_LENGTH, + .callback = &atp_reset_callback, + .interval = 0, /* no pre-delay */ + }, }; static int @@ -1529,10 +1573,7 @@ atp_probe(device_t self) (uaa->info.bInterfaceProtocol != UIPROTO_MOUSE)) return (ENXIO); - if (usbd_lookup_id_by_uaa(atp_devs, sizeof(atp_devs), uaa) == 0) - return BUS_PROBE_SPECIFIC; - else - return ENXIO; + return (usbd_lookup_id_by_uaa(atp_devs, sizeof(atp_devs), uaa)); } static int @@ -1542,12 +1583,6 @@ atp_attach(device_t dev) struct usb_attach_arg *uaa = device_get_ivars(dev); usb_error_t err; - /* ensure that the probe was successful */ - if (uaa->driver_info >= ATP_N_DEV_PARAMS) { - DPRINTF("device probe returned bad id: %lu\n", - uaa->driver_info); - return (ENXIO); - } DPRINTFN(ATP_LLEVEL_INFO, "sc=%p\n", sc); sc->sc_dev = dev; @@ -1626,7 +1661,6 @@ static int atp_detach(device_t dev) { struct atp_softc *sc; - int err; sc = device_get_softc(dev); if (sc->sc_state & ATP_ENABLED) { @@ -1641,12 +1675,6 @@ atp_detach(device_t dev) mtx_destroy(&sc->sc_mutex); - err = atp_set_device_mode(dev, HID_MODE); - if (err != 0) { - DPRINTF("failed to reset mode to 'HID' (%d)\n", err); - return (err); - } - return (0); } @@ -1823,10 +1851,7 @@ atp_intr(struct usb_xfer *xfer, usb_erro if (sc->sc_idlecount >= ATP_IDLENESS_THRESHOLD) { DPRINTFN(ATP_LLEVEL_INFO, "idle\n"); sc->sc_idlecount = 0; - - mtx_unlock(&sc->sc_mutex); - atp_set_device_mode(sc->sc_dev,RAW_SENSOR_MODE); - mtx_lock(&sc->sc_mutex); + usbd_transfer_start(sc->sc_xfer[ATP_RESET]); } } else { sc->sc_idlecount = 0; From owner-svn-src-all@FreeBSD.ORG Sun Nov 22 22:07:54 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7C266106566B; Sun, 22 Nov 2009 22:07:54 +0000 (UTC) (envelope-from oliver.pntr@gmail.com) Received: from mail-bw0-f213.google.com (mail-bw0-f213.google.com [209.85.218.213]) by mx1.freebsd.org (Postfix) with ESMTP id 4FD4E8FC19; Sun, 22 Nov 2009 22:07:52 +0000 (UTC) Received: by bwz5 with SMTP id 5so4912264bwz.3 for ; Sun, 22 Nov 2009 14:07:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type; bh=hGp8b+hi9cNVy+tQxZjXd4BdQQDp039kPgtr3fum1Hg=; b=kaFJg6e6YUvwTOK9jwWgt8zSj7vyRltVHgpUpaBdSXSOTN1EuiPyAkdeeV5HyJb25h /NswNNQEvm4W6VrE1eNQePCfueMwaX1U5J3RdnUNx9GYnb346yD1ISNKCW2daMq3mfsy ixSbZRC8ft+o119Oo0fPdYsmkXKuDOzKQfZpA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=lO5Wo8oCk1lnhDHnj6/j28nHXIQhlNnqEaeXINJeHgWFreryoH26C2SR/6biaw/JL/ BRdICAe7iPIK6ljoHWunZztP3GIMP8aSoKBtnlZ9YUbxP+JMq2w+3pGSKYe3mupOT1Dm RGrGSKphjy21iM0UgC6iGFD6lxJAjgpVag/Gk= MIME-Version: 1.0 Received: by 10.204.154.216 with SMTP id p24mr4005862bkw.16.1258927672003; Sun, 22 Nov 2009 14:07:52 -0800 (PST) In-Reply-To: <200911221609.nAMG9REa022880@svn.freebsd.org> References: <200911221609.nAMG9REa022880@svn.freebsd.org> Date: Sun, 22 Nov 2009 22:07:51 +0000 Message-ID: <6101e8c40911221407w54fbac5bn590b8c21c37ced11@mail.gmail.com> From: Oliver Pinter To: Attilio Rao Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org Subject: Re: svn commit: r199652 - stable/8/sys/fs/fifofs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Nov 2009 22:07:54 -0000 this for 7-STABLE? On 11/22/09, Attilio Rao wrote: > Author: attilio > Date: Sun Nov 22 16:09:27 2009 > New Revision: 199652 > URL: http://svn.freebsd.org/changeset/base/199652 > > Log: > MFC r199007: > Fix a memory leak. > > Modified: > stable/8/sys/fs/fifofs/fifo_vnops.c > Directory Properties: > stable/8/sys/ (props changed) > stable/8/sys/amd64/include/xen/ (props changed) > stable/8/sys/cddl/contrib/opensolaris/ (props changed) > stable/8/sys/contrib/dev/acpica/ (props changed) > stable/8/sys/contrib/pf/ (props changed) > stable/8/sys/dev/xen/xenpci/ (props changed) > > Modified: stable/8/sys/fs/fifofs/fifo_vnops.c > ============================================================================== > --- stable/8/sys/fs/fifofs/fifo_vnops.c Sun Nov 22 16:04:49 2009 (r199651) > +++ stable/8/sys/fs/fifofs/fifo_vnops.c Sun Nov 22 16:09:27 2009 (r199652) > @@ -78,6 +78,10 @@ struct fileops fifo_ops_f = { > /* > * This structure is associated with the FIFO vnode and stores > * the state associated with the FIFO. > + * Notes about locking: > + * - fi_readsock and fi_writesock are invariant since init time. > + * - fi_readers and fi_writers are vnode lock protected. > + * - fi_wgen is fif_mtx lock protected. > */ > struct fifoinfo { > struct socket *fi_readsock; > @@ -215,14 +219,9 @@ fail1: > } > > /* > - * General access to fi_readers and fi_writers is protected using > - * the vnode lock. > - * > - * Protect the increment of fi_readers and fi_writers and the > - * associated calls to wakeup() with the fifo mutex in addition > - * to the vnode lock. This allows the vnode lock to be dropped > - * for the msleep() calls below, and using the fifo mutex with > - * msleep() prevents the wakeup from being missed. > + * Use the fifo_mtx lock here, in addition to the vnode lock, > + * in order to allow vnode lock dropping before msleep() calls > + * and still avoiding missed wakeups. > */ > mtx_lock(&fifo_mtx); > if (ap->a_mode & FREAD) { > @@ -241,6 +240,8 @@ fail1: > if (ap->a_mode & FWRITE) { > if ((ap->a_mode & O_NONBLOCK) && fip->fi_readers == 0) { > mtx_unlock(&fifo_mtx); > + if (fip->fi_writers == 0) > + fifo_cleanup(vp); > return (ENXIO); > } > fip->fi_writers++; > _______________________________________________ > svn-src-stable@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/svn-src-stable > To unsubscribe, send any mail to "svn-src-stable-unsubscribe@freebsd.org" > From owner-svn-src-all@FreeBSD.ORG Sun Nov 22 22:09:52 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9567E106566B; Sun, 22 Nov 2009 22:09:52 +0000 (UTC) (envelope-from oliver.pntr@gmail.com) Received: from mail-bw0-f213.google.com (mail-bw0-f213.google.com [209.85.218.213]) by mx1.freebsd.org (Postfix) with ESMTP id 73F228FC16; Sun, 22 Nov 2009 22:09:51 +0000 (UTC) Received: by bwz5 with SMTP id 5so4912971bwz.3 for ; Sun, 22 Nov 2009 14:09:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type; bh=wFnoUz9INiv/W6/pPvaX3xvXLsB7/GVlcav9p8RHeFU=; b=x8+NbD3hQNAzsXP5ojURZehjY3zbEp/kor0H+dQabIkK0txTq/ZjEIjvJOavSbx5/B vUEkoTxNEcdZ8bSrBu7ybC7NpnaLi36ioyI0zTIXRzCCYCM7cbVap1hkn47WBar3z8XJ MofTfbefxFjNGQNZ3tIDFWcIfGqBwXpQwP9Uw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=uHnnEti4MAA1UALTioLqtpjP/Xfl1GPgqUvibpmP06jxIQyl7viDgMW9rql/QoqzBa ZoQhFQI5yMtKqqf/BKXrUeT91yhPzCGb7zNTfsjCG0mEY3wBECQqc37UVhEwD+G8q+pB owg30pqXIV+Q0sXobJNKe3b0NqS9NsTLkwxio= MIME-Version: 1.0 Received: by 10.204.7.87 with SMTP id c23mr3892574bkc.97.1258927790587; Sun, 22 Nov 2009 14:09:50 -0800 (PST) In-Reply-To: <200911221553.nAMFrd8K022397@svn.freebsd.org> References: <200911221553.nAMFrd8K022397@svn.freebsd.org> Date: Sun, 22 Nov 2009 22:09:50 +0000 Message-ID: <6101e8c40911221409j2a5af5e1ja6de3f0712c07f8d@mail.gmail.com> From: Oliver Pinter To: Attilio Rao Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org Subject: Re: svn commit: r199649 - stable/8/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Nov 2009 22:09:52 -0000 and this too for 7-STABLE On 11/22/09, Attilio Rao wrote: > Author: attilio > Date: Sun Nov 22 15:53:39 2009 > New Revision: 199649 > URL: http://svn.freebsd.org/changeset/base/199649 > > Log: > MFC r199209: > Fix a potential buffer boundaries overflow in devclass_add_device() by > using all available int lenghts digits for storing the information. > > Sponsored by: Sandvine Incorporated > > Modified: > stable/8/sys/kern/subr_bus.c > Directory Properties: > stable/8/sys/ (props changed) > stable/8/sys/amd64/include/xen/ (props changed) > stable/8/sys/cddl/contrib/opensolaris/ (props changed) > stable/8/sys/contrib/dev/acpica/ (props changed) > stable/8/sys/contrib/pf/ (props changed) > stable/8/sys/dev/xen/xenpci/ (props changed) > > Modified: stable/8/sys/kern/subr_bus.c > ============================================================================== > --- stable/8/sys/kern/subr_bus.c Sun Nov 22 14:32:32 2009 (r199648) > +++ stable/8/sys/kern/subr_bus.c Sun Nov 22 15:53:39 2009 (r199649) > @@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > #include > #include > #include > @@ -1584,7 +1585,7 @@ devclass_add_device(devclass_t dc, devic > > PDEBUG(("%s in devclass %s", DEVICENAME(dev), DEVCLANAME(dc))); > > - buflen = snprintf(NULL, 0, "%s%d$", dc->name, dev->unit); > + buflen = snprintf(NULL, 0, "%s%d$", dc->name, INT_MAX); > if (buflen < 0) > return (ENOMEM); > dev->nameunit = malloc(buflen, M_BUS, M_NOWAIT|M_ZERO); > _______________________________________________ > svn-src-stable@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/svn-src-stable > To unsubscribe, send any mail to "svn-src-stable-unsubscribe@freebsd.org" > From owner-svn-src-all@FreeBSD.ORG Sun Nov 22 23:46:44 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B3302106568B; Sun, 22 Nov 2009 23:46:44 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A0E1F8FC14; Sun, 22 Nov 2009 23:46:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAMNki4H033372; Sun, 22 Nov 2009 23:46:44 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAMNkiTe033370; Sun, 22 Nov 2009 23:46:44 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <200911222346.nAMNkiTe033370@svn.freebsd.org> From: Attilio Rao Date: Sun, 22 Nov 2009 23:46:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199682 - stable/7/sys/fs/fifofs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Nov 2009 23:46:44 -0000 Author: attilio Date: Sun Nov 22 23:46:44 2009 New Revision: 199682 URL: http://svn.freebsd.org/changeset/base/199682 Log: MFC r199007: Fix a memory leak. Modified: stable/7/sys/fs/fifofs/fifo_vnops.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/fs/fifofs/fifo_vnops.c ============================================================================== --- stable/7/sys/fs/fifofs/fifo_vnops.c Sun Nov 22 21:58:06 2009 (r199681) +++ stable/7/sys/fs/fifofs/fifo_vnops.c Sun Nov 22 23:46:44 2009 (r199682) @@ -76,6 +76,10 @@ struct fileops fifo_ops_f = { /* * This structure is associated with the FIFO vnode and stores * the state associated with the FIFO. + * Notes about locking: + * - fi_readsock and fi_writesock are invariant since init time. + * - fi_readers and fi_writers are vnode lock protected. + * - fi_wgen is fif_mtx lock protected. */ struct fifoinfo { struct socket *fi_readsock; @@ -210,14 +214,9 @@ fail1: } /* - * General access to fi_readers and fi_writers is protected using - * the vnode lock. - * - * Protect the increment of fi_readers and fi_writers and the - * associated calls to wakeup() with the fifo mutex in addition - * to the vnode lock. This allows the vnode lock to be dropped - * for the msleep() calls below, and using the fifo mutex with - * msleep() prevents the wakeup from being missed. + * Use the fifo_mtx lock here, in addition to the vnode lock, + * in order to allow vnode lock dropping before msleep() calls + * and still avoiding missed wakeups. */ mtx_lock(&fifo_mtx); if (ap->a_mode & FREAD) { @@ -235,6 +234,8 @@ fail1: if (ap->a_mode & FWRITE) { if ((ap->a_mode & O_NONBLOCK) && fip->fi_readers == 0) { mtx_unlock(&fifo_mtx); + if (fip->fi_writers == 0) + fifo_cleanup(vp); return (ENXIO); } fip->fi_writers++; From owner-svn-src-all@FreeBSD.ORG Sun Nov 22 23:48:32 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 55086106566B; Sun, 22 Nov 2009 23:48:32 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from pooker.samsco.org (pooker.samsco.org [168.103.85.57]) by mx1.freebsd.org (Postfix) with ESMTP id E97C78FC1A; Sun, 22 Nov 2009 23:48:31 +0000 (UTC) Received: from ydesk.samsco.home (ydesk.samsco.home [192.168.254.15]) (authenticated bits=0) by pooker.samsco.org (8.14.2/8.14.2) with ESMTP id nAMNmJlv010404; Sun, 22 Nov 2009 16:48:24 -0700 (MST) (envelope-from scottl@samsco.org) Mime-Version: 1.0 (Apple Message framework v1076) Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes From: Scott Long In-Reply-To: <200911222050.nAMKoRYh029141@svn.freebsd.org> Date: Sun, 22 Nov 2009 16:48:18 -0700 Content-Transfer-Encoding: 7bit Message-Id: <0298EC7E-26D5-460A-9EBE-5ABEAE8B21BD@samsco.org> References: <200911222050.nAMKoRYh029141@svn.freebsd.org> To: Pyun YongHyeon X-Mailer: Apple Mail (2.1076) X-Spam-Status: No, score=-4.4 required=3.8 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.1.8 X-Spam-Checker-Version: SpamAssassin 3.1.8 (2007-02-13) on pooker.samsco.org Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r199670 - head/sys/dev/bge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Nov 2009 23:48:32 -0000 By definition, PCIe can't transfer across 4GB boundaries. It's not a bug specific to Broadcom. If you're loading dynamic buffers (i.e. mbufs), setting an appropriate boundary value in the tag will allow busdma to take care of this. If you're allocating static buffers, busdma won't honor this. But what you've done here is best anyways; control buffers that are going to be frequently transferred are best kept in the lower 4GB of the address space. It simplifies PCIe handling, and it's significantly faster on PCI/PCI-X. So I'd suggest making this the rule rather than the exception in the driver. Scott On Nov 22, 2009, at 1:50 PM, Pyun YongHyeon wrote: > Author: yongari > Date: Sun Nov 22 20:50:27 2009 > New Revision: 199670 > URL: http://svn.freebsd.org/changeset/base/199670 > > Log: > Fix two long standing bugs on bge(4). Most pre BCM5755 controllers > have a DMA bug when buffer address crosses a multiple of the 4GB > boundary(e.g. 4GB, 8GB, 12GB etc). Limit DMA address to be within > 4GB address for these controllers. The second DMA bug limits DMA > address to be within 40bit address space. This bug applies to > BCM5714 and BCM5715 and 5708(bce(4) controller). This is not > actually a MAC controller bug but an issue with the embedded PCIe > to PCI-X bridge in the device. So for BCM5714/BCM5715 controllers > also limit the DMA address to be within 40bit address space. > Special thanks to davidch@ who gave me detailed errata information. > I think this change will fix long standing bge(4) instability > issues on systems with more than 4GB memory. > > Reviewed by: davidch > > Modified: > head/sys/dev/bge/if_bge.c > head/sys/dev/bge/if_bgereg.h > > Modified: head/sys/dev/bge/if_bge.c > = > = > = > = > = > = > = > = > ====================================================================== > --- head/sys/dev/bge/if_bge.c Sun Nov 22 20:45:15 2009 (r199669) > +++ head/sys/dev/bge/if_bge.c Sun Nov 22 20:50:27 2009 (r199670) > @@ -2104,15 +2104,21 @@ bge_dma_alloc(device_t dev) > { > struct bge_dmamap_arg ctx; > struct bge_softc *sc; > + bus_addr_t lowaddr; > int i, error; > > sc = device_get_softc(dev); > > + lowaddr = BUS_SPACE_MAXADDR; > + if ((sc->bge_flags & BGE_FLAG_40BIT_BUG) != 0) > + lowaddr = BGE_DMA_MAXADDR; > + if ((sc->bge_flags & BGE_FLAG_4G_BNDRY_BUG) != 0) > + lowaddr = BUS_SPACE_MAXADDR_32BIT; > /* > * Allocate the parent bus DMA tag appropriate for PCI. > */ > error = bus_dma_tag_create(bus_get_dma_tag(sc->bge_dev), > - 1, 0, BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL, > + 1, 0, lowaddr, BUS_SPACE_MAXADDR, NULL, > NULL, BUS_SPACE_MAXSIZE_32BIT, 0, BUS_SPACE_MAXSIZE_32BIT, > 0, NULL, NULL, &sc->bge_cdata.bge_parent_tag); > > @@ -2566,6 +2572,16 @@ bge_attach(device_t dev) > sc->bge_flags |= BGE_FLAG_BER_BUG; > } > > + /* > + * All controllers that are not 5755 or higher have 4GB > + * boundary DMA bug. > + * Whenever an address crosses a multiple of the 4GB boundary > + * (including 4GB, 8Gb, 12Gb, etc.) and makes the transition > + * from 0xX_FFFF_FFFF to 0x(X+1)_0000_0000 an internal DMA > + * state machine will lockup and cause the device to hang. > + */ > + if (BGE_IS_5755_PLUS(sc) == 0) > + sc->bge_flags |= BGE_FLAG_4G_BNDRY_BUG; > > /* > * We could possibly check for BCOM_DEVICEID_BCM5788 in bge_probe() > @@ -2729,6 +2745,13 @@ bge_attach(device_t dev) > #ifdef DEVICE_POLLING > ifp->if_capabilities |= IFCAP_POLLING; > #endif > + /* > + * The 40bit DMA bug applies to the 5714/5715 controllers and is > + * not actually a MAC controller bug but an issue with the embedded > + * PCIe to PCI-X bridge in the device. Use 40bit DMA workaround. > + */ > + if (BGE_IS_5714_FAMILY(sc) && (sc->bge_flags & BGE_FLAG_PCIX)) > + sc->bge_flags |= BGE_FLAG_40BIT_BUG; > > /* > * 5700 B0 chips do not support checksumming correctly due > > Modified: head/sys/dev/bge/if_bgereg.h > = > = > = > = > = > = > = > = > ====================================================================== > --- head/sys/dev/bge/if_bgereg.h Sun Nov 22 20:45:15 2009 (r199669) > +++ head/sys/dev/bge/if_bgereg.h Sun Nov 22 20:50:27 2009 (r199670) > @@ -2484,6 +2484,13 @@ struct bge_gib { > #define BGE_NSEG_JUMBO 4 > #define BGE_NSEG_NEW 32 > > +/* Maximum DMA address for controllers that have 40bit DMA address > bug. */ > +#if (BUS_SPACE_MAXADDR < 0xFFFFFFFFFF) > +#define BGE_DMA_MAXADDR BUS_SPACE_MAXADDR > +#else > +#define BGE_DMA_MAXADDR 0xFFFFFFFFFF > +#endif > + > /* > * Ring structures. Most of these reside in host memory and we tell > * the NIC where they are via the ring control blocks. The exceptions > @@ -2600,6 +2607,8 @@ struct bge_softc { > #define BGE_FLAG_5714_FAMILY 0x00004000 > #define BGE_FLAG_575X_PLUS 0x00008000 > #define BGE_FLAG_5755_PLUS 0x00010000 > +#define BGE_FLAG_40BIT_BUG 0x00020000 > +#define BGE_FLAG_4G_BNDRY_BUG 0x00040000 > #define BGE_FLAG_RX_ALIGNBUG 0x00100000 > #define BGE_FLAG_NO_3LED 0x00200000 > #define BGE_FLAG_ADC_BUG 0x00400000 From owner-svn-src-all@FreeBSD.ORG Sun Nov 22 23:51:52 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0A1AB106568B; Sun, 22 Nov 2009 23:51:52 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EC2BF8FC17; Sun, 22 Nov 2009 23:51:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAMNppbB033504; Sun, 22 Nov 2009 23:51:51 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAMNpp5c033502; Sun, 22 Nov 2009 23:51:51 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <200911222351.nAMNpp5c033502@svn.freebsd.org> From: Attilio Rao Date: Sun, 22 Nov 2009 23:51:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199683 - stable/7/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Nov 2009 23:51:52 -0000 Author: attilio Date: Sun Nov 22 23:51:51 2009 New Revision: 199683 URL: http://svn.freebsd.org/changeset/base/199683 Log: MFC r199209: Fix a potential buffer boundaries overflow in devclass_add_device() by using all available int lenghts digits for storing the information. Modified: stable/7/sys/kern/subr_bus.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/kern/subr_bus.c ============================================================================== --- stable/7/sys/kern/subr_bus.c Sun Nov 22 23:46:44 2009 (r199682) +++ stable/7/sys/kern/subr_bus.c Sun Nov 22 23:51:51 2009 (r199683) @@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -1394,7 +1395,7 @@ devclass_add_device(devclass_t dc, devic PDEBUG(("%s in devclass %s", DEVICENAME(dev), DEVCLANAME(dc))); - buflen = snprintf(NULL, 0, "%s%d$", dc->name, dev->unit); + buflen = snprintf(NULL, 0, "%s%d$", dc->name, INT_MAX); if (buflen < 0) return (ENOMEM); dev->nameunit = malloc(buflen, M_BUS, M_NOWAIT|M_ZERO); From owner-svn-src-all@FreeBSD.ORG Sun Nov 22 23:54:20 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 570C3106566C; Sun, 22 Nov 2009 23:54:20 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 451D88FC14; Sun, 22 Nov 2009 23:54:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAMNsKkd033590; Sun, 22 Nov 2009 23:54:20 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAMNsKvX033588; Sun, 22 Nov 2009 23:54:20 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <200911222354.nAMNsKvX033588@svn.freebsd.org> From: Attilio Rao Date: Sun, 22 Nov 2009 23:54:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199684 - stable/7/usr.bin/kdump X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Nov 2009 23:54:20 -0000 Author: attilio Date: Sun Nov 22 23:54:19 2009 New Revision: 199684 URL: http://svn.freebsd.org/changeset/base/199684 Log: MFC r199024: Use a safety belt for cases where corrupted narg can be passed to the ktrsyscall(). Modified: stable/7/usr.bin/kdump/kdump.c Directory Properties: stable/7/usr.bin/kdump/ (props changed) Modified: stable/7/usr.bin/kdump/kdump.c ============================================================================== --- stable/7/usr.bin/kdump/kdump.c Sun Nov 22 23:51:51 2009 (r199683) +++ stable/7/usr.bin/kdump/kdump.c Sun Nov 22 23:54:19 2009 (r199684) @@ -802,7 +802,7 @@ ktrsyscall(struct ktr_syscall *ktr) narg--; } } - while (narg) { + while (narg > 0) { print_number(ip,narg,c); } (void)putchar(')'); From owner-svn-src-all@FreeBSD.ORG Mon Nov 23 01:05:27 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AE68A1065670 for ; Mon, 23 Nov 2009 01:05:27 +0000 (UTC) (envelope-from joerg@britannica.bec.de) Received: from www.sonnenberger.org (www.sonnenberger.org [92.79.50.50]) by mx1.freebsd.org (Postfix) with ESMTP id 705078FC12 for ; Mon, 23 Nov 2009 01:05:27 +0000 (UTC) Received: from britannica.bec.de (www.sonnenberger.org [192.168.1.10]) by www.sonnenberger.org (Postfix) with ESMTP id BC78C6665E for ; Mon, 23 Nov 2009 02:05:24 +0100 (CET) Received: by britannica.bec.de (Postfix, from userid 1000) id D27AB15C3F; Mon, 23 Nov 2009 02:05:11 +0100 (CET) Date: Mon, 23 Nov 2009 02:05:11 +0100 From: Joerg Sonnenberger To: svn-src-all@freebsd.org Message-ID: <20091123010511.GA14572@britannica.bec.de> References: <200911222050.nAMKoRYh029141@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200911222050.nAMKoRYh029141@svn.freebsd.org> User-Agent: Mutt/1.5.20 (2009-06-14) Subject: Re: svn commit: r199670 - head/sys/dev/bge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Nov 2009 01:05:27 -0000 On Sun, Nov 22, 2009 at 08:50:27PM +0000, Pyun YongHyeon wrote: > Log: > Fix two long standing bugs on bge(4). Most pre BCM5755 controllers > have a DMA bug when buffer address crosses a multiple of the 4GB > boundary(e.g. 4GB, 8GB, 12GB etc). Does this only affect transfers that *cross* a 4GB boundary or does it also affect transfers that *end* at a 4GB boundary? E.g. if the mbuf cluster starts at 0xffffff00 with size 0x100 -- will the DMA engine stall happen or not? Joerg From owner-svn-src-all@FreeBSD.ORG Mon Nov 23 01:23:05 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8662D106568B; Mon, 23 Nov 2009 01:23:05 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 73D0B8FC0C; Mon, 23 Nov 2009 01:23:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAN1N4p4035420; Mon, 23 Nov 2009 01:23:04 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAN1N4Al035419; Mon, 23 Nov 2009 01:23:04 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <200911230123.nAN1N4Al035419@svn.freebsd.org> From: Ed Maste Date: Mon, 23 Nov 2009 01:23:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199685 - stable/6/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Nov 2009 01:23:05 -0000 Author: emaste Date: Mon Nov 23 01:23:03 2009 New Revision: 199685 URL: http://svn.freebsd.org/changeset/base/199685 Log: MFC r199209: Fix a potential buffer boundaries overflow in devclass_add_device() by using all available int lenghts digits for storing the information. Modified: stable/6/sys/kern/subr_bus.c Directory Properties: stable/6/sys/ (props changed) stable/6/sys/conf/ (props changed) stable/6/sys/contrib/pf/ (props changed) stable/6/sys/dev/cxgb/ (props changed) Modified: stable/6/sys/kern/subr_bus.c ============================================================================== --- stable/6/sys/kern/subr_bus.c Sun Nov 22 23:54:19 2009 (r199684) +++ stable/6/sys/kern/subr_bus.c Mon Nov 23 01:23:03 2009 (r199685) @@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -1365,7 +1366,7 @@ devclass_add_device(devclass_t dc, devic PDEBUG(("%s in devclass %s", DEVICENAME(dev), DEVCLANAME(dc))); - buflen = snprintf(NULL, 0, "%s%d$", dc->name, dev->unit); + buflen = snprintf(NULL, 0, "%s%d$", dc->name, INT_MAX); if (buflen < 0) return (ENOMEM); dev->nameunit = malloc(buflen, M_BUS, M_NOWAIT|M_ZERO); From owner-svn-src-all@FreeBSD.ORG Mon Nov 23 01:45:01 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 89FBD106566C; Mon, 23 Nov 2009 01:45:01 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 46DC08FC0A; Mon, 23 Nov 2009 01:45:01 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id nAN1cAXU030613; Sun, 22 Nov 2009 18:38:10 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Sun, 22 Nov 2009 18:38:41 -0700 (MST) Message-Id: <20091122.183841.222456704.imp@bsdimp.com> To: dougb@FreeBSD.org From: "M. Warner Losh" In-Reply-To: <200911210143.nAL1hMx3062260@svn.freebsd.org> References: <200911210143.nAL1hMx3062260@svn.freebsd.org> X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r199621 - head X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Nov 2009 01:45:01 -0000 In message: <200911210143.nAL1hMx3062260@svn.freebsd.org> Doug Barton writes: : Author: dougb : Date: Sat Nov 21 01:43:22 2009 : New Revision: 199621 : URL: http://svn.freebsd.org/changeset/base/199621 : : Log: : Add a note that wpa_supplicant(8) may require a full world build to : sync up with 20091109. : : Modified: : head/UPDATING : : Modified: head/UPDATING : ============================================================================== : --- head/UPDATING Sat Nov 21 00:34:51 2009 (r199620) : +++ head/UPDATING Sat Nov 21 01:43:22 2009 (r199621) : @@ -42,6 +42,10 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 9. : Applications that require wireless scan results (e.g. ifconfig(8)) : from net80211 need to be recompiled. : : + Applications such as wpa_supplicant(8) may require a full world : + build without using NO_CLEAN in order to get synchronized with the : + new structure. : + We should have some general language at the end of UPDATING that can be invoked for these things. In general, when structure sizes change, you have to do a fresh, from scratch build. We shouldn't have to repeat it each time we do one. Warner From owner-svn-src-all@FreeBSD.ORG Mon Nov 23 02:36:51 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 266E51065672 for ; Mon, 23 Nov 2009 02:36:51 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from mail2.fluidhosting.com (mx21.fluidhosting.com [204.14.89.4]) by mx1.freebsd.org (Postfix) with ESMTP id 94E858FC21 for ; Mon, 23 Nov 2009 02:36:50 +0000 (UTC) Received: (qmail 19978 invoked by uid 399); 23 Nov 2009 02:36:50 -0000 Received: from localhost (HELO ?192.168.0.110?) (dougb@dougbarton.us@127.0.0.1) by localhost with ESMTPAM; 23 Nov 2009 02:36:50 -0000 X-Originating-IP: 127.0.0.1 X-Sender: dougb@dougbarton.us Message-ID: <4B09F53C.30203@FreeBSD.org> Date: Sun, 22 Nov 2009 18:36:44 -0800 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: "M. Warner Losh" References: <200911210143.nAL1hMx3062260@svn.freebsd.org> <20091122.183841.222456704.imp@bsdimp.com> In-Reply-To: <20091122.183841.222456704.imp@bsdimp.com> X-Enigmail-Version: 0.96.0 OpenPGP: id=D5B2F0FB Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r199621 - head X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Nov 2009 02:36:51 -0000 M. Warner Losh wrote: > We should have some general language at the end of UPDATING that can > be invoked for these things. In general, when structure sizes change, > you have to do a fresh, from scratch build. We shouldn't have to > repeat it each time we do one. I have no objection to you making any changes you think are appropriate. I just didn't want any users wasting as much time as I did trying to make it work. Doug -- Improve the effectiveness of your Internet presence with a domain name makeover! http://SupersetSolutions.com/ From owner-svn-src-all@FreeBSD.ORG Mon Nov 23 08:45:17 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A8F071065694; Mon, 23 Nov 2009 08:45:17 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9588E8FC0A; Mon, 23 Nov 2009 08:45:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAN8jHXG046278; Mon, 23 Nov 2009 08:45:17 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAN8jHag046263; Mon, 23 Nov 2009 08:45:17 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200911230845.nAN8jHag046263@svn.freebsd.org> From: Alexander Motin Date: Mon, 23 Nov 2009 08:45:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199696 - in stable/8/sys: arm/mv dev/ata dev/ata/chipsets X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Nov 2009 08:45:17 -0000 Author: mav Date: Mon Nov 23 08:45:17 2009 New Revision: 199696 URL: http://svn.freebsd.org/changeset/base/199696 Log: MFC r198717: - Remove most of direct relations between ATA(4) peripherial and controller levels. It makes logic more transparent and is a mandatory step to wrap ATA(4) controller level into ATA-native CAM SIM. - Tune AHCI and SATA2 SiI drivers memory allocation a bit to allow bigger I/O transaction sizes without additional cost. Modified: stable/8/sys/arm/mv/mv_sata.c stable/8/sys/dev/ata/ata-all.c stable/8/sys/dev/ata/ata-all.h stable/8/sys/dev/ata/ata-dma.c stable/8/sys/dev/ata/ata-lowlevel.c stable/8/sys/dev/ata/ata-pci.c stable/8/sys/dev/ata/ata-queue.c stable/8/sys/dev/ata/ata-sata.c stable/8/sys/dev/ata/chipsets/ata-ahci.c stable/8/sys/dev/ata/chipsets/ata-intel.c stable/8/sys/dev/ata/chipsets/ata-marvell.c stable/8/sys/dev/ata/chipsets/ata-promise.c stable/8/sys/dev/ata/chipsets/ata-serverworks.c stable/8/sys/dev/ata/chipsets/ata-siliconimage.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/arm/mv/mv_sata.c ============================================================================== --- stable/8/sys/arm/mv/mv_sata.c Mon Nov 23 07:49:50 2009 (r199695) +++ stable/8/sys/arm/mv/mv_sata.c Mon Nov 23 08:45:17 2009 (r199696) @@ -548,14 +548,16 @@ sata_channel_begin_transaction(struct at uint32_t req_in; int error, slot; - sc = device_get_softc(GRANDPARENT(request->dev)); + sc = device_get_softc(device_get_parent(request->parent)); ch = device_get_softc(request->parent); mtx_assert(&ch->state_mtx, MA_OWNED); /* Only DMA R/W goes through the EDMA machine. */ if (request->u.ata.command != ATA_READ_DMA && - request->u.ata.command != ATA_WRITE_DMA) { + request->u.ata.command != ATA_WRITE_DMA && + request->u.ata.command != ATA_READ_DMA48 && + request->u.ata.command != ATA_WRITE_DMA48) { /* Disable EDMA before accessing legacy registers */ if (sata_edma_is_running(request->parent)) { @@ -569,12 +571,9 @@ sata_channel_begin_transaction(struct at return (ata_begin_transaction(request)); } - /* Check for 48 bit access and convert if needed */ - ata_modify_if_48bit(request); - /* Prepare data for DMA */ if ((error = ch->dma.load(request, NULL, NULL))) { - device_printf(request->dev, "setting up DMA failed!\n"); + device_printf(request->parent, "setting up DMA failed!\n"); request->result = error; return ATA_OP_FINISHED; } @@ -633,7 +632,7 @@ sata_channel_end_transaction(struct ata_ uint32_t res_in, res_out, icr; int slot; - sc = device_get_softc(GRANDPARENT(request->dev)); + sc = device_get_softc(device_get_parent(request->parent)); ch = device_get_softc(request->parent); mtx_assert(&ch->state_mtx, MA_OWNED); Modified: stable/8/sys/dev/ata/ata-all.c ============================================================================== --- stable/8/sys/dev/ata/ata-all.c Mon Nov 23 07:49:50 2009 (r199695) +++ stable/8/sys/dev/ata/ata-all.c Mon Nov 23 08:45:17 2009 (r199696) @@ -798,10 +798,10 @@ ata_default_registers(device_t dev) void ata_modify_if_48bit(struct ata_request *request) { - struct ata_channel *ch = device_get_softc(device_get_parent(request->dev)); + struct ata_channel *ch = device_get_softc(request->parent); struct ata_device *atadev = device_get_softc(request->dev); - atadev->flags &= ~ATA_D_48BIT_ACTIVE; + request->flags &= ~ATA_R_48BIT; if (((request->u.ata.lba + request->u.ata.count) >= ATA_MAX_28BIT_LBA || request->u.ata.count > 256) && @@ -875,7 +875,7 @@ ata_modify_if_48bit(struct ata_request * default: return; } - atadev->flags |= ATA_D_48BIT_ACTIVE; + request->flags |= ATA_R_48BIT; } else if (atadev->param.support.command2 & ATA_SUPPORT_ADDRESS48) { @@ -893,7 +893,7 @@ ata_modify_if_48bit(struct ata_request * default: return; } - atadev->flags |= ATA_D_48BIT_ACTIVE; + request->flags |= ATA_R_48BIT; } } Modified: stable/8/sys/dev/ata/ata-all.h ============================================================================== --- stable/8/sys/dev/ata/ata-all.h Mon Nov 23 07:49:50 2009 (r199695) +++ stable/8/sys/dev/ata/ata-all.h Mon Nov 23 08:45:17 2009 (r199696) @@ -255,7 +255,7 @@ #define ATA_AHCI_CL_OFFSET 0 #define ATA_AHCI_FB_OFFSET (ATA_AHCI_CL_SIZE * 32) #define ATA_AHCI_CT_OFFSET (ATA_AHCI_FB_OFFSET + 4096) -#define ATA_AHCI_CT_SIZE (1024 + 128) +#define ATA_AHCI_CT_SIZE (2176 + 128) struct ata_ahci_dma_prd { u_int64_t dba; @@ -269,7 +269,7 @@ struct ata_ahci_cmd_tab { u_int8_t cfis[64]; u_int8_t acmd[32]; u_int8_t reserved[32]; -#define ATA_AHCI_DMA_ENTRIES 64 +#define ATA_AHCI_DMA_ENTRIES 129 struct ata_ahci_dma_prd prd_tab[ATA_AHCI_DMA_ENTRIES]; } __packed; @@ -368,6 +368,7 @@ struct ata_composite { struct ata_request { device_t dev; /* device handle */ device_t parent; /* channel handle */ + int unit; /* physical unit */ union { struct { u_int8_t command; /* command reg */ @@ -393,6 +394,7 @@ struct ata_request { #define ATA_R_DMA 0x00000010 #define ATA_R_QUIET 0x00000020 #define ATA_R_TIMEOUT 0x00000040 +#define ATA_R_48BIT 0x00000080 #define ATA_R_ORDERED 0x00000100 #define ATA_R_AT_HEAD 0x00000200 @@ -400,6 +402,9 @@ struct ata_request { #define ATA_R_THREAD 0x00000800 #define ATA_R_DIRECT 0x00001000 +#define ATA_R_ATAPI16 0x00010000 +#define ATA_R_ATAPI_INTR 0x00020000 + #define ATA_R_DEBUG 0x10000000 #define ATA_R_DANGER1 0x20000000 #define ATA_R_DANGER2 0x40000000 @@ -427,7 +432,7 @@ struct ata_request { #define ATA_DEBUG_RQ(request, string) \ { \ if (request->flags & ATA_R_DEBUG) \ - device_printf(request->dev, "req=%p %s " string "\n", \ + device_printf(request->parent, "req=%p %s " string "\n", \ request, ata_cmd2str(request)); \ } #else @@ -453,7 +458,6 @@ struct ata_device { #define ATA_D_USE_CHS 0x0001 #define ATA_D_MEDIA_CHANGED 0x0002 #define ATA_D_ENC_PRESENT 0x0004 -#define ATA_D_48BIT_ACTIVE 0x0008 }; /* structure for holding DMA Physical Region Descriptors (PRD) entries */ @@ -487,7 +491,7 @@ struct ata_dma { u_int8_t *work; /* workspace */ bus_addr_t work_bus; /* bus address of dmatab */ -#define ATA_DMA_SLOTS 32 +#define ATA_DMA_SLOTS 1 int dma_slots; /* DMA slots allocated */ struct ata_dmaslot slot[ATA_DMA_SLOTS]; u_int32_t alignment; /* DMA SG list alignment */ Modified: stable/8/sys/dev/ata/ata-dma.c ============================================================================== --- stable/8/sys/dev/ata/ata-dma.c Mon Nov 23 07:49:50 2009 (r199695) +++ stable/8/sys/dev/ata/ata-dma.c Mon Nov 23 08:45:17 2009 (r199696) @@ -78,7 +78,7 @@ ata_dmainit(device_t dev) ch->dma.segsize = 65536; ch->dma.max_iosize = 128 * DEV_BSIZE; ch->dma.max_address = BUS_SPACE_MAXADDR_32BIT; - ch->dma.dma_slots = 6; + ch->dma.dma_slots = 1; if (bus_dma_tag_create(bus_get_dma_tag(dev), ch->dma.alignment, 0, ch->dma.max_address, BUS_SPACE_MAXADDR, @@ -256,37 +256,36 @@ static int ata_dmaload(struct ata_request *request, void *addr, int *entries) { struct ata_channel *ch = device_get_softc(request->parent); - struct ata_device *atadev = device_get_softc(request->dev); struct ata_dmasetprd_args dspa; int error; ATA_DEBUG_RQ(request, "dmaload"); if (request->dma) { - device_printf(request->dev, + device_printf(request->parent, "FAILURE - already active DMA on this device\n"); return EIO; } if (!request->bytecount) { - device_printf(request->dev, + device_printf(request->parent, "FAILURE - zero length DMA transfer attempted\n"); return EIO; } if (request->bytecount & (ch->dma.alignment - 1)) { - device_printf(request->dev, + device_printf(request->parent, "FAILURE - odd-sized DMA transfer attempt %d %% %d\n", request->bytecount, ch->dma.alignment); return EIO; } if (request->bytecount > ch->dma.max_iosize) { - device_printf(request->dev, + device_printf(request->parent, "FAILURE - oversized DMA transfer attempt %d > %d\n", request->bytecount, ch->dma.max_iosize); return EIO; } - /* set our slot, unit for simplicity XXX SOS NCQ will change that */ - request->dma = &ch->dma.slot[atadev->unit]; + /* set our slot. XXX SOS NCQ will change that */ + request->dma = &ch->dma.slot[0]; if (addr) dspa.dmatab = addr; @@ -297,7 +296,7 @@ ata_dmaload(struct ata_request *request, request->data, request->bytecount, ch->dma.setprd, &dspa, BUS_DMA_NOWAIT)) || (error = dspa.error)) { - device_printf(request->dev, "FAILURE - load data\n"); + device_printf(request->parent, "FAILURE - load data\n"); goto error; } Modified: stable/8/sys/dev/ata/ata-lowlevel.c ============================================================================== --- stable/8/sys/dev/ata/ata-lowlevel.c Mon Nov 23 07:49:50 2009 (r199695) +++ stable/8/sys/dev/ata/ata-lowlevel.c Mon Nov 23 08:45:17 2009 (r199696) @@ -47,7 +47,7 @@ __FBSDID("$FreeBSD$"); /* prototypes */ static int ata_generic_status(device_t dev); -static int ata_wait(struct ata_channel *ch, struct ata_device *, u_int8_t); +static int ata_wait(struct ata_channel *ch, int unit, u_int8_t); static void ata_pio_read(struct ata_request *, int); static void ata_pio_write(struct ata_request *, int); static void ata_tf_read(struct ata_request *); @@ -77,7 +77,6 @@ int ata_begin_transaction(struct ata_request *request) { struct ata_channel *ch = device_get_softc(request->parent); - struct ata_device *atadev = device_get_softc(request->dev); int dummy, error; ATA_DEBUG_RQ(request, "begin transaction"); @@ -88,9 +87,6 @@ ata_begin_transaction(struct ata_request (ATA_R_ATAPI | ATA_R_DMA | ATA_R_WRITE))) request->flags &= ~ATA_R_DMA; - /* check for 48 bit access and convert if needed */ - ata_modify_if_48bit(request); - switch (request->flags & (ATA_R_ATAPI | ATA_R_DMA)) { /* ATA PIO data transfer and control commands */ @@ -101,7 +97,7 @@ ata_begin_transaction(struct ata_request /* issue command */ if (ch->hw.command(request)) { - device_printf(request->dev, "error issuing %s command\n", + device_printf(request->parent, "error issuing %s command\n", ata_cmd2str(request)); request->result = EIO; goto begin_finished; @@ -122,8 +118,8 @@ ata_begin_transaction(struct ata_request /* if write command output the data */ if (write) { - if (ata_wait(ch, atadev, (ATA_S_READY | ATA_S_DRQ)) < 0) { - device_printf(request->dev, + if (ata_wait(ch, request->unit, (ATA_S_READY | ATA_S_DRQ)) < 0) { + device_printf(request->parent, "timeout waiting for write DRQ\n"); request->result = EIO; goto begin_finished; @@ -137,14 +133,14 @@ ata_begin_transaction(struct ata_request case ATA_R_DMA: /* check sanity, setup SG list and DMA engine */ if ((error = ch->dma.load(request, NULL, &dummy))) { - device_printf(request->dev, "setting up DMA failed\n"); + device_printf(request->parent, "setting up DMA failed\n"); request->result = error; goto begin_finished; } /* issue command */ if (ch->hw.command(request)) { - device_printf(request->dev, "error issuing %s command\n", + device_printf(request->parent, "error issuing %s command\n", ata_cmd2str(request)); request->result = EIO; goto begin_finished; @@ -152,7 +148,7 @@ ata_begin_transaction(struct ata_request /* start DMA engine */ if (ch->dma.start && ch->dma.start(request)) { - device_printf(request->dev, "error starting DMA\n"); + device_printf(request->parent, "error starting DMA\n"); request->result = EIO; goto begin_finished; } @@ -162,7 +158,7 @@ ata_begin_transaction(struct ata_request case ATA_R_ATAPI: /* is this just a POLL DSC command ? */ if (request->u.atapi.ccb[0] == ATAPI_POLL_DSC) { - ATA_IDX_OUTB(ch, ATA_DRIVE, ATA_D_IBM | ATA_DEV(atadev->unit)); + ATA_IDX_OUTB(ch, ATA_DRIVE, ATA_D_IBM | ATA_DEV(request->unit)); DELAY(10); if (!(ATA_IDX_INB(ch, ATA_ALTSTAT) & ATA_S_DSC)) request->result = EBUSY; @@ -171,7 +167,7 @@ ata_begin_transaction(struct ata_request /* start ATAPI operation */ if (ch->hw.command(request)) { - device_printf(request->dev, "error issuing ATA PACKET command\n"); + device_printf(request->parent, "error issuing ATA PACKET command\n"); request->result = EIO; goto begin_finished; } @@ -181,7 +177,7 @@ ata_begin_transaction(struct ata_request case ATA_R_ATAPI|ATA_R_DMA: /* is this just a POLL DSC command ? */ if (request->u.atapi.ccb[0] == ATAPI_POLL_DSC) { - ATA_IDX_OUTB(ch, ATA_DRIVE, ATA_D_IBM | ATA_DEV(atadev->unit)); + ATA_IDX_OUTB(ch, ATA_DRIVE, ATA_D_IBM | ATA_DEV(request->unit)); DELAY(10); if (!(ATA_IDX_INB(ch, ATA_ALTSTAT) & ATA_S_DSC)) request->result = EBUSY; @@ -190,14 +186,14 @@ ata_begin_transaction(struct ata_request /* check sanity, setup SG list and DMA engine */ if ((error = ch->dma.load(request, NULL, &dummy))) { - device_printf(request->dev, "setting up DMA failed\n"); + device_printf(request->parent, "setting up DMA failed\n"); request->result = error; goto begin_finished; } /* start ATAPI operation */ if (ch->hw.command(request)) { - device_printf(request->dev, "error issuing ATA PACKET command\n"); + device_printf(request->parent, "error issuing ATA PACKET command\n"); request->result = EIO; goto begin_finished; } @@ -229,7 +225,6 @@ int ata_end_transaction(struct ata_request *request) { struct ata_channel *ch = device_get_softc(request->parent); - struct ata_device *atadev = device_get_softc(request->dev); int length; ATA_DEBUG_RQ(request, "end transaction"); @@ -266,8 +261,8 @@ ata_end_transaction(struct ata_request * if (request->u.ata.command != ATA_ATAPI_IDENTIFY) flags |= ATA_S_READY; - if (ata_wait(ch, atadev, flags) < 0) { - device_printf(request->dev, + if (ata_wait(ch, request->unit, flags) < 0) { + device_printf(request->parent, "timeout waiting for read DRQ\n"); request->result = EIO; goto end_finished; @@ -290,8 +285,8 @@ ata_end_transaction(struct ata_request * if (request->flags & ATA_R_WRITE) { /* if we get an error here we are done with the HW */ - if (ata_wait(ch, atadev, (ATA_S_READY | ATA_S_DRQ)) < 0) { - device_printf(request->dev, + if (ata_wait(ch, request->unit, (ATA_S_READY | ATA_S_DRQ)) < 0) { + device_printf(request->parent, "timeout waiting for write DRQ\n"); request->status = ATA_IDX_INB(ch, ATA_STATUS); goto end_finished; @@ -347,20 +342,19 @@ ata_end_transaction(struct ata_request * DELAY(10); if (!(request->status & ATA_S_DRQ)) { - device_printf(request->dev, "command interrupt without DRQ\n"); + device_printf(request->parent, "command interrupt without DRQ\n"); request->status = ATA_S_ERROR; goto end_finished; } ATA_IDX_OUTSW_STRM(ch, ATA_DATA, (int16_t *)request->u.atapi.ccb, - (atadev->param.config & - ATA_PROTO_MASK)== ATA_PROTO_ATAPI_12 ? 6 : 8); + (request->flags & ATA_R_ATAPI16) ? 8 : 6); /* return wait for interrupt */ goto end_continue; case ATAPI_P_WRITE: if (request->flags & ATA_R_READ) { request->status = ATA_S_ERROR; - device_printf(request->dev, + device_printf(request->parent, "%s trying to write on read buffer\n", ata_cmd2str(request)); goto end_finished; @@ -378,7 +372,7 @@ ata_end_transaction(struct ata_request * case ATAPI_P_READ: if (request->flags & ATA_R_WRITE) { request->status = ATA_S_ERROR; - device_printf(request->dev, + device_printf(request->parent, "%s trying to read on write buffer\n", ata_cmd2str(request)); goto end_finished; @@ -393,7 +387,7 @@ ata_end_transaction(struct ata_request * goto end_continue; case ATAPI_P_DONEDRQ: - device_printf(request->dev, + device_printf(request->parent, "WARNING - %s DONEDRQ non conformant device\n", ata_cmd2str(request)); if (request->flags & ATA_R_READ) { @@ -415,7 +409,7 @@ ata_end_transaction(struct ata_request * goto end_finished; default: - device_printf(request->dev, "unknown transfer phase\n"); + device_printf(request->parent, "unknown transfer phase\n"); request->status = ATA_S_ERROR; } @@ -603,7 +597,7 @@ ata_generic_status(device_t dev) } static int -ata_wait(struct ata_channel *ch, struct ata_device *atadev, u_int8_t mask) +ata_wait(struct ata_channel *ch, int unit, u_int8_t mask) { u_int8_t status; int timeout = 0; @@ -616,7 +610,7 @@ ata_wait(struct ata_channel *ch, struct /* if drive fails status, reselect the drive and try again */ if (status == 0xff) { - ATA_IDX_OUTB(ch, ATA_DRIVE, ATA_D_IBM | ATA_DEV(atadev->unit)); + ATA_IDX_OUTB(ch, ATA_DRIVE, ATA_D_IBM | ATA_DEV(unit)); timeout += 1000; DELAY(1000); continue; @@ -657,14 +651,13 @@ int ata_generic_command(struct ata_request *request) { struct ata_channel *ch = device_get_softc(request->parent); - struct ata_device *atadev = device_get_softc(request->dev); /* select device */ - ATA_IDX_OUTB(ch, ATA_DRIVE, ATA_D_IBM | ATA_D_LBA | ATA_DEV(atadev->unit)); + ATA_IDX_OUTB(ch, ATA_DRIVE, ATA_D_IBM | ATA_D_LBA | ATA_DEV(request->unit)); /* ready to issue command ? */ - if (ata_wait(ch, atadev, 0) < 0) { - device_printf(request->dev, "timeout waiting to issue command\n"); + if (ata_wait(ch, request->unit, 0) < 0) { + device_printf(request->parent, "timeout waiting to issue command\n"); return -1; } @@ -673,6 +666,7 @@ ata_generic_command(struct ata_request * if (request->flags & ATA_R_ATAPI) { int timeout = 5000; + int res; /* issue packet command to controller */ if (request->flags & ATA_R_DMA) { @@ -688,9 +682,16 @@ ata_generic_command(struct ata_request * ATA_IDX_OUTB(ch, ATA_COMMAND, ATA_PACKET_CMD); /* command interrupt device ? just return and wait for interrupt */ - if ((atadev->param.config & ATA_DRQ_MASK) == ATA_DRQ_INTR) + if (request->flags & ATA_R_ATAPI_INTR) return 0; + /* command processed ? */ + res = ata_wait(ch, request->unit, 0); + if (res != 0) { + if (res < 0) + device_printf(request->parent, "timeout waiting for PACKET command\n"); + return (-1); + } /* wait for ready to write ATAPI command block */ while (timeout--) { int reason = ATA_IDX_INB(ch, ATA_IREASON); @@ -702,7 +703,7 @@ ata_generic_command(struct ata_request * DELAY(20); } if (timeout <= 0) { - device_printf(request->dev, "timeout waiting for ATAPI ready\n"); + device_printf(request->parent, "timeout waiting for ATAPI ready\n"); request->result = EIO; return -1; } @@ -712,8 +713,7 @@ ata_generic_command(struct ata_request * /* output command block */ ATA_IDX_OUTSW_STRM(ch, ATA_DATA, (int16_t *)request->u.atapi.ccb, - (atadev->param.config & ATA_PROTO_MASK) == - ATA_PROTO_ATAPI_12 ? 6 : 8); + (request->flags & ATA_R_ATAPI16) ? 8 : 6); } else { ch->hw.tf_write(request); @@ -728,9 +728,8 @@ static void ata_tf_read(struct ata_request *request) { struct ata_channel *ch = device_get_softc(request->parent); - struct ata_device *atadev = device_get_softc(request->dev); - if (atadev->flags & ATA_D_48BIT_ACTIVE) { + if (request->flags & ATA_R_48BIT) { ATA_IDX_OUTB(ch, ATA_CONTROL, ATA_A_4BIT | ATA_A_HOB); request->u.ata.count = (ATA_IDX_INB(ch, ATA_COUNT) << 8); request->u.ata.lba = @@ -760,7 +759,7 @@ ata_tf_write(struct ata_request *request struct ata_channel *ch = device_get_softc(request->parent); struct ata_device *atadev = device_get_softc(request->dev); - if (atadev->flags & ATA_D_48BIT_ACTIVE) { + if (request->flags & ATA_R_48BIT) { ATA_IDX_OUTB(ch, ATA_FEATURE, request->u.ata.feature >> 8); ATA_IDX_OUTB(ch, ATA_FEATURE, request->u.ata.feature); ATA_IDX_OUTB(ch, ATA_COUNT, request->u.ata.count >> 8); @@ -771,7 +770,7 @@ ata_tf_write(struct ata_request *request ATA_IDX_OUTB(ch, ATA_CYL_LSB, request->u.ata.lba >> 8); ATA_IDX_OUTB(ch, ATA_CYL_MSB, request->u.ata.lba >> 40); ATA_IDX_OUTB(ch, ATA_CYL_MSB, request->u.ata.lba >> 16); - ATA_IDX_OUTB(ch, ATA_DRIVE, ATA_D_LBA | ATA_DEV(atadev->unit)); + ATA_IDX_OUTB(ch, ATA_DRIVE, ATA_D_LBA | ATA_DEV(request->unit)); } else { ATA_IDX_OUTB(ch, ATA_FEATURE, request->u.ata.feature); @@ -793,7 +792,7 @@ ata_tf_write(struct ata_request *request (request->u.ata.lba / (sectors * heads))); ATA_IDX_OUTB(ch, ATA_CYL_MSB, (request->u.ata.lba / (sectors * heads)) >> 8); - ATA_IDX_OUTB(ch, ATA_DRIVE, ATA_D_IBM | ATA_DEV(atadev->unit) | + ATA_IDX_OUTB(ch, ATA_DRIVE, ATA_D_IBM | ATA_DEV(request->unit) | (((request->u.ata.lba% (sectors * heads)) / sectors) & 0xf)); } @@ -802,7 +801,7 @@ ata_tf_write(struct ata_request *request ATA_IDX_OUTB(ch, ATA_CYL_LSB, request->u.ata.lba >> 8); ATA_IDX_OUTB(ch, ATA_CYL_MSB, request->u.ata.lba >> 16); ATA_IDX_OUTB(ch, ATA_DRIVE, - ATA_D_IBM | ATA_D_LBA | ATA_DEV(atadev->unit) | + ATA_D_IBM | ATA_D_LBA | ATA_DEV(request->unit) | ((request->u.ata.lba >> 24) & 0x0f)); } } @@ -825,7 +824,7 @@ ata_pio_read(struct ata_request *request size / sizeof(int32_t)); if (request->transfersize < length) { - device_printf(request->dev, "WARNING - %s read data overrun %d>%d\n", + device_printf(request->parent, "WARNING - %s read data overrun %d>%d\n", ata_cmd2str(request), length, request->transfersize); for (resid = request->transfersize; resid < length; resid += sizeof(int16_t)) @@ -850,7 +849,7 @@ ata_pio_write(struct ata_request *reques size / sizeof(int32_t)); if (request->transfersize < length) { - device_printf(request->dev, "WARNING - %s write data underrun %d>%d\n", + device_printf(request->parent, "WARNING - %s write data underrun %d>%d\n", ata_cmd2str(request), length, request->transfersize); for (resid = request->transfersize; resid < length; resid += sizeof(int16_t)) Modified: stable/8/sys/dev/ata/ata-pci.c ============================================================================== --- stable/8/sys/dev/ata/ata-pci.c Mon Nov 23 07:49:50 2009 (r199695) +++ stable/8/sys/dev/ata/ata-pci.c Mon Nov 23 08:45:17 2009 (r199696) @@ -477,7 +477,7 @@ ata_pci_dmareset(device_t dev) ch->dma.flags &= ~ATA_DMA_ACTIVE; ATA_IDX_OUTB(ch, ATA_BMSTAT_PORT, ATA_BMSTAT_INTERRUPT | ATA_BMSTAT_ERROR); if ((request = ch->running)) { - device_printf(request->dev, "DMA reset calling unload\n"); + device_printf(dev, "DMA reset calling unload\n"); ch->dma.unload(request); } } Modified: stable/8/sys/dev/ata/ata-queue.c ============================================================================== --- stable/8/sys/dev/ata/ata-queue.c Mon Nov 23 07:49:50 2009 (r199695) +++ stable/8/sys/dev/ata/ata-queue.c Mon Nov 23 08:45:17 2009 (r199696) @@ -52,17 +52,25 @@ void ata_queue_request(struct ata_request *request) { struct ata_channel *ch; + struct ata_device *atadev = device_get_softc(request->dev); /* treat request as virgin (this might be an ATA_R_REQUEUE) */ request->result = request->status = request->error = 0; - /* check that the device is still valid */ + /* Prepare paramers required by low-level code. */ + request->unit = atadev->unit; if (!(request->parent = device_get_parent(request->dev))) { request->result = ENXIO; if (request->callback) (request->callback)(request); return; } + if ((atadev->param.config & ATA_PROTO_MASK) == ATA_PROTO_ATAPI_16) + request->flags |= ATA_R_ATAPI16; + if ((atadev->param.config & ATA_DRQ_MASK) == ATA_DRQ_INTR) + request->flags |= ATA_R_ATAPI_INTR; + if ((request->flags & ATA_R_ATAPI) == 0) + ata_modify_if_48bit(request); ch = device_get_softc(request->parent); callout_init_mtx(&request->callout, &ch->state_mtx, CALLOUT_RETURNUNLOCKED); if (!request->callback && !(request->flags & ATA_R_REQUEUE)) Modified: stable/8/sys/dev/ata/ata-sata.c ============================================================================== --- stable/8/sys/dev/ata/ata-sata.c Mon Nov 23 07:49:50 2009 (r199695) +++ stable/8/sys/dev/ata/ata-sata.c Mon Nov 23 08:45:17 2009 (r199696) @@ -246,11 +246,10 @@ ata_sata_setmode(device_t dev, int mode) int ata_request2fis_h2d(struct ata_request *request, u_int8_t *fis) { - struct ata_device *atadev = device_get_softc(request->dev); if (request->flags & ATA_R_ATAPI) { fis[0] = 0x27; /* host to device */ - fis[1] = 0x80 | (atadev->unit & 0x0f); + fis[1] = 0x80 | (request->unit & 0x0f); fis[2] = ATA_PACKET_CMD; if (request->flags & (ATA_R_READ | ATA_R_WRITE)) fis[3] = ATA_F_DMA; @@ -263,16 +262,15 @@ ata_request2fis_h2d(struct ata_request * return 20; } else { - ata_modify_if_48bit(request); fis[0] = 0x27; /* host to device */ - fis[1] = 0x80 | (atadev->unit & 0x0f); + fis[1] = 0x80 | (request->unit & 0x0f); fis[2] = request->u.ata.command; fis[3] = request->u.ata.feature; fis[4] = request->u.ata.lba; fis[5] = request->u.ata.lba >> 8; fis[6] = request->u.ata.lba >> 16; fis[7] = ATA_D_LBA; - if (!(atadev->flags & ATA_D_48BIT_ACTIVE)) + if (!(request->flags & ATA_R_48BIT)) fis[7] |= (ATA_D_IBM | (request->u.ata.lba >> 24 & 0x0f)); fis[8] = request->u.ata.lba >> 24; fis[9] = request->u.ata.lba >> 32; @@ -339,9 +337,6 @@ ata_pm_identify(device_t dev) pm_chipid, pm_revision, pm_ports); } - /* realloc space for needed DMA slots */ - ch->dma.dma_slots = pm_ports; - /* reset all ports and register if anything connected */ for (port=0; port < pm_ports; port++) { u_int32_t signature; Modified: stable/8/sys/dev/ata/chipsets/ata-ahci.c ============================================================================== --- stable/8/sys/dev/ata/chipsets/ata-ahci.c Mon Nov 23 07:49:50 2009 (r199695) +++ stable/8/sys/dev/ata/chipsets/ata-ahci.c Mon Nov 23 08:45:17 2009 (r199696) @@ -385,23 +385,22 @@ ata_ahci_status(device_t dev) static int ata_ahci_begin_transaction(struct ata_request *request) { - struct ata_pci_controller *ctlr=device_get_softc(GRANDPARENT(request->dev)); + struct ata_pci_controller *ctlr=device_get_softc(device_get_parent(request->parent)); struct ata_channel *ch = device_get_softc(request->parent); - struct ata_device *atadev = device_get_softc(request->dev); struct ata_ahci_cmd_tab *ctp; struct ata_ahci_cmd_list *clp; int offset = ch->unit << 7; - int port = atadev->unit & 0x0f; + int port = request->unit & 0x0f; int entries = 0; int fis_size; /* get a piece of the workspace for this request */ ctp = (struct ata_ahci_cmd_tab *) - (ch->dma.work + ATA_AHCI_CT_OFFSET + (ATA_AHCI_CT_SIZE*request->tag)); + (ch->dma.work + ATA_AHCI_CT_OFFSET); /* setup the FIS for this request */ if (!(fis_size = ata_ahci_setup_fis(ctp, request))) { - device_printf(request->dev, "setting up SATA FIS failed\n"); + device_printf(request->parent, "setting up SATA FIS failed\n"); request->result = EIO; return ATA_OP_FINISHED; } @@ -409,7 +408,7 @@ ata_ahci_begin_transaction(struct ata_re /* if request moves data setup and load SG list */ if (request->flags & (ATA_R_READ | ATA_R_WRITE)) { if (ch->dma.load(request, ctp->prd_tab, &entries)) { - device_printf(request->dev, "setting up DMA failed\n"); + device_printf(request->parent, "setting up DMA failed\n"); request->result = EIO; return ATA_OP_FINISHED; } @@ -417,7 +416,7 @@ ata_ahci_begin_transaction(struct ata_re /* setup the command list entry */ clp = (struct ata_ahci_cmd_list *) - (ch->dma.work + ATA_AHCI_CL_OFFSET + (ATA_AHCI_CL_SIZE*request->tag)); + (ch->dma.work + ATA_AHCI_CL_OFFSET); clp->prd_length = entries; clp->cmd_flags = (request->flags & ATA_R_WRITE ? ATA_AHCI_CMD_WRITE : 0) | @@ -426,12 +425,7 @@ ata_ahci_begin_transaction(struct ata_re (fis_size / sizeof(u_int32_t)) | (port << 12); clp->bytecount = 0; - clp->cmd_table_phys = htole64(ch->dma.work_bus + ATA_AHCI_CT_OFFSET + - (ATA_AHCI_CT_SIZE * request->tag)); - - /* clear eventual ACTIVE bit */ - ATA_IDX_OUTL(ch, ATA_SACTIVE, - ATA_IDX_INL(ch, ATA_SACTIVE) & (1 << request->tag)); + clp->cmd_table_phys = htole64(ch->dma.work_bus + ATA_AHCI_CT_OFFSET); /* set command type bit */ if (request->flags & ATA_R_ATAPI) @@ -444,7 +438,7 @@ ata_ahci_begin_transaction(struct ata_re ~ATA_AHCI_P_CMD_ATAPI); /* issue command to controller */ - ATA_OUTL(ctlr->r_res2, ATA_AHCI_P_CI + offset, (1 << request->tag)); + ATA_OUTL(ctlr->r_res2, ATA_AHCI_P_CI + offset, 1); if (!(request->flags & ATA_R_ATAPI)) { /* device reset doesn't interrupt */ @@ -476,7 +470,7 @@ ata_ahci_begin_transaction(struct ata_re static int ata_ahci_end_transaction(struct ata_request *request) { - struct ata_pci_controller *ctlr=device_get_softc(GRANDPARENT(request->dev)); + struct ata_pci_controller *ctlr=device_get_softc(device_get_parent(request->parent)); struct ata_channel *ch = device_get_softc(request->parent); struct ata_ahci_cmd_list *clp; u_int32_t tf_data; @@ -495,13 +489,12 @@ ata_ahci_end_transaction(struct ata_requ /* on control commands read back registers to the request struct */ if (request->flags & ATA_R_CONTROL) { - struct ata_device *atadev = device_get_softc(request->dev); u_int8_t *fis = ch->dma.work + ATA_AHCI_FB_OFFSET + 0x40; request->u.ata.count = fis[12] | ((u_int16_t)fis[13] << 8); request->u.ata.lba = fis[4] | ((u_int64_t)fis[5] << 8) | ((u_int64_t)fis[6] << 16); - if (atadev->flags & ATA_D_48BIT_ACTIVE) + if (request->flags & ATA_R_48BIT) request->u.ata.lba |= ((u_int64_t)fis[8] << 24) | ((u_int64_t)fis[9] << 32) | ((u_int64_t)fis[10] << 40); @@ -511,7 +504,7 @@ ata_ahci_end_transaction(struct ata_requ /* record how much data we actually moved */ clp = (struct ata_ahci_cmd_list *) - (ch->dma.work + ATA_AHCI_CL_OFFSET + (ATA_AHCI_CL_SIZE*request->tag)); + (ch->dma.work + ATA_AHCI_CL_OFFSET); request->donecount = clp->bytecount; /* release SG list etc */ Modified: stable/8/sys/dev/ata/chipsets/ata-intel.c ============================================================================== --- stable/8/sys/dev/ata/chipsets/ata-intel.c Mon Nov 23 07:49:50 2009 (r199695) +++ stable/8/sys/dev/ata/chipsets/ata-intel.c Mon Nov 23 08:45:17 2009 (r199696) @@ -470,10 +470,10 @@ ata_intel_31244_status(device_t dev) static void ata_intel_31244_tf_write(struct ata_request *request) { - struct ata_channel *ch = device_get_softc(device_get_parent(request->dev)); + struct ata_channel *ch = device_get_softc(request->parent); struct ata_device *atadev = device_get_softc(request->dev); - if (atadev->flags & ATA_D_48BIT_ACTIVE) { + if (request->flags & ATA_R_48BIT) { ATA_IDX_OUTW(ch, ATA_FEATURE, request->u.ata.feature); ATA_IDX_OUTW(ch, ATA_COUNT, request->u.ata.count); ATA_IDX_OUTW(ch, ATA_SECTOR, ((request->u.ata.lba >> 16) & 0xff00) | @@ -482,7 +482,7 @@ ata_intel_31244_tf_write(struct ata_requ ((request->u.ata.lba >> 8) & 0x00ff)); ATA_IDX_OUTW(ch, ATA_CYL_MSB, ((request->u.ata.lba >> 32) & 0xff00) | ((request->u.ata.lba >> 16) & 0x00ff)); - ATA_IDX_OUTW(ch, ATA_DRIVE, ATA_D_LBA | ATA_DEV(atadev->unit)); + ATA_IDX_OUTW(ch, ATA_DRIVE, ATA_D_LBA | ATA_DEV(request->unit)); } else { ATA_IDX_OUTB(ch, ATA_FEATURE, request->u.ata.feature); @@ -503,7 +503,7 @@ ata_intel_31244_tf_write(struct ata_requ (request->u.ata.lba / (sectors * heads))); ATA_IDX_OUTB(ch, ATA_CYL_MSB, (request->u.ata.lba / (sectors * heads)) >> 8); - ATA_IDX_OUTB(ch, ATA_DRIVE, ATA_D_IBM | ATA_DEV(atadev->unit) | + ATA_IDX_OUTB(ch, ATA_DRIVE, ATA_D_IBM | ATA_DEV(request->unit) | (((request->u.ata.lba% (sectors * heads)) / sectors) & 0xf)); } @@ -512,7 +512,7 @@ ata_intel_31244_tf_write(struct ata_requ ATA_IDX_OUTB(ch, ATA_CYL_LSB, request->u.ata.lba >> 8); ATA_IDX_OUTB(ch, ATA_CYL_MSB, request->u.ata.lba >> 16); ATA_IDX_OUTB(ch, ATA_DRIVE, - ATA_D_IBM | ATA_D_LBA | ATA_DEV(atadev->unit) | + ATA_D_IBM | ATA_D_LBA | ATA_DEV(request->unit) | ((request->u.ata.lba >> 24) & 0x0f)); } } Modified: stable/8/sys/dev/ata/chipsets/ata-marvell.c ============================================================================== --- stable/8/sys/dev/ata/chipsets/ata-marvell.c Mon Nov 23 07:49:50 2009 (r199695) +++ stable/8/sys/dev/ata/chipsets/ata-marvell.c Mon Nov 23 08:45:17 2009 (r199696) @@ -354,7 +354,7 @@ ata_marvell_edma_status(device_t dev) static int ata_marvell_edma_begin_transaction(struct ata_request *request) { - struct ata_pci_controller *ctlr=device_get_softc(GRANDPARENT(request->dev)); + struct ata_pci_controller *ctlr=device_get_softc(device_get_parent(request->parent)); struct ata_channel *ch = device_get_softc(request->parent); u_int32_t req_in; u_int8_t *bytep; @@ -363,7 +363,9 @@ ata_marvell_edma_begin_transaction(struc /* only DMA R/W goes through the EMDA machine */ if (request->u.ata.command != ATA_READ_DMA && - request->u.ata.command != ATA_WRITE_DMA) { + request->u.ata.command != ATA_WRITE_DMA && + request->u.ata.command != ATA_READ_DMA48 && + request->u.ata.command != ATA_WRITE_DMA48) { /* disable the EDMA machinery */ if (ATA_INL(ctlr->r_res1, 0x02028 + ATA_MV_EDMA_BASE(ch)) & 0x00000001) @@ -371,12 +373,9 @@ ata_marvell_edma_begin_transaction(struc return ata_begin_transaction(request); } - /* check for 48 bit access and convert if needed */ - ata_modify_if_48bit(request); - /* check sanity, setup SG list and DMA engine */ if ((error = ch->dma.load(request, NULL, NULL))) { - device_printf(request->dev, "setting up DMA failed\n"); + device_printf(request->parent, "setting up DMA failed\n"); request->result = error; return ATA_OP_FINISHED; } @@ -472,7 +471,7 @@ ata_marvell_edma_begin_transaction(struc static int ata_marvell_edma_end_transaction(struct ata_request *request) { - struct ata_pci_controller *ctlr=device_get_softc(GRANDPARENT(request->dev)); + struct ata_pci_controller *ctlr=device_get_softc(device_get_parent(request->parent)); struct ata_channel *ch = device_get_softc(request->parent); int offset = (ch->unit > 3 ? 0x30014 : 0x20014); u_int32_t icr = ATA_INL(ctlr->r_res1, offset); Modified: stable/8/sys/dev/ata/chipsets/ata-promise.c ============================================================================== --- stable/8/sys/dev/ata/chipsets/ata-promise.c Mon Nov 23 07:49:50 2009 (r199695) +++ stable/8/sys/dev/ata/chipsets/ata-promise.c Mon Nov 23 08:45:17 2009 (r199696) @@ -387,11 +387,10 @@ ata_promise_status(device_t dev) static int ata_promise_dmastart(struct ata_request *request) { - struct ata_pci_controller *ctlr=device_get_softc(GRANDPARENT(request->dev)); + struct ata_pci_controller *ctlr=device_get_softc(device_get_parent(request->parent)); struct ata_channel *ch = device_get_softc(request->parent); - struct ata_device *atadev = device_get_softc(request->dev); - if (atadev->flags & ATA_D_48BIT_ACTIVE) { + if (request->flags & ATA_R_48BIT) { ATA_OUTB(ctlr->r_res1, 0x11, ATA_INB(ctlr->r_res1, 0x11) | (ch->unit ? 0x08 : 0x02)); ATA_OUTL(ctlr->r_res1, ch->unit ? 0x24 : 0x20, @@ -411,12 +410,11 @@ ata_promise_dmastart(struct ata_request static int ata_promise_dmastop(struct ata_request *request) { - struct ata_pci_controller *ctlr=device_get_softc(GRANDPARENT(request->dev)); + struct ata_pci_controller *ctlr=device_get_softc(device_get_parent(request->parent)); struct ata_channel *ch = device_get_softc(request->parent); - struct ata_device *atadev = device_get_softc(request->dev); int error; - if (atadev->flags & ATA_D_48BIT_ACTIVE) { + if (request->flags & ATA_R_48BIT) { ATA_OUTB(ctlr->r_res1, 0x11, ATA_INB(ctlr->r_res1, 0x11) & ~(ch->unit ? 0x08 : 0x02)); ATA_OUTL(ctlr->r_res1, ch->unit ? 0x24 : 0x20, 0); @@ -682,9 +680,8 @@ ata_promise_mio_status(device_t dev) static int ata_promise_mio_command(struct ata_request *request) { - struct ata_pci_controller *ctlr=device_get_softc(GRANDPARENT(request->dev)); + struct ata_pci_controller *ctlr=device_get_softc(device_get_parent(request->parent)); struct ata_channel *ch = device_get_softc(request->parent); - struct ata_device *atadev = device_get_softc(request->dev); u_int32_t *wordp = (u_int32_t *)ch->dma.work; @@ -693,7 +690,7 @@ ata_promise_mio_command(struct ata_reque if ((ctlr->chip->cfg2 == PR_SATA2) || ((ctlr->chip->cfg2 == PR_CMBO2) && (ch->unit < 2))) { /* set portmultiplier port */ - ATA_OUTB(ctlr->r_res2, 0x4e8 + (ch->unit << 8), atadev->unit & 0x0f); + ATA_OUTB(ctlr->r_res2, 0x4e8 + (ch->unit << 8), request->unit & 0x0f); } /* XXX SOS add ATAPI commands support later */ @@ -1051,7 +1048,7 @@ ata_promise_sx4_intr(void *data) static int ata_promise_sx4_command(struct ata_request *request) { - device_t gparent = GRANDPARENT(request->dev); + device_t gparent = device_get_parent(request->parent); struct ata_pci_controller *ctlr = device_get_softc(gparent); struct ata_channel *ch = device_get_softc(request->parent); struct ata_dma_prdentry *prd; @@ -1158,15 +1155,14 @@ ata_promise_sx4_command(struct ata_reque static int ata_promise_apkt(u_int8_t *bytep, struct ata_request *request) { - struct ata_device *atadev = device_get_softc(request->dev); int i = 12; bytep[i++] = ATA_PDC_1B | ATA_PDC_WRITE_REG | ATA_PDC_WAIT_NBUSY|ATA_DRIVE; - bytep[i++] = ATA_D_IBM | ATA_D_LBA | ATA_DEV(atadev->unit); + bytep[i++] = ATA_D_IBM | ATA_D_LBA | ATA_DEV(request->unit); bytep[i++] = ATA_PDC_1B | ATA_PDC_WRITE_CTL; bytep[i++] = ATA_A_4BIT; - if (atadev->flags & ATA_D_48BIT_ACTIVE) { + if (request->flags & ATA_R_48BIT) { bytep[i++] = ATA_PDC_2B | ATA_PDC_WRITE_REG | ATA_FEATURE; bytep[i++] = request->u.ata.feature >> 8; bytep[i++] = request->u.ata.feature; @@ -1183,7 +1179,7 @@ ata_promise_apkt(u_int8_t *bytep, struct bytep[i++] = request->u.ata.lba >> 40; bytep[i++] = request->u.ata.lba >> 16; bytep[i++] = ATA_PDC_1B | ATA_PDC_WRITE_REG | ATA_DRIVE; - bytep[i++] = ATA_D_LBA | ATA_DEV(atadev->unit); + bytep[i++] = ATA_D_LBA | ATA_DEV(request->unit); } else { bytep[i++] = ATA_PDC_1B | ATA_PDC_WRITE_REG | ATA_FEATURE; @@ -1197,8 +1193,7 @@ ata_promise_apkt(u_int8_t *bytep, struct bytep[i++] = ATA_PDC_1B | ATA_PDC_WRITE_REG | ATA_CYL_MSB; bytep[i++] = request->u.ata.lba >> 16; bytep[i++] = ATA_PDC_1B | ATA_PDC_WRITE_REG | ATA_DRIVE; - bytep[i++] = (atadev->flags & ATA_D_USE_CHS ? 0 : ATA_D_LBA) | - ATA_D_IBM | ATA_DEV(atadev->unit) | + bytep[i++] = ATA_D_LBA | ATA_D_IBM | ATA_DEV(request->unit) | ((request->u.ata.lba >> 24)&0xf); } bytep[i++] = ATA_PDC_1B | ATA_PDC_WRITE_END | ATA_COMMAND; Modified: stable/8/sys/dev/ata/chipsets/ata-serverworks.c ============================================================================== --- stable/8/sys/dev/ata/chipsets/ata-serverworks.c Mon Nov 23 07:49:50 2009 (r199695) +++ stable/8/sys/dev/ata/chipsets/ata-serverworks.c Mon Nov 23 08:45:17 2009 (r199696) @@ -259,9 +259,8 @@ static void ata_serverworks_tf_read(struct ata_request *request) { struct ata_channel *ch = device_get_softc(request->parent); - struct ata_device *atadev = device_get_softc(request->dev); - if (atadev->flags & ATA_D_48BIT_ACTIVE) { + if (request->flags & ATA_R_48BIT) { u_int16_t temp; request->u.ata.count = ATA_IDX_INW(ch, ATA_COUNT); @@ -290,7 +289,7 @@ ata_serverworks_tf_write(struct ata_requ struct ata_channel *ch = device_get_softc(request->parent); struct ata_device *atadev = device_get_softc(request->dev); - if (atadev->flags & ATA_D_48BIT_ACTIVE) { + if (request->flags & ATA_R_48BIT) { ATA_IDX_OUTW(ch, ATA_FEATURE, request->u.ata.feature); ATA_IDX_OUTW(ch, ATA_COUNT, request->u.ata.count); ATA_IDX_OUTW(ch, ATA_SECTOR, ((request->u.ata.lba >> 16) & 0xff00) | @@ -299,7 +298,7 @@ ata_serverworks_tf_write(struct ata_requ ((request->u.ata.lba >> 8) & 0x00ff)); ATA_IDX_OUTW(ch, ATA_CYL_MSB, ((request->u.ata.lba >> 32) & 0xff00) | ((request->u.ata.lba >> 16) & 0x00ff)); - ATA_IDX_OUTW(ch, ATA_DRIVE, ATA_D_LBA | ATA_DEV(atadev->unit)); + ATA_IDX_OUTW(ch, ATA_DRIVE, ATA_D_LBA | ATA_DEV(request->unit)); } else { ATA_IDX_OUTW(ch, ATA_FEATURE, request->u.ata.feature); @@ -320,7 +319,7 @@ ata_serverworks_tf_write(struct ata_requ (request->u.ata.lba / (sectors * heads))); ATA_IDX_OUTW(ch, ATA_CYL_MSB, (request->u.ata.lba / (sectors * heads)) >> 8); - ATA_IDX_OUTW(ch, ATA_DRIVE, ATA_D_IBM | ATA_DEV(atadev->unit) | + ATA_IDX_OUTW(ch, ATA_DRIVE, ATA_D_IBM | ATA_DEV(request->unit) | (((request->u.ata.lba% (sectors * heads)) / sectors) & 0xf)); } @@ -329,7 +328,7 @@ ata_serverworks_tf_write(struct ata_requ ATA_IDX_OUTW(ch, ATA_CYL_LSB, request->u.ata.lba >> 8); ATA_IDX_OUTW(ch, ATA_CYL_MSB, request->u.ata.lba >> 16); ATA_IDX_OUTW(ch, ATA_DRIVE, - ATA_D_IBM | ATA_D_LBA | ATA_DEV(atadev->unit) | + ATA_D_IBM | ATA_D_LBA | ATA_DEV(request->unit) | ((request->u.ata.lba >> 24) & 0x0f)); } } Modified: stable/8/sys/dev/ata/chipsets/ata-siliconimage.c ============================================================================== --- stable/8/sys/dev/ata/chipsets/ata-siliconimage.c Mon Nov 23 07:49:50 2009 (r199695) +++ stable/8/sys/dev/ata/chipsets/ata-siliconimage.c Mon Nov 23 08:45:17 2009 (r199696) @@ -457,7 +457,7 @@ struct ata_siiprb_dma_prdentry { u_int32_t control; } __packed; -#define ATA_SIIPRB_DMA_ENTRIES 125 +#define ATA_SIIPRB_DMA_ENTRIES 129 struct ata_siiprb_ata_command { struct ata_siiprb_dma_prdentry prd[ATA_SIIPRB_DMA_ENTRIES]; } __packed; @@ -542,7 +542,7 @@ ata_siiprb_status(device_t dev) static int ata_siiprb_begin_transaction(struct ata_request *request) { - struct ata_pci_controller *ctlr=device_get_softc(GRANDPARENT(request->dev)); + struct ata_pci_controller *ctlr=device_get_softc(device_get_parent(request->parent)); struct ata_channel *ch = device_get_softc(request->parent); struct ata_siiprb_command *prb; struct ata_siiprb_dma_prdentry *prd; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon Nov 23 08:46:27 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0DE32106566C; Mon, 23 Nov 2009 08:46:27 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F06FF8FC17; Mon, 23 Nov 2009 08:46:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAN8kQFi046346; Mon, 23 Nov 2009 08:46:26 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAN8kQW0046344; Mon, 23 Nov 2009 08:46:26 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200911230846.nAN8kQW0046344@svn.freebsd.org> From: Alexander Motin Date: Mon, 23 Nov 2009 08:46:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199697 - stable/8/sys/dev/ata/chipsets X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Nov 2009 08:46:27 -0000 Author: mav Date: Mon Nov 23 08:46:26 2009 New Revision: 199697 URL: http://svn.freebsd.org/changeset/base/199697 Log: MFC r198752: Allow SATA1 SiI chips to do full-sized DMA. Specification tells that we may release DMA constrants even more, but it require some additional handling. Modified: stable/8/sys/dev/ata/chipsets/ata-siliconimage.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/ata/chipsets/ata-siliconimage.c ============================================================================== --- stable/8/sys/dev/ata/chipsets/ata-siliconimage.c Mon Nov 23 08:45:17 2009 (r199696) +++ stable/8/sys/dev/ata/chipsets/ata-siliconimage.c Mon Nov 23 08:46:26 2009 (r199697) @@ -340,6 +340,7 @@ ata_sii_ch_attach(device_t dev) ATA_OUTL(ctlr->r_res2, 0x148 + (unit01 << 7) + (unit10 << 8),(1 << 16)); } + ch->dma.max_iosize = (ATA_DMA_ENTRIES - 1) * PAGE_SIZE; if (ctlr->chip->cfg2 & SII_BUG) { /* work around errata in early chips */ ch->dma.boundary = 8192; From owner-svn-src-all@FreeBSD.ORG Mon Nov 23 08:56:19 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4B679106566C; Mon, 23 Nov 2009 08:56:19 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 37A358FC16; Mon, 23 Nov 2009 08:56:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAN8uHI5046588; Mon, 23 Nov 2009 08:56:17 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAN8uHxm046580; Mon, 23 Nov 2009 08:56:17 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200911230856.nAN8uHxm046580@svn.freebsd.org> From: Alexander Motin Date: Mon, 23 Nov 2009 08:56:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199698 - in stable/8/sys/dev: ahci ata ata/chipsets X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Nov 2009 08:56:19 -0000 Author: mav Date: Mon Nov 23 08:56:17 2009 New Revision: 199698 URL: http://svn.freebsd.org/changeset/base/199698 Log: MFC r199259, r199262, r199322: Change the way in which AHCI+PATA combined controllers, such as JMicron are handled. Instead of trying to attach two different drivers to single device, wrapping each call, make one of them (atajmicron) attach do device solely, but create child device for AHCI driver, passing it all required resources. It is quite easy, as none of resources are shared, except IRQ. Add support for AHCI SATA parts of alike SATA+PATA MArvell controllers. Add IDs of Marvell 88SX6102, 88SX6111. 88SX6141 controllers. As result, it: - makes drivers operation more independent and straitforward, - allows to use new ahci(4) driver with such devices, adding support for new features, such as PMP and NCQ, same time keeping legacy PATA support, - will allow to just drop old ataahci driver, when it's time come. Modified: stable/8/sys/dev/ahci/ahci.c stable/8/sys/dev/ahci/ahci.h stable/8/sys/dev/ata/ata-pci.c stable/8/sys/dev/ata/ata-pci.h stable/8/sys/dev/ata/chipsets/ata-ahci.c stable/8/sys/dev/ata/chipsets/ata-jmicron.c stable/8/sys/dev/ata/chipsets/ata-marvell.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/ahci/ahci.c ============================================================================== --- stable/8/sys/dev/ahci/ahci.c Mon Nov 23 08:46:26 2009 (r199697) +++ stable/8/sys/dev/ahci/ahci.c Mon Nov 23 08:56:17 2009 (r199698) @@ -99,7 +99,14 @@ MALLOC_DEFINE(M_AHCI, "AHCI driver", "AH static struct { uint32_t id; const char *name; - int flags; + int quirks; +#define AHCI_Q_NOFORCE 1 +#define AHCI_Q_NOPMP 2 +#define AHCI_Q_NONCQ 4 +#define AHCI_Q_1CH 8 +#define AHCI_Q_2CH 16 +#define AHCI_Q_4CH 32 +#define AHCI_Q_EDGEIS 64 } ahci_ids[] = { {0x43801002, "ATI IXP600", 0}, {0x43901002, "ATI IXP700", 0}, @@ -145,6 +152,15 @@ static struct { {0x3b2b8086, "Intel PCH", 0}, {0x3b2c8086, "Intel PCH", 0}, {0x3b2f8086, "Intel PCH", 0}, + {0x2361197b, "JMicron JMB361", AHCI_Q_NOFORCE}, + {0x2363197b, "JMicron JMB363", AHCI_Q_NOFORCE}, + {0x2365197b, "JMicron JMB365", AHCI_Q_NOFORCE}, + {0x2366197b, "JMicron JMB366", AHCI_Q_NOFORCE}, + {0x2368197b, "JMicron JMB368", AHCI_Q_NOFORCE}, + {0x611111ab, "Marvell 88SX6111", AHCI_Q_NOFORCE|AHCI_Q_1CH|AHCI_Q_EDGEIS}, + {0x612111ab, "Marvell 88SX6121", AHCI_Q_NOFORCE|AHCI_Q_2CH|AHCI_Q_EDGEIS}, + {0x614111ab, "Marvell 88SX6141", AHCI_Q_NOFORCE|AHCI_Q_4CH|AHCI_Q_EDGEIS}, + {0x614511ab, "Marvell 88SX6145", AHCI_Q_NOFORCE|AHCI_Q_4CH|AHCI_Q_EDGEIS}, {0x044c10de, "NVIDIA MCP65", 0}, {0x044d10de, "NVIDIA MCP65", 0}, {0x044e10de, "NVIDIA MCP65", 0}, @@ -226,9 +242,39 @@ static int ahci_probe(device_t dev) { char buf[64]; + int i, valid = 0; + uint32_t devid = pci_get_devid(dev); + + /* Is this a possible AHCI candidate? */ + if (pci_get_class(dev) == PCIC_STORAGE && + pci_get_subclass(dev) == PCIS_STORAGE_SATA && + pci_get_progif(dev) == PCIP_STORAGE_SATA_AHCI_1_0) + valid = 1; + /* Is this a known AHCI chip? */ + for (i = 0; ahci_ids[i].id != 0; i++) { + if (ahci_ids[i].id == devid && + (valid || !(ahci_ids[i].quirks & AHCI_Q_NOFORCE))) { + snprintf(buf, sizeof(buf), "%s AHCI SATA controller", + ahci_ids[i].name); + device_set_desc_copy(dev, buf); + return (BUS_PROBE_VENDOR); + } + } + if (!valid) + return (ENXIO); + device_set_desc_copy(dev, "AHCI SATA controller"); + return (BUS_PROBE_VENDOR); +} + +static int +ahci_ata_probe(device_t dev) +{ + char buf[64]; int i; uint32_t devid = pci_get_devid(dev); + if ((intptr_t)device_get_ivars(dev) >= 0) + return (ENXIO); /* Is this a known AHCI chip? */ for (i = 0; ahci_ids[i].id != 0; i++) { if (ahci_ids[i].id == devid) { @@ -238,11 +284,6 @@ ahci_probe(device_t dev) return (BUS_PROBE_VENDOR); } } - /* Is this a possible AHCI candidate? */ - if (pci_get_class(dev) != PCIC_STORAGE || - pci_get_subclass(dev) != PCIS_STORAGE_SATA || - pci_get_progif(dev) != PCIP_STORAGE_SATA_AHCI_1_0) - return (ENXIO); device_set_desc_copy(dev, "AHCI SATA controller"); return (BUS_PROBE_VENDOR); } @@ -252,10 +293,15 @@ ahci_attach(device_t dev) { struct ahci_controller *ctlr = device_get_softc(dev); device_t child; - int error, unit, speed; + int error, unit, speed, i; + uint32_t devid = pci_get_devid(dev); u_int32_t version; ctlr->dev = dev; + i = 0; + while (ahci_ids[i].id != 0 && ahci_ids[i].id != devid) + i++; + ctlr->quirks = ahci_ids[i].quirks; resource_int_value(device_get_name(dev), device_get_unit(dev), "ccc", &ctlr->ccc); /* if we have a memory BAR(5) we are likely on an AHCI part */ @@ -282,10 +328,32 @@ ahci_attach(device_t dev) rman_fini(&ctlr->sc_iomem); return (error); }; - /* Get the number of HW channels */ + /* Get the HW capabilities */ + version = ATA_INL(ctlr->r_mem, AHCI_VS); + ctlr->caps = ATA_INL(ctlr->r_mem, AHCI_CAP); + if (version >= 0x00010020) + ctlr->caps2 = ATA_INL(ctlr->r_mem, AHCI_CAP2); ctlr->ichannels = ATA_INL(ctlr->r_mem, AHCI_PI); + if (ctlr->quirks & AHCI_Q_1CH) { + ctlr->caps &= ~AHCI_CAP_NPMASK; + ctlr->ichannels &= 0x01; + } + if (ctlr->quirks & AHCI_Q_2CH) { + ctlr->caps &= ~AHCI_CAP_NPMASK; + ctlr->caps |= 1; + ctlr->ichannels &= 0x03; + } + if (ctlr->quirks & AHCI_Q_4CH) { + ctlr->caps &= ~AHCI_CAP_NPMASK; + ctlr->caps |= 3; + ctlr->ichannels &= 0x0f; + } ctlr->channels = MAX(flsl(ctlr->ichannels), - (ATA_INL(ctlr->r_mem, AHCI_CAP) & AHCI_CAP_NPMASK) + 1); + (ctlr->caps & AHCI_CAP_NPMASK) + 1); + if (ctlr->quirks & AHCI_Q_NOPMP) + ctlr->caps &= ~AHCI_CAP_SPM; + if (ctlr->quirks & AHCI_Q_NONCQ) + ctlr->caps &= ~AHCI_CAP_SNCQ; /* Setup interrupts. */ if (ahci_setup_interrupt(dev)) { bus_release_resource(dev, SYS_RES_MEMORY, ctlr->r_rid, ctlr->r_mem); @@ -293,10 +361,6 @@ ahci_attach(device_t dev) return ENXIO; } /* Announce HW capabilities. */ - version = ATA_INL(ctlr->r_mem, AHCI_VS); - ctlr->caps = ATA_INL(ctlr->r_mem, AHCI_CAP); - if (version >= 0x00010020) - ctlr->caps2 = ATA_INL(ctlr->r_mem, AHCI_CAP2); speed = (ctlr->caps & AHCI_CAP_ISS) >> AHCI_CAP_ISS_SHIFT; device_printf(dev, "AHCI v%x.%02x with %d %sGbps ports, Port Multiplier %s\n", @@ -531,8 +595,15 @@ ahci_intr(void *data) for (; unit < ctlr->channels; unit++) { if ((is & (1 << unit)) != 0 && (arg = ctlr->interrupt[unit].argument)) { - ctlr->interrupt[unit].function(arg); - ATA_OUTL(ctlr->r_mem, AHCI_IS, 1 << unit); + if (ctlr->quirks & AHCI_Q_EDGEIS) { + /* Some controller have edge triggered IS. */ + ATA_OUTL(ctlr->r_mem, AHCI_IS, 1 << unit); + ctlr->interrupt[unit].function(arg); + } else { + /* but AHCI declares level triggered IS. */ + ctlr->interrupt[unit].function(arg); + ATA_OUTL(ctlr->r_mem, AHCI_IS, 1 << unit); + } } } } @@ -665,6 +736,25 @@ static driver_t ahci_driver = { sizeof(struct ahci_controller) }; DRIVER_MODULE(ahci, pci, ahci_driver, ahci_devclass, 0, 0); +static device_method_t ahci_ata_methods[] = { + DEVMETHOD(device_probe, ahci_ata_probe), + DEVMETHOD(device_attach, ahci_attach), + DEVMETHOD(device_detach, ahci_detach), + DEVMETHOD(device_suspend, ahci_suspend), + DEVMETHOD(device_resume, ahci_resume), + DEVMETHOD(bus_print_child, ahci_print_child), + DEVMETHOD(bus_alloc_resource, ahci_alloc_resource), + DEVMETHOD(bus_release_resource, ahci_release_resource), + DEVMETHOD(bus_setup_intr, ahci_setup_intr), + DEVMETHOD(bus_teardown_intr,ahci_teardown_intr), + { 0, 0 } +}; +static driver_t ahci_ata_driver = { + "ahci", + ahci_ata_methods, + sizeof(struct ahci_controller) +}; +DRIVER_MODULE(ahci, atapci, ahci_ata_driver, ahci_devclass, 0, 0); MODULE_VERSION(ahci, 1); MODULE_DEPEND(ahci, cam, 1, 1, 1); @@ -688,6 +778,7 @@ ahci_ch_attach(device_t dev) ch->unit = (intptr_t)device_get_ivars(dev); ch->caps = ctlr->caps; ch->caps2 = ctlr->caps2; + ch->quirks = ctlr->quirks; ch->numslots = ((ch->caps & AHCI_CAP_NCS) >> AHCI_CAP_NCS_SHIFT) + 1, mtx_init(&ch->mtx, "AHCI channel lock", NULL, MTX_DEF); resource_int_value(device_get_name(dev), @@ -858,7 +949,7 @@ static driver_t ahcich_driver = { ahcich_methods, sizeof(struct ahci_channel) }; -DRIVER_MODULE(ahcich, ahci, ahcich_driver, ahci_devclass, 0, 0); +DRIVER_MODULE(ahcich, ahci, ahcich_driver, ahcich_devclass, 0, 0); struct ahci_dc_cb_args { bus_addr_t maddr; Modified: stable/8/sys/dev/ahci/ahci.h ============================================================================== --- stable/8/sys/dev/ahci/ahci.h Mon Nov 23 08:46:26 2009 (r199697) +++ stable/8/sys/dev/ahci/ahci.h Mon Nov 23 08:56:17 2009 (r199698) @@ -352,6 +352,7 @@ struct ahci_channel { struct cam_path *path; uint32_t caps; /* Controller capabilities */ uint32_t caps2; /* Controller capabilities */ + int quirks; int numslots; /* Number of present slots */ int pm_level; /* power management level */ int sata_rev; /* Maximum allowed SATA generation */ @@ -391,6 +392,7 @@ struct ahci_controller { } irqs[16]; uint32_t caps; /* Controller capabilities */ uint32_t caps2; /* Controller capabilities */ + int quirks; int numirqs; int channels; int ichannels; Modified: stable/8/sys/dev/ata/ata-pci.c ============================================================================== --- stable/8/sys/dev/ata/ata-pci.c Mon Nov 23 08:46:26 2009 (r199697) +++ stable/8/sys/dev/ata/ata-pci.c Mon Nov 23 08:56:17 2009 (r199698) @@ -189,91 +189,138 @@ ata_pci_resume(device_t dev) return error; } +int +ata_pci_read_ivar(device_t dev, device_t child, int which, uintptr_t *result) +{ + + return (BUS_READ_IVAR(device_get_parent(dev), dev, which, result)); +} + +int +ata_pci_write_ivar(device_t dev, device_t child, int which, uintptr_t value) +{ + + return (BUS_WRITE_IVAR(device_get_parent(dev), dev, which, value)); +} + +uint32_t +ata_pci_read_config(device_t dev, device_t child, int reg, int width) +{ + + return (pci_read_config(dev, reg, width)); +} + +void +ata_pci_write_config(device_t dev, device_t child, int reg, + uint32_t val, int width) +{ + + pci_write_config(dev, reg, val, width); +} + struct resource * ata_pci_alloc_resource(device_t dev, device_t child, int type, int *rid, u_long start, u_long end, u_long count, u_int flags) { - struct ata_pci_controller *controller = device_get_softc(dev); - int unit = ((struct ata_channel *)device_get_softc(child))->unit; - struct resource *res = NULL; - int myrid; - - if (type == SYS_RES_IOPORT) { - switch (*rid) { - case ATA_IOADDR_RID: - if (controller->legacy) { - start = (unit ? ATA_SECONDARY : ATA_PRIMARY); - count = ATA_IOSIZE; - end = start + count - 1; - } - myrid = PCIR_BAR(0) + (unit << 3); - res = BUS_ALLOC_RESOURCE(device_get_parent(dev), dev, - SYS_RES_IOPORT, &myrid, - start, end, count, flags); - break; - - case ATA_CTLADDR_RID: - if (controller->legacy) { - start = (unit ? ATA_SECONDARY : ATA_PRIMARY) + ATA_CTLOFFSET; - count = ATA_CTLIOSIZE; - end = start + count - 1; - } - myrid = PCIR_BAR(1) + (unit << 3); - res = BUS_ALLOC_RESOURCE(device_get_parent(dev), dev, - SYS_RES_IOPORT, &myrid, - start, end, count, flags); - break; - } - } - if (type == SYS_RES_IRQ && *rid == ATA_IRQ_RID) { - if (controller->legacy) { - int irq = (unit == 0 ? 14 : 15); + struct ata_pci_controller *controller = device_get_softc(dev); + struct resource *res = NULL; + + if (device_get_devclass(child) == ata_devclass) { + int unit = ((struct ata_channel *)device_get_softc(child))->unit; + int myrid; + + if (type == SYS_RES_IOPORT) { + switch (*rid) { + case ATA_IOADDR_RID: + if (controller->legacy) { + start = (unit ? ATA_SECONDARY : ATA_PRIMARY); + count = ATA_IOSIZE; + end = start + count - 1; + } + myrid = PCIR_BAR(0) + (unit << 3); + res = BUS_ALLOC_RESOURCE(device_get_parent(dev), dev, + SYS_RES_IOPORT, &myrid, + start, end, count, flags); + break; + case ATA_CTLADDR_RID: + if (controller->legacy) { + start = (unit ? ATA_SECONDARY : ATA_PRIMARY) + + ATA_CTLOFFSET; + count = ATA_CTLIOSIZE; + end = start + count - 1; + } + myrid = PCIR_BAR(1) + (unit << 3); + res = BUS_ALLOC_RESOURCE(device_get_parent(dev), dev, + SYS_RES_IOPORT, &myrid, + start, end, count, flags); + break; + } + } + if (type == SYS_RES_IRQ && *rid == ATA_IRQ_RID) { + if (controller->legacy) { + int irq = (unit == 0 ? 14 : 15); - res = BUS_ALLOC_RESOURCE(device_get_parent(dev), child, - SYS_RES_IRQ, rid, irq, irq, 1, flags); + res = BUS_ALLOC_RESOURCE(device_get_parent(dev), child, + SYS_RES_IRQ, rid, irq, irq, 1, flags); + } else + res = controller->r_irq; + } + } else { + if (type == SYS_RES_IRQ) { + if (*rid != ATA_IRQ_RID) + return (NULL); + res = controller->r_irq; + } else { + res = BUS_ALLOC_RESOURCE(device_get_parent(dev), dev, + type, rid, start, end, count, flags); + } } - else - res = controller->r_irq; - } - return res; + return (res); } int ata_pci_release_resource(device_t dev, device_t child, int type, int rid, struct resource *r) { - struct ata_pci_controller *controller = device_get_softc(dev); - int unit = ((struct ata_channel *)device_get_softc(child))->unit; - - if (type == SYS_RES_IOPORT) { - switch (rid) { - case ATA_IOADDR_RID: - return BUS_RELEASE_RESOURCE(device_get_parent(dev), dev, - SYS_RES_IOPORT, - PCIR_BAR(0) + (unit << 3), r); - break; - - case ATA_CTLADDR_RID: - return BUS_RELEASE_RESOURCE(device_get_parent(dev), dev, - SYS_RES_IOPORT, - PCIR_BAR(1) + (unit << 3), r); - break; - default: - return ENOENT; - } - } - if (type == SYS_RES_IRQ) { - if (rid != ATA_IRQ_RID) - return ENOENT; - if (controller->legacy) { - return BUS_RELEASE_RESOURCE(device_get_parent(dev), child, - SYS_RES_IRQ, rid, r); + if (device_get_devclass(child) == ata_devclass) { + struct ata_pci_controller *controller = device_get_softc(dev); + int unit = ((struct ata_channel *)device_get_softc(child))->unit; + + if (type == SYS_RES_IOPORT) { + switch (rid) { + case ATA_IOADDR_RID: + return BUS_RELEASE_RESOURCE(device_get_parent(dev), dev, + SYS_RES_IOPORT, + PCIR_BAR(0) + (unit << 3), r); + case ATA_CTLADDR_RID: + return BUS_RELEASE_RESOURCE(device_get_parent(dev), dev, + SYS_RES_IOPORT, + PCIR_BAR(1) + (unit << 3), r); + default: + return ENOENT; + } + } + if (type == SYS_RES_IRQ) { + if (rid != ATA_IRQ_RID) + return ENOENT; + if (controller->legacy) { + return BUS_RELEASE_RESOURCE(device_get_parent(dev), child, + SYS_RES_IRQ, rid, r); + } else + return 0; + } + } else { + if (type == SYS_RES_IRQ) { + if (rid != ATA_IRQ_RID) + return (ENOENT); + return (0); + } else { + return (BUS_RELEASE_RESOURCE(device_get_parent(dev), child, + type, rid, r)); + } } - else - return 0; - } - return EINVAL; + return (EINVAL); } int @@ -281,44 +328,50 @@ ata_pci_setup_intr(device_t dev, device_ int flags, driver_filter_t *filter, driver_intr_t *function, void *argument, void **cookiep) { - struct ata_pci_controller *controller = device_get_softc(dev); + struct ata_pci_controller *controller = device_get_softc(dev); - if (controller->legacy) { - return BUS_SETUP_INTR(device_get_parent(dev), child, irq, + if (controller->legacy) { + return BUS_SETUP_INTR(device_get_parent(dev), child, irq, flags, filter, function, argument, cookiep); - } - else { - struct ata_pci_controller *controller = device_get_softc(dev); - int unit = ((struct ata_channel *)device_get_softc(child))->unit; + } else { + struct ata_pci_controller *controller = device_get_softc(dev); + int unit; - if (filter != NULL) { - printf("ata-pci.c: we cannot use a filter here\n"); - return (EINVAL); + if (filter != NULL) { + printf("ata-pci.c: we cannot use a filter here\n"); + return (EINVAL); + } + if (device_get_devclass(child) == ata_devclass) + unit = ((struct ata_channel *)device_get_softc(child))->unit; + else + unit = ATA_PCI_MAX_CH - 1; + controller->interrupt[unit].function = function; + controller->interrupt[unit].argument = argument; + *cookiep = controller; + return 0; } - controller->interrupt[unit].function = function; - controller->interrupt[unit].argument = argument; - *cookiep = controller; - return 0; - } } int ata_pci_teardown_intr(device_t dev, device_t child, struct resource *irq, void *cookie) { - struct ata_pci_controller *controller = device_get_softc(dev); - - if (controller->legacy) { - return BUS_TEARDOWN_INTR(device_get_parent(dev), child, irq, cookie); - } - else { struct ata_pci_controller *controller = device_get_softc(dev); - int unit = ((struct ata_channel *)device_get_softc(child))->unit; - controller->interrupt[unit].function = NULL; - controller->interrupt[unit].argument = NULL; - return 0; - } + if (controller->legacy) { + return BUS_TEARDOWN_INTR(device_get_parent(dev), child, irq, cookie); + } else { + struct ata_pci_controller *controller = device_get_softc(dev); + int unit; + + if (device_get_devclass(child) == ata_devclass) + unit = ((struct ata_channel *)device_get_softc(child))->unit; + else + unit = ATA_PCI_MAX_CH - 1; + controller->interrupt[unit].function = NULL; + controller->interrupt[unit].argument = NULL; + return 0; + } } static void @@ -510,12 +563,16 @@ static device_method_t ata_pci_methods[] DEVMETHOD(device_shutdown, bus_generic_shutdown), /* bus methods */ + DEVMETHOD(bus_read_ivar, ata_pci_read_ivar), + DEVMETHOD(bus_write_ivar, ata_pci_write_ivar), DEVMETHOD(bus_alloc_resource, ata_pci_alloc_resource), DEVMETHOD(bus_release_resource, ata_pci_release_resource), DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), DEVMETHOD(bus_setup_intr, ata_pci_setup_intr), DEVMETHOD(bus_teardown_intr, ata_pci_teardown_intr), + DEVMETHOD(pci_read_config, ata_pci_read_config), + DEVMETHOD(pci_write_config, ata_pci_write_config), { 0, 0 } }; @@ -537,6 +594,8 @@ ata_pcichannel_probe(device_t dev) { char buffer[32]; + if ((intptr_t)device_get_ivars(dev) < 0) + return (ENXIO); sprintf(buffer, "ATA channel %d", (int)(intptr_t)device_get_ivars(dev)); device_set_desc_copy(dev, buffer); @@ -711,7 +770,7 @@ ata_generic_intr(void *data) struct ata_channel *ch; int unit; - for (unit = 0; unit < ctlr->channels; unit++) { + for (unit = 0; unit < ATA_PCI_MAX_CH; unit++) { if ((ch = ctlr->interrupt[unit].argument)) ctlr->interrupt[unit].function(ch); } Modified: stable/8/sys/dev/ata/ata-pci.h ============================================================================== --- stable/8/sys/dev/ata/ata-pci.h Mon Nov 23 08:46:26 2009 (r199697) +++ stable/8/sys/dev/ata/ata-pci.h Mon Nov 23 08:56:17 2009 (r199698) @@ -36,6 +36,8 @@ struct ata_chip_id { char *text; }; +#define ATA_PCI_MAX_CH 8 + /* structure describing a PCI ATA controller */ struct ata_pci_controller { device_t dev; @@ -65,7 +67,7 @@ struct ata_pci_controller { struct { void (*function)(void *); void *argument; - } interrupt[8]; /* XXX SOS max ch# for now */ + } interrupt[ATA_PCI_MAX_CH]; void *chipset_data; }; @@ -225,7 +227,10 @@ struct ata_pci_controller { #define ATA_M88SX6081 0x608111ab #define ATA_M88SX7042 0x704211ab #define ATA_M88SX6101 0x610111ab +#define ATA_M88SX6102 0x610211ab +#define ATA_M88SX6111 0x611111ab #define ATA_M88SX6121 0x612111ab +#define ATA_M88SX6141 0x614111ab #define ATA_M88SX6145 0x614511ab #define ATA_MICRON_ID 0x1042 @@ -483,6 +488,11 @@ int ata_pci_attach(device_t dev); int ata_pci_detach(device_t dev); int ata_pci_suspend(device_t dev); int ata_pci_resume(device_t dev); +int ata_pci_read_ivar(device_t dev, device_t child, int which, uintptr_t *result); +int ata_pci_write_ivar(device_t dev, device_t child, int which, uintptr_t value); +uint32_t ata_pci_read_config(device_t dev, device_t child, int reg, int width); +void ata_pci_write_config(device_t dev, device_t child, int reg, + uint32_t val, int width); struct resource * ata_pci_alloc_resource(device_t dev, device_t child, int type, int *rid, u_long start, u_long end, u_long count, u_int flags); int ata_pci_release_resource(device_t dev, device_t child, int type, int rid, struct resource *r); int ata_pci_setup_intr(device_t dev, device_t child, struct resource *irq, int flags, driver_filter_t *filter, driver_intr_t *function, void *argument, void **cookiep); @@ -506,12 +516,6 @@ int ata_mode2idx(int mode); /* global prototypes from chipsets/ata-*.c */ int ata_ahci_chipinit(device_t); -int ata_ahci_ch_attach(device_t dev); -int ata_ahci_ch_detach(device_t dev); -int ata_ahci_ch_suspend(device_t dev); -int ata_ahci_ch_resume(device_t dev); -int ata_ahci_ctlr_reset(device_t dev); -void ata_ahci_reset(device_t dev); int ata_marvell_edma_chipinit(device_t); int ata_sii_chipinit(device_t); @@ -527,12 +531,16 @@ static device_method_t __CONCAT(dname,_m DEVMETHOD(device_suspend, ata_pci_suspend), \ DEVMETHOD(device_resume, ata_pci_resume), \ DEVMETHOD(device_shutdown, bus_generic_shutdown), \ + DEVMETHOD(bus_read_ivar, ata_pci_read_ivar), \ + DEVMETHOD(bus_write_ivar, ata_pci_write_ivar), \ DEVMETHOD(bus_alloc_resource, ata_pci_alloc_resource), \ DEVMETHOD(bus_release_resource, ata_pci_release_resource), \ DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), \ DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), \ DEVMETHOD(bus_setup_intr, ata_pci_setup_intr), \ DEVMETHOD(bus_teardown_intr, ata_pci_teardown_intr), \ + DEVMETHOD(pci_read_config, ata_pci_read_config), \ + DEVMETHOD(pci_write_config, ata_pci_write_config), \ { 0, 0 } \ }; \ static driver_t __CONCAT(dname,_driver) = { \ Modified: stable/8/sys/dev/ata/chipsets/ata-ahci.c ============================================================================== --- stable/8/sys/dev/ata/chipsets/ata-ahci.c Mon Nov 23 08:46:26 2009 (r199697) +++ stable/8/sys/dev/ata/chipsets/ata-ahci.c Mon Nov 23 08:56:17 2009 (r199698) @@ -52,6 +52,12 @@ __FBSDID("$FreeBSD$"); #include /* local prototypes */ +static int ata_ahci_ch_attach(device_t dev); +static int ata_ahci_ch_detach(device_t dev); +static int ata_ahci_ch_suspend(device_t dev); +static int ata_ahci_ch_resume(device_t dev); +static int ata_ahci_ctlr_reset(device_t dev); +static void ata_ahci_reset(device_t dev); static int ata_ahci_suspend(device_t dev); static int ata_ahci_status(device_t dev); static int ata_ahci_begin_transaction(struct ata_request *request); @@ -97,6 +103,49 @@ ata_ahci_probe(device_t dev) return (BUS_PROBE_GENERIC); } +static int +ata_ahci_ata_probe(device_t dev) +{ + struct ata_pci_controller *ctlr = device_get_softc(dev); + + if ((intptr_t)device_get_ivars(dev) >= 0) + return (ENXIO); + device_set_desc_copy(dev, "AHCI SATA controller"); + ctlr->chipinit = ata_ahci_chipinit; + return (BUS_PROBE_GENERIC); +} + +static int +ata_ahci_ata_attach(device_t dev) +{ + struct ata_pci_controller *ctlr = device_get_softc(dev); + device_t child; + int unit; + + /* do chipset specific setups only needed once */ + ctlr->legacy = 0; + ctlr->ichannels = -1; + ctlr->ch_attach = ata_pci_ch_attach; + ctlr->ch_detach = ata_pci_ch_detach; + ctlr->dev = dev; + if (ctlr->chipinit(dev)) + return ENXIO; + /* attach all channels on this controller */ + for (unit = 0; unit < ctlr->channels; unit++) { + if ((ctlr->ichannels & (1 << unit)) == 0) + continue; + child = device_add_child(dev, "ata", + ((unit == 0 || unit == 1) && ctlr->legacy) ? + unit : devclass_find_free_unit(ata_devclass, 2)); + if (child == NULL) + device_printf(dev, "failed to add ata child device\n"); + else + device_set_ivars(child, (void *)(intptr_t)unit); + } + bus_generic_attach(dev); + return 0; +} + int ata_ahci_chipinit(device_t dev) { @@ -129,9 +178,15 @@ ata_ahci_chipinit(device_t dev) /* get the number of HW channels */ ctlr->ichannels = ATA_INL(ctlr->r_res2, ATA_AHCI_PI); - ctlr->channels = - MAX(flsl(ctlr->ichannels), + ctlr->channels = MAX(flsl(ctlr->ichannels), (ATA_INL(ctlr->r_res2, ATA_AHCI_CAP) & ATA_AHCI_CAP_NPMASK) + 1); + if (pci_get_devid(dev) == ATA_M88SX6111) + ctlr->channels = 1; + else if (pci_get_devid(dev) == ATA_M88SX6121) + ctlr->channels = 2; + else if (pci_get_devid(dev) == ATA_M88SX6141 || + pci_get_devid(dev) == ATA_M88SX6145) + ctlr->channels = 4; ctlr->reset = ata_ahci_reset; ctlr->ch_attach = ata_ahci_ch_attach; @@ -183,7 +238,7 @@ ata_ahci_chipinit(device_t dev) return 0; } -int +static int ata_ahci_ctlr_reset(device_t dev) { struct ata_pci_controller *ctlr = device_get_softc(dev); @@ -228,7 +283,7 @@ ata_ahci_suspend(device_t dev) return 0; } -int +static int ata_ahci_ch_attach(device_t dev) { struct ata_pci_controller *ctlr = device_get_softc(device_get_parent(dev)); @@ -259,7 +314,7 @@ ata_ahci_ch_attach(device_t dev) return 0; } -int +static int ata_ahci_ch_detach(device_t dev) { @@ -268,7 +323,7 @@ ata_ahci_ch_detach(device_t dev) return (0); } -int +static int ata_ahci_ch_suspend(device_t dev) { struct ata_pci_controller *ctlr = device_get_softc(device_get_parent(dev)); @@ -293,7 +348,7 @@ ata_ahci_ch_suspend(device_t dev) return (0); } -int +static int ata_ahci_ch_resume(device_t dev) { struct ata_pci_controller *ctlr = device_get_softc(device_get_parent(dev)); @@ -813,7 +868,7 @@ ata_ahci_softreset(device_t dev, int por return ATA_INL(ctlr->r_res2, ATA_AHCI_P_SIG + offset); } -void +static void ata_ahci_reset(device_t dev) { struct ata_pci_controller *ctlr = device_get_softc(device_get_parent(dev)); @@ -845,9 +900,12 @@ ata_ahci_reset(device_t dev) ((ch->pm_level == 0) ? ATA_AHCI_P_IX_PRC | ATA_AHCI_P_IX_PC : 0) | ATA_AHCI_P_IX_DP | ATA_AHCI_P_IX_UF | ATA_AHCI_P_IX_SDB | ATA_AHCI_P_IX_DS | ATA_AHCI_P_IX_PS | ATA_AHCI_P_IX_DHR)); - - /* only probe for PortMultiplier if HW has support */ - if (ATA_INL(ctlr->r_res2, ATA_AHCI_CAP) & ATA_AHCI_CAP_SPM) { + /* + * Only probe for PortMultiplier if HW has support. + * Ignore Marvell, which is not working, + */ + if ((ATA_INL(ctlr->r_res2, ATA_AHCI_CAP) & ATA_AHCI_CAP_SPM) && + pci_get_vendor(ctlr->dev) != 0x11ab) { signature = ata_ahci_softreset(dev, ATA_PM); /* Workaround for some ATI chips, failing to soft-reset * when port multiplicator supported, but absent. @@ -924,3 +982,26 @@ ata_ahci_setup_fis(struct ata_ahci_cmd_t } ATA_DECLARE_DRIVER(ata_ahci); +static device_method_t ata_ahci_ata_methods[] = { + DEVMETHOD(device_probe, ata_ahci_ata_probe), + DEVMETHOD(device_attach, ata_ahci_ata_attach), + DEVMETHOD(device_detach, ata_pci_detach), + DEVMETHOD(device_suspend, ata_pci_suspend), + DEVMETHOD(device_resume, ata_pci_resume), + DEVMETHOD(device_shutdown, bus_generic_shutdown), + DEVMETHOD(bus_read_ivar, ata_pci_read_ivar), + DEVMETHOD(bus_write_ivar, ata_pci_write_ivar), + DEVMETHOD(bus_alloc_resource, ata_pci_alloc_resource), + DEVMETHOD(bus_release_resource, ata_pci_release_resource), + DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), + DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), + DEVMETHOD(bus_setup_intr, ata_pci_setup_intr), + DEVMETHOD(bus_teardown_intr, ata_pci_teardown_intr), + { 0, 0 } +}; +static driver_t ata_ahci_ata_driver = { + "atapci", + ata_ahci_ata_methods, + sizeof(struct ata_pci_controller) +}; +DRIVER_MODULE(ata_ahci_ata, atapci, ata_ahci_ata_driver, ata_pci_devclass, 0, 0); Modified: stable/8/sys/dev/ata/chipsets/ata-jmicron.c ============================================================================== --- stable/8/sys/dev/ata/chipsets/ata-jmicron.c Mon Nov 23 08:46:26 2009 (r199697) +++ stable/8/sys/dev/ata/chipsets/ata-jmicron.c Mon Nov 23 08:56:17 2009 (r199698) @@ -53,11 +53,6 @@ __FBSDID("$FreeBSD$"); /* local prototypes */ static int ata_jmicron_chipinit(device_t dev); -static int ata_jmicron_ch_attach(device_t dev); -static int ata_jmicron_ch_detach(device_t dev); -static int ata_jmicron_ch_suspend(device_t dev); -static int ata_jmicron_ch_resume(device_t dev); -static void ata_jmicron_reset(device_t dev); static void ata_jmicron_setmode(device_t dev, int mode); /* @@ -70,10 +65,10 @@ ata_jmicron_probe(device_t dev) struct ata_chip_id *idx; static struct ata_chip_id ids[] = {{ ATA_JMB360, 0, 1, 0, ATA_SA300, "JMB360" }, - { ATA_JMB361, 0, 1, 1, ATA_SA300, "JMB361" }, - { ATA_JMB363, 0, 2, 1, ATA_SA300, "JMB363" }, - { ATA_JMB365, 0, 1, 2, ATA_SA300, "JMB365" }, - { ATA_JMB366, 0, 2, 2, ATA_SA300, "JMB366" }, + { ATA_JMB361, 0, 1, 1, ATA_UDMA6, "JMB361" }, + { ATA_JMB363, 0, 2, 1, ATA_UDMA6, "JMB363" }, + { ATA_JMB365, 0, 1, 2, ATA_UDMA6, "JMB365" }, + { ATA_JMB366, 0, 2, 2, ATA_UDMA6, "JMB366" }, { ATA_JMB368, 0, 0, 1, ATA_UDMA6, "JMB368" }, { 0, 0, 0, 0, 0, 0}}; char buffer[64]; @@ -101,7 +96,7 @@ static int ata_jmicron_chipinit(device_t dev) { struct ata_pci_controller *ctlr = device_get_softc(dev); - int error; + device_t child; if (ata_setup_interrupt(dev, ata_generic_intr)) return ENXIO; @@ -123,116 +118,35 @@ ata_jmicron_chipinit(device_t dev) /* set controller configuration to a combined setup we support */ pci_write_config(dev, 0x40, 0x80c0a131, 4); pci_write_config(dev, 0x80, 0x01200000, 4); - - if (ctlr->chip->cfg1 && (error = ata_ahci_chipinit(dev))) - return error; - - ctlr->ch_attach = ata_jmicron_ch_attach; - ctlr->ch_detach = ata_jmicron_ch_detach; - ctlr->ch_suspend = ata_jmicron_ch_suspend; - ctlr->ch_resume = ata_jmicron_ch_resume; - ctlr->reset = ata_jmicron_reset; + /* Create AHCI subdevice if AHCI part present. */ + if (ctlr->chip->cfg1) { + child = device_add_child(dev, NULL, -1); + if (child != NULL) { + device_set_ivars(child, (void *)(intptr_t)-1); + bus_generic_attach(dev); + } + } + ctlr->ch_attach = ata_pci_ch_attach; + ctlr->ch_detach = ata_pci_ch_detach; + ctlr->reset = ata_generic_reset; ctlr->setmode = ata_jmicron_setmode; - - /* set the number of HW channels */ - ctlr->channels = ctlr->chip->cfg1 + ctlr->chip->cfg2; - ctlr->ichannels |= ((0xffffffffU >> (32 - ctlr->chip->cfg2)) - << ctlr->chip->cfg1); + ctlr->channels = ctlr->chip->cfg2; } return 0; } -static int -ata_jmicron_ch_attach(device_t dev) -{ - struct ata_pci_controller *ctlr = device_get_softc(device_get_parent(dev)); - struct ata_channel *ch = device_get_softc(dev); - int error; - - if (ch->unit >= ctlr->chip->cfg1) { - ch->unit -= ctlr->chip->cfg1; - error = ata_pci_ch_attach(dev); - ch->unit += ctlr->chip->cfg1; - } - else - error = ata_ahci_ch_attach(dev); - return error; -} - -static int -ata_jmicron_ch_detach(device_t dev) -{ - struct ata_pci_controller *ctlr = device_get_softc(device_get_parent(dev)); - struct ata_channel *ch = device_get_softc(dev); - int error; - - if (ch->unit >= ctlr->chip->cfg1) { - ch->unit -= ctlr->chip->cfg1; - error = ata_pci_ch_detach(dev); - ch->unit += ctlr->chip->cfg1; - } - else - error = ata_ahci_ch_detach(dev); - - return (error); -} - -static int -ata_jmicron_ch_suspend(device_t dev) -{ - struct ata_pci_controller *ctlr = device_get_softc(device_get_parent(dev)); - struct ata_channel *ch = device_get_softc(dev); - int error = 0; - - if (ch->unit < ctlr->chip->cfg1) - error = ata_ahci_ch_suspend(dev); - return error; -} - -static int -ata_jmicron_ch_resume(device_t dev) -{ - struct ata_pci_controller *ctlr = device_get_softc(device_get_parent(dev)); - struct ata_channel *ch = device_get_softc(dev); - int error = 0; - - if (ch->unit < ctlr->chip->cfg1) - error = ata_ahci_ch_resume(dev); - return (error); -} - -static void -ata_jmicron_reset(device_t dev) -{ - struct ata_pci_controller *ctlr = device_get_softc(device_get_parent(dev)); - struct ata_channel *ch = device_get_softc(dev); - - if (ch->unit >= ctlr->chip->cfg1) - ata_generic_reset(dev); - else - ata_ahci_reset(dev); -} - static void ata_jmicron_setmode(device_t dev, int mode) { - struct ata_pci_controller *ctlr = device_get_softc(GRANDPARENT(dev)); - struct ata_channel *ch = device_get_softc(device_get_parent(dev)); - - if (pci_read_config(dev, 0xdf, 1) & 0x40 || ch->unit >= ctlr->chip->cfg1) { struct ata_device *atadev = device_get_softc(dev); /* check for 80pin cable present */ if (pci_read_config(dev, 0x40, 1) & 0x08) - mode = ata_limit_mode(dev, mode, ATA_UDMA2); + mode = ata_limit_mode(dev, mode, ATA_UDMA2); else - mode = ata_limit_mode(dev, mode, ATA_UDMA6); - + mode = ata_limit_mode(dev, mode, ATA_UDMA6); if (!ata_controlcmd(dev, ATA_SETFEATURES, ATA_SF_SETXFER, 0, mode)) - atadev->mode = mode; - } - else - ata_sata_setmode(dev, mode); + atadev->mode = mode; } ATA_DECLARE_DRIVER(ata_jmicron); Modified: stable/8/sys/dev/ata/chipsets/ata-marvell.c ============================================================================== --- stable/8/sys/dev/ata/chipsets/ata-marvell.c Mon Nov 23 08:46:26 2009 (r199697) +++ stable/8/sys/dev/ata/chipsets/ata-marvell.c Mon Nov 23 08:56:17 2009 (r199698) @@ -52,9 +52,9 @@ __FBSDID("$FreeBSD$"); #include /* local prototypes */ -static int ata_marvell_pata_chipinit(device_t dev); -static int ata_marvell_pata_ch_attach(device_t dev); -static void ata_marvell_pata_setmode(device_t dev, int mode); +static int ata_marvell_chipinit(device_t dev); +static int ata_marvell_ch_attach(device_t dev); +static void ata_marvell_setmode(device_t dev, int mode); static int ata_marvell_edma_ch_attach(device_t dev); static int ata_marvell_edma_ch_detach(device_t dev); static int ata_marvell_edma_status(device_t dev); @@ -107,9 +107,12 @@ ata_marvell_probe(device_t dev) { ATA_M88SX6042, 0, 4, MV_6042, ATA_SA300, "88SX6042" }, { ATA_M88SX6081, 0, 8, MV_60XX, ATA_SA300, "88SX6081" }, { ATA_M88SX7042, 0, 4, MV_7042, ATA_SA300, "88SX7042" }, - { ATA_M88SX6101, 0, 1, MV_61XX, ATA_UDMA6, "88SX6101" }, - { ATA_M88SX6121, 0, 1, MV_61XX, ATA_UDMA6, "88SX6121" }, - { ATA_M88SX6145, 0, 2, MV_61XX, ATA_UDMA6, "88SX6145" }, + { ATA_M88SX6101, 0, 0, MV_61XX, ATA_UDMA6, "88SX6101" }, + { ATA_M88SX6102, 0, 0, MV_61XX, ATA_UDMA6, "88SX6102" }, + { ATA_M88SX6111, 0, 1, MV_61XX, ATA_UDMA6, "88SX6111" }, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon Nov 23 09:02:09 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 42D181065670; Mon, 23 Nov 2009 09:02:09 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 31A208FC1A; Mon, 23 Nov 2009 09:02:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAN929P9046782; Mon, 23 Nov 2009 09:02:09 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAN929kU046780; Mon, 23 Nov 2009 09:02:09 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200911230902.nAN929kU046780@svn.freebsd.org> From: Alexander Motin Date: Mon, 23 Nov 2009 09:02:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199699 - head/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Nov 2009 09:02:09 -0000 Author: mav Date: Mon Nov 23 09:02:08 2009 New Revision: 199699 URL: http://svn.freebsd.org/changeset/base/199699 Log: Refer more recently added Marvell chips. Modified: head/share/man/man4/ata.4 Modified: head/share/man/man4/ata.4 ============================================================================== --- head/share/man/man4/ata.4 Mon Nov 23 08:56:17 2009 (r199698) +++ head/share/man/man4/ata.4 Mon Nov 23 09:02:08 2009 (r199699) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 6, 2009 +.Dd November 23, 2009 .Dt ATA 4 .Os .Sh NAME @@ -146,7 +146,7 @@ IT8211F, IT8212F, IT8213F. JMB360, JMB361, JMB363, JMB365, JMB366, JMB368. .It Marvell 88SX5040, 88SX5041, 88SX5080, 88SX5081, 88SX6041, 88SX6042, 88SX6081, 88SX6101, -88SX6141, 88SX7042. +88SX6102, 88SX6111, 88SX6121, 88SX6141, 88SX6145, 88SX7042. .It National: SC1100. .It NetCell: From owner-svn-src-all@FreeBSD.ORG Mon Nov 23 09:10:08 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7FCA8106566C; Mon, 23 Nov 2009 09:10:08 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6D8458FC0C; Mon, 23 Nov 2009 09:10:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAN9A8bp046990; Mon, 23 Nov 2009 09:10:08 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAN9A8TE046988; Mon, 23 Nov 2009 09:10:08 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <200911230910.nAN9A8TE046988@svn.freebsd.org> From: Christian Brueffer Date: Mon, 23 Nov 2009 09:10:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199700 - stable/8/lib/libc/posix1e X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Nov 2009 09:10:08 -0000 Author: brueffer Date: Mon Nov 23 09:10:08 2009 New Revision: 199700 URL: http://svn.freebsd.org/changeset/base/199700 Log: MFC: r199317 Fix a memory leak in acl_from_text() in case the conversion succeeded. Modified: stable/8/lib/libc/posix1e/acl_from_text.c Directory Properties: stable/8/lib/libc/ (props changed) stable/8/lib/libc/stdtime/ (props changed) Modified: stable/8/lib/libc/posix1e/acl_from_text.c ============================================================================== --- stable/8/lib/libc/posix1e/acl_from_text.c Mon Nov 23 09:02:08 2009 (r199699) +++ stable/8/lib/libc/posix1e/acl_from_text.c Mon Nov 23 09:10:08 2009 (r199700) @@ -257,6 +257,7 @@ acl_from_text(const char *buf_p) } #endif + free(mybuf_p); return(acl); error_label: From owner-svn-src-all@FreeBSD.ORG Mon Nov 23 09:13:32 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9E30C1065672; Mon, 23 Nov 2009 09:13:32 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8C3878FC1C; Mon, 23 Nov 2009 09:13:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAN9DWK3047115; Mon, 23 Nov 2009 09:13:32 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAN9DWNN047113; Mon, 23 Nov 2009 09:13:32 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200911230913.nAN9DWNN047113@svn.freebsd.org> From: Alexander Motin Date: Mon, 23 Nov 2009 09:13:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199701 - stable/8/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Nov 2009 09:13:32 -0000 Author: mav Date: Mon Nov 23 09:13:32 2009 New Revision: 199701 URL: http://svn.freebsd.org/changeset/base/199701 Log: MFC 199699: Refer more recently added Marvell chips. Modified: stable/8/share/man/man4/ata.4 Directory Properties: stable/8/share/man/man4/ (props changed) Modified: stable/8/share/man/man4/ata.4 ============================================================================== --- stable/8/share/man/man4/ata.4 Mon Nov 23 09:10:08 2009 (r199700) +++ stable/8/share/man/man4/ata.4 Mon Nov 23 09:13:32 2009 (r199701) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 6, 2009 +.Dd November 23, 2009 .Dt ATA 4 .Os .Sh NAME @@ -146,7 +146,7 @@ IT8211F, IT8212F, IT8213F. JMB360, JMB361, JMB363, JMB365, JMB366, JMB368. .It Marvell 88SX5040, 88SX5041, 88SX5080, 88SX5081, 88SX6041, 88SX6042, 88SX6081, 88SX6101, -88SX6141, 88SX7042. +88SX6102, 88SX6111, 88SX6121, 88SX6141, 88SX6145, 88SX7042. .It National: SC1100. .It NetCell: From owner-svn-src-all@FreeBSD.ORG Mon Nov 23 09:15:17 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0903C1065672; Mon, 23 Nov 2009 09:15:17 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EB1788FC18; Mon, 23 Nov 2009 09:15:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAN9FGLX047204; Mon, 23 Nov 2009 09:15:16 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAN9FG5h047202; Mon, 23 Nov 2009 09:15:16 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <200911230915.nAN9FG5h047202@svn.freebsd.org> From: Christian Brueffer Date: Mon, 23 Nov 2009 09:15:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199702 - stable/7/lib/libc/posix1e X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Nov 2009 09:15:17 -0000 Author: brueffer Date: Mon Nov 23 09:15:16 2009 New Revision: 199702 URL: http://svn.freebsd.org/changeset/base/199702 Log: MFC: r199317 Fix a memory leak in acl_from_text() in case the conversion succeeded. Modified: stable/7/lib/libc/posix1e/acl_from_text.c Directory Properties: stable/7/lib/libc/ (props changed) Modified: stable/7/lib/libc/posix1e/acl_from_text.c ============================================================================== --- stable/7/lib/libc/posix1e/acl_from_text.c Mon Nov 23 09:13:32 2009 (r199701) +++ stable/7/lib/libc/posix1e/acl_from_text.c Mon Nov 23 09:15:16 2009 (r199702) @@ -229,6 +229,7 @@ acl_from_text(const char *buf_p) } #endif + free(mybuf_p); return(acl); error_label: From owner-svn-src-all@FreeBSD.ORG Mon Nov 23 09:16:40 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 89FB11065696; Mon, 23 Nov 2009 09:16:40 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 424C18FC12; Mon, 23 Nov 2009 09:16:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAN9GeEC047306; Mon, 23 Nov 2009 09:16:40 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAN9GeFx047304; Mon, 23 Nov 2009 09:16:40 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <200911230916.nAN9GeFx047304@svn.freebsd.org> From: Christian Brueffer Date: Mon, 23 Nov 2009 09:16:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199703 - stable/6/lib/libc/posix1e X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Nov 2009 09:16:40 -0000 Author: brueffer Date: Mon Nov 23 09:16:39 2009 New Revision: 199703 URL: http://svn.freebsd.org/changeset/base/199703 Log: MFC: r199317 Fix a memory leak in acl_from_text() in case the conversion succeeded. Modified: stable/6/lib/libc/posix1e/acl_from_text.c Directory Properties: stable/6/lib/libc/ (props changed) Modified: stable/6/lib/libc/posix1e/acl_from_text.c ============================================================================== --- stable/6/lib/libc/posix1e/acl_from_text.c Mon Nov 23 09:15:16 2009 (r199702) +++ stable/6/lib/libc/posix1e/acl_from_text.c Mon Nov 23 09:16:39 2009 (r199703) @@ -226,6 +226,7 @@ acl_from_text(const char *buf_p) } #endif + free(mybuf_p); return(acl); error_label: From owner-svn-src-all@FreeBSD.ORG Mon Nov 23 09:20:33 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E9F951065672; Mon, 23 Nov 2009 09:20:33 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BE6D88FC1A; Mon, 23 Nov 2009 09:20:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAN9KX0W047492; Mon, 23 Nov 2009 09:20:33 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAN9KXNa047488; Mon, 23 Nov 2009 09:20:33 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200911230920.nAN9KXNa047488@svn.freebsd.org> From: Alexander Motin Date: Mon, 23 Nov 2009 09:20:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199704 - stable/8/sys/dev/sound/pci/hda X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Nov 2009 09:20:34 -0000 Author: mav Date: Mon Nov 23 09:20:33 2009 New Revision: 199704 URL: http://svn.freebsd.org/changeset/base/199704 Log: MFC r196762: Improve HDA controller capabilities logging. Modified: stable/8/sys/dev/sound/pci/hda/hdac.c stable/8/sys/dev/sound/pci/hda/hdac_private.h stable/8/sys/dev/sound/pci/hda/hdac_reg.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/sound/pci/hda/hdac.c ============================================================================== --- stable/8/sys/dev/sound/pci/hda/hdac.c Mon Nov 23 09:16:39 2009 (r199703) +++ stable/8/sys/dev/sound/pci/hda/hdac.c Mon Nov 23 09:20:33 2009 (r199704) @@ -1520,7 +1520,7 @@ hdac_get_capabilities(struct hdac_softc sc->num_iss = HDAC_GCAP_ISS(gcap); sc->num_oss = HDAC_GCAP_OSS(gcap); sc->num_bss = HDAC_GCAP_BSS(gcap); - + sc->num_sdo = HDAC_GCAP_NSDO(gcap); sc->support_64bit = HDA_FLAG_MATCH(gcap, HDAC_GCAP_64OK); corbsize = HDAC_READ_1(&sc->mem, HDAC_CORBSIZE); @@ -1555,11 +1555,12 @@ hdac_get_capabilities(struct hdac_softc return (ENXIO); } - HDA_BOOTHVERBOSE( - device_printf(sc->dev, " CORB size: %d\n", sc->corb_size); - device_printf(sc->dev, " RIRB size: %d\n", sc->rirb_size); - device_printf(sc->dev, " Streams: ISS=%d OSS=%d BSS=%d\n", - sc->num_iss, sc->num_oss, sc->num_bss); + HDA_BOOTVERBOSE( + device_printf(sc->dev, "Caps: OSS %d, ISS %d, BSS %d, " + "NSDO %d%s, CORB %d, RIRB %d\n", + sc->num_oss, sc->num_iss, sc->num_bss, 1 << sc->num_sdo, + sc->support_64bit ? ", 64bit" : "", + sc->corb_size, sc->rirb_size); ); return (0); Modified: stable/8/sys/dev/sound/pci/hda/hdac_private.h ============================================================================== --- stable/8/sys/dev/sound/pci/hda/hdac_private.h Mon Nov 23 09:16:39 2009 (r199703) +++ stable/8/sys/dev/sound/pci/hda/hdac_private.h Mon Nov 23 09:20:33 2009 (r199704) @@ -339,6 +339,7 @@ struct hdac_softc { int num_iss; int num_oss; int num_bss; + int num_sdo; int support_64bit; int streamcnt; Modified: stable/8/sys/dev/sound/pci/hda/hdac_reg.h ============================================================================== --- stable/8/sys/dev/sound/pci/hda/hdac_reg.h Mon Nov 23 09:16:39 2009 (r199703) +++ stable/8/sys/dev/sound/pci/hda/hdac_reg.h Mon Nov 23 09:20:33 2009 (r199704) @@ -136,6 +136,8 @@ (((gcap) & HDAC_GCAP_ISS_MASK) >> HDAC_GCAP_ISS_SHIFT) #define HDAC_GCAP_OSS(gcap) \ (((gcap) & HDAC_GCAP_OSS_MASK) >> HDAC_GCAP_OSS_SHIFT) +#define HDAC_GCAP_NSDO(gcap) \ + (((gcap) & HDAC_GCAP_NSDO_MASK) >> HDAC_GCAP_NSDO_SHIFT) /* GCTL - Global Control */ #define HDAC_GCTL_CRST 0x00000001 From owner-svn-src-all@FreeBSD.ORG Mon Nov 23 09:21:35 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CB0E5106566B; Mon, 23 Nov 2009 09:21:35 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B92798FC0A; Mon, 23 Nov 2009 09:21:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAN9LZPj047562; Mon, 23 Nov 2009 09:21:35 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAN9LZbw047560; Mon, 23 Nov 2009 09:21:35 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200911230921.nAN9LZbw047560@svn.freebsd.org> From: Alexander Motin Date: Mon, 23 Nov 2009 09:21:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199705 - stable/8/sys/dev/sound/pci/hda X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Nov 2009 09:21:35 -0000 Author: mav Date: Mon Nov 23 09:21:35 2009 New Revision: 199705 URL: http://svn.freebsd.org/changeset/base/199705 Log: MFC r197017: Add Intel 82801JD (one more ICH10) HDA controller ID. Modified: stable/8/sys/dev/sound/pci/hda/hdac.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/sound/pci/hda/hdac.c ============================================================================== --- stable/8/sys/dev/sound/pci/hda/hdac.c Mon Nov 23 09:20:33 2009 (r199704) +++ stable/8/sys/dev/sound/pci/hda/hdac.c Mon Nov 23 09:21:35 2009 (r199705) @@ -146,7 +146,8 @@ SND_DECLARE_FILE("$FreeBSD$"); #define HDA_INTEL_82801G HDA_MODEL_CONSTRUCT(INTEL, 0x27d8) #define HDA_INTEL_82801H HDA_MODEL_CONSTRUCT(INTEL, 0x284b) #define HDA_INTEL_82801I HDA_MODEL_CONSTRUCT(INTEL, 0x293e) -#define HDA_INTEL_82801J HDA_MODEL_CONSTRUCT(INTEL, 0x3a3e) +#define HDA_INTEL_82801JI HDA_MODEL_CONSTRUCT(INTEL, 0x3a3e) +#define HDA_INTEL_82801JD HDA_MODEL_CONSTRUCT(INTEL, 0x3a6e) #define HDA_INTEL_PCH HDA_MODEL_CONSTRUCT(INTEL, 0x3b56) #define HDA_INTEL_SCH HDA_MODEL_CONSTRUCT(INTEL, 0x811b) #define HDA_INTEL_ALL HDA_MODEL_CONSTRUCT(INTEL, 0xffff) @@ -486,7 +487,8 @@ static const struct { { HDA_INTEL_82801G, "Intel 82801G", 0 }, { HDA_INTEL_82801H, "Intel 82801H", 0 }, { HDA_INTEL_82801I, "Intel 82801I", 0 }, - { HDA_INTEL_82801J, "Intel 82801J", 0 }, + { HDA_INTEL_82801JI, "Intel 82801JI", 0 }, + { HDA_INTEL_82801JD, "Intel 82801JD", 0 }, { HDA_INTEL_PCH, "Intel PCH", 0 }, { HDA_INTEL_SCH, "Intel SCH", 0 }, { HDA_NVIDIA_MCP51, "NVidia MCP51", HDAC_NO_MSI }, From owner-svn-src-all@FreeBSD.ORG Mon Nov 23 09:22:38 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 93334106568F; Mon, 23 Nov 2009 09:22:38 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 65F938FC23; Mon, 23 Nov 2009 09:22:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAN9McUt047644; Mon, 23 Nov 2009 09:22:38 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAN9McBk047642; Mon, 23 Nov 2009 09:22:38 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200911230922.nAN9McBk047642@svn.freebsd.org> From: Alexander Motin Date: Mon, 23 Nov 2009 09:22:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199706 - stable/8/sys/dev/sound/pci/hda X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Nov 2009 09:22:38 -0000 Author: mav Date: Mon Nov 23 09:22:38 2009 New Revision: 199706 URL: http://svn.freebsd.org/changeset/base/199706 Log: MFC r197018: Add NVidia MCP89 HDA controller IDs. Modified: stable/8/sys/dev/sound/pci/hda/hdac.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/sound/pci/hda/hdac.c ============================================================================== --- stable/8/sys/dev/sound/pci/hda/hdac.c Mon Nov 23 09:21:35 2009 (r199705) +++ stable/8/sys/dev/sound/pci/hda/hdac.c Mon Nov 23 09:22:38 2009 (r199706) @@ -172,6 +172,10 @@ SND_DECLARE_FILE("$FreeBSD$"); #define HDA_NVIDIA_MCP79_2 HDA_MODEL_CONSTRUCT(NVIDIA, 0x0ac1) #define HDA_NVIDIA_MCP79_3 HDA_MODEL_CONSTRUCT(NVIDIA, 0x0ac2) #define HDA_NVIDIA_MCP79_4 HDA_MODEL_CONSTRUCT(NVIDIA, 0x0ac3) +#define HDA_NVIDIA_MCP89_1 HDA_MODEL_CONSTRUCT(NVIDIA, 0x0d94) +#define HDA_NVIDIA_MCP89_2 HDA_MODEL_CONSTRUCT(NVIDIA, 0x0d95) +#define HDA_NVIDIA_MCP89_3 HDA_MODEL_CONSTRUCT(NVIDIA, 0x0d96) +#define HDA_NVIDIA_MCP89_4 HDA_MODEL_CONSTRUCT(NVIDIA, 0x0d97) #define HDA_NVIDIA_ALL HDA_MODEL_CONSTRUCT(NVIDIA, 0xffff) /* ATI */ @@ -509,6 +513,10 @@ static const struct { { HDA_NVIDIA_MCP79_2, "NVidia MCP79", 0 }, { HDA_NVIDIA_MCP79_3, "NVidia MCP79", 0 }, { HDA_NVIDIA_MCP79_4, "NVidia MCP79", 0 }, + { HDA_NVIDIA_MCP89_1, "NVidia MCP89", 0 }, + { HDA_NVIDIA_MCP89_2, "NVidia MCP89", 0 }, + { HDA_NVIDIA_MCP89_3, "NVidia MCP89", 0 }, + { HDA_NVIDIA_MCP89_4, "NVidia MCP89", 0 }, { HDA_ATI_SB450, "ATI SB450", 0 }, { HDA_ATI_SB600, "ATI SB600", 0 }, { HDA_ATI_RS600, "ATI RS600", 0 }, From owner-svn-src-all@FreeBSD.ORG Mon Nov 23 09:26:31 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 404921065670; Mon, 23 Nov 2009 09:26:31 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2D4408FC08; Mon, 23 Nov 2009 09:26:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAN9QVB9047773; Mon, 23 Nov 2009 09:26:31 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAN9QVUw047770; Mon, 23 Nov 2009 09:26:31 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200911230926.nAN9QVUw047770@svn.freebsd.org> From: Alexander Motin Date: Mon, 23 Nov 2009 09:26:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199707 - stable/8/sys/dev/sound/pci/hda X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Nov 2009 09:26:31 -0000 Author: mav Date: Mon Nov 23 09:26:30 2009 New Revision: 199707 URL: http://svn.freebsd.org/changeset/base/199707 Log: MFC r197611, r197640: - Add some bits of HDMI/DisplayPort support from later specification updates. It may be not enough to make them work, but at least should give some information about these beasts. - Add Realtek ALC887 codec ID. Modified: stable/8/sys/dev/sound/pci/hda/hda_reg.h stable/8/sys/dev/sound/pci/hda/hdac.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/sound/pci/hda/hda_reg.h ============================================================================== --- stable/8/sys/dev/sound/pci/hda/hda_reg.h Mon Nov 23 09:22:38 2009 (r199706) +++ stable/8/sys/dev/sound/pci/hda/hda_reg.h Mon Nov 23 09:26:30 2009 (r199707) @@ -660,13 +660,49 @@ #define HDA_CMD_VERB_GET_STRIPE_CONTROL 0xf24 #define HDA_CMD_VERB_SET_STRIPE_CONTROL 0x724 -#define HDA_CMD_SET_STRIPE_CONTROL(cad, nid) \ +#define HDA_CMD_GET_STRIPE_CONTROL(cad, nid) \ (HDA_CMD_12BIT((cad), (nid), \ HDA_CMD_VERB_GET_STRIPE_CONTROL, 0x0)) -#define HDA_CMD_GET_STRIPE_CONTROL(cad, nid, payload) \ +#define HDA_CMD_SET_STRIPE_CONTROL(cad, nid, payload) \ (HDA_CMD_12BIT((cad), (nid), \ HDA_CMD_VERB_SET_STRIPE_CONTROL, (payload))) +/* Channel Count Control */ +#define HDA_CMD_VERB_GET_CONV_CHAN_COUNT 0xf2d +#define HDA_CMD_VERB_SET_CONV_CHAN_COUNT 0x72d + +#define HDA_CMD_GET_CONV_CHAN_COUNT(cad, nid) \ + (HDA_CMD_12BIT((cad), (nid), \ + HDA_CMD_VERB_GET_CONV_CHAN_COUNT, 0x0)) +#define HDA_CMD_SET_CONV_CHAN_COUNT(cad, nid, payload) \ + (HDA_CMD_12BIT((cad), (nid), \ + HDA_CMD_VERB_SET_CONV_CHAN_COUNT, (payload))) + +#define HDA_CMD_VERB_GET_HDMI_DIP_SIZE 0xf2e +#define HDA_CMD_VERB_GET_HDMI_ELDD 0xf2f + +#define HDA_CMD_VERB_GET_HDMI_DIP_INDEX 0xf30 +#define HDA_CMD_VERB_SET_HDMI_DIP_INDEX 0x730 + +#define HDA_CMD_VERB_GET_HDMI_DIP_DATA 0xf31 +#define HDA_CMD_VERB_SET_HDMI_DIP_DATA 0x731 + +#define HDA_CMD_VERB_GET_HDMI_DIP_XMIT 0xf32 +#define HDA_CMD_VERB_SET_HDMI_DIP_XMIT 0x732 + +#define HDA_CMD_VERB_GET_HDMI_CP_CTRL 0xf33 +#define HDA_CMD_VERB_SET_HDMI_CP_CTRL 0x733 + +#define HDA_CMD_VERB_GET_HDMI_CHAN_SLOT 0xf34 +#define HDA_CMD_VERB_SET_HDMI_CHAN_SLOT 0x734 + +#define HDA_CMD_GET_HDMI_CHAN_SLOT(cad, nid) \ + (HDA_CMD_12BIT((cad), (nid), \ + HDA_CMD_VERB_GET_HDMI_CHAN_SLOT, 0x0)) +#define HDA_CMD_SET_HDMI_CHAN_SLOT(cad, nid, payload) \ + (HDA_CMD_12BIT((cad), (nid), \ + HDA_CMD_VERB_SET_HDMI_CHAN_SLOT, (payload))) + /* Function Reset */ #define HDA_CMD_VERB_FUNCTION_RESET 0x7ff @@ -779,6 +815,10 @@ #define HDA_PARAM_AUDIO_WIDGET_CAP_TYPE_SHIFT 20 #define HDA_PARAM_AUDIO_WIDGET_CAP_DELAY_MASK 0x000f0000 #define HDA_PARAM_AUDIO_WIDGET_CAP_DELAY_SHIFT 16 +#define HDA_PARAM_AUDIO_WIDGET_CAP_CC_EXT_MASK 0x0000e000 +#define HDA_PARAM_AUDIO_WIDGET_CAP_CC_EXT_SHIFT 13 +#define HDA_PARAM_AUDIO_WIDGET_CAP_CP_MASK 0x00001000 +#define HDA_PARAM_AUDIO_WIDGET_CAP_CP_SHIFT 12 #define HDA_PARAM_AUDIO_WIDGET_CAP_LR_SWAP_MASK 0x00000800 #define HDA_PARAM_AUDIO_WIDGET_CAP_LR_SWAP_SHIFT 11 #define HDA_PARAM_AUDIO_WIDGET_CAP_POWER_CTRL_MASK 0x00000400 @@ -810,6 +850,14 @@ #define HDA_PARAM_AUDIO_WIDGET_CAP_DELAY(param) \ (((param) & HDA_PARAM_AUDIO_WIDGET_CAP_DELAY_MASK) >> \ HDA_PARAM_AUDIO_WIDGET_CAP_DELAY_SHIFT) +#define HDA_PARAM_AUDIO_WIDGET_CAP_CC(param) \ + ((((param) & HDA_PARAM_AUDIO_WIDGET_CAP_CC_EXT_MASK) >> \ + (HDA_PARAM_AUDIO_WIDGET_CAP_CC_EXT_SHIFT - 1)) | \ + (((param) & HDA_PARAM_AUDIO_WIDGET_CAP_STEREO_MASK) >> \ + HDA_PARAM_AUDIO_WIDGET_CAP_STEREO_SHIFT)) +#define HDA_PARAM_AUDIO_WIDGET_CAP_CP(param) \ + (((param) & HDA_PARAM_AUDIO_WIDGET_CAP_CP_MASK) >> \ + HDA_PARAM_AUDIO_WIDGET_CAP_CP_SHIFT) #define HDA_PARAM_AUDIO_WIDGET_CAP_LR_SWAP(param) \ (((param) & HDA_PARAM_AUDIO_WIDGET_CAP_LR_SWAP_MASK) >> \ HDA_PARAM_AUDIO_WIDGET_CAP_LR_SWAP_SHIFT) @@ -971,6 +1019,10 @@ /* Pin Capabilities */ #define HDA_PARAM_PIN_CAP 0x0c +#define HDA_PARAM_PIN_CAP_HBR_MASK 0x08000000 +#define HDA_PARAM_PIN_CAP_HBR_SHIFT 27 +#define HDA_PARAM_PIN_CAP_DP_MASK 0x01000000 +#define HDA_PARAM_PIN_CAP_DP_SHIFT 24 #define HDA_PARAM_PIN_CAP_EAPD_CAP_MASK 0x00010000 #define HDA_PARAM_PIN_CAP_EAPD_CAP_SHIFT 16 #define HDA_PARAM_PIN_CAP_VREF_CTRL_MASK 0x0000ff00 @@ -985,6 +1037,8 @@ #define HDA_PARAM_PIN_CAP_VREF_CTRL_50_SHIFT 9 #define HDA_PARAM_PIN_CAP_VREF_CTRL_HIZ_MASK 0x00000100 #define HDA_PARAM_PIN_CAP_VREF_CTRL_HIZ_SHIFT 8 +#define HDA_PARAM_PIN_CAP_HDMI_MASK 0x00000080 +#define HDA_PARAM_PIN_CAP_HDMI_SHIFT 7 #define HDA_PARAM_PIN_CAP_BALANCED_IO_PINS_MASK 0x00000040 #define HDA_PARAM_PIN_CAP_BALANCED_IO_PINS_SHIFT 6 #define HDA_PARAM_PIN_CAP_INPUT_CAP_MASK 0x00000020 @@ -1000,6 +1054,12 @@ #define HDA_PARAM_PIN_CAP_IMP_SENSE_CAP_MASK 0x00000001 #define HDA_PARAM_PIN_CAP_IMP_SENSE_CAP_SHIFT 0 +#define HDA_PARAM_PIN_CAP_HBR(param) \ + (((param) & HDA_PARAM_PIN_CAP_HBR_MASK) >> \ + HDA_PARAM_PIN_CAP_HBR_SHIFT) +#define HDA_PARAM_PIN_CAP_DP(param) \ + (((param) & HDA_PARAM_PIN_CAP_DP_MASK) >> \ + HDA_PARAM_PIN_CAP_DP_SHIFT) #define HDA_PARAM_PIN_CAP_EAPD_CAP(param) \ (((param) & HDA_PARAM_PIN_CAP_EAPD_CAP_MASK) >> \ HDA_PARAM_PIN_CAP_EAPD_CAP_SHIFT) @@ -1021,6 +1081,9 @@ #define HDA_PARAM_PIN_CAP_VREF_CTRL_HIZ(param) \ (((param) & HDA_PARAM_PIN_CAP_VREF_CTRL_HIZ_MASK) >> \ HDA_PARAM_PIN_CAP_VREF_CTRL_HIZ_SHIFT) +#define HDA_PARAM_PIN_CAP_HDMI(param) \ + (((param) & HDA_PARAM_PIN_CAP_HDMI_MASK) >> \ + HDA_PARAM_PIN_CAP_HDMI_SHIFT) #define HDA_PARAM_PIN_CAP_BALANCED_IO_PINS(param) \ (((param) & HDA_PARAM_PIN_CAP_BALANCED_IO_PINS_MASK) >> \ HDA_PARAM_PIN_CAP_BALANCED_IO_PINS_SHIFT) Modified: stable/8/sys/dev/sound/pci/hda/hdac.c ============================================================================== --- stable/8/sys/dev/sound/pci/hda/hdac.c Mon Nov 23 09:22:38 2009 (r199706) +++ stable/8/sys/dev/sound/pci/hda/hdac.c Mon Nov 23 09:26:30 2009 (r199707) @@ -38,7 +38,6 @@ * 2) HDA Codecs support, which may include * - HDA * - Modem - * - HDMI * 3) Widget parser - the real magic of why this driver works on so * many hardwares with minimal vendor specific quirk. The original * parser was written using Ruby and can be found at @@ -87,7 +86,7 @@ #include "mixer_if.h" -#define HDA_DRV_TEST_REV "20090624_0136" +#define HDA_DRV_TEST_REV "20090929_0137" SND_DECLARE_FILE("$FreeBSD$"); @@ -623,6 +622,7 @@ static const struct { #define HDA_CODEC_ALC882 HDA_CODEC_CONSTRUCT(REALTEK, 0x0882) #define HDA_CODEC_ALC883 HDA_CODEC_CONSTRUCT(REALTEK, 0x0883) #define HDA_CODEC_ALC885 HDA_CODEC_CONSTRUCT(REALTEK, 0x0885) +#define HDA_CODEC_ALC887 HDA_CODEC_CONSTRUCT(REALTEK, 0x0887) #define HDA_CODEC_ALC888 HDA_CODEC_CONSTRUCT(REALTEK, 0x0888) #define HDA_CODEC_ALC889 HDA_CODEC_CONSTRUCT(REALTEK, 0x0889) #define HDA_CODEC_ALCXXXX HDA_CODEC_CONSTRUCT(REALTEK, 0xffff) @@ -808,6 +808,7 @@ static const struct { { HDA_CODEC_ALC882, "Realtek ALC882" }, { HDA_CODEC_ALC883, "Realtek ALC883" }, { HDA_CODEC_ALC885, "Realtek ALC885" }, + { HDA_CODEC_ALC887, "Realtek ALC887" }, { HDA_CODEC_ALC888, "Realtek ALC888" }, { HDA_CODEC_ALC889, "Realtek ALC889" }, { HDA_CODEC_AD1882, "Analog Devices AD1882" }, @@ -3485,6 +3486,14 @@ hdac_stream_setup(struct hdac_chan *ch) } hdac_command(sc, HDA_CMD_SET_CONV_STREAM_CHAN(cad, ch->io[i], c), cad); +#if 0 + hdac_command(sc, + HDA_CMD_SET_CONV_CHAN_COUNT(cad, ch->io[i], 1), cad); + hdac_command(sc, + HDA_CMD_SET_HDMI_CHAN_SLOT(cad, ch->io[i], 0x00), cad); + hdac_command(sc, + HDA_CMD_SET_HDMI_CHAN_SLOT(cad, ch->io[i], 0x11), cad); +#endif chn += HDA_PARAM_AUDIO_WIDGET_CAP_STEREO(w->param.widget_cap) ? 2 : 1; @@ -4492,7 +4501,7 @@ hdac_audio_as_parse(struct hdac_devinfo for (i = 0; i < max; i++) { as[i].hpredir = -1; as[i].chan = -1; - as[i].digital = 1; + as[i].digital = 0; } /* Scan associations skipping as=0. */ @@ -4547,8 +4556,14 @@ hdac_audio_as_parse(struct hdac_devinfo __func__, w->nid, j); as[cnt].enable = 0; } - if (!HDA_PARAM_AUDIO_WIDGET_CAP_DIGITAL(w->param.widget_cap)) - as[cnt].digital = 0; + if (HDA_PARAM_AUDIO_WIDGET_CAP_DIGITAL(w->param.widget_cap)) { + if (HDA_PARAM_PIN_CAP_DP(w->wclass.pin.cap)) + as[cnt].digital = 3; + else if (HDA_PARAM_PIN_CAP_HDMI(w->wclass.pin.cap)) + as[cnt].digital = 2; + else + as[cnt].digital = 1; + } /* Headphones with seq=15 may mean redirection. */ if (type == HDA_CONFIG_DEFAULTCONF_DEVICE_HP_OUT && seq == 15) @@ -6548,15 +6563,15 @@ hdac_create_pcms(struct hdac_devinfo *de devinfo->function.audio.devs[i].devinfo = devinfo; devinfo->function.audio.devs[i].play = -1; devinfo->function.audio.devs[i].rec = -1; - devinfo->function.audio.devs[i].digital = 2; + devinfo->function.audio.devs[i].digital = 255; } for (i = 0; i < devinfo->function.audio.ascnt; i++) { if (as[i].enable == 0) continue; for (j = 0; j < devinfo->function.audio.num_devs; j++) { - if (devinfo->function.audio.devs[j].digital != 2 && - devinfo->function.audio.devs[j].digital != - as[i].digital) + if (devinfo->function.audio.devs[j].digital != 255 && + (!devinfo->function.audio.devs[j].digital) != + (!as[i].digital)) continue; if (as[i].dir == HDA_CTL_IN) { if (devinfo->function.audio.devs[j].rec >= 0) @@ -6732,6 +6747,8 @@ hdac_dump_pin(struct hdac_softc *sc, str printf(" IN"); if (HDA_PARAM_PIN_CAP_BALANCED_IO_PINS(pincap)) printf(" BAL"); + if (HDA_PARAM_PIN_CAP_HDMI(pincap)) + printf(" HDMI"); if (HDA_PARAM_PIN_CAP_VREF_CTRL(pincap)) { printf(" VREF["); if (HDA_PARAM_PIN_CAP_VREF_CTRL_50(pincap)) @@ -6748,6 +6765,10 @@ hdac_dump_pin(struct hdac_softc *sc, str } if (HDA_PARAM_PIN_CAP_EAPD_CAP(pincap)) printf(" EAPD"); + if (HDA_PARAM_PIN_CAP_DP(pincap)) + printf(" DP"); + if (HDA_PARAM_PIN_CAP_HBR(pincap)) + printf(" HBR"); printf("\n"); device_printf(sc->dev, " Pin config: 0x%08x\n", w->wclass.pin.config); @@ -6855,8 +6876,11 @@ hdac_dump_nodes(struct hdac_devinfo *dev printf(" PROC"); if (HDA_PARAM_AUDIO_WIDGET_CAP_STRIPE(w->param.widget_cap)) printf(" STRIPE"); - if (HDA_PARAM_AUDIO_WIDGET_CAP_STEREO(w->param.widget_cap)) + j = HDA_PARAM_AUDIO_WIDGET_CAP_CC(w->param.widget_cap); + if (j == 1) printf(" STEREO"); + else if (j > 1) + printf(" %dCH", j + 1); printf("\n"); } if (w->bindas != -1) { @@ -7957,7 +7981,9 @@ hdac_pcm_probe(device_t dev) snprintf(buf, sizeof(buf), "HDA %s PCM #%d %s", hdac_codec_name(pdevinfo->devinfo->codec), pdevinfo->index, - pdevinfo->digital?"Digital":"Analog"); + (pdevinfo->digital == 3)?"DisplayPort": + ((pdevinfo->digital == 2)?"HDMI": + ((pdevinfo->digital)?"Digital":"Analog"))); device_set_desc_copy(dev, buf); return (0); } From owner-svn-src-all@FreeBSD.ORG Mon Nov 23 09:28:18 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 834511065670; Mon, 23 Nov 2009 09:28:18 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3298F8FC1C; Mon, 23 Nov 2009 09:28:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAN9SGM8047859; Mon, 23 Nov 2009 09:28:16 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAN9SGb9047857; Mon, 23 Nov 2009 09:28:16 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200911230928.nAN9SGb9047857@svn.freebsd.org> From: Alexander Motin Date: Mon, 23 Nov 2009 09:28:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199708 - stable/8/sys/dev/sound/pci/hda X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Nov 2009 09:28:18 -0000 Author: mav Date: Mon Nov 23 09:28:16 2009 New Revision: 199708 URL: http://svn.freebsd.org/changeset/base/199708 Log: MFC r199258: Add more codec IDs. Modified: stable/8/sys/dev/sound/pci/hda/hdac.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/sound/pci/hda/hdac.c ============================================================================== --- stable/8/sys/dev/sound/pci/hda/hdac.c Mon Nov 23 09:26:30 2009 (r199707) +++ stable/8/sys/dev/sound/pci/hda/hdac.c Mon Nov 23 09:28:16 2009 (r199708) @@ -86,7 +86,7 @@ #include "mixer_if.h" -#define HDA_DRV_TEST_REV "20090929_0137" +#define HDA_DRV_TEST_REV "20091113_0138" SND_DECLARE_FILE("$FreeBSD$"); @@ -764,6 +764,16 @@ static const struct { #define HDA_CODEC_VT1702_5 HDA_CODEC_CONSTRUCT(VIA, 0x5398) #define HDA_CODEC_VT1702_6 HDA_CODEC_CONSTRUCT(VIA, 0x6398) #define HDA_CODEC_VT1702_7 HDA_CODEC_CONSTRUCT(VIA, 0x7398) +#define HDA_CODEC_VT1716S_0 HDA_CODEC_CONSTRUCT(VIA, 0x0433) +#define HDA_CODEC_VT1716S_1 HDA_CODEC_CONSTRUCT(VIA, 0xa721) +#define HDA_CODEC_VT1718S_0 HDA_CODEC_CONSTRUCT(VIA, 0x0428) +#define HDA_CODEC_VT1718S_1 HDA_CODEC_CONSTRUCT(VIA, 0x4428) +#define HDA_CODEC_VT1812 HDA_CODEC_CONSTRUCT(VIA, 0x0448) +#define HDA_CODEC_VT1818S HDA_CODEC_CONSTRUCT(VIA, 0x0440) +#define HDA_CODEC_VT1828S HDA_CODEC_CONSTRUCT(VIA, 0x4441) +#define HDA_CODEC_VT2002P_0 HDA_CODEC_CONSTRUCT(VIA, 0x0438) +#define HDA_CODEC_VT2002P_1 HDA_CODEC_CONSTRUCT(VIA, 0x4438) +#define HDA_CODEC_VT2020 HDA_CODEC_CONSTRUCT(VIA, 0x0441) #define HDA_CODEC_VTXXXX HDA_CODEC_CONSTRUCT(VIA, 0xffff) /* ATI */ @@ -786,6 +796,7 @@ static const struct { #define HDA_CODEC_INTELG45_2 HDA_CODEC_CONSTRUCT(INTEL, 0x2802) #define HDA_CODEC_INTELG45_3 HDA_CODEC_CONSTRUCT(INTEL, 0x2803) #define HDA_CODEC_INTELG45_4 HDA_CODEC_CONSTRUCT(INTEL, 0x29fb) +#define HDA_CODEC_INTELQ57 HDA_CODEC_CONSTRUCT(INTEL, 0x0054) #define HDA_CODEC_INTELXXXX HDA_CODEC_CONSTRUCT(INTEL, 0xffff) /* Codecs */ @@ -917,6 +928,16 @@ static const struct { { HDA_CODEC_VT1702_5, "VIA VT1702_5" }, { HDA_CODEC_VT1702_6, "VIA VT1702_6" }, { HDA_CODEC_VT1702_7, "VIA VT1702_7" }, + { HDA_CODEC_VT1716S_0, "VIA VT1716S_0" }, + { HDA_CODEC_VT1716S_1, "VIA VT1716S_1" }, + { HDA_CODEC_VT1718S_0, "VIA VT1718S_0" }, + { HDA_CODEC_VT1718S_1, "VIA VT1718S_1" }, + { HDA_CODEC_VT1812, "VIA VT1812" }, + { HDA_CODEC_VT1818S, "VIA VT1818S" }, + { HDA_CODEC_VT1828S, "VIA VT1828S" }, + { HDA_CODEC_VT2002P_0, "VIA VT2002P_0" }, + { HDA_CODEC_VT2002P_1, "VIA VT2002P_1" }, + { HDA_CODEC_VT2020, "VIA VT2020" }, { HDA_CODEC_ATIRS600_1,"ATI RS600 HDMI" }, { HDA_CODEC_ATIRS600_2,"ATI RS600 HDMI" }, { HDA_CODEC_ATIRS690, "ATI RS690/780 HDMI" }, @@ -930,6 +951,7 @@ static const struct { { HDA_CODEC_INTELG45_2, "Intel G45 HDMI" }, { HDA_CODEC_INTELG45_3, "Intel G45 HDMI" }, { HDA_CODEC_INTELG45_4, "Intel G45 HDMI" }, + { HDA_CODEC_INTELQ57, "Intel Q57 HDMI" }, { HDA_CODEC_SII1390, "Silicon Image SiI1390 HDMI" }, { HDA_CODEC_SII1392, "Silicon Image SiI1392 HDMI" }, /* Unknown codec */ From owner-svn-src-all@FreeBSD.ORG Mon Nov 23 09:44:09 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AB53D106566C; Mon, 23 Nov 2009 09:44:09 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 635798FC15; Mon, 23 Nov 2009 09:44:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAN9i9UJ048331; Mon, 23 Nov 2009 09:44:09 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAN9i9v8048329; Mon, 23 Nov 2009 09:44:09 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <200911230944.nAN9i9v8048329@svn.freebsd.org> From: Christian Brueffer Date: Mon, 23 Nov 2009 09:44:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199709 - stable/8/lib/libc/locale X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Nov 2009 09:44:09 -0000 Author: brueffer Date: Mon Nov 23 09:44:08 2009 New Revision: 199709 URL: http://svn.freebsd.org/changeset/base/199709 Log: MFC: r199320 Fix grammar. Modified: stable/8/lib/libc/locale/nl_langinfo.3 Directory Properties: stable/8/lib/libc/ (props changed) stable/8/lib/libc/stdtime/ (props changed) Modified: stable/8/lib/libc/locale/nl_langinfo.3 ============================================================================== --- stable/8/lib/libc/locale/nl_langinfo.3 Mon Nov 23 09:28:16 2009 (r199708) +++ stable/8/lib/libc/locale/nl_langinfo.3 Mon Nov 23 09:44:08 2009 (r199709) @@ -53,7 +53,7 @@ with a category corresponding to the cat or to the category .Dv LC_ALL , -may overwrite buffer pointed by the return value. +may overwrite the buffer pointed to by the return value. .Sh RETURN VALUES In a locale where langinfo data is not defined, .Fn nl_langinfo From owner-svn-src-all@FreeBSD.ORG Mon Nov 23 09:45:11 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 930631065676; Mon, 23 Nov 2009 09:45:11 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 80F628FC23; Mon, 23 Nov 2009 09:45:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAN9jB2v048428; Mon, 23 Nov 2009 09:45:11 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAN9jBRa048426; Mon, 23 Nov 2009 09:45:11 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <200911230945.nAN9jBRa048426@svn.freebsd.org> From: Christian Brueffer Date: Mon, 23 Nov 2009 09:45:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199710 - stable/7/lib/libc/locale X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Nov 2009 09:45:11 -0000 Author: brueffer Date: Mon Nov 23 09:45:11 2009 New Revision: 199710 URL: http://svn.freebsd.org/changeset/base/199710 Log: MFC: r199320 Fix grammar. Modified: stable/7/lib/libc/locale/nl_langinfo.3 Directory Properties: stable/7/lib/libc/ (props changed) Modified: stable/7/lib/libc/locale/nl_langinfo.3 ============================================================================== --- stable/7/lib/libc/locale/nl_langinfo.3 Mon Nov 23 09:44:08 2009 (r199709) +++ stable/7/lib/libc/locale/nl_langinfo.3 Mon Nov 23 09:45:11 2009 (r199710) @@ -53,7 +53,7 @@ with a category corresponding to the cat or to the category .Dv LC_ALL , -may overwrite buffer pointed by the return value. +may overwrite the buffer pointed to by the return value. .Sh RETURN VALUES In a locale where langinfo data is not defined, .Fn nl_langinfo From owner-svn-src-all@FreeBSD.ORG Mon Nov 23 09:46:00 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0B7641065695; Mon, 23 Nov 2009 09:46:00 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ED7C08FC1D; Mon, 23 Nov 2009 09:45:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAN9jxCH048507; Mon, 23 Nov 2009 09:45:59 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAN9jxAM048505; Mon, 23 Nov 2009 09:45:59 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <200911230945.nAN9jxAM048505@svn.freebsd.org> From: Christian Brueffer Date: Mon, 23 Nov 2009 09:45:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199711 - stable/6/lib/libc/locale X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Nov 2009 09:46:00 -0000 Author: brueffer Date: Mon Nov 23 09:45:59 2009 New Revision: 199711 URL: http://svn.freebsd.org/changeset/base/199711 Log: MFC: r199320 Fix grammar. Modified: stable/6/lib/libc/locale/nl_langinfo.3 Directory Properties: stable/6/lib/libc/ (props changed) Modified: stable/6/lib/libc/locale/nl_langinfo.3 ============================================================================== --- stable/6/lib/libc/locale/nl_langinfo.3 Mon Nov 23 09:45:11 2009 (r199710) +++ stable/6/lib/libc/locale/nl_langinfo.3 Mon Nov 23 09:45:59 2009 (r199711) @@ -53,7 +53,7 @@ with a category corresponding to the cat or to the category .Dv LC_ALL , -may overwrite buffer pointed by the return value. +may overwrite the buffer pointed to by the return value. .Sh RETURN VALUES In a locale where langinfo data is not defined, .Fn nl_langinfo From owner-svn-src-all@FreeBSD.ORG Mon Nov 23 11:52:21 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 44FD0106566B; Mon, 23 Nov 2009 11:52:21 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 18D458FC13; Mon, 23 Nov 2009 11:52:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nANBqKZS055646; Mon, 23 Nov 2009 11:52:20 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nANBqKOt055644; Mon, 23 Nov 2009 11:52:20 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200911231152.nANBqKOt055644@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Mon, 23 Nov 2009 11:52:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199712 - stable/6/sys/compat/pecoff X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Nov 2009 11:52:21 -0000 Author: bz Date: Mon Nov 23 11:52:20 2009 New Revision: 199712 URL: http://svn.freebsd.org/changeset/base/199712 Log: MF7 r199330: Note: this change was never in head; thus directly merged from stable/7. As we pass the 'offset' unvalidated to vn_rdwr() make sure that it is unsigned rather than possibly set to something negative by a malicious binary. This is just the immediate fix to the problem mentioned in PR kern/80742 and by http://milw0rm.com/exploits/9206 but does not fix all possible problems imgact_pecoff has. As this feature does not work and is not compiled in by default, the security team considers this vulnerability to be of low risk to the user population and will not be issuing an advisory. PR: kern/80742 Reported by: Oliver Pinter (oliver.pntr gmail.com) via freebsd-security Help reproducing and testing by: Damian Weber (dweber htw-saarland.de) Modified: stable/6/sys/compat/pecoff/imgact_pecoff.c Directory Properties: stable/6/sys/ (props changed) stable/6/sys/conf/ (props changed) stable/6/sys/contrib/pf/ (props changed) stable/6/sys/dev/cxgb/ (props changed) Modified: stable/6/sys/compat/pecoff/imgact_pecoff.c ============================================================================== --- stable/6/sys/compat/pecoff/imgact_pecoff.c Mon Nov 23 09:45:59 2009 (r199711) +++ stable/6/sys/compat/pecoff/imgact_pecoff.c Mon Nov 23 11:52:20 2009 (r199712) @@ -135,7 +135,7 @@ exec_pecoff_coff_makecmds(struct image_p struct coff_filehdr *, int); static int pecoff_signature(struct thread *, struct vnode *, const struct pecoff_dos_filehdr *); -static int pecoff_read_from(struct thread *, struct vnode *, int, caddr_t, int); +static int pecoff_read_from(struct thread *, struct vnode *, unsigned int, caddr_t, int); static int pecoff_load_section(struct thread * td, struct vmspace * vmspace, struct vnode * vp, @@ -291,7 +291,7 @@ pecoff_load_file(struct thread * td, con struct vmspace *vmspace = td->td_proc->p_vmspace; struct vattr attr; struct image_params image_params, *imgp; - int peofs; + unsigned int peofs; int error, i, scnsiz; imgp = &image_params; @@ -549,7 +549,7 @@ int pecoff_read_from(td, vp, pos, buf, siz) struct thread *td; struct vnode *vp; - int pos; + unsigned int pos; caddr_t buf; int siz; { From owner-svn-src-all@FreeBSD.ORG Mon Nov 23 13:38:39 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 37BBD106568B; Mon, 23 Nov 2009 13:38:39 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id EF79C8FC2F; Mon, 23 Nov 2009 13:38:38 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 91C8B46B2C; Mon, 23 Nov 2009 08:38:38 -0500 (EST) Received: from jhbbsd.hudson-trading.com (unknown [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPA id C652B8A01B; Mon, 23 Nov 2009 08:38:37 -0500 (EST) From: John Baldwin To: Scott Long Date: Mon, 23 Nov 2009 08:38:19 -0500 User-Agent: KMail/1.9.7 References: <200911222050.nAMKoRYh029141@svn.freebsd.org> <0298EC7E-26D5-460A-9EBE-5ABEAE8B21BD@samsco.org> In-Reply-To: <0298EC7E-26D5-460A-9EBE-5ABEAE8B21BD@samsco.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200911230838.20217.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Mon, 23 Nov 2009 08:38:37 -0500 (EST) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=4.2 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Pyun YongHyeon Subject: Re: svn commit: r199670 - head/sys/dev/bge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Nov 2009 13:38:39 -0000 On Sunday 22 November 2009 6:48:18 pm Scott Long wrote: > By definition, PCIe can't transfer across 4GB boundaries. It's not a > bug specific to Broadcom. If you're loading dynamic buffers (i.e. > mbufs), setting an appropriate boundary value in the tag will allow > busdma to take care of this. If you're allocating static buffers, > busdma won't honor this. But what you've done here is best anyways; > control buffers that are going to be frequently transferred are best > kept in the lower 4GB of the address space. It simplifies PCIe > handling, and it's significantly faster on PCI/PCI-X. So I'd suggest > making this the rule rather than the exception in the driver. Should we enforce an implicit 4GB boundary in bus_dma then? Perhaps Host-PCI bridge drivers should create a tag with a 4GB boundary that devices inherit via bus_get_dma_tag(). For i386/PAE we might should always enforce a 4GB boundary as well? > Scott > > On Nov 22, 2009, at 1:50 PM, Pyun YongHyeon wrote: > > > Author: yongari > > Date: Sun Nov 22 20:50:27 2009 > > New Revision: 199670 > > URL: http://svn.freebsd.org/changeset/base/199670 > > > > Log: > > Fix two long standing bugs on bge(4). Most pre BCM5755 controllers > > have a DMA bug when buffer address crosses a multiple of the 4GB > > boundary(e.g. 4GB, 8GB, 12GB etc). Limit DMA address to be within > > 4GB address for these controllers. The second DMA bug limits DMA > > address to be within 40bit address space. This bug applies to > > BCM5714 and BCM5715 and 5708(bce(4) controller). This is not > > actually a MAC controller bug but an issue with the embedded PCIe > > to PCI-X bridge in the device. So for BCM5714/BCM5715 controllers > > also limit the DMA address to be within 40bit address space. > > Special thanks to davidch@ who gave me detailed errata information. > > I think this change will fix long standing bge(4) instability > > issues on systems with more than 4GB memory. > > > > Reviewed by: davidch > > > > Modified: > > head/sys/dev/bge/if_bge.c > > head/sys/dev/bge/if_bgereg.h > > > > Modified: head/sys/dev/bge/if_bge.c > > = > > = > > = > > = > > = > > = > > = > > = > > ====================================================================== > > --- head/sys/dev/bge/if_bge.c Sun Nov 22 20:45:15 2009 (r199669) > > +++ head/sys/dev/bge/if_bge.c Sun Nov 22 20:50:27 2009 (r199670) > > @@ -2104,15 +2104,21 @@ bge_dma_alloc(device_t dev) > > { > > struct bge_dmamap_arg ctx; > > struct bge_softc *sc; > > + bus_addr_t lowaddr; > > int i, error; > > > > sc = device_get_softc(dev); > > > > + lowaddr = BUS_SPACE_MAXADDR; > > + if ((sc->bge_flags & BGE_FLAG_40BIT_BUG) != 0) > > + lowaddr = BGE_DMA_MAXADDR; > > + if ((sc->bge_flags & BGE_FLAG_4G_BNDRY_BUG) != 0) > > + lowaddr = BUS_SPACE_MAXADDR_32BIT; > > /* > > * Allocate the parent bus DMA tag appropriate for PCI. > > */ > > error = bus_dma_tag_create(bus_get_dma_tag(sc->bge_dev), > > - 1, 0, BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL, > > + 1, 0, lowaddr, BUS_SPACE_MAXADDR, NULL, > > NULL, BUS_SPACE_MAXSIZE_32BIT, 0, BUS_SPACE_MAXSIZE_32BIT, > > 0, NULL, NULL, &sc->bge_cdata.bge_parent_tag); > > > > @@ -2566,6 +2572,16 @@ bge_attach(device_t dev) > > sc->bge_flags |= BGE_FLAG_BER_BUG; > > } > > > > + /* > > + * All controllers that are not 5755 or higher have 4GB > > + * boundary DMA bug. > > + * Whenever an address crosses a multiple of the 4GB boundary > > + * (including 4GB, 8Gb, 12Gb, etc.) and makes the transition > > + * from 0xX_FFFF_FFFF to 0x(X+1)_0000_0000 an internal DMA > > + * state machine will lockup and cause the device to hang. > > + */ > > + if (BGE_IS_5755_PLUS(sc) == 0) > > + sc->bge_flags |= BGE_FLAG_4G_BNDRY_BUG; > > > > /* > > * We could possibly check for BCOM_DEVICEID_BCM5788 in bge_probe() > > @@ -2729,6 +2745,13 @@ bge_attach(device_t dev) > > #ifdef DEVICE_POLLING > > ifp->if_capabilities |= IFCAP_POLLING; > > #endif > > + /* > > + * The 40bit DMA bug applies to the 5714/5715 controllers and is > > + * not actually a MAC controller bug but an issue with the embedded > > + * PCIe to PCI-X bridge in the device. Use 40bit DMA workaround. > > + */ > > + if (BGE_IS_5714_FAMILY(sc) && (sc->bge_flags & BGE_FLAG_PCIX)) > > + sc->bge_flags |= BGE_FLAG_40BIT_BUG; > > > > /* > > * 5700 B0 chips do not support checksumming correctly due > > > > Modified: head/sys/dev/bge/if_bgereg.h > > = > > = > > = > > = > > = > > = > > = > > = > > ====================================================================== > > --- head/sys/dev/bge/if_bgereg.h Sun Nov 22 20:45:15 2009 (r199669) > > +++ head/sys/dev/bge/if_bgereg.h Sun Nov 22 20:50:27 2009 (r199670) > > @@ -2484,6 +2484,13 @@ struct bge_gib { > > #define BGE_NSEG_JUMBO 4 > > #define BGE_NSEG_NEW 32 > > > > +/* Maximum DMA address for controllers that have 40bit DMA address > > bug. */ > > +#if (BUS_SPACE_MAXADDR < 0xFFFFFFFFFF) > > +#define BGE_DMA_MAXADDR BUS_SPACE_MAXADDR > > +#else > > +#define BGE_DMA_MAXADDR 0xFFFFFFFFFF > > +#endif > > + > > /* > > * Ring structures. Most of these reside in host memory and we tell > > * the NIC where they are via the ring control blocks. The exceptions > > @@ -2600,6 +2607,8 @@ struct bge_softc { > > #define BGE_FLAG_5714_FAMILY 0x00004000 > > #define BGE_FLAG_575X_PLUS 0x00008000 > > #define BGE_FLAG_5755_PLUS 0x00010000 > > +#define BGE_FLAG_40BIT_BUG 0x00020000 > > +#define BGE_FLAG_4G_BNDRY_BUG 0x00040000 > > #define BGE_FLAG_RX_ALIGNBUG 0x00100000 > > #define BGE_FLAG_NO_3LED 0x00200000 > > #define BGE_FLAG_ADC_BUG 0x00400000 > > -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Mon Nov 23 14:27:10 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4E38A106566B; Mon, 23 Nov 2009 14:27:10 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-fx0-f218.google.com (mail-fx0-f218.google.com [209.85.220.218]) by mx1.freebsd.org (Postfix) with ESMTP id 88D358FC13; Mon, 23 Nov 2009 14:27:08 +0000 (UTC) Received: by fxm10 with SMTP id 10so2874065fxm.14 for ; Mon, 23 Nov 2009 06:27:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to:cc :content-type; bh=It5wpqFFalWq8gKYqTOps/yYVEaRBHExPPhqeVdRLPs=; b=VkDvejWYOi1Aq3rKSV0/1ELoaCPPwa78mPxDpWJsY/TQVwgKXeqP4/6ec1tuhKDwYR AHhu1BTQ+h9/tlLuDMkx1AouaTI6iWwm/nwbXuVpuiPHzPJ+ZIRYcj4rjmS6wjtiXlRH 7EKOgVJM0FUd4okszLPoqO5Md5/EB06CpHPc4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; b=aylAN4NH2ynMbUlQjmttM3MXZETaS/LQcWEVRyBqA6C7CqvBob1YLT0ZaLhA22NQuY w4XLqHKjbP1ijlw3/o03vPE1RwK6WrmPjOfKVob6sb/m9LpcuAonQZqr0iOtoas8wSEQ g9f1VyWy7Iok96UqaSFk0MWmo+hjXEMXkrauc= MIME-Version: 1.0 Sender: asmrookie@gmail.com Received: by 10.223.74.91 with SMTP id t27mr750119faj.62.1258986428270; Mon, 23 Nov 2009 06:27:08 -0800 (PST) In-Reply-To: <20091122.183841.222456704.imp@bsdimp.com> References: <200911210143.nAL1hMx3062260@svn.freebsd.org> <20091122.183841.222456704.imp@bsdimp.com> Date: Mon, 23 Nov 2009 15:27:08 +0100 X-Google-Sender-Auth: 88b08c53b3e172ca Message-ID: <3bbf2fe10911230627m5f9cff68n449f587c77e8c2a9@mail.gmail.com> From: Attilio Rao To: "M. Warner Losh" Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, dougb@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r199621 - head X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Nov 2009 14:27:10 -0000 2009/11/23 M. Warner Losh : > In message: <200911210143.nAL1hMx3062260@svn.freebsd.org> > Doug Barton writes: > : Author: dougb > : Date: Sat Nov 21 01:43:22 2009 > : New Revision: 199621 > : URL: http://svn.freebsd.org/changeset/base/199621 > : > : Log: > : Add a note that wpa_supplicant(8) may require a full world build to > : sync up with 20091109. > : > : Modified: > : head/UPDATING > : > : Modified: head/UPDATING > : ============================================================================== > : --- head/UPDATING Sat Nov 21 00:34:51 2009 (r199620) > : +++ head/UPDATING Sat Nov 21 01:43:22 2009 (r199621) > : @@ -42,6 +42,10 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 9. > : Applications that require wireless scan results (e.g. ifconfig(8)) > : from net80211 need to be recompiled. > : > : + Applications such as wpa_supplicant(8) may require a full world > : + build without using NO_CLEAN in order to get synchronized with the > : + new structure. > : + > > We should have some general language at the end of UPDATING that can > be invoked for these things. In general, when structure sizes change, > you have to do a fresh, from scratch build. We shouldn't have to > repeat it each time we do one. I'm not sure which commits that refers to, but if __FreeBSD_version wasn't bumped it must had happened, and users should rebuild world/kernel at any __FreeBSD_version bumping. We don't need such comments for any ABI/API/__FreeBSD_version bumping change. Attilio -- Peace can only be achieved by understanding - A. Einstein From owner-svn-src-all@FreeBSD.ORG Mon Nov 23 15:06:13 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8C8381065692; Mon, 23 Nov 2009 15:06:13 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from pooker.samsco.org (pooker.samsco.org [168.103.85.57]) by mx1.freebsd.org (Postfix) with ESMTP id AD56C8FC12; Mon, 23 Nov 2009 15:06:12 +0000 (UTC) Received: from ydesk.samsco.home (ydesk.samsco.home [192.168.254.15]) (authenticated bits=0) by pooker.samsco.org (8.14.2/8.14.2) with ESMTP id nANF68Wk014274; Mon, 23 Nov 2009 08:06:08 -0700 (MST) (envelope-from scottl@samsco.org) Mime-Version: 1.0 (Apple Message framework v1076) Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes From: Scott Long In-Reply-To: <200911230838.20217.jhb@freebsd.org> Date: Mon, 23 Nov 2009 08:06:08 -0700 Content-Transfer-Encoding: 7bit Message-Id: <2B4A2CD3-AA54-4030-9F39-3BF7DFC0434C@samsco.org> References: <200911222050.nAMKoRYh029141@svn.freebsd.org> <0298EC7E-26D5-460A-9EBE-5ABEAE8B21BD@samsco.org> <200911230838.20217.jhb@freebsd.org> To: John Baldwin X-Mailer: Apple Mail (2.1076) X-Spam-Status: No, score=-4.4 required=3.8 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.1.8 X-Spam-Checker-Version: SpamAssassin 3.1.8 (2007-02-13) on pooker.samsco.org Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Pyun YongHyeon Subject: Re: svn commit: r199670 - head/sys/dev/bge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Nov 2009 15:06:13 -0000 On Nov 23, 2009, at 6:38 AM, John Baldwin wrote: > On Sunday 22 November 2009 6:48:18 pm Scott Long wrote: >> By definition, PCIe can't transfer across 4GB boundaries. It's not a >> bug specific to Broadcom. If you're loading dynamic buffers (i.e. >> mbufs), setting an appropriate boundary value in the tag will allow >> busdma to take care of this. If you're allocating static buffers, >> busdma won't honor this. But what you've done here is best anyways; >> control buffers that are going to be frequently transferred are best >> kept in the lower 4GB of the address space. It simplifies PCIe >> handling, and it's significantly faster on PCI/PCI-X. So I'd suggest >> making this the rule rather than the exception in the driver. > > Should we enforce an implicit 4GB boundary in bus_dma then? Perhaps > Host-PCI > bridge drivers should create a tag with a 4GB boundary that devices > inherit > via bus_get_dma_tag(). For i386/PAE we might should always enforce > a 4GB > boundary as well? That was actually the point of creating bus_get_dma_tag(). I don't recall how complete the back-end work of providing a inheritance tree for bridges got. Note that having this wouldn't really solve Pyun's problem, because boundaries aren't honored for static allocations. There's been plenty of talk about multi-segment static allocations, but I don't think that that's applicable to this either. As I said before, it's best to restrict static allocations to the lower 4GB of memory and not worry about the boundary at all. But having the proper inheritance would still be nice. Another thing that I'd like to do is have an alternate for bus_dma_tag_create() that takes the device_t of the device as the first argument and figures out the parent tag and inheritance automatically. That's a job for the mythical /sys/kern/subr_busdma.c. Scott From owner-svn-src-all@FreeBSD.ORG Mon Nov 23 15:40:57 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 11D13106568B; Mon, 23 Nov 2009 15:40:57 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id D5DBF8FC13; Mon, 23 Nov 2009 15:40:56 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 84C2446B37; Mon, 23 Nov 2009 10:40:56 -0500 (EST) Received: from jhbbsd.hudson-trading.com (unknown [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPA id BB4D28A01D; Mon, 23 Nov 2009 10:40:55 -0500 (EST) From: John Baldwin To: Scott Long Date: Mon, 23 Nov 2009 10:40:16 -0500 User-Agent: KMail/1.9.7 References: <200911222050.nAMKoRYh029141@svn.freebsd.org> <200911230838.20217.jhb@freebsd.org> <2B4A2CD3-AA54-4030-9F39-3BF7DFC0434C@samsco.org> In-Reply-To: <2B4A2CD3-AA54-4030-9F39-3BF7DFC0434C@samsco.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200911231040.16597.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Mon, 23 Nov 2009 10:40:55 -0500 (EST) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=4.2 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Pyun YongHyeon Subject: Re: svn commit: r199670 - head/sys/dev/bge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Nov 2009 15:40:57 -0000 On Monday 23 November 2009 10:06:08 am Scott Long wrote: > > On Nov 23, 2009, at 6:38 AM, John Baldwin wrote: > > > On Sunday 22 November 2009 6:48:18 pm Scott Long wrote: > >> By definition, PCIe can't transfer across 4GB boundaries. It's not a > >> bug specific to Broadcom. If you're loading dynamic buffers (i.e. > >> mbufs), setting an appropriate boundary value in the tag will allow > >> busdma to take care of this. If you're allocating static buffers, > >> busdma won't honor this. But what you've done here is best anyways; > >> control buffers that are going to be frequently transferred are best > >> kept in the lower 4GB of the address space. It simplifies PCIe > >> handling, and it's significantly faster on PCI/PCI-X. So I'd suggest > >> making this the rule rather than the exception in the driver. > > > > Should we enforce an implicit 4GB boundary in bus_dma then? Perhaps > > Host-PCI > > bridge drivers should create a tag with a 4GB boundary that devices > > inherit > > via bus_get_dma_tag(). For i386/PAE we might should always enforce > > a 4GB > > boundary as well? > > That was actually the point of creating bus_get_dma_tag(). I don't > recall how complete the back-end work of providing a inheritance tree > for bridges got. Note that having this wouldn't really solve Pyun's > problem, because boundaries aren't honored for static allocations. > There's been plenty of talk about multi-segment static allocations, > but I don't think that that's applicable to this either. As I said > before, it's best to restrict static allocations to the lower 4GB of > memory and not worry about the boundary at all. But having the proper > inheritance would still be nice. > > Another thing that I'd like to do is have an alternate for > bus_dma_tag_create() that takes the device_t of the device as the > first argument and figures out the parent tag and inheritance > automatically. That's a job for the mythical /sys/kern/subr_busdma.c. The inheritance thing will actually work as the default version of bus_dma_get_tag() is to just pass the request up the tree. As long as devices always use bus_dma_get_tag() when creating the tag they pass down to their children via their own bus_dma_get_tag() implementation all the various restrictions should be passed down the tree. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Mon Nov 23 16:00:17 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2E9CC1065672; Mon, 23 Nov 2009 16:00:17 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1CD488FC1D; Mon, 23 Nov 2009 16:00:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nANG0HVH061647; Mon, 23 Nov 2009 16:00:17 GMT (envelope-from rnoland@svn.freebsd.org) Received: (from rnoland@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nANG0GkS061641; Mon, 23 Nov 2009 16:00:16 GMT (envelope-from rnoland@svn.freebsd.org) Message-Id: <200911231600.nANG0GkS061641@svn.freebsd.org> From: Robert Noland Date: Mon, 23 Nov 2009 16:00:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199714 - in head/sys/boot: . i386 i386/loader i386/zfsboot i386/zfsloader X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Nov 2009 16:00:17 -0000 Author: rnoland Date: Mon Nov 23 16:00:16 2009 New Revision: 199714 URL: http://svn.freebsd.org/changeset/base/199714 Log: Create a seperate ZFS enabled loader. This adds zfsloader which will be called by zfsboot/gptzfsboot code rather than the tradional loader. This eliminates the need to set the LOADER_ZFS_SUPPORT variable in order to get a ZFS enabled loader. Note however, that you must reinstall your bootcode (zfsboot/gptzfsboot) in order for the boot process to use the new loader. New installations will no longer be required to build a ZFS enabled loader for a working ZFS boot system. Installing zfsboot/gptzfsboot is sufficient for acknowledging the use of CDDL code and therefore the ZFS enabled loader. Based on a previous patch from jhb@ Reviewed by: jhb@ MFC after: 2 weeks Added: head/sys/boot/i386/zfsloader/ head/sys/boot/i386/zfsloader/Makefile (contents, props changed) Modified: head/sys/boot/Makefile head/sys/boot/i386/Makefile head/sys/boot/i386/loader/Makefile head/sys/boot/i386/zfsboot/zfsboot.c Modified: head/sys/boot/Makefile ============================================================================== --- head/sys/boot/Makefile Mon Nov 23 15:26:16 2009 (r199713) +++ head/sys/boot/Makefile Mon Nov 23 16:00:16 2009 (r199714) @@ -22,7 +22,7 @@ SUBDIR+= ofw SUBDIR+= uboot .endif -.if defined(LOADER_ZFS_SUPPORT) +.if ${MACHINE_ARCH} == "amd64" || ${MACHINE} == "i386" SUBDIR+= zfs .endif Modified: head/sys/boot/i386/Makefile ============================================================================== --- head/sys/boot/i386/Makefile Mon Nov 23 15:26:16 2009 (r199713) +++ head/sys/boot/i386/Makefile Mon Nov 23 16:00:16 2009 (r199714) @@ -1,7 +1,7 @@ # $FreeBSD$ SUBDIR= mbr pmbr boot0 boot0sio btx boot2 cdboot gptboot zfsboot \ - gptzfsboot kgzldr libi386 libfirewire loader + gptzfsboot kgzldr libi386 libfirewire loader zfsloader # special boot programs, 'self-extracting boot2+loader' SUBDIR+= pxeldr Modified: head/sys/boot/i386/loader/Makefile ============================================================================== --- head/sys/boot/i386/loader/Makefile Mon Nov 23 15:26:16 2009 (r199713) +++ head/sys/boot/i386/loader/Makefile Mon Nov 23 16:00:16 2009 (r199714) @@ -3,9 +3,10 @@ .include MK_SSP= no -PROG= loader.sym +LOADER?= loader +PROG= ${LOADER}.sym INTERNALPROG= -NEWVERSWHAT= "bootstrap loader" i386 +NEWVERSWHAT?= "bootstrap loader" i386 # architecture-specific loader code SRCS= main.c conf.c vers.c @@ -16,7 +17,7 @@ CFLAGS+= -DLOADER_FIREWIRE_SUPPORT LIBFIREWIRE= ${.OBJDIR}/../libfirewire/libfirewire.a .endif -# Put LOADER_ZFS_SUPPORT=yes in /etc/make.conf for ZFS support +# Set by zfsloader Makefile .if defined(LOADER_ZFS_SUPPORT) CFLAGS+= -DLOADER_ZFS_SUPPORT LIBZFS= ${.OBJDIR}/../../zfs/libzfsboot.a @@ -61,7 +62,7 @@ CFLAGS+= -DLOADER_GPT_SUPPORT CFLAGS+= -I${.CURDIR}/../../common CFLAGS+= -I. -CLEANFILES= vers.c loader loader.bin loader.help +CLEANFILES= vers.c ${LOADER} ${LOADER}.bin loader.help CFLAGS+= -Wall LDFLAGS= -static -Ttext 0x0 @@ -80,30 +81,35 @@ CFLAGS+= -I${.CURDIR}/../btx/lib # Pick up ../Makefile.inc early. .include -vers.c: ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version - sh ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version ${NEWVERSWHAT} +vers.c: ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/../loader/version + sh ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/../loader/version \ + ${NEWVERSWHAT} -loader: loader.bin ${BTXLDR} ${BTXKERN} +${LOADER}: ${LOADER}.bin ${BTXLDR} ${BTXKERN} btxld -v -f aout -e ${LOADER_ADDRESS} -o ${.TARGET} -l ${BTXLDR} \ - -b ${BTXKERN} loader.bin + -b ${BTXKERN} ${LOADER}.bin -loader.bin: loader.sym +${LOADER}.bin: ${LOADER}.sym cp ${.ALLSRC} ${.TARGET} strip -R .comment -R .note ${.TARGET} loader.help: help.common help.i386 cat ${.ALLSRC} | awk -f ${.CURDIR}/../../common/merge_help.awk > ${.TARGET} +FILES= ${LOADER} +# XXX INSTALLFLAGS_loader= -b +FILESMODE_${LOADER}= ${BINMODE} -b + +.if !defined(LOADER_ONLY) .PATH: ${.CURDIR}/../../forth -FILES= loader loader.help loader.4th support.4th loader.conf +FILES+= loader.help loader.4th support.4th loader.conf FILES+= screen.4th frames.4th beastie.4th -# XXX INSTALLFLAGS_loader= -b -FILESMODE_loader= ${BINMODE} -b FILESDIR_loader.conf= /boot/defaults .if !exists(${DESTDIR}/boot/loader.rc) FILES+= loader.rc .endif +.endif # XXX crt0.o needs to be first for pxeboot(8) to work OBJS= ${BTXCRT} Modified: head/sys/boot/i386/zfsboot/zfsboot.c ============================================================================== --- head/sys/boot/i386/zfsboot/zfsboot.c Mon Nov 23 15:26:16 2009 (r199713) +++ head/sys/boot/i386/zfsboot/zfsboot.c Mon Nov 23 16:00:16 2009 (r199714) @@ -84,7 +84,7 @@ __FBSDID("$FreeBSD$"); #define KARGS_FLAGS_ZFS 0x4 #define PATH_CONFIG "/boot.config" -#define PATH_BOOT3 "/boot/loader" +#define PATH_BOOT3 "/boot/zfsloader" #define PATH_KERNEL "/boot/kernel/kernel" #define ARGS 0x900 Added: head/sys/boot/i386/zfsloader/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/i386/zfsloader/Makefile Mon Nov 23 16:00:16 2009 (r199714) @@ -0,0 +1,12 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../loader + +LOADER= zfsloader +NEWVERSWHAT= "ZFS enabled bootstrap loader" i386 +LOADER_ZFS_SUPPORT=yes +LOADER_ONLY= yes +NO_MAN= yes + +.include "${.CURDIR}/../loader/Makefile" + From owner-svn-src-all@FreeBSD.ORG Mon Nov 23 16:08:15 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 99BF01065679; Mon, 23 Nov 2009 16:08:15 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 889C58FC13; Mon, 23 Nov 2009 16:08:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nANG8Fpm061840; Mon, 23 Nov 2009 16:08:15 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nANG8F2Y061838; Mon, 23 Nov 2009 16:08:15 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <200911231608.nANG8F2Y061838@svn.freebsd.org> From: Rick Macklem Date: Mon, 23 Nov 2009 16:08:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199715 - head/sys/fs/nfsserver X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Nov 2009 16:08:15 -0000 Author: rmacklem Date: Mon Nov 23 16:08:15 2009 New Revision: 199715 URL: http://svn.freebsd.org/changeset/base/199715 Log: Modify the experimental nfs server so that it falls back to using VOP_LOOKUP() when VFS_VGET() returns EOPNOTSUPP in the ReaddirPlus RPC. This patch is based upon one by pjd@ for the regular nfs server which has not yet been committed. It is needed when a ZFS volume is exported and ReaddirPlus (which almost always happens for NFSv4) is performed by a client. The patch also simplifies vnode lock handling somewhat. MFC after: 2 weeks Modified: head/sys/fs/nfsserver/nfs_nfsdport.c Modified: head/sys/fs/nfsserver/nfs_nfsdport.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdport.c Mon Nov 23 16:00:16 2009 (r199714) +++ head/sys/fs/nfsserver/nfs_nfsdport.c Mon Nov 23 16:08:15 2009 (r199715) @@ -1675,7 +1675,7 @@ nfsrvd_readdirplus(struct nfsrv_descript struct nfsvattr nva, at, *nvap = &nva; struct mbuf *mb0, *mb1; struct nfsreferral *refp; - int nlen, r, error = 0, getret = 1, vgetret; + int nlen, r, error = 0, getret = 1, usevget = 1; int siz, cnt, fullsiz, eofflag, ncookies, entrycnt; caddr_t bpos0, bpos1; u_int64_t off, toff, verf; @@ -1683,6 +1683,7 @@ nfsrvd_readdirplus(struct nfsrv_descript nfsattrbit_t attrbits, rderrbits, savbits; struct uio io; struct iovec iv; + struct componentname cn; if (nd->nd_repstat) { nfsrv_postopattr(nd, getret, &at); @@ -1761,8 +1762,6 @@ nfsrvd_readdirplus(struct nfsrv_descript return (0); } - NFSVOPUNLOCK(vp, 0, p); - MALLOC(rbuf, caddr_t, siz, M_TEMP, M_WAITOK); again: eofflag = 0; @@ -1780,10 +1779,8 @@ again: io.uio_segflg = UIO_SYSSPACE; io.uio_rw = UIO_READ; io.uio_td = NULL; - NFSVOPLOCK(vp, LK_EXCLUSIVE | LK_RETRY, p); nd->nd_repstat = VOP_READDIR(vp, &io, nd->nd_cred, &eofflag, &ncookies, &cookies); - NFSVOPUNLOCK(vp, 0, p); off = (u_int64_t)io.uio_offset; if (io.uio_resid) siz -= io.uio_resid; @@ -1795,7 +1792,7 @@ again: if (!nd->nd_repstat) nd->nd_repstat = getret; if (nd->nd_repstat) { - vrele(vp); + vput(vp); if (cookies) free((caddr_t)cookies, M_TEMP); free((caddr_t)rbuf, M_TEMP); @@ -1808,7 +1805,7 @@ again: * rpc reply */ if (siz == 0) { - vrele(vp); + vput(vp); if (nd->nd_flag & ND_NFSV3) nfsrv_postopattr(nd, getret, &at); NFSM_BUILD(tl, u_int32_t *, 4 * NFSX_UNSIGNED); @@ -1853,33 +1850,7 @@ again: toff = off; goto again; } - - /* - * Probe one of the directory entries to see if the filesystem - * supports VGET for NFSv3. For NFSv4, it will return an - * error later, if attributes are required. - * (To be honest, most if not all NFSv4 clients will require - * attributes, but??) - */ - if ((nd->nd_flag & ND_NFSV3)) { - vgetret = VFS_VGET(vp->v_mount, dp->d_fileno, LK_EXCLUSIVE, - &nvp); - if (vgetret != 0) { - if (vgetret == EOPNOTSUPP) - nd->nd_repstat = NFSERR_NOTSUPP; - else - nd->nd_repstat = NFSERR_SERVERFAULT; - vrele(vp); - if (cookies) - free((caddr_t)cookies, M_TEMP); - free((caddr_t)rbuf, M_TEMP); - nfsrv_postopattr(nd, getret, &at); - return (0); - } - if (!vgetret) - vput(nvp); - nvp = NULL; - } + NFSVOPUNLOCK(vp, 0, p); /* * Save this position, in case there is an error before one entry @@ -1937,9 +1908,41 @@ again: if (nd->nd_flag & ND_NFSV4) refp = nfsv4root_getreferral(NULL, vp, dp->d_fileno); - if (refp == NULL) - r = VFS_VGET(vp->v_mount, dp->d_fileno, - LK_EXCLUSIVE, &nvp); + if (refp == NULL) { + if (usevget) + r = VFS_VGET(vp->v_mount, + dp->d_fileno, LK_EXCLUSIVE, + &nvp); + else + r = EOPNOTSUPP; + if (r == EOPNOTSUPP) { + if (usevget) { + usevget = 0; + cn.cn_nameiop = LOOKUP; + cn.cn_lkflags = + LK_EXCLUSIVE | + LK_RETRY; + cn.cn_cred = + nd->nd_cred; + cn.cn_thread = p; + } + cn.cn_nameptr = dp->d_name; + cn.cn_namelen = nlen; + cn.cn_flags = ISLASTCN | + NOFOLLOW | LOCKLEAF | + MPSAFE; + if (nlen == 2 && + dp->d_name[0] == '.' && + dp->d_name[1] == '.') + cn.cn_flags |= + ISDOTDOT; + if (!VOP_ISLOCKED(vp)) + vn_lock(vp, + LK_EXCLUSIVE | + LK_RETRY); + r = VOP_LOOKUP(vp, &nvp, &cn); + } + } if (!r) { if (refp == NULL && ((nd->nd_flag & ND_NFSV3) || @@ -2018,7 +2021,10 @@ again: cookiep++; ncookies--; } - vrele(vp); + if (!usevget && VOP_ISLOCKED(vp)) + vput(vp); + else + vrele(vp); /* * If dirlen > cnt, we must strip off the last entry. If that From owner-svn-src-all@FreeBSD.ORG Mon Nov 23 16:49:32 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 30A891065670 for ; Mon, 23 Nov 2009 16:49:32 +0000 (UTC) (envelope-from julian@elischer.org) Received: from outF.internet-mail-service.net (outf.internet-mail-service.net [216.240.47.229]) by mx1.freebsd.org (Postfix) with ESMTP id 137BA8FC1D for ; Mon, 23 Nov 2009 16:49:31 +0000 (UTC) Received: from idiom.com (mx0.idiom.com [216.240.32.160]) by out.internet-mail-service.net (Postfix) with ESMTP id CE7F7C482; Mon, 23 Nov 2009 08:49:32 -0800 (PST) X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e Received: from julian-mac.elischer.org (h-67-100-89-137.snfccasy.static.covad.net [67.100.89.137]) by idiom.com (Postfix) with ESMTP id 27F482D6014; Mon, 23 Nov 2009 08:49:31 -0800 (PST) Message-ID: <4B0ABD19.4010206@elischer.org> Date: Mon, 23 Nov 2009 08:49:29 -0800 From: Julian Elischer User-Agent: Thunderbird 2.0.0.23 (Macintosh/20090812) MIME-Version: 1.0 To: Scott Long References: <200911222050.nAMKoRYh029141@svn.freebsd.org> <200911230838.20217.jhb@freebsd.org> <2B4A2CD3-AA54-4030-9F39-3BF7DFC0434C@samsco.org> <200911231040.16597.jhb@freebsd.org> In-Reply-To: <200911231040.16597.jhb@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, John Baldwin , Pyun YongHyeon Subject: Re: svn commit: r199670 - head/sys/dev/bge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Nov 2009 16:49:32 -0000 >>> On Sunday 22 November 2009 6:48:18 pm Scott Long wrote: >>>> By definition, PCIe can't transfer across 4GB boundaries. It's not a >>>> bug specific to Broadcom. That is a limitation I was not aware of.. Not having the specs, can you tell us why it is "by definition" broken in this way? I.E. What do you mean by that? From owner-svn-src-all@FreeBSD.ORG Mon Nov 23 17:02:24 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from [127.0.0.1] (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by hub.freebsd.org (Postfix) with ESMTP id 962F61065672; Mon, 23 Nov 2009 17:02:24 +0000 (UTC) (envelope-from jkim@FreeBSD.org) From: Jung-uk Kim To: Ed Schouten Date: Mon, 23 Nov 2009 12:02:07 -0500 User-Agent: KMail/1.6.2 References: <200911202112.nAKLCe35056653@svn.freebsd.org> <20091121102114.GK64905@hoeg.nl> In-Reply-To: <20091121102114.GK64905@hoeg.nl> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200911231202.11209.jkim@FreeBSD.org> Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r199615 - in head/sys: amd64/amd64 i386/i386 net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Nov 2009 17:02:24 -0000 On Saturday 21 November 2009 05:21 am, Ed Schouten wrote: > Hi, > > * Jung-uk Kim wrote: > > #ifdef _KERNEL > > - stream.refs = malloc((nins + 1) * sizeof(u_int), M_BPFJIT, > > M_NOWAIT); + stream.refs = malloc((nins + 1) * sizeof(u_int), > > M_BPFJIT, + M_NOWAIT | M_ZERO); > > #else > > stream.refs = malloc((nins + 1) * sizeof(u_int)); > > #endif > > if (stream.refs == NULL) > > return (NULL); > > - > > - /* Reset the reference table */ > > - for (i = 0; i < nins + 1; i++) > > - stream.refs[i] = 0; > > +#ifndef _KERNEL > > + memset(stream.refs, 0, (nins + 1) * sizeof(u_int)); > > +#endif > > Can't we avoid the special case here by just calling calloc(3)? Good point, will be done in the next patch set. Thanks, Jung-uk Kim From owner-svn-src-all@FreeBSD.ORG Mon Nov 23 17:54:57 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BF4AA106566B; Mon, 23 Nov 2009 17:54:57 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AE15F8FC21; Mon, 23 Nov 2009 17:54:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nANHsvbI064107; Mon, 23 Nov 2009 17:54:57 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nANHsvsA064105; Mon, 23 Nov 2009 17:54:57 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200911231754.nANHsvsA064105@svn.freebsd.org> From: Alexander Motin Date: Mon, 23 Nov 2009 17:54:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199716 - stable/8/sys/cam/ata X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Nov 2009 17:54:57 -0000 Author: mav Date: Mon Nov 23 17:54:57 2009 New Revision: 199716 URL: http://svn.freebsd.org/changeset/base/199716 Log: MFC r199321: Disable PortMultiplier Async Notifications for time of ports reset. They are useless at that time, but confuse Marvell AHCI. Add quirk for SiI57XX Port Multipliers, to hide extra port. Modified: stable/8/sys/cam/ata/ata_pmp.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/cam/ata/ata_pmp.c ============================================================================== --- stable/8/sys/cam/ata/ata_pmp.c Mon Nov 23 16:08:15 2009 (r199715) +++ stable/8/sys/cam/ata/ata_pmp.c Mon Nov 23 17:54:57 2009 (r199716) @@ -63,11 +63,12 @@ __FBSDID("$FreeBSD$"); typedef enum { PMP_STATE_NORMAL, PMP_STATE_PORTS, - PMP_STATE_CONFIG, + PMP_STATE_PRECONFIG, PMP_STATE_RESET, PMP_STATE_CONNECT, PMP_STATE_CHECK, PMP_STATE_CLEAR, + PMP_STATE_CONFIG, PMP_STATE_SCAN } pmp_state; @@ -436,7 +437,7 @@ pmpstart(struct cam_periph *periph, unio pmp_default_timeout * 1000); ata_pm_read_cmd(ataio, 2, 15); break; - case PMP_STATE_CONFIG: + case PMP_STATE_PRECONFIG: cam_fill_ataio(ataio, pmp_retry_count, pmpdone, @@ -445,7 +446,7 @@ pmpstart(struct cam_periph *periph, unio /*data_ptr*/NULL, /*dxfer_len*/0, pmp_default_timeout * 1000); - ata_pm_write_cmd(ataio, 0x60, 15, 0xf); + ata_pm_write_cmd(ataio, 0x60, 15, 0x0); break; case PMP_STATE_RESET: cam_fill_ataio(ataio, @@ -495,6 +496,17 @@ printf("PM RESET %d%s\n", softc->pm_step pmp_default_timeout * 1000); ata_pm_write_cmd(ataio, 1, softc->pm_step, 0xFFFFFFFF); break; + case PMP_STATE_CONFIG: + cam_fill_ataio(ataio, + pmp_retry_count, + pmpdone, + /*flags*/CAM_DIR_NONE, + 0, + /*data_ptr*/NULL, + /*dxfer_len*/0, + pmp_default_timeout * 1000); + ata_pm_write_cmd(ataio, 0x60, 15, 0xf); + break; default: break; } @@ -554,24 +566,29 @@ pmpdone(struct cam_periph *periph, union (done_ccb->ataio.res.lba_mid << 16) + (done_ccb->ataio.res.lba_low << 8) + done_ccb->ataio.res.sector_count; - /* This PM declares 6 ports, while only 5 of them are real. + /* This PMP declares 6 ports, while only 5 of them are real. * Port 5 is enclosure management bridge port, which has implementation * problems, causing probe faults. Hide it for now. */ if (softc->pm_pid == 0x37261095 && softc->pm_ports == 6) softc->pm_ports = 5; - /* This PM declares 7 ports, while only 5 of them are real. + /* This PMP declares 7 ports, while only 5 of them are real. * Port 5 is some fake "Config Disk" with 640 sectors size, * port 6 is enclosure management bridge port. * Both fake ports has implementation problems, causing * probe faults. Hide them for now. */ if (softc->pm_pid == 0x47261095 && softc->pm_ports == 7) softc->pm_ports = 5; + /* These PMPs declare one more port then actually have, + * for configuration purposes. Hide it for now. */ + if (softc->pm_pid == 0x57231095 || softc->pm_pid == 0x57331095 || + softc->pm_pid == 0x57341095 || softc->pm_pid == 0x57441095) + softc->pm_ports--; printf("PM ports: %d\n", softc->pm_ports); - softc->state = PMP_STATE_CONFIG; + softc->state = PMP_STATE_PRECONFIG; xpt_release_ccb(done_ccb); xpt_schedule(periph, priority); return; - case PMP_STATE_CONFIG: + case PMP_STATE_PRECONFIG: softc->pm_step = 0; softc->state = PMP_STATE_RESET; softc->reset |= ~softc->found; @@ -658,11 +675,15 @@ pmpdone(struct cam_periph *periph, union return; case PMP_STATE_CLEAR: softc->pm_step++; - if (softc->pm_step < softc->pm_ports) { - xpt_release_ccb(done_ccb); - xpt_schedule(periph, priority); - return; - } else if (softc->found) { + if (softc->pm_step >= softc->pm_ports) { + softc->state = PMP_STATE_CONFIG; + softc->pm_step = 0; + } + xpt_release_ccb(done_ccb); + xpt_schedule(periph, priority); + return; + case PMP_STATE_CONFIG: + if (softc->found) { softc->pm_step = 0; softc->state = PMP_STATE_SCAN; work_ccb = xpt_alloc_ccb_nowait(); From owner-svn-src-all@FreeBSD.ORG Mon Nov 23 18:07:28 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AB922106566C; Mon, 23 Nov 2009 18:07:28 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9B81E8FC17; Mon, 23 Nov 2009 18:07:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nANI7SE5064459; Mon, 23 Nov 2009 18:07:28 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nANI7SPN064457; Mon, 23 Nov 2009 18:07:28 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200911231807.nANI7SPN064457@svn.freebsd.org> From: Alexander Motin Date: Mon, 23 Nov 2009 18:07:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199717 - head/sys/dev/ahci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Nov 2009 18:07:28 -0000 Author: mav Date: Mon Nov 23 18:07:28 2009 New Revision: 199717 URL: http://svn.freebsd.org/changeset/base/199717 Log: Do not attach JMicrons with single PCI function. They are not working as AHCI for some reason, even when declaring so. Let atajmicron configure them for us and provide PATA support. Modified: head/sys/dev/ahci/ahci.c Modified: head/sys/dev/ahci/ahci.c ============================================================================== --- head/sys/dev/ahci/ahci.c Mon Nov 23 17:54:57 2009 (r199716) +++ head/sys/dev/ahci/ahci.c Mon Nov 23 18:07:28 2009 (r199717) @@ -254,6 +254,10 @@ ahci_probe(device_t dev) for (i = 0; ahci_ids[i].id != 0; i++) { if (ahci_ids[i].id == devid && (valid || !(ahci_ids[i].quirks & AHCI_Q_NOFORCE))) { + /* Do not attach JMicrons with single PCI function. */ + if (pci_get_vendor(dev) == 0x197b && + (pci_read_config(dev, 0xdf, 1) & 0x40) == 0) + return (ENXIO); snprintf(buf, sizeof(buf), "%s AHCI SATA controller", ahci_ids[i].name); device_set_desc_copy(dev, buf); From owner-svn-src-all@FreeBSD.ORG Mon Nov 23 18:12:09 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 77BFC1065672; Mon, 23 Nov 2009 18:12:09 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 679B08FC0A; Mon, 23 Nov 2009 18:12:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nANIC9lB064607; Mon, 23 Nov 2009 18:12:09 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nANIC9JM064605; Mon, 23 Nov 2009 18:12:09 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200911231812.nANIC9JM064605@svn.freebsd.org> From: Andrew Thompson Date: Mon, 23 Nov 2009 18:12:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199718 - head/sys/dev/usb/controller X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Nov 2009 18:12:09 -0000 Author: thompsa Date: Mon Nov 23 18:12:09 2009 New Revision: 199718 URL: http://svn.freebsd.org/changeset/base/199718 Log: Actually disable interrupts in ehci_detach(). Reviewed by: HPS Modified: head/sys/dev/usb/controller/ehci.c Modified: head/sys/dev/usb/controller/ehci.c ============================================================================== --- head/sys/dev/usb/controller/ehci.c Mon Nov 23 18:07:28 2009 (r199717) +++ head/sys/dev/usb/controller/ehci.c Mon Nov 23 18:12:09 2009 (r199718) @@ -528,7 +528,7 @@ ehci_detach(ehci_softc_t *sc) usb_callout_stop(&sc->sc_tmo_pcd); usb_callout_stop(&sc->sc_tmo_poll); - EOWRITE4(sc, EHCI_USBINTR, sc->sc_eintrs); + EOWRITE4(sc, EHCI_USBINTR, 0); USB_BUS_UNLOCK(&sc->sc_bus); if (ehci_hcreset(sc)) { From owner-svn-src-all@FreeBSD.ORG Mon Nov 23 20:44:34 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A494E106566C; Mon, 23 Nov 2009 20:44:34 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: from mail-yx0-f171.google.com (mail-yx0-f171.google.com [209.85.210.171]) by mx1.freebsd.org (Postfix) with ESMTP id D06858FC0A; Mon, 23 Nov 2009 20:44:33 +0000 (UTC) Received: by yxe1 with SMTP id 1so5203304yxe.3 for ; Mon, 23 Nov 2009 12:44:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:received:from:date:to:cc :subject:message-id:reply-to:references:mime-version:content-type :content-disposition:in-reply-to:user-agent; bh=iWauVuorTNgerR6tRj9goq2sl7Hg+RnaEYdUoyCd0f0=; b=dDVBuWMGpr4u80kOqV/9jfy3EL9i2AetZsBXBacMUL8vv0fJaziXAAYPGUwcKqYF8+ Dqi4Lh2uhB2GJzl/Jm9WyUijEFQfi4rRksIZ2KLSA+bEVy3SDyvIWKH53rPnvf0g3/QQ L3WLPGq6E1VSGRn+98mP61MXv3ztQefm29yVk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:date:to:cc:subject:message-id:reply-to:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=ptZkqk0e1AFyoUvsES21mh+fQMrTkGeb57tzsJaRCkpDvF/jk2X+opobB7rd3D0GsF DfPEnHC1HdLjv7gzcpYr7wkU5KATa3fBqBkwgLfXY+mG4rPOgn4DqX+q8Aqd2cFOlbMj 8wRgF3+0Qhu/en5CJe7C+vZ3OqnViGa1mo7CQ= Received: by 10.101.166.2 with SMTP id t2mr4294380ano.9.1259009069276; Mon, 23 Nov 2009 12:44:29 -0800 (PST) Received: from pyunyh@gmail.com ([174.35.1.224]) by mx.google.com with ESMTPS id 9sm1368971ywe.56.2009.11.23.12.44.26 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 23 Nov 2009 12:44:28 -0800 (PST) Received: by pyunyh@gmail.com (sSMTP sendmail emulation); Mon, 23 Nov 2009 12:44:00 -0800 From: Pyun YongHyeon Date: Mon, 23 Nov 2009 12:44:00 -0800 To: Scott Long Message-ID: <20091123204400.GB1214@michelle.cdnetworks.com> References: <200911222050.nAMKoRYh029141@svn.freebsd.org> <0298EC7E-26D5-460A-9EBE-5ABEAE8B21BD@samsco.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="AhhlLboLdkugWU4S" Content-Disposition: inline In-Reply-To: <0298EC7E-26D5-460A-9EBE-5ABEAE8B21BD@samsco.org> User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Pyun YongHyeon Subject: Re: svn commit: r199670 - head/sys/dev/bge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: pyunyh@gmail.com List-Id: "SVN commit messages 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, 23 Nov 2009 20:44:34 -0000 --AhhlLboLdkugWU4S Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Sun, Nov 22, 2009 at 04:48:18PM -0700, Scott Long wrote: > By definition, PCIe can't transfer across 4GB boundaries. It's not a > bug specific to Broadcom. If you're loading dynamic buffers (i.e. > mbufs), setting an appropriate boundary value in the tag will allow > busdma to take care of this. If you're allocating static buffers, > busdma won't honor this. But what you've done here is best anyways; Last time I tried boundary value for static buffer in dma tag it didn't honor the boundary value so I blindly thought boundary value also is not honored for dynamic buffers. It would be great if this can be documented in man page. > control buffers that are going to be frequently transferred are best > kept in the lower 4GB of the address space. It simplifies PCIe > handling, and it's significantly faster on PCI/PCI-X. So I'd suggest > making this the rule rather than the exception in the driver. > If this is the case it would also affect other drivers(em(4) and igb(4) etc). As John said it would be even better this could be automatically handled in bus_dma. Patching every driver in tree to reflect this would be pain, I guess. Anyway I've made a new patch. Would you review this? --AhhlLboLdkugWU4S Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="bge.dma.diff2" --- if_bge.c.orig 2009-11-22 13:45:55.000000000 -0800 +++ if_bge.c 2009-11-23 12:20:07.000000000 -0800 @@ -2028,7 +2028,8 @@ bus_dma_tag_destroy(sc->bge_cdata.bge_rx_mtag); if (sc->bge_cdata.bge_tx_mtag) bus_dma_tag_destroy(sc->bge_cdata.bge_tx_mtag); - + if (sc->bge_cdata.bge_mbuf_tag) + bus_dma_tag_destroy(sc->bge_cdata.bge_mbuf_tag); /* Destroy standard RX ring. */ if (sc->bge_cdata.bge_rx_std_ring_map) @@ -2125,16 +2126,24 @@ sc = device_get_softc(dev); - lowaddr = BUS_SPACE_MAXADDR; - if ((sc->bge_flags & BGE_FLAG_40BIT_BUG) != 0) - lowaddr = BGE_DMA_MAXADDR; - if ((sc->bge_flags & BGE_FLAG_4G_BNDRY_BUG) != 0) - lowaddr = BUS_SPACE_MAXADDR_32BIT; /* * Allocate the parent bus DMA tag appropriate for PCI. + * All controllers that are not 5755 or higher have 4GB + * boundary DMA bug. + * Whenever an address crosses a multiple of the 4GB boundary + * (including 4GB, 8Gb, 12Gb, etc.) and makes the transition + * from 0xX_FFFF_FFFF to 0x(X+1)_0000_0000 an internal DMA + * state machine will lockup and cause the device to hang. + * According to Scott Long, PCIe can't transfer across 4GB + * boundaries by definition. And control buffers that are + * going to frequently transferred are best kept in the lower + * 4GB of the address space. It simplifies PCIe handling and + * it's significantly faster on PCI/PCI-X. So limit the + * DMA address to be within 4GB address for all control + * buffers(TX/RX/RX return/status block/statistics block etc). */ error = bus_dma_tag_create(bus_get_dma_tag(sc->bge_dev), - 1, 0, lowaddr, BUS_SPACE_MAXADDR, NULL, + 1, 0, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, BUS_SPACE_MAXSIZE_32BIT, 0, BUS_SPACE_MAXSIZE_32BIT, 0, NULL, NULL, &sc->bge_cdata.bge_parent_tag); @@ -2143,6 +2152,23 @@ "could not allocate parent dma tag\n"); return (ENOMEM); } + /* + * Set 4GB boundary for mbufs such that it workarounds DMA bug + * of pre BCM5755 controllers. + */ + lowaddr = BUS_SPACE_MAXADDR; + if ((sc->bge_flags & BGE_FLAG_40BIT_BUG) != 0) + lowaddr = BGE_DMA_MAXADDR; + error = bus_dma_tag_create(bus_get_dma_tag(sc->bge_dev), + 1, BUS_SPACE_MAXSIZE_32BIT, lowaddr, BUS_SPACE_MAXADDR, + NULL, NULL, BUS_SPACE_MAXSIZE_32BIT, 0, BUS_SPACE_MAXSIZE_32BIT, + 0, NULL, NULL, &sc->bge_cdata.bge_mbuf_tag); + + if (error != 0) { + device_printf(sc->bge_dev, + "could not allocate mbuf dma tag\n"); + return (ENOMEM); + } /* * Create tag for Tx mbufs. @@ -2154,7 +2180,7 @@ txsegsz = MCLBYTES; txmaxsegsz = MCLBYTES * BGE_NSEG_NEW; } - error = bus_dma_tag_create(sc->bge_cdata.bge_parent_tag, 1, + error = bus_dma_tag_create(sc->bge_cdata.bge_mbuf_tag, 1, 0, BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL, NULL, txmaxsegsz, BGE_NSEG_NEW, txsegsz, 0, NULL, NULL, &sc->bge_cdata.bge_tx_mtag); @@ -2167,7 +2193,7 @@ /* * Create tag for Rx mbufs. */ - error = bus_dma_tag_create(sc->bge_cdata.bge_parent_tag, 1, 0, + error = bus_dma_tag_create(sc->bge_cdata.bge_mbuf_tag, 1, 0, BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL, NULL, MCLBYTES, 1, MCLBYTES, 0, NULL, NULL, &sc->bge_cdata.bge_rx_mtag); @@ -2607,17 +2633,6 @@ } /* - * All controllers that are not 5755 or higher have 4GB - * boundary DMA bug. - * Whenever an address crosses a multiple of the 4GB boundary - * (including 4GB, 8Gb, 12Gb, etc.) and makes the transition - * from 0xX_FFFF_FFFF to 0x(X+1)_0000_0000 an internal DMA - * state machine will lockup and cause the device to hang. - */ - if (BGE_IS_5755_PLUS(sc) == 0) - sc->bge_flags |= BGE_FLAG_4G_BNDRY_BUG; - - /* * We could possibly check for BCOM_DEVICEID_BCM5788 in bge_probe() * but I do not know the DEVICEID for the 5788M. */ --- if_bgereg.h.orig 2009-11-22 13:16:30.000000000 -0800 +++ if_bgereg.h 2009-11-23 11:53:56.000000000 -0800 @@ -2537,6 +2537,7 @@ */ struct bge_chain_data { bus_dma_tag_t bge_parent_tag; + bus_dma_tag_t bge_mbuf_tag; bus_dma_tag_t bge_rx_std_ring_tag; bus_dma_tag_t bge_rx_jumbo_ring_tag; bus_dma_tag_t bge_rx_return_ring_tag; @@ -2612,7 +2613,6 @@ #define BGE_FLAG_575X_PLUS 0x00008000 #define BGE_FLAG_5755_PLUS 0x00010000 #define BGE_FLAG_40BIT_BUG 0x00020000 -#define BGE_FLAG_4G_BNDRY_BUG 0x00040000 #define BGE_FLAG_RX_ALIGNBUG 0x00100000 #define BGE_FLAG_NO_3LED 0x00200000 #define BGE_FLAG_ADC_BUG 0x00400000 --AhhlLboLdkugWU4S-- From owner-svn-src-all@FreeBSD.ORG Mon Nov 23 20:53:52 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F041B106566B for ; Mon, 23 Nov 2009 20:53:52 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: from qw-out-2122.google.com (qw-out-2122.google.com [74.125.92.26]) by mx1.freebsd.org (Postfix) with ESMTP id A22AB8FC13 for ; Mon, 23 Nov 2009 20:53:52 +0000 (UTC) Received: by qw-out-2122.google.com with SMTP id 9so1311856qwb.7 for ; Mon, 23 Nov 2009 12:53:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:received:from:date:to:cc :subject:message-id:reply-to:references:mime-version:content-type :content-disposition:in-reply-to:user-agent; bh=kklH4ERhFSUMoMIkJJWWNZerAa7DWq8wOI1a3rLggQU=; b=OBsTSkmtMuQ7TijmNJ9bVsRLUsKUhuXKDWHyI9scZ9clbGVOeK/YFq1SObPsjLdyF9 YgLH7+mywVlO2q7bR+Sm/D8e/0n+QS40fzLSQ9+PV/AN3xCRe7JUZx+OHHCSe9OH9zOw EnHUZ8643Tk2KdBpZx6yvSCnDsDUEyqQ5I/MI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:date:to:cc:subject:message-id:reply-to:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=ld0kKN8kExcPiITpR9sEOTVeHXSA9Nh4CvV/eZ1QzcoUcvTjWA4TlEbAhnT3Vm+xYN srVqgPJqY/6WDBCOhzU5xWo/+s0LTUETf3yB3FcganxNxdvHJGR1dmXB5akHNcWfPCBf 8inDSqsSF2hKXEZFMXX0XzJEpCJudtJtk2Yo4= Received: by 10.224.102.211 with SMTP id h19mr2700261qao.310.1259009631981; Mon, 23 Nov 2009 12:53:51 -0800 (PST) Received: from pyunyh@gmail.com ([174.35.1.224]) by mx.google.com with ESMTPS id 2sm13269996qwi.27.2009.11.23.12.53.49 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 23 Nov 2009 12:53:51 -0800 (PST) Received: by pyunyh@gmail.com (sSMTP sendmail emulation); Mon, 23 Nov 2009 12:53:24 -0800 From: Pyun YongHyeon Date: Mon, 23 Nov 2009 12:53:24 -0800 To: Joerg Sonnenberger Message-ID: <20091123205324.GC1214@michelle.cdnetworks.com> References: <200911222050.nAMKoRYh029141@svn.freebsd.org> <20091123010511.GA14572@britannica.bec.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20091123010511.GA14572@britannica.bec.de> User-Agent: Mutt/1.4.2.3i Cc: svn-src-all@freebsd.org Subject: Re: svn commit: r199670 - head/sys/dev/bge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: pyunyh@gmail.com List-Id: "SVN commit messages 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, 23 Nov 2009 20:53:53 -0000 On Mon, Nov 23, 2009 at 02:05:11AM +0100, Joerg Sonnenberger wrote: > On Sun, Nov 22, 2009 at 08:50:27PM +0000, Pyun YongHyeon wrote: > > Log: > > Fix two long standing bugs on bge(4). Most pre BCM5755 controllers > > have a DMA bug when buffer address crosses a multiple of the 4GB > > boundary(e.g. 4GB, 8GB, 12GB etc). > > Does this only affect transfers that *cross* a 4GB boundary or does it > also affect transfers that *end* at a 4GB boundary? E.g. if the mbuf > cluster starts at 0xffffff00 with size 0x100 -- will the DMA engine > stall happen or not? > AFAIK publicly available datasheet explicitly mentions 4GB boundary limitation(page 153). For BCM5704 case, the datasheet also says buffer descriptors that ends exactly on any multiple of 4GB, BCM5704 will generate host address overflow error even though the buffer descriptor does not actually cross over the 4GB boundary (page 213). I have no idea how to address this specific issue on BCM5704 except allocating more size than needed descriptor size though. > Joerg From owner-svn-src-all@FreeBSD.ORG Mon Nov 23 21:00:46 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1A5B11065672 for ; Mon, 23 Nov 2009 21:00:46 +0000 (UTC) (envelope-from joerg@britannica.bec.de) Received: from www.sonnenberger.org (www.sonnenberger.org [92.79.50.50]) by mx1.freebsd.org (Postfix) with ESMTP id 853798FC1E for ; Mon, 23 Nov 2009 21:00:45 +0000 (UTC) Received: from britannica.bec.de (www.sonnenberger.org [192.168.1.10]) by www.sonnenberger.org (Postfix) with ESMTP id 5FACF666BC; Mon, 23 Nov 2009 22:00:44 +0100 (CET) Received: by britannica.bec.de (Postfix, from userid 1000) id 4034915C36; Mon, 23 Nov 2009 22:00:31 +0100 (CET) Date: Mon, 23 Nov 2009 22:00:31 +0100 From: Joerg Sonnenberger To: Pyun YongHyeon Message-ID: <20091123210031.GA18189@britannica.bec.de> References: <200911222050.nAMKoRYh029141@svn.freebsd.org> <20091123010511.GA14572@britannica.bec.de> <20091123205324.GC1214@michelle.cdnetworks.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20091123205324.GC1214@michelle.cdnetworks.com> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-all@freebsd.org Subject: Re: svn commit: r199670 - head/sys/dev/bge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Nov 2009 21:00:46 -0000 On Mon, Nov 23, 2009 at 12:53:24PM -0800, Pyun YongHyeon wrote: > On Mon, Nov 23, 2009 at 02:05:11AM +0100, Joerg Sonnenberger wrote: > > On Sun, Nov 22, 2009 at 08:50:27PM +0000, Pyun YongHyeon wrote: > > > Log: > > > Fix two long standing bugs on bge(4). Most pre BCM5755 controllers > > > have a DMA bug when buffer address crosses a multiple of the 4GB > > > boundary(e.g. 4GB, 8GB, 12GB etc). > > > > Does this only affect transfers that *cross* a 4GB boundary or does it > > also affect transfers that *end* at a 4GB boundary? E.g. if the mbuf > > cluster starts at 0xffffff00 with size 0x100 -- will the DMA engine > > stall happen or not? > > > > AFAIK publicly available datasheet explicitly mentions 4GB boundary > limitation(page 153). For BCM5704 case, the datasheet also says > buffer descriptors that ends exactly on any multiple of 4GB, > BCM5704 will generate host address overflow error even though the > buffer descriptor does not actually cross over the 4GB boundary > (page 213). I'm asking because the case of crossing the 4GB boundary could be handled transparently via scatter/gather register. If the address overflow happens for the boundary, a work-around in the bus-dma layer would still be applied easy when scatter/gather is supported by the device to bounce the last cache line or so. Joerg From owner-svn-src-all@FreeBSD.ORG Mon Nov 23 21:09:24 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A0306106568B; Mon, 23 Nov 2009 21:09:23 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8EFAC8FC18; Mon, 23 Nov 2009 21:09:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nANL9NKd069666; Mon, 23 Nov 2009 21:09:23 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nANL9Nk5069664; Mon, 23 Nov 2009 21:09:23 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <200911232109.nANL9Nk5069664@svn.freebsd.org> From: Marcel Moolenaar Date: Mon, 23 Nov 2009 21:09:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199719 - head/sys/ia64/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Nov 2009 21:09:25 -0000 Author: marcel Date: Mon Nov 23 21:09:23 2009 New Revision: 199719 URL: http://svn.freebsd.org/changeset/base/199719 Log: Revert previous commit. The problem was not related to overrunning the kernel stack at all. The new USB stack simply caused a change in timing that triggered a firmware bug more often. The addition of PRINTF_BUFR_SIZE apparently triggered the same firmware bug even more reliably. But even with KSTACK_PAGES=5, one instance of the firmware bug remained: booting with a CD inserted. This problem was run into by accident after installing Debian and having to boot FreeBSD to fixup the GPT partitioning (Thanks... not). After bumping KSTACK_PAGES to 5, it was pretty unbelievable that the stack was still being too small. After updating the firmware we could boot with a CD inserted and KSTACK_PAGES could be lowered back to 4 pages without problems. Note: It is believed to be a timing related firmware bug, because the machine check information showed access to the serial console on one CPU and access to the EHCI HCD on the other CPU. Since both are devices on the management unit and thus virtualized in some way, any execution trace that does not include concurrent access to the BMC from both CPUs is fine. Note also that it's not understood exactly how increasing the kernel stack avoided hitting the firmware bug. A change in page faults does change timing, but it's not known if that's what's happening here. In any case: the problem is being monitored. Reverting back to 4 pages for the kernel stack is preferred, because it makes it easier to switch to 16K pages (double the page size) without wasting too much memory by not being able to half the number of pages... Modified: head/sys/ia64/include/param.h Modified: head/sys/ia64/include/param.h ============================================================================== --- head/sys/ia64/include/param.h Mon Nov 23 18:12:09 2009 (r199718) +++ head/sys/ia64/include/param.h Mon Nov 23 21:09:23 2009 (r199719) @@ -92,7 +92,7 @@ #define MAXPAGESIZES 1 /* maximum number of supported page sizes */ #ifndef KSTACK_PAGES -#define KSTACK_PAGES 5 /* pages of kernel stack */ +#define KSTACK_PAGES 4 /* pages of kernel stack */ #endif #define KSTACK_GUARD_PAGES 0 /* pages of kstack guard; 0 disables */ From owner-svn-src-all@FreeBSD.ORG Mon Nov 23 22:23:20 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AACDA106568D; Mon, 23 Nov 2009 22:23:20 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 986768FC1D; Mon, 23 Nov 2009 22:23:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nANMNKRT077635; Mon, 23 Nov 2009 22:23:20 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nANMNKlR077633; Mon, 23 Nov 2009 22:23:20 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <200911232223.nANMNKlR077633@svn.freebsd.org> From: Jung-uk Kim Date: Mon, 23 Nov 2009 22:23:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199721 - in head/sys: amd64/amd64 i386/i386 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Nov 2009 22:23:20 -0000 Author: jkim Date: Mon Nov 23 22:23:19 2009 New Revision: 199721 URL: http://svn.freebsd.org/changeset/base/199721 Log: - Add more aggressive BPF JIT optimization. This is in more favor of i386 while the previous commit was more amd64-centric. - Use calloc(3) instead of malloc(3)/memset(3) in user land[1]. Submitted by: ed[1] Modified: head/sys/amd64/amd64/bpf_jit_machdep.c head/sys/amd64/amd64/bpf_jit_machdep.h head/sys/i386/i386/bpf_jit_machdep.c head/sys/i386/i386/bpf_jit_machdep.h Modified: head/sys/amd64/amd64/bpf_jit_machdep.c ============================================================================== --- head/sys/amd64/amd64/bpf_jit_machdep.c Mon Nov 23 21:17:38 2009 (r199720) +++ head/sys/amd64/amd64/bpf_jit_machdep.c Mon Nov 23 22:23:19 2009 (r199721) @@ -101,29 +101,46 @@ emit_code(bpf_bin_stream *stream, u_int static int bpf_jit_optimize(struct bpf_insn *prog, u_int nins) { - const struct bpf_insn *p; int flags; u_int i; /* Do we return immediately? */ if (BPF_CLASS(prog[0].code) == BPF_RET) - return (BPF_JIT_FLAG_RET); + return (BPF_JIT_FRET); for (flags = 0, i = 0; i < nins; i++) { - p = &prog[i]; - - /* Do we need reference table? */ - if ((flags & BPF_JIT_FLAG_JMP) == 0 && - BPF_CLASS(p->code) == BPF_JMP) - flags |= BPF_JIT_FLAG_JMP; - - /* Do we need scratch memory? */ - if ((flags & BPF_JIT_FLAG_MEM) == 0 && - (p->code == BPF_ST || p->code == BPF_STX || - p->code == (BPF_LD|BPF_MEM) || - p->code == (BPF_LDX|BPF_MEM))) - flags |= BPF_JIT_FLAG_MEM; - + switch (prog[i].code) { + case BPF_LD|BPF_W|BPF_ABS: + case BPF_LD|BPF_H|BPF_ABS: + case BPF_LD|BPF_B|BPF_ABS: + case BPF_LD|BPF_W|BPF_IND: + case BPF_LD|BPF_H|BPF_IND: + case BPF_LD|BPF_B|BPF_IND: + case BPF_LDX|BPF_MSH|BPF_B: + flags |= BPF_JIT_FPKT; + break; + case BPF_LD|BPF_MEM: + case BPF_LDX|BPF_MEM: + case BPF_ST: + case BPF_STX: + flags |= BPF_JIT_FMEM; + break; + case BPF_LD|BPF_W|BPF_LEN: + case BPF_LDX|BPF_W|BPF_LEN: + flags |= BPF_JIT_FLEN; + break; + case BPF_JMP|BPF_JA: + case BPF_JMP|BPF_JGT|BPF_K: + case BPF_JMP|BPF_JGE|BPF_K: + case BPF_JMP|BPF_JEQ|BPF_K: + case BPF_JMP|BPF_JSET|BPF_K: + case BPF_JMP|BPF_JGT|BPF_X: + case BPF_JMP|BPF_JGE|BPF_X: + case BPF_JMP|BPF_JEQ|BPF_X: + case BPF_JMP|BPF_JSET|BPF_X: + flags |= BPF_JIT_FJMP; + break; + } if (flags == BPF_JIT_FLAG_ALL) break; } @@ -139,35 +156,37 @@ bpf_jit_compile(struct bpf_insn *prog, u { bpf_bin_stream stream; struct bpf_insn *ins; - int flags, flag_ret, flag_jmp, flag_mem; + int flags, fret, fpkt, fmem, fjmp, flen; u_int i, pass; - flags = bpf_jit_optimize(prog, nins); - flag_ret = (flags & BPF_JIT_FLAG_RET) != 0; - flag_jmp = (flags & BPF_JIT_FLAG_JMP) != 0; - flag_mem = (flags & BPF_JIT_FLAG_MEM) != 0; - /* * NOTE: Do not modify the name of this variable, as it's used by * the macros to emit code. */ emit_func emitm; + flags = bpf_jit_optimize(prog, nins); + fret = (flags & BPF_JIT_FRET) != 0; + fpkt = (flags & BPF_JIT_FPKT) != 0; + fmem = (flags & BPF_JIT_FMEM) != 0; + fjmp = (flags & BPF_JIT_FJMP) != 0; + flen = (flags & BPF_JIT_FLEN) != 0; + + if (fret) + nins = 1; + memset(&stream, 0, sizeof(stream)); /* Allocate the reference table for the jumps. */ - if (flag_jmp) { + if (fjmp) { #ifdef _KERNEL stream.refs = malloc((nins + 1) * sizeof(u_int), M_BPFJIT, M_NOWAIT | M_ZERO); #else - stream.refs = malloc((nins + 1) * sizeof(u_int)); + stream.refs = calloc(nins + 1, sizeof(u_int)); #endif if (stream.refs == NULL) return (NULL); -#ifndef _KERNEL - memset(stream.refs, 0, (nins + 1) * sizeof(u_int)); -#endif } /* @@ -180,14 +199,15 @@ bpf_jit_compile(struct bpf_insn *prog, u ins = prog; /* Create the procedure header. */ - if (flag_mem) { + if (fmem) { PUSH(RBP); MOVrq(RSP, RBP); SUBib(BPF_MEMWORDS * sizeof(uint32_t), RSP); } - if (!flag_ret) { - MOVrq2(RDI, R8); + if (flen) MOVrd2(ESI, R9D); + if (fpkt) { + MOVrq2(RDI, R8); MOVrd(EDX, EDI); } @@ -204,13 +224,13 @@ bpf_jit_compile(struct bpf_insn *prog, u case BPF_RET|BPF_K: MOVid(ins->k, EAX); - if (flag_mem) + if (fmem) LEAVE(); RET(); break; case BPF_RET|BPF_A: - if (flag_mem) + if (fmem) LEAVE(); RET(); break; @@ -222,7 +242,7 @@ bpf_jit_compile(struct bpf_insn *prog, u MOVrd(EDI, ECX); SUBrd(ESI, ECX); CMPid(sizeof(int32_t), ECX); - if (flag_mem) { + if (fmem) { JAEb(4); ZEROrd(EAX); LEAVE(); @@ -244,7 +264,7 @@ bpf_jit_compile(struct bpf_insn *prog, u MOVrd(EDI, ECX); SUBrd(ESI, ECX); CMPid(sizeof(int16_t), ECX); - if (flag_mem) { + if (fmem) { JAEb(2); LEAVE(); } else @@ -259,7 +279,7 @@ bpf_jit_compile(struct bpf_insn *prog, u ZEROrd(EAX); MOVid(ins->k, ESI); CMPrd(EDI, ESI); - if (flag_mem) { + if (fmem) { JBb(2); LEAVE(); } else @@ -289,7 +309,7 @@ bpf_jit_compile(struct bpf_insn *prog, u MOVrd(EDI, ECX); SUBrd(ESI, ECX); CMPid(sizeof(int32_t), ECX); - if (flag_mem) { + if (fmem) { JAEb(4); ZEROrd(EAX); LEAVE(); @@ -316,7 +336,7 @@ bpf_jit_compile(struct bpf_insn *prog, u MOVrd(EDI, ECX); SUBrd(ESI, ECX); CMPid(sizeof(int16_t), ECX); - if (flag_mem) { + if (fmem) { JAEb(2); LEAVE(); } else @@ -335,7 +355,7 @@ bpf_jit_compile(struct bpf_insn *prog, u MOVrd(EDI, ECX); SUBrd(EDX, ECX); CMPrd(ESI, ECX); - if (flag_mem) { + if (fmem) { JAb(2); LEAVE(); } else @@ -349,7 +369,7 @@ bpf_jit_compile(struct bpf_insn *prog, u case BPF_LDX|BPF_MSH|BPF_B: MOVid(ins->k, ESI); CMPrd(EDI, ESI); - if (flag_mem) { + if (fmem) { JBb(4); ZEROrd(EAX); LEAVE(); @@ -475,7 +495,7 @@ bpf_jit_compile(struct bpf_insn *prog, u case BPF_ALU|BPF_DIV|BPF_X: TESTrd(EDX, EDX); - if (flag_mem) { + if (fmem) { JNEb(4); ZEROrd(EAX); LEAVE(); @@ -583,7 +603,7 @@ bpf_jit_compile(struct bpf_insn *prog, u * Modify the reference table to contain the offsets and * not the lengths of the instructions. */ - if (flag_jmp) + if (fjmp) for (i = 1; i < nins + 1; i++) stream.refs[i] += stream.refs[i - 1]; @@ -599,7 +619,7 @@ bpf_jit_compile(struct bpf_insn *prog, u * The reference table is needed only during compilation, * now we can free it. */ - if (flag_jmp) + if (fjmp) #ifdef _KERNEL free(stream.refs, M_BPFJIT); #else Modified: head/sys/amd64/amd64/bpf_jit_machdep.h ============================================================================== --- head/sys/amd64/amd64/bpf_jit_machdep.h Mon Nov 23 21:17:38 2009 (r199720) +++ head/sys/amd64/amd64/bpf_jit_machdep.h Mon Nov 23 22:23:19 2009 (r199721) @@ -86,12 +86,14 @@ #define BL 3 /* Optimization flags */ -#define BPF_JIT_FLAG_RET 0x01 -#define BPF_JIT_FLAG_JMP 0x02 -#define BPF_JIT_FLAG_MEM 0x04 +#define BPF_JIT_FRET 0x01 +#define BPF_JIT_FPKT 0x02 +#define BPF_JIT_FMEM 0x04 +#define BPF_JIT_FJMP 0x08 +#define BPF_JIT_FLEN 0x10 #define BPF_JIT_FLAG_ALL \ - (BPF_JIT_FLAG_JMP | BPF_JIT_FLAG_MEM) + (BPF_JIT_FPKT | BPF_JIT_FMEM | BPF_JIT_FJMP | BPF_JIT_FLEN) /* A stream of native binary code */ typedef struct bpf_bin_stream { Modified: head/sys/i386/i386/bpf_jit_machdep.c ============================================================================== --- head/sys/i386/i386/bpf_jit_machdep.c Mon Nov 23 21:17:38 2009 (r199720) +++ head/sys/i386/i386/bpf_jit_machdep.c Mon Nov 23 22:23:19 2009 (r199721) @@ -101,29 +101,45 @@ emit_code(bpf_bin_stream *stream, u_int static int bpf_jit_optimize(struct bpf_insn *prog, u_int nins) { - const struct bpf_insn *p; int flags; u_int i; /* Do we return immediately? */ if (BPF_CLASS(prog[0].code) == BPF_RET) - return (BPF_JIT_FLAG_RET); + return (BPF_JIT_FRET); for (flags = 0, i = 0; i < nins; i++) { - p = &prog[i]; - - /* Do we need reference table? */ - if ((flags & BPF_JIT_FLAG_JMP) == 0 && - BPF_CLASS(p->code) == BPF_JMP) - flags |= BPF_JIT_FLAG_JMP; - - /* Do we need scratch memory? */ - if ((flags & BPF_JIT_FLAG_MEM) == 0 && - (p->code == BPF_ST || p->code == BPF_STX || - p->code == (BPF_LD|BPF_MEM) || - p->code == (BPF_LDX|BPF_MEM))) - flags |= BPF_JIT_FLAG_MEM; - + switch (prog[i].code) { + case BPF_LD|BPF_W|BPF_ABS: + case BPF_LD|BPF_H|BPF_ABS: + case BPF_LD|BPF_B|BPF_ABS: + case BPF_LD|BPF_W|BPF_IND: + case BPF_LD|BPF_H|BPF_IND: + case BPF_LD|BPF_B|BPF_IND: + case BPF_LDX|BPF_MSH|BPF_B: + flags |= BPF_JIT_FPKT; + break; + case BPF_LD|BPF_MEM: + case BPF_LDX|BPF_MEM: + case BPF_ST: + case BPF_STX: + flags |= BPF_JIT_FMEM; + break; + case BPF_JMP|BPF_JA: + case BPF_JMP|BPF_JGT|BPF_K: + case BPF_JMP|BPF_JGE|BPF_K: + case BPF_JMP|BPF_JEQ|BPF_K: + case BPF_JMP|BPF_JSET|BPF_K: + case BPF_JMP|BPF_JGT|BPF_X: + case BPF_JMP|BPF_JGE|BPF_X: + case BPF_JMP|BPF_JEQ|BPF_X: + case BPF_JMP|BPF_JSET|BPF_X: + flags |= BPF_JIT_FJMP; + break; + case BPF_ALU|BPF_DIV|BPF_K: + flags |= BPF_JIT_FADK; + break; + } if (flags == BPF_JIT_FLAG_ALL) break; } @@ -139,35 +155,39 @@ bpf_jit_compile(struct bpf_insn *prog, u { bpf_bin_stream stream; struct bpf_insn *ins; - int flags, flag_ret, flag_jmp, flag_mem; + int flags, fret, fpkt, fmem, fjmp, fadk; + int save_esp; u_int i, pass; - flags = bpf_jit_optimize(prog, nins); - flag_ret = (flags & BPF_JIT_FLAG_RET) != 0; - flag_jmp = (flags & BPF_JIT_FLAG_JMP) != 0; - flag_mem = (flags & BPF_JIT_FLAG_MEM) != 0; - /* * NOTE: Do not modify the name of this variable, as it's used by * the macros to emit code. */ emit_func emitm; + flags = bpf_jit_optimize(prog, nins); + fret = (flags & BPF_JIT_FRET) != 0; + fpkt = (flags & BPF_JIT_FPKT) != 0; + fmem = (flags & BPF_JIT_FMEM) != 0; + fjmp = (flags & BPF_JIT_FJMP) != 0; + fadk = (flags & BPF_JIT_FADK) != 0; + save_esp = (fpkt || fmem || fadk); /* Stack is used. */ + + if (fret) + nins = 1; + memset(&stream, 0, sizeof(stream)); /* Allocate the reference table for the jumps. */ - if (flag_jmp) { + if (fjmp) { #ifdef _KERNEL stream.refs = malloc((nins + 1) * sizeof(u_int), M_BPFJIT, M_NOWAIT | M_ZERO); #else - stream.refs = malloc((nins + 1) * sizeof(u_int)); + stream.refs = calloc(nins + 1, sizeof(u_int)); #endif if (stream.refs == NULL) return (NULL); -#ifndef _KERNEL - memset(stream.refs, 0, (nins + 1) * sizeof(u_int)); -#endif } /* @@ -180,15 +200,16 @@ bpf_jit_compile(struct bpf_insn *prog, u ins = prog; /* Create the procedure header. */ - if (!flag_ret) { + if (save_esp) { PUSH(EBP); MOVrd(ESP, EBP); } - if (flag_mem) + if (fmem) SUBib(BPF_MEMWORDS * sizeof(uint32_t), ESP); - if (!flag_ret) { - PUSH(EDI); + if (save_esp) PUSH(ESI); + if (fpkt) { + PUSH(EDI); PUSH(EBX); MOVodd(8, EBP, EBX); MOVodd(16, EBP, EDI); @@ -207,20 +228,24 @@ bpf_jit_compile(struct bpf_insn *prog, u case BPF_RET|BPF_K: MOVid(ins->k, EAX); - if (!flag_ret) { - POP(EBX); + if (save_esp) { + if (fpkt) { + POP(EBX); + POP(EDI); + } POP(ESI); - POP(EDI); LEAVE(); } RET(); break; case BPF_RET|BPF_A: - if (!flag_ret) { - POP(EBX); + if (save_esp) { + if (fpkt) { + POP(EBX); + POP(EDI); + } POP(ESI); - POP(EDI); LEAVE(); } RET(); @@ -236,8 +261,8 @@ bpf_jit_compile(struct bpf_insn *prog, u JAEb(7); ZEROrd(EAX); POP(EBX); - POP(ESI); POP(EDI); + POP(ESI); LEAVE(); RET(); MOVobd(EBX, ESI, EAX); @@ -254,8 +279,8 @@ bpf_jit_compile(struct bpf_insn *prog, u CMPid(sizeof(int16_t), ECX); JAEb(5); POP(EBX); - POP(ESI); POP(EDI); + POP(ESI); LEAVE(); RET(); MOVobw(EBX, ESI, AX); @@ -268,19 +293,29 @@ bpf_jit_compile(struct bpf_insn *prog, u CMPrd(EDI, ESI); JBb(5); POP(EBX); - POP(ESI); POP(EDI); + POP(ESI); LEAVE(); RET(); MOVobb(EBX, ESI, AL); break; case BPF_LD|BPF_W|BPF_LEN: - MOVodd(12, EBP, EAX); + if (save_esp) + MOVodd(12, EBP, EAX); + else { + MOVrd(ESP, ECX); + MOVodd(12, ECX, EAX); + } break; case BPF_LDX|BPF_W|BPF_LEN: - MOVodd(12, EBP, EDX); + if (save_esp) + MOVodd(12, EBP, EDX); + else { + MOVrd(ESP, ECX); + MOVodd(12, ECX, EDX); + } break; case BPF_LD|BPF_W|BPF_IND: @@ -298,8 +333,8 @@ bpf_jit_compile(struct bpf_insn *prog, u JAEb(7); ZEROrd(EAX); POP(EBX); - POP(ESI); POP(EDI); + POP(ESI); LEAVE(); RET(); MOVobd(EBX, ESI, EAX); @@ -321,8 +356,8 @@ bpf_jit_compile(struct bpf_insn *prog, u CMPid(sizeof(int16_t), ECX); JAEb(5); POP(EBX); - POP(ESI); POP(EDI); + POP(ESI); LEAVE(); RET(); MOVobw(EBX, ESI, AX); @@ -339,8 +374,8 @@ bpf_jit_compile(struct bpf_insn *prog, u CMPrd(ESI, ECX); JAb(5); POP(EBX); - POP(ESI); POP(EDI); + POP(ESI); LEAVE(); RET(); ADDrd(EDX, ESI); @@ -353,8 +388,8 @@ bpf_jit_compile(struct bpf_insn *prog, u JBb(7); ZEROrd(EAX); POP(EBX); - POP(ESI); POP(EDI); + POP(ESI); LEAVE(); RET(); ZEROrd(EDX); @@ -481,12 +516,22 @@ bpf_jit_compile(struct bpf_insn *prog, u case BPF_ALU|BPF_DIV|BPF_X: TESTrd(EDX, EDX); - JNEb(7); - ZEROrd(EAX); - POP(EBX); - POP(ESI); - POP(EDI); - LEAVE(); + if (save_esp) { + if (fpkt) { + JNEb(7); + ZEROrd(EAX); + POP(EBX); + POP(EDI); + } else { + JNEb(5); + ZEROrd(EAX); + } + POP(ESI); + LEAVE(); + } else { + JNEb(3); + ZEROrd(EAX); + } RET(); MOVrd(EDX, ECX); ZEROrd(EDX); @@ -587,7 +632,7 @@ bpf_jit_compile(struct bpf_insn *prog, u * Modify the reference table to contain the offsets and * not the lengths of the instructions. */ - if (flag_jmp) + if (fjmp) for (i = 1; i < nins + 1; i++) stream.refs[i] += stream.refs[i - 1]; @@ -603,7 +648,7 @@ bpf_jit_compile(struct bpf_insn *prog, u * The reference table is needed only during compilation, * now we can free it. */ - if (flag_jmp) + if (fjmp) #ifdef _KERNEL free(stream.refs, M_BPFJIT); #else Modified: head/sys/i386/i386/bpf_jit_machdep.h ============================================================================== --- head/sys/i386/i386/bpf_jit_machdep.h Mon Nov 23 21:17:38 2009 (r199720) +++ head/sys/i386/i386/bpf_jit_machdep.h Mon Nov 23 22:23:19 2009 (r199721) @@ -61,12 +61,14 @@ #define BL 3 /* Optimization flags */ -#define BPF_JIT_FLAG_RET 0x01 -#define BPF_JIT_FLAG_JMP 0x02 -#define BPF_JIT_FLAG_MEM 0x04 +#define BPF_JIT_FRET 0x01 +#define BPF_JIT_FPKT 0x02 +#define BPF_JIT_FMEM 0x04 +#define BPF_JIT_FJMP 0x08 +#define BPF_JIT_FADK 0x10 #define BPF_JIT_FLAG_ALL \ - (BPF_JIT_FLAG_JMP | BPF_JIT_FLAG_MEM) + (BPF_JIT_FPKT | BPF_JIT_FMEM | BPF_JIT_FJMP | BPF_JIT_FADK) /* A stream of native binary code */ typedef struct bpf_bin_stream { From owner-svn-src-all@FreeBSD.ORG Mon Nov 23 22:28:16 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 096371065679; Mon, 23 Nov 2009 22:28:16 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E9B398FC12; Mon, 23 Nov 2009 22:28:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nANMSFXk078234; Mon, 23 Nov 2009 22:28:15 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nANMSF7k078232; Mon, 23 Nov 2009 22:28:15 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <200911232228.nANMSF7k078232@svn.freebsd.org> From: Jung-uk Kim Date: Mon, 23 Nov 2009 22:28:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199722 - head/tools/regression/bpf/bpf_filter/tests X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Nov 2009 22:28:17 -0000 Author: jkim Date: Mon Nov 23 22:28:15 2009 New Revision: 199722 URL: http://svn.freebsd.org/changeset/base/199722 Log: Make this test case little bit more interesting. Modified: head/tools/regression/bpf/bpf_filter/tests/test0084.h Modified: head/tools/regression/bpf/bpf_filter/tests/test0084.h ============================================================================== --- head/tools/regression/bpf/bpf_filter/tests/test0084.h Mon Nov 23 22:23:19 2009 (r199721) +++ head/tools/regression/bpf/bpf_filter/tests/test0084.h Mon Nov 23 22:28:15 2009 (r199722) @@ -6,1005 +6,1005 @@ /* BPF program */ struct bpf_insn pc[] = { + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), + BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon Nov 23 23:23:06 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 19680106568B; Mon, 23 Nov 2009 23:23:06 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 089178FC08; Mon, 23 Nov 2009 23:23:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nANNN5XI084112; Mon, 23 Nov 2009 23:23:05 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nANNN5gl084110; Mon, 23 Nov 2009 23:23:05 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <200911232323.nANNN5gl084110@svn.freebsd.org> From: Marcel Moolenaar Date: Mon, 23 Nov 2009 23:23:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199723 - head/sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Nov 2009 23:23:06 -0000 Author: marcel Date: Mon Nov 23 23:23:05 2009 New Revision: 199723 URL: http://svn.freebsd.org/changeset/base/199723 Log: Don't make MJUMPAGESIZE equal to PAGE_SIZE unconditionally. When PAGE_SIZE is 16K, MJUMPAGESIZE equals MJUM16BYTES and causes build breakages. For PAGE_SIZE < 2K, define MJUMPAGESIZE as MCLBYTES. For PAGE_SIZE > 8K, define MJUMPAGESIZE as 8K. Everywhere inbetween, define MJUMPAGESIZE as PAGE_SIZE. Thus MCLBYTES <= MJUMPAGESIZE <= 8KB. Modified: head/sys/sys/param.h Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Mon Nov 23 22:28:15 2009 (r199722) +++ head/sys/sys/param.h Mon Nov 23 23:23:05 2009 (r199723) @@ -144,7 +144,14 @@ #define MCLBYTES (1 << MCLSHIFT) /* size of an mbuf cluster */ -#define MJUMPAGESIZE PAGE_SIZE /* jumbo cluster 4k */ +#if PAGE_SIZE < 2048 +#define MJUMPAGESIZE MCLBYTES +#elif PAGE_SIZE <= 8192 +#define MJUMPAGESIZE PAGE_SIZE +#else +#define MJUMPAGESIZE (8 * 1024) +#endif + #define MJUM9BYTES (9 * 1024) /* jumbo cluster 9k */ #define MJUM16BYTES (16 * 1024) /* jumbo cluster 16k */ From owner-svn-src-all@FreeBSD.ORG Mon Nov 23 23:32:57 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BE162106566B for ; Mon, 23 Nov 2009 23:32:57 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from sippysoft.com (gk1.360sip.com [72.236.70.240]) by mx1.freebsd.org (Postfix) with ESMTP id 740FB8FC12 for ; Mon, 23 Nov 2009 23:32:57 +0000 (UTC) Received: from [192.168.1.38] (S0106005004e13421.vs.shawcable.net [70.71.167.197]) (authenticated bits=0) by sippysoft.com (8.14.3/8.14.3) with ESMTP id nANN3tGL022587 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 23 Nov 2009 15:03:57 -0800 (PST) (envelope-from sobomax@FreeBSD.org) Message-ID: <4B0B14D5.3090903@FreeBSD.org> Date: Mon, 23 Nov 2009 15:03:49 -0800 From: Maxim Sobolev Organization: Sippy Software, Inc. User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Joerg Sonnenberger References: <200911222050.nAMKoRYh029141@svn.freebsd.org> <20091123010511.GA14572@britannica.bec.de> In-Reply-To: <20091123010511.GA14572@britannica.bec.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-all@FreeBSD.org Subject: Re: svn commit: r199670 - head/sys/dev/bge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Nov 2009 23:32:57 -0000 Joerg Sonnenberger wrote: > On Sun, Nov 22, 2009 at 08:50:27PM +0000, Pyun YongHyeon wrote: >> Log: >> Fix two long standing bugs on bge(4). Most pre BCM5755 controllers >> have a DMA bug when buffer address crosses a multiple of the 4GB >> boundary(e.g. 4GB, 8GB, 12GB etc). > > Does this only affect transfers that *cross* a 4GB boundary or does it > also affect transfers that *end* at a 4GB boundary? E.g. if the mbuf > cluster starts at 0xffffff00 with size 0x100 -- will the DMA engine > stall happen or not? What about bce(4) driver? Could it be affected too? We've seen some periodic lookups with the bce machine under the load (7.2-release, 5708C). Installing the add-on intel pro-based card into the same machine resolved the issue for us. -Maxim From owner-svn-src-all@FreeBSD.ORG Tue Nov 24 01:35:21 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F140A1065692; Tue, 24 Nov 2009 01:35:21 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E12A48FC18; Tue, 24 Nov 2009 01:35:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAO1ZLSm087400; Tue, 24 Nov 2009 01:35:21 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAO1ZLbg087398; Tue, 24 Nov 2009 01:35:21 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <200911240135.nAO1ZLbg087398@svn.freebsd.org> From: Marcel Moolenaar Date: Tue, 24 Nov 2009 01:35:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199727 - head/sys/ia64/ia64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Nov 2009 01:35:22 -0000 Author: marcel Date: Tue Nov 24 01:35:21 2009 New Revision: 199727 URL: http://svn.freebsd.org/changeset/base/199727 Log: Improve upon revision 196196 by removing the newly added comment in the wrong place and instead add a KASSERT in the right place. Modified: head/sys/ia64/ia64/interrupt.c Modified: head/sys/ia64/ia64/interrupt.c ============================================================================== --- head/sys/ia64/ia64/interrupt.c Mon Nov 23 23:45:26 2009 (r199726) +++ head/sys/ia64/ia64/interrupt.c Tue Nov 24 01:35:21 2009 (r199727) @@ -145,8 +145,6 @@ interrupt(struct trapframe *tf) /* * Handle ExtINT interrupts by generating an INTA cycle to * read the vector. - * IPI_STOP_HARD is mapped to IPI_STOP so it is not necessary - * to add it to this switch-like construct. */ if (vector == 0) { inta = ib->ib_inta; @@ -226,6 +224,10 @@ interrupt(struct trapframe *tf) } else if (vector == ipi_vector[IPI_STOP]) { cpumask_t mybit = PCPU_GET(cpumask); + /* Make sure IPI_STOP_HARD is mapped to IPI_STOP. */ + KASSERT(IPI_STOP == IPI_STOP_HARD, + ("%s: IPI_STOP_HARD not handled.", __func__)); + savectx(PCPU_PTR(pcb)); atomic_set_int(&stopped_cpus, mybit); while ((started_cpus & mybit) == 0) From owner-svn-src-all@FreeBSD.ORG Tue Nov 24 03:17:00 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 934231065672; Tue, 24 Nov 2009 03:17:00 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7257D8FC08; Tue, 24 Nov 2009 03:17:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAO3H0Zr003554; Tue, 24 Nov 2009 03:17:00 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAO3H0P6003552; Tue, 24 Nov 2009 03:17:00 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <200911240317.nAO3H0P6003552@svn.freebsd.org> From: Marcel Moolenaar Date: Tue, 24 Nov 2009 03:17:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199729 - stable/8/sys/ia64/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Nov 2009 03:17:00 -0000 Author: marcel Date: Tue Nov 24 03:17:00 2009 New Revision: 199729 URL: http://svn.freebsd.org/changeset/base/199729 Log: MFC r198338: o Align function on a 32-byte boundary so that the core's front-end can deliver 2 bundles per cycle to the back-end. o Mark syscall stubs with a special unwind ABI tag so that unwind libraries know how to unwind. Modified: stable/8/sys/ia64/include/asm.h Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/ia64/include/asm.h ============================================================================== --- stable/8/sys/ia64/include/asm.h Tue Nov 24 01:44:11 2009 (r199728) +++ stable/8/sys/ia64/include/asm.h Tue Nov 24 03:17:00 2009 (r199729) @@ -61,7 +61,7 @@ */ #define ENTRY(_name_, _n_args_) \ .global _name_; \ - .align 16; \ + .align 32; \ .proc _name_; \ _name_:; \ .regstk _n_args_, 0, 0, 0; \ @@ -69,7 +69,7 @@ _name_:; \ #define ENTRY_NOPROFILE(_name_, _n_args_) \ .global _name_; \ - .align 16; \ + .align 32; \ .proc _name_; \ _name_:; \ .regstk _n_args_, 0, 0, 0 @@ -79,7 +79,7 @@ _name_:; \ * Declare a local leaf function. */ #define STATIC_ENTRY(_name_, _n_args_) \ - .align 16; \ + .align 32; \ .proc _name_; \ _name_:; \ .regstk _n_args_, 0, 0, 0 \ @@ -161,6 +161,10 @@ label: ASCIZ msg; \ #define SYSCALLNUM(name) SYS_ ## name #define CALLSYS_NOERROR(name) \ + .prologue ; \ + .unwabi @svr4, 'S' ; \ + .save rp, r0 ; \ + .body ; \ { .mmi ; \ alloc r9 = ar.pfs, 0, 0, 8, 0 ; \ mov r31 = ar.k5 ; \ From owner-svn-src-all@FreeBSD.ORG Tue Nov 24 03:23:41 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3F359106566B; Tue, 24 Nov 2009 03:23:41 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2DFD78FC1A; Tue, 24 Nov 2009 03:23:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAO3NeP1003821; Tue, 24 Nov 2009 03:23:41 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAO3NesL003820; Tue, 24 Nov 2009 03:23:40 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <200911240323.nAO3NesL003820@svn.freebsd.org> From: Marcel Moolenaar Date: Tue, 24 Nov 2009 03:23:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199730 - in stable/8/lib/libthr/arch/ia64: . ia64 include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Nov 2009 03:23:41 -0000 Author: marcel Date: Tue Nov 24 03:23:40 2009 New Revision: 199730 URL: http://svn.freebsd.org/changeset/base/199730 Log: MFC r198450: Implement _umtx_op_err() for ia64. Added: stable/8/lib/libthr/arch/ia64/ia64/_umtx_op_err.S - copied unchanged from r198450, head/lib/libthr/arch/ia64/ia64/_umtx_op_err.S Modified: stable/8/lib/libthr/arch/ia64/Makefile.inc stable/8/lib/libthr/arch/ia64/include/pthread_md.h Directory Properties: stable/8/lib/libthr/ (props changed) Modified: stable/8/lib/libthr/arch/ia64/Makefile.inc ============================================================================== --- stable/8/lib/libthr/arch/ia64/Makefile.inc Tue Nov 24 03:17:00 2009 (r199729) +++ stable/8/lib/libthr/arch/ia64/Makefile.inc Tue Nov 24 03:23:40 2009 (r199730) @@ -2,4 +2,4 @@ .PATH: ${.CURDIR}/arch/${MACHINE_ARCH}/${MACHINE_ARCH} -SRCS+= pthread_md.c +SRCS+= _umtx_op_err.S pthread_md.c Copied: stable/8/lib/libthr/arch/ia64/ia64/_umtx_op_err.S (from r198450, head/lib/libthr/arch/ia64/ia64/_umtx_op_err.S) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/lib/libthr/arch/ia64/ia64/_umtx_op_err.S Tue Nov 24 03:23:40 2009 (r199730, copy of r198450, head/lib/libthr/arch/ia64/ia64/_umtx_op_err.S) @@ -0,0 +1,35 @@ +/*- + * Copyright (c) 2009 Marcel Moolenaar + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 + +ENTRY(_umtx_op_err, 5) + CALLSYS_NOERROR(_umtx_op) + br.ret.sptk.few rp +END(_umtx_op_err) Modified: stable/8/lib/libthr/arch/ia64/include/pthread_md.h ============================================================================== --- stable/8/lib/libthr/arch/ia64/include/pthread_md.h Tue Nov 24 03:17:00 2009 (r199729) +++ stable/8/lib/libthr/arch/ia64/include/pthread_md.h Tue Nov 24 03:23:40 2009 (r199730) @@ -33,6 +33,8 @@ #define CPU_SPINWAIT +#define HAS__UMTX_OP_ERR 1 + #define DTV_OFFSET offsetof(struct tcb, tcb_dtv) /* From owner-svn-src-all@FreeBSD.ORG Tue Nov 24 03:28:36 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 10B98106566B; Tue, 24 Nov 2009 03:28:36 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F2B858FC08; Tue, 24 Nov 2009 03:28:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAO3SZqa003984; Tue, 24 Nov 2009 03:28:35 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAO3SZZ2003982; Tue, 24 Nov 2009 03:28:35 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <200911240328.nAO3SZZ2003982@svn.freebsd.org> From: Marcel Moolenaar Date: Tue, 24 Nov 2009 03:28:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199731 - stable/8/sys/ia64/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Nov 2009 03:28:36 -0000 Author: marcel Date: Tue Nov 24 03:28:35 2009 New Revision: 199731 URL: http://svn.freebsd.org/changeset/base/199731 Log: MFC r198452: Add PRINTF_BUFR_SIZE=128, since we have SMP by default. While here, fix tabulation. Modified: stable/8/sys/ia64/conf/GENERIC Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/ia64/conf/GENERIC ============================================================================== --- stable/8/sys/ia64/conf/GENERIC Tue Nov 24 03:23:40 2009 (r199730) +++ stable/8/sys/ia64/conf/GENERIC Tue Nov 24 03:28:35 2009 (r199731) @@ -37,13 +37,14 @@ options INET6 # IPv6 communications pr options INVARIANTS # Enable calls of extra sanity checking options INVARIANT_SUPPORT # required by INVARIANTS options KTRACE # ktrace(1) syscall trace support -options MAC # TrustedBSD MAC Framework +options MAC # TrustedBSD MAC Framework options MD_ROOT # MD usable as root device options MSDOSFS # MSDOS Filesystem options NFSCLIENT # Network Filesystem Client options NFSSERVER # Network Filesystem Server options NFSLOCKD # Network Lock Manager options NFS_ROOT # NFS usable as root device +options PRINTF_BUFR_SIZE=128 # Printf buffering to limit interspersion options PROCFS # Process filesystem (/proc) options PSEUDOFS # Pseudo-filesystem framework options SCHED_ULE # ULE scheduler @@ -60,7 +61,7 @@ options UFS_ACL # Support for access c options UFS_DIRHASH # Hash-based directory lookup scheme options UFS_GJOURNAL # Enable gjournal-based UFS journaling options _KPOSIX_PRIORITY_SCHEDULING # Posix P1003_1B RT extensions -options HWPMC_HOOKS # Necessary kernel hooks for hwpmc(4) +options HWPMC_HOOKS # Necessary kernel hooks for hwpmc(4) # Various "busses" device firewire # FireWire bus code From owner-svn-src-all@FreeBSD.ORG Tue Nov 24 03:32:42 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 700AD1065670; Tue, 24 Nov 2009 03:32:42 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5E44B8FC12; Tue, 24 Nov 2009 03:32:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAO3WgMH004133; Tue, 24 Nov 2009 03:32:42 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAO3WgnK004124; Tue, 24 Nov 2009 03:32:42 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <200911240332.nAO3WgnK004124@svn.freebsd.org> From: Marcel Moolenaar Date: Tue, 24 Nov 2009 03:32:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199732 - in stable/8/sys: conf ia64/ia64 ia64/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Nov 2009 03:32:42 -0000 Author: marcel Date: Tue Nov 24 03:32:42 2009 New Revision: 199732 URL: http://svn.freebsd.org/changeset/base/199732 Log: MFC r198733: Reimplement the lazy FP context switching... ...This change fixes the high FP inconsistency panics. Added: stable/8/sys/ia64/ia64/highfp.c - copied unchanged from r198733, head/sys/ia64/ia64/highfp.c Modified: stable/8/sys/conf/files.ia64 stable/8/sys/ia64/ia64/interrupt.c stable/8/sys/ia64/ia64/machdep.c stable/8/sys/ia64/ia64/trap.c stable/8/sys/ia64/ia64/vm_machdep.c stable/8/sys/ia64/include/md_var.h stable/8/sys/ia64/include/proc.h Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/conf/files.ia64 ============================================================================== --- stable/8/sys/conf/files.ia64 Tue Nov 24 03:28:35 2009 (r199731) +++ stable/8/sys/conf/files.ia64 Tue Nov 24 03:32:42 2009 (r199732) @@ -85,6 +85,7 @@ ia64/ia64/elf_machdep.c standard ia64/ia64/emulate.c standard ia64/ia64/exception.S standard ia64/ia64/gdb_machdep.c optional gdb +ia64/ia64/highfp.c standard ia64/ia64/in_cksum.c optional inet ia64/ia64/interrupt.c standard ia64/ia64/locore.S standard no-obj Copied: stable/8/sys/ia64/ia64/highfp.c (from r198733, head/sys/ia64/ia64/highfp.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/sys/ia64/ia64/highfp.c Tue Nov 24 03:32:42 2009 (r199732, copy of r198733, head/sys/ia64/ia64/highfp.c) @@ -0,0 +1,181 @@ +/*- + * Copyright (c) 2009 Marcel Moolenaar + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 + +static struct mtx ia64_highfp_mtx; + +static void +ia64_highfp_init(void *_) +{ + mtx_init(&ia64_highfp_mtx, "High FP lock", NULL, MTX_SPIN); +} +SYSINIT(ia64_highfp_init, SI_SUB_LOCK, SI_ORDER_ANY, ia64_highfp_init, NULL); + +#ifdef SMP +static int +ia64_highfp_ipi(struct pcpu *cpu) +{ + int error; + + ipi_send(cpu, IPI_HIGH_FP); + error = msleep_spin(&cpu->pc_fpcurthread, &ia64_highfp_mtx, + "High FP", 0); + return (error); +} +#endif + +int +ia64_highfp_drop(struct thread *td) +{ + struct pcb *pcb; + struct pcpu *cpu; + + pcb = td->td_pcb; + + mtx_lock_spin(&ia64_highfp_mtx); + cpu = pcb->pcb_fpcpu; + if (cpu != NULL) { + KASSERT(cpu->pc_fpcurthread == td, + ("cpu->pc_fpcurthread != td")); + td->td_frame->tf_special.psr |= IA64_PSR_DFH; + pcb->pcb_fpcpu = NULL; + cpu->pc_fpcurthread = NULL; + } + mtx_unlock_spin(&ia64_highfp_mtx); + + return ((cpu != NULL) ? 1 : 0); +} + +int +ia64_highfp_enable(struct thread *td, struct trapframe *tf) +{ + struct pcb *pcb; + struct pcpu *cpu; + struct thread *td1; + + pcb = td->td_pcb; + + mtx_lock_spin(&ia64_highfp_mtx); + KASSERT((tf->tf_special.psr & IA64_PSR_DFH) != 0, + ("(tf->tf_special.psr & IA64_PSR_DFH) == 0")); + cpu = pcb->pcb_fpcpu; +#ifdef SMP + if (cpu != NULL && cpu != pcpup) { + KASSERT(cpu->pc_fpcurthread == td, + ("cpu->pc_fpcurthread != td")); + ia64_highfp_ipi(cpu); + } +#endif + td1 = PCPU_GET(fpcurthread); + if (td1 != NULL && td1 != td) { + KASSERT(td1->td_pcb->pcb_fpcpu == pcpup, + ("td1->td_pcb->pcb_fpcpu != pcpup")); + save_high_fp(&td1->td_pcb->pcb_high_fp); + td1->td_frame->tf_special.psr |= IA64_PSR_DFH; + td1->td_pcb->pcb_fpcpu = NULL; + PCPU_SET(fpcurthread, NULL); + td1 = NULL; + } + if (td1 == NULL) { + KASSERT(pcb->pcb_fpcpu == NULL, ("pcb->pcb_fpcpu != NULL")); + KASSERT(PCPU_GET(fpcurthread) == NULL, + ("PCPU_GET(fpcurthread) != NULL")); + restore_high_fp(&pcb->pcb_high_fp); + PCPU_SET(fpcurthread, td); + pcb->pcb_fpcpu = pcpup; + tf->tf_special.psr &= ~IA64_PSR_MFH; + } + tf->tf_special.psr &= ~IA64_PSR_DFH; + mtx_unlock_spin(&ia64_highfp_mtx); + + return ((td1 != NULL) ? 1 : 0); +} + +int +ia64_highfp_save(struct thread *td) +{ + struct pcb *pcb; + struct pcpu *cpu; + + pcb = td->td_pcb; + + mtx_lock_spin(&ia64_highfp_mtx); + cpu = pcb->pcb_fpcpu; +#ifdef SMP + if (cpu != NULL && cpu != pcpup) { + KASSERT(cpu->pc_fpcurthread == td, + ("cpu->pc_fpcurthread != td")); + ia64_highfp_ipi(cpu); + } else +#endif + if (cpu != NULL) { + KASSERT(cpu->pc_fpcurthread == td, + ("cpu->pc_fpcurthread != td")); + save_high_fp(&pcb->pcb_high_fp); + td->td_frame->tf_special.psr |= IA64_PSR_DFH; + pcb->pcb_fpcpu = NULL; + cpu->pc_fpcurthread = NULL; + } + mtx_unlock_spin(&ia64_highfp_mtx); + + return ((cpu != NULL) ? 1 : 0); +} + +#ifdef SMP +int +ia64_highfp_save_ipi(void) +{ + struct thread *td; + + mtx_lock_spin(&ia64_highfp_mtx); + td = PCPU_GET(fpcurthread); + if (td != NULL) { + KASSERT(td->td_pcb->pcb_fpcpu == pcpup, + ("td->td_pcb->pcb_fpcpu != pcpup")); + save_high_fp(&td->td_pcb->pcb_high_fp); + td->td_frame->tf_special.psr |= IA64_PSR_DFH; + td->td_pcb->pcb_fpcpu = NULL; + PCPU_SET(fpcurthread, NULL); + } + mtx_unlock_spin(&ia64_highfp_mtx); + wakeup(&PCPU_GET(fpcurthread)); + + return ((td != NULL) ? 1 : 0); +} +#endif Modified: stable/8/sys/ia64/ia64/interrupt.c ============================================================================== --- stable/8/sys/ia64/ia64/interrupt.c Tue Nov 24 03:28:35 2009 (r199731) +++ stable/8/sys/ia64/ia64/interrupt.c Tue Nov 24 03:32:42 2009 (r199732) @@ -216,14 +216,7 @@ interrupt(struct trapframe *tf) asts[PCPU_GET(cpuid)]++; CTR1(KTR_SMP, "IPI_AST, cpuid=%d", PCPU_GET(cpuid)); } else if (vector == ipi_vector[IPI_HIGH_FP]) { - struct thread *thr = PCPU_GET(fpcurthread); - if (thr != NULL) { - mtx_lock_spin(&thr->td_md.md_highfp_mtx); - save_high_fp(&thr->td_pcb->pcb_high_fp); - thr->td_pcb->pcb_fpcpu = NULL; - PCPU_SET(fpcurthread, NULL); - mtx_unlock_spin(&thr->td_md.md_highfp_mtx); - } + ia64_highfp_save_ipi(); } else if (vector == ipi_vector[IPI_RENDEZVOUS]) { rdvs[PCPU_GET(cpuid)]++; CTR1(KTR_SMP, "IPI_RENDEZVOUS, cpuid=%d", PCPU_GET(cpuid)); Modified: stable/8/sys/ia64/ia64/machdep.c ============================================================================== --- stable/8/sys/ia64/ia64/machdep.c Tue Nov 24 03:28:35 2009 (r199731) +++ stable/8/sys/ia64/ia64/machdep.c Tue Nov 24 03:32:42 2009 (r199732) @@ -1467,81 +1467,6 @@ set_fpregs(struct thread *td, struct fpr return (0); } -/* - * High FP register functions. - */ - -int -ia64_highfp_drop(struct thread *td) -{ - struct pcb *pcb; - struct pcpu *cpu; - struct thread *thr; - - mtx_lock_spin(&td->td_md.md_highfp_mtx); - pcb = td->td_pcb; - cpu = pcb->pcb_fpcpu; - if (cpu == NULL) { - mtx_unlock_spin(&td->td_md.md_highfp_mtx); - return (0); - } - pcb->pcb_fpcpu = NULL; - thr = cpu->pc_fpcurthread; - cpu->pc_fpcurthread = NULL; - mtx_unlock_spin(&td->td_md.md_highfp_mtx); - - /* Post-mortem sanity checking. */ - KASSERT(thr == td, ("Inconsistent high FP state")); - return (1); -} - -int -ia64_highfp_save(struct thread *td) -{ - struct pcb *pcb; - struct pcpu *cpu; - struct thread *thr; - - /* Don't save if the high FP registers weren't modified. */ - if ((td->td_frame->tf_special.psr & IA64_PSR_MFH) == 0) - return (ia64_highfp_drop(td)); - - mtx_lock_spin(&td->td_md.md_highfp_mtx); - pcb = td->td_pcb; - cpu = pcb->pcb_fpcpu; - if (cpu == NULL) { - mtx_unlock_spin(&td->td_md.md_highfp_mtx); - return (0); - } -#ifdef SMP - if (td == curthread) - sched_pin(); - if (cpu != pcpup) { - mtx_unlock_spin(&td->td_md.md_highfp_mtx); - ipi_send(cpu, IPI_HIGH_FP); - if (td == curthread) - sched_unpin(); - while (pcb->pcb_fpcpu == cpu) - DELAY(100); - return (1); - } else { - save_high_fp(&pcb->pcb_high_fp); - if (td == curthread) - sched_unpin(); - } -#else - save_high_fp(&pcb->pcb_high_fp); -#endif - pcb->pcb_fpcpu = NULL; - thr = cpu->pc_fpcurthread; - cpu->pc_fpcurthread = NULL; - mtx_unlock_spin(&td->td_md.md_highfp_mtx); - - /* Post-mortem sanity cxhecking. */ - KASSERT(thr == td, ("Inconsistent high FP state")); - return (1); -} - void ia64_sync_icache(vm_offset_t va, vm_offset_t sz) { Modified: stable/8/sys/ia64/ia64/trap.c ============================================================================== --- stable/8/sys/ia64/ia64/trap.c Tue Nov 24 03:28:35 2009 (r199731) +++ stable/8/sys/ia64/ia64/trap.c Tue Nov 24 03:32:42 2009 (r199732) @@ -652,66 +652,10 @@ trap(int vector, struct trapframe *tf) break; case IA64_VEC_DISABLED_FP: { - struct pcpu *pcpu; - struct pcb *pcb; - struct thread *thr; - - /* Always fatal in kernel. Should never happen. */ - if (!user) + if (user) + ia64_highfp_enable(td, tf); + else trap_panic(vector, tf); - - sched_pin(); - thr = PCPU_GET(fpcurthread); - if (thr == td) { - /* - * Short-circuit handling the trap when this CPU - * already holds the high FP registers for this - * thread. We really shouldn't get the trap in the - * first place, but since it's only a performance - * issue and not a correctness issue, we emit a - * message for now, enable the high FP registers and - * return. - */ - printf("XXX: bogusly disabled high FP regs\n"); - tf->tf_special.psr &= ~IA64_PSR_DFH; - sched_unpin(); - goto out; - } else if (thr != NULL) { - mtx_lock_spin(&thr->td_md.md_highfp_mtx); - pcb = thr->td_pcb; - save_high_fp(&pcb->pcb_high_fp); - pcb->pcb_fpcpu = NULL; - PCPU_SET(fpcurthread, NULL); - mtx_unlock_spin(&thr->td_md.md_highfp_mtx); - thr = NULL; - } - - mtx_lock_spin(&td->td_md.md_highfp_mtx); - pcb = td->td_pcb; - pcpu = pcb->pcb_fpcpu; - -#ifdef SMP - if (pcpu != NULL) { - mtx_unlock_spin(&td->td_md.md_highfp_mtx); - ipi_send(pcpu, IPI_HIGH_FP); - while (pcb->pcb_fpcpu == pcpu) - DELAY(100); - mtx_lock_spin(&td->td_md.md_highfp_mtx); - pcpu = pcb->pcb_fpcpu; - thr = PCPU_GET(fpcurthread); - } -#endif - - if (thr == NULL && pcpu == NULL) { - restore_high_fp(&pcb->pcb_high_fp); - PCPU_SET(fpcurthread, td); - pcb->pcb_fpcpu = pcpup; - tf->tf_special.psr &= ~IA64_PSR_MFH; - tf->tf_special.psr &= ~IA64_PSR_DFH; - } - - mtx_unlock_spin(&td->td_md.md_highfp_mtx); - sched_unpin(); goto out; } Modified: stable/8/sys/ia64/ia64/vm_machdep.c ============================================================================== --- stable/8/sys/ia64/ia64/vm_machdep.c Tue Nov 24 03:28:35 2009 (r199731) +++ stable/8/sys/ia64/ia64/vm_machdep.c Tue Nov 24 03:32:42 2009 (r199732) @@ -120,14 +120,11 @@ cpu_thread_alloc(struct thread *td) sp -= sizeof(struct trapframe); td->td_frame = (struct trapframe *)sp; td->td_frame->tf_length = sizeof(struct trapframe); - mtx_init(&td->td_md.md_highfp_mtx, "High FP lock", NULL, MTX_SPIN); } void cpu_thread_free(struct thread *td) { - - mtx_destroy(&td->td_md.md_highfp_mtx); } void @@ -148,6 +145,8 @@ cpu_set_upcall(struct thread *td, struct struct pcb *pcb; struct trapframe *tf; + ia64_highfp_save(td0); + tf = td->td_frame; KASSERT(tf != NULL, ("foo")); bcopy(td0->td_frame, tf, sizeof(*tf)); Modified: stable/8/sys/ia64/include/md_var.h ============================================================================== --- stable/8/sys/ia64/include/md_var.h Tue Nov 24 03:28:35 2009 (r199731) +++ stable/8/sys/ia64/include/md_var.h Tue Nov 24 03:32:42 2009 (r199732) @@ -86,7 +86,9 @@ int ia64_emulate(struct trapframe *, str int ia64_flush_dirty(struct thread *, struct _special *); uint64_t ia64_get_hcdp(void); int ia64_highfp_drop(struct thread *); +int ia64_highfp_enable(struct thread *, struct trapframe *); int ia64_highfp_save(struct thread *); +int ia64_highfp_save_ipi(void); struct ia64_init_return ia64_init(void); void ia64_probe_sapics(void); void ia64_sync_icache(vm_offset_t, vm_size_t); Modified: stable/8/sys/ia64/include/proc.h ============================================================================== --- stable/8/sys/ia64/include/proc.h Tue Nov 24 03:28:35 2009 (r199731) +++ stable/8/sys/ia64/include/proc.h Tue Nov 24 03:32:42 2009 (r199732) @@ -30,7 +30,6 @@ #define _MACHINE_PROC_H_ struct mdthread { - struct mtx md_highfp_mtx; int md_spinlock_count; /* (k) */ int md_saved_intr; /* (k) */ }; From owner-svn-src-all@FreeBSD.ORG Tue Nov 24 03:38:42 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9A111106566C; Tue, 24 Nov 2009 03:38:42 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 89D008FC08; Tue, 24 Nov 2009 03:38:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAO3cgok004369; Tue, 24 Nov 2009 03:38:42 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAO3cgM9004367; Tue, 24 Nov 2009 03:38:42 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <200911240338.nAO3cgM9004367@svn.freebsd.org> From: Marcel Moolenaar Date: Tue, 24 Nov 2009 03:38:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199733 - stable/8/sys/nfsserver X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Nov 2009 03:38:42 -0000 Author: marcel Date: Tue Nov 24 03:38:42 2009 New Revision: 199733 URL: http://svn.freebsd.org/changeset/base/199733 Log: MFC r199274, r199284: Fix an obvious panic by not casting from a pointer that is 4-bytes alignment to a type that needs 8-byte alignment, and thus causing misaligned memory references. Modified: stable/8/sys/nfsserver/nfs_fha.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/nfsserver/nfs_fha.c ============================================================================== --- stable/8/sys/nfsserver/nfs_fha.c Tue Nov 24 03:32:42 2009 (r199732) +++ stable/8/sys/nfsserver/nfs_fha.c Tue Nov 24 03:38:42 2009 (r199733) @@ -206,7 +206,7 @@ fha_extract_info(struct svc_req *req, st if (error) goto out; - i->fh = *(const u_int64_t *)(fh.fh_generic.fh_fid.fid_data); + bcopy(fh.fh_generic.fh_fid.fid_data, &i->fh, sizeof(i->fh)); /* Content ourselves with zero offset for all but reads. */ if (procnum != NFSPROC_READ) From owner-svn-src-all@FreeBSD.ORG Tue Nov 24 03:51:56 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 14DCD106568F for ; Tue, 24 Nov 2009 03:51:56 +0000 (UTC) (envelope-from max@love2party.net) Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.17.8]) by mx1.freebsd.org (Postfix) with ESMTP id 9D8F38FC0C for ; Tue, 24 Nov 2009 03:51:55 +0000 (UTC) Received: from vampire.homelinux.org (dslb-088-064-190-074.pools.arcor-ip.net [88.64.190.74]) by mrelayeu.kundenserver.de (node=mrbap0) with ESMTP (Nemesis) id 0M7lyK-1O81pA24qu-00vuoL; Tue, 24 Nov 2009 04:51:54 +0100 Received: (qmail 65458 invoked from network); 24 Nov 2009 03:51:47 -0000 Received: from kvm.laiers.local (HELO kvm.localnet) (192.168.4.188) by laiers.local with SMTP; 24 Nov 2009 03:51:47 -0000 From: Max Laier Organization: FreeBSD To: Marcel Moolenaar Date: Tue, 24 Nov 2009 04:51:45 +0100 User-Agent: KMail/1.12.3 (Linux/2.6.31-ARCH; KDE/4.3.3; x86_64; ; ) References: <200911240317.nAO3H0P6003552@svn.freebsd.org> In-Reply-To: <200911240317.nAO3H0P6003552@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <200911240451.46875.max@love2party.net> X-Provags-ID: V01U2FsdGVkX1/F7leDwuJw12PDNFyWsBcJZCjqI5bV09ysTmM pR6NH5QO3zMCqSblI0AGYnhNc1DXCPMjR3+XNNivaVEOuTHt67 AAf/UpWe67sgKIAncsMEA== Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org Subject: Re: svn commit: r199729 - stable/8/sys/ia64/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Nov 2009 03:51:56 -0000 On Tuesday 24 November 2009 04:17:00 Marcel Moolenaar wrote: > Author: marcel > Date: Tue Nov 24 03:17:00 2009 > New Revision: 199729 > URL: http://svn.freebsd.org/changeset/base/199729 > > Log: > MFC r198338: > o Align function on a 32-byte boundary so that the core's front-end > can deliver 2 bundles per cycle to the back-end. > o Mark syscall stubs with a special unwind ABI tag so that unwind > libraries know how to unwind. > > Modified: > stable/8/sys/ia64/include/asm.h > Directory Properties: > stable/8/sys/ (props changed) These MFCs seem to be missing mergeinfo for the contrib directories. -- /"\ Best regards, | mlaier@freebsd.org \ / Max Laier | ICQ #67774661 X http://pf4freebsd.love2party.net/ | mlaier@EFnet / \ ASCII Ribbon Campaign | Against HTML Mail and News From owner-svn-src-all@FreeBSD.ORG Tue Nov 24 04:17:34 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1C4CF106566B; Tue, 24 Nov 2009 04:17:34 +0000 (UTC) (envelope-from xcllnt@mac.com) Received: from asmtpout027.mac.com (asmtpout027.mac.com [17.148.16.102]) by mx1.freebsd.org (Postfix) with ESMTP id 0284E8FC1E; Tue, 24 Nov 2009 04:17:33 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; charset=us-ascii Received: from macbook-pro.lan.xcllnt.net (mail.xcllnt.net [75.101.29.67]) by asmtp027.mac.com (Sun Java(tm) System Messaging Server 6.3-8.01 (built Dec 16 2008; 32bit)) with ESMTPSA id <0KTL001NFIKCBM30@asmtp027.mac.com>; Mon, 23 Nov 2009 20:17:02 -0800 (PST) From: Marcel Moolenaar In-reply-to: <200911240451.46875.max@love2party.net> Date: Mon, 23 Nov 2009 20:17:00 -0800 Message-id: <85603446-C587-4AD5-91B0-653D106117BF@mac.com> References: <200911240317.nAO3H0P6003552@svn.freebsd.org> <200911240451.46875.max@love2party.net> To: Max Laier X-Mailer: Apple Mail (2.1077) Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, Marcel Moolenaar , src-committers@freebsd.org, svn-src-stable-8@freebsd.org Subject: Re: svn commit: r199729 - stable/8/sys/ia64/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Nov 2009 04:17:34 -0000 On Nov 23, 2009, at 7:51 PM, Max Laier wrote: >> Modified: >> stable/8/sys/ia64/include/asm.h >> Directory Properties: >> stable/8/sys/ (props changed) > > These MFCs seem to be missing mergeinfo for the contrib directories. I pruned them. We don't seem to get rid of merge into in the wrong directories even even people try to clean it up... -- Marcel Moolenaar xcllnt@mac.com From owner-svn-src-all@FreeBSD.ORG Tue Nov 24 07:17:52 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 11659106568B; Tue, 24 Nov 2009 07:17:52 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 002078FC1C; Tue, 24 Nov 2009 07:17:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAO7HpNV008838; Tue, 24 Nov 2009 07:17:51 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAO7Hp2u008835; Tue, 24 Nov 2009 07:17:51 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200911240717.nAO7Hp2u008835@svn.freebsd.org> From: Kip Macy Date: Tue, 24 Nov 2009 07:17:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199734 - in head/sys: dev/xen/blkfront i386/xen X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Nov 2009 07:17:52 -0000 Author: kmacy Date: Tue Nov 24 07:17:51 2009 New Revision: 199734 URL: http://svn.freebsd.org/changeset/base/199734 Log: fixup kernel core dumps on paravirtual guests Modified: head/sys/dev/xen/blkfront/blkfront.c head/sys/i386/xen/pmap.c Modified: head/sys/dev/xen/blkfront/blkfront.c ============================================================================== --- head/sys/dev/xen/blkfront/blkfront.c Tue Nov 24 03:38:42 2009 (r199733) +++ head/sys/dev/xen/blkfront/blkfront.c Tue Nov 24 07:17:51 2009 (r199734) @@ -325,7 +325,7 @@ xb_quiesce(struct blkfront_info *info) } if (blkif_queued_requests) { // Still pending requests, wait for the disk i/o to complete - HYPERVISOR_block(); + HYPERVISOR_yield(); } } } Modified: head/sys/i386/xen/pmap.c ============================================================================== --- head/sys/i386/xen/pmap.c Tue Nov 24 03:38:42 2009 (r199733) +++ head/sys/i386/xen/pmap.c Tue Nov 24 07:17:51 2009 (r199734) @@ -3103,7 +3103,7 @@ pmap_kenter_temporary(vm_paddr_t pa, int vm_offset_t va; va = (vm_offset_t)crashdumpmap + (i * PAGE_SIZE); - pmap_kenter(va, pa); + PT_SET_MA(va, (pa & ~PAGE_MASK) | PG_V | pgeflag); invlpg(va); return ((void *)crashdumpmap); } From owner-svn-src-all@FreeBSD.ORG Tue Nov 24 07:18:39 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3A85A106568B; Tue, 24 Nov 2009 07:18:39 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 29A678FC0A; Tue, 24 Nov 2009 07:18:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAO7IdXR008888; Tue, 24 Nov 2009 07:18:39 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAO7Id0O008886; Tue, 24 Nov 2009 07:18:39 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200911240718.nAO7Id0O008886@svn.freebsd.org> From: Kip Macy Date: Tue, 24 Nov 2009 07:18:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199735 - head/sys/dev/xen/console X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Nov 2009 07:18:39 -0000 Author: kmacy Date: Tue Nov 24 07:18:38 2009 New Revision: 199735 URL: http://svn.freebsd.org/changeset/base/199735 Log: remove annoying printf that cripples kdb on PV guests Modified: head/sys/dev/xen/console/console.c Modified: head/sys/dev/xen/console/console.c ============================================================================== --- head/sys/dev/xen/console/console.c Tue Nov 24 07:17:51 2009 (r199734) +++ head/sys/dev/xen/console/console.c Tue Nov 24 07:18:38 2009 (r199735) @@ -132,7 +132,6 @@ xc_cngetc(struct consdev *dev) CN_LOCK(cn_mtx); if ((rp - rc)) { - /* if (kdb_active) printf("%s:%d\n", __func__, __LINE__); */ /* we need to return only one char */ ret = (int)rbuf[RBUF_MASK(rc)]; rc++; From owner-svn-src-all@FreeBSD.ORG Tue Nov 24 08:14:22 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D244D106566C; Tue, 24 Nov 2009 08:14:22 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C10708FC16; Tue, 24 Nov 2009 08:14:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAO8EMB3010238; Tue, 24 Nov 2009 08:14:22 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAO8EMuG010236; Tue, 24 Nov 2009 08:14:22 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <200911240814.nAO8EMuG010236@svn.freebsd.org> From: Christian Brueffer Date: Tue, 24 Nov 2009 08:14:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199739 - head/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Nov 2009 08:14:22 -0000 Author: brueffer Date: Tue Nov 24 08:14:22 2009 New Revision: 199739 URL: http://svn.freebsd.org/changeset/base/199739 Log: LSI MegaRAID 9260 works, sort the hardware list while here. Submitted by: Jason MFC after: 3 days Modified: head/share/man/man4/mfi.4 Modified: head/share/man/man4/mfi.4 ============================================================================== --- head/share/man/man4/mfi.4 Tue Nov 24 07:50:19 2009 (r199738) +++ head/share/man/man4/mfi.4 Tue Nov 24 08:14:22 2009 (r199739) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 15, 2009 +.Dd November 24, 2009 .Dt MFI 4 .Os .Sh NAME @@ -79,11 +79,13 @@ driver supports the following hardware: .Pp .Bl -bullet -compact .It +LSI MegaRAID SAS 1078 +.It LSI MegaRAID SAS 8408E .It LSI MegaRAID SAS 8480E .It -LSI MegaRAID SAS 1078 +LSI MegaRAID SAS 9260 .It Dell PERC5 .It From owner-svn-src-all@FreeBSD.ORG Tue Nov 24 09:10:43 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AFA15106566B; Tue, 24 Nov 2009 09:10:43 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9DAC58FC12; Tue, 24 Nov 2009 09:10:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAO9Ah4M011633; Tue, 24 Nov 2009 09:10:43 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAO9Ah0p011631; Tue, 24 Nov 2009 09:10:43 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200911240910.nAO9Ah0p011631@svn.freebsd.org> From: Alexander Motin Date: Tue, 24 Nov 2009 09:10:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199743 - stable/8/sys/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Nov 2009 09:10:43 -0000 Author: mav Date: Tue Nov 24 09:10:43 2009 New Revision: 199743 URL: http://svn.freebsd.org/changeset/base/199743 Log: MFC r199535: Tune CAM ATA kernel options a bit. Move PMP support from da to scbus and add ada device option, according to man page. Modified: stable/8/sys/conf/files Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/conf/files ============================================================================== --- stable/8/sys/conf/files Tue Nov 24 08:35:11 2009 (r199742) +++ stable/8/sys/conf/files Tue Nov 24 09:10:43 2009 (r199743) @@ -112,12 +112,12 @@ cam/cam_sim.c optional scbus cam/cam_xpt.c optional scbus cam/ata/ata_all.c optional scbus cam/ata/ata_xpt.c optional scbus +cam/ata/ata_pmp.c optional scbus cam/scsi/scsi_xpt.c optional scbus cam/scsi/scsi_all.c optional scbus cam/scsi/scsi_cd.c optional cd cam/scsi/scsi_ch.c optional ch -cam/ata/ata_da.c optional da -cam/ata/ata_pmp.c optional da +cam/ata/ata_da.c optional ada | da cam/scsi/scsi_da.c optional da cam/scsi/scsi_low.c optional ct | ncv | nsp | stg cam/scsi/scsi_low_pisa.c optional ct | ncv | nsp | stg From owner-svn-src-all@FreeBSD.ORG Tue Nov 24 09:13:16 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 57ED8106566C; Tue, 24 Nov 2009 09:13:16 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3B37E8FC14; Tue, 24 Nov 2009 09:13:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAO9DGZO011749; Tue, 24 Nov 2009 09:13:16 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAO9DGAU011746; Tue, 24 Nov 2009 09:13:16 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200911240913.nAO9DGAU011746@svn.freebsd.org> From: Alexander Motin Date: Tue, 24 Nov 2009 09:13:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199744 - stable/8/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Nov 2009 09:13:16 -0000 Author: mav Date: Tue Nov 24 09:13:15 2009 New Revision: 199744 URL: http://svn.freebsd.org/changeset/base/199744 Log: MFC r199532: Add ada(4) man page. Added: stable/8/share/man/man4/ada.4 - copied unchanged from r199532, head/share/man/man4/ada.4 Modified: stable/8/share/man/man4/Makefile Directory Properties: stable/8/share/man/man4/ (props changed) Modified: stable/8/share/man/man4/Makefile ============================================================================== --- stable/8/share/man/man4/Makefile Tue Nov 24 09:10:43 2009 (r199743) +++ stable/8/share/man/man4/Makefile Tue Nov 24 09:13:15 2009 (r199744) @@ -15,6 +15,7 @@ MAN= aac.4 \ ${_acpi_toshiba.4} \ acpi_video.4 \ ${_acpi_wmi.4} \ + ada.4 \ adv.4 \ adw.4 \ ae.4 \ Copied: stable/8/share/man/man4/ada.4 (from r199532, head/share/man/man4/ada.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/share/man/man4/ada.4 Tue Nov 24 09:13:15 2009 (r199744, copy of r199532, head/share/man/man4/ada.4) @@ -0,0 +1,138 @@ +.\" Copyright (c) 2009 Alexander Motin +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd November 19, 2009 +.Dt ADA 4 +.Os +.Sh NAME +.Nm ada +.Nd ATA Direct Access device driver +.Sh SYNOPSIS +.Cd device ada +.Sh DESCRIPTION +The +.Nm +driver provides support for direct access devices, implementing +.Tn ATA +command protocol, that are attached to the system through a host adapter +supported by CAM subsystem. +.Pp +Host adapter must also be separately configured into the system before a +.Tn ATA +direct access device can be configured. +.Sh COMMAND QUEUING +Command queueing allows the device to process multiple transactions +concurrently, often re-ordering them to reduce the number and length of +seeks. +.Tn ATA +defines two types of queueing: +.Tn TCQ (Tagged Command Queueing, PATA legacy) +and +.Tn NCQ (Native Command Queueing, SATA). +The +.Nm +device driver takes full advantage of the NCQ, when supported. +To ensure that transactions to distant portions of the media, +which may be deferred indefinitely by servicing requests nearer the current +head position, are completed in a timely fashion, an ordered +transaction is sent every 7 seconds during continuous device operation. +.Sh CACHE EFFECTS +Many direct access devices are equipped with read and/or write caches. +Parameters affecting the device's cache are reported in device IDENTIFY data +and can be examined and modified via the +.Xr camcontrol 8 +utility. +.Pp +The read cache is used to store data from device-initiated read ahead +operations as well as frequently used data. +The read cache is transparent +to the user and can be enabled without any adverse effect. +Most devices +with a read cache come from the factory with it enabled. +.Pp +The write cache can greatly decrease the latency of write operations +and allows the device to reorganize writes to increase efficiency and +performance. +This performance gain comes at a price. +Should the device +lose power while its cache contains uncommitted write operations, these +writes will be lost. +The effect of a loss of write transactions on +a file system is non-deterministic and can cause corruption. +Most +devices age write transactions to limit vulnerability to a few transactions +recently reported as complete, but it is none-the-less recommended that +systems with write cache enabled devices reside on an Uninterruptible +Power Supply (UPS). +The +.Nm +device driver ensures that the cache and media are synchronized upon +final close of the device or an unexpected shutdown (panic) event. +This ensures that it is safe to disconnect power once the operating system +has reported that it has halted. +.Sh SYSCTL VARIABLES +The following variables are available as both +.Xr sysctl 8 +variables and +.Xr loader 8 +tunables: +.Bl -tag -width 12 +.It kern.cam.ada.retry_count +.Pp +This variable determines how many times the +.Nm +driver will retry a READ or WRITE command. +This does not affect the number of retries used during probe time or for +the +.Nm +driver dump routine. +This value currently defaults to 4. +.It kern.cam.ada.default_timeout +.Pp +This variable determines how long the +.Nm +driver will wait before timing out an outstanding command. +The units for this value are seconds, and the default is currently 30 +seconds. +.El +.Sh FILES +.Bl -tag -width ".Pa /dev/ada*" -compact +.It Pa /dev/ada* +ATA device nodes +.El +.Sh SEE ALSO +.Xr ahci 4 , +.Xr siis 4 , +.Xr ad 4 +.Xr da 4 +.Sh HISTORY +The +.Nm +driver first appeared in +.Fx 8.0 . +.Sh AUTHORS +.An Alexander Motin Aq mav@FreeBSD.org . From owner-svn-src-all@FreeBSD.ORG Tue Nov 24 09:16:47 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 71FDA10656A3; Tue, 24 Nov 2009 09:16:47 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 600DB8FC14; Tue, 24 Nov 2009 09:16:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAO9GlbZ011903; Tue, 24 Nov 2009 09:16:47 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAO9GlHc011901; Tue, 24 Nov 2009 09:16:47 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200911240916.nAO9GlHc011901@svn.freebsd.org> From: Alexander Motin Date: Tue, 24 Nov 2009 09:16:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199745 - stable/8/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Nov 2009 09:16:47 -0000 Author: mav Date: Tue Nov 24 09:16:47 2009 New Revision: 199745 URL: http://svn.freebsd.org/changeset/base/199745 Log: MFC r199247: Remove part that HDMI is not implemented. It had different meaning and confuse users. Extend BUGS section. Add some supported chipsets. Modified: stable/8/share/man/man4/snd_hda.4 Directory Properties: stable/8/share/man/man4/ (props changed) Modified: stable/8/share/man/man4/snd_hda.4 ============================================================================== --- stable/8/share/man/man4/snd_hda.4 Tue Nov 24 09:13:15 2009 (r199744) +++ stable/8/share/man/man4/snd_hda.4 Tue Nov 24 09:16:47 2009 (r199745) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 7, 2009 +.Dd November 13, 2009 .Dt SND_HDA 4 .Os .Sh NAME @@ -59,7 +59,7 @@ driver that allows the generic audio dri to be used with this hardware. Only audio functions are supported by .Nm . -Modem, HDMI and other possible functions are not implemented. +Modem and other possible functions are not implemented. .Pp The .Nm @@ -500,6 +500,14 @@ nVidia MCP68 .It nVidia MCP69 .It +nVidia MCP73 +.It +nVidia MCP78 +.It +nVidia MCP79 +.It +nVidia MCP89 +.It SiS 966 .It VIA VT8251/8237A @@ -626,5 +634,11 @@ trying to fix problem that way, make sur and the PCM audio device you are using really corresponds to expected audio connector. .Pp +Some vendors use non-standardized General Purpose I/O (GPIO) pins of codec +to control external amplifiers. In some cases setting proper combination of +GPIO bits may be needed to make sound work on specific device. +.Pp +HDMI and DisplayPort audio may also require support from video driver. +.Pp Due to OSS limitation multichannel (not multidevice) playback is not supported. From owner-svn-src-all@FreeBSD.ORG Tue Nov 24 10:46:17 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9F597106566B; Tue, 24 Nov 2009 10:46:17 +0000 (UTC) (envelope-from netchild@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8D76F8FC18; Tue, 24 Nov 2009 10:46:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAOAkH8R015026; Tue, 24 Nov 2009 10:46:17 GMT (envelope-from netchild@svn.freebsd.org) Received: (from netchild@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAOAkHcK015024; Tue, 24 Nov 2009 10:46:17 GMT (envelope-from netchild@svn.freebsd.org) Message-Id: <200911241046.nAOAkHcK015024@svn.freebsd.org> From: Alexander Leidinger Date: Tue, 24 Nov 2009 10:46:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199746 - stable/8/bin/ps X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Nov 2009 10:46:17 -0000 Author: netchild Date: Tue Nov 24 10:46:17 2009 New Revision: 199746 URL: http://svn.freebsd.org/changeset/base/199746 Log: MFC r199351: Fix small resource leak (memory). Reviewed by: gad Modified: stable/8/bin/ps/keyword.c Directory Properties: stable/8/bin/ps/ (props changed) Modified: stable/8/bin/ps/keyword.c ============================================================================== --- stable/8/bin/ps/keyword.c Tue Nov 24 09:16:47 2009 (r199745) +++ stable/8/bin/ps/keyword.c Tue Nov 24 10:46:17 2009 (r199746) @@ -330,6 +330,7 @@ findvar(char *p, int user, char **header errx(1, "malloc failed"); snprintf(realfmt, rflen, "%s=%s", v->alias, hp); parsefmt(realfmt, user); + free(realfmt); } return ((VAR *)NULL); } From owner-svn-src-all@FreeBSD.ORG Tue Nov 24 12:47:59 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 407C9106568D; Tue, 24 Nov 2009 12:47:59 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2D0F78FC22; Tue, 24 Nov 2009 12:47:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAOClxwF017433; Tue, 24 Nov 2009 12:47:59 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAOClwow017421; Tue, 24 Nov 2009 12:47:58 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200911241247.nAOClwow017421@svn.freebsd.org> From: Alexander Motin Date: Tue, 24 Nov 2009 12:47:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199747 - in head: sbin/camcontrol sys/cam sys/cam/ata sys/dev/ahci sys/dev/siis X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Nov 2009 12:47:59 -0000 Author: mav Date: Tue Nov 24 12:47:58 2009 New Revision: 199747 URL: http://svn.freebsd.org/changeset/base/199747 Log: MFp4: - Extend XPT-SIM transfer settings control API. Now it allows to report to SATA SIM number of tags supported by each device, implement ATA mode and SATA revision negotiation for both SATA and PATA SIMs. - Make ahci(4) and siis(4) to use submitted maximum tag number, when scheduling requests. It allows to support NCQ on devices with lower tags count then controller supports. - Make PMP driver to report attached devices connection speeds. - Implement ATA mode negotiation between user settings, device and controller capabilities. Modified: head/sbin/camcontrol/camcontrol.c head/sys/cam/ata/ata_all.c head/sys/cam/ata/ata_all.h head/sys/cam/ata/ata_pmp.c head/sys/cam/ata/ata_xpt.c head/sys/cam/cam_ccb.h head/sys/cam/cam_xpt.c head/sys/dev/ahci/ahci.c head/sys/dev/ahci/ahci.h head/sys/dev/siis/siis.c head/sys/dev/siis/siis.h Modified: head/sbin/camcontrol/camcontrol.c ============================================================================== --- head/sbin/camcontrol/camcontrol.c Tue Nov 24 10:46:17 2009 (r199746) +++ head/sbin/camcontrol/camcontrol.c Tue Nov 24 12:47:58 2009 (r199747) @@ -226,6 +226,12 @@ static int scsireadcapacity(struct cam_d static int atapm(struct cam_device *device, int argc, char **argv, char *combinedopt, int retry_count, int timeout); #endif /* MINIMALISTIC */ +#ifndef min +#define min(a,b) (((a)<(b))?(a):(b)) +#endif +#ifndef max +#define max(a,b) (((a)>(b))?(a):(b)) +#endif camcontrol_optret getoption(char *arg, cam_cmdmask *cmdnum, cam_argmask *argnum, @@ -950,21 +956,27 @@ camxferrate(struct cam_device *device) if (sas->valid & CTS_SAS_VALID_SPEED) speed = sas->bitrate; + } else if (ccb->cts.transport == XPORT_ATA) { + struct ccb_trans_settings_ata *ata = + &ccb->cts.xport_specific.ata; + + if (ata->valid & CTS_ATA_VALID_MODE) + speed = ata_mode2speed(ata->mode); } else if (ccb->cts.transport == XPORT_SATA) { - struct ccb_trans_settings_sata *sata = + struct ccb_trans_settings_sata *sata = &ccb->cts.xport_specific.sata; - if (sata->valid & CTS_SATA_VALID_SPEED) - speed = sata->bitrate; + if (sata->valid & CTS_SATA_VALID_REVISION) + speed = ata_revision2speed(sata->revision); } mb = speed / 1000; if (mb > 0) { - fprintf(stdout, "%s%d: %d.%03dMB/s transfers ", + fprintf(stdout, "%s%d: %d.%03dMB/s transfers", device->device_name, device->dev_unit_num, mb, speed % 1000); } else { - fprintf(stdout, "%s%d: %dKB/s transfers ", + fprintf(stdout, "%s%d: %dKB/s transfers", device->device_name, device->dev_unit_num, speed); } @@ -975,7 +987,7 @@ camxferrate(struct cam_device *device) if (((spi->valid & CTS_SPI_VALID_SYNC_OFFSET) != 0) && (spi->sync_offset != 0)) - fprintf(stdout, "(%d.%03dMHz, offset %d", freq / 1000, + fprintf(stdout, " (%d.%03dMHz, offset %d", freq / 1000, freq % 1000, spi->sync_offset); if (((spi->valid & CTS_SPI_VALID_BUS_WIDTH) != 0) @@ -995,18 +1007,24 @@ camxferrate(struct cam_device *device) struct ccb_trans_settings_ata *ata = &ccb->cts.xport_specific.ata; - if (ata->valid & CTS_ATA_VALID_BYTECOUNT) { - fprintf(stdout, "(PIO size %dbytes)", - ata->bytecount); - } + printf(" ("); + if (ata->valid & CTS_ATA_VALID_MODE) + printf("%s, ", ata_mode2string(ata->mode)); + if (ata->valid & CTS_ATA_VALID_BYTECOUNT) + printf("PIO size %dbytes", ata->bytecount); + printf(")"); } else if (ccb->cts.transport == XPORT_SATA) { struct ccb_trans_settings_sata *sata = &ccb->cts.xport_specific.sata; - if (sata->valid & CTS_SATA_VALID_BYTECOUNT) { - fprintf(stdout, "(PIO size %dbytes)", - sata->bytecount); - } + printf(" ("); + if (sata->valid & CTS_SATA_VALID_REVISION) + printf("SATA %d.x, ", sata->revision); + if (sata->valid & CTS_SATA_VALID_MODE) + printf("%s, ", ata_mode2string(sata->mode)); + if (sata->valid & CTS_SATA_VALID_BYTECOUNT) + printf("PIO size %dbytes", sata->bytecount); + printf(")"); } if (ccb->cts.protocol == PROTO_SCSI) { @@ -2757,7 +2775,44 @@ cts_print(struct cam_device *device, str "enabled" : "disabled"); } } + if (cts->transport == XPORT_ATA) { + struct ccb_trans_settings_ata *ata = + &cts->xport_specific.ata; + + if ((ata->valid & CTS_ATA_VALID_MODE) != 0) { + fprintf(stdout, "%sATA mode: %s\n", pathstr, + ata_mode2string(ata->mode)); + } + if ((ata->valid & CTS_ATA_VALID_BYTECOUNT) != 0) { + fprintf(stdout, "%sPIO transaction length: %d\n", + pathstr, ata->bytecount); + } + } + if (cts->transport == XPORT_SATA) { + struct ccb_trans_settings_sata *sata = + &cts->xport_specific.sata; + if ((sata->valid & CTS_SATA_VALID_REVISION) != 0) { + fprintf(stdout, "%sSATA revision: %d.x\n", pathstr, + sata->revision); + } + if ((sata->valid & CTS_SATA_VALID_MODE) != 0) { + fprintf(stdout, "%sATA mode: %s\n", pathstr, + ata_mode2string(sata->mode)); + } + if ((sata->valid & CTS_SATA_VALID_BYTECOUNT) != 0) { + fprintf(stdout, "%sPIO transaction length: %d\n", + pathstr, sata->bytecount); + } + if ((sata->valid & CTS_SATA_VALID_PM) != 0) { + fprintf(stdout, "%sPMP presence: %d\n", pathstr, + sata->pm_present); + } + if ((sata->valid & CTS_SATA_VALID_TAGS) != 0) { + fprintf(stdout, "%sNumber of tags: %d\n", pathstr, + sata->tags); + } + } if (cts->protocol == PROTO_SCSI) { struct ccb_trans_settings_scsi *scsi= &cts->proto_specific.scsi; Modified: head/sys/cam/ata/ata_all.c ============================================================================== --- head/sys/cam/ata/ata_all.c Tue Nov 24 10:46:17 2009 (r199746) +++ head/sys/cam/ata/ata_all.c Tue Nov 24 12:47:58 2009 (r199747) @@ -491,22 +491,111 @@ ata_max_umode(struct ata_params *ap) } int -ata_max_mode(struct ata_params *ap, int mode, int maxmode) +ata_max_mode(struct ata_params *ap, int maxmode) { - if (maxmode && mode > maxmode) - mode = maxmode; + if (maxmode == 0) + maxmode = ATA_DMA_MAX; + if (maxmode >= ATA_UDMA0 && ata_max_umode(ap) > 0) + return (min(maxmode, ata_max_umode(ap))); + if (maxmode >= ATA_WDMA0 && ata_max_wmode(ap) > 0) + return (min(maxmode, ata_max_wmode(ap))); + return (min(maxmode, ata_max_pmode(ap))); +} - if (mode >= ATA_UDMA0 && ata_max_umode(ap) > 0) - return (min(mode, ata_max_umode(ap))); +char * +ata_mode2string(int mode) +{ + switch (mode) { + case -1: return "UNSUPPORTED"; + case 0: return "NONE"; + case ATA_PIO0: return "PIO0"; + case ATA_PIO1: return "PIO1"; + case ATA_PIO2: return "PIO2"; + case ATA_PIO3: return "PIO3"; + case ATA_PIO4: return "PIO4"; + case ATA_WDMA0: return "WDMA0"; + case ATA_WDMA1: return "WDMA1"; + case ATA_WDMA2: return "WDMA2"; + case ATA_UDMA0: return "UDMA0"; + case ATA_UDMA1: return "UDMA1"; + case ATA_UDMA2: return "UDMA2"; + case ATA_UDMA3: return "UDMA3"; + case ATA_UDMA4: return "UDMA4"; + case ATA_UDMA5: return "UDMA5"; + case ATA_UDMA6: return "UDMA6"; + default: + if (mode & ATA_DMA_MASK) + return "BIOSDMA"; + else + return "BIOSPIO"; + } +} - if (mode >= ATA_WDMA0 && ata_max_wmode(ap) > 0) - return (min(mode, ata_max_wmode(ap))); +u_int +ata_mode2speed(int mode) +{ + switch (mode) { + case ATA_PIO0: + default: + return (3300); + case ATA_PIO1: + return (5200); + case ATA_PIO2: + return (8300); + case ATA_PIO3: + return (11100); + case ATA_PIO4: + return (16700); + case ATA_WDMA0: + return (4200); + case ATA_WDMA1: + return (13300); + case ATA_WDMA2: + return (16700); + case ATA_UDMA0: + return (16700); + case ATA_UDMA1: + return (25000); + case ATA_UDMA2: + return (33300); + case ATA_UDMA3: + return (44400); + case ATA_UDMA4: + return (66700); + case ATA_UDMA5: + return (100000); + case ATA_UDMA6: + return (133000); + } +} - if (mode > ata_max_pmode(ap)) - return (min(mode, ata_max_pmode(ap))); +u_int +ata_revision2speed(int revision) +{ + switch (revision) { + case 1: + default: + return (150000); + case 2: + return (300000); + case 3: + return (600000); + } +} - return (mode); +int +ata_speed2revision(u_int speed) +{ + switch (speed) { + case 150000: + default: + return (1); + case 300000: + return (2); + case 600000: + return (3); + } } int Modified: head/sys/cam/ata/ata_all.h ============================================================================== --- head/sys/cam/ata/ata_all.h Tue Nov 24 10:46:17 2009 (r199746) +++ head/sys/cam/ata/ata_all.h Tue Nov 24 12:47:58 2009 (r199747) @@ -112,7 +112,12 @@ void ata_bpack(int8_t *src, int8_t *dst, int ata_max_pmode(struct ata_params *ap); int ata_max_wmode(struct ata_params *ap); int ata_max_umode(struct ata_params *ap); -int ata_max_mode(struct ata_params *ap, int mode, int maxmode); +int ata_max_mode(struct ata_params *ap, int maxmode); + +char * ata_mode2string(int mode); +u_int ata_mode2speed(int mode); +u_int ata_revision2speed(int revision); +int ata_speed2revision(u_int speed); int ata_identify_match(caddr_t identbuffer, caddr_t table_entry); int ata_static_identify_match(caddr_t identbuffer, caddr_t table_entry); Modified: head/sys/cam/ata/ata_pmp.c ============================================================================== --- head/sys/cam/ata/ata_pmp.c Tue Nov 24 10:46:17 2009 (r199746) +++ head/sys/cam/ata/ata_pmp.c Tue Nov 24 12:47:58 2009 (r199747) @@ -516,6 +516,7 @@ printf("PM RESET %d%s\n", softc->pm_step static void pmpdone(struct cam_periph *periph, union ccb *done_ccb) { + struct ccb_trans_settings cts; struct pmp_softc *softc; struct ccb_ataio *ataio; union ccb *work_ccb; @@ -635,6 +636,19 @@ pmpdone(struct cam_periph *periph, union done_ccb->ataio.res.sector_count; if ((res & 0xf0f) == 0x103 && (res & 0x0f0) != 0) { printf("PM status: %d - %08x\n", softc->pm_step, res); + /* Report device speed. */ + if (xpt_create_path(&dpath, periph, + xpt_path_path_id(periph->path), + softc->pm_step, 0) == CAM_REQ_CMP) { + bzero(&cts, sizeof(cts)); + xpt_setup_ccb(&cts.ccb_h, dpath, CAM_PRIORITY_NORMAL); + cts.ccb_h.func_code = XPT_SET_TRAN_SETTINGS; + cts.type = CTS_TYPE_CURRENT_SETTINGS; + cts.xport_specific.sata.revision = (res & 0x0f0) >> 4; + cts.xport_specific.sata.valid = CTS_SATA_VALID_REVISION; + xpt_action((union ccb *)&cts); + xpt_free_path(dpath); + } softc->found |= (1 << softc->pm_step); softc->pm_step++; } else { Modified: head/sys/cam/ata/ata_xpt.c ============================================================================== --- head/sys/cam/ata/ata_xpt.c Tue Nov 24 10:46:17 2009 (r199746) +++ head/sys/cam/ata/ata_xpt.c Tue Nov 24 12:47:58 2009 (r199747) @@ -275,7 +275,7 @@ probeschedule(struct cam_periph *periph) static void probestart(struct cam_periph *periph, union ccb *start_ccb) { - /* Probe the device that our peripheral driver points to */ + struct ccb_trans_settings cts; struct ccb_ataio *ataio; struct ccb_scsiio *csio; probe_softc *softc; @@ -333,6 +333,55 @@ probestart(struct cam_periph *periph, un ata_28bit_cmd(ataio, ATA_ATAPI_IDENTIFY, 0, 0, 0); break; case PROBE_SETMODE: + { + int mode, wantmode; + + mode = 0; + /* Fetch user modes from SIM. */ + bzero(&cts, sizeof(cts)); + xpt_setup_ccb(&cts.ccb_h, path, CAM_PRIORITY_NORMAL); + cts.ccb_h.func_code = XPT_GET_TRAN_SETTINGS; + cts.type = CTS_TYPE_USER_SETTINGS; + xpt_action((union ccb *)&cts); + if (path->device->transport == XPORT_ATA) { + if (cts.xport_specific.ata.valid & CTS_ATA_VALID_MODE) + mode = cts.xport_specific.ata.mode; + } else { + if (cts.xport_specific.ata.valid & CTS_SATA_VALID_MODE) + mode = cts.xport_specific.sata.mode; + } +negotiate: + /* Honor device capabilities. */ + wantmode = mode = ata_max_mode(ident_buf, mode); + /* Report modes to SIM. */ + bzero(&cts, sizeof(cts)); + xpt_setup_ccb(&cts.ccb_h, path, CAM_PRIORITY_NORMAL); + cts.ccb_h.func_code = XPT_SET_TRAN_SETTINGS; + cts.type = CTS_TYPE_CURRENT_SETTINGS; + if (path->device->transport == XPORT_ATA) { + cts.xport_specific.ata.mode = mode; + cts.xport_specific.ata.valid = CTS_ATA_VALID_MODE; + } else { + cts.xport_specific.sata.mode = mode; + cts.xport_specific.sata.valid = CTS_SATA_VALID_MODE; + } + xpt_action((union ccb *)&cts); + /* Fetch user modes from SIM. */ + bzero(&cts, sizeof(cts)); + xpt_setup_ccb(&cts.ccb_h, path, CAM_PRIORITY_NORMAL); + cts.ccb_h.func_code = XPT_GET_TRAN_SETTINGS; + cts.type = CTS_TYPE_CURRENT_SETTINGS; + xpt_action((union ccb *)&cts); + if (path->device->transport == XPORT_ATA) { + if (cts.xport_specific.ata.valid & CTS_ATA_VALID_MODE) + mode = cts.xport_specific.ata.mode; + } else { + if (cts.xport_specific.ata.valid & CTS_SATA_VALID_MODE) + mode = cts.xport_specific.sata.mode; + } + /* If SIM disagree - renegotiate. */ + if (mode != wantmode) + goto negotiate; cam_fill_ataio(ataio, 1, probedone, @@ -341,12 +390,11 @@ probestart(struct cam_periph *periph, un /*data_ptr*/NULL, /*dxfer_len*/0, 30 * 1000); - ata_28bit_cmd(ataio, ATA_SETFEATURES, ATA_SF_SETXFER, 0, - ata_max_mode(ident_buf, ATA_UDMA6, ATA_UDMA6)); + ata_28bit_cmd(ataio, ATA_SETFEATURES, ATA_SF_SETXFER, 0, mode); break; + } case PROBE_SET_MULTI: { - struct ccb_trans_settings cts; u_int sectors; sectors = max(1, min(ident_buf->sectors_intr & 0xff, 16)); @@ -564,6 +612,7 @@ proberequestbackoff(struct cam_periph *p static void probedone(struct cam_periph *periph, union ccb *done_ccb) { + struct ccb_trans_settings cts; struct ata_params *ident_buf; probe_softc *softc; struct cam_path *path; @@ -619,9 +668,7 @@ noerror: PROBE_SET_ACTION(softc, PROBE_IDENTIFY); } else if (sign == 0x9669 && done_ccb->ccb_h.target_id == 15) { - struct ccb_trans_settings cts; - - /* Report SIM that PM is present. */ + /* Report SIM that PM is present. */ bzero(&cts, sizeof(cts)); xpt_setup_ccb(&cts.ccb_h, path, CAM_PRIORITY_NORMAL); cts.ccb_h.func_code = XPT_SET_TRAN_SETTINGS; @@ -716,11 +763,17 @@ noerror: ATA_QUEUE_LEN(ident_buf->queue) + 1; } ata_find_quirk(path->device); - /* XXX: If not all tags allowed, we must to tell SIM which are. */ - if (path->device->mintags < path->bus->sim->max_tagged_dev_openings) - path->device->mintags = path->device->maxtags = 0; if (path->device->mintags != 0 && path->bus->sim->max_tagged_dev_openings != 0) { + /* Report SIM which tags are allowed. */ + bzero(&cts, sizeof(cts)); + xpt_setup_ccb(&cts.ccb_h, path, CAM_PRIORITY_NORMAL); + cts.ccb_h.func_code = XPT_SET_TRAN_SETTINGS; + cts.type = CTS_TYPE_CURRENT_SETTINGS; + cts.xport_specific.sata.tags = path->device->maxtags; + cts.xport_specific.sata.valid = CTS_SATA_VALID_TAGS; + xpt_action((union ccb *)&cts); + /* Reconfigure queues for tagged queueing. */ xpt_start_tags(path); } ata_device_transport(path); Modified: head/sys/cam/cam_ccb.h ============================================================================== --- head/sys/cam/cam_ccb.h Tue Nov 24 10:46:17 2009 (r199746) +++ head/sys/cam/cam_ccb.h Tue Nov 24 12:47:58 2009 (r199747) @@ -819,19 +819,23 @@ struct ccb_trans_settings_sas { struct ccb_trans_settings_ata { u_int valid; /* Which fields to honor */ #define CTS_ATA_VALID_MODE 0x01 -#define CTS_ATA_VALID_BYTECOUNT 0x04 - u_int32_t mode; +#define CTS_ATA_VALID_BYTECOUNT 0x02 + int mode; /* Mode */ u_int bytecount; /* Length of PIO transaction */ }; struct ccb_trans_settings_sata { u_int valid; /* Which fields to honor */ -#define CTS_SATA_VALID_SPEED 0x01 -#define CTS_SATA_VALID_PM 0x02 -#define CTS_SATA_VALID_BYTECOUNT 0x04 - u_int32_t bitrate; /* Mbps */ - u_int pm_present; /* PM is present (XPT->SIM) */ +#define CTS_SATA_VALID_MODE 0x01 +#define CTS_SATA_VALID_BYTECOUNT 0x02 +#define CTS_SATA_VALID_REVISION 0x04 +#define CTS_SATA_VALID_PM 0x08 +#define CTS_SATA_VALID_TAGS 0x10 + int mode; /* Legacy PATA mode */ u_int bytecount; /* Length of PIO transaction */ + u_int revision; /* SATA revision */ + u_int pm_present; /* PM is present (XPT->SIM) */ + u_int tags; /* Number of allowed tags */ }; /* Get/Set transfer rate/width/disconnection/tag queueing settings */ Modified: head/sys/cam/cam_xpt.c ============================================================================== --- head/sys/cam/cam_xpt.c Tue Nov 24 10:46:17 2009 (r199746) +++ head/sys/cam/cam_xpt.c Tue Nov 24 12:47:58 2009 (r199747) @@ -1140,12 +1140,19 @@ xpt_announce_periph(struct cam_periph *p if (sas->valid & CTS_SAS_VALID_SPEED) speed = sas->bitrate; } + if (cts.ccb_h.status == CAM_REQ_CMP && cts.transport == XPORT_ATA) { + struct ccb_trans_settings_ata *ata = + &cts.xport_specific.ata; + + if (ata->valid & CTS_ATA_VALID_MODE) + speed = ata_mode2speed(ata->mode); + } if (cts.ccb_h.status == CAM_REQ_CMP && cts.transport == XPORT_SATA) { struct ccb_trans_settings_sata *sata = &cts.xport_specific.sata; - if (sata->valid & CTS_SATA_VALID_SPEED) - speed = sata->bitrate; + if (sata->valid & CTS_SATA_VALID_REVISION) + speed = ata_revision2speed(sata->revision); } mb = speed / 1000; @@ -1195,15 +1202,25 @@ xpt_announce_periph(struct cam_periph *p struct ccb_trans_settings_ata *ata = &cts.xport_specific.ata; + printf(" ("); + if (ata->valid & CTS_ATA_VALID_MODE) + printf("%s, ", ata_mode2string(ata->mode)); if (ata->valid & CTS_ATA_VALID_BYTECOUNT) - printf(" (PIO size %dbytes)", ata->bytecount); + printf("PIO size %dbytes", ata->bytecount); + printf(")"); } if (cts.ccb_h.status == CAM_REQ_CMP && cts.transport == XPORT_SATA) { struct ccb_trans_settings_sata *sata = &cts.xport_specific.sata; + printf(" ("); + if (sata->valid & CTS_SATA_VALID_REVISION) + printf("SATA %d.x, ", sata->revision); + if (sata->valid & CTS_SATA_VALID_MODE) + printf("%s, ", ata_mode2string(sata->mode)); if (sata->valid & CTS_SATA_VALID_BYTECOUNT) - printf(" (PIO size %dbytes)", sata->bytecount); + printf("PIO size %dbytes", sata->bytecount); + printf(")"); } if (path->device->inq_flags & SID_CmdQue || path->device->flags & CAM_DEV_TAG_AFTER_COUNT) { Modified: head/sys/dev/ahci/ahci.c ============================================================================== --- head/sys/dev/ahci/ahci.c Tue Nov 24 10:46:17 2009 (r199746) +++ head/sys/dev/ahci/ahci.c Tue Nov 24 12:47:58 2009 (r199747) @@ -776,7 +776,7 @@ ahci_ch_attach(device_t dev) struct ahci_controller *ctlr = device_get_softc(device_get_parent(dev)); struct ahci_channel *ch = device_get_softc(dev); struct cam_devq *devq; - int rid, error; + int rid, error, i; ch->dev = dev; ch->unit = (intptr_t)device_get_ivars(dev); @@ -789,6 +789,13 @@ ahci_ch_attach(device_t dev) device_get_unit(dev), "pm_level", &ch->pm_level); if (ch->pm_level > 3) callout_init_mtx(&ch->pm_timer, &ch->mtx, 0); + for (i = 0; i < 16; i++) { + ch->user[i].revision = 0; + ch->user[i].mode = 0; + ch->user[i].bytecount = 8192; + ch->user[i].tags = ch->numslots; + ch->curr[i] = ch->user[i]; + } /* Limit speed for my onboard JMicron external port. * It is not eSATA really. */ if (pci_get_devid(ctlr->dev) == 0x2363197b && @@ -1275,6 +1282,10 @@ ahci_check_collision(device_t dev, union if (ch->numtslots != 0 && ch->taggedtarget != ccb->ccb_h.target_id) return (1); + /* Tagged command while we have no supported tag free. */ + if (((~ch->oslots) & (0xffffffff >> (32 - + ch->curr[ccb->ccb_h.target_id].tags))) == 0) + return (1); } else { /* Untagged command while tagged are active. */ if (ch->numrslots != 0 && ch->numtslots != 0) @@ -1298,15 +1309,21 @@ ahci_begin_transaction(device_t dev, uni { struct ahci_channel *ch = device_get_softc(dev); struct ahci_slot *slot; - int tag; + int tag, tags; /* Choose empty slot. */ + tags = ch->numslots; + if ((ccb->ccb_h.func_code == XPT_ATA_IO) && + (ccb->ataio.cmd.flags & CAM_ATAIO_FPDMA)) + tags = ch->curr[ccb->ccb_h.target_id].tags; tag = ch->lastslot; - while (ch->slot[tag].state != AHCI_SLOT_EMPTY) { - if (++tag >= ch->numslots) + while (1) { + if (tag >= tags) tag = 0; - KASSERT(tag != ch->lastslot, ("ahci: ALL SLOTS BUSY!")); - } + if (ch->slot[tag].state == AHCI_SLOT_EMPTY) + break; + tag++; + }; ch->lastslot = tag; /* Occupy chosen slot. */ slot = &ch->slot[tag]; @@ -1315,6 +1332,7 @@ ahci_begin_transaction(device_t dev, uni if (ch->numrslots == 0 && ch->pm_level > 3) callout_stop(&ch->pm_timer); /* Update channel stats. */ + ch->oslots |= (1 << slot->slot); ch->numrslots++; if ((ccb->ccb_h.func_code == XPT_ATA_IO) && (ccb->ataio.cmd.flags & CAM_ATAIO_FPDMA)) { @@ -1635,6 +1653,7 @@ ahci_end_transaction(struct ahci_slot *s ccb->ccb_h.status |= CAM_REQ_CMP_ERR; } /* Free slot. */ + ch->oslots &= ~(1 << slot->slot); ch->rslots &= ~(1 << slot->slot); ch->aslots &= ~(1 << slot->slot); slot->state = AHCI_SLOT_EMPTY; @@ -1664,7 +1683,7 @@ ahci_end_transaction(struct ahci_slot *s } else xpt_done(ccb); /* Unfreeze frozen command. */ - if (ch->frozen && ch->numrslots == 0) { + if (ch->frozen && !ahci_check_collision(dev, ch->frozen)) { union ccb *fccb = ch->frozen; ch->frozen = NULL; ahci_begin_transaction(dev, fccb); @@ -2125,10 +2144,22 @@ ahciaction(struct cam_sim *sim, union cc case XPT_SET_TRAN_SETTINGS: { struct ccb_trans_settings *cts = &ccb->cts; + struct ahci_device *d; - if (cts->xport_specific.sata.valid & CTS_SATA_VALID_PM) { + if (cts->type == CTS_TYPE_CURRENT_SETTINGS) + d = &ch->curr[ccb->ccb_h.target_id]; + else + d = &ch->user[ccb->ccb_h.target_id]; + if (cts->xport_specific.sata.valid & CTS_SATA_VALID_REVISION) + d->revision = cts->xport_specific.sata.revision; + if (cts->xport_specific.sata.valid & CTS_SATA_VALID_MODE) + d->mode = cts->xport_specific.sata.mode; + if (cts->xport_specific.sata.valid & CTS_SATA_VALID_BYTECOUNT) + d->bytecount = min(8192, cts->xport_specific.sata.bytecount); + if (cts->xport_specific.sata.valid & CTS_SATA_VALID_TAGS) + d->tags = min(ch->numslots, cts->xport_specific.sata.tags); + if (cts->xport_specific.sata.valid & CTS_SATA_VALID_PM) ch->pm_present = cts->xport_specific.sata.pm_present; - } ccb->ccb_h.status = CAM_REQ_CMP; xpt_done(ccb); break; @@ -2137,36 +2168,41 @@ ahciaction(struct cam_sim *sim, union cc /* Get default/user set transfer settings for the target */ { struct ccb_trans_settings *cts = &ccb->cts; + struct ahci_device *d; uint32_t status; + if (cts->type == CTS_TYPE_CURRENT_SETTINGS) + d = &ch->curr[ccb->ccb_h.target_id]; + else + d = &ch->user[ccb->ccb_h.target_id]; cts->protocol = PROTO_ATA; cts->protocol_version = PROTO_VERSION_UNSPECIFIED; cts->transport = XPORT_SATA; cts->transport_version = XPORT_VERSION_UNSPECIFIED; cts->proto_specific.valid = 0; cts->xport_specific.sata.valid = 0; - if (cts->type == CTS_TYPE_CURRENT_SETTINGS) + if (cts->type == CTS_TYPE_CURRENT_SETTINGS && + (ccb->ccb_h.target_id == 15 || + (ccb->ccb_h.target_id == 0 && !ch->pm_present))) { status = ATA_INL(ch->r_mem, AHCI_P_SSTS) & ATA_SS_SPD_MASK; - else - status = ATA_INL(ch->r_mem, AHCI_P_SCTL) & ATA_SC_SPD_MASK; - if (status & ATA_SS_SPD_GEN3) { - cts->xport_specific.sata.bitrate = 600000; - cts->xport_specific.sata.valid |= CTS_SATA_VALID_SPEED; - } else if (status & ATA_SS_SPD_GEN2) { - cts->xport_specific.sata.bitrate = 300000; - cts->xport_specific.sata.valid |= CTS_SATA_VALID_SPEED; - } else if (status & ATA_SS_SPD_GEN1) { - cts->xport_specific.sata.bitrate = 150000; - cts->xport_specific.sata.valid |= CTS_SATA_VALID_SPEED; - } - if (cts->type == CTS_TYPE_CURRENT_SETTINGS) { - cts->xport_specific.sata.pm_present = - (ATA_INL(ch->r_mem, AHCI_P_CMD) & AHCI_P_CMD_PMA) ? - 1 : 0; + if (status & 0x0f0) { + cts->xport_specific.sata.revision = + (status & 0x0f0) >> 4; + cts->xport_specific.sata.valid |= + CTS_SATA_VALID_REVISION; + } } else { - cts->xport_specific.sata.pm_present = ch->pm_present; + cts->xport_specific.sata.revision = d->revision; + cts->xport_specific.sata.valid |= CTS_SATA_VALID_REVISION; } + cts->xport_specific.sata.mode = d->mode; + cts->xport_specific.sata.valid |= CTS_SATA_VALID_MODE; + cts->xport_specific.sata.bytecount = d->bytecount; + cts->xport_specific.sata.valid |= CTS_SATA_VALID_BYTECOUNT; + cts->xport_specific.sata.pm_present = ch->pm_present; cts->xport_specific.sata.valid |= CTS_SATA_VALID_PM; + cts->xport_specific.sata.tags = d->tags; + cts->xport_specific.sata.valid |= CTS_SATA_VALID_TAGS; ccb->ccb_h.status = CAM_REQ_CMP; xpt_done(ccb); break; Modified: head/sys/dev/ahci/ahci.h ============================================================================== --- head/sys/dev/ahci/ahci.h Tue Nov 24 10:46:17 2009 (r199746) +++ head/sys/dev/ahci/ahci.h Tue Nov 24 12:47:58 2009 (r199747) @@ -340,6 +340,13 @@ struct ahci_slot { struct callout timeout; /* Execution timeout */ }; +struct ahci_device { + u_int revision; + int mode; + u_int bytecount; + u_int tags; +}; + /* structure describing an ATA channel */ struct ahci_channel { device_t dev; /* Device handle */ @@ -362,6 +369,7 @@ struct ahci_channel { struct mtx mtx; /* state lock */ int devices; /* What is present */ int pm_present; /* PM presence reported */ + uint32_t oslots; /* Occupied slots */ uint32_t rslots; /* Running slots */ uint32_t aslots; /* Slots with atomic commands */ int numrslots; /* Number of running slots */ @@ -372,6 +380,9 @@ struct ahci_channel { int taggedtarget; /* Last tagged target */ union ccb *frozen; /* Frozen command */ struct callout pm_timer; /* Power management events */ + + struct ahci_device user[16]; /* User-specified settings */ + struct ahci_device curr[16]; /* Current settings */ }; /* structure describing a AHCI controller */ Modified: head/sys/dev/siis/siis.c ============================================================================== --- head/sys/dev/siis/siis.c Tue Nov 24 10:46:17 2009 (r199746) +++ head/sys/dev/siis/siis.c Tue Nov 24 12:47:58 2009 (r199747) @@ -415,12 +415,19 @@ siis_ch_attach(device_t dev) { struct siis_channel *ch = device_get_softc(dev); struct cam_devq *devq; - int rid, error; + int rid, error, i; ch->dev = dev; ch->unit = (intptr_t)device_get_ivars(dev); resource_int_value(device_get_name(dev), device_get_unit(dev), "pm_level", &ch->pm_level); + for (i = 0; i < 16; i++) { + ch->user[i].revision = 0; + ch->user[i].mode = 0; + ch->user[i].bytecount = 8192; + ch->user[i].tags = SIIS_MAX_SLOTS; + ch->curr[i] = ch->user[i]; + } resource_int_value(device_get_name(dev), device_get_unit(dev), "sata_rev", &ch->sata_rev); mtx_init(&ch->mtx, "SIIS channel lock", NULL, MTX_DEF); @@ -833,6 +840,13 @@ siis_check_collision(device_t dev, union mtx_assert(&ch->mtx, MA_OWNED); if ((ccb->ccb_h.func_code == XPT_ATA_IO) && + (ccb->ataio.cmd.flags & CAM_ATAIO_FPDMA)) { + /* Tagged command while we have no supported tag free. */ + if (((~ch->oslots) & (0x7fffffff >> (31 - + ch->curr[ccb->ccb_h.target_id].tags))) == 0) + return (1); + } + if ((ccb->ccb_h.func_code == XPT_ATA_IO) && (ccb->ataio.cmd.flags & (CAM_ATAIO_CONTROL | CAM_ATAIO_NEEDRESULT))) { /* Atomic command while anything active. */ if (ch->numrslots != 0) @@ -850,21 +864,20 @@ siis_begin_transaction(device_t dev, uni { struct siis_channel *ch = device_get_softc(dev); struct siis_slot *slot; - int tag; + int tag, tags; mtx_assert(&ch->mtx, MA_OWNED); /* Choose empty slot. */ - tag = ch->lastslot; - while (ch->slot[tag].state != SIIS_SLOT_EMPTY) { - if (++tag >= SIIS_MAX_SLOTS) - tag = 0; - KASSERT(tag != ch->lastslot, ("siis: ALL SLOTS BUSY!")); - } - ch->lastslot = tag; + tags = SIIS_MAX_SLOTS; + if ((ccb->ccb_h.func_code == XPT_ATA_IO) && + (ccb->ataio.cmd.flags & CAM_ATAIO_FPDMA)) + tags = ch->curr[ccb->ccb_h.target_id].tags; + tag = fls((~ch->oslots) & (0x7fffffff >> (31 - tags))) - 1; /* Occupy chosen slot. */ slot = &ch->slot[tag]; slot->ccb = ccb; /* Update channel stats. */ + ch->oslots |= (1 << slot->slot); ch->numrslots++; if ((ccb->ccb_h.func_code == XPT_ATA_IO) && (ccb->ataio.cmd.flags & CAM_ATAIO_FPDMA)) { @@ -1118,6 +1131,7 @@ siis_end_transaction(struct siis_slot *s ccb->ccb_h.status |= CAM_REQ_CMP_ERR; } /* Free slot. */ + ch->oslots &= ~(1 << slot->slot); ch->rslots &= ~(1 << slot->slot); ch->aslots &= ~(1 << slot->slot); if (et != SIIS_ERR_TIMEOUT) { @@ -1143,7 +1157,7 @@ siis_end_transaction(struct siis_slot *s } else xpt_done(ccb); /* Unfreeze frozen command. */ - if (ch->frozen && ch->numrslots == 0) { + if (ch->frozen && !siis_check_collision(dev, ch->frozen)) { union ccb *fccb = ch->frozen; ch->frozen = NULL; siis_begin_transaction(dev, fccb); @@ -1554,7 +1568,20 @@ siisaction(struct cam_sim *sim, union cc case XPT_SET_TRAN_SETTINGS: { struct ccb_trans_settings *cts = &ccb->cts; + struct siis_device *d; + if (cts->type == CTS_TYPE_CURRENT_SETTINGS) + d = &ch->curr[ccb->ccb_h.target_id]; + else + d = &ch->user[ccb->ccb_h.target_id]; + if (cts->xport_specific.sata.valid & CTS_SATA_VALID_REVISION) + d->revision = cts->xport_specific.sata.revision; + if (cts->xport_specific.sata.valid & CTS_SATA_VALID_MODE) + d->mode = cts->xport_specific.sata.mode; + if (cts->xport_specific.sata.valid & CTS_SATA_VALID_BYTECOUNT) + d->bytecount = min(8192, cts->xport_specific.sata.bytecount); + if (cts->xport_specific.sata.valid & CTS_SATA_VALID_TAGS) + d->tags = min(SIIS_MAX_SLOTS, cts->xport_specific.sata.tags); if (cts->xport_specific.sata.valid & CTS_SATA_VALID_PM) { ch->pm_present = cts->xport_specific.sata.pm_present; if (ch->pm_present) @@ -1570,30 +1597,41 @@ siisaction(struct cam_sim *sim, union cc /* Get default/user set transfer settings for the target */ { struct ccb_trans_settings *cts = &ccb->cts; + struct siis_device *d; uint32_t status; + if (cts->type == CTS_TYPE_CURRENT_SETTINGS) + d = &ch->curr[ccb->ccb_h.target_id]; + else + d = &ch->user[ccb->ccb_h.target_id]; cts->protocol = PROTO_ATA; cts->protocol_version = PROTO_VERSION_UNSPECIFIED; cts->transport = XPORT_SATA; cts->transport_version = XPORT_VERSION_UNSPECIFIED; cts->proto_specific.valid = 0; cts->xport_specific.sata.valid = 0; - if (cts->type == CTS_TYPE_CURRENT_SETTINGS) + if (cts->type == CTS_TYPE_CURRENT_SETTINGS && + (ccb->ccb_h.target_id == 15 || + (ccb->ccb_h.target_id == 0 && !ch->pm_present))) { status = ATA_INL(ch->r_mem, SIIS_P_SSTS) & ATA_SS_SPD_MASK; - else - status = ATA_INL(ch->r_mem, SIIS_P_SCTL) & ATA_SC_SPD_MASK; - if (status & ATA_SS_SPD_GEN3) { - cts->xport_specific.sata.bitrate = 600000; - cts->xport_specific.sata.valid |= CTS_SATA_VALID_SPEED; - } else if (status & ATA_SS_SPD_GEN2) { - cts->xport_specific.sata.bitrate = 300000; - cts->xport_specific.sata.valid |= CTS_SATA_VALID_SPEED; - } else if (status & ATA_SS_SPD_GEN1) { - cts->xport_specific.sata.bitrate = 150000; - cts->xport_specific.sata.valid |= CTS_SATA_VALID_SPEED; + if (status & 0x0f0) { + cts->xport_specific.sata.revision = + (status & 0x0f0) >> 4; + cts->xport_specific.sata.valid |= + CTS_SATA_VALID_REVISION; + } + } else { + cts->xport_specific.sata.revision = d->revision; + cts->xport_specific.sata.valid |= CTS_SATA_VALID_REVISION; } + cts->xport_specific.sata.mode = d->mode; + cts->xport_specific.sata.valid |= CTS_SATA_VALID_MODE; + cts->xport_specific.sata.bytecount = d->bytecount; + cts->xport_specific.sata.valid |= CTS_SATA_VALID_BYTECOUNT; cts->xport_specific.sata.pm_present = ch->pm_present; cts->xport_specific.sata.valid |= CTS_SATA_VALID_PM; + cts->xport_specific.sata.tags = d->tags; + cts->xport_specific.sata.valid |= CTS_SATA_VALID_TAGS; ccb->ccb_h.status = CAM_REQ_CMP; xpt_done(ccb); break; Modified: head/sys/dev/siis/siis.h ============================================================================== --- head/sys/dev/siis/siis.h Tue Nov 24 10:46:17 2009 (r199746) +++ head/sys/dev/siis/siis.h Tue Nov 24 12:47:58 2009 (r199747) @@ -346,6 +346,13 @@ struct siis_slot { struct callout timeout; /* Execution timeout */ }; +struct siis_device { + u_int revision; + int mode; + u_int bytecount; + u_int tags; +}; + /* structure describing an ATA channel */ struct siis_channel { device_t dev; /* Device handle */ @@ -364,6 +371,7 @@ struct siis_channel { struct mtx mtx; /* state lock */ int devices; /* What is present */ int pm_present; /* PM presence reported */ + uint32_t oslots; /* Occupied slots */ uint32_t rslots; /* Running slots */ uint32_t aslots; /* Slots with atomic commands */ uint32_t eslots; /* Slots in error */ @@ -374,8 +382,10 @@ struct siis_channel { int readlog; /* Our READ LOG active */ int fatalerr; /* Fatal error happend */ int recovery; /* Some slots are in error */ - int lastslot; /* Last used slot */ union ccb *frozen; /* Frozen command */ + + struct siis_device user[16]; /* User-specified settings */ + struct siis_device curr[16]; /* Current settings */ }; /* structure describing a SIIS controller */ From owner-svn-src-all@FreeBSD.ORG Tue Nov 24 13:44:54 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 59CCD1065672; Tue, 24 Nov 2009 13:44:54 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2ED978FC12; Tue, 24 Nov 2009 13:44:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAODir7F018438; Tue, 24 Nov 2009 13:44:53 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAODiruH018436; Tue, 24 Nov 2009 13:44:53 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <200911241344.nAODiruH018436@svn.freebsd.org> From: Christian Brueffer Date: Tue, 24 Nov 2009 13:44:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199748 - head/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Nov 2009 13:44:54 -0000 Author: brueffer Date: Tue Nov 24 13:44:53 2009 New Revision: 199748 URL: http://svn.freebsd.org/changeset/base/199748 Log: Grammar and mdoc improvements. MFC after: 3 days Modified: head/share/man/man4/ada.4 Modified: head/share/man/man4/ada.4 ============================================================================== --- head/share/man/man4/ada.4 Tue Nov 24 12:47:58 2009 (r199747) +++ head/share/man/man4/ada.4 Tue Nov 24 13:44:53 2009 (r199748) @@ -36,12 +36,12 @@ .Sh DESCRIPTION The .Nm -driver provides support for direct access devices, implementing +driver provides support for direct access devices, implementing the .Tn ATA command protocol, that are attached to the system through a host adapter -supported by CAM subsystem. +supported by the CAM subsystem. .Pp -Host adapter must also be separately configured into the system before a +The host adapter must also be separately configured into the system before an .Tn ATA direct access device can be configured. .Sh COMMAND QUEUING @@ -52,12 +52,12 @@ seeks. defines two types of queueing: .Tn TCQ (Tagged Command Queueing, PATA legacy) and -.Tn NCQ (Native Command Queueing, SATA). +.Tn NCQ (Native Command Queueing, SATA) . The .Nm -device driver takes full advantage of the NCQ, when supported. -To ensure that transactions to distant portions of the media, -which may be deferred indefinitely by servicing requests nearer the current +device driver takes full advantage of NCQ, when supported. +To ensure that transactions to distant parts of the media, +which may be deferred indefinitely by servicing requests closer to the current head position, are completed in a timely fashion, an ordered transaction is sent every 7 seconds during continuous device operation. .Sh CACHE EFFECTS @@ -84,8 +84,8 @@ writes will be lost. The effect of a loss of write transactions on a file system is non-deterministic and can cause corruption. Most -devices age write transactions to limit vulnerability to a few transactions -recently reported as complete, but it is none-the-less recommended that +devices age write transactions to limit the vulnerability to a few transactions +recently reported as complete, but it is nonetheless recommended that systems with write cache enabled devices reside on an Uninterruptible Power Supply (UPS). The @@ -125,14 +125,14 @@ seconds. ATA device nodes .El .Sh SEE ALSO +.Xr ad 4 , .Xr ahci 4 , -.Xr siis 4 , -.Xr ad 4 -.Xr da 4 +.Xr da 4 , +.Xr siis 4 .Sh HISTORY The .Nm driver first appeared in .Fx 8.0 . .Sh AUTHORS -.An Alexander Motin Aq mav@FreeBSD.org . +.An Alexander Motin Aq mav@FreeBSD.org From owner-svn-src-all@FreeBSD.ORG Tue Nov 24 14:06:16 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1534A106566C; Tue, 24 Nov 2009 14:06:16 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0472A8FC16; Tue, 24 Nov 2009 14:06:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAOE6FZu018860; Tue, 24 Nov 2009 14:06:15 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAOE6FdR018858; Tue, 24 Nov 2009 14:06:15 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200911241406.nAOE6FdR018858@svn.freebsd.org> From: Alexander Motin Date: Tue, 24 Nov 2009 14:06:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199749 - head/sys/dev/ata X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Nov 2009 14:06:16 -0000 Author: mav Date: Tue Nov 24 14:06:15 2009 New Revision: 199749 URL: http://svn.freebsd.org/changeset/base/199749 Log: Use only lower byte of sectors_intr IDENTIFY word as sector count. This fixes SET_MULTI error during boot on devices supporting less then 16 sectors per interrupt. Modified: head/sys/dev/ata/ata-disk.c Modified: head/sys/dev/ata/ata-disk.c ============================================================================== --- head/sys/dev/ata/ata-disk.c Tue Nov 24 13:44:53 2009 (r199748) +++ head/sys/dev/ata/ata-disk.c Tue Nov 24 14:06:15 2009 (r199749) @@ -397,7 +397,7 @@ ad_init(device_t dev) /* use multiple sectors/interrupt if device supports it */ if (ad_version(atadev->param.version_major)) { - int secsperint = max(1, min(atadev->param.sectors_intr, 16)); + int secsperint = max(1, min(atadev->param.sectors_intr & 0xff, 16)); if (!ata_controlcmd(dev, ATA_SET_MULTI, 0, 0, secsperint)) atadev->max_iosize = secsperint * DEV_BSIZE; From owner-svn-src-all@FreeBSD.ORG Tue Nov 24 14:40:50 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 60C44106566B; Tue, 24 Nov 2009 14:40:50 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4EF488FC0C; Tue, 24 Nov 2009 14:40:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAOEeoHr019789; Tue, 24 Nov 2009 14:40:50 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAOEeoOU019787; Tue, 24 Nov 2009 14:40:50 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <200911241440.nAOEeoOU019787@svn.freebsd.org> From: Attilio Rao Date: Tue, 24 Nov 2009 14:40:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199750 - stable/6/sys/fs/fifofs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Nov 2009 14:40:50 -0000 Author: attilio Date: Tue Nov 24 14:40:50 2009 New Revision: 199750 URL: http://svn.freebsd.org/changeset/base/199750 Log: MFC 199007: Fix a memory leak. Modified: stable/6/sys/fs/fifofs/fifo_vnops.c Directory Properties: stable/6/sys/ (props changed) stable/6/sys/conf/ (props changed) stable/6/sys/contrib/pf/ (props changed) stable/6/sys/dev/cxgb/ (props changed) Modified: stable/6/sys/fs/fifofs/fifo_vnops.c ============================================================================== --- stable/6/sys/fs/fifofs/fifo_vnops.c Tue Nov 24 14:06:15 2009 (r199749) +++ stable/6/sys/fs/fifofs/fifo_vnops.c Tue Nov 24 14:40:50 2009 (r199750) @@ -76,6 +76,9 @@ struct fileops fifo_ops_f = { /* * This structure is associated with the FIFO vnode and stores * the state associated with the FIFO. + * Notes about locking: + * - fi_readsock and fi_writesock are invariant since init time. + * - fi_readers and fi_writers are vnode lock protected. */ struct fifoinfo { struct socket *fi_readsock; @@ -212,14 +215,9 @@ fail1: } /* - * General access to fi_readers and fi_writers is protected using - * the vnode lock. - * - * Protect the increment of fi_readers and fi_writers and the - * associated calls to wakeup() with the fifo mutex in addition - * to the vnode lock. This allows the vnode lock to be dropped - * for the msleep() calls below, and using the fifo mutex with - * msleep() prevents the wakeup from being missed. + * Use the fifo_mtx lock here, in addition to the vnode lock, + * in order to allow vnode lock dropping before msleep() calls + * and still avoiding missed wakeups. */ mtx_lock(&fifo_mtx); if (ap->a_mode & FREAD) { @@ -237,6 +235,8 @@ fail1: if (ap->a_mode & FWRITE) { if ((ap->a_mode & O_NONBLOCK) && fip->fi_readers == 0) { mtx_unlock(&fifo_mtx); + if (fip->fi_writers == 0) + fifo_cleanup(vp); return (ENXIO); } fip->fi_writers++; From owner-svn-src-all@FreeBSD.ORG Tue Nov 24 16:54:55 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 31D381065692; Tue, 24 Nov 2009 16:54:55 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 20A2B8FC1F; Tue, 24 Nov 2009 16:54:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAOGstja024262; Tue, 24 Nov 2009 16:54:55 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAOGssfT024256; Tue, 24 Nov 2009 16:54:54 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200911241654.nAOGssfT024256@svn.freebsd.org> From: John Baldwin Date: Tue, 24 Nov 2009 16:54:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199756 - head/sys/dev/an X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Nov 2009 16:54:55 -0000 Author: jhb Date: Tue Nov 24 16:54:54 2009 New Revision: 199756 URL: http://svn.freebsd.org/changeset/base/199756 Log: Use bus_*() rather than bus_space_*(). Modified: head/sys/dev/an/if_an.c head/sys/dev/an/if_an_isa.c head/sys/dev/an/if_an_pccard.c head/sys/dev/an/if_an_pci.c head/sys/dev/an/if_anreg.h Modified: head/sys/dev/an/if_an.c ============================================================================== --- head/sys/dev/an/if_an.c Tue Nov 24 16:53:58 2009 (r199755) +++ head/sys/dev/an/if_an.c Tue Nov 24 16:54:54 2009 (r199756) @@ -349,9 +349,6 @@ an_probe(device_t dev) * to be able to issue commands and call some of the * other routines. */ - sc->an_bhandle = rman_get_bushandle(sc->port_res); - sc->an_btag = rman_get_bustag(sc->port_res); - ssid.an_len = sizeof(ssid); ssid.an_type = AN_RID_SSIDLIST; Modified: head/sys/dev/an/if_an_isa.c ============================================================================== --- head/sys/dev/an/if_an_isa.c Tue Nov 24 16:53:58 2009 (r199755) +++ head/sys/dev/an/if_an_isa.c Tue Nov 24 16:54:54 2009 (r199756) @@ -111,8 +111,6 @@ an_attach_isa(device_t dev) an_alloc_port(dev, sc->port_rid, 1); an_alloc_irq(dev, sc->irq_rid, 0); - sc->an_bhandle = rman_get_bushandle(sc->port_res); - sc->an_btag = rman_get_bustag(sc->port_res); sc->an_dev = dev; error = an_attach(sc, flags); Modified: head/sys/dev/an/if_an_pccard.c ============================================================================== --- head/sys/dev/an/if_an_pccard.c Tue Nov 24 16:53:58 2009 (r199755) +++ head/sys/dev/an/if_an_pccard.c Tue Nov 24 16:54:54 2009 (r199756) @@ -141,8 +141,6 @@ an_pccard_attach(device_t dev) an_alloc_irq(dev, sc->irq_rid, 0); - sc->an_bhandle = rman_get_bushandle(sc->port_res); - sc->an_btag = rman_get_bustag(sc->port_res); sc->an_dev = dev; error = an_attach(sc, flags); Modified: head/sys/dev/an/if_an_pci.c ============================================================================== --- head/sys/dev/an/if_an_pci.c Tue Nov 24 16:53:58 2009 (r199755) +++ head/sys/dev/an/if_an_pci.c Tue Nov 24 16:54:54 2009 (r199756) @@ -175,9 +175,6 @@ an_attach_pci(dev) goto fail; } - sc->an_btag = rman_get_bustag(sc->port_res); - sc->an_bhandle = rman_get_bushandle(sc->port_res); - /* Allocate memory for MPI350 */ if (sc->mpi350) { /* Allocate memory */ @@ -187,8 +184,6 @@ an_attach_pci(dev) device_printf(dev, "couldn't map memory\n"); goto fail; } - sc->an_mem_btag = rman_get_bustag(sc->mem_res); - sc->an_mem_bhandle = rman_get_bushandle(sc->mem_res); /* Allocate aux. memory */ sc->mem_aux_rid = PCIR_BAR(2); @@ -198,8 +193,6 @@ an_attach_pci(dev) device_printf(dev, "couldn't map aux memory\n"); goto fail; } - sc->an_mem_aux_btag = rman_get_bustag(sc->mem_aux_res); - sc->an_mem_aux_bhandle = rman_get_bushandle(sc->mem_aux_res); /* Allocate DMA region */ error = bus_dma_tag_create(NULL, /* parent */ Modified: head/sys/dev/an/if_anreg.h ============================================================================== --- head/sys/dev/an/if_anreg.h Tue Nov 24 16:53:58 2009 (r199755) +++ head/sys/dev/an/if_anreg.h Tue Nov 24 16:54:54 2009 (r199756) @@ -45,47 +45,39 @@ /* * register space access macros */ -#define CSR_WRITE_2(sc, reg, val) \ - bus_space_write_2(sc->an_btag, sc->an_bhandle, reg, val) +#define CSR_WRITE_2(sc, reg, val) bus_write_2(sc->port_res, reg, val) -#define CSR_READ_2(sc, reg) \ - bus_space_read_2(sc->an_btag, sc->an_bhandle, reg) +#define CSR_READ_2(sc, reg) bus_read_2(sc->port_res, reg) -#define CSR_WRITE_1(sc, reg, val) \ - bus_space_write_1(sc->an_btag, sc->an_bhandle, reg, val) +#define CSR_WRITE_1(sc, reg, val) bus_write_1(sc->port_res, reg, val) -#define CSR_READ_1(sc, reg) \ - bus_space_read_1(sc->an_btag, sc->an_bhandle, reg) +#define CSR_READ_1(sc, reg) bus_read_1(sc->port_res, reg) /* * memory space access macros */ -#define CSR_MEM_WRITE_2(sc, reg, val) \ - bus_space_write_2(sc->an_mem_btag, sc->an_mem_bhandle, reg, val) +#define CSR_MEM_WRITE_2(sc, reg, val) bus_write_2(sc->mem_res, reg, val) -#define CSR_MEM_READ_2(sc, reg) \ - bus_space_read_2(sc->an_mem_btag, sc->an_mem_bhandle, reg) +#define CSR_MEM_READ_2(sc, reg) bus_read_2(sc->mem_res, reg) -#define CSR_MEM_WRITE_1(sc, reg, val) \ - bus_space_write_1(sc->an_mem_btag, sc->an_mem_bhandle, reg, val) +#define CSR_MEM_WRITE_1(sc, reg, val) bus_write_1(sc->mem_res, reg, val) -#define CSR_MEM_READ_1(sc, reg) \ - bus_space_read_1(sc->an_mem_btag, sc->an_mem_bhandle, reg) +#define CSR_MEM_READ_1(sc, reg) bus_read_1(sc->mem_res, reg) /* * aux. memory space access macros */ #define CSR_MEM_AUX_WRITE_4(sc, reg, val) \ - bus_space_write_4(sc->an_mem_aux_btag, sc->an_mem_aux_bhandle, reg, val) + bus_write_4(sc->mem_aux_res, reg, val) #define CSR_MEM_AUX_READ_4(sc, reg) \ - bus_space_read_4(sc->an_mem_aux_btag, sc->an_mem_aux_bhandle, reg) + bus_read_4(sc->mem_aux_res, reg) #define CSR_MEM_AUX_WRITE_1(sc, reg, val) \ - bus_space_write_1(sc->an_mem_aux_btag, sc->an_mem_aux_bhandle, reg, val) + bus_write_1(sc->mem_aux_res, reg, val) #define CSR_MEM_AUX_READ_1(sc, reg) \ - bus_space_read_1(sc->an_mem_aux_btag, sc->an_mem_aux_bhandle, reg) + bus_read_1(sc->mem_aux_res, reg) /* * Size of Aironet I/O space. @@ -454,11 +446,6 @@ struct an_softc { void* irq_handle; /* handle for irq handler */ struct resource* irq_res; /* resource for irq */ - bus_space_handle_t an_bhandle_p; - bus_space_handle_t an_bhandle; - bus_space_tag_t an_btag; - bus_space_handle_t an_mem_bhandle; - bus_space_tag_t an_mem_btag; bus_space_handle_t an_mem_aux_bhandle; bus_space_tag_t an_mem_aux_btag; bus_dma_tag_t an_dtag; From owner-svn-src-all@FreeBSD.ORG Tue Nov 24 16:57:36 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 455D7106568D; Tue, 24 Nov 2009 16:57:36 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1AEFC8FC1E; Tue, 24 Nov 2009 16:57:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAOGvZoZ024361; Tue, 24 Nov 2009 16:57:36 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAOGvZLG024358; Tue, 24 Nov 2009 16:57:35 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200911241657.nAOGvZLG024358@svn.freebsd.org> From: John Baldwin Date: Tue, 24 Nov 2009 16:57:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199757 - head/sys/dev/an X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Nov 2009 16:57:36 -0000 Author: jhb Date: Tue Nov 24 16:57:35 2009 New Revision: 199757 URL: http://svn.freebsd.org/changeset/base/199757 Log: - For 350 chips, don't set various INTR bits in TX control word; turning INTR bits on seems to confuse hardware TX engine. - For 350 chips, set TX desc's buffer physical address before turning on the TX desc valid bit. Submitted by: Jeremy O'Brien obrien654j | gmail, sephe Obtained from: DragonFly BSD Modified: head/sys/dev/an/if_an.c head/sys/dev/an/if_anreg.h Modified: head/sys/dev/an/if_an.c ============================================================================== --- head/sys/dev/an/if_an.c Tue Nov 24 16:54:54 2009 (r199756) +++ head/sys/dev/an/if_an.c Tue Nov 24 16:57:35 2009 (r199757) @@ -2800,7 +2800,7 @@ an_start_locked(struct ifnet *ifp) tx_frame_802_3.an_tx_802_3_payload_len, (caddr_t)&sc->an_txbuf); - txcontrol = AN_TXCTL_8023; + txcontrol = AN_TXCTL_8023 | AN_TXCTL_HW(sc->mpi350); /* write the txcontrol only */ an_write_data(sc, id, 0x08, (caddr_t)&txcontrol, sizeof(txcontrol)); @@ -2863,7 +2863,7 @@ an_start_locked(struct ifnet *ifp) tx_frame_802_3.an_tx_802_3_payload_len, (caddr_t)&sc->an_txbuf); - txcontrol = AN_TXCTL_8023; + txcontrol = AN_TXCTL_8023 | AN_TXCTL_HW(sc->mpi350); /* write the txcontrol only */ bcopy((caddr_t)&txcontrol, &buf[0x08], sizeof(txcontrol)); @@ -2885,7 +2885,7 @@ an_start_locked(struct ifnet *ifp) tx_frame_802_3.an_tx_802_3_payload_len; an_tx_desc.an_phys = sc->an_tx_buffer[idx].an_dma_paddr; - for (i = 0; i < sizeof(an_tx_desc) / 4 ; i++) { + for (i = sizeof(an_tx_desc) / 4 - 1; i >= 0; i--) { CSR_MEM_AUX_WRITE_4(sc, AN_TX_DESC_OFFSET /* zero for now */ + (0 * sizeof(an_tx_desc)) Modified: head/sys/dev/an/if_anreg.h ============================================================================== --- head/sys/dev/an/if_anreg.h Tue Nov 24 16:54:54 2009 (r199756) +++ head/sys/dev/an/if_anreg.h Tue Nov 24 16:57:35 2009 (r199757) @@ -386,13 +386,18 @@ struct an_txframe_802_3 { #define AN_PAYLOADTYPE_ETHER 0x0000 #define AN_PAYLOADTYPE_LLC 0x0010 -#define AN_TXCTL_80211 \ - (AN_TXCTL_TXOK_INTR|AN_TXCTL_TXERR_INTR|AN_HEADERTYPE_80211| \ - AN_PAYLOADTYPE_LLC|AN_TXCTL_NORELEASE) - -#define AN_TXCTL_8023 \ - (AN_TXCTL_TXOK_INTR|AN_TXCTL_TXERR_INTR|AN_HEADERTYPE_8023| \ - AN_PAYLOADTYPE_ETHER|AN_TXCTL_NORELEASE) +#define AN_TXCTL_80211 (AN_HEADERTYPE_80211|AN_PAYLOADTYPE_LLC) + +#define AN_TXCTL_8023 (AN_HEADERTYPE_8023|AN_PAYLOADTYPE_ETHER) + +/* + * Additions to transmit control bits for MPI350 + */ +#define AN_TXCTL_HW(x) \ + ( x ? (AN_TXCTL_NORELEASE) \ + : \ + (AN_TXCTL_TXOK_INTR|AN_TXCTL_TXERR_INTR|AN_TXCTL_NORELEASE) \ + ) #define AN_TXGAP_80211 0 #define AN_TXGAP_8023 0 From owner-svn-src-all@FreeBSD.ORG Tue Nov 24 17:46:59 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 403F51065670; Tue, 24 Nov 2009 17:46:59 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2F6E88FC08; Tue, 24 Nov 2009 17:46:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAOHkxYf025389; Tue, 24 Nov 2009 17:46:59 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAOHkxrP025387; Tue, 24 Nov 2009 17:46:59 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200911241746.nAOHkxrP025387@svn.freebsd.org> From: Pyun YongHyeon Date: Tue, 24 Nov 2009 17:46:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199761 - head/sys/dev/bge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Nov 2009 17:46:59 -0000 Author: yongari Date: Tue Nov 24 17:46:58 2009 New Revision: 199761 URL: http://svn.freebsd.org/changeset/base/199761 Log: BGE_FLAG_40BIT_BUG should be set before creating DMA tags. Pointy hat to: yongari Modified: head/sys/dev/bge/if_bge.c Modified: head/sys/dev/bge/if_bge.c ============================================================================== --- head/sys/dev/bge/if_bge.c Tue Nov 24 17:15:22 2009 (r199760) +++ head/sys/dev/bge/if_bge.c Tue Nov 24 17:46:58 2009 (r199761) @@ -2665,6 +2665,13 @@ bge_attach(device_t dev) } /* + * The 40bit DMA bug applies to the 5714/5715 controllers and is + * not actually a MAC controller bug but an issue with the embedded + * PCIe to PCI-X bridge in the device. Use 40bit DMA workaround. + */ + if (BGE_IS_5714_FAMILY(sc) && (sc->bge_flags & BGE_FLAG_PCIX)) + sc->bge_flags |= BGE_FLAG_40BIT_BUG; + /* * Allocate the interrupt, using MSI if possible. These devices * support 8 MSI messages, but only the first one is used in * normal operation. @@ -2798,13 +2805,6 @@ bge_attach(device_t dev) #ifdef DEVICE_POLLING ifp->if_capabilities |= IFCAP_POLLING; #endif - /* - * The 40bit DMA bug applies to the 5714/5715 controllers and is - * not actually a MAC controller bug but an issue with the embedded - * PCIe to PCI-X bridge in the device. Use 40bit DMA workaround. - */ - if (BGE_IS_5714_FAMILY(sc) && (sc->bge_flags & BGE_FLAG_PCIX)) - sc->bge_flags |= BGE_FLAG_40BIT_BUG; /* * 5700 B0 chips do not support checksumming correctly due From owner-svn-src-all@FreeBSD.ORG Tue Nov 24 18:18:23 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A1222106568F; Tue, 24 Nov 2009 18:18:23 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 6EEC48FC1E; Tue, 24 Nov 2009 18:18:23 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 1FBEC46B1A; Tue, 24 Nov 2009 13:18:23 -0500 (EST) Received: from jhbbsd.localnet (unknown [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPA id 6A2088A01B; Tue, 24 Nov 2009 13:18:22 -0500 (EST) From: John Baldwin To: Marcel Moolenaar Date: Tue, 24 Nov 2009 11:24:46 -0500 User-Agent: KMail/1.12.1 (FreeBSD/7.2-CBSD-20091103; KDE/4.3.1; amd64; ; ) References: <200911240317.nAO3H0P6003552@svn.freebsd.org> <200911240451.46875.max@love2party.net> <85603446-C587-4AD5-91B0-653D106117BF@mac.com> In-Reply-To: <85603446-C587-4AD5-91B0-653D106117BF@mac.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200911241124.46293.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Tue, 24 Nov 2009 13:18:22 -0500 (EST) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=4.2 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: Marcel Moolenaar , svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org, Max Laier Subject: Re: svn commit: r199729 - stable/8/sys/ia64/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Nov 2009 18:18:23 -0000 On Monday 23 November 2009 11:17:00 pm Marcel Moolenaar wrote: > On Nov 23, 2009, at 7:51 PM, Max Laier wrote: > > >> Modified: > >> stable/8/sys/ia64/include/asm.h > >> Directory Properties: > >> stable/8/sys/ (props changed) > > > > These MFCs seem to be missing mergeinfo for the contrib directories. > > I pruned them. We don't seem to get rid of merge into in the > wrong directories even even people try to clean it up... That was the wrong thing to do. The mergeinfo on the contrib directories is actually quite valid b/c they have metadata from multiple locations. These were not the results of merges into the wrong directories, but the results of merges from vendor trees into HEAD. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Tue Nov 24 18:34:48 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6A523106568F; Tue, 24 Nov 2009 18:34:48 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 598D68FC1A; Tue, 24 Nov 2009 18:34:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAOIYmhl026405; Tue, 24 Nov 2009 18:34:48 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAOIYlsn026404; Tue, 24 Nov 2009 18:34:47 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200911241834.nAOIYlsn026404@svn.freebsd.org> From: John Baldwin Date: Tue, 24 Nov 2009 18:34:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199762 - head/sys/mips/adm5120 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Nov 2009 18:34:48 -0000 Author: jhb Date: Tue Nov 24 18:34:47 2009 New Revision: 199762 URL: http://svn.freebsd.org/changeset/base/199762 Log: Use a single private timer to drive the transmit watchdog rather than using if_watchdog and if_timer from the first port. Reviewed by: gonzo Modified: head/sys/mips/adm5120/if_admsw.c head/sys/mips/adm5120/if_admswvar.h Modified: head/sys/mips/adm5120/if_admsw.c ============================================================================== --- head/sys/mips/adm5120/if_admsw.c Tue Nov 24 17:46:58 2009 (r199761) +++ head/sys/mips/adm5120/if_admsw.c Tue Nov 24 18:34:47 2009 (r199762) @@ -128,7 +128,7 @@ static uint8_t vlan_matrix[SW_DEVS] = { /* ifnet entry points */ static void admsw_start(struct ifnet *); -static void admsw_watchdog(struct ifnet *); +static void admsw_watchdog(void *); static int admsw_ioctl(struct ifnet *, u_long, caddr_t); static void admsw_init(void *); static void admsw_stop(struct ifnet *, int); @@ -398,6 +398,7 @@ admsw_attach(device_t dev) device_printf(sc->sc_dev, "base Ethernet address %s\n", ether_sprintf(enaddr)); + callout_init(&sc->sc_watchdog, 1); rid = 0; if ((sc->mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, @@ -536,8 +537,6 @@ admsw_attach(device_t dev) ifp->if_ioctl = admsw_ioctl; ifp->if_output = ether_output; ifp->if_start = admsw_start; - ifp->if_watchdog = admsw_watchdog; - ifp->if_timer = 0; ifp->if_init = admsw_init; ifp->if_mtu = ETHERMTU; ifp->if_baudrate = IF_Mbps(100); @@ -733,7 +732,7 @@ admsw_start(struct ifnet *ifp) BPF_MTAP(ifp, m0); /* Set a watchdog timer in case the chip flakes out. */ - sc->sc_ifnet[0]->if_timer = 5; + sc->sc_timer = 5; } } @@ -743,25 +742,29 @@ admsw_start(struct ifnet *ifp) * Watchdog timer handler. */ static void -admsw_watchdog(struct ifnet *ifp) +admsw_watchdog(void *arg) { - struct admsw_softc *sc = ifp->if_softc; + struct admsw_softc *sc = arg; int vlan; + callout_reset(&sc->watchdog, hz, admsw_watchdog, sc); + if (sc->sc_timer == 0 || --sc->timer > 0) + return; + /* Check if an interrupt was lost. */ if (sc->sc_txfree == ADMSW_NTXLDESC) { device_printf(sc->sc_dev, "watchdog false alarm\n"); return; } - if (sc->sc_ifnet[0]->if_timer != 0) + if (sc->sc_timer != 0) device_printf(sc->sc_dev, "watchdog timer is %d!\n", - sc->sc_ifnet[0]->if_timer); + sc->sc_timer); admsw_txintr(sc, 0); if (sc->sc_txfree == ADMSW_NTXLDESC) { device_printf(sc->sc_dev, "tx IRQ lost (queue empty)\n"); return; } - if (sc->sc_ifnet[0]->if_timer != 0) { + if (sc->sc_timer != 0) { device_printf(sc->sc_dev, "tx IRQ lost (timer recharged)\n"); return; } @@ -938,7 +941,7 @@ admsw_txintr(struct admsw_softc *sc, int * cancel the watchdog timer. */ if (sc->sc_txfree == ADMSW_NTXLDESC) - ifp->if_timer = 0; + sc->sc_timer = 0; } @@ -1096,6 +1099,9 @@ admsw_init(void *xsc) ~(ADMSW_INTR_SHD | ADMSW_INTR_SLD | ADMSW_INTR_RHD | ADMSW_INTR_RLD | ADMSW_INTR_HDF | ADMSW_INTR_LDF)); + + callout_reset(&sc->sc_watchdog, hz, + admsw_watchdog, sc); } sc->ndevs++; } @@ -1137,11 +1143,14 @@ admsw_stop(struct ifnet *ifp, int disabl /* disable interrupts */ REG_WRITE(ADMSW_INT_MASK, INT_MASK); + + /* Cancel the watchdog timer. */ + sc->sc_timer = 0; + callout_stop(&sc->sc_watchdog); } - /* Mark the interface as down and cancel the watchdog timer. */ + /* Mark the interface as down. */ ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); - ifp->if_timer = 0; return; } Modified: head/sys/mips/adm5120/if_admswvar.h ============================================================================== --- head/sys/mips/adm5120/if_admswvar.h Tue Nov 24 17:46:58 2009 (r199761) +++ head/sys/mips/adm5120/if_admswvar.h Tue Nov 24 18:34:47 2009 (r199762) @@ -132,7 +132,9 @@ struct admsw_softc { bus_dma_tag_t sc_bufs_dmat; /* bus DMA tag for buffers */ struct ifmedia sc_ifmedia[SW_DEVS]; int ndevs; /* number of IFF_RUNNING interfaces */ - struct ifnet *sc_ifnet[SW_DEVS]; + struct ifnet *sc_ifnet[SW_DEVS]; + struct callout sc_watchdog; + int sc_timer; /* Ethernet common data */ void *sc_ih; /* interrupt cookie */ struct resource *irq_res; From owner-svn-src-all@FreeBSD.ORG Tue Nov 24 19:01:02 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 428D11065676; Tue, 24 Nov 2009 19:01:02 +0000 (UTC) (envelope-from xcllnt@mac.com) Received: from asmtpout026.mac.com (asmtpout026.mac.com [17.148.16.101]) by mx1.freebsd.org (Postfix) with ESMTP id 274BA8FC1B; Tue, 24 Nov 2009 19:01:02 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; charset=us-ascii Received: from [172.24.107.154] (natint3.juniper.net [66.129.224.36]) by asmtp026.mac.com (Sun Java(tm) System Messaging Server 6.3-8.01 (built Dec 16 2008; 32bit)) with ESMTPSA id <0KTM00ITRNHH9R70@asmtp026.mac.com>; Tue, 24 Nov 2009 11:00:55 -0800 (PST) From: Marcel Moolenaar In-reply-to: <200911241124.46293.jhb@freebsd.org> Date: Tue, 24 Nov 2009 11:00:54 -0800 Message-id: References: <200911240317.nAO3H0P6003552@svn.freebsd.org> <200911240451.46875.max@love2party.net> <85603446-C587-4AD5-91B0-653D106117BF@mac.com> <200911241124.46293.jhb@freebsd.org> To: John Baldwin X-Mailer: Apple Mail (2.1077) Cc: Marcel Moolenaar , svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org, Max Laier Subject: Re: svn commit: r199729 - stable/8/sys/ia64/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Nov 2009 19:01:02 -0000 On Nov 24, 2009, at 8:24 AM, John Baldwin wrote: > On Monday 23 November 2009 11:17:00 pm Marcel Moolenaar wrote: >> On Nov 23, 2009, at 7:51 PM, Max Laier wrote: >> >>>> Modified: >>>> stable/8/sys/ia64/include/asm.h >>>> Directory Properties: >>>> stable/8/sys/ (props changed) >>> >>> These MFCs seem to be missing mergeinfo for the contrib directories. >> >> I pruned them. We don't seem to get rid of merge into in the >> wrong directories even even people try to clean it up... > > That was the wrong thing to do. *sigh* I can't keep up with this... -- Marcel Moolenaar xcllnt@mac.com From owner-svn-src-all@FreeBSD.ORG Tue Nov 24 19:26:54 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 35CE8106566B; Tue, 24 Nov 2009 19:26:54 +0000 (UTC) (envelope-from fabient@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1A3278FC13; Tue, 24 Nov 2009 19:26:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAOJQrqE027488; Tue, 24 Nov 2009 19:26:53 GMT (envelope-from fabient@svn.freebsd.org) Received: (from fabient@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAOJQr0i027487; Tue, 24 Nov 2009 19:26:53 GMT (envelope-from fabient@svn.freebsd.org) Message-Id: <200911241926.nAOJQr0i027487@svn.freebsd.org> From: Fabien Thomas Date: Tue, 24 Nov 2009 19:26:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199763 - head/sys/dev/hwpmc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Nov 2009 19:26:54 -0000 Author: fabient Date: Tue Nov 24 19:26:53 2009 New Revision: 199763 URL: http://svn.freebsd.org/changeset/base/199763 Log: - fix a LOR between process lock and pmc thread mutex - fix a system deadlock on process exit when the sample buffer is full (pmclog_loop blocked in fo_write) and pmcstat exit. Reviewed by: jkoshy MFC after: 3 weeks Modified: head/sys/dev/hwpmc/hwpmc_logging.c Modified: head/sys/dev/hwpmc/hwpmc_logging.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_logging.c Tue Nov 24 18:34:47 2009 (r199762) +++ head/sys/dev/hwpmc/hwpmc_logging.c Tue Nov 24 19:26:53 2009 (r199763) @@ -240,6 +240,7 @@ pmclog_loop(void *arg) int error; struct pmc_owner *po; struct pmclog_buffer *lb; + struct proc *p; struct ucred *ownercred; struct ucred *mycred; struct thread *td; @@ -248,12 +249,13 @@ pmclog_loop(void *arg) size_t nbytes; po = (struct pmc_owner *) arg; + p = po->po_owner; td = curthread; mycred = td->td_ucred; - PROC_LOCK(po->po_owner); - ownercred = crhold(po->po_owner->p_ucred); - PROC_UNLOCK(po->po_owner); + PROC_LOCK(p); + ownercred = crhold(p->p_ucred); + PROC_UNLOCK(p); PMCDBG(LOG,INI,1, "po=%p kt=%p", po, po->po_kthread); KASSERT(po->po_kthread == curthread->td_proc, @@ -324,16 +326,16 @@ pmclog_loop(void *arg) error = fo_write(po->po_file, &auio, ownercred, 0, td); td->td_ucred = mycred; - mtx_lock(&pmc_kthread_mtx); - if (error) { /* XXX some errors are recoverable */ /* XXX also check for SIGPIPE if a socket */ /* send a SIGIO to the owner and exit */ - PROC_LOCK(po->po_owner); - psignal(po->po_owner, SIGIO); - PROC_UNLOCK(po->po_owner); + PROC_LOCK(p); + psignal(p, SIGIO); + PROC_UNLOCK(p); + + mtx_lock(&pmc_kthread_mtx); po->po_error = error; /* save for flush log */ @@ -342,6 +344,8 @@ pmclog_loop(void *arg) break; } + mtx_lock(&pmc_kthread_mtx); + /* put the used buffer back into the global pool */ PMCLOG_INIT_BUFFER_DESCRIPTOR(lb); @@ -525,15 +529,20 @@ static void pmclog_stop_kthread(struct pmc_owner *po) { /* - * Unset flag, wakeup the helper thread, + * Close the file to force the thread out of fo_write, + * unset flag, wakeup the helper thread, * wait for it to exit */ - mtx_assert(&pmc_kthread_mtx, MA_OWNED); + if (po->po_file != NULL) + fo_close(po->po_file, curthread); + + mtx_lock(&pmc_kthread_mtx); po->po_flags &= ~PMC_PO_OWNS_LOGFILE; wakeup_one(po); if (po->po_kthread) msleep(po->po_kthread, &pmc_kthread_mtx, PPAUSE, "pmckstp", 0); + mtx_unlock(&pmc_kthread_mtx); } /* @@ -602,10 +611,8 @@ pmclog_configure_log(struct pmc_mdep *md error: /* shutdown the thread */ - mtx_lock(&pmc_kthread_mtx); if (po->po_kthread) pmclog_stop_kthread(po); - mtx_unlock(&pmc_kthread_mtx); KASSERT(po->po_kthread == NULL, ("[pmclog,%d] po=%p kthread not " "stopped", __LINE__, po)); @@ -641,10 +648,8 @@ pmclog_deconfigure_log(struct pmc_owner ("[pmclog,%d] po=%p no log file", __LINE__, po)); /* stop the kthread, this will reset the 'OWNS_LOGFILE' flag */ - mtx_lock(&pmc_kthread_mtx); if (po->po_kthread) pmclog_stop_kthread(po); - mtx_unlock(&pmc_kthread_mtx); KASSERT(po->po_kthread == NULL, ("[pmclog,%d] po=%p kthread not stopped", __LINE__, po)); From owner-svn-src-all@FreeBSD.ORG Tue Nov 24 19:32:59 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DB7881065676; Tue, 24 Nov 2009 19:32:59 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id AAFB18FC17; Tue, 24 Nov 2009 19:32:59 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 46A9346B2A; Tue, 24 Nov 2009 14:32:59 -0500 (EST) Received: from jhbbsd.localnet (unknown [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPA id 915428A01B; Tue, 24 Nov 2009 14:32:58 -0500 (EST) From: John Baldwin To: Marcel Moolenaar Date: Tue, 24 Nov 2009 14:32:50 -0500 User-Agent: KMail/1.12.1 (FreeBSD/7.2-CBSD-20091103; KDE/4.3.1; amd64; ; ) References: <200911240317.nAO3H0P6003552@svn.freebsd.org> <200911241124.46293.jhb@freebsd.org> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200911241432.50925.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Tue, 24 Nov 2009 14:32:58 -0500 (EST) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=4.2 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: Marcel Moolenaar , svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org, Max Laier Subject: Re: svn commit: r199729 - stable/8/sys/ia64/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Nov 2009 19:33:00 -0000 On Tuesday 24 November 2009 2:00:54 pm Marcel Moolenaar wrote: > > On Nov 24, 2009, at 8:24 AM, John Baldwin wrote: > > > On Monday 23 November 2009 11:17:00 pm Marcel Moolenaar wrote: > >> On Nov 23, 2009, at 7:51 PM, Max Laier wrote: > >> > >>>> Modified: > >>>> stable/8/sys/ia64/include/asm.h > >>>> Directory Properties: > >>>> stable/8/sys/ (props changed) > >>> > >>> These MFCs seem to be missing mergeinfo for the contrib directories. > >> > >> I pruned them. We don't seem to get rid of merge into in the > >> wrong directories even even people try to clean it up... > > > > That was the wrong thing to do. > > *sigh* > > I can't keep up with this... Generally you can just commit whatever svn merge gives you. Having a few extra properties in the kernel tree is "normal" for stable/[678]. (I think stable/6 only has one extra: contrib/pf). I do try to clean up merges into the wrong directories, but in the case of vendor merges there isn't anything to clean unless we reorganize the vendor-sys trees so that they always merge to sys. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Tue Nov 24 19:56:13 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EDE14106566B; Tue, 24 Nov 2009 19:56:13 +0000 (UTC) (envelope-from xcllnt@mac.com) Received: from asmtpout029.mac.com (asmtpout029.mac.com [17.148.16.104]) by mx1.freebsd.org (Postfix) with ESMTP id D27998FC0A; Tue, 24 Nov 2009 19:56:13 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; charset=us-ascii Received: from macbook-pro.jnpr.net (natint3.juniper.net [66.129.224.36]) by asmtp029.mac.com (Sun Java(tm) System Messaging Server 6.3-8.01 (built Dec 16 2008; 32bit)) with ESMTPSA id <0KTM00J08Q15L4A0@asmtp029.mac.com>; Tue, 24 Nov 2009 11:55:55 -0800 (PST) From: Marcel Moolenaar In-reply-to: <200911241432.50925.jhb@freebsd.org> Date: Tue, 24 Nov 2009 11:55:53 -0800 Message-id: References: <200911240317.nAO3H0P6003552@svn.freebsd.org> <200911241124.46293.jhb@freebsd.org> <200911241432.50925.jhb@freebsd.org> To: John Baldwin X-Mailer: Apple Mail (2.1077) Cc: Marcel Moolenaar , svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org, Max Laier Subject: Re: svn commit: r199729 - stable/8/sys/ia64/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Nov 2009 19:56:14 -0000 *snip* >>>>> These MFCs seem to be missing mergeinfo for the contrib directories. >>>> >>>> I pruned them. We don't seem to get rid of merge into in the >>>> wrong directories even even people try to clean it up... >>> >>> That was the wrong thing to do. >> >> *sigh* >> >> I can't keep up with this... > > Generally you can just commit whatever svn merge gives you. Having a few > extra properties in the kernel tree is "normal" for stable/[678]. (I think > stable/6 only has one extra: contrib/pf). I do try to clean up merges into > the wrong directories, but in the case of vendor merges there isn't anything > to clean unless we reorganize the vendor-sys trees so that they always merge > to sys. Do you want me to --record-only what I pruned or can we leave it as is with the note not to prune? -- Marcel Moolenaar xcllnt@mac.com From owner-svn-src-all@FreeBSD.ORG Tue Nov 24 19:57:41 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CA86F10656A3; Tue, 24 Nov 2009 19:57:41 +0000 (UTC) (envelope-from ivoras@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BA1DB8FC0C; Tue, 24 Nov 2009 19:57:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAOJvfi4028108; Tue, 24 Nov 2009 19:57:41 GMT (envelope-from ivoras@svn.freebsd.org) Received: (from ivoras@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAOJvfuw028106; Tue, 24 Nov 2009 19:57:41 GMT (envelope-from ivoras@svn.freebsd.org) Message-Id: <200911241957.nAOJvfuw028106@svn.freebsd.org> From: Ivan Voras Date: Tue, 24 Nov 2009 19:57:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199764 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Nov 2009 19:57:41 -0000 Author: ivoras Date: Tue Nov 24 19:57:41 2009 New Revision: 199764 URL: http://svn.freebsd.org/changeset/base/199764 Log: Make ULE process usage (%CPU) accounting usable again by keeping track of the last tick we incremented on. Submitted by: matthew.fleming/at/isilon.com, is/at/rambler-co.ru Reviewed by: jeff (who thinks there should be a better way in the future) Approved by: gnn (mentor) MFC after: 3 weeks Modified: head/sys/kern/sched_ule.c Modified: head/sys/kern/sched_ule.c ============================================================================== --- head/sys/kern/sched_ule.c Tue Nov 24 19:26:53 2009 (r199763) +++ head/sys/kern/sched_ule.c Tue Nov 24 19:57:41 2009 (r199764) @@ -103,6 +103,7 @@ struct td_sched { u_int ts_slptime; /* Number of ticks we vol. slept */ u_int ts_runtime; /* Number of ticks we were running */ int ts_ltick; /* Last tick that we were running on */ + int ts_incrtick; /* Last tick that we incremented on */ int ts_ftick; /* First tick that we were running on */ int ts_ticks; /* Tick count */ #ifdef KTR @@ -1991,6 +1992,7 @@ sched_fork_thread(struct thread *td, str */ ts2->ts_ticks = ts->ts_ticks; ts2->ts_ltick = ts->ts_ltick; + ts2->ts_incrtick = ts->ts_incrtick; ts2->ts_ftick = ts->ts_ftick; child->td_user_pri = td->td_user_pri; child->td_base_user_pri = td->td_base_user_pri; @@ -2182,11 +2184,12 @@ sched_tick(void) * Ticks is updated asynchronously on a single cpu. Check here to * avoid incrementing ts_ticks multiple times in a single tick. */ - if (ts->ts_ltick == ticks) + if (ts->ts_incrtick == ticks) return; /* Adjust ticks for pctcpu */ ts->ts_ticks += 1 << SCHED_TICK_SHIFT; ts->ts_ltick = ticks; + ts->ts_incrtick = ticks; /* * Update if we've exceeded our desired tick threshhold by over one * second. From owner-svn-src-all@FreeBSD.ORG Tue Nov 24 20:04:32 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 26694106566B; Tue, 24 Nov 2009 20:04:32 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1493D8FC0A; Tue, 24 Nov 2009 20:04:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAOK4V36028291; Tue, 24 Nov 2009 20:04:31 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAOK4VOS028289; Tue, 24 Nov 2009 20:04:31 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200911242004.nAOK4VOS028289@svn.freebsd.org> From: Marius Strobl Date: Tue, 24 Nov 2009 20:04:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199765 - stable/8/sys/sparc64/sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Nov 2009 20:04:32 -0000 Author: marius Date: Tue Nov 24 20:04:31 2009 New Revision: 199765 URL: http://svn.freebsd.org/changeset/base/199765 Log: MFC: r199442 Unroll copying of the registers in {g,s}et_mcontext() and limit it to the set actually restored by tl0_ret() instead of using the whole trapframe. Additionally skip %g7 as that register is used as the userland TLS pointer. PR: 140523 Modified: stable/8/sys/sparc64/sparc64/machdep.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/sparc64/sparc64/machdep.c ============================================================================== --- stable/8/sys/sparc64/sparc64/machdep.c Tue Nov 24 19:57:41 2009 (r199764) +++ stable/8/sys/sparc64/sparc64/machdep.c Tue Nov 24 20:04:31 2009 (r199765) @@ -696,12 +696,39 @@ get_mcontext(struct thread *td, mcontext tf = td->td_frame; pcb = td->td_pcb; - bcopy(tf, mc, sizeof(*tf)); + /* + * Copy the registers which will be restored by tl0_ret() from the + * trapframe. + * Note that we skip %g7 which is used as the userland TLS register + * and %wstate. + */ + mc->mc_flags = _MC_VERSION; + mc->mc_global[1] = tf->tf_global[1]; + mc->mc_global[2] = tf->tf_global[2]; + mc->mc_global[3] = tf->tf_global[3]; + mc->mc_global[4] = tf->tf_global[4]; + mc->mc_global[5] = tf->tf_global[5]; + mc->mc_global[6] = tf->tf_global[6]; if (flags & GET_MC_CLEAR_RET) { mc->mc_out[0] = 0; mc->mc_out[1] = 0; + } else { + mc->mc_out[0] = tf->tf_out[0]; + mc->mc_out[1] = tf->tf_out[1]; } - mc->mc_flags = _MC_VERSION; + mc->mc_out[2] = tf->tf_out[2]; + mc->mc_out[3] = tf->tf_out[3]; + mc->mc_out[4] = tf->tf_out[4]; + mc->mc_out[5] = tf->tf_out[5]; + mc->mc_out[6] = tf->tf_out[6]; + mc->mc_out[7] = tf->tf_out[7]; + mc->mc_fprs = tf->tf_fprs; + mc->mc_fsr = tf->tf_fsr; + mc->mc_gsr = tf->tf_gsr; + mc->mc_tnpc = tf->tf_tnpc; + mc->mc_tpc = tf->tf_tpc; + mc->mc_tstate = tf->tf_tstate; + mc->mc_y = tf->tf_y; critical_enter(); if ((tf->tf_fprs & FPRS_FEF) != 0) { savefpctx(pcb->pcb_ufp); @@ -721,7 +748,6 @@ set_mcontext(struct thread *td, const mc { struct trapframe *tf; struct pcb *pcb; - uint64_t wstate; if (!TSTATE_SECURE(mc->mc_tstate) || (mc->mc_flags & ((1L << _MC_VERSION_BITS) - 1)) != _MC_VERSION) @@ -730,9 +756,33 @@ set_mcontext(struct thread *td, const mc pcb = td->td_pcb; /* Make sure the windows are spilled first. */ flushw(); - wstate = tf->tf_wstate; - bcopy(mc, tf, sizeof(*tf)); - tf->tf_wstate = wstate; + /* + * Copy the registers which will be restored by tl0_ret() to the + * trapframe. + * Note that we skip %g7 which is used as the userland TLS register + * and %wstate. + */ + tf->tf_global[1] = mc->mc_global[1]; + tf->tf_global[2] = mc->mc_global[2]; + tf->tf_global[3] = mc->mc_global[3]; + tf->tf_global[4] = mc->mc_global[4]; + tf->tf_global[5] = mc->mc_global[5]; + tf->tf_global[6] = mc->mc_global[6]; + tf->tf_out[0] = mc->mc_out[0]; + tf->tf_out[1] = mc->mc_out[1]; + tf->tf_out[2] = mc->mc_out[2]; + tf->tf_out[3] = mc->mc_out[3]; + tf->tf_out[4] = mc->mc_out[4]; + tf->tf_out[5] = mc->mc_out[5]; + tf->tf_out[6] = mc->mc_out[6]; + tf->tf_out[7] = mc->mc_out[7]; + tf->tf_fprs = mc->mc_fprs; + tf->tf_fsr = mc->mc_fsr; + tf->tf_gsr = mc->mc_gsr; + tf->tf_tnpc = mc->mc_tnpc; + tf->tf_tpc = mc->mc_tpc; + tf->tf_tstate = mc->mc_tstate; + tf->tf_y = mc->mc_y; if ((mc->mc_fprs & FPRS_FEF) != 0) { tf->tf_fprs = 0; bcopy(mc->mc_fp, pcb->pcb_ufp, sizeof(pcb->pcb_ufp)); From owner-svn-src-all@FreeBSD.ORG Tue Nov 24 20:11:03 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A64B41065676; Tue, 24 Nov 2009 20:11:03 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 7475F8FC28; Tue, 24 Nov 2009 20:11:03 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 2B34246B1A; Tue, 24 Nov 2009 15:11:03 -0500 (EST) Received: from jhbbsd.localnet (unknown [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPA id 67DE98A01B; Tue, 24 Nov 2009 15:11:02 -0500 (EST) From: John Baldwin To: Marcel Moolenaar Date: Tue, 24 Nov 2009 15:10:57 -0500 User-Agent: KMail/1.12.1 (FreeBSD/7.2-CBSD-20091103; KDE/4.3.1; amd64; ; ) References: <200911240317.nAO3H0P6003552@svn.freebsd.org> <200911241432.50925.jhb@freebsd.org> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200911241510.57232.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Tue, 24 Nov 2009 15:11:02 -0500 (EST) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=4.2 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: Marcel Moolenaar , svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org, Max Laier Subject: Re: svn commit: r199729 - stable/8/sys/ia64/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Nov 2009 20:11:04 -0000 On Tuesday 24 November 2009 2:55:53 pm Marcel Moolenaar wrote: > *snip* > > >>>>> These MFCs seem to be missing mergeinfo for the contrib directories. > >>>> > >>>> I pruned them. We don't seem to get rid of merge into in the > >>>> wrong directories even even people try to clean it up... > >>> > >>> That was the wrong thing to do. > >> > >> *sigh* > >> > >> I can't keep up with this... > > > > Generally you can just commit whatever svn merge gives you. Having a few > > extra properties in the kernel tree is "normal" for stable/[678]. (I think > > stable/6 only has one extra: contrib/pf). I do try to clean up merges into > > the wrong directories, but in the case of vendor merges there isn't anything > > to clean unless we reorganize the vendor-sys trees so that they always merge > > to sys. > > Do you want me to --record-only what I pruned or can we leave it > as is with the note not to prune? You can just leave it as it is in this case I think. In the cases when I do find mergeinfo that I can prune I will generally find missing info like this and fix it up when doing the prune. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Tue Nov 24 20:31:44 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A3E791065670; Tue, 24 Nov 2009 20:31:44 +0000 (UTC) (envelope-from xcllnt@mac.com) Received: from asmtpout028.mac.com (asmtpout028.mac.com [17.148.16.103]) by mx1.freebsd.org (Postfix) with ESMTP id 881248FC0A; Tue, 24 Nov 2009 20:31:44 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; charset=us-ascii Received: from macbook-pro.jnpr.net (natint3.juniper.net [66.129.224.36]) by asmtp028.mac.com (Sun Java(tm) System Messaging Server 6.3-8.01 (built Dec 16 2008; 32bit)) with ESMTPSA id <0KTM00LO1ROSWJ20@asmtp028.mac.com>; Tue, 24 Nov 2009 12:31:44 -0800 (PST) From: Marcel Moolenaar In-reply-to: <200911241510.57232.jhb@freebsd.org> Date: Tue, 24 Nov 2009 12:31:40 -0800 Message-id: <39B700FA-6C21-4A7C-9375-E67AC9EC16EF@mac.com> References: <200911240317.nAO3H0P6003552@svn.freebsd.org> <200911241432.50925.jhb@freebsd.org> <200911241510.57232.jhb@freebsd.org> To: John Baldwin X-Mailer: Apple Mail (2.1077) Cc: Marcel Moolenaar , svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org, Max Laier Subject: Re: svn commit: r199729 - stable/8/sys/ia64/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Nov 2009 20:31:44 -0000 On Nov 24, 2009, at 12:10 PM, John Baldwin wrote: > On Tuesday 24 November 2009 2:55:53 pm Marcel Moolenaar wrote: >> *snip* >> >>>>>>> These MFCs seem to be missing mergeinfo for the contrib directories. >>>>>> >>>>>> I pruned them. We don't seem to get rid of merge into in the >>>>>> wrong directories even even people try to clean it up... >>>>> >>>>> That was the wrong thing to do. >>>> >>>> *sigh* >>>> >>>> I can't keep up with this... >>> >>> Generally you can just commit whatever svn merge gives you. Having a few >>> extra properties in the kernel tree is "normal" for stable/[678]. (I think >>> stable/6 only has one extra: contrib/pf). I do try to clean up merges into >>> the wrong directories, but in the case of vendor merges there isn't anything >>> to clean unless we reorganize the vendor-sys trees so that they always merge >>> to sys. >> >> Do you want me to --record-only what I pruned or can we leave it >> as is with the note not to prune? > > You can just leave it as it is in this case I think. In the cases when I do find > mergeinfo that I can prune I will generally find missing info like this and fix it up > when doing the prune. Thanks, I appreciate it! -- Marcel Moolenaar xcllnt@mac.com From owner-svn-src-all@FreeBSD.ORG Tue Nov 24 22:13:07 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EB84A106568D; Tue, 24 Nov 2009 22:13:06 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D9A3F8FC13; Tue, 24 Nov 2009 22:13:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAOMD6PM030924; Tue, 24 Nov 2009 22:13:06 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAOMD6Yk030922; Tue, 24 Nov 2009 22:13:06 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200911242213.nAOMD6Yk030922@svn.freebsd.org> From: Marius Strobl Date: Tue, 24 Nov 2009 22:13:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199768 - stable/7/sys/sparc64/sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Nov 2009 22:13:07 -0000 Author: marius Date: Tue Nov 24 22:13:06 2009 New Revision: 199768 URL: http://svn.freebsd.org/changeset/base/199768 Log: MFC: r199442 Unroll copying of the registers in {g,s}et_mcontext() and limit it to the set actually restored by tl0_ret() instead of using the whole trapframe. Additionally skip %g7 as that register is used as the userland TLS pointer. PR: 140523 Modified: stable/7/sys/sparc64/sparc64/machdep.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/sparc64/sparc64/machdep.c ============================================================================== --- stable/7/sys/sparc64/sparc64/machdep.c Tue Nov 24 21:06:41 2009 (r199767) +++ stable/7/sys/sparc64/sparc64/machdep.c Tue Nov 24 22:13:06 2009 (r199768) @@ -695,12 +695,39 @@ get_mcontext(struct thread *td, mcontext tf = td->td_frame; pcb = td->td_pcb; - bcopy(tf, mc, sizeof(*tf)); + /* + * Copy the registers which will be restored by tl0_ret() from the + * trapframe. + * Note that we skip %g7 which is used as the userland TLS register + * and %wstate. + */ + mc->mc_flags = _MC_VERSION; + mc->mc_global[1] = tf->tf_global[1]; + mc->mc_global[2] = tf->tf_global[2]; + mc->mc_global[3] = tf->tf_global[3]; + mc->mc_global[4] = tf->tf_global[4]; + mc->mc_global[5] = tf->tf_global[5]; + mc->mc_global[6] = tf->tf_global[6]; if (flags & GET_MC_CLEAR_RET) { mc->mc_out[0] = 0; mc->mc_out[1] = 0; + } else { + mc->mc_out[0] = tf->tf_out[0]; + mc->mc_out[1] = tf->tf_out[1]; } - mc->mc_flags = _MC_VERSION; + mc->mc_out[2] = tf->tf_out[2]; + mc->mc_out[3] = tf->tf_out[3]; + mc->mc_out[4] = tf->tf_out[4]; + mc->mc_out[5] = tf->tf_out[5]; + mc->mc_out[6] = tf->tf_out[6]; + mc->mc_out[7] = tf->tf_out[7]; + mc->mc_fprs = tf->tf_fprs; + mc->mc_fsr = tf->tf_fsr; + mc->mc_gsr = tf->tf_gsr; + mc->mc_tnpc = tf->tf_tnpc; + mc->mc_tpc = tf->tf_tpc; + mc->mc_tstate = tf->tf_tstate; + mc->mc_y = tf->tf_y; critical_enter(); if ((tf->tf_fprs & FPRS_FEF) != 0) { savefpctx(pcb->pcb_ufp); @@ -720,7 +747,6 @@ set_mcontext(struct thread *td, const mc { struct trapframe *tf; struct pcb *pcb; - uint64_t wstate; if (!TSTATE_SECURE(mc->mc_tstate) || (mc->mc_flags & ((1L << _MC_VERSION_BITS) - 1)) != _MC_VERSION) @@ -729,9 +755,33 @@ set_mcontext(struct thread *td, const mc pcb = td->td_pcb; /* Make sure the windows are spilled first. */ flushw(); - wstate = tf->tf_wstate; - bcopy(mc, tf, sizeof(*tf)); - tf->tf_wstate = wstate; + /* + * Copy the registers which will be restored by tl0_ret() to the + * trapframe. + * Note that we skip %g7 which is used as the userland TLS register + * and %wstate. + */ + tf->tf_global[1] = mc->mc_global[1]; + tf->tf_global[2] = mc->mc_global[2]; + tf->tf_global[3] = mc->mc_global[3]; + tf->tf_global[4] = mc->mc_global[4]; + tf->tf_global[5] = mc->mc_global[5]; + tf->tf_global[6] = mc->mc_global[6]; + tf->tf_out[0] = mc->mc_out[0]; + tf->tf_out[1] = mc->mc_out[1]; + tf->tf_out[2] = mc->mc_out[2]; + tf->tf_out[3] = mc->mc_out[3]; + tf->tf_out[4] = mc->mc_out[4]; + tf->tf_out[5] = mc->mc_out[5]; + tf->tf_out[6] = mc->mc_out[6]; + tf->tf_out[7] = mc->mc_out[7]; + tf->tf_fprs = mc->mc_fprs; + tf->tf_fsr = mc->mc_fsr; + tf->tf_gsr = mc->mc_gsr; + tf->tf_tnpc = mc->mc_tnpc; + tf->tf_tpc = mc->mc_tpc; + tf->tf_tstate = mc->mc_tstate; + tf->tf_y = mc->mc_y; if ((mc->mc_fprs & FPRS_FEF) != 0) { tf->tf_fprs = 0; bcopy(mc->mc_fp, pcb->pcb_ufp, sizeof(pcb->pcb_ufp)); From owner-svn-src-all@FreeBSD.ORG Wed Nov 25 00:00:57 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E3F221065694; Wed, 25 Nov 2009 00:00:57 +0000 (UTC) (envelope-from will@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D314D8FC15; Wed, 25 Nov 2009 00:00:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAP00vgi033400; Wed, 25 Nov 2009 00:00:57 GMT (envelope-from will@svn.freebsd.org) Received: (from will@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAP00vnl033398; Wed, 25 Nov 2009 00:00:57 GMT (envelope-from will@svn.freebsd.org) Message-Id: <200911250000.nAP00vnl033398@svn.freebsd.org> From: Will Andrews Date: Wed, 25 Nov 2009 00:00:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199770 - head/sbin/ifconfig X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Nov 2009 00:00:58 -0000 Author: will Date: Wed Nov 25 00:00:57 2009 New Revision: 199770 URL: http://svn.freebsd.org/changeset/base/199770 Log: Make ``ifconfig -l ether'' only list interfaces that speak Ethernet. PR: 118987 Approved by: ken (mentor) Modified: head/sbin/ifconfig/ifconfig.c Modified: head/sbin/ifconfig/ifconfig.c ============================================================================== --- head/sbin/ifconfig/ifconfig.c Tue Nov 24 22:37:04 2009 (r199769) +++ head/sbin/ifconfig/ifconfig.c Wed Nov 25 00:00:57 2009 (r199770) @@ -147,7 +147,7 @@ main(int argc, char *argv[]) struct ifaddrs *ifap, *ifa; struct ifreq paifr; const struct sockaddr_dl *sdl; - char options[1024], *cp; + char options[1024], *cp, *namecp = NULL; const char *ifname; struct option *p; size_t iflen; @@ -294,7 +294,7 @@ main(int argc, char *argv[]) sdl = (const struct sockaddr_dl *) ifa->ifa_addr; else sdl = NULL; - if (cp != NULL && strcmp(cp, ifa->ifa_name) == 0) + if (cp != NULL && strcmp(cp, ifa->ifa_name) == 0 && !namesonly) continue; iflen = strlcpy(name, ifa->ifa_name, sizeof(name)); if (iflen >= sizeof(name)) { @@ -308,16 +308,32 @@ main(int argc, char *argv[]) continue; if (uponly && (ifa->ifa_flags & IFF_UP) == 0) continue; - ifindex++; /* * Are we just listing the interfaces? */ if (namesonly) { + if (namecp == cp) + continue; + if (afp != NULL) { + /* special case for "ether" address family */ + if (!strcmp(afp->af_name, "ether")) { + if (sdl == NULL || + sdl->sdl_type != IFT_ETHER || + sdl->sdl_alen != ETHER_ADDR_LEN) + continue; + } else { + if (ifa->ifa_addr->sa_family != afp->af_af) + continue; + } + } + namecp = cp; + ifindex++; if (ifindex > 1) printf(" "); fputs(name, stdout); continue; } + ifindex++; if (argc > 0) ifconfig(argc, argv, 0, afp); From owner-svn-src-all@FreeBSD.ORG Wed Nov 25 01:19:09 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D5C67106566B; Wed, 25 Nov 2009 01:19:09 +0000 (UTC) (envelope-from juli@clockworksquid.com) Received: from mail-px0-f182.google.com (mail-px0-f182.google.com [209.85.216.182]) by mx1.freebsd.org (Postfix) with ESMTP id A85508FC1A; Wed, 25 Nov 2009 01:19:09 +0000 (UTC) Received: by pxi12 with SMTP id 12so5245721pxi.3 for ; Tue, 24 Nov 2009 17:19:09 -0800 (PST) MIME-Version: 1.0 Sender: juli@clockworksquid.com Received: by 10.142.60.19 with SMTP id i19mr754552wfa.315.1259111949196; Tue, 24 Nov 2009 17:19:09 -0800 (PST) In-Reply-To: <200911221651.nAMGpiIO023873@svn.freebsd.org> References: <200911221651.nAMGpiIO023873@svn.freebsd.org> From: Juli Mallett Date: Tue, 24 Nov 2009 17:18:49 -0800 X-Google-Sender-Auth: d649427cbcafb050 Message-ID: To: Hajimu UMEMOTO Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r199655 - head/usr.bin/w X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Nov 2009 01:19:09 -0000 I'm not sure this is right. While the manpage implies that doing no resolution means that it will show numeric addresses, since that is not correct, there are two ways to go. As you have done, you can choose to try to resolve hostnames to IP addresses. You could also do as the code before did and do no resolution. I frequently use 'w -n' on systems with slow nameservers to see who is logged in without triggering a bunch of DNS traffic that I then have to wait for. Trying to resolve the name to a numeric address presents that problem. Since it is not possible to always show a numeric address (if, for example, the hostname is no longer valid) I'm not sure that this is the right direction to try to go with 'w -n'. On Sun, Nov 22, 2009 at 08:51, Hajimu UMEMOTO wrote: > Author: ume > Date: Sun Nov 22 16:51:44 2009 > New Revision: 199655 > URL: http://svn.freebsd.org/changeset/base/199655 > > Log: > =A0When -n is specified, attempt to turn hostnames found in utmp into IP > =A0addresses, again. =A0However, change a hostname into an IP address, on= ly > =A0when a host has just one A/AAAA RR. > > =A0Requested by: candy__at__kgc.co.jp > =A0MFC after: =A0 =A02 weeks > > Modified: > =A0head/usr.bin/w/w.c > > Modified: head/usr.bin/w/w.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/usr.bin/w/w.c =A0Sun Nov 22 16:13:16 2009 =A0 =A0 =A0 =A0(r19965= 4) > +++ head/usr.bin/w/w.c =A0Sun Nov 22 16:51:44 2009 =A0 =A0 =A0 =A0(r19965= 5) > @@ -348,6 +348,7 @@ main(int argc, char *argv[]) > > =A0 =A0 =A0 =A0for (ep =3D ehead; ep !=3D NULL; ep =3D ep->next) { > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0char host_buf[UT_HOSTSIZE + 1]; > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 struct addrinfo hints, *res; > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0struct sockaddr_storage ss; > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0struct sockaddr *sa =3D (struct sockaddr *= )&ss; > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0struct sockaddr_in *lsin =3D (struct socka= ddr_in *)&ss; > @@ -365,23 +366,42 @@ main(int argc, char *argv[]) > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0else > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0x_suffix = =3D NULL; > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0} > + > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 isaddr =3D 0; > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 memset(&ss, '\0', sizeof(ss)); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (inet_pton(AF_INET6, p, &lsin6->sin6_add= r) =3D=3D 1) { > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 lsin6->sin6_len =3D sizeof(= *lsin6); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 lsin6->sin6_family =3D AF_I= NET6; > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 isaddr =3D 1; > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 } else if (inet_pton(AF_INET, p, &lsin->sin= _addr) =3D=3D 1) { > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 lsin->sin_len =3D sizeof(*l= sin); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 lsin->sin_family =3D AF_INE= T; > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 isaddr =3D 1; > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 } > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (!nflag) { > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0/* Attempt to change an IP= address into a name */ > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 isaddr =3D 0; > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 memset(&ss, '\0', sizeof(ss= )); > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (inet_pton(AF_INET6, p, = &lsin6->sin6_addr) =3D=3D 1) { > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 lsin6->sin6= _len =3D sizeof(*lsin6); > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 lsin6->sin6= _family =3D AF_INET6; > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 isaddr =3D = 1; > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 } else if (inet_pton(AF_INE= T, p, &lsin->sin_addr) =3D=3D 1) { > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 lsin->sin_l= en =3D sizeof(*lsin); > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 lsin->sin_f= amily =3D AF_INET; > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 isaddr =3D = 1; > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 } > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (isaddr && realhostname= _sa(fn, sizeof(fn), sa, > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0sa->sa_len) =3D=3D= HOSTNAME_FOUND) > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0p =3D fn; > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 } else if (!isaddr) { > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 /* > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0* If a host has only one= A/AAAA RR, change a > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0* name into an IP addres= s > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0*/ > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 memset(&hints, 0, sizeof(hi= nts)); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 hints.ai_flags =3D AI_PASSI= VE; > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 hints.ai_family =3D AF_UNSP= EC; > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 hints.ai_socktype =3D SOCK_= STREAM; > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (getaddrinfo(p, NULL, &h= ints, &res) =3D=3D 0) { > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (res->ai= _next =3D=3D NULL && > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 get= nameinfo(res->ai_addr, res->ai_addrlen, > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 fn, sizeof(fn), NULL, 0, > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 NI_NUMERICHOST) =3D=3D 0) > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 p =3D fn; > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 freeaddrinf= o(res); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 } > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0} > + > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (x_suffix) { > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0(void)snprintf(buf, sizeof= (buf), "%s:%s", p, x_suffix); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0p =3D buf; > From owner-svn-src-all@FreeBSD.ORG Wed Nov 25 01:50:18 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2509A1065672; Wed, 25 Nov 2009 01:50:18 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 133838FC19; Wed, 25 Nov 2009 01:50:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAP1oH8w035463; Wed, 25 Nov 2009 01:50:17 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAP1oHvL035461; Wed, 25 Nov 2009 01:50:17 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200911250150.nAP1oHvL035461@svn.freebsd.org> From: Kip Macy Date: Wed, 25 Nov 2009 01:50:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199771 - stable/8/sys/dev/xen/blkfront X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Nov 2009 01:50:18 -0000 Author: kmacy Date: Wed Nov 25 01:50:17 2009 New Revision: 199771 URL: http://svn.freebsd.org/changeset/base/199771 Log: MFC core dump support Modified: stable/8/sys/dev/xen/blkfront/blkfront.c Modified: stable/8/sys/dev/xen/blkfront/blkfront.c ============================================================================== --- stable/8/sys/dev/xen/blkfront/blkfront.c Wed Nov 25 00:00:57 2009 (r199770) +++ stable/8/sys/dev/xen/blkfront/blkfront.c Wed Nov 25 01:50:17 2009 (r199771) @@ -16,7 +16,9 @@ */ /* - * XenoBSD block device driver + * XenBSD block device driver + * + * Copyright (c) 2009 Frank Suchomel, Citrix */ #include @@ -122,6 +124,10 @@ static int blkif_ioctl(struct disk *dp, static int blkif_queue_request(struct bio *bp); static void xb_strategy(struct bio *bp); +// In order to quiesce the device during kernel dumps, outstanding requests to +// DOM0 for disk reads/writes need to be accounted for. +static int blkif_queued_requests; +static int xb_dump(void *, void *, vm_offset_t, off_t, size_t); /* XXX move to xb_vbd.c when VBD update support is added */ @@ -231,6 +237,7 @@ xlvbd_add(device_t dev, blkif_sector_t c sc->xb_disk->d_close = blkif_close; sc->xb_disk->d_ioctl = blkif_ioctl; sc->xb_disk->d_strategy = xb_strategy; + sc->xb_disk->d_dump = xb_dump; sc->xb_disk->d_name = name; sc->xb_disk->d_drv1 = sc; sc->xb_disk->d_sectorsize = sector_size; @@ -286,9 +293,10 @@ xb_strategy(struct bio *bp) * Place it in the queue of disk activities for this disk */ mtx_lock(&blkif_io_lock); - bioq_disksort(&sc->xb_bioq, bp); + bioq_disksort(&sc->xb_bioq, bp); xb_startio(sc); + mtx_unlock(&blkif_io_lock); return; @@ -301,6 +309,81 @@ xb_strategy(struct bio *bp) return; } +static void xb_quiesce(struct blkfront_info *info); +// Quiesce the disk writes for a dump file before allowing the next buffer. +static void +xb_quiesce(struct blkfront_info *info) +{ + int mtd; + + // While there are outstanding requests + while (blkif_queued_requests) { + RING_FINAL_CHECK_FOR_RESPONSES(&info->ring, mtd); + if (mtd) { + // Recieved request completions, update queue. + blkif_int(info); + } + if (blkif_queued_requests) { + // Still pending requests, wait for the disk i/o to complete + HYPERVISOR_yield(); + } + } +} + +// Some bio structures for dumping core +#define DUMP_BIO_NO 16 // 16 * 4KB = 64KB dump block +static struct bio xb_dump_bp[DUMP_BIO_NO]; + +// Kernel dump function for a paravirtualized disk device +static int +xb_dump(void *arg, void *virtual, vm_offset_t physical, off_t offset, + size_t length) +{ + int sbp; + int mbp; + size_t chunk; + struct disk *dp = arg; + struct xb_softc *sc = (struct xb_softc *) dp->d_drv1; + int rc = 0; + + xb_quiesce(sc->xb_info); // All quiet on the western front. + if (length > 0) { + // If this lock is held, then this module is failing, and a successful + // kernel dump is highly unlikely anyway. + mtx_lock(&blkif_io_lock); + // Split the 64KB block into 16 4KB blocks + for (sbp=0; length>0 && sbp PAGE_SIZE ? PAGE_SIZE : length; + xb_dump_bp[sbp].bio_disk = dp; + xb_dump_bp[sbp].bio_pblkno = offset / dp->d_sectorsize; + xb_dump_bp[sbp].bio_bcount = chunk; + xb_dump_bp[sbp].bio_resid = chunk; + xb_dump_bp[sbp].bio_data = virtual; + xb_dump_bp[sbp].bio_cmd = BIO_WRITE; + xb_dump_bp[sbp].bio_done = NULL; + + bioq_disksort(&sc->xb_bioq, &xb_dump_bp[sbp]); + + length -= chunk; + offset += chunk; + virtual = (char *) virtual + chunk; + } + // Tell DOM0 to do the I/O + xb_startio(sc); + mtx_unlock(&blkif_io_lock); + + // Must wait for the completion: the dump routine reuses the same + // 16 x 4KB buffer space. + xb_quiesce(sc->xb_info); // All quite on the eastern front + // If there were any errors, bail out... + for (mbp=0; mbp RING_SIZE", nfree)); info->shadow_free = info->shadow[nfree].req.id; info->shadow[nfree].req.id = 0x0fffffee; /* debug */ + atomic_add_int(&blkif_queued_requests, 1); return nfree; } @@ -655,6 +739,7 @@ ADD_ID_TO_FREELIST(struct blkfront_info info->shadow[id].req.id = info->shadow_free; info->shadow[id].request = 0; info->shadow_free = id; + atomic_subtract_int(&blkif_queued_requests, 1); } static inline void From owner-svn-src-all@FreeBSD.ORG Wed Nov 25 01:51:08 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 581AA106568F; Wed, 25 Nov 2009 01:51:08 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 46F318FC14; Wed, 25 Nov 2009 01:51:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAP1p8mC035514; Wed, 25 Nov 2009 01:51:08 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAP1p88j035512; Wed, 25 Nov 2009 01:51:08 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200911250151.nAP1p88j035512@svn.freebsd.org> From: Kip Macy Date: Wed, 25 Nov 2009 01:51:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199772 - stable/8/sys/dev/xen/console X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Nov 2009 01:51:08 -0000 Author: kmacy Date: Wed Nov 25 01:51:07 2009 New Revision: 199772 URL: http://svn.freebsd.org/changeset/base/199772 Log: remove gratuitous comment Modified: stable/8/sys/dev/xen/console/console.c Modified: stable/8/sys/dev/xen/console/console.c ============================================================================== --- stable/8/sys/dev/xen/console/console.c Wed Nov 25 01:50:17 2009 (r199771) +++ stable/8/sys/dev/xen/console/console.c Wed Nov 25 01:51:07 2009 (r199772) @@ -152,7 +152,6 @@ xccncheckc(struct consdev *dev) CN_LOCK(cn_mtx); if ((rp - rc)) { - /* if (kdb_active) printf("%s:%d\n", __func__, __LINE__); */ /* we need to return only one char */ ret = (int)rbuf[RBUF_MASK(rc)]; rc++; From owner-svn-src-all@FreeBSD.ORG Wed Nov 25 01:52:36 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7E8C5106566C; Wed, 25 Nov 2009 01:52:36 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6C0508FC14; Wed, 25 Nov 2009 01:52:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAP1qal6035579; Wed, 25 Nov 2009 01:52:36 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAP1qaet035574; Wed, 25 Nov 2009 01:52:36 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200911250152.nAP1qaet035574@svn.freebsd.org> From: Kip Macy Date: Wed, 25 Nov 2009 01:52:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199773 - in stable/8/sys/i386: i386 include xen X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Nov 2009 01:52:36 -0000 Author: kmacy Date: Wed Nov 25 01:52:36 2009 New Revision: 199773 URL: http://svn.freebsd.org/changeset/base/199773 Log: MFC xen pmap updates and eflags fixes Modified: stable/8/sys/i386/i386/vm_machdep.c stable/8/sys/i386/include/cpufunc.h stable/8/sys/i386/xen/pmap.c stable/8/sys/i386/xen/xen_machdep.c Modified: stable/8/sys/i386/i386/vm_machdep.c ============================================================================== --- stable/8/sys/i386/i386/vm_machdep.c Wed Nov 25 01:51:07 2009 (r199772) +++ stable/8/sys/i386/i386/vm_machdep.c Wed Nov 25 01:52:36 2009 (r199773) @@ -61,6 +61,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -270,11 +271,7 @@ cpu_fork(td1, p2, td2, flags) /* * XXX XEN need to check on PSL_USER is handled */ -#ifdef XEN - td2->td_md.md_saved_flags = 0; -#else td2->td_md.md_saved_flags = PSL_KERNEL | PSL_I; -#endif /* * Now, cpu_switch() can schedule the new process. * pcb_esp is loaded pointing to the cpu_switch() stack frame @@ -446,11 +443,7 @@ cpu_set_upcall(struct thread *td, struct /* Setup to release spin count in fork_exit(). */ td->td_md.md_spinlock_count = 1; -#ifdef XEN - td->td_md.md_saved_flags = 0; -#else td->td_md.md_saved_flags = PSL_KERNEL | PSL_I; -#endif } /* Modified: stable/8/sys/i386/include/cpufunc.h ============================================================================== --- stable/8/sys/i386/include/cpufunc.h Wed Nov 25 01:51:07 2009 (r199772) +++ stable/8/sys/i386/include/cpufunc.h Wed Nov 25 01:52:36 2009 (r199773) @@ -49,8 +49,8 @@ extern u_int xen_rcr2(void); extern void xen_load_cr3(u_int data); extern void xen_tlb_flush(void); extern void xen_invlpg(u_int addr); -extern int xen_save_and_cli(void); -extern void xen_restore_flags(u_int eflags); +extern void write_eflags(u_int eflags); +extern u_int read_eflags(void); #endif struct region_descriptor; @@ -293,7 +293,11 @@ ia32_pause(void) } static __inline u_int +#ifdef XEN +_read_eflags(void) +#else read_eflags(void) +#endif { u_int ef; @@ -335,7 +339,11 @@ wbinvd(void) } static __inline void +#ifdef XEN +_write_eflags(u_int ef) +#else write_eflags(u_int ef) +#endif { __asm __volatile("pushl %0; popfl" : : "r" (ef)); } @@ -653,23 +661,15 @@ intr_disable(void) { register_t eflags; -#ifdef XEN - eflags = xen_save_and_cli(); -#else eflags = read_eflags(); disable_intr(); -#endif return (eflags); } static __inline void intr_restore(register_t eflags) { -#ifdef XEN - xen_restore_flags(eflags); -#else write_eflags(eflags); -#endif } #else /* !(__GNUCLIKE_ASM && __CC_SUPPORTS___INLINE) */ Modified: stable/8/sys/i386/xen/pmap.c ============================================================================== --- stable/8/sys/i386/xen/pmap.c Wed Nov 25 01:51:07 2009 (r199772) +++ stable/8/sys/i386/xen/pmap.c Wed Nov 25 01:52:36 2009 (r199773) @@ -223,6 +223,8 @@ static uma_zone_t pdptzone; #endif #endif +static int pat_works; /* Is page attribute table sane? */ + /* * Data for the pv entry allocation mechanism */ @@ -277,7 +279,7 @@ static struct mtx PMAP2mutex; SYSCTL_NODE(_vm, OID_AUTO, pmap, CTLFLAG_RD, 0, "VM/pmap parameters"); static int pg_ps_enabled; -SYSCTL_INT(_vm_pmap, OID_AUTO, pg_ps_enabled, CTLFLAG_RD, &pg_ps_enabled, 0, +SYSCTL_INT(_vm_pmap, OID_AUTO, pg_ps_enabled, CTLFLAG_RDTUN, &pg_ps_enabled, 0, "Are large page mappings enabled?"); SYSCTL_INT(_vm_pmap, OID_AUTO, pv_entry_max, CTLFLAG_RD, &pv_entry_max, 0, @@ -311,6 +313,7 @@ static vm_offset_t pmap_kmem_choose(vm_o static boolean_t pmap_is_prefaultable_locked(pmap_t pmap, vm_offset_t addr); static void pmap_kenter_attr(vm_offset_t va, vm_paddr_t pa, int mode); +static __inline void pagezero(void *page); #if defined(PAE) && !defined(XEN) static void *pmap_pdpt_allocf(uma_zone_t zone, int bytes, u_int8_t *flags, int wait); @@ -328,22 +331,6 @@ CTASSERT(KERNBASE % (1 << 24) == 0); -static __inline void -pagezero(void *page) -{ -#if defined(I686_CPU) - if (cpu_class == CPUCLASS_686) { -#if defined(CPU_ENABLE_SSE) - if (cpu_feature & CPUID_SSE2) - sse2_pagezero(page); - else -#endif - i686_pagezero(page); - } else -#endif - bzero(page, PAGE_SIZE); -} - void pd_set(struct pmap *pmap, int ptepindex, vm_paddr_t val, int type) { @@ -529,33 +516,36 @@ pmap_init_pat(void) if (!(cpu_feature & CPUID_PAT)) return; -#ifdef PAT_WORKS - /* - * Leave the indices 0-3 at the default of WB, WT, UC, and UC-. - * Program 4 and 5 as WP and WC. - * Leave 6 and 7 as UC and UC-. - */ - pat_msr = rdmsr(MSR_PAT); - pat_msr &= ~(PAT_MASK(4) | PAT_MASK(5)); - pat_msr |= PAT_VALUE(4, PAT_WRITE_PROTECTED) | - PAT_VALUE(5, PAT_WRITE_COMBINING); -#else - /* - * Due to some Intel errata, we can only safely use the lower 4 - * PAT entries. Thus, just replace PAT Index 2 with WC instead - * of UC-. - * - * Intel Pentium III Processor Specification Update - * Errata E.27 (Upper Four PAT Entries Not Usable With Mode B - * or Mode C Paging) - * - * Intel Pentium IV Processor Specification Update - * Errata N46 (PAT Index MSB May Be Calculated Incorrectly) - */ - pat_msr = rdmsr(MSR_PAT); - pat_msr &= ~PAT_MASK(2); - pat_msr |= PAT_VALUE(2, PAT_WRITE_COMBINING); -#endif + if (cpu_vendor_id != CPU_VENDOR_INTEL || + (CPUID_TO_FAMILY(cpu_id) == 6 && CPUID_TO_MODEL(cpu_id) >= 0xe)) { + /* + * Leave the indices 0-3 at the default of WB, WT, UC, and UC-. + * Program 4 and 5 as WP and WC. + * Leave 6 and 7 as UC and UC-. + */ + pat_msr = rdmsr(MSR_PAT); + pat_msr &= ~(PAT_MASK(4) | PAT_MASK(5)); + pat_msr |= PAT_VALUE(4, PAT_WRITE_PROTECTED) | + PAT_VALUE(5, PAT_WRITE_COMBINING); + pat_works = 1; + } else { + /* + * Due to some Intel errata, we can only safely use the lower 4 + * PAT entries. Thus, just replace PAT Index 2 with WC instead + * of UC-. + * + * Intel Pentium III Processor Specification Update + * Errata E.27 (Upper Four PAT Entries Not Usable With Mode B + * or Mode C Paging) + * + * Intel Pentium IV Processor Specification Update + * Errata N46 (PAT Index MSB May Be Calculated Incorrectly) + */ + pat_msr = rdmsr(MSR_PAT); + pat_msr &= ~PAT_MASK(2); + pat_msr |= PAT_VALUE(2, PAT_WRITE_COMBINING); + pat_works = 0; + } wrmsr(MSR_PAT, pat_msr); } @@ -784,44 +774,48 @@ pmap_cache_bits(int mode, boolean_t is_p } /* Map the caching mode to a PAT index. */ - switch (mode) { -#ifdef PAT_WORKS - case PAT_UNCACHEABLE: - pat_index = 3; - break; - case PAT_WRITE_THROUGH: - pat_index = 1; - break; - case PAT_WRITE_BACK: - pat_index = 0; - break; - case PAT_UNCACHED: - pat_index = 2; - break; - case PAT_WRITE_COMBINING: - pat_index = 5; - break; - case PAT_WRITE_PROTECTED: - pat_index = 4; - break; -#else - case PAT_UNCACHED: - case PAT_UNCACHEABLE: - case PAT_WRITE_PROTECTED: - pat_index = 3; - break; - case PAT_WRITE_THROUGH: - pat_index = 1; - break; - case PAT_WRITE_BACK: - pat_index = 0; - break; - case PAT_WRITE_COMBINING: - pat_index = 2; - break; -#endif - default: - panic("Unknown caching mode %d\n", mode); + if (pat_works) { + switch (mode) { + case PAT_UNCACHEABLE: + pat_index = 3; + break; + case PAT_WRITE_THROUGH: + pat_index = 1; + break; + case PAT_WRITE_BACK: + pat_index = 0; + break; + case PAT_UNCACHED: + pat_index = 2; + break; + case PAT_WRITE_COMBINING: + pat_index = 5; + break; + case PAT_WRITE_PROTECTED: + pat_index = 4; + break; + default: + panic("Unknown caching mode %d\n", mode); + } + } else { + switch (mode) { + case PAT_UNCACHED: + case PAT_UNCACHEABLE: + case PAT_WRITE_PROTECTED: + pat_index = 3; + break; + case PAT_WRITE_THROUGH: + pat_index = 1; + break; + case PAT_WRITE_BACK: + pat_index = 0; + break; + case PAT_WRITE_COMBINING: + pat_index = 2; + break; + default: + panic("Unknown caching mode %d\n", mode); + } } /* Map the 3-bit index value into the PAT, PCD, and PWT bits. */ @@ -1735,7 +1729,7 @@ retry: * Deal with a SMP shootdown of other users of the pmap that we are * trying to dispose of. This can be a bit hairy. */ -static u_int *lazymask; +static cpumask_t *lazymask; static u_int lazyptd; static volatile u_int lazywait; @@ -1744,7 +1738,7 @@ void pmap_lazyfix_action(void); void pmap_lazyfix_action(void) { - u_int mymask = PCPU_GET(cpumask); + cpumask_t mymask = PCPU_GET(cpumask); #ifdef COUNT_IPIS (*ipi_lazypmap_counts[PCPU_GET(cpuid)])++; @@ -1756,7 +1750,7 @@ pmap_lazyfix_action(void) } static void -pmap_lazyfix_self(u_int mymask) +pmap_lazyfix_self(cpumask_t mymask) { if (rcr3() == lazyptd) @@ -1768,8 +1762,7 @@ pmap_lazyfix_self(u_int mymask) static void pmap_lazyfix(pmap_t pmap) { - u_int mymask; - u_int mask; + cpumask_t mymask, mask; u_int spins; while ((mask = pmap->pm_active) != 0) { @@ -3110,7 +3103,7 @@ pmap_kenter_temporary(vm_paddr_t pa, int vm_offset_t va; va = (vm_offset_t)crashdumpmap + (i * PAGE_SIZE); - pmap_kenter(va, pa); + PT_SET_MA(va, (pa & ~PAGE_MASK) | PG_V | pgeflag); invlpg(va); return ((void *)crashdumpmap); } @@ -3343,6 +3336,22 @@ pmap_copy(pmap_t dst_pmap, pmap_t src_pm PMAP_UNLOCK(dst_pmap); } +static __inline void +pagezero(void *page) +{ +#if defined(I686_CPU) + if (cpu_class == CPUCLASS_686) { +#if defined(CPU_ENABLE_SSE) + if (cpu_feature & CPUID_SSE2) + sse2_pagezero(page); + else +#endif + i686_pagezero(page); + } else +#endif + bzero(page, PAGE_SIZE); +} + /* * pmap_zero_page zeros the specified hardware page by mapping * the page into KVM and using bzero to clear its contents. @@ -4162,7 +4171,6 @@ pmap_activate(struct thread *td) td->td_pcb->pcb_cr3 = cr3; PT_UPDATES_FLUSH(); load_cr3(cr3); - PCPU_SET(curpmap, pmap); critical_exit(); } Modified: stable/8/sys/i386/xen/xen_machdep.c ============================================================================== --- stable/8/sys/i386/xen/xen_machdep.c Wed Nov 25 01:51:07 2009 (r199772) +++ stable/8/sys/i386/xen/xen_machdep.c Wed Nov 25 01:52:36 2009 (r199773) @@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -101,6 +102,7 @@ void ni_sti(void); void ni_cli(void) { + CTR0(KTR_SPARE2, "ni_cli disabling interrupts"); __asm__("pushl %edx;" "pushl %eax;" ); @@ -345,33 +347,53 @@ xen_load_cr3(u_int val) PANIC_IF(HYPERVISOR_mmuext_op(&op, 1, NULL, DOMID_SELF) < 0); } -void -xen_restore_flags(u_int eflags) +#ifdef KTR +static __inline u_int +rebp(void) { - if (eflags > 1) - eflags = ((eflags & PSL_I) == 0); + u_int data; - __restore_flags(eflags); + __asm __volatile("movl 4(%%ebp),%0" : "=r" (data)); + return (data); } +#endif -int -xen_save_and_cli(void) +u_int +read_eflags(void) { - int eflags; - - __save_and_cli(eflags); + vcpu_info_t *_vcpu; + u_int eflags; + + eflags = _read_eflags(); + _vcpu = &HYPERVISOR_shared_info->vcpu_info[smp_processor_id()]; + if (_vcpu->evtchn_upcall_mask) + eflags &= ~PSL_I; + return (eflags); } void +write_eflags(u_int eflags) +{ + u_int intr; + + CTR2(KTR_SPARE2, "%x xen_restore_flags eflags %x", rebp(), eflags); + intr = ((eflags & PSL_I) == 0); + __restore_flags(intr); + _write_eflags(eflags); +} + +void xen_cli(void) { + CTR1(KTR_SPARE2, "%x xen_cli disabling interrupts", rebp()); __cli(); } void xen_sti(void) { + CTR1(KTR_SPARE2, "%x xen_sti enabling interrupts", rebp()); __sti(); } From owner-svn-src-all@FreeBSD.ORG Wed Nov 25 01:55:35 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6BD2F1065670; Wed, 25 Nov 2009 01:55:35 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5A47E8FC17; Wed, 25 Nov 2009 01:55:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAP1tZiM035740; Wed, 25 Nov 2009 01:55:35 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAP1tYW0035737; Wed, 25 Nov 2009 01:55:34 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200911250155.nAP1tYW0035737@svn.freebsd.org> From: Kip Macy Date: Wed, 25 Nov 2009 01:55:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199774 - in stable/8/sys/i386: include/xen xen X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Nov 2009 01:55:35 -0000 Author: kmacy Date: Wed Nov 25 01:55:34 2009 New Revision: 199774 URL: http://svn.freebsd.org/changeset/base/199774 Log: fix UP compilation Modified: stable/8/sys/i386/include/xen/xen-os.h stable/8/sys/i386/xen/locore.s Modified: stable/8/sys/i386/include/xen/xen-os.h ============================================================================== --- stable/8/sys/i386/include/xen/xen-os.h Wed Nov 25 01:52:36 2009 (r199773) +++ stable/8/sys/i386/include/xen/xen-os.h Wed Nov 25 01:55:34 2009 (r199774) @@ -34,10 +34,10 @@ void force_evtchn_callback(void); #include #endif +extern int gdtset; #ifdef SMP #include /* XXX for pcpu.h */ #include /* XXX for PCPU_GET */ -extern int gdtset; static inline int smp_processor_id(void) { Modified: stable/8/sys/i386/xen/locore.s ============================================================================== --- stable/8/sys/i386/xen/locore.s Wed Nov 25 01:52:36 2009 (r199773) +++ stable/8/sys/i386/xen/locore.s Wed Nov 25 01:55:34 2009 (r199774) @@ -148,9 +148,7 @@ IdlePDPT: .long 0 /* phys addr of kerne .globl KPTphys #endif KPTphys: .long 0 /* phys addr of kernel page tables */ -#ifdef SMP .globl gdtset -#endif gdtset: .long 0 /* GDT is valid */ .globl proc0kstack From owner-svn-src-all@FreeBSD.ORG Wed Nov 25 04:21:43 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2A4EA106566B; Wed, 25 Nov 2009 04:21:43 +0000 (UTC) (envelope-from wollman@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 18EB68FC17; Wed, 25 Nov 2009 04:21:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAP4LgnV038922; Wed, 25 Nov 2009 04:21:42 GMT (envelope-from wollman@svn.freebsd.org) Received: (from wollman@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAP4LgKp038921; Wed, 25 Nov 2009 04:21:42 GMT (envelope-from wollman@svn.freebsd.org) Message-Id: <200911250421.nAP4LgKp038921@svn.freebsd.org> From: Garrett Wollman Date: Wed, 25 Nov 2009 04:21:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199781 - head/lib/libc/stdio X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Nov 2009 04:21:43 -0000 Author: wollman Date: Wed Nov 25 04:21:42 2009 New Revision: 199781 URL: http://svn.freebsd.org/changeset/base/199781 Log: Eliminate dead store. Found by: Clang static analyzer MFC after: 7 days Modified: head/lib/libc/stdio/fvwrite.c Modified: head/lib/libc/stdio/fvwrite.c ============================================================================== --- head/lib/libc/stdio/fvwrite.c Wed Nov 25 02:39:33 2009 (r199780) +++ head/lib/libc/stdio/fvwrite.c Wed Nov 25 04:21:42 2009 (r199781) @@ -60,7 +60,7 @@ __sfvwrite(fp, uio) char *nl; int nlknown, nldist; - if ((len = uio->uio_resid) == 0) + if (uio->uio_resid == 0) return (0); /* make sure we can write */ if (prepwrite(fp) != 0) From owner-svn-src-all@FreeBSD.ORG Wed Nov 25 04:27:56 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 207BE106566B; Wed, 25 Nov 2009 04:27:56 +0000 (UTC) (envelope-from wollman@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 101E88FC17; Wed, 25 Nov 2009 04:27:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAP4RthQ039069; Wed, 25 Nov 2009 04:27:55 GMT (envelope-from wollman@svn.freebsd.org) Received: (from wollman@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAP4RtMK039067; Wed, 25 Nov 2009 04:27:55 GMT (envelope-from wollman@svn.freebsd.org) Message-Id: <200911250427.nAP4RtMK039067@svn.freebsd.org> From: Garrett Wollman Date: Wed, 25 Nov 2009 04:27:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199782 - head/lib/libc/stdio X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Nov 2009 04:27:56 -0000 Author: wollman Date: Wed Nov 25 04:27:55 2009 New Revision: 199782 URL: http://svn.freebsd.org/changeset/base/199782 Log: In __mbsconv(), if prec was zero, nconv could have been used uninitialized. Initialize it to a safe value so that there's no chance of returning an error if stack garbage happens to be equal to (size_t)-1 or (size_t)-2. Found by: Clang static analyzer MFC after: 7 days Modified: head/lib/libc/stdio/vfwprintf.c Modified: head/lib/libc/stdio/vfwprintf.c ============================================================================== --- head/lib/libc/stdio/vfwprintf.c Wed Nov 25 04:21:42 2009 (r199781) +++ head/lib/libc/stdio/vfwprintf.c Wed Nov 25 04:27:55 2009 (r199782) @@ -293,7 +293,7 @@ __mbsconv(char *mbsarg, int prec) * number of characters to print. */ p = mbsarg; - insize = nchars = 0; + insize = nchars = nconv = 0; mbs = initial_mbs; while (nchars != (size_t)prec) { nconv = mbrlen(p, MB_CUR_MAX, &mbs); From owner-svn-src-all@FreeBSD.ORG Wed Nov 25 04:35:55 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 39E8D106566C; Wed, 25 Nov 2009 04:35:55 +0000 (UTC) (envelope-from wollman@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 29BA38FC13; Wed, 25 Nov 2009 04:35:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAP4ZsTn039244; Wed, 25 Nov 2009 04:35:54 GMT (envelope-from wollman@svn.freebsd.org) Received: (from wollman@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAP4Zsx5039242; Wed, 25 Nov 2009 04:35:54 GMT (envelope-from wollman@svn.freebsd.org) Message-Id: <200911250435.nAP4Zsx5039242@svn.freebsd.org> From: Garrett Wollman Date: Wed, 25 Nov 2009 04:35:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199783 - head/lib/libc/stdio X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Nov 2009 04:35:55 -0000 Author: wollman Date: Wed Nov 25 04:35:54 2009 New Revision: 199783 URL: http://svn.freebsd.org/changeset/base/199783 Log: Make all three if conditions look similar by always initializing nsec and moving the default initialization of prec into the else clause. The clang static analyzer erroneously thought that nsec can be used uninitialized here; it was not actually possible, but better to make the code clearer. (Clang can't know that sprintf() won't modify *pi behind the scenes.) Modified: head/lib/libc/stdio/xprintf_time.c Modified: head/lib/libc/stdio/xprintf_time.c ============================================================================== --- head/lib/libc/stdio/xprintf_time.c Wed Nov 25 04:27:55 2009 (r199782) +++ head/lib/libc/stdio/xprintf_time.c Wed Nov 25 04:35:54 2009 (r199783) @@ -64,7 +64,6 @@ __printf_render_time(struct __printf_io intmax_t t, tx; int i, prec, nsec; - prec = 0; if (pi->is_long) { tv = *((struct timeval **)arg[0]); t = tv->tv_sec; @@ -78,6 +77,8 @@ __printf_render_time(struct __printf_io } else { tp = *((time_t **)arg[0]); t = *tp; + nsec = 0; + prec = 0; } p = buf; From owner-svn-src-all@FreeBSD.ORG Wed Nov 25 04:45:46 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 36561106566C; Wed, 25 Nov 2009 04:45:46 +0000 (UTC) (envelope-from wollman@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 251A88FC08; Wed, 25 Nov 2009 04:45:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAP4jjOu039525; Wed, 25 Nov 2009 04:45:45 GMT (envelope-from wollman@svn.freebsd.org) Received: (from wollman@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAP4jjQS039517; Wed, 25 Nov 2009 04:45:45 GMT (envelope-from wollman@svn.freebsd.org) Message-Id: <200911250445.nAP4jjQS039517@svn.freebsd.org> From: Garrett Wollman Date: Wed, 25 Nov 2009 04:45:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199784 - in head/lib/libc: gen rpc stdio yp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Nov 2009 04:45:46 -0000 Author: wollman Date: Wed Nov 25 04:45:45 2009 New Revision: 199784 URL: http://svn.freebsd.org/changeset/base/199784 Log: Eliminate more dead stores. Found by: Clang static analyzer MFC after: 7 days Modified: head/lib/libc/gen/getcap.c head/lib/libc/gen/getusershell.c head/lib/libc/gen/wordexp.c head/lib/libc/rpc/getnetconfig.c head/lib/libc/rpc/key_call.c head/lib/libc/stdio/fgetws.c head/lib/libc/yp/yplib.c Modified: head/lib/libc/gen/getcap.c ============================================================================== --- head/lib/libc/gen/getcap.c Wed Nov 25 04:35:54 2009 (r199783) +++ head/lib/libc/gen/getcap.c Wed Nov 25 04:45:45 2009 (r199784) @@ -647,7 +647,7 @@ int cgetnext(char **bp, char **db_array) { size_t len; - int done, hadreaderr, i, savederrno, status; + int done, hadreaderr, savederrno, status; char *cp, *line, *rp, *np, buf[BSIZE], nbuf[BSIZE]; u_int dummy; @@ -658,7 +658,7 @@ cgetnext(char **bp, char **db_array) (void)cgetclose(); return (-1); } - for(;;) { + for (;;) { if (toprec && !gottoprec) { gottoprec = 1; line = toprec; @@ -709,7 +709,6 @@ cgetnext(char **bp, char **db_array) /* * Line points to a name line. */ - i = 0; done = 0; np = nbuf; for (;;) { Modified: head/lib/libc/gen/getusershell.c ============================================================================== --- head/lib/libc/gen/getusershell.c Wed Nov 25 04:35:54 2009 (r199783) +++ head/lib/libc/gen/getusershell.c Wed Nov 25 04:45:45 2009 (r199784) @@ -124,7 +124,7 @@ _local_initshells(rv, cb_data, ap) if ((fp = fopen(_PATH_SHELLS, "r")) == NULL) return NS_UNAVAIL; - sp = cp = line; + cp = line; while (fgets(cp, MAXPATHLEN + 1, fp) != NULL) { while (*cp != '#' && *cp != '/' && *cp != '\0') cp++; Modified: head/lib/libc/gen/wordexp.c ============================================================================== --- head/lib/libc/gen/wordexp.c Wed Nov 25 04:35:54 2009 (r199783) +++ head/lib/libc/gen/wordexp.c Wed Nov 25 04:45:45 2009 (r199784) @@ -320,7 +320,7 @@ we_check(const char *words, int flags) if (c == '\0' || level != 0) return (WRDE_SYNTAX); } else - c = *--words; + --words; break; default: break; Modified: head/lib/libc/rpc/getnetconfig.c ============================================================================== --- head/lib/libc/rpc/getnetconfig.c Wed Nov 25 04:35:54 2009 (r199783) +++ head/lib/libc/rpc/getnetconfig.c Wed Nov 25 04:45:45 2009 (r199784) @@ -412,13 +412,13 @@ void *handlep; * Noone needs these entries anymore, then frees them. * Make sure all info in netconfig_info structure has been reinitialized. */ - q = p = ni.head; + q = ni.head; ni.eof = ni.ref = 0; ni.head = NULL; ni.tail = NULL; mutex_unlock(&ni_lock); - while (q) { + while (q != NULL) { p = q->next; if (q->ncp->nc_lookups != NULL) free(q->ncp->nc_lookups); free(q->ncp); Modified: head/lib/libc/rpc/key_call.c ============================================================================== --- head/lib/libc/rpc/key_call.c Wed Nov 25 04:35:54 2009 (r199783) +++ head/lib/libc/rpc/key_call.c Wed Nov 25 04:45:45 2009 (r199784) @@ -302,7 +302,7 @@ int vers; void *localhandle; struct netconfig *nconf; struct netconfig *tpconf; - struct key_call_private *kcp = key_call_private_main; + struct key_call_private *kcp; struct timeval wait_time; struct utsname u; int main_thread; Modified: head/lib/libc/stdio/fgetws.c ============================================================================== --- head/lib/libc/stdio/fgetws.c Wed Nov 25 04:35:54 2009 (r199783) +++ head/lib/libc/stdio/fgetws.c Wed Nov 25 04:45:45 2009 (r199784) @@ -89,7 +89,7 @@ fgetws(wchar_t * __restrict ws, int n, F if (!__mbsinit(&fp->_mbstate)) /* Incomplete character */ goto error; - *wsp++ = L'\0'; + *wsp = L'\0'; FUNLOCKFILE(fp); return (ws); Modified: head/lib/libc/yp/yplib.c ============================================================================== --- head/lib/libc/yp/yplib.c Wed Nov 25 04:35:54 2009 (r199783) +++ head/lib/libc/yp/yplib.c Wed Nov 25 04:45:45 2009 (r199784) @@ -241,7 +241,7 @@ static bool_t ypmatch_cache_lookup(struct dom_binding *ypdb, char *map, keydat *key, valdat *val) { - struct ypmatch_ent *c = ypdb->cache; + struct ypmatch_ent *c; ypmatch_cache_expire(ypdb); From owner-svn-src-all@FreeBSD.ORG Wed Nov 25 04:49:42 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 39F9A1065672; Wed, 25 Nov 2009 04:49:42 +0000 (UTC) (envelope-from wollman@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 29A678FC08; Wed, 25 Nov 2009 04:49:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAP4ngEs039640; Wed, 25 Nov 2009 04:49:42 GMT (envelope-from wollman@svn.freebsd.org) Received: (from wollman@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAP4ngNs039638; Wed, 25 Nov 2009 04:49:42 GMT (envelope-from wollman@svn.freebsd.org) Message-Id: <200911250449.nAP4ngNs039638@svn.freebsd.org> From: Garrett Wollman Date: Wed, 25 Nov 2009 04:49:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199785 - head/lib/libc/rpc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Nov 2009 04:49:42 -0000 Author: wollman Date: Wed Nov 25 04:49:41 2009 New Revision: 199785 URL: http://svn.freebsd.org/changeset/base/199785 Log: In svc_raw_reply(), don't leave stat uninitialized if the MSG_ACCEPTED && SUCCESS case succeeds. The stack garbage might be zero. Found by: Clang static analyzer MFC after: 7 days Modified: head/lib/libc/rpc/svc_raw.c Modified: head/lib/libc/rpc/svc_raw.c ============================================================================== --- head/lib/libc/rpc/svc_raw.c Wed Nov 25 04:45:45 2009 (r199784) +++ head/lib/libc/rpc/svc_raw.c Wed Nov 25 04:49:41 2009 (r199785) @@ -176,9 +176,8 @@ svc_raw_reply(xprt, msg) msg->acpted_rply.ar_results.proc = (xdrproc_t) xdr_void; msg->acpted_rply.ar_results.where = NULL; - if (!xdr_replymsg(xdrs, msg) || - !SVCAUTH_WRAP(&SVC_AUTH(xprt), xdrs, xdr_proc, xdr_where)) - stat = FALSE; + stat = xdr_replymsg(xdrs, msg) && + SVCAUTH_WRAP(&SVC_AUTH(xprt), xdrs, xdr_proc, xdr_where); } else { stat = xdr_replymsg(xdrs, msg); } From owner-svn-src-all@FreeBSD.ORG Wed Nov 25 04:52:12 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DF58E106566C; Wed, 25 Nov 2009 04:52:12 +0000 (UTC) (envelope-from wollman@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CF2C48FC08; Wed, 25 Nov 2009 04:52:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAP4qC6G039718; Wed, 25 Nov 2009 04:52:12 GMT (envelope-from wollman@svn.freebsd.org) Received: (from wollman@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAP4qCvE039716; Wed, 25 Nov 2009 04:52:12 GMT (envelope-from wollman@svn.freebsd.org) Message-Id: <200911250452.nAP4qCvE039716@svn.freebsd.org> From: Garrett Wollman Date: Wed, 25 Nov 2009 04:52:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199786 - head/lib/libc/rpc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Nov 2009 04:52:13 -0000 Author: wollman Date: Wed Nov 25 04:52:12 2009 New Revision: 199786 URL: http://svn.freebsd.org/changeset/base/199786 Log: In clnt_raw_create(), avoid minor race condition initializing the file-scope variable clntraw_private. Found by: Clang static analyzer MFC after: 7 days Modified: head/lib/libc/rpc/clnt_raw.c Modified: head/lib/libc/rpc/clnt_raw.c ============================================================================== --- head/lib/libc/rpc/clnt_raw.c Wed Nov 25 04:49:41 2009 (r199785) +++ head/lib/libc/rpc/clnt_raw.c Wed Nov 25 04:52:12 2009 (r199786) @@ -92,13 +92,13 @@ clnt_raw_create(prog, vers) rpcprog_t prog; rpcvers_t vers; { - struct clntraw_private *clp = clntraw_private; + struct clntraw_private *clp; struct rpc_msg call_msg; - XDR *xdrs = &clp->xdr_stream; - CLIENT *client = &clp->client_object; + XDR *xdrs; + CLIENT *client; mutex_lock(&clntraw_lock); - if (clp == NULL) { + if ((clp = clntraw_private) == NULL) { clp = (struct clntraw_private *)calloc(1, sizeof (*clp)); if (clp == NULL) { mutex_unlock(&clntraw_lock); @@ -110,6 +110,9 @@ clnt_raw_create(prog, vers) clp->_raw_buf = __rpc_rawcombuf; clntraw_private = clp; } + xdrs = &clp->xdr_stream; + client = &clp->client_object; + /* * pre-serialize the static part of the call msg and stash it away */ From owner-svn-src-all@FreeBSD.ORG Wed Nov 25 04:53:38 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C9E24106566C; Wed, 25 Nov 2009 04:53:38 +0000 (UTC) (envelope-from wollman@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B9CC28FC15; Wed, 25 Nov 2009 04:53:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAP4rc71039777; Wed, 25 Nov 2009 04:53:38 GMT (envelope-from wollman@svn.freebsd.org) Received: (from wollman@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAP4rcTf039775; Wed, 25 Nov 2009 04:53:38 GMT (envelope-from wollman@svn.freebsd.org) Message-Id: <200911250453.nAP4rcTf039775@svn.freebsd.org> From: Garrett Wollman Date: Wed, 25 Nov 2009 04:53:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199787 - head/lib/libc/rpc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Nov 2009 04:53:38 -0000 Author: wollman Date: Wed Nov 25 04:53:38 2009 New Revision: 199787 URL: http://svn.freebsd.org/changeset/base/199787 Log: Style: use structure assignment rather than memcpy() to copy a structure. Modified: head/lib/libc/rpc/getrpcent.c Modified: head/lib/libc/rpc/getrpcent.c ============================================================================== --- head/lib/libc/rpc/getrpcent.c Wed Nov 25 04:52:12 2009 (r199786) +++ head/lib/libc/rpc/getrpcent.c Wed Nov 25 04:53:38 2009 (r199787) @@ -698,7 +698,7 @@ rpc_marshal_func(char *buffer, size_t *b return (NS_RETURN); } - memcpy(&new_rpc, rpc, sizeof(struct rpcent)); + new_rpc = *rpc; *buffer_size = desired_size; memset(buffer, 0, desired_size); From owner-svn-src-all@FreeBSD.ORG Wed Nov 25 10:52:07 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CB44D106566B; Wed, 25 Nov 2009 10:52:07 +0000 (UTC) (envelope-from roam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B9A598FC12; Wed, 25 Nov 2009 10:52:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAPAq764046708; Wed, 25 Nov 2009 10:52:07 GMT (envelope-from roam@svn.freebsd.org) Received: (from roam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAPAq7VD046706; Wed, 25 Nov 2009 10:52:07 GMT (envelope-from roam@svn.freebsd.org) Message-Id: <200911251052.nAPAq7VD046706@svn.freebsd.org> From: Peter Pentchev Date: Wed, 25 Nov 2009 10:52:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199791 - stable/8/lib/libc/locale X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Nov 2009 10:52:07 -0000 Author: roam (doc,ports committer) Date: Wed Nov 25 10:52:07 2009 New Revision: 199791 URL: http://svn.freebsd.org/changeset/base/199791 Log: Merge rev. 199180 to 8.x-STABLE, the change to isblank(3): Fix the grammar as in the PR, and then some. PR: 140454 Submitted by: Jeremy Huddleston Modified: stable/8/lib/libc/locale/isblank.3 Directory Properties: stable/8/lib/libc/ (props changed) stable/8/lib/libc/stdtime/ (props changed) Modified: stable/8/lib/libc/locale/isblank.3 ============================================================================== --- stable/8/lib/libc/locale/isblank.3 Wed Nov 25 10:43:03 2009 (r199790) +++ stable/8/lib/libc/locale/isblank.3 Wed Nov 25 10:52:07 2009 (r199791) @@ -50,9 +50,9 @@ For any locale, this includes the follow .It "\&``\et''\t`` ''" .El .Pp -In the "C" locale +In the "C" locale, a successful .Fn isblank -successful test is limited to this characters only. +test is limited to these characters only. The value of the argument must be representable as an .Vt "unsigned char" or the value of From owner-svn-src-all@FreeBSD.ORG Wed Nov 25 11:16:39 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 73B00106568D; Wed, 25 Nov 2009 11:16:39 +0000 (UTC) (envelope-from roam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 625258FC08; Wed, 25 Nov 2009 11:16:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAPBGdMg049034; Wed, 25 Nov 2009 11:16:39 GMT (envelope-from roam@svn.freebsd.org) Received: (from roam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAPBGdC9049032; Wed, 25 Nov 2009 11:16:39 GMT (envelope-from roam@svn.freebsd.org) Message-Id: <200911251116.nAPBGdC9049032@svn.freebsd.org> From: Peter Pentchev Date: Wed, 25 Nov 2009 11:16:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199794 - stable/7/lib/libc/locale X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Nov 2009 11:16:39 -0000 Author: roam (doc,ports committer) Date: Wed Nov 25 11:16:39 2009 New Revision: 199794 URL: http://svn.freebsd.org/changeset/base/199794 Log: Merge rev. 199180 to 7.x-STABLE, the change to isblank(3): Fix the grammar as in the PR, and then some. PR: 140454 Submitted by: Jeremy Huddleston Modified: stable/7/lib/libc/locale/isblank.3 Directory Properties: stable/7/lib/libc/ (props changed) Modified: stable/7/lib/libc/locale/isblank.3 ============================================================================== --- stable/7/lib/libc/locale/isblank.3 Wed Nov 25 10:56:50 2009 (r199793) +++ stable/7/lib/libc/locale/isblank.3 Wed Nov 25 11:16:39 2009 (r199794) @@ -50,9 +50,9 @@ For any locale, this includes the follow .It "\&``\et''\t`` ''" .El .Pp -In the "C" locale +In the "C" locale, a successful .Fn isblank -successful test is limited to this characters only. +test is limited to these characters only. The value of the argument must be representable as an .Vt "unsigned char" or the value of From owner-svn-src-all@FreeBSD.ORG Wed Nov 25 11:17:29 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3432610656A7; Wed, 25 Nov 2009 11:17:29 +0000 (UTC) (envelope-from roam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 22C4D8FC20; Wed, 25 Nov 2009 11:17:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAPBHT7A049098; Wed, 25 Nov 2009 11:17:29 GMT (envelope-from roam@svn.freebsd.org) Received: (from roam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAPBHTkw049096; Wed, 25 Nov 2009 11:17:29 GMT (envelope-from roam@svn.freebsd.org) Message-Id: <200911251117.nAPBHTkw049096@svn.freebsd.org> From: Peter Pentchev Date: Wed, 25 Nov 2009 11:17:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199795 - stable/6/lib/libc/locale X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Nov 2009 11:17:29 -0000 Author: roam (doc,ports committer) Date: Wed Nov 25 11:17:28 2009 New Revision: 199795 URL: http://svn.freebsd.org/changeset/base/199795 Log: Merge rev. 199180 to 8.x-STABLE, the change to isblank(3): Fix the grammar as in the PR, and then some. PR: 140454 Submitted by: Jeremy Huddleston Modified: stable/6/lib/libc/locale/isblank.3 Directory Properties: stable/6/lib/libc/ (props changed) Modified: stable/6/lib/libc/locale/isblank.3 ============================================================================== --- stable/6/lib/libc/locale/isblank.3 Wed Nov 25 11:16:39 2009 (r199794) +++ stable/6/lib/libc/locale/isblank.3 Wed Nov 25 11:17:28 2009 (r199795) @@ -54,9 +54,9 @@ For any locale, this includes the follow .It "\&``\et''\t`` ''" .El .Pp -In the "C" locale +In the "C" locale, a successful .Fn isblank -successful test is limited to this characters only. +test is limited to these characters only. For single C .Va char Ns s locales (see From owner-svn-src-all@FreeBSD.ORG Wed Nov 25 11:23:45 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 74992106566B; Wed, 25 Nov 2009 11:23:45 +0000 (UTC) (envelope-from roam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 630E18FC1D; Wed, 25 Nov 2009 11:23:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAPBNjKP049278; Wed, 25 Nov 2009 11:23:45 GMT (envelope-from roam@svn.freebsd.org) Received: (from roam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAPBNjqI049276; Wed, 25 Nov 2009 11:23:45 GMT (envelope-from roam@svn.freebsd.org) Message-Id: <200911251123.nAPBNjqI049276@svn.freebsd.org> From: Peter Pentchev Date: Wed, 25 Nov 2009 11:23:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199796 - stable/8/share/misc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Nov 2009 11:23:45 -0000 Author: roam (doc,ports committer) Date: Wed Nov 25 11:23:44 2009 New Revision: 199796 URL: http://svn.freebsd.org/changeset/base/199796 Log: Merge rev. 199181 to 8.x-STABLE: Correct the information about the doceng@ team members - Murray Stokely stepped down some time ago, about the same time as Giorgos Keramidas joined the team. PR: 140465 Submitted by: Denny Lin Modified: stable/8/share/misc/organization.dot Directory Properties: stable/8/share/misc/ (props changed) Modified: stable/8/share/misc/organization.dot ============================================================================== --- stable/8/share/misc/organization.dot Wed Nov 25 11:17:28 2009 (r199795) +++ stable/8/share/misc/organization.dot Wed Nov 25 11:23:44 2009 (r199796) @@ -28,7 +28,7 @@ _misc [label="Miscellaneous Hats"] core [label="Core Team\ncore@FreeBSD.org\nwilko, brooks, keramida, imp,\ngnn, wes, hrs, murray,\nrwatson"] coresecretary [label="Core Team Secretary\ncore-secretary@FreeBSD.org\njoel"] doccommitters [label="Doc/www Committers\ndoc-committers@FreeBSD.org"] -doceng [label="Documentation Engineering Team\ndoceng@FreeBSD.org\nnik, blackend, hrs,\nmurray"] +doceng [label="Documentation Engineering Team\ndoceng@FreeBSD.org\nnik, blackend, hrs,\nkeramida"] portscommitters [label="Ports Committers\nports-committers@FreeBSD.org"] portmgr [label="Port Management Team\nportmgr@FreeBSD.org\nmarcus, kris, erwin,\nlinimon, pav, krion"] portmgrsecretary [label="Port Management Team Secretary\nportmgr-secretary@FreeBSD.org\nerwin"] From owner-svn-src-all@FreeBSD.ORG Wed Nov 25 11:25:06 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 02E1A106568B; Wed, 25 Nov 2009 11:25:06 +0000 (UTC) (envelope-from roam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E5A6E8FC15; Wed, 25 Nov 2009 11:25:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAPBP5Ac049358; Wed, 25 Nov 2009 11:25:05 GMT (envelope-from roam@svn.freebsd.org) Received: (from roam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAPBP5l8049356; Wed, 25 Nov 2009 11:25:05 GMT (envelope-from roam@svn.freebsd.org) Message-Id: <200911251125.nAPBP5l8049356@svn.freebsd.org> From: Peter Pentchev Date: Wed, 25 Nov 2009 11:25:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199797 - stable/7/share/misc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Nov 2009 11:25:06 -0000 Author: roam (doc,ports committer) Date: Wed Nov 25 11:25:05 2009 New Revision: 199797 URL: http://svn.freebsd.org/changeset/base/199797 Log: Merge rev. 199181 to 7.x-STABLE: Correct the information about the doceng@ team members - Murray Stokely stepped down some time ago, about the same time as Giorgos Keramidas joined the team. PR: 140465 Submitted by: Denny Lin Modified: stable/7/share/misc/organization.dot Directory Properties: stable/7/share/misc/ (props changed) stable/7/share/misc/iso639 (props changed) stable/7/share/misc/pci_vendors (props changed) Modified: stable/7/share/misc/organization.dot ============================================================================== --- stable/7/share/misc/organization.dot Wed Nov 25 11:23:44 2009 (r199796) +++ stable/7/share/misc/organization.dot Wed Nov 25 11:25:05 2009 (r199797) @@ -28,7 +28,7 @@ _misc [label="Miscellaneous Hats"] core [label="Core Team\ncore@FreeBSD.org\nwilko, brooks, keramida, imp,\ngnn, wes, hrs, murray,\nrwatson"] coresecretary [label="Core Team Secretary\ncore-secretary@FreeBSD.org\njoel"] doccommitters [label="Doc/www Committers\ndoc-committers@FreeBSD.org"] -doceng [label="Documentation Engineering Team\ndoceng@FreeBSD.org\nnik, blackend, hrs,\nmurray"] +doceng [label="Documentation Engineering Team\ndoceng@FreeBSD.org\nnik, blackend, hrs,\nkeramida"] portscommitters [label="Ports Committers\nports-committers@FreeBSD.org"] portmgr [label="Port Management Team\nportmgr@FreeBSD.org\nmarcus, kris, erwin,\nlinimon, pav, krion"] portmgrsecretary [label="Port Management Team Secretary\nportmgr-secretary@FreeBSD.org\nerwin"] From owner-svn-src-all@FreeBSD.ORG Wed Nov 25 13:31:18 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 33F521065679; Wed, 25 Nov 2009 13:31:18 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 232468FC0C; Wed, 25 Nov 2009 13:31:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAPDVIns051915; Wed, 25 Nov 2009 13:31:18 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAPDVIBJ051913; Wed, 25 Nov 2009 13:31:18 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200911251331.nAPDVIBJ051913@svn.freebsd.org> From: Robert Watson Date: Wed, 25 Nov 2009 13:31:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199798 - head/sys/dev/fe X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Nov 2009 13:31:18 -0000 Author: rwatson Date: Wed Nov 25 13:31:17 2009 New Revision: 199798 URL: http://svn.freebsd.org/changeset/base/199798 Log: Fix comment typo. Submitted by: Marc Balmer MFC after: 3 days Modified: head/sys/dev/fe/if_fe_pccard.c Modified: head/sys/dev/fe/if_fe_pccard.c ============================================================================== --- head/sys/dev/fe/if_fe_pccard.c Wed Nov 25 11:25:05 2009 (r199797) +++ head/sys/dev/fe/if_fe_pccard.c Wed Nov 25 13:31:17 2009 (r199798) @@ -306,7 +306,7 @@ fe_pccard_xircom_mac(const struct pccard * Probe and initialization for TDK/CONTEC PCMCIA Ethernet interface. * by MASUI Kenji * - * (Contec uses TDK Ethenet chip -- hosokawa) + * (Contec uses TDK Ethernet chip -- hosokawa) * * This version of fe_probe_tdk has been rewrote to handle * *generic* PC Card implementation of Fujitsu MB8696x family. The From owner-svn-src-all@FreeBSD.ORG Wed Nov 25 14:24:14 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 97F53106566B; Wed, 25 Nov 2009 14:24:14 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 86D178FC0A; Wed, 25 Nov 2009 14:24:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAPEOETN052986; Wed, 25 Nov 2009 14:24:14 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAPEOE3u052984; Wed, 25 Nov 2009 14:24:14 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200911251424.nAPEOE3u052984@svn.freebsd.org> From: Alexander Motin Date: Wed, 25 Nov 2009 14:24:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199799 - head/sys/cam/ata X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Nov 2009 14:24:14 -0000 Author: mav Date: Wed Nov 25 14:24:14 2009 New Revision: 199799 URL: http://svn.freebsd.org/changeset/base/199799 Log: Fix small copu-paste bug. Modified: head/sys/cam/ata/ata_xpt.c Modified: head/sys/cam/ata/ata_xpt.c ============================================================================== --- head/sys/cam/ata/ata_xpt.c Wed Nov 25 13:31:17 2009 (r199798) +++ head/sys/cam/ata/ata_xpt.c Wed Nov 25 14:24:14 2009 (r199799) @@ -347,7 +347,7 @@ probestart(struct cam_periph *periph, un if (cts.xport_specific.ata.valid & CTS_ATA_VALID_MODE) mode = cts.xport_specific.ata.mode; } else { - if (cts.xport_specific.ata.valid & CTS_SATA_VALID_MODE) + if (cts.xport_specific.sata.valid & CTS_SATA_VALID_MODE) mode = cts.xport_specific.sata.mode; } negotiate: From owner-svn-src-all@FreeBSD.ORG Wed Nov 25 14:54:58 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D9502106566C; Wed, 25 Nov 2009 14:54:58 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AD9B88FC0A; Wed, 25 Nov 2009 14:54:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAPEswig053582; Wed, 25 Nov 2009 14:54:58 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAPEswc6053580; Wed, 25 Nov 2009 14:54:58 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200911251454.nAPEswc6053580@svn.freebsd.org> From: Rui Paulo Date: Wed, 25 Nov 2009 14:54:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199800 - stable/8/sys/dev/ath/ath_hal X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Nov 2009 14:54:59 -0000 Author: rpaulo Date: Wed Nov 25 14:54:58 2009 New Revision: 199800 URL: http://svn.freebsd.org/changeset/base/199800 Log: MFC r199491: Add WorldB SKU. Modified: stable/8/sys/dev/ath/ath_hal/ah_regdomain.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/ath/ath_hal/ah_regdomain.c ============================================================================== --- stable/8/sys/dev/ath/ath_hal/ah_regdomain.c Wed Nov 25 14:24:14 2009 (r199799) +++ stable/8/sys/dev/ath/ath_hal/ah_regdomain.c Wed Nov 25 14:54:58 2009 (r199800) @@ -170,6 +170,7 @@ enum { WOR9_WORLD = 0x69, /* World9 (WO9 SKU) */ WORA_WORLD = 0x6A, /* WorldA (WOA SKU) */ + WORB_WORLD = 0x6B, /* WorldB (WOB SKU) */ MKK3_MKKB = 0x80, /* Japan UNI-1 even + MKKB */ MKK3_MKKA2 = 0x81, /* Japan UNI-1 even + MKKA2 */ @@ -432,6 +433,7 @@ static REG_DMN_PAIR_MAPPING regDomainPai {EU1_WORLD, EU1_WORLD, EU1_WORLD, NO_REQ, NO_REQ, PSCAN_DEFER, CTRY_DEFAULT }, {WOR9_WORLD, WOR9_WORLD, WOR9_WORLD, DISALLOW_ADHOC_11A | DISALLOW_ADHOC_11A_TURB, NO_REQ, PSCAN_DEFER, CTRY_DEFAULT }, {WORA_WORLD, WORA_WORLD, WORA_WORLD, DISALLOW_ADHOC_11A | DISALLOW_ADHOC_11A_TURB, NO_REQ, PSCAN_DEFER, CTRY_DEFAULT }, + {WORB_WORLD, WORB_WORLD, WORB_WORLD, DISALLOW_ADHOC_11A | DISALLOW_ADHOC_11A_TURB, NO_REQ, PSCAN_DEFER, CTRY_DEFAULT }, }; /* @@ -1681,6 +1683,31 @@ static REG_DOMAIN regDomains[] = { WG1_2467_2467), .chan11g_turbo = BM1(T3_2437_2437)}, + {.regDmnEnum = WORB_WORLD, + .conformanceTestLimit = NO_CTL, + .dfsMask = DFS_FCC3 | DFS_ETSI, + .pscan = PSCAN_WWR, + .flags = DISALLOW_ADHOC_11A, + .chan11a = BM4(W1_5260_5320, + W1_5180_5240, + W1_5745_5825, + W1_5500_5700), + .chan11b = BM7(W1_2412_2412, + W1_2437_2442, + W1_2462_2462, + W1_2472_2472, + W1_2417_2432, + W1_2447_2457, + W1_2467_2467), + .chan11g = BM7(WG1_2412_2412, + WG1_2437_2442, + WG1_2462_2462, + WG1_2472_2472, + WG1_2417_2432, + WG1_2447_2457, + WG1_2467_2467), + .chan11g_turbo = BM1(T3_2437_2437)}, + {.regDmnEnum = NULL1, .conformanceTestLimit = NO_CTL, } From owner-svn-src-all@FreeBSD.ORG Wed Nov 25 14:57:07 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C433E106568D; Wed, 25 Nov 2009 14:57:07 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B30038FC16; Wed, 25 Nov 2009 14:57:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAPEv7Mq053669; Wed, 25 Nov 2009 14:57:07 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAPEv72D053667; Wed, 25 Nov 2009 14:57:07 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <200911251457.nAPEv72D053667@svn.freebsd.org> From: Attilio Rao Date: Wed, 25 Nov 2009 14:57:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199801 - head/lib/libfetch X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Nov 2009 14:57:07 -0000 Author: attilio Date: Wed Nov 25 14:57:07 2009 New Revision: 199801 URL: http://svn.freebsd.org/changeset/base/199801 Log: Fix a socket leak in ftp_request() after that a connection is established. Submitted by: Sandvine Incorporated Reviewed by: des, emaste Sponsored by: Sandvine Incorporated MFC: 1 week Modified: head/lib/libfetch/ftp.c Modified: head/lib/libfetch/ftp.c ============================================================================== --- head/lib/libfetch/ftp.c Wed Nov 25 14:54:58 2009 (r199800) +++ head/lib/libfetch/ftp.c Wed Nov 25 14:57:07 2009 (r199801) @@ -1122,17 +1122,19 @@ ftp_request(struct url *url, const char /* change directory */ if (ftp_cwd(conn, url->doc) == -1) - return (NULL); + goto errsock; /* stat file */ if (us && ftp_stat(conn, url->doc, us) == -1 && fetchLastErrCode != FETCH_PROTO && fetchLastErrCode != FETCH_UNAVAIL) - return (NULL); + goto errsock; /* just a stat */ - if (strcmp(op, "STAT") == 0) + if (strcmp(op, "STAT") == 0) { + ftp_disconnect(conn); return (FILE *)1; /* bogus return value */ + } if (strcmp(op, "STOR") == 0 || strcmp(op, "APPE") == 0) oflag = O_WRONLY; else @@ -1140,6 +1142,10 @@ ftp_request(struct url *url, const char /* initiate the transfer */ return (ftp_transfer(conn, op, url->doc, oflag, url->offset, flags)); + +errsock: + ftp_disconnect(conn); + return (NULL); } /* From owner-svn-src-all@FreeBSD.ORG Wed Nov 25 14:59:28 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E2E6B106568B; Wed, 25 Nov 2009 14:59:28 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D1E4B8FC19; Wed, 25 Nov 2009 14:59:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAPExSxc053744; Wed, 25 Nov 2009 14:59:28 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAPExS7C053742; Wed, 25 Nov 2009 14:59:28 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <200911251459.nAPExS7C053742@svn.freebsd.org> From: Attilio Rao Date: Wed, 25 Nov 2009 14:59:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199802 - head/lib/libtacplus X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Nov 2009 14:59:29 -0000 Author: attilio Date: Wed Nov 25 14:59:28 2009 New Revision: 199802 URL: http://svn.freebsd.org/changeset/base/199802 Log: In tac_get_av_value() empty attributes should be handled like 0-length strings rather than unset strings. Fix the present wrong behaviour. Obtained from: Sandvine Incorporated Reviewed by: emaste Sponsored by: Sandvine Incorporated MFC: 1 week Modified: head/lib/libtacplus/taclib.c Modified: head/lib/libtacplus/taclib.c ============================================================================== --- head/lib/libtacplus/taclib.c Wed Nov 25 14:57:07 2009 (r199801) +++ head/lib/libtacplus/taclib.c Wed Nov 25 14:59:28 2009 (r199802) @@ -1263,8 +1263,13 @@ tac_get_av_value(struct tac_handle *h, c * h->srvr_avs[0] = "foobie=var1" * h->srvr_avs[1] = "foo=var2" * is handled. + * + * Note that for empty string attribute values a + * 0-length string is returned in order to distinguish + * against unset values. + * dump_str() will handle srvr.len == 0 correctly. */ - if (found_seperator == 1 && ch != end) { + if (found_seperator == 1) { srvr.len = end - ch; srvr.data = ch; return dup_str(h, &srvr, NULL); From owner-svn-src-all@FreeBSD.ORG Wed Nov 25 15:02:32 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C3883106568B; Wed, 25 Nov 2009 15:02:32 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B1E2F8FC16; Wed, 25 Nov 2009 15:02:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAPF2WAU053870; Wed, 25 Nov 2009 15:02:32 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAPF2Wpk053868; Wed, 25 Nov 2009 15:02:32 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <200911251502.nAPF2Wpk053868@svn.freebsd.org> From: Attilio Rao Date: Wed, 25 Nov 2009 15:02:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199803 - head/usr.bin/netstat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Nov 2009 15:02:33 -0000 Author: attilio Date: Wed Nov 25 15:02:32 2009 New Revision: 199803 URL: http://svn.freebsd.org/changeset/base/199803 Log: Add the possibility to show informations about dropped packets on the input path when showing informations about the interfaces. Obtained from: Sandvine Incorporated Reviewed by: emaste Sponsored by: Sandvine Incorporated MFC: 2 weeks Modified: head/usr.bin/netstat/if.c Modified: head/usr.bin/netstat/if.c ============================================================================== --- head/usr.bin/netstat/if.c Wed Nov 25 14:59:28 2009 (r199802) +++ head/usr.bin/netstat/if.c Wed Nov 25 15:02:32 2009 (r199803) @@ -198,6 +198,7 @@ intpr(int interval1, u_long ifnetaddr, v u_long imcasts; u_long oerrors; u_long ierrors; + u_long idrops; u_long collisions; short timer; int drops; @@ -225,8 +226,8 @@ intpr(int interval1, u_long ifnetaddr, v printf("%-7.7s", "Name"); else printf("%-5.5s", "Name"); - printf(" %5.5s %-13.13s %-17.17s %8.8s %5.5s", - "Mtu", "Network", "Address", "Ipkts", "Ierrs"); + printf(" %5.5s %-13.13s %-17.17s %8.8s %5.5s %5.5s", + "Mtu", "Network", "Address", "Ipkts", "Ierrs", "Idrop"); if (bflag) printf(" %10.10s","Ibytes"); printf(" %8.8s %5.5s", "Opkts", "Oerrs"); @@ -285,6 +286,7 @@ intpr(int interval1, u_long ifnetaddr, v imcasts = ifnet.if_imcasts; oerrors = ifnet.if_oerrors; ierrors = ifnet.if_ierrors; + idrops = ifnet.if_iqdrops; collisions = ifnet.if_collisions; timer = ifnet.if_timer; drops = ifnet.if_snd.ifq_drops; @@ -423,6 +425,7 @@ intpr(int interval1, u_long ifnetaddr, v show_stat("lu", 8, ipackets, link_layer|network_layer); show_stat("lu", 5, ierrors, link_layer); + show_stat("lu", 5, idrops, link_layer); if (bflag) show_stat("lu", 10, ibytes, link_layer|network_layer); @@ -513,6 +516,7 @@ struct iftot { char ift_name[IFNAMSIZ]; /* interface name */ u_long ift_ip; /* input packets */ u_long ift_ie; /* input errors */ + u_long ift_id; /* input drops */ u_long ift_op; /* output packets */ u_long ift_oe; /* output errors */ u_long ift_co; /* collisions */ @@ -598,8 +602,9 @@ banner: printf("%17s %14s %16s", "input", interesting ? interesting->ift_name : "(Total)", "output"); putchar('\n'); - printf("%10s %5s %10s %10s %5s %10s %5s", - "packets", "errs", "bytes", "packets", "errs", "bytes", "colls"); + printf("%10s %5s %5s %10s %10s %5s %10s %5s", + "packets", "errs", "idrops", "bytes", "packets", "errs", "bytes", + "colls"); if (dflag) printf(" %5.5s", "drops"); putchar('\n'); @@ -615,6 +620,7 @@ loop: if (!first) { show_stat("lu", 10, ifnet.if_ipackets - ip->ift_ip, 1); show_stat("lu", 5, ifnet.if_ierrors - ip->ift_ie, 1); + show_stat("lu", 5, ifnet.if_iqdrops - ip->ift_id, 1); show_stat("lu", 10, ifnet.if_ibytes - ip->ift_ib, 1); show_stat("lu", 10, ifnet.if_opackets - ip->ift_op, 1); show_stat("lu", 5, ifnet.if_oerrors - ip->ift_oe, 1); @@ -636,6 +642,7 @@ loop: } else { sum->ift_ip = 0; sum->ift_ie = 0; + sum->ift_id = 0; sum->ift_ib = 0; sum->ift_op = 0; sum->ift_oe = 0; @@ -651,6 +658,7 @@ loop: } sum->ift_ip += ifnet.if_ipackets; sum->ift_ie += ifnet.if_ierrors; + sum->ift_id += ifnet.if_iqdrops; sum->ift_ib += ifnet.if_ibytes; sum->ift_op += ifnet.if_opackets; sum->ift_oe += ifnet.if_oerrors; @@ -662,6 +670,7 @@ loop: if (!first) { show_stat("lu", 10, sum->ift_ip - total->ift_ip, 1); show_stat("lu", 5, sum->ift_ie - total->ift_ie, 1); + show_stat("lu", 5, sum->ift_id - total->ift_id, 1); show_stat("lu", 10, sum->ift_ib - total->ift_ib, 1); show_stat("lu", 10, sum->ift_op - total->ift_op, 1); show_stat("lu", 5, sum->ift_oe - total->ift_oe, 1); From owner-svn-src-all@FreeBSD.ORG Wed Nov 25 15:12:24 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C820D106568D; Wed, 25 Nov 2009 15:12:24 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B58B38FC18; Wed, 25 Nov 2009 15:12:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAPFCO0A054114; Wed, 25 Nov 2009 15:12:24 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAPFCODO054109; Wed, 25 Nov 2009 15:12:24 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <200911251512.nAPFCODO054109@svn.freebsd.org> From: Attilio Rao Date: Wed, 25 Nov 2009 15:12:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199804 - in head: crypto/openssh usr.sbin/cron/cron usr.sbin/inetd usr.sbin/syslogd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Nov 2009 15:12:25 -0000 Author: attilio Date: Wed Nov 25 15:12:24 2009 New Revision: 199804 URL: http://svn.freebsd.org/changeset/base/199804 Log: Avoid sshd, cron, syslogd and inetd to be killed under high-pressure swap environments. Please note that this can't be done while such processes run in jails. Note: in future it would be interesting to find a way to do that selectively for any desired proccess (choosen by user himself), probabilly via a ptrace interface or whatever. Obtained from: Sandvine Incorporated Reviewed by: emaste, arch@ Sponsored by: Sandvine Incorporated MFC: 1 month Modified: head/crypto/openssh/sshd.c head/usr.sbin/cron/cron/cron.c head/usr.sbin/inetd/inetd.c head/usr.sbin/syslogd/syslogd.c Modified: head/crypto/openssh/sshd.c ============================================================================== --- head/crypto/openssh/sshd.c Wed Nov 25 15:02:32 2009 (r199803) +++ head/crypto/openssh/sshd.c Wed Nov 25 15:12:24 2009 (r199804) @@ -47,6 +47,7 @@ __RCSID("$FreeBSD$"); #include #include +#include #include #ifdef HAVE_SYS_STAT_H # include @@ -1293,6 +1294,10 @@ main(int ac, char **av) /* Initialize configuration options to their default values. */ initialize_server_options(&options); + /* Avoid killing the process in high-pressure swapping environments. */ + if (madvise(NULL, 0, MADV_PROTECT) != 0) + debug("madvise(): %.200s", strerror(errno)); + /* Parse command-line arguments. */ while ((opt = getopt(ac, av, "f:p:b:k:h:g:u:o:C:dDeiqrtQRT46")) != -1) { switch (opt) { Modified: head/usr.sbin/cron/cron/cron.c ============================================================================== --- head/usr.sbin/cron/cron/cron.c Wed Nov 25 15:02:32 2009 (r199803) +++ head/usr.sbin/cron/cron/cron.c Wed Nov 25 15:12:24 2009 (r199804) @@ -24,6 +24,7 @@ static const char rcsid[] = #include "cron.h" +#include #include #if SYS_TIME_H # include @@ -134,6 +135,9 @@ main(argc, argv) } } + if (madvise(NULL, 0, MADV_PROTECT) != 0) + log_it("CRON", getpid(), "WARNING", "madvise() failed"); + pidfile_write(pfh); database.head = NULL; database.tail = NULL; Modified: head/usr.sbin/inetd/inetd.c ============================================================================== --- head/usr.sbin/inetd/inetd.c Wed Nov 25 15:02:32 2009 (r199803) +++ head/usr.sbin/inetd/inetd.c Wed Nov 25 15:12:24 2009 (r199804) @@ -110,6 +110,7 @@ __FBSDID("$FreeBSD$"); */ #include #include +#include #include #include #include @@ -497,6 +498,9 @@ main(int argc, char **argv) } } + if (madvise(NULL, 0, MADV_PROTECT) != 0) + syslog(LOG_WARNING, "madvise() failed: %s", strerror(errno)); + for (i = 0; i < PERIPSIZE; ++i) LIST_INIT(&proctable[i]); Modified: head/usr.sbin/syslogd/syslogd.c ============================================================================== --- head/usr.sbin/syslogd/syslogd.c Wed Nov 25 15:02:32 2009 (r199803) +++ head/usr.sbin/syslogd/syslogd.c Wed Nov 25 15:12:24 2009 (r199804) @@ -77,6 +77,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -352,6 +353,9 @@ main(int argc, char *argv[]) pid_t ppid = 1, spid; socklen_t len; + if (madvise(NULL, 0, MADV_PROTECT) != 0) + dprintf("madvise() failed: %s\n", strerror(errno)); + bindhostname = NULL; while ((ch = getopt(argc, argv, "468Aa:b:cCdf:kl:m:nop:P:sS:Tuv")) != -1) From owner-svn-src-all@FreeBSD.ORG Wed Nov 25 15:23:15 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 49C7D106566C; Wed, 25 Nov 2009 15:23:15 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 372048FC1C; Wed, 25 Nov 2009 15:23:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAPFNFqR054375; Wed, 25 Nov 2009 15:23:15 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAPFNFD6054370; Wed, 25 Nov 2009 15:23:15 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <200911251523.nAPFNFD6054370@svn.freebsd.org> From: Attilio Rao Date: Wed, 25 Nov 2009 15:23:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199805 - head/usr.bin/gcore X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Nov 2009 15:23:15 -0000 Author: attilio Date: Wed Nov 25 15:23:14 2009 New Revision: 199805 URL: http://svn.freebsd.org/changeset/base/199805 Log: Change gcore in order to get rid of the procfs accesses and use FreeBSD's specific sysctls and ptrace interfaces. This change switches a bit gcore POLA that is summarized here: - now gcore can recognize threads within the process and handle dumps on thread-scope - the process to be analyzed will be stopped during its gcore run - gcore may not work with processes which are actively being analyzed by gdb or truss - the ptrace interface may cause syscalls to return EINTR, thus interferring with signals handling within the process Side note: the interface can be further lifted in order to get rid of the very last procfs interfaces remnants and made more suitable for copying with sysctl/ptrace interface . Obtained from: Sandvine Incorporated Reviewed by: emaste, rwatson Sponsored by: Sandvine Incorporated MFC: 1 month Modified: head/usr.bin/gcore/Makefile head/usr.bin/gcore/elfcore.c head/usr.bin/gcore/gcore.1 head/usr.bin/gcore/gcore.c Modified: head/usr.bin/gcore/Makefile ============================================================================== --- head/usr.bin/gcore/Makefile Wed Nov 25 15:12:24 2009 (r199804) +++ head/usr.bin/gcore/Makefile Wed Nov 25 15:23:14 2009 (r199805) @@ -1,6 +1,7 @@ # @(#)Makefile 8.1 (Berkeley) 6/6/93 # $FreeBSD$ +LDADD+= -lutil PROG= gcore SRCS= elfcore.c gcore.c Modified: head/usr.bin/gcore/elfcore.c ============================================================================== --- head/usr.bin/gcore/elfcore.c Wed Nov 25 15:12:24 2009 (r199804) +++ head/usr.bin/gcore/elfcore.c Wed Nov 25 15:23:14 2009 (r199805) @@ -1,4 +1,5 @@ /*- + * Copyright (c) 2007 Sandvine Incorporated * Copyright (c) 1998 John D. Polstra * All rights reserved. * @@ -29,8 +30,12 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include +#include +#include +#include #include #include #include @@ -44,6 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "extern.h" @@ -69,16 +75,15 @@ static void cb_put_phdr(vm_map_entry_t, static void cb_size_segment(vm_map_entry_t, void *); static void each_writable_segment(vm_map_entry_t, segment_callback, void *closure); -static void elf_corehdr(int fd, pid_t, vm_map_entry_t, int numsegs, - void *hdr, size_t hdrsize); -static void elf_puthdr(vm_map_entry_t, void *, size_t *, - const prstatus_t *, const prfpregset_t *, const prpsinfo_t *, int numsegs); +static void elf_detach(void); /* atexit() handler. */ +static void elf_puthdr(pid_t, vm_map_entry_t, void *, size_t *, int numsegs); static void elf_putnote(void *dst, size_t *off, const char *name, int type, const void *desc, size_t descsz); static void freemap(vm_map_entry_t); -static void readhdrinfo(pid_t, prstatus_t *, prfpregset_t *, prpsinfo_t *); static vm_map_entry_t readmap(pid_t); +static pid_t g_pid; /* Pid being dumped, global for elf_detach */ + static int elf_ident(int efd, pid_t pid __unused, char *binfile __unused) { @@ -93,6 +98,14 @@ elf_ident(int efd, pid_t pid __unused, c return (0); } +static void +elf_detach(void) +{ + + if (g_pid != 0) + ptrace(PT_DETACH, g_pid, (caddr_t)1, 0); +} + /* * Write an ELF coredump for the given pid to the given fd. */ @@ -103,11 +116,20 @@ elf_coredump(int efd __unused, int fd, p struct sseg_closure seginfo; void *hdr; size_t hdrsize; - char memname[64]; - int memfd; Elf_Phdr *php; int i; + /* Attach to process to dump. */ + g_pid = pid; + if (atexit(elf_detach) != 0) + err(1, "atexit"); + errno = 0; + ptrace(PT_ATTACH, pid, NULL, 0); + if (errno) + err(1, "PT_ATTACH"); + if (waitpid(pid, NULL, 0) == -1) + err(1, "waitpid"); + /* Get the program's memory map. */ map = readmap(pid); @@ -122,28 +144,31 @@ elf_coredump(int efd __unused, int fd, p * size is calculated. */ hdrsize = 0; - elf_puthdr(map, (void *)NULL, &hdrsize, - (const prstatus_t *)NULL, (const prfpregset_t *)NULL, - (const prpsinfo_t *)NULL, seginfo.count); + elf_puthdr(pid, map, NULL, &hdrsize, seginfo.count); /* * Allocate memory for building the header, fill it up, * and write it out. */ - if ((hdr = malloc(hdrsize)) == NULL) + if ((hdr = calloc(1, hdrsize)) == NULL) errx(1, "out of memory"); - elf_corehdr(fd, pid, map, seginfo.count, hdr, hdrsize); - /* Write the contents of all of the writable segments. */ - snprintf(memname, sizeof memname, "/proc/%d/mem", pid); - if ((memfd = open(memname, O_RDONLY)) == -1) - err(1, "cannot open %s", memname); + /* Fill in the header. */ + hdrsize = 0; + elf_puthdr(pid, map, hdr, &hdrsize, seginfo.count); + + /* Write it to the core file. */ + if (write(fd, hdr, hdrsize) == -1) + err(1, "write"); + /* Write the contents of all of the writable segments. */ php = (Elf_Phdr *)((char *)hdr + sizeof(Elf_Ehdr)) + 1; for (i = 0; i < seginfo.count; i++) { + struct ptrace_io_desc iorequest; uintmax_t nleft = php->p_filesz; - lseek(memfd, (off_t)php->p_vaddr, SEEK_SET); + iorequest.piod_op = PIOD_READ_D; + iorequest.piod_offs = (caddr_t)php->p_vaddr; while (nleft > 0) { char buf[8*1024]; size_t nwant; @@ -153,12 +178,12 @@ elf_coredump(int efd __unused, int fd, p nwant = sizeof buf; else nwant = nleft; - ngot = read(memfd, buf, nwant); - if (ngot == -1) - err(1, "read from %s", memname); + iorequest.piod_addr = buf; + iorequest.piod_len = nwant; + ptrace(PT_IO, pid, (caddr_t)&iorequest, 0); + ngot = iorequest.piod_len; if ((size_t)ngot < nwant) - errx(1, "short read from %s:" - " wanted %zu, got %zd", memname, + errx(1, "short read wanted %d, got %d", nwant, ngot); ngot = write(fd, buf, nwant); if (ngot == -1) @@ -166,10 +191,10 @@ elf_coredump(int efd __unused, int fd, p if ((size_t)ngot != nwant) errx(1, "short write"); nleft -= nwant; + iorequest.piod_offs += ngot; } php++; } - close(memfd); free(hdr); freemap(map); } @@ -231,30 +256,25 @@ each_writable_segment(vm_map_entry_t map (*func)(entry, closure); } -/* - * Write the core file header to the file, including padding up to - * the page boundary. - */ static void -elf_corehdr(int fd, pid_t pid, vm_map_entry_t map, int numsegs, void *hdr, - size_t hdrsize) +elf_getstatus(pid_t pid, prpsinfo_t *psinfo) { - size_t off; - prstatus_t status; - prfpregset_t fpregset; - prpsinfo_t psinfo; - - /* Gather the information for the header. */ - readhdrinfo(pid, &status, &fpregset, &psinfo); - - /* Fill in the header. */ - memset(hdr, 0, hdrsize); - off = 0; - elf_puthdr(map, hdr, &off, &status, &fpregset, &psinfo, numsegs); - - /* Write it to the core file. */ - if (write(fd, hdr, hdrsize) == -1) - err(1, "write"); + struct kinfo_proc kobj; + int name[4]; + size_t len; + + name[0] = CTL_KERN; + name[1] = KERN_PROC; + name[2] = KERN_PROC_PID; + name[3] = pid; + + len = sizeof(kobj); + if (sysctl(name, 4, &kobj, &len, NULL, 0) == -1) + err(1, "error accessing kern.proc.pid.%u sysctl", pid); + if (kobj.ki_pid != pid) + err(1, "error accessing kern.proc.pid.%u sysctl datas", pid); + strncpy(psinfo->pr_fname, kobj.ki_comm, MAXCOMLEN); + strncpy(psinfo->pr_psargs, psinfo->pr_fname, PRARGSZ); } /* @@ -262,13 +282,24 @@ elf_corehdr(int fd, pid_t pid, vm_map_en * be NULL, in which case the header is sized but not actually generated. */ static void -elf_puthdr(vm_map_entry_t map, void *dst, size_t *off, const prstatus_t *status, - const prfpregset_t *fpregset, const prpsinfo_t *psinfo, int numsegs) +elf_puthdr(pid_t pid, vm_map_entry_t map, void *dst, size_t *off, int numsegs) { + struct { + prstatus_t status; + prfpregset_t fpregset; + prpsinfo_t psinfo; + } *tempdata; size_t ehoff; size_t phoff; size_t noteoff; size_t notesz; + size_t threads; + lwpid_t *tids; + int i; + + prstatus_t *status; + prfpregset_t *fpregset; + prpsinfo_t *psinfo; ehoff = *off; *off += sizeof(Elf_Ehdr); @@ -277,14 +308,68 @@ elf_puthdr(vm_map_entry_t map, void *dst *off += (numsegs + 1) * sizeof(Elf_Phdr); noteoff = *off; - elf_putnote(dst, off, "FreeBSD", NT_PRSTATUS, status, - sizeof *status); - elf_putnote(dst, off, "FreeBSD", NT_FPREGSET, fpregset, - sizeof *fpregset); + + if (dst != NULL) { + if ((tempdata = calloc(1, sizeof(*tempdata))) == NULL) + errx(1, "out of memory"); + status = &tempdata->status; + fpregset = &tempdata->fpregset; + psinfo = &tempdata->psinfo; + } else { + tempdata = NULL; + status = NULL; + fpregset = NULL; + psinfo = NULL; + } + + errno = 0; + threads = ptrace(PT_GETNUMLWPS, pid, NULL, 0); + if (errno) + err(1, "PT_GETNUMLWPS"); + + if (dst != NULL) { + psinfo->pr_version = PRPSINFO_VERSION; + psinfo->pr_psinfosz = sizeof(prpsinfo_t); + elf_getstatus(pid, psinfo); + + } elf_putnote(dst, off, "FreeBSD", NT_PRPSINFO, psinfo, sizeof *psinfo); + + if (dst != NULL) { + tids = malloc(threads * sizeof(*tids)); + if (tids == NULL) + errx(1, "out of memory"); + errno = 0; + ptrace(PT_GETLWPLIST, pid, (void *)tids, threads); + if (errno) + err(1, "PT_GETLWPLIST"); + } + for (i = 0; i < threads; ++i) { + if (dst != NULL) { + status->pr_version = PRSTATUS_VERSION; + status->pr_statussz = sizeof(prstatus_t); + status->pr_gregsetsz = sizeof(gregset_t); + status->pr_fpregsetsz = sizeof(fpregset_t); + status->pr_osreldate = __FreeBSD_version; + status->pr_pid = tids[i]; + + ptrace(PT_GETREGS, tids[i], (void *)&status->pr_reg, 0); + ptrace(PT_GETFPREGS, tids[i], (void *)fpregset, 0); + } + elf_putnote(dst, off, "FreeBSD", NT_PRSTATUS, status, + sizeof *status); + elf_putnote(dst, off, "FreeBSD", NT_FPREGSET, fpregset, + sizeof *fpregset); + } + notesz = *off - noteoff; + if (dst != NULL) { + free(tids); + free(tempdata); + } + /* Align up to a page boundary for the program segments. */ *off = round_page(*off); @@ -381,70 +466,7 @@ freemap(vm_map_entry_t map) } /* - * Read the process information necessary to fill in the core file's header. - */ -static void -readhdrinfo(pid_t pid, prstatus_t *status, prfpregset_t *fpregset, - prpsinfo_t *psinfo) -{ - char name[64]; - char line[256]; - int fd; - int i; - int n; - - memset(status, 0, sizeof *status); - status->pr_version = PRSTATUS_VERSION; - status->pr_statussz = sizeof(prstatus_t); - status->pr_gregsetsz = sizeof(gregset_t); - status->pr_fpregsetsz = sizeof(fpregset_t); - status->pr_osreldate = __FreeBSD_version; - status->pr_pid = pid; - - memset(fpregset, 0, sizeof *fpregset); - - memset(psinfo, 0, sizeof *psinfo); - psinfo->pr_version = PRPSINFO_VERSION; - psinfo->pr_psinfosz = sizeof(prpsinfo_t); - - /* Read the general registers. */ - snprintf(name, sizeof name, "/proc/%d/regs", pid); - if ((fd = open(name, O_RDONLY)) == -1) - err(1, "cannot open %s", name); - if ((n = read(fd, &status->pr_reg, sizeof status->pr_reg)) == -1) - err(1, "read error from %s", name); - if ((size_t)n < sizeof(status->pr_reg)) - errx(1, "short read from %s: wanted %zu, got %d", name, - sizeof status->pr_reg, n); - close(fd); - - /* Read the floating point registers. */ - snprintf(name, sizeof name, "/proc/%d/fpregs", pid); - if ((fd = open(name, O_RDONLY)) == -1) - err(1, "cannot open %s", name); - if ((n = read(fd, fpregset, sizeof *fpregset)) == -1) - err(1, "read error from %s", name); - if ((size_t)n < sizeof(*fpregset)) - errx(1, "short read from %s: wanted %zu, got %d", name, - sizeof *fpregset, n); - close(fd); - - /* Read and parse the process status. */ - snprintf(name, sizeof name, "/proc/%d/status", pid); - if ((fd = open(name, O_RDONLY)) == -1) - err(1, "cannot open %s", name); - if ((n = read(fd, line, sizeof line - 1)) == -1) - err(1, "read error from %s", name); - if (n > MAXCOMLEN) - n = MAXCOMLEN; - for (i = 0; i < n && line[i] != ' '; i++) - psinfo->pr_fname[i] = line[i]; - strncpy(psinfo->pr_psargs, psinfo->pr_fname, PRARGSZ); - close(fd); -} - -/* - * Read the process's memory map using procfs, and return a list of + * Read the process's memory map using kinfo_getvmmap(), and return a list of * VM map entries. Only the non-device read/writable segments are * returned. The map entries in the list aren't fully filled in; only * the items we need are present. @@ -452,83 +474,44 @@ readhdrinfo(pid_t pid, prstatus_t *statu static vm_map_entry_t readmap(pid_t pid) { - char mapname[64]; - int mapfd; - ssize_t mapsize; - size_t bufsize; - char *mapbuf; - int pos; - vm_map_entry_t map; - vm_map_entry_t *linkp; - - snprintf(mapname, sizeof mapname, "/proc/%d/map", pid); - if ((mapfd = open(mapname, O_RDONLY)) == -1) - err(1, "cannot open %s", mapname); + vm_map_entry_t ent, *linkp, map; + struct kinfo_vmentry *vmentl, *kve; + int i, nitems; + + vmentl = kinfo_getvmmap(pid, &nitems); + if (vmentl == NULL) + err(1, "cannot retrieve mappings for %u process", pid); - /* - * Procfs requires (for consistency) that the entire memory map - * be read with a single read() call. Start with a reasonably sized - * buffer, and double it until it is big enough. - */ - bufsize = 8 * 1024; - mapbuf = NULL; - for ( ; ; ) { - if ((mapbuf = realloc(mapbuf, bufsize + 1)) == NULL) - errx(1, "out of memory"); - mapsize = read(mapfd, mapbuf, bufsize); - if (mapsize != -1 || errno != EFBIG) - break; - bufsize *= 2; - /* This lseek shouldn't be necessary, but it is. */ - lseek(mapfd, (off_t)0, SEEK_SET); - } - if (mapsize == -1) - err(1, "read error from %s", mapname); - if (mapsize == 0) - errx(1, "empty map file %s", mapname); - mapbuf[mapsize] = 0; - close(mapfd); - - pos = 0; map = NULL; linkp = ↦ - while (pos < mapsize) { - vm_map_entry_t ent; - u_long start; - u_long end; - char prot[4]; - char type[16]; - int n; - int len; - - len = 0; - n = sscanf(mapbuf + pos, "%lx %lx %*d %*d %*x %3[-rwx]" - " %*d %*d %*x %*s %*s %16s %*s%*[\n]%n", - &start, &end, prot, type, &len); - if (n != 4 || len == 0) - errx(1, "ill-formed line in %s starting at character %d", mapname, pos + 1); - pos += len; - - /* Ignore segments of the wrong kind, and unwritable ones */ - if (strncmp(prot, "rw", 2) != 0 || - (strcmp(type, "default") != 0 && - strcmp(type, "vnode") != 0 && - strcmp(type, "swap") != 0)) + for (i = 0; i < nitems; i++) { + kve = &vmentl[i]; + + /* + * Ignore segments of the wrong kind and ones which are not + * readable and writable. + */ + if ((kve->kve_protection & KVME_PROT_WRITE) == 0 || + (kve->kve_protection & KVME_PROT_READ) == 0 || + (kve->kve_type != KVME_TYPE_DEFAULT && + kve->kve_type != KVME_TYPE_VNODE && + kve->kve_type != KVME_TYPE_SWAP)) continue; - if ((ent = (vm_map_entry_t)calloc(1, sizeof *ent)) == NULL) + ent = calloc(1, sizeof(*ent)); + if (ent == NULL) errx(1, "out of memory"); - ent->start = start; - ent->end = end; + ent->start = (vm_offset_t)kve->kve_start; + ent->end = (vm_offset_t)kve->kve_end; ent->protection = VM_PROT_READ | VM_PROT_WRITE; - if (prot[2] == 'x') - ent->protection |= VM_PROT_EXECUTE; + if ((kve->kve_protection & KVME_PROT_EXEC) != 0) + ent->protection |= VM_PROT_EXECUTE; *linkp = ent; linkp = &ent->next; } - free(mapbuf); - return map; + free(vmentl); + return (map); } struct dumpers elfdump = { elf_ident, elf_coredump }; Modified: head/usr.bin/gcore/gcore.1 ============================================================================== --- head/usr.bin/gcore/gcore.1 Wed Nov 25 15:12:24 2009 (r199804) +++ head/usr.bin/gcore/gcore.1 Wed Nov 25 15:23:14 2009 (r199805) @@ -32,7 +32,7 @@ .\" @(#)gcore.1 8.2 (Berkeley) 4/18/94 .\" $FreeBSD$ .\" -.Dd April 18, 1994 +.Dd November 18, 2009 .Dt GCORE 1 .Os .Sh NAME @@ -55,11 +55,6 @@ By default, the core is written to the f The process identifier, .Ar pid , must be given on the command line. -If no executable image is -specified, -.Nm -will use -.Dq Pa /proc//file . .Pp The following options are available: .Bl -tag -width indent @@ -80,8 +75,6 @@ The same effect can be achieved manually .Bl -tag -width /var/log/messages -compact .It Pa core. the core image -.It Pa /proc//file -the executable image .El .Sh HISTORY A @@ -89,12 +82,15 @@ A utility appeared in .Bx 4.2 . .Sh BUGS -Context switches or paging activity that occur while -.Nm -is running may cause the program to become confused. -For best results, use -.Fl s -to temporarily stop the target process. +Because of the +.Xr ptrace 2 +usage +.Nm +may not work with processes which are actively investigated with +.Xr truss 1 +or +.Xr gdb 1 . +Additionally, interruptable sleeps may exit with EINTR. .Pp The .Nm Modified: head/usr.bin/gcore/gcore.c ============================================================================== --- head/usr.bin/gcore/gcore.c Wed Nov 25 15:12:24 2009 (r199804) +++ head/usr.bin/gcore/gcore.c Wed Nov 25 15:23:14 2009 (r199805) @@ -61,6 +61,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -83,10 +84,11 @@ SET_DECLARE(dumpset, struct dumpers); int main(int argc, char *argv[]) { - int ch, efd, fd, sflag; + int ch, efd, fd, name[4], sflag; char *binfile, *corefile; - char fname[MAXPATHLEN]; + char passpath[MAXPATHLEN], fname[MAXPATHLEN]; struct dumpers **d, *dumper; + size_t len; sflag = 0; corefile = NULL; @@ -109,9 +111,14 @@ main(int argc, char *argv[]) switch (argc) { case 1: pid = atoi(argv[0]); - asprintf(&binfile, "/proc/%d/file", pid); - if (binfile == NULL) - errx(1, "allocation failure"); + name[0] = CTL_KERN; + name[1] = KERN_PROC; + name[2] = KERN_PROC_PATHNAME; + name[3] = pid; + len = sizeof(passpath); + if (sysctl(name, 4, passpath, &len, NULL, 0) == -1) + errx(1, "kern.proc.pathname failure"); + binfile = passpath; break; case 2: pid = atoi(argv[1]); From owner-svn-src-all@FreeBSD.ORG Wed Nov 25 16:09:41 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B69C4106568D; Wed, 25 Nov 2009 16:09:41 +0000 (UTC) (envelope-from des@des.no) Received: from tim.des.no (tim.des.no [194.63.250.121]) by mx1.freebsd.org (Postfix) with ESMTP id 2E0868FC18; Wed, 25 Nov 2009 16:09:41 +0000 (UTC) Received: from ds4.des.no (des.no [84.49.246.2]) by smtp.des.no (Postfix) with ESMTP id 6AFC76D41B; Wed, 25 Nov 2009 16:09:40 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id 0FA39844F2; Wed, 25 Nov 2009 17:09:40 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Juli Mallett References: <200911221651.nAMGpiIO023873@svn.freebsd.org> Date: Wed, 25 Nov 2009 17:09:40 +0100 In-Reply-To: (Juli Mallett's message of "Tue, 24 Nov 2009 17:18:49 -0800") Message-ID: <86pr7637sr.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.95 (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, Hajimu UMEMOTO Subject: Re: svn commit: r199655 - head/usr.bin/w X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Nov 2009 16:09:41 -0000 Juli Mallett writes: > I'm not sure this is right. In fact, it's completely backward. It means you can no longer use -n to avoid a timeout when DNS is misconfigured or your connection is down. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-all@FreeBSD.ORG Wed Nov 25 16:28:10 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 62B5F106566C; Wed, 25 Nov 2009 16:28:10 +0000 (UTC) (envelope-from ume@mahoroba.org) Received: from asuka.mahoroba.org (ent.mahoroba.org [IPv6:2001:2f0:104:8010::1]) by mx1.freebsd.org (Postfix) with ESMTP id E39808FC12; Wed, 25 Nov 2009 16:28:09 +0000 (UTC) Received: from yuga.mahoroba.org (ume@yuga.mahoroba.org [IPv6:2001:2f0:104:8010:21b:d3ff:fe38:5381]) (user=ume mech=CRAM-MD5 bits=0) by asuka.mahoroba.org (8.14.3/8.14.3) with ESMTP/inet6 id nAPGS2AA008626 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 26 Nov 2009 01:28:02 +0900 (JST) (envelope-from ume@mahoroba.org) Date: Thu, 26 Nov 2009 01:28:02 +0900 Message-ID: From: Hajimu UMEMOTO To: Juli Mallett In-Reply-To: References: <200911221651.nAMGpiIO023873@svn.freebsd.org> User-Agent: xcite1.58> Wanderlust/2.15.7 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?ISO-2022-JP-2?B?R29qGyQoRCtXGyhC?=) APEL/10.7 Emacs/23.1 (i386-portbld-freebsd8.0) MULE/6.0 (HANACHIRUSATO) X-Operating-System: FreeBSD 8.0-RELEASE X-PGP-Key: http://www.imasy.or.jp/~ume/publickey.asc X-PGP-Fingerprint: 1F00 0B9E 2164 70FC 6DC5 BF5F 04E9 F086 BF90 71FE Organization: Internet Mutual Aid Society, YOKOHAMA MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.3 (asuka.mahoroba.org [IPv6:2001:2f0:104:8010::1]); Thu, 26 Nov 2009 01:28:02 +0900 (JST) X-Virus-Scanned: clamav-milter 0.95.3 at asuka.mahoroba.org X-Virus-Status: Clean X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on asuka.mahoroba.org Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r199655 - head/usr.bin/w X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Nov 2009 16:28:10 -0000 Hi, >>>>> On Tue, 24 Nov 2009 17:18:49 -0800 >>>>> Juli Mallett said: jmallett> I'm not sure this is right. While the manpage implies that doing no jmallett> resolution means that it will show numeric addresses, since that is jmallett> not correct, there are two ways to go. As you have done, you can jmallett> choose to try to resolve hostnames to IP addresses. You could also do jmallett> as the code before did and do no resolution. I frequently use 'w -n' jmallett> on systems with slow nameservers to see who is logged in without jmallett> triggering a bunch of DNS traffic that I then have to wait for. jmallett> Trying to resolve the name to a numeric address presents that problem. jmallett> Since it is not possible to always show a numeric address (if, for jmallett> example, the hostname is no longer valid) I'm not sure that this is jmallett> the right direction to try to go with 'w -n'. The feature was present in the past, and was dropped by 1.48. The reason is that we have no idea what address family they belong to. So, I reintroduce it for just one A/AAAA RR case. http://www.freebsd.org/cgi/cvsweb.cgi/src/usr.bin/w/w.c#rev1.48 However, a hostname in utmp is truncated in many cases. It is useless to query for a truncated hostname. How about this patch? Index: usr.bin/w/w.c diff -u -p usr.bin/w/w.c.orig usr.bin/w/w.c --- usr.bin/w/w.c.orig 2009-11-21 20:27:35.000000000 +0900 +++ usr.bin/w/w.c 2009-11-25 12:40:19.142972545 +0900 @@ -383,7 +383,7 @@ main(int argc, char *argv[]) if (isaddr && realhostname_sa(fn, sizeof(fn), sa, sa->sa_len) == HOSTNAME_FOUND) p = fn; - } else if (!isaddr) { + } else if (!isaddr && strlen(p) < UT_HOSTSIZE) { /* * If a host has only one A/AAAA RR, change a * name into an IP address Sincerely, -- Hajimu UMEMOTO @ Internet Mutual Aid Society Yokohama, Japan ume@mahoroba.org ume@{,jp.}FreeBSD.org http://www.imasy.org/~ume/ From owner-svn-src-all@FreeBSD.ORG Wed Nov 25 16:31:23 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DA7BD1065672; Wed, 25 Nov 2009 16:31:23 +0000 (UTC) (envelope-from juli@clockworksquid.com) Received: from mail-px0-f190.google.com (mail-px0-f190.google.com [209.85.216.190]) by mx1.freebsd.org (Postfix) with ESMTP id A6ED28FC12; Wed, 25 Nov 2009 16:31:23 +0000 (UTC) Received: by pxi28 with SMTP id 28so5407266pxi.7 for ; Wed, 25 Nov 2009 08:31:23 -0800 (PST) MIME-Version: 1.0 Sender: juli@clockworksquid.com Received: by 10.142.6.11 with SMTP id 11mr873411wff.68.1259166683163; Wed, 25 Nov 2009 08:31:23 -0800 (PST) In-Reply-To: References: <200911221651.nAMGpiIO023873@svn.freebsd.org> From: Juli Mallett Date: Wed, 25 Nov 2009 08:31:03 -0800 X-Google-Sender-Auth: e0ef5782ee3e529e Message-ID: To: Hajimu UMEMOTO Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r199655 - head/usr.bin/w X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Nov 2009 16:31:24 -0000 On Wed, Nov 25, 2009 at 08:28, Hajimu UMEMOTO wrote: > The feature was present in the past, and was dropped by 1.48. =A0The > reason is that we have no idea what address family they belong to. > So, I reintroduce it for just one A/AAAA RR case. > > http://www.freebsd.org/cgi/cvsweb.cgi/src/usr.bin/w/w.c#rev1.48 > > However, a hostname in utmp is truncated in many cases. =A0It is useless > to query for a truncated hostname. =A0How about this patch? This catches hostnames that have been truncated but ignores hostnames that would have been truncated if they were still one letter longer. In any event, it generates traffic if '-n' is specified and tries to use the resolver, which is undesirable to at least me and DES. From owner-svn-src-all@FreeBSD.ORG Wed Nov 25 16:36:07 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9C28A106566B; Wed, 25 Nov 2009 16:36:07 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8B4C38FC18; Wed, 25 Nov 2009 16:36:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAPGa76H055799; Wed, 25 Nov 2009 16:36:07 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAPGa7YX055796; Wed, 25 Nov 2009 16:36:07 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <200911251636.nAPGa7YX055796@svn.freebsd.org> From: Edward Tomasz Napierala Date: Wed, 25 Nov 2009 16:36:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199806 - head/sys/boot/i386/libi386 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Nov 2009 16:36:07 -0000 Author: trasz Date: Wed Nov 25 16:36:07 2009 New Revision: 199806 URL: http://svn.freebsd.org/changeset/base/199806 Log: Be nice, don't use the f-word. Modified: head/sys/boot/i386/libi386/elf32_freebsd.c head/sys/boot/i386/libi386/elf64_freebsd.c Modified: head/sys/boot/i386/libi386/elf32_freebsd.c ============================================================================== --- head/sys/boot/i386/libi386/elf32_freebsd.c Wed Nov 25 15:23:14 2009 (r199805) +++ head/sys/boot/i386/libi386/elf32_freebsd.c Wed Nov 25 16:36:07 2009 (r199806) @@ -59,7 +59,7 @@ elf32_exec(struct preloaded_file *fp) int boothowto, err, bootdev; if ((md = file_findmetadata(fp, MODINFOMD_ELFHDR)) == NULL) - return(EFTYPE); /* XXX actually EFUCKUP */ + return(EFTYPE); ehdr = (Elf_Ehdr *)&(md->md_data); err = bi_load32(fp->f_args, &boothowto, &bootdev, &bootinfop, &modulep, &kernend); Modified: head/sys/boot/i386/libi386/elf64_freebsd.c ============================================================================== --- head/sys/boot/i386/libi386/elf64_freebsd.c Wed Nov 25 15:23:14 2009 (r199805) +++ head/sys/boot/i386/libi386/elf64_freebsd.c Wed Nov 25 16:36:07 2009 (r199806) @@ -78,7 +78,7 @@ elf64_exec(struct preloaded_file *fp) int i; if ((md = file_findmetadata(fp, MODINFOMD_ELFHDR)) == NULL) - return(EFTYPE); /* XXX actually EFUCKUP */ + return(EFTYPE); ehdr = (Elf_Ehdr *)&(md->md_data); err = bi_load64(fp->f_args, &modulep, &kernend); From owner-svn-src-all@FreeBSD.ORG Wed Nov 25 16:46:17 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A4E961065672; Wed, 25 Nov 2009 16:46:17 +0000 (UTC) (envelope-from amdmi3@amdmi3.ru) Received: from smtp.timeweb.ru (smtp.timeweb.ru [92.53.113.20]) by mx1.freebsd.org (Postfix) with ESMTP id 5D2488FC15; Wed, 25 Nov 2009 16:46:17 +0000 (UTC) Received: from [213.148.20.85] (helo=hive.panopticon) by smtp.timeweb.ru with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.69) (envelope-from ) id 1NDKzS-0001vN-5D; Wed, 25 Nov 2009 19:45:14 +0300 Received: from hades.panopticon (hades.panopticon [192.168.0.32]) by hive.panopticon (Postfix) with ESMTP id 3700FB860; Wed, 25 Nov 2009 19:46:15 +0300 (MSK) Received: by hades.panopticon (Postfix, from userid 1000) id 0F28CB849; Wed, 25 Nov 2009 19:46:15 +0300 (MSK) Date: Wed, 25 Nov 2009 19:46:15 +0300 From: Dmitry Marakasov To: Attilio Rao Message-ID: <20091125164615.GA90402@hades.panopticon> References: <200911251512.nAPFCODO054109@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <200911251512.nAPFCODO054109@svn.freebsd.org> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r199804 - in head: crypto/openssh usr.sbin/cron/cron usr.sbin/inetd usr.sbin/syslogd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Nov 2009 16:46:17 -0000 * Attilio Rao (attilio@FreeBSD.org) wrote: > Avoid sshd, cron, syslogd and inetd to be killed under high-pressure swap > environments. > Please note that this can't be done while such processes run in jails. > > Note: in future it would be interesting to find a way to do that > selectively for any desired proccess (choosen by user himself), probabilly > via a ptrace interface or whatever. You might be interested in looking at /usr/ports/sysutils/scprotect. -- Dmitry Marakasov . 55B5 0596 FF1E 8D84 5F56 9510 D35A 80DD F9D2 F77D amdmi3@amdmi3.ru ..: jabber: amdmi3@jabber.ru http://www.amdmi3.ru From owner-svn-src-all@FreeBSD.ORG Wed Nov 25 17:15:32 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 458D3106566B; Wed, 25 Nov 2009 17:15:32 +0000 (UTC) (envelope-from ume@mahoroba.org) Received: from asuka.mahoroba.org (ent.mahoroba.org [IPv6:2001:2f0:104:8010::1]) by mx1.freebsd.org (Postfix) with ESMTP id A9CEC8FC1C; Wed, 25 Nov 2009 17:15:31 +0000 (UTC) Received: from yuga.mahoroba.org (ume@yuga.mahoroba.org [IPv6:2001:2f0:104:8010:21b:d3ff:fe38:5381]) (user=ume mech=CRAM-MD5 bits=0) by asuka.mahoroba.org (8.14.3/8.14.3) with ESMTP/inet6 id nAPHFN7C092915 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 26 Nov 2009 02:15:24 +0900 (JST) (envelope-from ume@mahoroba.org) Date: Thu, 26 Nov 2009 02:15:23 +0900 Message-ID: From: Hajimu UMEMOTO To: Juli Mallett In-Reply-To: References: <200911221651.nAMGpiIO023873@svn.freebsd.org> User-Agent: xcite1.58> Wanderlust/2.15.7 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?ISO-2022-JP-2?B?R29qGyQoRCtXGyhC?=) APEL/10.7 Emacs/23.1 (i386-portbld-freebsd8.0) MULE/6.0 (HANACHIRUSATO) X-Operating-System: FreeBSD 8.0-RELEASE X-PGP-Key: http://www.imasy.or.jp/~ume/publickey.asc X-PGP-Fingerprint: 1F00 0B9E 2164 70FC 6DC5 BF5F 04E9 F086 BF90 71FE Organization: Internet Mutual Aid Society, YOKOHAMA MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.3 (asuka.mahoroba.org [IPv6:2001:2f0:104:8010::1]); Thu, 26 Nov 2009 02:15:24 +0900 (JST) X-Virus-Scanned: clamav-milter 0.95.3 at asuka.mahoroba.org X-Virus-Status: Clean X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on asuka.mahoroba.org Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r199655 - head/usr.bin/w X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Nov 2009 17:15:32 -0000 Hi, >>>>> On Wed, 25 Nov 2009 08:31:03 -0800 >>>>> Juli Mallett said: jmallett> This catches hostnames that have been truncated but ignores hostnames jmallett> that would have been truncated if they were still one letter longer. jmallett> In any event, it generates traffic if '-n' is specified and tries to jmallett> use the resolver, which is undesirable to at least me and DES. Some people think it was regression. So, I made this change. It is useful that -n means don't resolve at all, as you think. And, we already familiar with the behavior these days. But, the commit log of 1.48 didn't say it is a reason for the change. Then, how about this patch? It introduces -nn to resolve hostname in utmp. Index: usr.bin/w/w.1 diff -u usr.bin/w/w.1.orig usr.bin/w/w.1 --- usr.bin/w/w.1.orig 2009-10-25 10:10:29.000000000 +0900 +++ usr.bin/w/w.1 2009-11-26 02:00:28.970109388 +0900 @@ -81,6 +81,10 @@ Do not attempt to resolve network addresses (normally .Nm interprets addresses and attempts to display them as names). +When +.Fl n +is specified more than once, hostnames stored in utmp are attempted to +resolve to display them as network addresses. .El .Pp If one or more Index: usr.bin/w/w.c diff -u -p usr.bin/w/w.c.orig usr.bin/w/w.c --- usr.bin/w/w.c.orig 2009-11-21 20:28:57.000000000 +0900 +++ usr.bin/w/w.c 2009-11-26 01:48:42.729602183 +0900 @@ -180,7 +180,7 @@ main(int argc, char *argv[]) dropgid = 1; break; case 'n': - nflag = 1; + nflag += 1; break; case 'f': case 'l': case 's': case 'u': case 'w': warnx("[-flsuw] no longer supported"); @@ -378,12 +378,12 @@ main(int argc, char *argv[]) lsin->sin_family = AF_INET; isaddr = 1; } - if (!nflag) { + if (nflag == 0) { /* Attempt to change an IP address into a name */ if (isaddr && realhostname_sa(fn, sizeof(fn), sa, sa->sa_len) == HOSTNAME_FOUND) p = fn; - } else if (!isaddr) { + } else if (!isaddr && nflag > 1) { /* * If a host has only one A/AAAA RR, change a * name into an IP address Sincerely, -- Hajimu UMEMOTO @ Internet Mutual Aid Society Yokohama, Japan ume@mahoroba.org ume@{,jp.}FreeBSD.org http://www.imasy.org/~ume/ From owner-svn-src-all@FreeBSD.ORG Wed Nov 25 17:30:38 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C4CBD106568D; Wed, 25 Nov 2009 17:30:38 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B474B8FC15; Wed, 25 Nov 2009 17:30:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAPHUcUZ056952; Wed, 25 Nov 2009 17:30:38 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAPHUcG8056950; Wed, 25 Nov 2009 17:30:38 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200911251730.nAPHUcG8056950@svn.freebsd.org> From: Pyun YongHyeon Date: Wed, 25 Nov 2009 17:30:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199807 - head/sys/dev/bge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Nov 2009 17:30:38 -0000 Author: yongari Date: Wed Nov 25 17:30:38 2009 New Revision: 199807 URL: http://svn.freebsd.org/changeset/base/199807 Log: Make sure one shot MSI is enabled. Submitted by: marius Modified: head/sys/dev/bge/if_bge.c Modified: head/sys/dev/bge/if_bge.c ============================================================================== --- head/sys/dev/bge/if_bge.c Wed Nov 25 16:36:07 2009 (r199806) +++ head/sys/dev/bge/if_bge.c Wed Nov 25 17:30:38 2009 (r199807) @@ -2915,6 +2915,8 @@ again: #if __FreeBSD_version > 700030 if (BGE_IS_5755_PLUS(sc) && sc->bge_flags & BGE_FLAG_MSI) { /* Take advantage of single-shot MSI. */ + CSR_WRITE_4(sc, BGE_MSI_MODE, CSR_READ_4(sc, BGE_MSI_MODE) & + ~BGE_MSIMODE_ONE_SHOT_DISABLE); sc->bge_tq = taskqueue_create_fast("bge_taskq", M_WAITOK, taskqueue_thread_enqueue, &sc->bge_tq); if (sc->bge_tq == NULL) { From owner-svn-src-all@FreeBSD.ORG Wed Nov 25 17:38:55 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E18D61065676; Wed, 25 Nov 2009 17:38:55 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: from mail-bw0-f213.google.com (mail-bw0-f213.google.com [209.85.218.213]) by mx1.freebsd.org (Postfix) with ESMTP id E96348FC14; Wed, 25 Nov 2009 17:38:54 +0000 (UTC) Received: by bwz5 with SMTP id 5so7562642bwz.3 for ; Wed, 25 Nov 2009 09:38:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=38OcZDv6fKFT8k9vs8iNS79BYF0rilbgGdr7EQSCpX8=; b=RZ7wZ0lBDccjsDMCMQ7OSJLav36yzanwWw3Nu185N0IF7Ymwhl5xwwb5DbFeimMM70 HnMlnPTVrqMHg4U+XBU45Lo/yqRLdWWN4aqeWOI8vTLroo86uDuSvn/1H5EZ5PSw4Rdt Hw/6XLCV743EqeLlF9Nn3vXFQjJaJ56YM0Bk4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=qaxY7ZZ4VK79BmiWHz5VU98C5ZNONPC0TsLms1MoR156umMlRFRFXQqmOuFgviNq8T ijZBsdX+ev6BhMqwPUNHugdoEp5kKOrwJke9MydcOakAU7c6KfpNnQQo1zYwoOj109kZ xpJW6sWrFqZJfCtIcriYFcK8IYgHfCDbh7xtM= MIME-Version: 1.0 Received: by 10.204.156.218 with SMTP id y26mr4300129bkw.205.1259170733810; Wed, 25 Nov 2009 09:38:53 -0800 (PST) In-Reply-To: <200911251512.nAPFCODO054109@svn.freebsd.org> References: <200911251512.nAPFCODO054109@svn.freebsd.org> Date: Wed, 25 Nov 2009 20:38:53 +0300 Message-ID: From: pluknet To: Attilio Rao Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r199804 - in head: crypto/openssh usr.sbin/cron/cron usr.sbin/inetd usr.sbin/syslogd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Nov 2009 17:38:56 -0000 2009/11/25 Attilio Rao : > Author: attilio > Date: Wed Nov 25 15:12:24 2009 > New Revision: 199804 > URL: http://svn.freebsd.org/changeset/base/199804 > > Log: > =A0Avoid sshd, cron, syslogd and inetd to be killed under high-pressure s= wap > =A0environments. > =A0Please note that this can't be done while such processes run in jails. > > =A0Note: in future it would be interesting to find a way to do that > =A0selectively for any desired proccess (choosen by user himself), probab= illy > =A0via a ptrace interface or whatever. There is an existing (though it does different things) interface in Solaris= . Look at getpflags(2)/setpflags(2). --=20 wbr, pluknet From owner-svn-src-all@FreeBSD.ORG Wed Nov 25 17:51:15 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 27DC0106566B; Wed, 25 Nov 2009 17:51:15 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 177B08FC0C; Wed, 25 Nov 2009 17:51:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAPHpEqv057379; Wed, 25 Nov 2009 17:51:14 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAPHpEv1057377; Wed, 25 Nov 2009 17:51:14 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200911251751.nAPHpEv1057377@svn.freebsd.org> From: Pyun YongHyeon Date: Wed, 25 Nov 2009 17:51:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199808 - head/sys/dev/bge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Nov 2009 17:51:15 -0000 Author: yongari Date: Wed Nov 25 17:51:14 2009 New Revision: 199808 URL: http://svn.freebsd.org/changeset/base/199808 Log: Fix typo which inversed the logic which in turn disabled MSI. Pointy hat to: yongari Modified: head/sys/dev/bge/if_bge.c Modified: head/sys/dev/bge/if_bge.c ============================================================================== --- head/sys/dev/bge/if_bge.c Wed Nov 25 17:30:38 2009 (r199807) +++ head/sys/dev/bge/if_bge.c Wed Nov 25 17:51:14 2009 (r199808) @@ -2677,7 +2677,7 @@ bge_attach(device_t dev) * normal operation. */ rid = 0; - if (pci_find_extcap(sc->bge_dev, PCIY_MSI, ®) != 0) { + if (pci_find_extcap(sc->bge_dev, PCIY_MSI, ®) == 0) { sc->bge_msicap = reg; if (bge_can_use_msi(sc)) { msicount = pci_msi_count(dev); From owner-svn-src-all@FreeBSD.ORG Wed Nov 25 18:31:34 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8FC35106566B; Wed, 25 Nov 2009 18:31:34 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7E6678FC20; Wed, 25 Nov 2009 18:31:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAPIVYJv058265; Wed, 25 Nov 2009 18:31:34 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAPIVYtg058263; Wed, 25 Nov 2009 18:31:34 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200911251831.nAPIVYtg058263@svn.freebsd.org> From: Marius Strobl Date: Wed, 25 Nov 2009 18:31:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199809 - stable/8/sys/sparc64/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Nov 2009 18:31:34 -0000 Author: marius Date: Wed Nov 25 18:31:34 2009 New Revision: 199809 URL: http://svn.freebsd.org/changeset/base/199809 Log: MFC: r198502 Sync with the other archs and wrap the prototype of in_cksum_skip(9) in #ifdef _KERNEL. Submitted by: Ulrich Spoerlein Modified: stable/8/sys/sparc64/include/in_cksum.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/sparc64/include/in_cksum.h ============================================================================== --- stable/8/sys/sparc64/include/in_cksum.h Wed Nov 25 17:51:14 2009 (r199808) +++ stable/8/sys/sparc64/include/in_cksum.h Wed Nov 25 18:31:34 2009 (r199809) @@ -164,6 +164,8 @@ in_cksum_hdr(struct ip *ip) return (__ret); } +#ifdef _KERNEL u_short in_cksum_skip(struct mbuf *m, int len, int skip); +#endif #endif /* _MACHINE_IN_CKSUM_H_ */ From owner-svn-src-all@FreeBSD.ORG Wed Nov 25 18:31:59 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4BC7E106568B; Wed, 25 Nov 2009 18:31:59 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3A9B48FC1F; Wed, 25 Nov 2009 18:31:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAPIVxRP058307; Wed, 25 Nov 2009 18:31:59 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAPIVx2G058305; Wed, 25 Nov 2009 18:31:59 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200911251831.nAPIVx2G058305@svn.freebsd.org> From: Marius Strobl Date: Wed, 25 Nov 2009 18:31:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199810 - stable/7/sys/sparc64/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Nov 2009 18:31:59 -0000 Author: marius Date: Wed Nov 25 18:31:58 2009 New Revision: 199810 URL: http://svn.freebsd.org/changeset/base/199810 Log: MFC: r198502 Sync with the other archs and wrap the prototype of in_cksum_skip(9) in #ifdef _KERNEL. Submitted by: Ulrich Spoerlein Modified: stable/7/sys/sparc64/include/in_cksum.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/sparc64/include/in_cksum.h ============================================================================== --- stable/7/sys/sparc64/include/in_cksum.h Wed Nov 25 18:31:34 2009 (r199809) +++ stable/7/sys/sparc64/include/in_cksum.h Wed Nov 25 18:31:58 2009 (r199810) @@ -164,6 +164,8 @@ in_cksum_hdr(struct ip *ip) return (__ret); } +#ifdef _KERNEL u_short in_cksum_skip(struct mbuf *m, int len, int skip); +#endif #endif /* _MACHINE_IN_CKSUM_H_ */ From owner-svn-src-all@FreeBSD.ORG Wed Nov 25 18:32:12 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1033) id 3824E1065693; Wed, 25 Nov 2009 18:32:12 +0000 (UTC) Date: Wed, 25 Nov 2009 18:32:12 +0000 From: Alexey Dokuchaev To: Juli Mallett Message-ID: <20091125183212.GA16390@FreeBSD.org> References: <200911221651.nAMGpiIO023873@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.1i Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Hajimu UMEMOTO Subject: Re: svn commit: r199655 - head/usr.bin/w X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Nov 2009 18:32:12 -0000 On Wed, Nov 25, 2009 at 08:31:03AM -0800, Juli Mallett wrote: > In any event, it generates traffic if '-n' is specified and tries to > use the resolver, which is undesirable to at least me and DES. Me to. ./danfe From owner-svn-src-all@FreeBSD.ORG Wed Nov 25 18:39:27 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DF0261065696; Wed, 25 Nov 2009 18:39:26 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C4C778FC1A; Wed, 25 Nov 2009 18:39:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAPIdQSK058491; Wed, 25 Nov 2009 18:39:26 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAPIdQ46058489; Wed, 25 Nov 2009 18:39:26 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200911251839.nAPIdQ46058489@svn.freebsd.org> From: Marius Strobl Date: Wed, 25 Nov 2009 18:39:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199811 - in stable/6/sys: . sparc64/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Nov 2009 18:39:27 -0000 Author: marius Date: Wed Nov 25 18:39:26 2009 New Revision: 199811 URL: http://svn.freebsd.org/changeset/base/199811 Log: MFC: r198502 Sync with the other archs and wrap the prototype of in_cksum_skip(9) in #ifdef _KERNEL. Submitted by: Ulrich Spoerlein Modified: stable/6/sys/sparc64/include/in_cksum.h Directory Properties: stable/6/sys/ (props changed) stable/6/sys/Makefile (props changed) stable/6/sys/alpha/ (props changed) stable/6/sys/amd64/ (props changed) stable/6/sys/arm/ (props changed) stable/6/sys/boot/ (props changed) stable/6/sys/bsm/ (props changed) stable/6/sys/cam/ (props changed) stable/6/sys/coda/ (props changed) stable/6/sys/compat/ (props changed) stable/6/sys/conf/ (props changed) stable/6/sys/contrib/ (props changed) stable/6/sys/contrib/pf/ (props changed) stable/6/sys/crypto/ (props changed) stable/6/sys/ddb/ (props changed) stable/6/sys/dev/ (props changed) stable/6/sys/dev/cxgb/ (props changed) stable/6/sys/doc/ (props changed) stable/6/sys/fs/ (props changed) stable/6/sys/gdb/ (props changed) stable/6/sys/geom/ (props changed) stable/6/sys/gnu/ (props changed) stable/6/sys/i386/ (props changed) stable/6/sys/i4b/ (props changed) stable/6/sys/ia64/ (props changed) stable/6/sys/isa/ (props changed) stable/6/sys/isofs/ (props changed) stable/6/sys/kern/ (props changed) stable/6/sys/libkern/ (props changed) stable/6/sys/modules/ (props changed) stable/6/sys/net/ (props changed) stable/6/sys/net80211/ (props changed) stable/6/sys/netatalk/ (props changed) stable/6/sys/netatm/ (props changed) stable/6/sys/netgraph/ (props changed) stable/6/sys/netinet/ (props changed) stable/6/sys/netinet6/ (props changed) stable/6/sys/netipsec/ (props changed) stable/6/sys/netipx/ (props changed) stable/6/sys/netkey/ (props changed) stable/6/sys/netnatm/ (props changed) stable/6/sys/netncp/ (props changed) stable/6/sys/netsmb/ (props changed) stable/6/sys/nfs/ (props changed) stable/6/sys/nfs4client/ (props changed) stable/6/sys/nfsclient/ (props changed) stable/6/sys/nfsserver/ (props changed) stable/6/sys/nlm/ (props changed) stable/6/sys/opencrypto/ (props changed) stable/6/sys/pc98/ (props changed) stable/6/sys/pccard/ (props changed) stable/6/sys/pci/ (props changed) stable/6/sys/posix4/ (props changed) stable/6/sys/powerpc/ (props changed) stable/6/sys/rpc/ (props changed) stable/6/sys/security/ (props changed) stable/6/sys/sparc64/ (props changed) stable/6/sys/sys/ (props changed) stable/6/sys/tools/ (props changed) stable/6/sys/ufs/ (props changed) stable/6/sys/vm/ (props changed) stable/6/sys/xdr/ (props changed) Modified: stable/6/sys/sparc64/include/in_cksum.h ============================================================================== --- stable/6/sys/sparc64/include/in_cksum.h Wed Nov 25 18:31:58 2009 (r199810) +++ stable/6/sys/sparc64/include/in_cksum.h Wed Nov 25 18:39:26 2009 (r199811) @@ -164,6 +164,8 @@ in_cksum_hdr(struct ip *ip) return (__ret); } +#ifdef _KERNEL u_short in_cksum_skip(struct mbuf *m, int len, int skip); +#endif #endif /* _MACHINE_IN_CKSUM_H_ */ From owner-svn-src-all@FreeBSD.ORG Wed Nov 25 19:00:31 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0B16C106568B; Wed, 25 Nov 2009 19:00:31 +0000 (UTC) (envelope-from julian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EF00A8FC13; Wed, 25 Nov 2009 19:00:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAPJ0UnF058983; Wed, 25 Nov 2009 19:00:30 GMT (envelope-from julian@svn.freebsd.org) Received: (from julian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAPJ0UDL058981; Wed, 25 Nov 2009 19:00:30 GMT (envelope-from julian@svn.freebsd.org) Message-Id: <200911251900.nAPJ0UDL058981@svn.freebsd.org> From: Julian Elischer Date: Wed, 25 Nov 2009 19:00:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199812 - head/tools/tools/tinybsd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Nov 2009 19:00:31 -0000 Author: julian Date: Wed Nov 25 19:00:30 2009 New Revision: 199812 URL: http://svn.freebsd.org/changeset/base/199812 Log: exit if "make distribition" fails Submitted by: patrick tracanelli MFC after: 1 week Modified: head/tools/tools/tinybsd/tinybsd Modified: head/tools/tools/tinybsd/tinybsd ============================================================================== --- head/tools/tools/tinybsd/tinybsd Wed Nov 25 18:39:26 2009 (r199811) +++ head/tools/tools/tinybsd/tinybsd Wed Nov 25 19:00:30 2009 (r199812) @@ -393,7 +393,7 @@ create_etc() { cd /usr/src/etc/ mkdir -p ${WORKDIR}/var/named/etc/namedb - make distribution DESTDIR=${WORKDIR} + make distribution DESTDIR=${WORKDIR} || exit 1 } create_ssh_keys() { From owner-svn-src-all@FreeBSD.ORG Wed Nov 25 20:07:29 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B8F6C1065670; Wed, 25 Nov 2009 20:07:29 +0000 (UTC) (envelope-from antoine.brodin.freebsd@gmail.com) Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by mx1.freebsd.org (Postfix) with ESMTP id E2CF08FC14; Wed, 25 Nov 2009 20:07:28 +0000 (UTC) Received: by ewy26 with SMTP id 26so72724ewy.3 for ; Wed, 25 Nov 2009 12:07:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:date:from:to:cc :subject:message-id:in-reply-to:references:x-mailer:mime-version :content-type:content-transfer-encoding; bh=FNHpsXWAaTs2PIRtP3ggeSjq749Cc/BjWuZ5wIZxMR4=; b=faRYwNyxr4hlIErYNAiFFWN8T1KvuiULipOoGe3LPFKIVH6JZy2kE76KUM/fqPZO5/ j5M+pLdYLgjXim349KX+vsC/SSBHf+bz2BQ1XN43Gn+wIotG5jORs8MFf7s+SJbf+3F0 03GX9MaGLujdJ/0C3JcsZ832Tc2NmefUWJc4o= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:date:from:to:cc:subject:message-id:in-reply-to:references :x-mailer:mime-version:content-type:content-transfer-encoding; b=xp0v8+deTguXlj7LhrzF/2mMjdUKHjDYznf5qDKMBIA8+ZhwZ6S+Ku+ye1N1o81FVw XBca6fnvV+aUgKQFTOjev8U4274zuQshGTCSLWNtkC+cEyJBEVo0dE0dAR5k4BqNeeed vFogrKlZ5Qvs9O0y0hk03lMcPT8dgCFRU0zFE= Received: by 10.213.109.69 with SMTP id i5mr8319237ebp.11.1259179646874; Wed, 25 Nov 2009 12:07:26 -0800 (PST) Received: from peanut.dreadbsd.org (mna75-2-82-67-196-50.fbx.proxad.net [82.67.196.50]) by mx.google.com with ESMTPS id 15sm1007444ewy.0.2009.11.25.12.07.23 (version=SSLv3 cipher=RC4-MD5); Wed, 25 Nov 2009 12:07:24 -0800 (PST) Sender: Antoine Brodin Date: Wed, 25 Nov 2009 21:07:18 +0100 From: Antoine Brodin To: Darren Reed Message-Id: <20091125210718.deac319d.antoine@FreeBSD.org> In-Reply-To: <20091119083005.S37440@maildrop.int.zabbadoz.net> References: <200911190810.nAJ8AOKF098105@svn.freebsd.org> <20091119083005.S37440@maildrop.int.zabbadoz.net> X-Mailer: Sylpheed 2.7.1 (GTK+ 2.16.6; i386-portbld-freebsd8.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, "Bjoern A. Zeeb" , svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r199510 - head/contrib/ipfilter/man X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Nov 2009 20:07:29 -0000 On Thu, 19 Nov 2009 08:30:54 +0000 (UTC) "Bjoern A. Zeeb" wrote: > On Thu, 19 Nov 2009, Darren Reed wrote: > > Author: darrenr > > Date: Thu Nov 19 08:10:24 2009 > > New Revision: 199510 > > URL: http://svn.freebsd.org/changeset/base/199510 > > > > Log: > > fix spelling mistake > > > > Modified: > > head/contrib/ipfilter/man/ipf.8 > > > > Modified: head/contrib/ipfilter/man/ipf.8 > > ============================================================================== > > --- head/contrib/ipfilter/man/ipf.8 Thu Nov 19 07:01:09 2009 (r199509) > > +++ head/contrib/ipfilter/man/ipf.8 Thu Nov 19 08:10:24 2009 (r199510) > > @@ -46,7 +46,7 @@ supports \fBlanguage\fI. At present, th > > \fBC\fB (-cc) for which two files - \fBip_rules.c\fP > > and \fBip_rules.h\fP are generated in the \fBCURRENT DIRECTORY\fP when > > \fBipf\fP is being run. These files can be used with the > > -\fBIPFILTER_COMPILED\fP kernel option to build filter rules staticly into > > +\fBIPFILTER_COMPILED\fP kernel option to build filter rules staticlly into > > I might need coffee, still, but did you mean "statically"? Hi Darren, Do you plan to fix this? Cheers, Antoine From owner-svn-src-all@FreeBSD.ORG Wed Nov 25 20:23:18 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 80C16106566C; Wed, 25 Nov 2009 20:23:18 +0000 (UTC) (envelope-from fanf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6F21B8FC1B; Wed, 25 Nov 2009 20:23:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAPKNIh7060770; Wed, 25 Nov 2009 20:23:18 GMT (envelope-from fanf@svn.freebsd.org) Received: (from fanf@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAPKNIl0060766; Wed, 25 Nov 2009 20:23:18 GMT (envelope-from fanf@svn.freebsd.org) Message-Id: <200911252023.nAPKNIl0060766@svn.freebsd.org> From: Tony Finch Date: Wed, 25 Nov 2009 20:23:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199813 - head/usr.bin/unifdef X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Nov 2009 20:23:18 -0000 Author: fanf Date: Wed Nov 25 20:23:18 2009 New Revision: 199813 URL: http://svn.freebsd.org/changeset/base/199813 Log: Update unifdef to my upstream version 1.188 Main highlights: (A) The new -B option compresses blank lines around a deleted section so that blank lines around "paragraphs" of code don't get doubled. (B) Lenient evaluation of && and || so that #if expressions can be evaluated even when some of their sub-expressions cannot be. (C) The evaluator can now handle macros with arguments. (D) Portability fixes, especially for unifdefall. Contributions from: Ben Hutchings at Solarflare Communications (A and B) Anders H Kaseorg (A and C) Jonathan Nieder (D) Obtained from: http://dotat.at/prog/unifdef/ Modified: head/usr.bin/unifdef/unifdef.1 head/usr.bin/unifdef/unifdef.c head/usr.bin/unifdef/unifdefall.sh Modified: head/usr.bin/unifdef/unifdef.1 ============================================================================== --- head/usr.bin/unifdef/unifdef.1 Wed Nov 25 19:00:30 2009 (r199812) +++ head/usr.bin/unifdef/unifdef.1 Wed Nov 25 20:23:18 2009 (r199813) @@ -1,6 +1,6 @@ .\" Copyright (c) 1985, 1991, 1993 .\" The Regents of the University of California. All rights reserved. -.\" Copyright (c) 2002 - 2005 Tony Finch . All rights reserved. +.\" Copyright (c) 2002 - 2009 Tony Finch . All rights reserved. .\" .\" This code is derived from software contributed to Berkeley by .\" Dave Yost. It was rewritten to support ANSI C by Tony Finch. @@ -30,7 +30,7 @@ .\" SUCH DAMAGE. .\" .\" @(#)unifdef.1 8.2 (Berkeley) 4/1/94 -.\" $dotat: things/unifdef.1,v 1.51 2005/03/08 12:39:01 fanf2 Exp $ +.\" $dotat: unifdef/unifdef.1,v 1.60 2009/11/25 00:11:02 fanf2 Exp $ .\" $FreeBSD$ .\" .Dd September 24, 2002 @@ -41,7 +41,7 @@ .Nd remove preprocessor conditionals from code .Sh SYNOPSIS .Nm -.Op Fl cdeklnst +.Op Fl BbcdeKknst .Op Fl I Ns Ar path .Op Fl D Ns Ar sym Ns Op = Ns Ar val .Op Fl U Ns Ar sym @@ -70,46 +70,85 @@ utility acts on .Ic #if , #ifdef , #ifndef , #elif , #else , and .Ic #endif -lines, -and it understands only the commonly-used subset +lines. +A directive is only processed +if the symbols specified on the command line are sufficient to allow +.Nm +to get a definite value for its control expression. +If the result is false, +the directive and the following lines under its control are removed. +If the result is true, +only the directive is removed. +An +.Ic #ifdef +or +.Ic #ifndef +directive is passed through unchanged +if its controlling symbol is not specified on the command line. +Any +.Ic #if +or +.Ic #elif +control expression that has an unknown value or that +.Nm +cannot parse is passed through unchanged. +By default, +.Nm +ignores +.Ic #if +and +.Ic #elif +lines with constant expressions; +it can be told to process them by specifying the +.Fl k +flag on the command line. +.Pp +It understands a commonly-used subset of the expression syntax for .Ic #if and .Ic #elif -lines. -It handles +lines: +integer constants, integer values of symbols defined on the command line, the .Fn defined -operator applied to symbols defined or undefined on the command line, +operator, the operators .Ic \&! , < , > , <= , >= , == , != , && , || , and parenthesized expressions. -Anything that it does not understand is passed through unharmed. -It only processes -.Ic #ifdef -and -.Ic #ifndef -directives if the symbol is specified on the command line, -otherwise they are also passed through unchanged. -By default, it ignores -.Ic #if -and -.Ic #elif -lines with constant expressions, -or they may be processed by specifying the -.Fl k -flag on the command line. +A kind of +.Dq "short circuit" +evaluation is used for the +.Ic && +operator: +if either operand is definitely false then the result is false, +even if the value of the other operand is unknown. +Similarly, +if either operand of +.Ic || +is definitely true then the result is true. +.Pp +In most cases, the +.Nm +utility does not distinguish between object-like macros +(without arguments) and function-like arguments (with arguments). +If a macro is not explicitly defined, or is defined with the +.Fl D +flag on the command-line, its arguments are ignored. +If a macro is explicitly undefined on the command line with the +.Fl U +flag, it may not have any arguments since this leads to a syntax error. .Pp The .Nm -utility also understands just enough about C +utility understands just enough about C to know when one of the directives is inactive because it is inside a comment, or affected by a backslash-continued line. It spots unusually-formatted preprocessor directives -and knows when the layout is too odd to handle. +and knows when the layout is too odd for it to handle. .Pp A script called .Nm unifdefall @@ -125,8 +164,7 @@ and their definitions (or lack thereof), then invokes .Nm with appropriate arguments to process the file. -.Pp -Available options: +.Sh OPTIONS .Pp .Bl -tag -width indent -compact .It Fl D Ns Ar sym Ns Op = Ns Ar val @@ -143,6 +181,19 @@ Specify that a symbol is undefined. If the same symbol appears in more than one argument, the last occurrence dominates. .Pp +.It Fl B +Compress blank lines around a deleted section. +Mutually exclusive with the +.Fl b +option. +.Pp +.It Fl b +Replace removed lines with blank lines +instead of deleting them. +Mutually exclusive with the +.Fl B +option. +.Pp .It Fl c If the .Fl c @@ -174,6 +225,16 @@ option changes the behaviour so that, where possible, such lines are left unprocessed instead of reporting an error. .Pp +.It Fl K +Always treat the result of +.Ic && +and +.Ic || +operators as unknown if either operand is unknown, +instead of short-circuiting when unknown operands can't affect the result. +This option is for compatibility with older versions of +.Nm . +.Pp .It Fl k Process .Ic #if @@ -186,10 +247,6 @@ because they typically start and are used as a kind of comment to sketch out future or past development. It would be rude to strip them out, just as it would be for normal comments. .Pp -.It Fl l -Replace removed lines with blank lines -instead of deleting them. -.Pp .It Fl n Add .Li #line @@ -235,7 +292,7 @@ comments and line continuations inside those .Ic #ifdef Ns s . -One specifies ignored symbols with +You can specify ignored symbols with .Fl iD Ns Ar sym Ns Oo = Ns Ar val Oc and .Fl iU Ns Ar sym @@ -313,7 +370,7 @@ command appeared in support was added in .Fx 4.7 . .Sh AUTHORS -This implementation was originally written by +The original implementation was written by .An Dave Yost Aq Dave@Yost.com . .An Tony Finch Aq dot@dotat.at rewrote it to support Modified: head/usr.bin/unifdef/unifdef.c ============================================================================== --- head/usr.bin/unifdef/unifdef.c Wed Nov 25 19:00:30 2009 (r199812) +++ head/usr.bin/unifdef/unifdef.c Wed Nov 25 20:23:18 2009 (r199813) @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002 - 2008 Tony Finch + * Copyright (c) 2002 - 2009 Tony Finch * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -33,18 +33,9 @@ #include -#ifndef lint -#if 0 -static const char copyright[] = -"@(#) Copyright (c) 1985, 1993\n\ - The Regents of the University of California. All rights reserved.\n"; -#endif #ifdef __IDSTRING -__IDSTRING(Berkeley, "@(#)unifdef.c 8.1 (Berkeley) 6/6/93"); -__IDSTRING(NetBSD, "$NetBSD: unifdef.c,v 1.8 2000/07/03 02:51:36 matt Exp $"); -__IDSTRING(dotat, "$dotat: things/unifdef.c,v 1.178 2008/03/02 22:23:32 fanf2 Exp $"); +__IDSTRING(dotat, "$dotat: unifdef/unifdef.c,v 1.188 2009/11/25 00:11:02 fanf2 Exp $"); #endif -#endif /* not lint */ #ifdef __FBSDID __FBSDID("$FreeBSD$"); #endif @@ -88,6 +79,7 @@ typedef enum { LT_DODGY_LAST = LT_DODGY + LT_ENDIF, LT_PLAIN, /* ordinary line */ LT_EOF, /* end of file */ + LT_ERROR, /* unevaluable #if */ LT_COUNT } Linetype; @@ -98,7 +90,7 @@ static char const * const linetype_name[ "DODGY IF", "DODGY TRUE", "DODGY FALSE", "DODGY ELIF", "DODGY ELTRUE", "DODGY ELFALSE", "DODGY ELSE", "DODGY ENDIF", - "PLAIN", "EOF" + "PLAIN", "EOF", "ERROR" }; /* state of #if processing */ @@ -166,11 +158,13 @@ static char const * const linestate_name * Globals. */ +static bool compblank; /* -B: compress blank lines */ +static bool lnblank; /* -b: blank deleted lines */ static bool complement; /* -c: do the complement */ static bool debugging; /* -d: debugging reports */ static bool iocccok; /* -e: fewer IOCCC errors */ +static bool strictlogic; /* -K: keep ambiguous #ifs */ static bool killconsts; /* -k: eval constant #ifs */ -static bool lnblank; /* -l: blank deleted lines */ static bool lnnum; /* -n: add #line directives */ static bool symlist; /* -s: output symbol list */ static bool text; /* -t: this is a text file */ @@ -194,7 +188,9 @@ static bool ignoring[MAXDEPT static int stifline[MAXDEPTH]; /* start of current #if */ static int depth; /* current #if nesting */ static int delcount; /* count of deleted lines */ -static bool keepthis; /* don't delete constant #if */ +static unsigned blankcount; /* count of blank lines */ +static unsigned blankmax; /* maximum recent blankcount */ +static bool constexpr; /* constant #if expression */ static int exitstat; /* program exit status */ @@ -204,13 +200,14 @@ static void done(void); static void error(const char *); static int findsym(const char *); static void flushline(bool); -static Linetype getline(void); +static Linetype parseline(void); static Linetype ifeval(const char **); static void ignoreoff(void); static void ignoreon(void); static void keywordedit(const char *); static void nest(void); static void process(void); +static const char *skipargs(const char *); static const char *skipcomment(const char *); static const char *skipsym(const char *); static void state(Ifstate); @@ -218,7 +215,7 @@ static int strlcmp(const ch static void unnest(void); static void usage(void); -#define endsym(c) (!isalpha((unsigned char)c) && !isdigit((unsigned char)c) && c != '_') +#define endsym(c) (!isalnum((unsigned char)c) && c != '_') /* * The main program. @@ -228,7 +225,7 @@ main(int argc, char *argv[]) { int opt; - while ((opt = getopt(argc, argv, "i:D:U:I:cdeklnst")) != -1) + while ((opt = getopt(argc, argv, "i:D:U:I:BbcdeKklnst")) != -1) switch (opt) { case 'i': /* treat stuff controlled by these symbols as text */ /* @@ -253,6 +250,13 @@ main(int argc, char *argv[]) case 'I': /* no-op for compatibility with cpp */ break; + case 'B': /* compress blank lines around removed section */ + compblank = true; + break; + case 'b': /* blank deleted lines instead of omitting them */ + case 'l': /* backwards compatibility */ + lnblank = true; + break; case 'c': /* treat -D as -U and vice versa */ complement = true; break; @@ -262,12 +266,12 @@ main(int argc, char *argv[]) case 'e': /* fewer errors from dodgy lines */ iocccok = true; break; + case 'K': /* keep ambiguous #ifs */ + strictlogic = true; + break; case 'k': /* process constant #ifs */ killconsts = true; break; - case 'l': /* blank deleted lines instead of omitting them */ - lnblank = true; - break; case 'n': /* add #line directive after deleted lines */ lnnum = true; break; @@ -282,6 +286,8 @@ main(int argc, char *argv[]) } argc -= optind; argv += optind; + if (compblank && lnblank) + errx(2, "-B and -b are mutually exclusive"); if (argc > 1) { errx(2, "can only do one file"); } else if (argc == 1 && strcmp(*argv, "-") != 0) { @@ -300,7 +306,7 @@ main(int argc, char *argv[]) static void usage(void) { - fprintf(stderr, "usage: unifdef [-cdeklnst] [-Ipath]" + fprintf(stderr, "usage: unifdef [-BbcdeKknst] [-Ipath]" " [-Dsym[=val]] [-Usym] [-iDsym[=val]] [-iUsym] ... [file]\n"); exit(2); } @@ -381,46 +387,46 @@ static state_fn * const trans_table[IS_C /* IS_OUTSIDE */ { Itrue, Ifalse,Fpass, Ftrue, Ffalse,Eelif, Eelif, Eelif, Eelse, Eendif, Oiffy, Oiffy, Fpass, Oif, Oif, Eelif, Eelif, Eelif, Eelse, Eendif, - print, done }, + print, done, abort }, /* IS_FALSE_PREFIX */ { Idrop, Idrop, Fdrop, Fdrop, Fdrop, Mpass, Strue, Sfalse,Selse, Dendif, Idrop, Idrop, Fdrop, Fdrop, Fdrop, Mpass, Eioccc,Eioccc,Eioccc,Eioccc, - drop, Eeof }, + drop, Eeof, abort }, /* IS_TRUE_PREFIX */ { Itrue, Ifalse,Fpass, Ftrue, Ffalse,Dfalse,Dfalse,Dfalse,Delse, Dendif, Oiffy, Oiffy, Fpass, Oif, Oif, Eioccc,Eioccc,Eioccc,Eioccc,Eioccc, - print, Eeof }, + print, Eeof, abort }, /* IS_PASS_MIDDLE */ { Itrue, Ifalse,Fpass, Ftrue, Ffalse,Pelif, Mtrue, Delif, Pelse, Pendif, Oiffy, Oiffy, Fpass, Oif, Oif, Pelif, Oelif, Oelif, Pelse, Pendif, - print, Eeof }, + print, Eeof, abort }, /* IS_FALSE_MIDDLE */ { Idrop, Idrop, Fdrop, Fdrop, Fdrop, Pelif, Mtrue, Delif, Pelse, Pendif, Idrop, Idrop, Fdrop, Fdrop, Fdrop, Eioccc,Eioccc,Eioccc,Eioccc,Eioccc, - drop, Eeof }, + drop, Eeof, abort }, /* IS_TRUE_MIDDLE */ { Itrue, Ifalse,Fpass, Ftrue, Ffalse,Melif, Melif, Melif, Melse, Pendif, Oiffy, Oiffy, Fpass, Oif, Oif, Eioccc,Eioccc,Eioccc,Eioccc,Pendif, - print, Eeof }, + print, Eeof, abort }, /* IS_PASS_ELSE */ { Itrue, Ifalse,Fpass, Ftrue, Ffalse,Eelif, Eelif, Eelif, Eelse, Pendif, Oiffy, Oiffy, Fpass, Oif, Oif, Eelif, Eelif, Eelif, Eelse, Pendif, - print, Eeof }, + print, Eeof, abort }, /* IS_FALSE_ELSE */ { Idrop, Idrop, Fdrop, Fdrop, Fdrop, Eelif, Eelif, Eelif, Eelse, Dendif, Idrop, Idrop, Fdrop, Fdrop, Fdrop, Eelif, Eelif, Eelif, Eelse, Eioccc, - drop, Eeof }, + drop, Eeof, abort }, /* IS_TRUE_ELSE */ { Itrue, Ifalse,Fpass, Ftrue, Ffalse,Eelif, Eelif, Eelif, Eelse, Dendif, Oiffy, Oiffy, Fpass, Oif, Oif, Eelif, Eelif, Eelif, Eelse, Eioccc, - print, Eeof }, + print, Eeof, abort }, /* IS_FALSE_TRAILER */ { Idrop, Idrop, Fdrop, Fdrop, Fdrop, Dfalse,Dfalse,Dfalse,Delse, Dendif, Idrop, Idrop, Fdrop, Fdrop, Fdrop, Dfalse,Dfalse,Dfalse,Delse, Eioccc, - drop, Eeof } + drop, Eeof, abort } /*TRUEI FALSEI IF TRUE FALSE ELIF ELTRUE ELFALSE ELSE ENDIF TRUEI FALSEI IF TRUE FALSE ELIF ELTRUE ELFALSE ELSE ENDIF (DODGY) - PLAIN EOF */ + PLAIN EOF ERROR */ }; /* @@ -481,15 +487,23 @@ flushline(bool keep) if (symlist) return; if (keep ^ complement) { - if (lnnum && delcount > 0) - printf("#line %d\n", linenum); - fputs(tline, stdout); - delcount = 0; + bool blankline = tline[strspn(tline, " \t\n")] == '\0'; + if (blankline && compblank && blankcount != blankmax) { + delcount += 1; + blankcount += 1; + } else { + if (lnnum && delcount > 0) + printf("#line %d\n", linenum); + fputs(tline, stdout); + delcount = 0; + blankmax = blankcount = blankline ? blankcount + 1 : 0; + } } else { if (lnblank) putc('\n', stdout); exitstat = 1; delcount += 1; + blankcount = 0; } } @@ -501,9 +515,12 @@ process(void) { Linetype lineval; + /* When compressing blank lines, act as if the file + is preceded by a large number of blank lines. */ + blankmax = blankcount = 1000; for (;;) { linenum++; - lineval = getline(); + lineval = parseline(); trans_table[ifstate[depth]][lineval](); debug("process %s -> %s depth %d", linetype_name[lineval], @@ -517,7 +534,7 @@ process(void) * help from skipcomment(). */ static Linetype -getline(void) +parseline(void) { const char *cp; int cursym; @@ -613,17 +630,40 @@ getline(void) /* * These are the binary operators that are supported by the expression - * evaluator. Note that if support for division is added then we also - * need short-circuiting booleans because of divide-by-zero. + * evaluator. */ -static int op_lt(int a, int b) { return (a < b); } -static int op_gt(int a, int b) { return (a > b); } -static int op_le(int a, int b) { return (a <= b); } -static int op_ge(int a, int b) { return (a >= b); } -static int op_eq(int a, int b) { return (a == b); } -static int op_ne(int a, int b) { return (a != b); } -static int op_or(int a, int b) { return (a || b); } -static int op_and(int a, int b) { return (a && b); } +static Linetype op_strict(int *p, int v, Linetype at, Linetype bt) { + if(at == LT_IF || bt == LT_IF) return (LT_IF); + return (*p = v, v ? LT_TRUE : LT_FALSE); +} +static Linetype op_lt(int *p, Linetype at, int a, Linetype bt, int b) { + return op_strict(p, a < b, at, bt); +} +static Linetype op_gt(int *p, Linetype at, int a, Linetype bt, int b) { + return op_strict(p, a > b, at, bt); +} +static Linetype op_le(int *p, Linetype at, int a, Linetype bt, int b) { + return op_strict(p, a <= b, at, bt); +} +static Linetype op_ge(int *p, Linetype at, int a, Linetype bt, int b) { + return op_strict(p, a >= b, at, bt); +} +static Linetype op_eq(int *p, Linetype at, int a, Linetype bt, int b) { + return op_strict(p, a == b, at, bt); +} +static Linetype op_ne(int *p, Linetype at, int a, Linetype bt, int b) { + return op_strict(p, a != b, at, bt); +} +static Linetype op_or(int *p, Linetype at, int a, Linetype bt, int b) { + if (!strictlogic && (at == LT_TRUE || bt == LT_TRUE)) + return (*p = 1, LT_TRUE); + return op_strict(p, a || b, at, bt); +} +static Linetype op_and(int *p, Linetype at, int a, Linetype bt, int b) { + if (!strictlogic && (at == LT_FALSE || bt == LT_FALSE)) + return (*p = 0, LT_FALSE); + return op_strict(p, a && b, at, bt); +} /* * An evaluation function takes three arguments, as follows: (1) a pointer to @@ -632,8 +672,8 @@ static int op_and(int a, int b) { return * value of the expression; and (3) a pointer to a char* that points to the * expression to be evaluated and that is updated to the end of the expression * when evaluation is complete. The function returns LT_FALSE if the value of - * the expression is zero, LT_TRUE if it is non-zero, or LT_IF if the - * expression could not be evaluated. + * the expression is zero, LT_TRUE if it is non-zero, LT_IF if the expression + * depends on an unknown symbol, or LT_ERROR if there is a parse failure. */ struct ops; @@ -652,7 +692,7 @@ static const struct ops { eval_fn *inner; struct op { const char *str; - int (*fn)(int, int); + Linetype (*fn)(int *, Linetype, int, Linetype, int); } op[5]; } eval_ops[] = { { eval_table, { { "||", op_or } } }, @@ -667,8 +707,8 @@ static const struct ops { /* * Function for evaluating the innermost parts of expressions, - * viz. !expr (expr) defined(symbol) symbol number - * We reset the keepthis flag when we find a non-constant subexpression. + * viz. !expr (expr) number defined(symbol) symbol + * We reset the constexpr flag in the last two cases. */ static Linetype eval_unary(const struct ops *ops, int *valp, const char **cpp) @@ -677,25 +717,34 @@ eval_unary(const struct ops *ops, int *v char *ep; int sym; bool defparen; + Linetype lt; cp = skipcomment(*cpp); if (*cp == '!') { debug("eval%d !", ops - eval_ops); cp++; - if (eval_unary(ops, valp, &cp) == LT_IF) - return (LT_IF); - *valp = !*valp; + lt = eval_unary(ops, valp, &cp); + if (lt == LT_ERROR) + return (LT_ERROR); + if (lt != LT_IF) { + *valp = !*valp; + lt = *valp ? LT_TRUE : LT_FALSE; + } } else if (*cp == '(') { cp++; debug("eval%d (", ops - eval_ops); - if (eval_table(eval_ops, valp, &cp) == LT_IF) - return (LT_IF); + lt = eval_table(eval_ops, valp, &cp); + if (lt == LT_ERROR) + return (LT_ERROR); cp = skipcomment(cp); if (*cp++ != ')') - return (LT_IF); + return (LT_ERROR); } else if (isdigit((unsigned char)*cp)) { debug("eval%d number", ops - eval_ops); *valp = strtol(cp, &ep, 0); + if (ep == cp) + return (LT_ERROR); + lt = *valp ? LT_TRUE : LT_FALSE; cp = skipsym(cp); } else if (strncmp(cp, "defined", 7) == 0 && endsym(cp[7])) { cp = skipcomment(cp+7); @@ -707,36 +756,43 @@ eval_unary(const struct ops *ops, int *v defparen = false; } sym = findsym(cp); - if (sym < 0) - return (LT_IF); - *valp = (value[sym] != NULL); + if (sym < 0) { + lt = LT_IF; + } else { + *valp = (value[sym] != NULL); + lt = *valp ? LT_TRUE : LT_FALSE; + } cp = skipsym(cp); cp = skipcomment(cp); if (defparen && *cp++ != ')') - return (LT_IF); - keepthis = false; + return (LT_ERROR); + constexpr = false; } else if (!endsym(*cp)) { debug("eval%d symbol", ops - eval_ops); sym = findsym(cp); - if (sym < 0) - return (LT_IF); - if (value[sym] == NULL) + cp = skipsym(cp); + if (sym < 0) { + lt = LT_IF; + cp = skipargs(cp); + } else if (value[sym] == NULL) { *valp = 0; - else { + lt = LT_FALSE; + } else { *valp = strtol(value[sym], &ep, 0); if (*ep != '\0' || ep == value[sym]) - return (LT_IF); + return (LT_ERROR); + lt = *valp ? LT_TRUE : LT_FALSE; + cp = skipargs(cp); } - cp = skipsym(cp); - keepthis = false; + constexpr = false; } else { debug("eval%d bad expr", ops - eval_ops); - return (LT_IF); + return (LT_ERROR); } *cpp = cp; debug("eval%d = %d", ops - eval_ops, *valp); - return (*valp ? LT_TRUE : LT_FALSE); + return (lt); } /* @@ -748,11 +804,13 @@ eval_table(const struct ops *ops, int *v const struct op *op; const char *cp; int val; + Linetype lt, rt; debug("eval%d", ops - eval_ops); cp = *cpp; - if (ops->inner(ops+1, valp, &cp) == LT_IF) - return (LT_IF); + lt = ops->inner(ops+1, valp, &cp); + if (lt == LT_ERROR) + return (LT_ERROR); for (;;) { cp = skipcomment(cp); for (op = ops->op; op->str != NULL; op++) @@ -762,14 +820,16 @@ eval_table(const struct ops *ops, int *v break; cp += strlen(op->str); debug("eval%d %s", ops - eval_ops, op->str); - if (ops->inner(ops+1, &val, &cp) == LT_IF) - return (LT_IF); - *valp = op->fn(*valp, val); + rt = ops->inner(ops+1, &val, &cp); + if (rt == LT_ERROR) + return (LT_ERROR); + lt = op->fn(valp, lt, *valp, rt, val); } *cpp = cp; debug("eval%d = %d", ops - eval_ops, *valp); - return (*valp ? LT_TRUE : LT_FALSE); + debug("eval%d lt = %s", ops - eval_ops, linetype_name[lt]); + return (lt); } /* @@ -784,10 +844,10 @@ ifeval(const char **cpp) int val = 0; debug("eval %s", *cpp); - keepthis = killconsts ? false : true; + constexpr = killconsts ? false : true; ret = eval_table(eval_ops, &val, cpp); debug("eval = %d", val); - return (keepthis ? LT_IF : ret); + return (constexpr ? LT_IF : ret == LT_ERROR ? LT_IF : ret); } /* @@ -899,6 +959,31 @@ skipcomment(const char *cp) } /* + * Skip macro arguments. + */ +static const char * +skipargs(const char *cp) +{ + const char *ocp = cp; + int level = 0; + cp = skipcomment(cp); + if (*cp != '(') + return (cp); + do { + if (*cp == '(') + level++; + if (*cp == ')') + level--; + cp = skipcomment(cp+1); + } while (level != 0 && *cp != '\0'); + if (level == 0) + return (cp); + else + /* Rewind and re-detect the syntax error later. */ + return (ocp); +} + +/* * Skip over an identifier. */ static const char * Modified: head/usr.bin/unifdef/unifdefall.sh ============================================================================== --- head/usr.bin/unifdef/unifdefall.sh Wed Nov 25 19:00:30 2009 (r199812) +++ head/usr.bin/unifdef/unifdefall.sh Wed Nov 25 20:23:18 2009 (r199813) @@ -1,29 +1,53 @@ #!/bin/sh # -# remove all the #if's from a source file +# unifdefall: remove all the #if's from a source file # -# $dotat: things/unifdefall.sh,v 1.9 2002/09/24 19:43:57 fanf2 Exp $ +# Copyright (c) 2002 - 2009 Tony Finch . All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $dotat: unifdef/unifdefall.sh,v 1.21 2009/11/25 19:54:34 fanf2 Exp $ # $FreeBSD$ set -e -basename=`basename $0` -tmp=`mktemp -d -t $basename` || exit 2 - -unifdef -s "$@" | sort | uniq > $tmp/ctrl -cpp -dM "$@" | sort | - sed -Ee 's/^#define[ ]+(.*[^ ])[ ]*$/\1/' > $tmp/hashdefs -sed -Ee 's/^([A-Za-z0-9_]+).*$/\1/' $tmp/hashdefs > $tmp/alldef -comm -23 $tmp/ctrl $tmp/alldef > $tmp/undef -comm -12 $tmp/ctrl $tmp/alldef > $tmp/def +basename=$(basename $0) +tmp=$(mktemp -d "${TMPDIR:-/tmp}/$basename.XXXXXXXXXX") || exit 2 +trap 'rm -r "$tmp" || exit 1' EXIT -echo unifdef -k \\ > $tmp/cmd -sed -Ee 's/^(.*)$/-U\1 \\/' $tmp/undef >> $tmp/cmd -while read sym -do sed -Ee '/^('"$sym"')([(][^)]*[)])?([ ]+(.*))?$/!d;s//-D\1=\4/' $tmp/hashdefs -done < $tmp/def | - sed -Ee 's/\\/\\\\/g;s/"/\\"/g;s/^/"/;s/$/" \\/' >> $tmp/cmd -echo '"$@"' >> $tmp/cmd -sh $tmp/cmd "$@" +export LC_ALL=C -rm -r $tmp +./unifdef -s "$@" | sort | uniq >"$tmp/ctrl" +cpp -dM "$@" | sort | sed 's/^#define //' >"$tmp/hashdefs" +sed 's/[^A-Za-z0-9_].*$//' "$tmp/hashdefs" >"$tmp/alldef" +comm -23 "$tmp/ctrl" "$tmp/alldef" >"$tmp/undef" +comm -12 "$tmp/ctrl" "$tmp/alldef" >"$tmp/def" +( + echo ./unifdef -k \\ + sed 's/.*/-U& \\/' "$tmp/undef" + while read sym + do sed -n 's/^'$sym'\(([^)]*)\)\{0,1\} /-D'$sym'=/p' "$tmp/hashdefs" + done <"$tmp/def" | + sed "s/'/'\\\\''/g;s/.*/'&' \\\\/" + echo '"$@"' +) >"$tmp/cmd" +sh "$tmp/cmd" "$@" From owner-svn-src-all@FreeBSD.ORG Wed Nov 25 20:50:44 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0D3601065676; Wed, 25 Nov 2009 20:50:44 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E624F8FC16; Wed, 25 Nov 2009 20:50:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAPKohrH061377; Wed, 25 Nov 2009 20:50:43 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAPKohDE061373; Wed, 25 Nov 2009 20:50:43 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200911252050.nAPKohDE061373@svn.freebsd.org> From: Andrew Thompson Date: Wed, 25 Nov 2009 20:50:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199814 - in head/sys/dev: pci usb/controller X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Nov 2009 20:50:44 -0000 Author: thompsa Date: Wed Nov 25 20:50:43 2009 New Revision: 199814 URL: http://svn.freebsd.org/changeset/base/199814 Log: Disable interrupts after doing early takeover of the usb controller in case usb isnt actually compiled in (or kldloaded) as the controller could cause spurious interrupts. Tested by: Florian Smeets Modified: head/sys/dev/pci/pci.c head/sys/dev/usb/controller/uhci_pci.c head/sys/dev/usb/controller/uhcireg.h Modified: head/sys/dev/pci/pci.c ============================================================================== --- head/sys/dev/pci/pci.c Wed Nov 25 20:23:18 2009 (r199813) +++ head/sys/dev/pci/pci.c Wed Nov 25 20:50:43 2009 (r199814) @@ -2614,6 +2614,8 @@ ohci_early_takeover(device_t self) "SMM does not respond, resetting\n"); bus_write_4(res, OHCI_CONTROL, OHCI_HCFS_RESET); } + /* Disable interrupts */ + bus_write_4(res, OHCI_INTERRUPT_DISABLE, OHCI_ALL_INTRS); } bus_release_resource(self, SYS_RES_MEMORY, rid, res); @@ -2623,6 +2625,9 @@ ohci_early_takeover(device_t self) static void uhci_early_takeover(device_t self) { + struct resource *res; + int rid; + /* * Set the PIRQD enable bit and switch off all the others. We don't * want legacy support to interfere with us XXX Does this also mean @@ -2630,6 +2635,14 @@ uhci_early_takeover(device_t self) * to the ports of the root hub? */ pci_write_config(self, PCI_LEGSUP, PCI_LEGSUP_USBPIRQDEN, 2); + + /* Disable interrupts */ + rid = PCI_UHCI_BASE_REG; + res = bus_alloc_resource_any(self, SYS_RES_IOPORT, &rid, RF_ACTIVE); + if (res != NULL) { + bus_write_2(res, UHCI_INTR, 0); + bus_release_resource(self, SYS_RES_IOPORT, rid, res); + } } /* Perform early EHCI takeover from SMM. */ @@ -2641,6 +2654,7 @@ ehci_early_takeover(device_t self) uint32_t eec; uint8_t eecp; uint8_t bios_sem; + uint8_t offs; int rid; int i; @@ -2680,6 +2694,9 @@ ehci_early_takeover(device_t self) printf("ehci early: " "SMM does not respond\n"); } + /* Disable interrupts */ + offs = bus_read_1(res, EHCI_CAPLENGTH); + bus_write_4(res, offs + EHCI_USBINTR, 0); } bus_release_resource(self, SYS_RES_MEMORY, rid, res); } Modified: head/sys/dev/usb/controller/uhci_pci.c ============================================================================== --- head/sys/dev/usb/controller/uhci_pci.c Wed Nov 25 20:23:18 2009 (r199813) +++ head/sys/dev/usb/controller/uhci_pci.c Wed Nov 25 20:50:43 2009 (r199814) @@ -88,8 +88,6 @@ __FBSDID("$FreeBSD$"); /* PIIX4E has no separate stepping */ -#define PCI_UHCI_BASE_REG 0x20 - static device_probe_t uhci_pci_probe; static device_attach_t uhci_pci_attach; static device_detach_t uhci_pci_detach; Modified: head/sys/dev/usb/controller/uhcireg.h ============================================================================== --- head/sys/dev/usb/controller/uhcireg.h Wed Nov 25 20:23:18 2009 (r199813) +++ head/sys/dev/usb/controller/uhcireg.h Wed Nov 25 20:50:43 2009 (r199814) @@ -39,6 +39,8 @@ #ifndef _UHCIREG_H_ #define _UHCIREG_H_ +#define PCI_UHCI_BASE_REG 0x20 + /* PCI config registers */ #define PCI_USBREV 0x60 /* USB protocol revision */ #define PCI_USB_REV_MASK 0xff From owner-svn-src-all@FreeBSD.ORG Thu Nov 26 00:38:14 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DC18E1065679; Thu, 26 Nov 2009 00:38:13 +0000 (UTC) (envelope-from fanf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CA7AB8FC17; Thu, 26 Nov 2009 00:38:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAQ0cD4A065982; Thu, 26 Nov 2009 00:38:13 GMT (envelope-from fanf@svn.freebsd.org) Received: (from fanf@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAQ0cDfO065980; Thu, 26 Nov 2009 00:38:13 GMT (envelope-from fanf@svn.freebsd.org) Message-Id: <200911260038.nAQ0cDfO065980@svn.freebsd.org> From: Tony Finch Date: Thu, 26 Nov 2009 00:38:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199815 - head/games/factor X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Nov 2009 00:38:14 -0000 Author: fanf Date: Thu Nov 26 00:38:13 2009 New Revision: 199815 URL: http://svn.freebsd.org/changeset/base/199815 Log: Fix a performance bug in factor(6). Check if large factor is prime before applying Pollard's algorithm; fixes "factor 2147483647111311". Increase base if p-1 algorithm reaches 1; fixes "factor 99999999999991". Testcases from David A Bagley . Fixes from Joseph Myers . Problem rediscovered by an attempt to factor my phone number. A few other incidental fixes: correct a couple of factually incorrect comments; use ident string macros; move from 4-clause to 3-clause BSD licence (University of California copyright). Obtained from: NetBSD Modified: head/games/factor/factor.c Modified: head/games/factor/factor.c ============================================================================== --- head/games/factor/factor.c Wed Nov 25 20:50:43 2009 (r199814) +++ head/games/factor/factor.c Thu Nov 26 00:38:13 2009 (r199815) @@ -13,11 +13,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. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 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. * @@ -35,18 +31,20 @@ */ #ifndef lint -static const char copyright[] = -"@(#) Copyright (c) 1989, 1993\n\ - The Regents of the University of California. All rights reserved.\n"; -#endif /* not lint */ - -#ifndef lint -#if 0 -static char sccsid[] = "@(#)factor.c 8.4 (Berkeley) 5/4/95"; -__RCSID("$NetBSD: factor.c,v 1.13 2002/06/18 23:07:36 simonb Exp $"); +#include +#ifdef __COPYRIGHT +__COPYRIGHT("@(#) Copyright (c) 1989, 1993\ + The Regents of the University of California. All rights reserved."); +#endif +#ifdef __SCCSID +__SCCSID("@(#)factor.c 8.4 (Berkeley) 5/4/95"); +#endif +#ifdef __RCSID +__RCSID("$NetBSD: factor.c,v 1.19 2009/08/12 05:54:31 dholland Exp $"); +#endif +#ifdef __FBSDID +__FBSDID("$FreeBSD$"); #endif -static const char rcsid[] = - "$FreeBSD$"; #endif /* not lint */ /* @@ -63,7 +61,7 @@ static const char rcsid[] = * * number: factor1 factor1 factor2 factor3 factor3 factor3 ... * - * where factor1 < factor2 < factor3 < ... + * where factor1 <= factor2 <= factor3 <= ... * * If no args are given, the list of numbers are read from stdin. */ @@ -214,7 +212,9 @@ pr_fact(BIGNUM *val) bnfact = BN_new(); BN_set_word(bnfact, *(fact - 1)); BN_sqr(bnfact, bnfact, ctx); - if (BN_cmp(bnfact, val) > 0) + if (BN_cmp(bnfact, val) > 0 || + BN_is_prime(val, PRIME_CHECKS, + NULL, NULL, NULL) == 1) pr_print(val); else pollard_pminus1(val); @@ -257,22 +257,28 @@ usage(void) #ifdef HAVE_OPENSSL -/* pollard rho, algorithm from Jim Gillogly, May 2000 */ +/* pollard p-1, algorithm from Jim Gillogly, May 2000 */ static void pollard_pminus1(BIGNUM *val) { - BIGNUM *base, *num, *i, *x; + BIGNUM *base, *rbase, *num, *i, *x; base = BN_new(); + rbase = BN_new(); num = BN_new(); i = BN_new(); x = BN_new(); + BN_set_word(rbase, 1); +newbase: + BN_add_word(rbase, 1); BN_set_word(i, 2); - BN_set_word(base, 2); + BN_copy(base, rbase); for (;;) { BN_mod_exp(base, base, i, val, ctx); + if (BN_is_one(base)) + goto newbase; BN_copy(x, base); BN_sub_word(x, 1); From owner-svn-src-all@FreeBSD.ORG Thu Nov 26 00:43:17 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DE046106566C; Thu, 26 Nov 2009 00:43:17 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CA1188FC08; Thu, 26 Nov 2009 00:43:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAQ0hHnN066141; Thu, 26 Nov 2009 00:43:17 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAQ0hH4s066104; Thu, 26 Nov 2009 00:43:17 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200911260043.nAQ0hH4s066104@svn.freebsd.org> From: Andrew Thompson Date: Thu, 26 Nov 2009 00:43:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199816 - in head/sys/dev/usb: . controller input net serial storage template wlan X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Nov 2009 00:43:18 -0000 Author: thompsa Date: Thu Nov 26 00:43:17 2009 New Revision: 199816 URL: http://svn.freebsd.org/changeset/base/199816 Log: Remove overuse of exclamation marks in kernel printfs, there mere fact a message has been printed is enough to get someones attention. Also remove the line number for DPRINTF/DPRINTFN, it already prints the funtion name and a unique message. Modified: head/sys/dev/usb/controller/atmegadci.c head/sys/dev/usb/controller/avr32dci.c head/sys/dev/usb/controller/musb_otg.c head/sys/dev/usb/controller/usb_controller.c head/sys/dev/usb/input/ukbd.c head/sys/dev/usb/net/if_aue.c head/sys/dev/usb/net/if_axe.c head/sys/dev/usb/net/if_cdce.c head/sys/dev/usb/net/if_cue.c head/sys/dev/usb/net/if_kue.c head/sys/dev/usb/net/if_rue.c head/sys/dev/usb/net/if_udav.c head/sys/dev/usb/serial/u3g.c head/sys/dev/usb/serial/uark.c head/sys/dev/usb/serial/ubser.c head/sys/dev/usb/serial/ucycom.c head/sys/dev/usb/serial/ufoma.c head/sys/dev/usb/serial/uftdi.c head/sys/dev/usb/serial/ugensa.c head/sys/dev/usb/serial/umct.c head/sys/dev/usb/serial/umodem.c head/sys/dev/usb/serial/uplcom.c head/sys/dev/usb/storage/umass.c head/sys/dev/usb/template/usb_template.c head/sys/dev/usb/usb_busdma.c head/sys/dev/usb/usb_debug.h head/sys/dev/usb/usb_dev.c head/sys/dev/usb/usb_device.c head/sys/dev/usb/usb_hid.c head/sys/dev/usb/usb_hub.c head/sys/dev/usb/usb_msctest.c head/sys/dev/usb/usb_process.c head/sys/dev/usb/usb_request.c head/sys/dev/usb/usb_transfer.c head/sys/dev/usb/wlan/if_upgt.c Modified: head/sys/dev/usb/controller/atmegadci.c ============================================================================== --- head/sys/dev/usb/controller/atmegadci.c Thu Nov 26 00:38:13 2009 (r199815) +++ head/sys/dev/usb/controller/atmegadci.c Thu Nov 26 00:43:17 2009 (r199816) @@ -1192,7 +1192,8 @@ atmegadci_clear_stall_sub(struct atmegad temp = ATMEGA_READ_1(sc, ATMEGA_UESTA0X); if (!(temp & ATMEGA_UESTA0X_CFGOK)) { - DPRINTFN(0, "Chip rejected configuration\n"); + device_printf(sc->sc_bus.bdev, + "Chip rejected configuration\n"); } } while (0); } @@ -1914,7 +1915,8 @@ tr_handle_clear_port_feature: /* check valid config */ temp = ATMEGA_READ_1(sc, ATMEGA_UESTA0X); if (!(temp & ATMEGA_UESTA0X_CFGOK)) { - DPRINTFN(0, "Chip rejected EP0 configuration\n"); + device_printf(sc->sc_bus.bdev, + "Chip rejected EP0 configuration\n"); } break; case UHF_C_PORT_SUSPEND: Modified: head/sys/dev/usb/controller/avr32dci.c ============================================================================== --- head/sys/dev/usb/controller/avr32dci.c Thu Nov 26 00:38:13 2009 (r199815) +++ head/sys/dev/usb/controller/avr32dci.c Thu Nov 26 00:43:17 2009 (r199816) @@ -1160,7 +1160,7 @@ avr32dci_clear_stall_sub(struct avr32dci temp = AVR32_READ_4(sc, AVR32_EPTCFG(ep_no)); if (!(temp & AVR32_EPTCFG_EPT_MAPD)) { - DPRINTFN(0, "Chip rejected configuration\n"); + device_printf(sc->sc_bus.bdev, "Chip rejected configuration\n"); } else { AVR32_WRITE_4(sc, AVR32_EPTCTLENB(ep_no), AVR32_EPTCTL_EPT_ENABL); @@ -1840,7 +1840,8 @@ tr_handle_clear_port_feature: temp = AVR32_READ_4(sc, AVR32_EPTCFG(0)); if (!(temp & AVR32_EPTCFG_EPT_MAPD)) { - DPRINTFN(0, "Chip rejected configuration\n"); + device_printf(sc->sc_bus.bdev, + "Chip rejected configuration\n"); } else { AVR32_WRITE_4(sc, AVR32_EPTCTLENB(0), AVR32_EPTCTL_EPT_ENABL); Modified: head/sys/dev/usb/controller/musb_otg.c ============================================================================== --- head/sys/dev/usb/controller/musb_otg.c Thu Nov 26 00:38:13 2009 (r199815) +++ head/sys/dev/usb/controller/musb_otg.c Thu Nov 26 00:43:17 2009 (r199816) @@ -1781,8 +1781,8 @@ musbotg_init(struct musbotg_softc *sc) dynfifo = (sc->sc_conf_data & MUSB2_MASK_CD_DYNFIFOSZ) ? 1 : 0; if (dynfifo) { - DPRINTFN(0, "Dynamic FIFO sizing detected! " - "Assuming 16Kbytes of FIFO RAM\n"); + device_printf(sc->sc_bus.bdev, "Dynamic FIFO sizing detected, " + "assuming 16Kbytes of FIFO RAM\n"); } DPRINTFN(2, "HW version: 0x%04x\n", Modified: head/sys/dev/usb/controller/usb_controller.c ============================================================================== --- head/sys/dev/usb/controller/usb_controller.c Thu Nov 26 00:38:13 2009 (r199815) +++ head/sys/dev/usb/controller/usb_controller.c Thu Nov 26 00:43:17 2009 (r199816) @@ -130,7 +130,7 @@ usb_attach(device_t dev) DPRINTF("\n"); if (bus == NULL) { - DPRINTFN(0, "USB device has no ivars\n"); + device_printf(dev, "USB device has no ivars\n"); return (ENXIO); } @@ -343,7 +343,7 @@ usb_bus_attach(struct usb_proc_msg *pm) break; default: - device_printf(bus->bdev, "Unsupported USB revision!\n"); + device_printf(bus->bdev, "Unsupported USB revision\n"); return; } @@ -530,7 +530,7 @@ usb_bus_mem_alloc_all(struct usb_bus *bu (bus->devices_max < USB_MIN_DEVICES) || (bus->devices == NULL)) { DPRINTFN(0, "Devices field has not been " - "initialised properly!\n"); + "initialised properly\n"); bus->alloc_failed = 1; /* failure */ } #if USB_HAVE_BUSDMA Modified: head/sys/dev/usb/input/ukbd.c ============================================================================== --- head/sys/dev/usb/input/ukbd.c Thu Nov 26 00:38:13 2009 (r199815) +++ head/sys/dev/usb/input/ukbd.c Thu Nov 26 00:43:17 2009 (r199816) @@ -926,7 +926,7 @@ ukbd_detach(device_t dev) DPRINTF("\n"); if (sc->sc_flags & UKBD_FLAG_POLLING) { - panic("cannot detach polled keyboard!\n"); + panic("cannot detach polled keyboard\n"); } sc->sc_flags |= UKBD_FLAG_GONE; Modified: head/sys/dev/usb/net/if_aue.c ============================================================================== --- head/sys/dev/usb/net/if_aue.c Thu Nov 26 00:38:13 2009 (r199815) +++ head/sys/dev/usb/net/if_aue.c Thu Nov 26 00:43:17 2009 (r199816) @@ -692,7 +692,7 @@ aue_attach(device_t dev) sc->sc_xfer, aue_config, AUE_N_TRANSFER, sc, &sc->sc_mtx); if (error) { - device_printf(dev, "allocating USB transfers failed!\n"); + device_printf(dev, "allocating USB transfers failed\n"); goto detach; } Modified: head/sys/dev/usb/net/if_axe.c ============================================================================== --- head/sys/dev/usb/net/if_axe.c Thu Nov 26 00:38:13 2009 (r199815) +++ head/sys/dev/usb/net/if_axe.c Thu Nov 26 00:43:17 2009 (r199816) @@ -706,7 +706,7 @@ axe_attach(device_t dev) error = usbd_transfer_setup(uaa->device, &iface_index, sc->sc_xfer, axe_config, AXE_N_TRANSFER, sc, &sc->sc_mtx); if (error) { - device_printf(dev, "allocating USB transfers failed!\n"); + device_printf(dev, "allocating USB transfers failed\n"); goto detach; } Modified: head/sys/dev/usb/net/if_cdce.c ============================================================================== --- head/sys/dev/usb/net/if_cdce.c Thu Nov 26 00:38:13 2009 (r199815) +++ head/sys/dev/usb/net/if_cdce.c Thu Nov 26 00:43:17 2009 (r199816) @@ -489,7 +489,7 @@ cdce_attach(device_t dev) break; } } else { - device_printf(dev, "no data interface found!\n"); + device_printf(dev, "no data interface found\n"); goto detach; } } @@ -541,7 +541,7 @@ alloc_transfers: if (error || (i == 32)) { device_printf(dev, "No valid alternate " - "setting found!\n"); + "setting found\n"); goto detach; } Modified: head/sys/dev/usb/net/if_cue.c ============================================================================== --- head/sys/dev/usb/net/if_cue.c Thu Nov 26 00:38:13 2009 (r199815) +++ head/sys/dev/usb/net/if_cue.c Thu Nov 26 00:43:17 2009 (r199816) @@ -404,7 +404,7 @@ cue_attach(device_t dev) error = usbd_transfer_setup(uaa->device, &iface_index, sc->sc_xfer, cue_config, CUE_N_TRANSFER, sc, &sc->sc_mtx); if (error) { - device_printf(dev, "allocating USB transfers failed!\n"); + device_printf(dev, "allocating USB transfers failed\n"); goto detach; } Modified: head/sys/dev/usb/net/if_kue.c ============================================================================== --- head/sys/dev/usb/net/if_kue.c Thu Nov 26 00:38:13 2009 (r199815) +++ head/sys/dev/usb/net/if_kue.c Thu Nov 26 00:43:17 2009 (r199816) @@ -480,14 +480,14 @@ kue_attach(device_t dev) error = usbd_transfer_setup(uaa->device, &iface_index, sc->sc_xfer, kue_config, KUE_N_TRANSFER, sc, &sc->sc_mtx); if (error) { - device_printf(dev, "allocating USB transfers failed!\n"); + device_printf(dev, "allocating USB transfers failed\n"); goto detach; } sc->sc_mcfilters = malloc(KUE_MCFILTCNT(sc) * ETHER_ADDR_LEN, M_USBDEV, M_WAITOK); if (sc->sc_mcfilters == NULL) { - device_printf(dev, "failed allocating USB memory!\n"); + device_printf(dev, "failed allocating USB memory\n"); goto detach; } Modified: head/sys/dev/usb/net/if_rue.c ============================================================================== --- head/sys/dev/usb/net/if_rue.c Thu Nov 26 00:38:13 2009 (r199815) +++ head/sys/dev/usb/net/if_rue.c Thu Nov 26 00:43:17 2009 (r199816) @@ -535,7 +535,7 @@ rue_reset(struct rue_softc *sc) break; } if (i == RUE_TIMEOUT) - device_printf(sc->sc_ue.ue_dev, "reset never completed!\n"); + device_printf(sc->sc_ue.ue_dev, "reset never completed\n"); uether_pause(&sc->sc_ue, hz / 100); } @@ -591,7 +591,7 @@ rue_attach(device_t dev) sc->sc_xfer, rue_config, RUE_N_TRANSFER, sc, &sc->sc_mtx); if (error) { - device_printf(dev, "allocating USB transfers failed!\n"); + device_printf(dev, "allocating USB transfers failed\n"); goto detach; } Modified: head/sys/dev/usb/net/if_udav.c ============================================================================== --- head/sys/dev/usb/net/if_udav.c Thu Nov 26 00:38:13 2009 (r199815) +++ head/sys/dev/usb/net/if_udav.c Thu Nov 26 00:43:17 2009 (r199816) @@ -254,7 +254,7 @@ udav_attach(device_t dev) error = usbd_transfer_setup(uaa->device, &iface_index, sc->sc_xfer, udav_config, UDAV_N_TRANSFER, sc, &sc->sc_mtx); if (error) { - device_printf(dev, "allocating USB transfers failed!\n"); + device_printf(dev, "allocating USB transfers failed\n"); goto detach; } Modified: head/sys/dev/usb/serial/u3g.c ============================================================================== --- head/sys/dev/usb/serial/u3g.c Thu Nov 26 00:38:13 2009 (r199815) +++ head/sys/dev/usb/serial/u3g.c Thu Nov 26 00:43:17 2009 (r199816) @@ -250,8 +250,6 @@ u3g_sierra_init(struct usb_device *udev) { struct usb_device_request req; - DPRINTFN(0, "\n"); - req.bmRequestType = UT_VENDOR; req.bRequest = UR_SET_INTERFACE; USETW(req.wValue, UF_DEVICE_REMOTE_WAKEUP); @@ -270,8 +268,6 @@ u3g_huawei_init(struct usb_device *udev) { struct usb_device_request req; - DPRINTFN(0, "\n"); - req.bmRequestType = UT_WRITE_DEVICE; req.bRequest = UR_SET_FEATURE; USETW(req.wValue, UF_DEVICE_REMOTE_WAKEUP); Modified: head/sys/dev/usb/serial/uark.c ============================================================================== --- head/sys/dev/usb/serial/uark.c Thu Nov 26 00:38:13 2009 (r199815) +++ head/sys/dev/usb/serial/uark.c Thu Nov 26 00:43:17 2009 (r199816) @@ -211,7 +211,7 @@ uark_attach(device_t dev) if (error) { device_printf(dev, "allocating control USB " - "transfers failed!\n"); + "transfers failed\n"); goto detach; } /* clear stall at first run */ Modified: head/sys/dev/usb/serial/ubser.c ============================================================================== --- head/sys/dev/usb/serial/ubser.c Thu Nov 26 00:38:13 2009 (r199815) +++ head/sys/dev/usb/serial/ubser.c Thu Nov 26 00:43:17 2009 (r199816) @@ -282,7 +282,7 @@ ubser_attach(device_t dev) sc->sc_tx_size = usbd_xfer_max_len(sc->sc_xfer[UBSER_BULK_DT_WR]); if (sc->sc_tx_size == 0) { - DPRINTFN(0, "invalid tx_size!\n"); + DPRINTFN(0, "invalid tx_size\n"); goto detach; } /* initialize port numbers */ Modified: head/sys/dev/usb/serial/ucycom.c ============================================================================== --- head/sys/dev/usb/serial/ucycom.c Thu Nov 26 00:38:13 2009 (r199815) +++ head/sys/dev/usb/serial/ucycom.c Thu Nov 26 00:43:17 2009 (r199816) @@ -266,7 +266,7 @@ ucycom_attach(device_t dev) sc, &sc->sc_mtx); if (error) { device_printf(dev, "allocating USB " - "transfers failed!\n"); + "transfers failed\n"); goto detach; } error = ucom_attach(&sc->sc_super_ucom, &sc->sc_ucom, 1, sc, @@ -555,7 +555,7 @@ ucycom_intr_read_callback(struct usb_xfe break; default: - DPRINTFN(0, "unsupported model number!\n"); + DPRINTFN(0, "unsupported model number\n"); goto tr_setup; } Modified: head/sys/dev/usb/serial/ufoma.c ============================================================================== --- head/sys/dev/usb/serial/ufoma.c Thu Nov 26 00:38:13 2009 (r199815) +++ head/sys/dev/usb/serial/ufoma.c Thu Nov 26 00:43:17 2009 (r199816) @@ -401,7 +401,7 @@ ufoma_attach(device_t dev) if (error) { device_printf(dev, "allocating control USB " - "transfers failed!\n"); + "transfers failed\n"); goto detach; } mad = ufoma_get_intconf(cd, id, UDESC_VS_INTERFACE, UDESCSUB_MCPC_ACM); @@ -1060,7 +1060,7 @@ ufoma_modem_setup(device_t dev, struct u break; } } else { - device_printf(dev, "no data interface!\n"); + device_printf(dev, "no data interface\n"); return (EINVAL); } } @@ -1071,7 +1071,7 @@ ufoma_modem_setup(device_t dev, struct u if (error) { device_printf(dev, "allocating BULK USB " - "transfers failed!\n"); + "transfers failed\n"); return (EINVAL); } return (0); Modified: head/sys/dev/usb/serial/uftdi.c ============================================================================== --- head/sys/dev/usb/serial/uftdi.c Thu Nov 26 00:38:13 2009 (r199815) +++ head/sys/dev/usb/serial/uftdi.c Thu Nov 26 00:43:17 2009 (r199816) @@ -307,7 +307,7 @@ uftdi_attach(device_t dev) if (error) { device_printf(dev, "allocating USB " - "transfers failed!\n"); + "transfers failed\n"); goto detach; } sc->sc_ucom.sc_portno = FTDI_PIT_SIOA + uaa->info.bIfaceNum; Modified: head/sys/dev/usb/serial/ugensa.c ============================================================================== --- head/sys/dev/usb/serial/ugensa.c Thu Nov 26 00:38:13 2009 (r199815) +++ head/sys/dev/usb/serial/ugensa.c Thu Nov 26 00:43:17 2009 (r199816) @@ -210,7 +210,7 @@ ugensa_attach(device_t dev) } if (cnt == 0) { - device_printf(dev, "No interfaces!\n"); + device_printf(dev, "No interfaces\n"); goto detach; } for (x = 0; x < cnt; x++) { @@ -229,7 +229,7 @@ ugensa_attach(device_t dev) if (error) { device_printf(dev, "allocating USB " - "transfers failed!\n"); + "transfers failed\n"); goto detach; } /* clear stall at first run */ Modified: head/sys/dev/usb/serial/umct.c ============================================================================== --- head/sys/dev/usb/serial/umct.c Thu Nov 26 00:38:13 2009 (r199815) +++ head/sys/dev/usb/serial/umct.c Thu Nov 26 00:43:17 2009 (r199816) @@ -263,7 +263,7 @@ umct_attach(device_t dev) if (error) { device_printf(dev, "allocating USB " - "transfers failed!\n"); + "transfers failed\n"); goto detach; } Modified: head/sys/dev/usb/serial/umodem.c ============================================================================== --- head/sys/dev/usb/serial/umodem.c Thu Nov 26 00:38:13 2009 (r199815) +++ head/sys/dev/usb/serial/umodem.c Thu Nov 26 00:43:17 2009 (r199816) @@ -311,7 +311,7 @@ umodem_attach(device_t dev) 0 - 1, UDESCSUB_CDC_UNION, 0 - 1); if ((cud == NULL) || (cud->bLength < sizeof(*cud))) { - device_printf(dev, "no CM or union descriptor!\n"); + device_printf(dev, "no CM or union descriptor\n"); goto detach; } @@ -344,7 +344,7 @@ umodem_attach(device_t dev) break; } } else { - device_printf(dev, "no data interface!\n"); + device_printf(dev, "no data interface\n"); goto detach; } } Modified: head/sys/dev/usb/serial/uplcom.c ============================================================================== --- head/sys/dev/usb/serial/uplcom.c Thu Nov 26 00:38:13 2009 (r199815) +++ head/sys/dev/usb/serial/uplcom.c Thu Nov 26 00:43:17 2009 (r199816) @@ -377,7 +377,7 @@ uplcom_attach(device_t dev) if (iface) { id = usbd_get_interface_descriptor(iface); if (id == NULL) { - device_printf(dev, "no interface descriptor (2)!\n"); + device_printf(dev, "no interface descriptor (2)\n"); goto detach; } sc->sc_data_iface_no = id->bInterfaceNumber; @@ -420,7 +420,7 @@ uplcom_attach(device_t dev) */ if (sc->sc_chiptype == TYPE_PL2303X) { if (uplcom_pl2303x_init(uaa->device)) { - device_printf(dev, "init failed!\n"); + device_printf(dev, "init failed\n"); goto detach; } } Modified: head/sys/dev/usb/storage/umass.c ============================================================================== --- head/sys/dev/usb/storage/umass.c Thu Nov 26 00:38:13 2009 (r199815) +++ head/sys/dev/usb/storage/umass.c Thu Nov 26 00:43:17 2009 (r199816) @@ -2847,7 +2847,7 @@ umass_cam_detach_sim(struct umass_softc sc->sc_sim->softc = UMASS_GONE; cam_sim_free(sc->sc_sim, /* free_devq */ TRUE); } else { - panic("%s: CAM layer is busy!\n", + panic("%s: CAM layer is busy\n", sc->sc_name); } sc->sc_sim = NULL; Modified: head/sys/dev/usb/template/usb_template.c ============================================================================== --- head/sys/dev/usb/template/usb_template.c Thu Nov 26 00:38:13 2009 (r199815) +++ head/sys/dev/usb/template/usb_template.c Thu Nov 26 00:43:17 2009 (r199816) @@ -727,7 +727,7 @@ handle_endpoint_desc: if ((pf->max_in_frame_size < wMaxPacketSize) || (pf->max_out_frame_size < wMaxPacketSize)) { DPRINTFN(0, "Endpoint profile %u " - "has too small buffer!\n", ep_no); + "has too small buffer\n", ep_no); return (1); } } else if (ed->bEndpointAddress & UE_DIR_IN) { @@ -735,7 +735,7 @@ handle_endpoint_desc: (1 << (ep_no % 8)); if (pf->max_in_frame_size < wMaxPacketSize) { DPRINTFN(0, "Endpoint profile %u " - "has too small buffer!\n", ep_no); + "has too small buffer\n", ep_no); return (1); } } else { @@ -743,7 +743,7 @@ handle_endpoint_desc: (1 << (ep_no % 8)); if (pf->max_out_frame_size < wMaxPacketSize) { DPRINTFN(0, "Endpoint profile %u " - "has too small buffer!\n", ep_no); + "has too small buffer\n", ep_no); return (1); } } Modified: head/sys/dev/usb/usb_busdma.c ============================================================================== --- head/sys/dev/usb/usb_busdma.c Thu Nov 26 00:38:13 2009 (r199815) +++ head/sys/dev/usb/usb_busdma.c Thu Nov 26 00:43:17 2009 (r199816) @@ -445,7 +445,7 @@ usb_pc_common_mem_cb(void *arg, bus_dma_ /* * This check verifies that the physical address is correct: */ - DPRINTFN(0, "Page offset was not preserved!\n"); + DPRINTFN(0, "Page offset was not preserved\n"); error = 1; goto done; } @@ -764,8 +764,8 @@ usb_dma_tag_find(struct usb_dma_parent_t struct usb_dma_tag *udt; uint8_t nudt; - USB_ASSERT(align > 0, ("Invalid parameter align = 0!\n")); - USB_ASSERT(size > 0, ("Invalid parameter size = 0!\n")); + USB_ASSERT(align > 0, ("Invalid parameter align = 0\n")); + USB_ASSERT(size > 0, ("Invalid parameter size = 0\n")); udt = udpt->utag_first; nudt = udpt->utag_max; Modified: head/sys/dev/usb/usb_debug.h ============================================================================== --- head/sys/dev/usb/usb_debug.h Thu Nov 26 00:38:13 2009 (r199815) +++ head/sys/dev/usb/usb_debug.h Thu Nov 26 00:43:17 2009 (r199816) @@ -35,11 +35,11 @@ extern int usb_debug; /* Check if USB debugging is enabled. */ #ifdef USB_DEBUG_VAR #if (USB_DEBUG != 0) -#define DPRINTFN(n,fmt,...) do { \ - if ((USB_DEBUG_VAR) >= (n)) { \ - printf("%s:%u: " fmt, \ - __FUNCTION__, __LINE__,## __VA_ARGS__); \ - } \ +#define DPRINTFN(n,fmt,...) do { \ + if ((USB_DEBUG_VAR) >= (n)) { \ + printf("%s: " fmt, \ + __FUNCTION__,## __VA_ARGS__); \ + } \ } while (0) #define DPRINTF(...) DPRINTFN(1, __VA_ARGS__) #else Modified: head/sys/dev/usb/usb_dev.c ============================================================================== --- head/sys/dev/usb/usb_dev.c Thu Nov 26 00:38:13 2009 (r199815) +++ head/sys/dev/usb/usb_dev.c Thu Nov 26 00:43:17 2009 (r199816) @@ -575,7 +575,7 @@ usb_fifo_free(struct usb_fifo *f) (f->udev->fifo[f->fifo_index] == f)) { f->udev->fifo[f->fifo_index] = NULL; } else { - DPRINTFN(0, "USB FIFO %p has not been linked!\n", f); + DPRINTFN(0, "USB FIFO %p has not been linked\n", f); } /* decrease refcount */ @@ -952,7 +952,7 @@ usb_dev_init_post(void *arg) usb_dev = make_dev(&usb_static_devsw, 0, UID_ROOT, GID_OPERATOR, 0644, USB_DEVICE_NAME); if (usb_dev == NULL) { - DPRINTFN(0, "Could not create usb bus device!\n"); + DPRINTFN(0, "Could not create usb bus device\n"); } } Modified: head/sys/dev/usb/usb_device.c ============================================================================== --- head/sys/dev/usb/usb_device.c Thu Nov 26 00:38:13 2009 (r199815) +++ head/sys/dev/usb/usb_device.c Thu Nov 26 00:43:17 2009 (r199816) @@ -1023,7 +1023,7 @@ usb_detach_device_sub(struct usb_device if (udev->flags.peer_suspended) { err = DEVICE_RESUME(dev); if (err) { - device_printf(dev, "Resume failed!\n"); + device_printf(dev, "Resume failed\n"); } } if (device_detach(dev)) { @@ -1038,7 +1038,7 @@ usb_detach_device_sub(struct usb_device error: /* Detach is not allowed to fail in the USB world */ - panic("An USB driver would not detach!\n"); + panic("A USB driver would not detach\n"); } /*------------------------------------------------------------------------* @@ -1131,7 +1131,7 @@ usb_probe_and_attach_sub(struct usb_devi * to device_detach(). USB devices should * never fail on detach! */ - panic("device_delete_child() failed!\n"); + panic("device_delete_child() failed\n"); } } if (uaa->temp_dev == NULL) { @@ -1140,7 +1140,7 @@ usb_probe_and_attach_sub(struct usb_devi uaa->temp_dev = device_add_child(udev->parent_dev, NULL, -1); if (uaa->temp_dev == NULL) { device_printf(udev->parent_dev, - "Device creation failed!\n"); + "Device creation failed\n"); return (1); /* failure */ } device_set_ivars(uaa->temp_dev, uaa); @@ -1320,7 +1320,7 @@ usb_probe_and_attach(struct usb_device * /* remove the last created child; it is unused */ if (device_delete_child(udev->parent_dev, uaa.temp_dev)) { - DPRINTFN(0, "device delete child failed!\n"); + DPRINTFN(0, "device delete child failed\n"); } } done: @@ -1353,7 +1353,7 @@ usb_suspend_resume_sub(struct usb_device err = DEVICE_RESUME(dev); } if (err) { - device_printf(dev, "%s failed!\n", + device_printf(dev, "%s failed\n", do_suspend ? "Suspend" : "Resume"); } } @@ -1473,13 +1473,13 @@ usb_alloc_device(device_t parent_dev, st if (device_index == bus->devices_max) { device_printf(bus->bdev, - "No free USB device index for new device!\n"); + "No free USB device index for new device\n"); return (NULL); } if (depth > 0x10) { device_printf(bus->bdev, - "Invalid device depth!\n"); + "Invalid device depth\n"); return (NULL); } udev = malloc(sizeof(*udev), M_USB, M_WAITOK | M_ZERO); @@ -1631,7 +1631,7 @@ usb_alloc_device(device_t parent_dev, st USB_MAX_IPACKET, USB_MAX_IPACKET, 0, UDESC_DEVICE, 0, 0); if (err) { DPRINTFN(0, "getting device descriptor " - "at addr %d failed, %s!\n", udev->address, + "at addr %d failed, %s\n", udev->address, usbd_errstr(err)); /* XXX try to re-enumerate the device */ err = usbd_req_re_enumerate(udev, NULL); @@ -1797,7 +1797,7 @@ repeat_set_config: (usbd_get_no_descriptors(udev->cdesc, UDESC_ENDPOINT) == 0)) { DPRINTFN(0, "Found no endpoints " - "(trying next config)!\n"); + "(trying next config)\n"); config_index++; goto repeat_set_config; } @@ -1814,7 +1814,7 @@ repeat_set_config: } } } else if (usb_test_huawei_autoinst_p(udev, &uaa) == 0) { - DPRINTFN(0, "Found Huawei auto-install disk!\n"); + DPRINTFN(0, "Found Huawei auto-install disk\n"); /* leave device unconfigured */ usb_unconfigure(udev, 0); } Modified: head/sys/dev/usb/usb_hid.c ============================================================================== --- head/sys/dev/usb/usb_hid.c Thu Nov 26 00:38:13 2009 (r199815) +++ head/sys/dev/usb/usb_hid.c Thu Nov 26 00:43:17 2009 (r199816) @@ -450,7 +450,7 @@ hid_get_item(struct hid_data *s, struct c = &s->cur[s->pushlevel]; } else { DPRINTFN(0, "Cannot push " - "item @ %d!\n", s->pushlevel); + "item @ %d\n", s->pushlevel); } break; case 11: /* Pop */ @@ -468,7 +468,7 @@ hid_get_item(struct hid_data *s, struct c->loc.count = 0; } else { DPRINTFN(0, "Cannot pop " - "item @ %d!\n", s->pushlevel); + "item @ %d\n", s->pushlevel); } break; default: @@ -490,7 +490,7 @@ hid_get_item(struct hid_data *s, struct s->usages_max[s->nusage] = dval; s->nusage ++; } else { - DPRINTFN(0, "max usage reached!\n"); + DPRINTFN(0, "max usage reached\n"); } /* clear any pending usage sets */ @@ -525,7 +525,7 @@ hid_get_item(struct hid_data *s, struct c->usage_maximum; s->nusage ++; } else { - DPRINTFN(0, "Usage set dropped!\n"); + DPRINTFN(0, "Usage set dropped\n"); } s->susage = 0; break; Modified: head/sys/dev/usb/usb_hub.c ============================================================================== --- head/sys/dev/usb/usb_hub.c Thu Nov 26 00:38:13 2009 (r199815) +++ head/sys/dev/usb/usb_hub.c Thu Nov 26 00:43:17 2009 (r199816) @@ -385,7 +385,7 @@ repeat: (!(sc->sc_st.port_status & UPS_CURRENT_CONNECT_STATUS))) { if (timeout) { DPRINTFN(0, "giving up port reset " - "- device vanished!\n"); + "- device vanished\n"); goto error; } timeout = 1; @@ -435,7 +435,7 @@ repeat: child = usb_alloc_device(sc->sc_dev, udev->bus, udev, udev->depth + 1, portno - 1, portno, speed, mode); if (child == NULL) { - DPRINTFN(0, "could not allocate new device!\n"); + DPRINTFN(0, "could not allocate new device\n"); goto error; } return (0); /* success */ @@ -711,14 +711,14 @@ uhub_attach(device_t dev) parent_hub->flags.self_powered : 0); if (udev->depth > USB_HUB_MAX_DEPTH) { - DPRINTFN(0, "hub depth, %d, exceeded. HUB ignored!\n", + DPRINTFN(0, "hub depth, %d, exceeded. HUB ignored\n", USB_HUB_MAX_DEPTH); goto error; } if (!udev->flags.self_powered && parent_hub && (!parent_hub->flags.self_powered)) { DPRINTFN(0, "bus powered HUB connected to " - "bus powered HUB. HUB ignored!\n"); + "bus powered HUB. HUB ignored\n"); goto error; } /* get HUB descriptor */ @@ -740,11 +740,11 @@ uhub_attach(device_t dev) goto error; } if (hubdesc.bNbrPorts != nports) { - DPRINTFN(0, "number of ports changed!\n"); + DPRINTFN(0, "number of ports changed\n"); goto error; } if (nports == 0) { - DPRINTFN(0, "portless HUB!\n"); + DPRINTFN(0, "portless HUB\n"); goto error; } hub = malloc(sizeof(hub[0]) + (sizeof(hub->ports[0]) * nports), @@ -784,7 +784,7 @@ uhub_attach(device_t dev) } if (err) { DPRINTFN(0, "cannot setup interrupt transfer, " - "errstr=%s!\n", usbd_errstr(err)); + "errstr=%s\n", usbd_errstr(err)); goto error; } /* wait with power off for a while */ @@ -1924,7 +1924,7 @@ usb_dev_resume_peer(struct usb_device *u err = usbd_req_clear_port_feature(udev->parent_hub, NULL, udev->port_no, UHF_PORT_SUSPEND); if (err) { - DPRINTFN(0, "Resuming port failed!\n"); + DPRINTFN(0, "Resuming port failed\n"); return; } /* resume settle time */ @@ -1972,7 +1972,7 @@ usb_dev_resume_peer(struct usb_device *u NULL, UF_DEVICE_REMOTE_WAKEUP); if (err) { DPRINTFN(0, "Clearing device " - "remote wakeup failed: %s!\n", + "remote wakeup failed: %s\n", usbd_errstr(err)); } } @@ -2042,7 +2042,7 @@ repeat: NULL, UF_DEVICE_REMOTE_WAKEUP); if (err) { DPRINTFN(0, "Setting device " - "remote wakeup failed!\n"); + "remote wakeup failed\n"); } } USB_BUS_LOCK(udev->bus); Modified: head/sys/dev/usb/usb_msctest.c ============================================================================== --- head/sys/dev/usb/usb_msctest.c Thu Nov 26 00:38:13 2009 (r199815) +++ head/sys/dev/usb/usb_msctest.c Thu Nov 26 00:43:17 2009 (r199816) @@ -284,7 +284,7 @@ bbb_command_callback(struct usb_xfer *xf sc->cbw.bCDBLength = sc->cmd_len; if (sc->cbw.bCDBLength > sizeof(sc->cbw.CBWCDB)) { sc->cbw.bCDBLength = sizeof(sc->cbw.CBWCDB); - DPRINTFN(0, "Truncating long command!\n"); + DPRINTFN(0, "Truncating long command\n"); } usbd_xfer_set_frame_data(xfer, 0, &sc->cbw, sizeof(sc->cbw)); usbd_transfer_submit(xfer); Modified: head/sys/dev/usb/usb_process.c ============================================================================== --- head/sys/dev/usb/usb_process.c Thu Nov 26 00:38:13 2009 (r199815) +++ head/sys/dev/usb/usb_process.c Thu Nov 26 00:43:17 2009 (r199816) @@ -444,7 +444,7 @@ usb_proc_drain(struct usb_process *up) if (cold) { USB_THREAD_SUSPEND(up->up_ptr); printf("WARNING: A USB process has " - "been left suspended!\n"); + "been left suspended\n"); break; } cv_wait(&up->up_cv, up->up_mtx); Modified: head/sys/dev/usb/usb_request.c ============================================================================== --- head/sys/dev/usb/usb_request.c Thu Nov 26 00:38:13 2009 (r199815) +++ head/sys/dev/usb/usb_request.c Thu Nov 26 00:43:17 2009 (r199816) @@ -1549,7 +1549,7 @@ retry: USB_MAX_IPACKET, USB_MAX_IPACKET, 0, UDESC_DEVICE, 0, 0); if (err) { DPRINTFN(0, "getting device descriptor " - "at addr %d failed, %s!\n", udev->address, + "at addr %d failed, %s\n", udev->address, usbd_errstr(err)); goto done; } @@ -1557,7 +1557,7 @@ retry: err = usbd_req_get_device_desc(udev, mtx, &udev->ddesc); if (err) { DPRINTFN(0, "addr=%d, getting device " - "descriptor failed, %s!\n", old_addr, + "descriptor failed, %s\n", old_addr, usbd_errstr(err)); goto done; } Modified: head/sys/dev/usb/usb_transfer.c ============================================================================== --- head/sys/dev/usb/usb_transfer.c Thu Nov 26 00:38:13 2009 (r199815) +++ head/sys/dev/usb/usb_transfer.c Thu Nov 26 00:43:17 2009 (r199816) @@ -201,9 +201,9 @@ usbd_transfer_setup_sub_malloc(struct us usb_size_t r; usb_size_t z; - USB_ASSERT(align > 1, ("Invalid alignment, 0x%08x!\n", + USB_ASSERT(align > 1, ("Invalid alignment, 0x%08x\n", align)); - USB_ASSERT(size > 0, ("Invalid size = 0!\n")); + USB_ASSERT(size > 0, ("Invalid size = 0\n")); if (count == 0) { return (0); /* nothing to allocate */ @@ -1200,7 +1200,7 @@ usbd_transfer_unsetup(struct usb_xfer ** USB_BUS_LOCK(info->bus); USB_ASSERT(info->setup_refcount != 0, ("Invalid setup " - "reference count!\n")); + "reference count\n")); info->setup_refcount--; @@ -1353,7 +1353,7 @@ usbd_setup_ctrl_transfer(struct usb_xfer if (len > xfer->flags_int.control_rem) { DPRINTFN(0, "Length (%d) greater than " - "remaining length (%d)!\n", len, + "remaining length (%d)\n", len, xfer->flags_int.control_rem); goto error; } @@ -1366,7 +1366,7 @@ usbd_setup_ctrl_transfer(struct usb_xfer (len != xfer->flags_int.control_rem) && (xfer->nframes != 1)) { DPRINTFN(0, "Short control transfer without " - "force_short_xfer set!\n"); + "force_short_xfer set\n"); goto error; } xfer->flags_int.control_rem -= len; @@ -1927,7 +1927,7 @@ usbd_xfer_set_frame_offset(struct usb_xf usb_frcount_t frindex) { KASSERT(!xfer->flags.ext_buffer, ("Cannot offset data frame " - "when the USB buffer is external!\n")); + "when the USB buffer is external\n")); KASSERT(frindex < xfer->max_frame_count, ("frame index overflow")); /* set virtual address to load */ @@ -2437,7 +2437,7 @@ usbd_pipe_start(struct usb_xfer_queue *p &udev->cs_msg[0], &udev->cs_msg[1]); } else { /* should not happen */ - DPRINTFN(0, "No stall handler!\n"); + DPRINTFN(0, "No stall handler\n"); } /* * Check if we should stall. Some USB hardware @@ -2580,7 +2580,7 @@ usbd_callback_wrapper_sub(struct usb_xfe if (xfer->aframes > xfer->nframes) { if (xfer->error == 0) { panic("%s: actual number of frames, %d, is " - "greater than initial number of frames, %d!\n", + "greater than initial number of frames, %d\n", __FUNCTION__, xfer->aframes, xfer->nframes); } else { /* just set some valid value */ @@ -2607,7 +2607,7 @@ usbd_callback_wrapper_sub(struct usb_xfe if (xfer->actlen > xfer->sumlen) { if (xfer->error == 0) { panic("%s: actual length, %d, is greater than " - "initial length, %d!\n", + "initial length, %d\n", __FUNCTION__, xfer->actlen, xfer->sumlen); } else { /* just set some valid value */ @@ -2809,7 +2809,7 @@ repeat: udev->default_xfer, usb_control_ep_cfg, USB_DEFAULT_XFER_MAX, NULL, udev->default_mtx)) { DPRINTFN(0, "could not setup default " - "USB transfer!\n"); + "USB transfer\n"); } else { goto repeat; } Modified: head/sys/dev/usb/wlan/if_upgt.c ============================================================================== --- head/sys/dev/usb/wlan/if_upgt.c Thu Nov 26 00:38:13 2009 (r199815) +++ head/sys/dev/usb/wlan/if_upgt.c Thu Nov 26 00:43:17 2009 (r199816) @@ -292,7 +292,7 @@ upgt_attach(device_t dev) /* Calculate device memory space. */ if (sc->sc_memaddr_frame_start == 0 || sc->sc_memaddr_frame_end == 0) { device_printf(dev, - "could not find memory space addresses on FW!\n"); + "could not find memory space addresses on FW\n"); error = EIO; goto fail5; } @@ -732,7 +732,7 @@ upgt_set_macfilter(struct upgt_softc *sc break; default: device_printf(sc->sc_dev, - "MAC filter does not know that state!\n"); + "MAC filter does not know that state\n"); break; } @@ -1181,7 +1181,7 @@ upgt_eeprom_parse(struct upgt_softc *sc) break; case UPGT_EEPROM_TYPE_OFF: DPRINTF(sc, UPGT_DEBUG_FW, - "%s: EEPROM off without end option!\n", __func__); + "%s: EEPROM off without end option\n", __func__); return (EIO); default: DPRINTF(sc, UPGT_DEBUG_FW, @@ -1356,7 +1356,7 @@ upgt_eeprom_read(struct upgt_softc *sc) error = mtx_sleep(sc, &sc->sc_mtx, 0, "eeprom_request", hz); if (error != 0) { device_printf(sc->sc_dev, - "timeout while waiting for EEPROM data!\n"); + "timeout while waiting for EEPROM data\n"); UPGT_UNLOCK(sc); return (EIO); } @@ -1490,7 +1490,7 @@ upgt_rx(struct upgt_softc *sc, uint8_t * ("A current mbuf storage is small (%d)", pkglen + ETHER_ALIGN)); m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); if (m == NULL) { - device_printf(sc->sc_dev, "could not create RX mbuf!\n"); + device_printf(sc->sc_dev, "could not create RX mbuf\n"); return (NULL); } m_adj(m, ETHER_ALIGN); @@ -1587,7 +1587,7 @@ upgt_mem_free(struct upgt_softc *sc, uin } device_printf(sc->sc_dev, - "could not free memory address 0x%08x!\n", addr); + "could not free memory address 0x%08x\n", addr); } static int @@ -1602,7 +1602,7 @@ upgt_fw_load(struct upgt_softc *sc) fw = firmware_get(upgt_fwname); if (fw == NULL) { - device_printf(sc->sc_dev, "could not read microcode %s!\n", + device_printf(sc->sc_dev, "could not read microcode %s\n", upgt_fwname); return (EIO); } @@ -1676,7 +1676,7 @@ upgt_fw_load(struct upgt_softc *sc) usbd_transfer_start(sc->sc_xfer[UPGT_BULK_RX]); error = mtx_sleep(sc, &sc->sc_mtx, 0, "upgtfw", 2 * hz); if (error != 0) { - device_printf(sc->sc_dev, "firmware load failed!\n"); + device_printf(sc->sc_dev, "firmware load failed\n"); error = EIO; } @@ -1782,7 +1782,7 @@ upgt_fw_verify(struct upgt_softc *sc) fw = firmware_get(upgt_fwname); if (fw == NULL) { - device_printf(sc->sc_dev, "could not read microcode %s!\n", + device_printf(sc->sc_dev, "could not read microcode %s\n", upgt_fwname); return EIO; } @@ -1802,7 +1802,7 @@ upgt_fw_verify(struct upgt_softc *sc) } if (offset == fw->datasize) { device_printf(sc->sc_dev, - "firmware Boot Record Area not found!\n"); + "firmware Boot Record Area not found\n"); error = EIO; goto fail; } @@ -1827,7 +1827,7 @@ upgt_fw_verify(struct upgt_softc *sc) if (bra_option_len != UPGT_BRA_FWTYPE_SIZE) { device_printf(sc->sc_dev, - "wrong UPGT_BRA_TYPE_FW len!\n"); + "wrong UPGT_BRA_TYPE_FW len\n"); error = EIO; goto fail; } @@ -1842,7 +1842,7 @@ upgt_fw_verify(struct upgt_softc *sc) break; } device_printf(sc->sc_dev, - "unsupported firmware type!\n"); + "unsupported firmware type\n"); error = EIO; goto fail; case UPGT_BRA_TYPE_VERSION: @@ -1946,7 +1946,7 @@ upgt_alloc_tx(struct upgt_softc *sc) data->buf = malloc(MCLBYTES, M_USBDEV, M_NOWAIT | M_ZERO); if (data->buf == NULL) { device_printf(sc->sc_dev, - "could not allocate TX buffer!\n"); + "could not allocate TX buffer\n"); return (ENOMEM); } STAILQ_INSERT_TAIL(&sc->sc_tx_inactive, data, next); @@ -1970,7 +1970,7 @@ upgt_alloc_rx(struct upgt_softc *sc) data->buf = malloc(MCLBYTES, M_USBDEV, M_NOWAIT | M_ZERO); if (data->buf == NULL) { device_printf(sc->sc_dev, - "could not allocate RX buffer!\n"); + "could not allocate RX buffer\n"); return (ENOMEM); } STAILQ_INSERT_TAIL(&sc->sc_rx_inactive, data, next); From owner-svn-src-all@FreeBSD.ORG Thu Nov 26 02:14:08 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B35A3106566C; Thu, 26 Nov 2009 02:14:08 +0000 (UTC) (envelope-from fanf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A29718FC14; Thu, 26 Nov 2009 02:14:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAQ2E8kA067844; Thu, 26 Nov 2009 02:14:08 GMT (envelope-from fanf@svn.freebsd.org) Received: (from fanf@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAQ2E8Zw067843; Thu, 26 Nov 2009 02:14:08 GMT (envelope-from fanf@svn.freebsd.org) Message-Id: <200911260214.nAQ2E8Zw067843@svn.freebsd.org> From: Tony Finch Date: Thu, 26 Nov 2009 02:14:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199817 - head/usr.bin/unifdef X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Nov 2009 02:14:08 -0000 Author: fanf Date: Thu Nov 26 02:14:08 2009 New Revision: 199817 URL: http://svn.freebsd.org/changeset/base/199817 Log: Remove debugging remnants from unifdefall. Submitted by: Jonathan Nieder Modified: head/usr.bin/unifdef/unifdefall.sh Modified: head/usr.bin/unifdef/unifdefall.sh ============================================================================== --- head/usr.bin/unifdef/unifdefall.sh Thu Nov 26 00:43:17 2009 (r199816) +++ head/usr.bin/unifdef/unifdefall.sh Thu Nov 26 02:14:08 2009 (r199817) @@ -36,13 +36,13 @@ trap 'rm -r "$tmp" || exit 1' EXIT export LC_ALL=C -./unifdef -s "$@" | sort | uniq >"$tmp/ctrl" +unifdef -s "$@" | sort | uniq >"$tmp/ctrl" cpp -dM "$@" | sort | sed 's/^#define //' >"$tmp/hashdefs" sed 's/[^A-Za-z0-9_].*$//' "$tmp/hashdefs" >"$tmp/alldef" comm -23 "$tmp/ctrl" "$tmp/alldef" >"$tmp/undef" comm -12 "$tmp/ctrl" "$tmp/alldef" >"$tmp/def" ( - echo ./unifdef -k \\ + echo unifdef -k \\ sed 's/.*/-U& \\/' "$tmp/undef" while read sym do sed -n 's/^'$sym'\(([^)]*)\)\{0,1\} /-D'$sym'=/p' "$tmp/hashdefs" From owner-svn-src-all@FreeBSD.ORG Thu Nov 26 03:27:00 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 194B51065670; Thu, 26 Nov 2009 03:27:00 +0000 (UTC) (envelope-from kuriyama@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 06EE58FC16; Thu, 26 Nov 2009 03:27:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAQ3QxDj069450; Thu, 26 Nov 2009 03:26:59 GMT (envelope-from kuriyama@svn.freebsd.org) Received: (from kuriyama@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAQ3Qxtu069448; Thu, 26 Nov 2009 03:26:59 GMT (envelope-from kuriyama@svn.freebsd.org) Message-Id: <200911260326.nAQ3Qxtu069448@svn.freebsd.org> From: Jun Kuriyama Date: Thu, 26 Nov 2009 03:26:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199818 - head/usr.sbin/jail X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Nov 2009 03:27:00 -0000 Author: kuriyama Date: Thu Nov 26 03:26:59 2009 New Revision: 199818 URL: http://svn.freebsd.org/changeset/base/199818 Log: - New style of jail(8) usage requires "-c" argument to create a jail. Reviewed by: jamie Modified: head/usr.sbin/jail/jail.8 Modified: head/usr.sbin/jail/jail.8 ============================================================================== --- head/usr.sbin/jail/jail.8 Thu Nov 26 02:14:08 2009 (r199817) +++ head/usr.sbin/jail/jail.8 Thu Nov 26 03:26:59 2009 (r199818) @@ -561,7 +561,7 @@ or for running a virtual server. Start a shell in the jail: .Pp .Bd -literal -offset indent -jail path=/data/jail/192.0.2.100 host.hostname=testhostname \\ +jail -c path=/data/jail/192.0.2.100 host.hostname=testhostname \\ ip4.addr=192.0.2.100 command=/bin/sh .Ed .Pp @@ -636,7 +636,7 @@ script from within the jail. .Bd -literal -offset indent ifconfig ed0 inet alias 192.0.2.100/32 mount -t procfs proc /data/jail/192.0.2.100/proc -jail path=/data/jail/192.0.2.100 host.hostname=testhostname \\ +jail -c path=/data/jail/192.0.2.100 host.hostname=testhostname \\ ip4.addr=192.0.2.100 command=/bin/sh /etc/rc .Ed .Pp From owner-svn-src-all@FreeBSD.ORG Thu Nov 26 05:16:08 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6C42A10656A3; Thu, 26 Nov 2009 05:16:08 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5BB1C8FC27; Thu, 26 Nov 2009 05:16:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAQ5G8WU071425; Thu, 26 Nov 2009 05:16:08 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAQ5G7L8071420; Thu, 26 Nov 2009 05:16:07 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <200911260516.nAQ5G7L8071420@svn.freebsd.org> From: Alan Cox Date: Thu, 26 Nov 2009 05:16:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199819 - in head/sys: kern vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Nov 2009 05:16:08 -0000 Author: alc Date: Thu Nov 26 05:16:07 2009 New Revision: 199819 URL: http://svn.freebsd.org/changeset/base/199819 Log: Replace VM_PROT_OVERRIDE_WRITE by VM_PROT_COPY. VM_PROT_OVERRIDE_WRITE has represented a write access that is allowed to override write protection. Until now, VM_PROT_OVERRIDE_WRITE has been used to write breakpoints into text pages. Text pages are not just write protected but they are also copy-on-write. VM_PROT_OVERRIDE_WRITE overrides the write protection on the text page and triggers the replication of the page so that the breakpoint will be written to a private copy. However, here is where things become confused. It is the debugger, not the process being debugged that requires write access to the copied page. Nonetheless, the copied page is being mapped into the process with write access enabled. In other words, once the debugger sets a breakpoint within a text page, the program can write to its private copy of that text page. Whereas prior to setting the breakpoint, a SIGSEGV would have occurred upon a write access. VM_PROT_COPY addresses this problem. The combination of VM_PROT_READ and VM_PROT_COPY forces the replication of a copy-on-write page even though the access is only for read. Moreover, the replicated page is only mapped into the process with read access, and not write access. Reviewed by: kib MFC after: 4 weeks Modified: head/sys/kern/sys_process.c head/sys/vm/vm.h head/sys/vm/vm_fault.c head/sys/vm/vm_map.c Modified: head/sys/kern/sys_process.c ============================================================================== --- head/sys/kern/sys_process.c Thu Nov 26 03:26:59 2009 (r199818) +++ head/sys/kern/sys_process.c Thu Nov 26 05:16:07 2009 (r199819) @@ -59,6 +59,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #ifdef COMPAT_IA32 @@ -213,10 +214,10 @@ int proc_rwmem(struct proc *p, struct uio *uio) { vm_map_t map; - vm_object_t backing_object, object = NULL; - vm_offset_t pageno = 0; /* page number */ + vm_object_t backing_object, object; + vm_offset_t pageno; /* page number */ vm_prot_t reqprot; - int error, fault_flags, writing; + int error, writing; /* * Assert that someone has locked this vmspace. (Should be @@ -232,9 +233,7 @@ proc_rwmem(struct proc *p, struct uio *u map = &p->p_vmspace->vm_map; writing = uio->uio_rw == UIO_WRITE; - reqprot = writing ? (VM_PROT_WRITE | VM_PROT_OVERRIDE_WRITE) : - VM_PROT_READ; - fault_flags = writing ? VM_FAULT_DIRTY : VM_FAULT_NORMAL; + reqprot = writing ? VM_PROT_COPY | VM_PROT_READ : VM_PROT_READ; /* * Only map in one page at a time. We don't have to, but it @@ -269,7 +268,7 @@ proc_rwmem(struct proc *p, struct uio *u /* * Fault the page on behalf of the process */ - error = vm_fault(map, pageno, reqprot, fault_flags); + error = vm_fault(map, pageno, reqprot, VM_FAULT_NORMAL); if (error) { if (error == KERN_RESOURCE_SHORTAGE) error = ENOMEM; @@ -279,8 +278,8 @@ proc_rwmem(struct proc *p, struct uio *u } /* - * Now we need to get the page. out_entry, wired, - * and single_use aren't used. One would think the vm code + * Now we need to get the page. out_entry and wired + * aren't used. One would think the vm code * would be a *bit* nicer... We use tmap because * vm_map_lookup() can change the map argument. */ @@ -303,6 +302,10 @@ proc_rwmem(struct proc *p, struct uio *u VM_OBJECT_UNLOCK(object); object = backing_object; } + if (writing && m != NULL) { + vm_page_dirty(m); + vm_pager_page_unswapped(m); + } VM_OBJECT_UNLOCK(object); if (m == NULL) { vm_map_lookup_done(tmap, out_entry); Modified: head/sys/vm/vm.h ============================================================================== --- head/sys/vm/vm.h Thu Nov 26 03:26:59 2009 (r199818) +++ head/sys/vm/vm.h Thu Nov 26 05:16:07 2009 (r199819) @@ -76,7 +76,7 @@ typedef u_char vm_prot_t; /* protection #define VM_PROT_READ ((vm_prot_t) 0x01) #define VM_PROT_WRITE ((vm_prot_t) 0x02) #define VM_PROT_EXECUTE ((vm_prot_t) 0x04) -#define VM_PROT_OVERRIDE_WRITE ((vm_prot_t) 0x08) /* copy-on-write */ +#define VM_PROT_COPY ((vm_prot_t) 0x08) /* copy-on-read */ #define VM_PROT_ALL (VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE) #define VM_PROT_RW (VM_PROT_READ|VM_PROT_WRITE) Modified: head/sys/vm/vm_fault.c ============================================================================== --- head/sys/vm/vm_fault.c Thu Nov 26 03:26:59 2009 (r199818) +++ head/sys/vm/vm_fault.c Thu Nov 26 05:16:07 2009 (r199819) @@ -702,7 +702,7 @@ vnode_locked: /* * We only really need to copy if we want to write it. */ - if (fault_type & VM_PROT_WRITE) { + if ((fault_type & (VM_PROT_COPY | VM_PROT_WRITE)) != 0) { /* * This allows pages to be virtually copied from a * backing_object into the first_object, where the Modified: head/sys/vm/vm_map.c ============================================================================== --- head/sys/vm/vm_map.c Thu Nov 26 03:26:59 2009 (r199818) +++ head/sys/vm/vm_map.c Thu Nov 26 05:16:07 2009 (r199819) @@ -3554,14 +3554,8 @@ RetryLookup:; /* * Check whether this task is allowed to have this page. - * Note the special case for MAP_ENTRY_COW - * pages with an override. This is to implement a forced - * COW for debuggers. - */ - if (fault_type & VM_PROT_OVERRIDE_WRITE) - prot = entry->max_protection; - else - prot = entry->protection; + */ + prot = entry->protection; fault_type &= (VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE); if ((fault_type & prot) != fault_type || prot == VM_PROT_NONE) { vm_map_unlock_read(map); @@ -3569,8 +3563,7 @@ RetryLookup:; } if ((entry->eflags & MAP_ENTRY_USER_WIRED) && (entry->eflags & MAP_ENTRY_COW) && - (fault_type & VM_PROT_WRITE) && - (fault_typea & VM_PROT_OVERRIDE_WRITE) == 0) { + (fault_type & VM_PROT_WRITE)) { vm_map_unlock_read(map); return (KERN_PROTECTION_FAILURE); } @@ -3581,7 +3574,7 @@ RetryLookup:; */ *wired = (entry->wired_count != 0); if (*wired) - prot = fault_type = entry->protection; + fault_type = entry->protection; size = entry->end - entry->start; /* * If the entry was copy-on-write, we either ... @@ -3594,7 +3587,8 @@ RetryLookup:; * If we don't need to write the page, we just demote the * permissions allowed. */ - if (fault_type & VM_PROT_WRITE) { + if ((fault_type & VM_PROT_WRITE) != 0 || + (fault_typea & VM_PROT_COPY) != 0) { /* * Make a new object, and place it in the object * chain. Note that no new references have appeared @@ -3717,21 +3711,14 @@ vm_map_lookup_locked(vm_map_t *var_map, /* * Check whether this task is allowed to have this page. - * Note the special case for MAP_ENTRY_COW - * pages with an override. This is to implement a forced - * COW for debuggers. - */ - if (fault_type & VM_PROT_OVERRIDE_WRITE) - prot = entry->max_protection; - else - prot = entry->protection; + */ + prot = entry->protection; fault_type &= VM_PROT_READ | VM_PROT_WRITE | VM_PROT_EXECUTE; if ((fault_type & prot) != fault_type) return (KERN_PROTECTION_FAILURE); if ((entry->eflags & MAP_ENTRY_USER_WIRED) && (entry->eflags & MAP_ENTRY_COW) && - (fault_type & VM_PROT_WRITE) && - (fault_typea & VM_PROT_OVERRIDE_WRITE) == 0) + (fault_type & VM_PROT_WRITE)) return (KERN_PROTECTION_FAILURE); /* @@ -3740,7 +3727,7 @@ vm_map_lookup_locked(vm_map_t *var_map, */ *wired = (entry->wired_count != 0); if (*wired) - prot = fault_type = entry->protection; + fault_type = entry->protection; if (entry->eflags & MAP_ENTRY_NEEDS_COPY) { /* From owner-svn-src-all@FreeBSD.ORG Thu Nov 26 08:29:03 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F2B60106566C; Thu, 26 Nov 2009 08:29:02 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E07788FC0C; Thu, 26 Nov 2009 08:29:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAQ8T2Eg075397; Thu, 26 Nov 2009 08:29:02 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAQ8T275075395; Thu, 26 Nov 2009 08:29:02 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200911260829.nAQ8T275075395@svn.freebsd.org> From: Alexander Motin Date: Thu, 26 Nov 2009 08:29:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199820 - stable/8/sys/dev/ahci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Nov 2009 08:29:03 -0000 Author: mav Date: Thu Nov 26 08:29:02 2009 New Revision: 199820 URL: http://svn.freebsd.org/changeset/base/199820 Log: MFC r199717: Do not attach JMicrons with single PCI function. They are not working as AHCI for some reason, even when declaring so. Let atajmicron configure them for us and provide PATA support. Modified: stable/8/sys/dev/ahci/ahci.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/ahci/ahci.c ============================================================================== --- stable/8/sys/dev/ahci/ahci.c Thu Nov 26 05:16:07 2009 (r199819) +++ stable/8/sys/dev/ahci/ahci.c Thu Nov 26 08:29:02 2009 (r199820) @@ -254,6 +254,10 @@ ahci_probe(device_t dev) for (i = 0; ahci_ids[i].id != 0; i++) { if (ahci_ids[i].id == devid && (valid || !(ahci_ids[i].quirks & AHCI_Q_NOFORCE))) { + /* Do not attach JMicrons with single PCI function. */ + if (pci_get_vendor(dev) == 0x197b && + (pci_read_config(dev, 0xdf, 1) & 0x40) == 0) + return (ENXIO); snprintf(buf, sizeof(buf), "%s AHCI SATA controller", ahci_ids[i].name); device_set_desc_copy(dev, buf); From owner-svn-src-all@FreeBSD.ORG Thu Nov 26 08:49:46 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E11D310656D3; Thu, 26 Nov 2009 08:49:46 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CDB7A8FC1A; Thu, 26 Nov 2009 08:49:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAQ8nkBG075993; Thu, 26 Nov 2009 08:49:46 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAQ8nk2A075983; Thu, 26 Nov 2009 08:49:46 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200911260849.nAQ8nk2A075983@svn.freebsd.org> From: Alexander Motin Date: Thu, 26 Nov 2009 08:49:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199821 - in head: sbin/camcontrol sys/cam sys/cam/ata sys/dev/ahci sys/dev/siis X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Nov 2009 08:49:47 -0000 Author: mav Date: Thu Nov 26 08:49:46 2009 New Revision: 199821 URL: http://svn.freebsd.org/changeset/base/199821 Log: MFp4: Improve ATA mode/SATA revision control. Modified: head/sbin/camcontrol/camcontrol.8 head/sbin/camcontrol/camcontrol.c head/sys/cam/ata/ata_all.c head/sys/cam/ata/ata_all.h head/sys/cam/cam_ccb.h head/sys/dev/ahci/ahci.c head/sys/dev/ahci/ahci.h head/sys/dev/siis/siis.c head/sys/dev/siis/siis.h Modified: head/sbin/camcontrol/camcontrol.8 ============================================================================== --- head/sbin/camcontrol/camcontrol.8 Thu Nov 26 08:29:02 2009 (r199820) +++ head/sbin/camcontrol/camcontrol.8 Thu Nov 26 08:49:46 2009 (r199821) @@ -149,6 +149,7 @@ .Op generic args .Op Fl c .Op Fl D Ar enable|disable +.Op Fl M Ar mode .Op Fl O Ar offset .Op Fl q .Op Fl R Ar syncrate @@ -705,6 +706,8 @@ Show or set current negotiation settings This is the default. .It Fl D Ar enable|disable Enable or disable disconnection. +.It Fl M Ar mode +Set ATA mode. .It Fl O Ar offset Set the command delay offset. .It Fl q Modified: head/sbin/camcontrol/camcontrol.c ============================================================================== --- head/sbin/camcontrol/camcontrol.c Thu Nov 26 08:29:02 2009 (r199820) +++ head/sbin/camcontrol/camcontrol.c Thu Nov 26 08:49:46 2009 (r199821) @@ -125,7 +125,7 @@ struct camcontrol_opts { #ifndef MINIMALISTIC static const char scsicmd_opts[] = "a:c:i:o:r"; static const char readdefect_opts[] = "f:GP"; -static const char negotiate_opts[] = "acD:O:qR:T:UW:"; +static const char negotiate_opts[] = "acD:M:O:qR:T:UW:"; #endif struct camcontrol_opts option_table[] = { @@ -3112,6 +3112,7 @@ ratecontrol(struct cam_device *device, i int user_settings = 0; int retval = 0; int disc_enable = -1, tag_enable = -1; + int mode = -1; int offset = -1; double syncrate = -1; int bus_width = -1; @@ -3120,12 +3121,10 @@ ratecontrol(struct cam_device *device, i struct ccb_pathinq cpi; ccb = cam_getccb(device); - if (ccb == NULL) { warnx("ratecontrol: error allocating ccb"); return(1); } - while ((c = getopt(argc, argv, combinedopt)) != -1) { switch(c){ case 'a': @@ -3146,6 +3145,15 @@ ratecontrol(struct cam_device *device, i } change_settings = 1; break; + case 'M': + mode = ata_string2mode(optarg); + if (mode < 0) { + warnx("unknown mode '%s'", optarg); + retval = 1; + goto ratecontrol_bailout; + } + change_settings = 1; + break; case 'O': offset = strtol(optarg, NULL, 0); if (offset < 0) { @@ -3160,7 +3168,6 @@ ratecontrol(struct cam_device *device, i break; case 'R': syncrate = atof(optarg); - if (syncrate < 0) { warnx("sync rate %f is < 0", syncrate); retval = 1; @@ -3196,17 +3203,14 @@ ratecontrol(struct cam_device *device, i break; } } - bzero(&(&ccb->ccb_h)[1], sizeof(struct ccb_pathinq) - sizeof(struct ccb_hdr)); - /* * Grab path inquiry information, so we can determine whether * or not the initiator is capable of the things that the user * requests. */ ccb->ccb_h.func_code = XPT_PATH_INQ; - if (cam_send_ccb(device, ccb) < 0) { perror("error sending XPT_PATH_INQ CCB"); if (arglist & CAM_ARG_VERBOSE) { @@ -3216,7 +3220,6 @@ ratecontrol(struct cam_device *device, i retval = 1; goto ratecontrol_bailout; } - if ((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { warnx("XPT_PATH_INQ CCB failed"); if (arglist & CAM_ARG_VERBOSE) { @@ -3226,17 +3229,14 @@ ratecontrol(struct cam_device *device, i retval = 1; goto ratecontrol_bailout; } - bcopy(&ccb->cpi, &cpi, sizeof(struct ccb_pathinq)); - bzero(&(&ccb->ccb_h)[1], sizeof(struct ccb_trans_settings) - sizeof(struct ccb_hdr)); - - if (quiet == 0) - fprintf(stdout, "Current Parameters:\n"); - + if (quiet == 0) { + fprintf(stdout, "%s parameters:\n", + user_settings ? "User" : "Current"); + } retval = get_print_cts(device, user_settings, quiet, &ccb->cts); - if (retval != 0) goto ratecontrol_bailout; @@ -3246,16 +3246,20 @@ ratecontrol(struct cam_device *device, i if (change_settings) { int didsettings = 0; struct ccb_trans_settings_spi *spi = NULL; + struct ccb_trans_settings_ata *ata = NULL; + struct ccb_trans_settings_sata *sata = NULL; struct ccb_trans_settings_scsi *scsi = NULL; - if (ccb->cts.transport == XPORT_SPI) { + if (ccb->cts.transport == XPORT_SPI) spi = &ccb->cts.xport_specific.spi; - spi->valid = 0; - } - if (ccb->cts.protocol == PROTO_SCSI) { + if (ccb->cts.transport == XPORT_ATA) + ata = &ccb->cts.xport_specific.ata; + if (ccb->cts.transport == XPORT_SATA) + sata = &ccb->cts.xport_specific.sata; + if (ccb->cts.protocol == PROTO_SCSI) scsi = &ccb->cts.proto_specific.scsi; - scsi->valid = 0; - } + ccb->cts.xport_specific.valid = 0; + ccb->cts.proto_specific.valid = 0; if (spi && disc_enable != -1) { spi->valid |= CTS_SPI_VALID_DISC; if (disc_enable == 0) @@ -3263,7 +3267,6 @@ ratecontrol(struct cam_device *device, i else spi->flags |= CTS_SPI_FLAGS_DISC_ENB; } - if (scsi && tag_enable != -1) { if ((cpi.hba_inquiry & PI_TAG_ABLE) == 0) { warnx("HBA does not support tagged queueing, " @@ -3271,21 +3274,16 @@ ratecontrol(struct cam_device *device, i retval = 1; goto ratecontrol_bailout; } - scsi->valid |= CTS_SCSI_VALID_TQ; - if (tag_enable == 0) scsi->flags &= ~CTS_SCSI_FLAGS_TAG_ENB; else scsi->flags |= CTS_SCSI_FLAGS_TAG_ENB; didsettings++; } - if (spi && offset != -1) { if ((cpi.hba_inquiry & PI_SDTR_ABLE) == 0) { - warnx("HBA at %s%d is not cable of changing " - "offset", cpi.dev_name, - cpi.unit_number); + warnx("HBA is not capable of changing offset"); retval = 1; goto ratecontrol_bailout; } @@ -3293,28 +3291,23 @@ ratecontrol(struct cam_device *device, i spi->sync_offset = offset; didsettings++; } - if (spi && syncrate != -1) { int prelim_sync_period; u_int freq; if ((cpi.hba_inquiry & PI_SDTR_ABLE) == 0) { - warnx("HBA at %s%d is not cable of changing " - "transfer rates", cpi.dev_name, - cpi.unit_number); + warnx("HBA is not capable of changing " + "transfer rates"); retval = 1; goto ratecontrol_bailout; } - spi->valid |= CTS_SPI_VALID_SYNC_RATE; - /* * The sync rate the user gives us is in MHz. * We need to translate it into KHz for this * calculation. */ syncrate *= 1000; - /* * Next, we calculate a "preliminary" sync period * in tenths of a nanosecond. @@ -3323,14 +3316,43 @@ ratecontrol(struct cam_device *device, i prelim_sync_period = 0; else prelim_sync_period = 10000000 / syncrate; - spi->sync_period = scsi_calc_syncparam(prelim_sync_period); - freq = scsi_calc_syncsrate(spi->sync_period); didsettings++; } - + if (sata && syncrate != -1) { + if ((cpi.hba_inquiry & PI_SDTR_ABLE) == 0) { + warnx("HBA is not capable of changing " + "transfer rates"); + retval = 1; + goto ratecontrol_bailout; + } + sata->revision = ata_speed2revision(syncrate * 100); + if (sata->revision < 0) { + warnx("Invalid rate %f", syncrate); + retval = 1; + goto ratecontrol_bailout; + } + sata->valid |= CTS_SATA_VALID_REVISION; + didsettings++; + } + if ((ata || sata) && mode != -1) { + if ((cpi.hba_inquiry & PI_SDTR_ABLE) == 0) { + warnx("HBA is not capable of changing " + "transfer rates"); + retval = 1; + goto ratecontrol_bailout; + } + if (ata) { + ata->mode = mode; + ata->valid |= CTS_ATA_VALID_MODE; + } else { + sata->mode = mode; + sata->valid |= CTS_SATA_VALID_MODE; + } + didsettings++; + } /* * The bus_width argument goes like this: * 0 == 8 bit @@ -3341,7 +3363,6 @@ ratecontrol(struct cam_device *device, i * number. */ if (spi && bus_width != -1) { - /* * We might as well validate things here with a * decipherable error message, rather than what @@ -3365,17 +3386,19 @@ ratecontrol(struct cam_device *device, i retval = 1; goto ratecontrol_bailout; } - spi->valid |= CTS_SPI_VALID_BUS_WIDTH; spi->bus_width = bus_width >> 4; didsettings++; } - if (didsettings == 0) { goto ratecontrol_bailout; } + if (!user_settings && (ata || sata)) { + warnx("You can modify only user settings for ATA/SATA"); + retval = 1; + goto ratecontrol_bailout; + } ccb->ccb_h.func_code = XPT_SET_TRAN_SETTINGS; - if (cam_send_ccb(device, ccb) < 0) { perror("error sending XPT_SET_TRAN_SETTINGS CCB"); if (arglist & CAM_ARG_VERBOSE) { @@ -3385,7 +3408,6 @@ ratecontrol(struct cam_device *device, i retval = 1; goto ratecontrol_bailout; } - if ((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { warnx("XPT_SET_TRANS_SETTINGS CCB failed"); if (arglist & CAM_ARG_VERBOSE) { @@ -3396,11 +3418,9 @@ ratecontrol(struct cam_device *device, i goto ratecontrol_bailout; } } - if (send_tur) { retval = testunitready(device, retry_count, timeout, (arglist & CAM_ARG_VERBOSE) ? 0 : 1); - /* * If the TUR didn't succeed, just bail. */ @@ -3409,7 +3429,6 @@ ratecontrol(struct cam_device *device, i fprintf(stderr, "Test Unit Ready failed\n"); goto ratecontrol_bailout; } - /* * If the user wants things quiet, there's no sense in * getting the transfer settings, if we're not going @@ -3417,13 +3436,11 @@ ratecontrol(struct cam_device *device, i */ if (quiet != 0) goto ratecontrol_bailout; - - fprintf(stdout, "New Parameters:\n"); + fprintf(stdout, "New parameters:\n"); retval = get_print_cts(device, user_settings, 0, NULL); } ratecontrol_bailout: - cam_freeccb(ccb); return(retval); } @@ -4310,8 +4327,8 @@ usage(int verbose) " \n" " camcontrol tags [dev_id][generic args] [-N tags] [-q] [-v]\n" " camcontrol negotiate [dev_id][generic args] [-a][-c]\n" -" [-D ][-O offset][-q]\n" -" [-R syncrate][-v][-T ]\n" +" [-D ][-M mode][-O offset]\n" +" [-q][-R syncrate][-v][-T ]\n" " [-U][-W bus_width]\n" " camcontrol format [dev_id][generic args][-q][-r][-w][-y]\n" " camcontrol idle [dev_id][generic args][-t time]\n" @@ -4402,6 +4419,7 @@ usage(int verbose) "-a send a test unit ready after negotiation\n" "-c report/set current negotiation settings\n" "-D \"enable\" or \"disable\" disconnection\n" +"-M mode set ATA mode\n" "-O offset set command delay offset\n" "-q be quiet, don't report anything\n" "-R syncrate synchronization rate in MHz\n" Modified: head/sys/cam/ata/ata_all.c ============================================================================== --- head/sys/cam/ata/ata_all.c Thu Nov 26 08:29:02 2009 (r199820) +++ head/sys/cam/ata/ata_all.c Thu Nov 26 08:49:46 2009 (r199821) @@ -532,6 +532,35 @@ ata_mode2string(int mode) } } +int +ata_string2mode(char *str) +{ + if (!strcasecmp(str, "PIO0")) return (ATA_PIO0); + if (!strcasecmp(str, "PIO1")) return (ATA_PIO1); + if (!strcasecmp(str, "PIO2")) return (ATA_PIO2); + if (!strcasecmp(str, "PIO3")) return (ATA_PIO3); + if (!strcasecmp(str, "PIO4")) return (ATA_PIO4); + if (!strcasecmp(str, "WDMA0")) return (ATA_WDMA0); + if (!strcasecmp(str, "WDMA1")) return (ATA_WDMA1); + if (!strcasecmp(str, "WDMA2")) return (ATA_WDMA2); + if (!strcasecmp(str, "UDMA0")) return (ATA_UDMA0); + if (!strcasecmp(str, "UDMA16")) return (ATA_UDMA0); + if (!strcasecmp(str, "UDMA1")) return (ATA_UDMA1); + if (!strcasecmp(str, "UDMA25")) return (ATA_UDMA1); + if (!strcasecmp(str, "UDMA2")) return (ATA_UDMA2); + if (!strcasecmp(str, "UDMA33")) return (ATA_UDMA2); + if (!strcasecmp(str, "UDMA3")) return (ATA_UDMA3); + if (!strcasecmp(str, "UDMA44")) return (ATA_UDMA3); + if (!strcasecmp(str, "UDMA4")) return (ATA_UDMA4); + if (!strcasecmp(str, "UDMA66")) return (ATA_UDMA4); + if (!strcasecmp(str, "UDMA5")) return (ATA_UDMA5); + if (!strcasecmp(str, "UDMA100")) return (ATA_UDMA5); + if (!strcasecmp(str, "UDMA6")) return (ATA_UDMA6); + if (!strcasecmp(str, "UDMA133")) return (ATA_UDMA6); + return (-1); +} + + u_int ata_mode2speed(int mode) { @@ -588,13 +617,16 @@ int ata_speed2revision(u_int speed) { switch (speed) { + case 0: + return (0); case 150000: - default: return (1); case 300000: return (2); case 600000: return (3); + default: + return (-1); } } Modified: head/sys/cam/ata/ata_all.h ============================================================================== --- head/sys/cam/ata/ata_all.h Thu Nov 26 08:29:02 2009 (r199820) +++ head/sys/cam/ata/ata_all.h Thu Nov 26 08:49:46 2009 (r199821) @@ -115,6 +115,7 @@ int ata_max_umode(struct ata_params *ap) int ata_max_mode(struct ata_params *ap, int maxmode); char * ata_mode2string(int mode); +int ata_string2mode(char *str); u_int ata_mode2speed(int mode); u_int ata_revision2speed(int revision); int ata_speed2revision(u_int speed); Modified: head/sys/cam/cam_ccb.h ============================================================================== --- head/sys/cam/cam_ccb.h Thu Nov 26 08:29:02 2009 (r199820) +++ head/sys/cam/cam_ccb.h Thu Nov 26 08:49:46 2009 (r199821) @@ -820,7 +820,7 @@ struct ccb_trans_settings_ata { u_int valid; /* Which fields to honor */ #define CTS_ATA_VALID_MODE 0x01 #define CTS_ATA_VALID_BYTECOUNT 0x02 - int mode; /* Mode */ + int mode; /* Mode */ u_int bytecount; /* Length of PIO transaction */ }; @@ -831,9 +831,9 @@ struct ccb_trans_settings_sata { #define CTS_SATA_VALID_REVISION 0x04 #define CTS_SATA_VALID_PM 0x08 #define CTS_SATA_VALID_TAGS 0x10 - int mode; /* Legacy PATA mode */ + int mode; /* Legacy PATA mode */ u_int bytecount; /* Length of PIO transaction */ - u_int revision; /* SATA revision */ + int revision; /* SATA revision */ u_int pm_present; /* PM is present (XPT->SIM) */ u_int tags; /* Number of allowed tags */ }; Modified: head/sys/dev/ahci/ahci.c ============================================================================== --- head/sys/dev/ahci/ahci.c Thu Nov 26 08:29:02 2009 (r199820) +++ head/sys/dev/ahci/ahci.c Thu Nov 26 08:49:46 2009 (r199821) @@ -72,7 +72,7 @@ static void ahci_dmasetprd(void *arg, bu static void ahci_execute_transaction(struct ahci_slot *slot); static void ahci_timeout(struct ahci_slot *slot); static void ahci_end_transaction(struct ahci_slot *slot, enum ahci_err_type et); -static int ahci_setup_fis(struct ahci_cmd_tab *ctp, union ccb *ccb, int tag); +static int ahci_setup_fis(device_t dev, struct ahci_cmd_tab *ctp, union ccb *ccb, int tag); static void ahci_dmainit(device_t dev); static void ahci_dmasetupc_cb(void *xsc, bus_dma_segment_t *segs, int nsegs, int error); static void ahci_dmafini(device_t dev); @@ -776,7 +776,7 @@ ahci_ch_attach(device_t dev) struct ahci_controller *ctlr = device_get_softc(device_get_parent(dev)); struct ahci_channel *ch = device_get_softc(dev); struct cam_devq *devq; - int rid, error, i; + int rid, error, i, sata_rev = 0; ch->dev = dev; ch->unit = (intptr_t)device_get_ivars(dev); @@ -789,22 +789,22 @@ ahci_ch_attach(device_t dev) device_get_unit(dev), "pm_level", &ch->pm_level); if (ch->pm_level > 3) callout_init_mtx(&ch->pm_timer, &ch->mtx, 0); - for (i = 0; i < 16; i++) { - ch->user[i].revision = 0; - ch->user[i].mode = 0; - ch->user[i].bytecount = 8192; - ch->user[i].tags = ch->numslots; - ch->curr[i] = ch->user[i]; - } /* Limit speed for my onboard JMicron external port. * It is not eSATA really. */ if (pci_get_devid(ctlr->dev) == 0x2363197b && pci_get_subvendor(ctlr->dev) == 0x1043 && pci_get_subdevice(ctlr->dev) == 0x81e4 && ch->unit == 0) - ch->sata_rev = 1; + sata_rev = 1; resource_int_value(device_get_name(dev), - device_get_unit(dev), "sata_rev", &ch->sata_rev); + device_get_unit(dev), "sata_rev", &sata_rev); + for (i = 0; i < 16; i++) { + ch->user[i].revision = sata_rev; + ch->user[i].mode = 0; + ch->user[i].bytecount = 8192; + ch->user[i].tags = ch->numslots; + ch->curr[i] = ch->user[i]; + } rid = ch->unit; if (!(ch->r_mem = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE))) @@ -1410,7 +1410,7 @@ ahci_execute_transaction(struct ahci_slo ctp = (struct ahci_cmd_tab *) (ch->dma.work + AHCI_CT_OFFSET + (AHCI_CT_SIZE * slot->slot)); /* Setup the FIS for this request */ - if (!(fis_size = ahci_setup_fis(ctp, ccb, slot->slot))) { + if (!(fis_size = ahci_setup_fis(dev, ctp, ccb, slot->slot))) { device_printf(ch->dev, "Setting up SATA FIS failed\n"); ahci_end_transaction(slot, AHCI_ERR_INVALID); return; @@ -1983,8 +1983,9 @@ ahci_reset(device_t dev) } static int -ahci_setup_fis(struct ahci_cmd_tab *ctp, union ccb *ccb, int tag) +ahci_setup_fis(device_t dev, struct ahci_cmd_tab *ctp, union ccb *ccb, int tag) { + struct ahci_channel *ch = device_get_softc(dev); u_int8_t *fis = &ctp->cfis[0]; bzero(ctp->cfis, 64); @@ -1993,7 +1994,8 @@ ahci_setup_fis(struct ahci_cmd_tab *ctp, if (ccb->ccb_h.func_code == XPT_SCSI_IO) { fis[1] |= 0x80; fis[2] = ATA_PACKET_CMD; - if ((ccb->ccb_h.flags & CAM_DIR_MASK) != CAM_DIR_NONE) + if ((ccb->ccb_h.flags & CAM_DIR_MASK) != CAM_DIR_NONE && + ch->curr[ccb->ccb_h.target_id].mode >= ATA_DMA) fis[3] = ATA_F_DMA; else { fis[5] = ccb->csio.dxfer_len; @@ -2073,6 +2075,7 @@ static int ahci_sata_phy_reset(device_t dev, int quick) { struct ahci_channel *ch = device_get_softc(dev); + int sata_rev; uint32_t val; if (quick) { @@ -2083,11 +2086,12 @@ ahci_sata_phy_reset(device_t dev, int qu if (bootverbose) device_printf(dev, "hardware reset ...\n"); - if (ch->sata_rev == 1) + sata_rev = ch->user[ch->pm_present ? 15 : 0].revision; + if (sata_rev == 1) val = ATA_SC_SPD_SPEED_GEN1; - else if (ch->sata_rev == 2) + else if (sata_rev == 2) val = ATA_SC_SPD_SPEED_GEN2; - else if (ch->sata_rev == 3) + else if (sata_rev == 3) val = ATA_SC_SPD_SPEED_GEN3; else val = 0; Modified: head/sys/dev/ahci/ahci.h ============================================================================== --- head/sys/dev/ahci/ahci.h Thu Nov 26 08:29:02 2009 (r199820) +++ head/sys/dev/ahci/ahci.h Thu Nov 26 08:49:46 2009 (r199821) @@ -341,7 +341,7 @@ struct ahci_slot { }; struct ahci_device { - u_int revision; + int revision; int mode; u_int bytecount; u_int tags; @@ -362,7 +362,6 @@ struct ahci_channel { int quirks; int numslots; /* Number of present slots */ int pm_level; /* power management level */ - int sata_rev; /* Maximum allowed SATA generation */ struct ahci_slot slot[AHCI_MAX_SLOTS]; union ccb *hold[AHCI_MAX_SLOTS]; Modified: head/sys/dev/siis/siis.c ============================================================================== --- head/sys/dev/siis/siis.c Thu Nov 26 08:29:02 2009 (r199820) +++ head/sys/dev/siis/siis.c Thu Nov 26 08:49:46 2009 (r199821) @@ -69,7 +69,7 @@ static void siis_dmasetprd(void *arg, bu static void siis_execute_transaction(struct siis_slot *slot); static void siis_timeout(struct siis_slot *slot); static void siis_end_transaction(struct siis_slot *slot, enum siis_err_type et); -static int siis_setup_fis(struct siis_cmd *ctp, union ccb *ccb, int tag); +static int siis_setup_fis(device_t dev, struct siis_cmd *ctp, union ccb *ccb, int tag); static void siis_dmainit(device_t dev); static void siis_dmasetupc_cb(void *xsc, bus_dma_segment_t *segs, int nsegs, int error); static void siis_dmafini(device_t dev); @@ -415,21 +415,21 @@ siis_ch_attach(device_t dev) { struct siis_channel *ch = device_get_softc(dev); struct cam_devq *devq; - int rid, error, i; + int rid, error, i, sata_rev = 0; ch->dev = dev; ch->unit = (intptr_t)device_get_ivars(dev); resource_int_value(device_get_name(dev), device_get_unit(dev), "pm_level", &ch->pm_level); + resource_int_value(device_get_name(dev), + device_get_unit(dev), "sata_rev", &sata_rev); for (i = 0; i < 16; i++) { - ch->user[i].revision = 0; + ch->user[i].revision = sata_rev; ch->user[i].mode = 0; ch->user[i].bytecount = 8192; ch->user[i].tags = SIIS_MAX_SLOTS; ch->curr[i] = ch->user[i]; } - resource_int_value(device_get_name(dev), - device_get_unit(dev), "sata_rev", &ch->sata_rev); mtx_init(&ch->mtx, "SIIS channel lock", NULL, MTX_DEF); rid = ch->unit; if (!(ch->r_mem = bus_alloc_resource_any(dev, SYS_RES_MEMORY, @@ -974,7 +974,7 @@ siis_execute_transaction(struct siis_slo ctp->control |= htole16(SIIS_PRB_PACKET_WRITE); } /* Setup the FIS for this request */ - if (!siis_setup_fis(ctp, ccb, slot->slot)) { + if (!siis_setup_fis(dev, ctp, ccb, slot->slot)) { device_printf(ch->dev, "Setting up SATA FIS failed\n"); if (!ch->readlog) xpt_freeze_simq(ch->sim, 1); @@ -1346,7 +1346,7 @@ static void siis_reset(device_t dev) { struct siis_channel *ch = device_get_softc(dev); - int i, retry = 0; + int i, retry = 0, sata_rev; uint32_t val; if (bootverbose) @@ -1390,11 +1390,12 @@ siis_reset(device_t dev) /* Disable port interrupts */ ATA_OUTL(ch->r_mem, SIIS_P_IECLR, 0x0000FFFF); /* Set speed limit. */ - if (ch->sata_rev == 1) + sata_rev = ch->user[ch->pm_present ? 15 : 0].revision; + if (sata_rev == 1) val = ATA_SC_SPD_SPEED_GEN1; - else if (ch->sata_rev == 2) + else if (sata_rev == 2) val = ATA_SC_SPD_SPEED_GEN2; - else if (ch->sata_rev == 3) + else if (sata_rev == 3) val = ATA_SC_SPD_SPEED_GEN3; else val = 0; @@ -1446,8 +1447,9 @@ retry: } static int -siis_setup_fis(struct siis_cmd *ctp, union ccb *ccb, int tag) +siis_setup_fis(device_t dev, struct siis_cmd *ctp, union ccb *ccb, int tag) { + struct siis_channel *ch = device_get_softc(dev); u_int8_t *fis = &ctp->fis[0]; bzero(fis, 24); @@ -1456,7 +1458,8 @@ siis_setup_fis(struct siis_cmd *ctp, uni if (ccb->ccb_h.func_code == XPT_SCSI_IO) { fis[1] |= 0x80; fis[2] = ATA_PACKET_CMD; - if ((ccb->ccb_h.flags & CAM_DIR_MASK) != CAM_DIR_NONE) + if ((ccb->ccb_h.flags & CAM_DIR_MASK) != CAM_DIR_NONE && + ch->curr[ccb->ccb_h.target_id].mode >= ATA_DMA) fis[3] = ATA_F_DMA; else { fis[5] = ccb->csio.dxfer_len; Modified: head/sys/dev/siis/siis.h ============================================================================== --- head/sys/dev/siis/siis.h Thu Nov 26 08:29:02 2009 (r199820) +++ head/sys/dev/siis/siis.h Thu Nov 26 08:49:46 2009 (r199821) @@ -347,7 +347,7 @@ struct siis_slot { }; struct siis_device { - u_int revision; + int revision; int mode; u_int bytecount; u_int tags; @@ -364,7 +364,6 @@ struct siis_channel { struct cam_sim *sim; struct cam_path *path; int pm_level; /* power management level */ - int sata_rev; /* Maximum allowed SATA generation */ struct siis_slot slot[SIIS_MAX_SLOTS]; union ccb *hold[SIIS_MAX_SLOTS]; From owner-svn-src-all@FreeBSD.ORG Thu Nov 26 12:41:43 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9DB81106566B; Thu, 26 Nov 2009 12:41:43 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 829B68FC0C; Thu, 26 Nov 2009 12:41:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAQCfhbP081835; Thu, 26 Nov 2009 12:41:43 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAQCfhBF081830; Thu, 26 Nov 2009 12:41:43 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200911261241.nAQCfhBF081830@svn.freebsd.org> From: Alexander Motin Date: Thu, 26 Nov 2009 12:41:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199822 - in head: sbin/atacontrol sys/conf sys/dev/ata sys/modules/ata/atausb sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Nov 2009 12:41:43 -0000 Author: mav Date: Thu Nov 26 12:41:43 2009 New Revision: 199822 URL: http://svn.freebsd.org/changeset/base/199822 Log: Drop USB mass storage devices support from ata(4). It is out of the build as long as I remember, and completely superseded by better maintained umass(4). It's main idea was to optionally avoid CAM dependency for such devices, but with move ATA to CAM, it is not actual any more. No objections: hselasky@, thompsa@, arch@ Deleted: head/sys/dev/ata/ata-usb.c head/sys/modules/ata/atausb/ Modified: head/sbin/atacontrol/atacontrol.c head/sys/conf/files head/sys/dev/ata/ata-all.c head/sys/sys/ata.h Modified: head/sbin/atacontrol/atacontrol.c ============================================================================== --- head/sbin/atacontrol/atacontrol.c Thu Nov 26 08:49:46 2009 (r199821) +++ head/sbin/atacontrol/atacontrol.c Thu Nov 26 12:41:43 2009 (r199822) @@ -61,9 +61,6 @@ mode2str(int mode) case ATA_UDMA6: return "UDMA133"; case ATA_SA150: return "SATA150"; case ATA_SA300: return "SATA300"; - case ATA_USB: return "USB"; - case ATA_USB1: return "USB1"; - case ATA_USB2: return "USB2"; case ATA_DMA: return "BIOSDMA"; default: return "???"; } @@ -95,9 +92,6 @@ str2mode(char *str) if (!strcasecmp(str, "UDMA133")) return ATA_UDMA6; if (!strcasecmp(str, "SATA150")) return ATA_SA150; if (!strcasecmp(str, "SATA300")) return ATA_SA300; - if (!strcasecmp(str, "USB")) return ATA_USB; - if (!strcasecmp(str, "USB1")) return ATA_USB1; - if (!strcasecmp(str, "USB2")) return ATA_USB2; if (!strcasecmp(str, "BIOSDMA")) return ATA_DMA; return -1; } Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Thu Nov 26 08:49:46 2009 (r199821) +++ head/sys/conf/files Thu Nov 26 12:41:43 2009 (r199822) @@ -533,7 +533,6 @@ dev/ata/chipsets/ata-sis.c optional ata dev/ata/chipsets/ata-via.c optional ata pci | atavia dev/ata/ata-disk.c optional atadisk dev/ata/ata-raid.c optional ataraid -dev/ata/ata-usb.c optional atausb usb dev/ata/atapi-cd.c optional atapicd dev/ata/atapi-fd.c optional atapifd dev/ata/atapi-tape.c optional atapist Modified: head/sys/dev/ata/ata-all.c ============================================================================== --- head/sys/dev/ata/ata-all.c Thu Nov 26 08:49:46 2009 (r199821) +++ head/sys/dev/ata/ata-all.c Thu Nov 26 12:41:43 2009 (r199822) @@ -942,9 +942,6 @@ ata_mode2str(int mode) case ATA_UDMA6: return "UDMA133"; case ATA_SA150: return "SATA150"; case ATA_SA300: return "SATA300"; - case ATA_USB: return "USB"; - case ATA_USB1: return "USB1"; - case ATA_USB2: return "USB2"; default: if (mode & ATA_DMA_MASK) return "BIOSDMA"; Modified: head/sys/sys/ata.h ============================================================================== --- head/sys/sys/ata.h Thu Nov 26 08:49:46 2009 (r199821) +++ head/sys/sys/ata.h Thu Nov 26 12:41:43 2009 (r199822) @@ -278,9 +278,6 @@ struct ata_params { #define ATA_SA150 0x47 #define ATA_SA300 0x48 #define ATA_DMA_MAX 0x4f -#define ATA_USB 0x80 -#define ATA_USB1 0x81 -#define ATA_USB2 0x82 /* ATA commands */ From owner-svn-src-all@FreeBSD.ORG Thu Nov 26 13:18:38 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6ACDE106568B; Thu, 26 Nov 2009 13:18:38 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 598F48FC12; Thu, 26 Nov 2009 13:18:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAQDIc4I082679; Thu, 26 Nov 2009 13:18:38 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAQDIcYU082677; Thu, 26 Nov 2009 13:18:38 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <200911261318.nAQDIcYU082677@svn.freebsd.org> From: Takahashi Yoshihiro Date: Thu, 26 Nov 2009 13:18:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199823 - stable/7/release/pc98 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Nov 2009 13:18:38 -0000 Author: nyan Date: Thu Nov 26 13:18:38 2009 New Revision: 199823 URL: http://svn.freebsd.org/changeset/base/199823 Log: MFC: revision 178945 Add the ed and remove the vi. This fixes a disk-full error. Modified: stable/7/release/pc98/fixit_crunch.conf Directory Properties: stable/7/release/ (props changed) stable/7/release/doc/en_US.ISO8859-1/hardware/ (props changed) Modified: stable/7/release/pc98/fixit_crunch.conf ============================================================================== --- stable/7/release/pc98/fixit_crunch.conf Thu Nov 26 12:41:43 2009 (r199822) +++ stable/7/release/pc98/fixit_crunch.conf Thu Nov 26 13:18:38 2009 (r199823) @@ -9,6 +9,7 @@ progs cp progs dd progs df progs echo +progs ed progs expr progs kill progs ln @@ -39,9 +40,6 @@ special fdisk srcdir /usr/src/sbin/fdisk srcdirs /usr/src/usr.bin progs ftp progs telnet -progs vi -ln vi view -ln vi ex srcdirs /usr/src/usr.sbin progs chown From owner-svn-src-all@FreeBSD.ORG Thu Nov 26 13:22:01 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 228A11065672; Thu, 26 Nov 2009 13:22:01 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 114F78FC13; Thu, 26 Nov 2009 13:22:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAQDM0lw082799; Thu, 26 Nov 2009 13:22:00 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAQDM0W7082797; Thu, 26 Nov 2009 13:22:00 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <200911261322.nAQDM0W7082797@svn.freebsd.org> From: Takahashi Yoshihiro Date: Thu, 26 Nov 2009 13:22:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199824 - stable/7/release/pc98 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Nov 2009 13:22:01 -0000 Author: nyan Date: Thu Nov 26 13:22:00 2009 New Revision: 199824 URL: http://svn.freebsd.org/changeset/base/199824 Log: MFC: revision 178974 Replace the ee with the ed to resolve disk overflow. Modified: stable/7/release/pc98/fixit-small_crunch.conf Directory Properties: stable/7/release/ (props changed) stable/7/release/doc/en_US.ISO8859-1/hardware/ (props changed) Modified: stable/7/release/pc98/fixit-small_crunch.conf ============================================================================== --- stable/7/release/pc98/fixit-small_crunch.conf Thu Nov 26 13:18:38 2009 (r199823) +++ stable/7/release/pc98/fixit-small_crunch.conf Thu Nov 26 13:22:00 2009 (r199824) @@ -9,6 +9,7 @@ progs cp progs dd progs df progs echo +progs ed progs expr progs kill progs ln @@ -37,9 +38,7 @@ ln bsdlabel disklabel special fdisk srcdir /usr/src/sbin/fdisk_pc98 srcdirs /usr/src/usr.bin -progs ee progs ftp -ln ee edit srcdirs /usr/src/usr.sbin progs chown From owner-svn-src-all@FreeBSD.ORG Thu Nov 26 13:25:08 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 432D3106568F; Thu, 26 Nov 2009 13:25:08 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 32A698FC12; Thu, 26 Nov 2009 13:25:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAQDP8Xt082899; Thu, 26 Nov 2009 13:25:08 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAQDP8D2082897; Thu, 26 Nov 2009 13:25:08 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <200911261325.nAQDP8D2082897@svn.freebsd.org> From: Christian Brueffer Date: Thu, 26 Nov 2009 13:25:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199825 - head/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Nov 2009 13:25:08 -0000 Author: brueffer Date: Thu Nov 26 13:25:07 2009 New Revision: 199825 URL: http://svn.freebsd.org/changeset/base/199825 Log: Add IBM ServeRAID-MR10i to the hardware list. Submitted by: pluknet MFC after: 3 days Modified: head/share/man/man4/mfi.4 Modified: head/share/man/man4/mfi.4 ============================================================================== --- head/share/man/man4/mfi.4 Thu Nov 26 13:22:00 2009 (r199824) +++ head/share/man/man4/mfi.4 Thu Nov 26 13:25:07 2009 (r199825) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 24, 2009 +.Dd November 26, 2009 .Dt MFI 4 .Os .Sh NAME @@ -90,6 +90,8 @@ LSI MegaRAID SAS 9260 Dell PERC5 .It Dell PERC6 +.It +IBM ServeRAID-MR10i .El .Sh FILES .Bl -tag -width ".Pa /dev/mfid?" -compact From owner-svn-src-all@FreeBSD.ORG Thu Nov 26 13:41:15 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9CA211065679; Thu, 26 Nov 2009 13:41:15 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8C7E68FC1D; Thu, 26 Nov 2009 13:41:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAQDfFsC083285; Thu, 26 Nov 2009 13:41:15 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAQDfFEI083283; Thu, 26 Nov 2009 13:41:15 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200911261341.nAQDfFEI083283@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 26 Nov 2009 13:41:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199826 - head/lib/libutil X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Nov 2009 13:41:15 -0000 Author: kib Date: Thu Nov 26 13:41:15 2009 New Revision: 199826 URL: http://svn.freebsd.org/changeset/base/199826 Log: sigset() is the name of function specified by SUSv4. Replace it to avoid conflict. MFC after: 3 weeks Modified: head/lib/libutil/pw_util.c Modified: head/lib/libutil/pw_util.c ============================================================================== --- head/lib/libutil/pw_util.c Thu Nov 26 13:25:07 2009 (r199825) +++ head/lib/libutil/pw_util.c Thu Nov 26 13:41:15 2009 (r199826) @@ -289,7 +289,7 @@ int pw_edit(int notsetuid) { struct sigaction sa, sa_int, sa_quit; - sigset_t oldsigset, sigset; + sigset_t oldsigset, nsigset; struct stat st1, st2; const char *editor; int pstat; @@ -303,9 +303,9 @@ pw_edit(int notsetuid) sa.sa_flags = 0; sigaction(SIGINT, &sa, &sa_int); sigaction(SIGQUIT, &sa, &sa_quit); - sigemptyset(&sigset); - sigaddset(&sigset, SIGCHLD); - sigprocmask(SIG_BLOCK, &sigset, &oldsigset); + sigemptyset(&nsigset); + sigaddset(&nsigset, SIGCHLD); + sigprocmask(SIG_BLOCK, &nsigset, &oldsigset); switch ((editpid = fork())) { case -1: return (-1); From owner-svn-src-all@FreeBSD.ORG Thu Nov 26 13:49:38 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9E6B61065694; Thu, 26 Nov 2009 13:49:38 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8C8758FC1E; Thu, 26 Nov 2009 13:49:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAQDnc3D083477; Thu, 26 Nov 2009 13:49:38 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAQDnco2083469; Thu, 26 Nov 2009 13:49:38 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200911261349.nAQDnco2083469@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 26 Nov 2009 13:49:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199827 - in head: include lib/libc/compat-43 sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Nov 2009 13:49:38 -0000 Author: kib Date: Thu Nov 26 13:49:37 2009 New Revision: 199827 URL: http://svn.freebsd.org/changeset/base/199827 Log: Implement sighold, sigignore, sigpause, sigrelse, sigset functions from SUSv4 XSI. Note that the functions are obsoleted, and only provided to ease porting from System V-like systems. Since sigpause already exists in compat with different interface, XSI sigpause is named xsi_sigpause. Reviewed by: davidxu MFC after: 3 weeks Modified: head/include/signal.h head/lib/libc/compat-43/Makefile.inc head/lib/libc/compat-43/Symbol.map head/lib/libc/compat-43/sigcompat.c head/lib/libc/compat-43/sigpause.2 head/sys/sys/signal.h head/sys/sys/signalvar.h Modified: head/include/signal.h ============================================================================== --- head/include/signal.h Thu Nov 26 13:41:15 2009 (r199826) +++ head/include/signal.h Thu Nov 26 13:49:37 2009 (r199827) @@ -99,7 +99,12 @@ int sigwaitinfo(const sigset_t * __restr #if __XSI_VISIBLE int killpg(__pid_t, int); int sigaltstack(const stack_t * __restrict, stack_t * __restrict); -int sigpause(int); +int sighold(int sig); +int sigignore(int sig); +int sigpause(int sigmask); +int sigrelse(int sig); +void (*sigset(int sig, void (*disp)(int)))(int); +int xsi_sigpause(int sig); #endif #if __XSI_VISIBLE >= 600 Modified: head/lib/libc/compat-43/Makefile.inc ============================================================================== --- head/lib/libc/compat-43/Makefile.inc Thu Nov 26 13:41:15 2009 (r199826) +++ head/lib/libc/compat-43/Makefile.inc Thu Nov 26 13:49:37 2009 (r199827) @@ -13,6 +13,11 @@ MAN+= creat.2 killpg.2 sigpause.2 sigset MAN+= gethostid.3 setruid.3 MLINKS+=gethostid.3 sethostid.3 +MLINKS+=sigpause.2 sighold.2 +MLINKS+=sigpause.2 sigignore.2 +MLINKS+=sigpause.2 sigrelse.2 +MLINKS+=sigpause.2 sigset.2 +MLINKS+=sigpause.2 xsi_sigpause.2 MLINKS+=setruid.3 setrgid.3 MLINKS+=sigsetmask.2 sigblock.2 Modified: head/lib/libc/compat-43/Symbol.map ============================================================================== --- head/lib/libc/compat-43/Symbol.map Thu Nov 26 13:41:15 2009 (r199826) +++ head/lib/libc/compat-43/Symbol.map Thu Nov 26 13:49:37 2009 (r199827) @@ -17,6 +17,14 @@ FBSD_1.0 { sigvec; }; +FBSD_1.2 { + sighold; + sigignore; + sigrelse; + sigset; + xsi_sigpause; +}; + FBSDprivate_1.0 { __creat; _creat; Modified: head/lib/libc/compat-43/sigcompat.c ============================================================================== --- head/lib/libc/compat-43/sigcompat.c Thu Nov 26 13:41:15 2009 (r199826) +++ head/lib/libc/compat-43/sigcompat.c Thu Nov 26 13:49:37 2009 (r199827) @@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$"); #include "namespace.h" #include #include +#include #include "un-namespace.h" #include "libc_private.h" @@ -97,8 +98,7 @@ sigblock(mask) } int -sigpause(mask) - int mask; +sigpause(int mask) { sigset_t set; @@ -106,3 +106,84 @@ sigpause(mask) set.__bits[0] = mask; return (_sigsuspend(&set)); } + +int +xsi_sigpause(int sig) +{ + sigset_t set; + + sigemptyset(&set); + sigaddset(&set, sig); + return (_sigsuspend(&set)); +} + +int +sighold(int sig) +{ + sigset_t set; + + sigemptyset(&set); + sigaddset(&set, sig); + return (_sigprocmask(SIG_BLOCK, &set, NULL)); +} + +int +sigignore(int sig) +{ + struct sigaction sa; + + bzero(&sa, sizeof(sa)); + sa.sa_handler = SIG_IGN; + return (_sigaction(sig, &sa, NULL)); +} + +int +sigrelse(int sig) +{ + sigset_t set; + + sigemptyset(&set); + sigaddset(&set, sig); + return (_sigprocmask(SIG_UNBLOCK, &set, NULL)); +} + +void +(*sigset(int sig, void (*disp)(int)))(int) +{ + sigset_t set, pset; + struct sigaction sa, psa; + int error; + + sigemptyset(&set); + sigaddset(&set, sig); + error = _sigprocmask(SIG_BLOCK, NULL, &pset); + if (error == -1) + return (SIG_ERR); + if ((__sighandler_t *)disp == SIG_HOLD) { + error = _sigprocmask(SIG_BLOCK, &set, &pset); + if (error == -1) + return (SIG_ERR); + if (sigismember(&pset, sig)) + return (SIG_HOLD); + else { + error = _sigaction(sig, NULL, &psa); + if (error == -1) + return (SIG_ERR); + return (psa.sa_handler); + } + } else { + error = _sigprocmask(SIG_UNBLOCK, &set, &pset); + if (error == -1) + return (SIG_ERR); + } + + bzero(&sa, sizeof(sa)); + sa.sa_handler = disp; + error = _sigaction(sig, &sa, &psa); + if (error == -1) + return (SIG_ERR); + if (sigismember(&pset, sig)) + return (SIG_HOLD); + else + return (psa.sa_handler); +} Modified: head/lib/libc/compat-43/sigpause.2 ============================================================================== --- head/lib/libc/compat-43/sigpause.2 Thu Nov 26 13:41:15 2009 (r199826) +++ head/lib/libc/compat-43/sigpause.2 Thu Nov 26 13:49:37 2009 (r199827) @@ -28,21 +28,118 @@ .\" @(#)sigpause.2 8.1 (Berkeley) 6/2/93 .\" $FreeBSD$ .\" +.\" Part of the content of the man page was derived from +.\" The Open Group Base Specifications Issue 7 +.\" IEEE Std 1003.1-2008 +.\" .Dd June 2, 1993 .Dt SIGPAUSE 2 .Os .Sh NAME -.Nm sigpause -.Nd atomically release blocked signals and wait for interrupt +.Nm sighold , +.Nm sigignore , +.Nm sigpause , +.Nm sigrelse , +.Nm sigset +.Nd legacy interface for signal management .Sh LIBRARY .Lb libc .Sh SYNOPSIS .In signal.h .Ft int +.Fn sighold "int sig" +.Ft int +.Fn sigignore "int sig" +.Ft int +.Fn xsi_sigpause "int sigmask" +.Ft int +.Fn sigrelse "int sig" +.Ft void (*)(int) +.Fn sigset "int" "void (*disp)(int)" +.Ft int .Fn sigpause "int sigmask" .Sh DESCRIPTION .Sy This interface is made obsolete by -.Xr sigsuspend 2 . +.Xr sigsuspend 2 +.Sy and +.Xr sigaction 2 +.Pp +The +.Fn sigset +function modifies signal dispositions. +The +.Fa sig +argument specifies the signal, which may be any signal except +.Dv SIGKILL +and +.Dv SIGSTOP . +The +.Fa disp +argument specifies the signal's disposition, +which may be +.Dv SIG_DFL , +.Dv SIG_IGN , +or the address of a signal handler. +If +.Fn sigset +is used, and +.Fa disp +is the address of a signal handler, the +system adds +.Fa sig +to the signal mask of the calling process before executing the signal +handler; when the signal handler returns, the system restores the +signal mask of the calling process to its state prior to the delivery +of the signal. +In addition, if +.Fn sigset +is used, and +.Fa disp +is equal to +.Dv SIG_HOLD , +.Fa sig +is added to the signal +mask of the calling process and +.Fa sig 's +disposition remains unchanged. +If +.Fn sigset +is used, and +.Fa disp +is not equal to +.Dv SIG_HOLD , +.Fa sig +is removed from the signal mask of the calling process. +.Pp +The +.Fn sighold +function adds +.Fa sig +to the signal mask of the calling process. +.Pp +The +.Fn sigrelse +function removes +.Fa sig +from the signal mask of the calling process. +.Pp +The +.Fn sigignore +function sets the disposition of +.Fa sig +to +.Dv SIG_IGN . +.Pp +The +.Fn xsi_sigpause +function removes +.Fa sig +from the signal mask of the calling process and suspend the calling process +until a signal is received. +The +.Fn xsi_sigpause +function restores the signal mask of the process to its original state before +returning. .Pp The .Fn sigpause @@ -57,13 +154,47 @@ The argument is usually 0 to indicate that no signals are to be blocked. +.Sh RETURN VALUES The .Fn sigpause -function -always terminates by being interrupted, returning -1 with +and +.Fn xsi_sigpause +functions +always terminate by being interrupted, returning -1 with .Va errno set to -.Er EINTR +.Er EINTR . +.Pp +Upon successful completion, +.Fn sigset +returns +.Dv SIG_HOLD +if the signal had been blocked and the signal's previous disposition if +it had not been blocked. +Otherwise, +.Dv SIG_ERR is returned and +.Va errno +set to indicate the error. +.Pp +For all other functions, upon successful completion, 0 is returned. +Otherwise, -1 is returned and +.Va errno +is set to indicate the error: +.Bl -tag -width Er +.It Bq Er EINVAL +The +.Fa sig +argument +is not a valid signal number. +.It Bq Er EINVAL +For +.Fn sigset +and +.Fn sigignore +functions, an attempt was made to catch or ignore +.Dv SIGKILL +or +.Dv SIGSTOP . .Sh SEE ALSO .Xr kill 2 , .Xr sigaction 2 , @@ -85,9 +216,26 @@ and was copied from there into the .Pq Tn XSI option of .St -p1003.1-2001 . +.Fx +implements it under the name +.Fn xsi_sigpause . +The +.Fn sighold , +.Fn sigignore , +.Fn sigrelse +and +.Fn sigset +functions are implemented for compatibility with +.Sy System V +and +.Sy XSI +interfaces. .Sh HISTORY The .Fn sigpause function appeared in .Bx 4.2 and has been deprecated. +All other functions appeared in +.Fx 9.0 +and were deprecated before being implemented. Modified: head/sys/sys/signal.h ============================================================================== --- head/sys/sys/signal.h Thu Nov 26 13:41:15 2009 (r199826) +++ head/sys/sys/signal.h Thu Nov 26 13:49:37 2009 (r199827) @@ -119,9 +119,8 @@ #define SIG_DFL ((__sighandler_t *)0) #define SIG_IGN ((__sighandler_t *)1) #define SIG_ERR ((__sighandler_t *)-1) -/* - * XXX missing SIG_HOLD. - */ +/* #define SIG_CATCH ((__sighandler_t *)2) See signalvar.h */ +#define SIG_HOLD ((__sighandler_t *)3) /*- * Type of a signal handling function. Modified: head/sys/sys/signalvar.h ============================================================================== --- head/sys/sys/signalvar.h Thu Nov 26 13:41:15 2009 (r199826) +++ head/sys/sys/signalvar.h Thu Nov 26 13:49:37 2009 (r199827) @@ -97,7 +97,7 @@ typedef void __osiginfohandler_t(int, os /* additional signal action values, used only temporarily/internally */ #define SIG_CATCH ((__sighandler_t *)2) -#define SIG_HOLD ((__sighandler_t *)3) +/* #define SIG_HOLD ((__sighandler_t *)3) See signal.h */ /* * get signal action for process and signal; currently only for current process From owner-svn-src-all@FreeBSD.ORG Thu Nov 26 13:55:49 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BAD80106568F; Thu, 26 Nov 2009 13:55:49 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AAA748FC29; Thu, 26 Nov 2009 13:55:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAQDtnIb083626; Thu, 26 Nov 2009 13:55:49 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAQDtnXG083624; Thu, 26 Nov 2009 13:55:49 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200911261355.nAQDtnXG083624@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 26 Nov 2009 13:55:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199828 - head/libexec/rtld-elf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Nov 2009 13:55:49 -0000 Author: kib Date: Thu Nov 26 13:55:49 2009 New Revision: 199828 URL: http://svn.freebsd.org/changeset/base/199828 Log: Flag controlling origin expansion in DT_FLAGS is DF_ORIGIN, not DF_1_ORIGIN. Reviewed by: kan MFC after: 3 days Modified: head/libexec/rtld-elf/rtld.c Modified: head/libexec/rtld-elf/rtld.c ============================================================================== --- head/libexec/rtld-elf/rtld.c Thu Nov 26 13:49:37 2009 (r199827) +++ head/libexec/rtld-elf/rtld.c Thu Nov 26 13:55:49 2009 (r199828) @@ -898,7 +898,7 @@ digest_dynamic(Obj_Entry *obj, int early #endif case DT_FLAGS: - if ((dynp->d_un.d_val & DF_1_ORIGIN) && trust) + if ((dynp->d_un.d_val & DF_ORIGIN) && trust) obj->z_origin = true; if (dynp->d_un.d_val & DF_SYMBOLIC) obj->symbolic = true; From owner-svn-src-all@FreeBSD.ORG Thu Nov 26 13:57:20 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7E205106566B; Thu, 26 Nov 2009 13:57:20 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6C8BE8FC23; Thu, 26 Nov 2009 13:57:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAQDvK2u083692; Thu, 26 Nov 2009 13:57:20 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAQDvKG8083688; Thu, 26 Nov 2009 13:57:20 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200911261357.nAQDvKG8083688@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 26 Nov 2009 13:57:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199829 - in head: libexec/rtld-elf sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Nov 2009 13:57:20 -0000 Author: kib Date: Thu Nov 26 13:57:20 2009 New Revision: 199829 URL: http://svn.freebsd.org/changeset/base/199829 Log: Implement rtld part of the support for -z nodlopen (see ld(1)). Reviewed by: kan MFC after: 3 weeks Modified: head/libexec/rtld-elf/rtld.c head/libexec/rtld-elf/rtld.h head/sys/sys/elf_common.h Modified: head/libexec/rtld-elf/rtld.c ============================================================================== --- head/libexec/rtld-elf/rtld.c Thu Nov 26 13:55:49 2009 (r199828) +++ head/libexec/rtld-elf/rtld.c Thu Nov 26 13:57:20 2009 (r199829) @@ -87,7 +87,7 @@ static void die(void) __dead2; static void digest_dynamic(Obj_Entry *, int); static Obj_Entry *digest_phdr(const Elf_Phdr *, int, caddr_t, const char *); static Obj_Entry *dlcheck(void *); -static Obj_Entry *do_load_object(int, const char *, char *, struct stat *); +static Obj_Entry *do_load_object(int, const char *, char *, struct stat *, int); static int do_search_info(const Obj_Entry *obj, int, struct dl_serinfo *); static bool donelist_check(DoneList *, const Obj_Entry *); static void errmsg_restore(char *); @@ -103,7 +103,7 @@ static void initlist_add_objects(Obj_Ent static bool is_exported(const Elf_Sym *); static void linkmap_add(Obj_Entry *); static void linkmap_delete(Obj_Entry *); -static int load_needed_objects(Obj_Entry *); +static int load_needed_objects(Obj_Entry *, int); static int load_preload_objects(void); static Obj_Entry *load_object(const char *, const Obj_Entry *, int); static Obj_Entry *obj_from_addr(const void *); @@ -485,7 +485,7 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_ preload_tail = obj_tail; dbg("loading needed objects"); - if (load_needed_objects(obj_main) == -1) + if (load_needed_objects(obj_main, 0) == -1) die(); /* Make a list of all objects loaded at startup. */ @@ -932,6 +932,8 @@ digest_dynamic(Obj_Entry *obj, int early #endif case DT_FLAGS_1: + if (dynp->d_un.d_val & DF_1_NOOPEN) + obj->z_noopen = true; if ((dynp->d_un.d_val & DF_1_ORIGIN) && trust) obj->z_origin = true; if (dynp->d_un.d_val & DF_1_GLOBAL) @@ -1425,7 +1427,7 @@ is_exported(const Elf_Sym *def) * returns -1 on failure. */ static int -load_needed_objects(Obj_Entry *first) +load_needed_objects(Obj_Entry *first, int flags) { Obj_Entry *obj, *obj1; @@ -1434,7 +1436,7 @@ load_needed_objects(Obj_Entry *first) for (needed = obj->needed; needed != NULL; needed = needed->next) { obj1 = needed->obj = load_object(obj->strtab + needed->name, obj, - false); + flags & ~RTLD_LO_NOLOAD); if (obj1 == NULL && !ld_tracing) return -1; if (obj1 != NULL && obj1->z_nodelete && !obj1->ref_nodel) { @@ -1465,7 +1467,7 @@ load_preload_objects(void) savech = p[len]; p[len] = '\0'; - if (load_object(p, NULL, false) == NULL) + if (load_object(p, NULL, 0) == NULL) return -1; /* XXX - cleanup */ p[len] = savech; p += len; @@ -1482,7 +1484,7 @@ load_preload_objects(void) * on failure. */ static Obj_Entry * -load_object(const char *name, const Obj_Entry *refobj, int noload) +load_object(const char *name, const Obj_Entry *refobj, int flags) { Obj_Entry *obj; int fd = -1; @@ -1528,11 +1530,11 @@ load_object(const char *name, const Obj_ close(fd); return obj; } - if (noload) + if (flags & RTLD_LO_NOLOAD) return (NULL); /* First use of this object, so we must map it in */ - obj = do_load_object(fd, name, path, &sb); + obj = do_load_object(fd, name, path, &sb, flags); if (obj == NULL) free(path); close(fd); @@ -1541,7 +1543,8 @@ load_object(const char *name, const Obj_ } static Obj_Entry * -do_load_object(int fd, const char *name, char *path, struct stat *sbp) +do_load_object(int fd, const char *name, char *path, struct stat *sbp, + int flags) { Obj_Entry *obj; struct statfs fs; @@ -1568,6 +1571,13 @@ do_load_object(int fd, const char *name, object_add_name(obj, name); obj->path = path; digest_dynamic(obj, 0); + if (obj->z_noopen && (flags & RTLD_LO_DLOPEN)) { + dbg("refusing to load non-loadable \"%s\"", obj->path); + _rtld_error("Cannot dlopen non-loadable %s\n", obj->path); + munmap(obj->mapbase, obj->mapsize); + obj_free(obj); + return (NULL); + } *obj_tail = obj; obj_tail = &obj->next; @@ -1986,14 +1996,16 @@ dlopen(const char *name, int mode) Obj_Entry **old_obj_tail; Obj_Entry *obj; Objlist initlist; - int result, lockstate, nodelete, noload; + int result, lockstate, nodelete, lo_flags; LD_UTRACE(UTRACE_DLOPEN_START, NULL, NULL, 0, mode, name); ld_tracing = (mode & RTLD_TRACE) == 0 ? NULL : "1"; if (ld_tracing != NULL) environ = (char **)*get_program_var_addr("environ"); nodelete = mode & RTLD_NODELETE; - noload = mode & RTLD_NOLOAD; + lo_flags = RTLD_LO_DLOPEN; + if (mode & RTLD_NOLOAD) + lo_flags |= RTLD_LO_NOLOAD; objlist_init(&initlist); @@ -2006,7 +2018,7 @@ dlopen(const char *name, int mode) obj = obj_main; obj->refcount++; } else { - obj = load_object(name, obj_main, noload); + obj = load_object(name, obj_main, lo_flags); } if (obj) { @@ -2016,7 +2028,7 @@ dlopen(const char *name, int mode) mode &= RTLD_MODEMASK; if (*old_obj_tail != NULL) { /* We loaded something new. */ assert(*old_obj_tail == obj); - result = load_needed_objects(obj); + result = load_needed_objects(obj, RTLD_LO_DLOPEN); init_dag(obj); if (result != -1) result = rtld_verify_versions(&obj->dagmembers); Modified: head/libexec/rtld-elf/rtld.h ============================================================================== --- head/libexec/rtld-elf/rtld.h Thu Nov 26 13:55:49 2009 (r199828) +++ head/libexec/rtld-elf/rtld.h Thu Nov 26 13:57:20 2009 (r199829) @@ -218,6 +218,7 @@ typedef struct Struct_Obj_Entry { bool phdr_alloc : 1; /* Phdr is allocated and needs to be freed. */ bool z_origin : 1; /* Process rpath and soname tokens */ bool z_nodelete : 1; /* Do not unload the object and dependencies */ + bool z_noopen : 1; /* Do not load on dlopen */ bool ref_nodel : 1; /* Refcount increased to prevent dlclose */ bool init_scanned: 1; /* Object is already on init list. */ bool on_fini_list: 1; /* Object is already on fini list. */ @@ -240,6 +241,10 @@ typedef struct Struct_Obj_Entry { #define SYMLOOK_DLSYM 0x02 /* Return newes versioned symbol. Used by dlsym. */ +/* Flags for load_object(). */ +#define RTLD_LO_NOLOAD 0x01 /* dlopen() specified RTLD_NOLOAD */ +#define RTLD_LO_DLOPEN 0x02 /* load_object() called from dlopen(). */ + /* * Symbol cache entry used during relocation to avoid multiple lookups * of the same symbol. Modified: head/sys/sys/elf_common.h ============================================================================== --- head/sys/sys/elf_common.h Thu Nov 26 13:55:49 2009 (r199828) +++ head/sys/sys/elf_common.h Thu Nov 26 13:57:20 2009 (r199829) @@ -471,6 +471,7 @@ typedef struct { #define DF_1_BIND_NOW 0x00000001 /* Same as DF_BIND_NOW */ #define DF_1_GLOBAL 0x00000002 /* Set the RTLD_GLOBAL for object */ #define DF_1_NODELETE 0x00000008 /* Set the RTLD_NODELETE for object */ +#define DF_1_NOOPEN 0x00000040 /* Do not allow loading on dlopen() */ #define DF_1_ORIGIN 0x00000080 /* Process $ORIGIN */ /* Values for n_type. Used in core files. */ From owner-svn-src-all@FreeBSD.ORG Thu Nov 26 14:01:14 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C8067106566B; Thu, 26 Nov 2009 14:01:14 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B842B8FC23; Thu, 26 Nov 2009 14:01:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAQE1E2p083826; Thu, 26 Nov 2009 14:01:14 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAQE1Ewj083824; Thu, 26 Nov 2009 14:01:14 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200911261401.nAQE1Ewj083824@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 26 Nov 2009 14:01:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199830 - head/lib/libthr X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Nov 2009 14:01:14 -0000 Author: kib Date: Thu Nov 26 14:01:14 2009 New Revision: 199830 URL: http://svn.freebsd.org/changeset/base/199830 Log: Libthr cannot be dynamically loaded into the running process. Mark it with -z nodlopen for now. Discussed with: jhb, kan MFC after: 3 weeks Modified: head/lib/libthr/Makefile Modified: head/lib/libthr/Makefile ============================================================================== --- head/lib/libthr/Makefile Thu Nov 26 13:57:20 2009 (r199829) +++ head/lib/libthr/Makefile Thu Nov 26 14:01:14 2009 (r199830) @@ -25,7 +25,7 @@ CFLAGS+=-I${.CURDIR}/../../libexec/rtld- CFLAGS+=-I${.CURDIR}/../../libexec/rtld-elf/${MACHINE_ARCH} CFLAGS+=-I${.CURDIR}/../libthread_db CFLAGS+=-Winline -LDFLAGS+=-Wl,-znodelete +LDFLAGS+=-Wl,-znodelete -Wl,-znodlopen VERSION_DEF=${.CURDIR}/../libc/Versions.def SYMBOL_MAPS=${.CURDIR}/pthread.map From owner-svn-src-all@FreeBSD.ORG Thu Nov 26 14:50:01 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D7ECC10656A4; Thu, 26 Nov 2009 14:50:01 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C6C008FC15; Thu, 26 Nov 2009 14:50:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAQEo1F0084958; Thu, 26 Nov 2009 14:50:01 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAQEo15R084956; Thu, 26 Nov 2009 14:50:01 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200911261450.nAQEo15R084956@svn.freebsd.org> From: Alexander Motin Date: Thu, 26 Nov 2009 14:50:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199831 - stable/8/sys/dev/ata X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Nov 2009 14:50:02 -0000 Author: mav Date: Thu Nov 26 14:50:01 2009 New Revision: 199831 URL: http://svn.freebsd.org/changeset/base/199831 Log: MFC r199749: Use only lower byte of sectors_intr IDENTIFY word as sector count. This fixes SET_MULTI error during boot on devices supporting less then 16 sectors per interrupt. Modified: stable/8/sys/dev/ata/ata-disk.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/ata/ata-disk.c ============================================================================== --- stable/8/sys/dev/ata/ata-disk.c Thu Nov 26 14:01:14 2009 (r199830) +++ stable/8/sys/dev/ata/ata-disk.c Thu Nov 26 14:50:01 2009 (r199831) @@ -397,7 +397,7 @@ ad_init(device_t dev) /* use multiple sectors/interrupt if device supports it */ if (ad_version(atadev->param.version_major)) { - int secsperint = max(1, min(atadev->param.sectors_intr, 16)); + int secsperint = max(1, min(atadev->param.sectors_intr & 0xff, 16)); if (!ata_controlcmd(dev, ATA_SET_MULTI, 0, 0, secsperint)) atadev->max_iosize = secsperint * DEV_BSIZE; From owner-svn-src-all@FreeBSD.ORG Thu Nov 26 14:52:14 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A304F106568F; Thu, 26 Nov 2009 14:52:14 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 91D2C8FC14; Thu, 26 Nov 2009 14:52:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAQEqE37085048; Thu, 26 Nov 2009 14:52:14 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAQEqEKX085046; Thu, 26 Nov 2009 14:52:14 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200911261452.nAQEqEKX085046@svn.freebsd.org> From: Alexander Motin Date: Thu, 26 Nov 2009 14:52:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199832 - stable/7/sys/dev/ata X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Nov 2009 14:52:14 -0000 Author: mav Date: Thu Nov 26 14:52:14 2009 New Revision: 199832 URL: http://svn.freebsd.org/changeset/base/199832 Log: MFC r199749: Use only lower byte of sectors_intr IDENTIFY word as sector count. This fixes SET_MULTI error during boot on devices supporting less then 16 sectors per interrupt. Modified: stable/7/sys/dev/ata/ata-disk.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/ata/ata-disk.c ============================================================================== --- stable/7/sys/dev/ata/ata-disk.c Thu Nov 26 14:50:01 2009 (r199831) +++ stable/7/sys/dev/ata/ata-disk.c Thu Nov 26 14:52:14 2009 (r199832) @@ -417,7 +417,7 @@ ad_init(device_t dev) /* use multiple sectors/interrupt if device supports it */ if (ad_version(atadev->param.version_major)) { - int secsperint = max(1, min(atadev->param.sectors_intr, 16)); + int secsperint = max(1, min(atadev->param.sectors_intr & 0xff, 16)); if (!ata_controlcmd(dev, ATA_SET_MULTI, 0, 0, secsperint)) atadev->max_iosize = secsperint * DEV_BSIZE; From owner-svn-src-all@FreeBSD.ORG Thu Nov 26 14:56:59 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9A7171065696; Thu, 26 Nov 2009 14:56:59 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6E1DF8FC1C; Thu, 26 Nov 2009 14:56:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAQEuxfB085180; Thu, 26 Nov 2009 14:56:59 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAQEuxA5085178; Thu, 26 Nov 2009 14:56:59 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200911261456.nAQEuxA5085178@svn.freebsd.org> From: Alexander Motin Date: Thu, 26 Nov 2009 14:56:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199833 - stable/8/sys/dev/ata/chipsets X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Nov 2009 14:56:59 -0000 Author: mav Date: Thu Nov 26 14:56:58 2009 New Revision: 199833 URL: http://svn.freebsd.org/changeset/base/199833 Log: MFC r199645, r199646: Fix Intel PATA UDMA timings setting, affecting write performance. Binary divider value 10 specified in datasheet is not a hex 0x10. UDMA2 should be 33/2 instead of 66/4, which is documented as reverved, UDMA4 should be 66/2 instead of 66/4, which is definitely wrong. Release over-agressive WDMA0 mode timings as close to spec as chip can. Modified: stable/8/sys/dev/ata/chipsets/ata-intel.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/ata/chipsets/ata-intel.c ============================================================================== --- stable/8/sys/dev/ata/chipsets/ata-intel.c Thu Nov 26 14:52:14 2009 (r199832) +++ stable/8/sys/dev/ata/chipsets/ata-intel.c Thu Nov 26 14:56:58 2009 (r199833) @@ -301,7 +301,7 @@ ata_intel_new_setmode(device_t dev, int u_int32_t mask40 = 0, new40 = 0; u_int8_t mask44 = 0, new44 = 0; int error; - u_int8_t timings[] = { 0x00, 0x00, 0x10, 0x21, 0x23, 0x10, 0x21, 0x23, + u_int8_t timings[] = { 0x00, 0x00, 0x10, 0x21, 0x23, 0x00, 0x21, 0x23, 0x23, 0x23, 0x23, 0x23, 0x23, 0x23 }; mode = ata_limit_mode(dev, mode, ctlr->chip->max_dma); @@ -319,7 +319,7 @@ ata_intel_new_setmode(device_t dev, int ata_mode2str(mode), ctlr->chip->text); if (!error) { if (mode >= ATA_UDMA0) { - u_int8_t utimings[] = { 0x00, 0x01, 0x10, 0x01, 0x10, 0x01, 0x10 }; + u_int8_t utimings[] = { 0x00, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02 }; pci_write_config(gparent, 0x48, reg48 | (0x0001 << devno), 2); pci_write_config(gparent, 0x4a, @@ -331,7 +331,7 @@ ata_intel_new_setmode(device_t dev, int pci_write_config(gparent, 0x4a, (reg4a & ~(0x3 << (devno << 2))),2); } reg54 |= 0x0400; - if (mode >= ATA_UDMA2) + if (mode >= ATA_UDMA3) reg54 |= (0x1 << devno); else reg54 &= ~(0x1 << devno); From owner-svn-src-all@FreeBSD.ORG Thu Nov 26 15:11:19 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A22F8106568D; Thu, 26 Nov 2009 15:11:19 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 779038FC18; Thu, 26 Nov 2009 15:11:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAQFBJLH085659; Thu, 26 Nov 2009 15:11:19 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAQFBJeY085657; Thu, 26 Nov 2009 15:11:19 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200911261511.nAQFBJeY085657@svn.freebsd.org> From: Alexander Motin Date: Thu, 26 Nov 2009 15:11:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199834 - stable/8/sys/i386/cpufreq X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Nov 2009 15:11:19 -0000 Author: mav Date: Thu Nov 26 15:11:19 2009 New Revision: 199834 URL: http://svn.freebsd.org/changeset/base/199834 Log: MFC r199268, r199269, r199273: Core2Duo/Core2Quad CPUs are unable to control frequency of single CPU core, only pair of them. As result, both cores are running on highest one of requested frequencies, and that is reported by status register. Such behavior confuses frequency validation logic, as it runs on only one core, as SMP is not yet launched, making EIST completely unusable. Disable frequency validation by default, for systems with more then one CPU, until we can implement it properly. It looks like making more harm now then benefits. Add 'hw.est.strict' loader tunable to control it. PR: amd64/140506 Modified: stable/8/sys/i386/cpufreq/est.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/i386/cpufreq/est.c ============================================================================== --- stable/8/sys/i386/cpufreq/est.c Thu Nov 26 14:56:58 2009 (r199833) +++ stable/8/sys/i386/cpufreq/est.c Thu Nov 26 15:11:19 2009 (r199834) @@ -96,6 +96,8 @@ struct est_softc { static int msr_info_enabled = 0; TUNABLE_INT("hw.est.msr_info", &msr_info_enabled); +static int strict = -1; +TUNABLE_INT("hw.est.strict", &strict); /* Default bus clock value for Centrino processors. */ #define INTEL_BUS_CLK 100 @@ -1025,6 +1027,9 @@ est_attach(device_t dev) sc = device_get_softc(dev); sc->dev = dev; + /* On SMP system we can't guarantie independent freq setting. */ + if (strict == -1 && mp_ncpus > 1) + strict = 0; /* Check CPU for supported settings. */ if (est_get_info(dev)) return (ENXIO); @@ -1119,17 +1124,21 @@ est_acpi_info(device_t dev, freq_info ** */ if (sets[i].freq > 0) { error = est_set_id16(dev, sets[i].spec[0], 1); - if (error != 0) { + if (error != 0 && strict) { if (bootverbose) device_printf(dev, "Invalid freq %u, " "ignored.\n", sets[i].freq); - } else { - table[j].freq = sets[i].freq; - table[j].volts = sets[i].volts; - table[j].id16 = sets[i].spec[0]; - table[j].power = sets[i].power; - ++j; + continue; + } else if (error != 0 && bootverbose) { + device_printf(dev, "Can't check freq %u, " + "it may be invalid\n", + sets[i].freq); } + table[j].freq = sets[i].freq; + table[j].volts = sets[i].volts; + table[j].id16 = sets[i].spec[0]; + table[j].power = sets[i].power; + ++j; } } /* restore saved setting */ From owner-svn-src-all@FreeBSD.ORG Thu Nov 26 15:16:03 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ADB2B1065694; Thu, 26 Nov 2009 15:16:03 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9C3118FC1B; Thu, 26 Nov 2009 15:16:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAQFG3JY085807; Thu, 26 Nov 2009 15:16:03 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAQFG3Gk085805; Thu, 26 Nov 2009 15:16:03 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200911261516.nAQFG3Gk085805@svn.freebsd.org> From: Alexander Motin Date: Thu, 26 Nov 2009 15:16:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199835 - stable/8/sys/dev/hptrr X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Nov 2009 15:16:03 -0000 Author: mav Date: Thu Nov 26 15:16:03 2009 New Revision: 199835 URL: http://svn.freebsd.org/changeset/base/199835 Log: MFC r199043: Introduce hw.hptrr.attach_generic loader tunable to deny hptrr driver attach chips with generic Marvell (non-HighPoint) PCI identification. These chips are also supported by ata(4). Some vendors, like Supermicro, are using same chips without providing HPT RAID BIOS. PR: kern/120842, kern/136750 Modified: stable/8/sys/dev/hptrr/hptrr_osm_bsd.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/hptrr/hptrr_osm_bsd.c ============================================================================== --- stable/8/sys/dev/hptrr/hptrr_osm_bsd.c Thu Nov 26 15:11:19 2009 (r199834) +++ stable/8/sys/dev/hptrr/hptrr_osm_bsd.c Thu Nov 26 15:16:03 2009 (r199835) @@ -34,6 +34,9 @@ #include #include +static int attach_generic = 1; +TUNABLE_INT("hw.hptrr.attach_generic", &attach_generic); + static int hpt_probe(device_t dev) { PCI_ID pci_id; @@ -41,6 +44,9 @@ static int hpt_probe(device_t dev) int i; PHBA hba; + /* Some of supported chips are used not only by HPT. */ + if (pci_get_vendor(dev) != 0x1103 && !attach_generic) + return (ENXIO); for (him = him_list; him; him = him->next) { for (i=0; him->get_supported_device_id(i, &pci_id); i++) { if ((pci_get_vendor(dev) == pci_id.vid) && From owner-svn-src-all@FreeBSD.ORG Thu Nov 26 15:18:05 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AE8D01065676; Thu, 26 Nov 2009 15:18:05 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9CBBC8FC0C; Thu, 26 Nov 2009 15:18:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAQFI5K0085892; Thu, 26 Nov 2009 15:18:05 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAQFI5lD085890; Thu, 26 Nov 2009 15:18:05 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200911261518.nAQFI5lD085890@svn.freebsd.org> From: Alexander Motin Date: Thu, 26 Nov 2009 15:18:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199836 - stable/7/sys/dev/hptrr X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Nov 2009 15:18:05 -0000 Author: mav Date: Thu Nov 26 15:18:05 2009 New Revision: 199836 URL: http://svn.freebsd.org/changeset/base/199836 Log: MFC r199043: Introduce hw.hptrr.attach_generic loader tunable to deny hptrr driver attach chips with generic Marvell (non-HighPoint) PCI identification. These chips are also supported by ata(4). Some vendors, like Supermicro, are using same chips without providing HPT RAID BIOS. PR: kern/120842, kern/136750 Modified: stable/7/sys/dev/hptrr/hptrr_osm_bsd.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/hptrr/hptrr_osm_bsd.c ============================================================================== --- stable/7/sys/dev/hptrr/hptrr_osm_bsd.c Thu Nov 26 15:16:03 2009 (r199835) +++ stable/7/sys/dev/hptrr/hptrr_osm_bsd.c Thu Nov 26 15:18:05 2009 (r199836) @@ -34,6 +34,9 @@ #include #include +static int attach_generic = 1; +TUNABLE_INT("hw.hptrr.attach_generic", &attach_generic); + static int hpt_probe(device_t dev) { PCI_ID pci_id; @@ -41,6 +44,9 @@ static int hpt_probe(device_t dev) int i; PHBA hba; + /* Some of supported chips are used not only by HPT. */ + if (pci_get_vendor(dev) != 0x1103 && !attach_generic) + return (ENXIO); for (him = him_list; him; him = him->next) { for (i=0; him->get_supported_device_id(i, &pci_id); i++) { if ((pci_get_vendor(dev) == pci_id.vid) && From owner-svn-src-all@FreeBSD.ORG Thu Nov 26 15:22:43 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 55B341065670; Thu, 26 Nov 2009 15:22:43 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 443DF8FC15; Thu, 26 Nov 2009 15:22:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAQFMhR7086054; Thu, 26 Nov 2009 15:22:43 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAQFMhRP086052; Thu, 26 Nov 2009 15:22:43 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200911261522.nAQFMhRP086052@svn.freebsd.org> From: Alexander Motin Date: Thu, 26 Nov 2009 15:22:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199837 - stable/8/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Nov 2009 15:22:43 -0000 Author: mav Date: Thu Nov 26 15:22:42 2009 New Revision: 199837 URL: http://svn.freebsd.org/changeset/base/199837 Log: MFC r199043: Introduce hw.hptrr.attach_generic loader tunable to deny hptrr driver attach chips with generic Marvell (non-HighPoint) PCI identification. These chips are also supported by ata(4). Some vendors, like Supermicro, are using same chips without providing HPT RAID BIOS. PR: kern/120842, kern/136750 Modified: stable/8/share/man/man4/hptrr.4 Directory Properties: stable/8/share/man/man4/ (props changed) Modified: stable/8/share/man/man4/hptrr.4 ============================================================================== --- stable/8/share/man/man4/hptrr.4 Thu Nov 26 15:18:05 2009 (r199836) +++ stable/8/share/man/man4/hptrr.4 Thu Nov 26 15:22:42 2009 (r199837) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 14, 2007 +.Dd November 8, 2009 .Dt HPTRR 4 .Os .Sh NAME @@ -46,6 +46,14 @@ module at boot time, place the following .Bd -literal -offset indent hptrr_load="YES" .Ed +.Pp +The following tunables are settable from the loader: +.Bl -ohang +.It Va hw.hptrr.attach_generic +set to 0 to deny driver attach to chips with generic Marvell (non-HighPoint) +PCI identification. These chips are also supported by ata(4). +Some vendors are using same chips, but without providing RAID BIOS. +.El .Sh DESCRIPTION The .Nm @@ -101,6 +109,7 @@ manual page for details on support. .Pp This driver supersedes the older rr232x driver. .Sh SEE ALSO +.Xr ata 4 , .Xr cam 4 , .Xr hptmv 4 , .Xr loader 8 From owner-svn-src-all@FreeBSD.ORG Thu Nov 26 15:23:25 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AAFED106566B; Thu, 26 Nov 2009 15:23:25 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 999E98FC14; Thu, 26 Nov 2009 15:23:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAQFNPWq086115; Thu, 26 Nov 2009 15:23:25 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAQFNPOG086113; Thu, 26 Nov 2009 15:23:25 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200911261523.nAQFNPOG086113@svn.freebsd.org> From: Alexander Motin Date: Thu, 26 Nov 2009 15:23:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199838 - stable/7/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Nov 2009 15:23:25 -0000 Author: mav Date: Thu Nov 26 15:23:25 2009 New Revision: 199838 URL: http://svn.freebsd.org/changeset/base/199838 Log: MFC r199043: Introduce hw.hptrr.attach_generic loader tunable to deny hptrr driver attach chips with generic Marvell (non-HighPoint) PCI identification. These chips are also supported by ata(4). Some vendors, like Supermicro, are using same chips without providing HPT RAID BIOS. PR: kern/120842, kern/136750 Modified: stable/7/share/man/man4/hptrr.4 Directory Properties: stable/7/share/man/man4/ (props changed) Modified: stable/7/share/man/man4/hptrr.4 ============================================================================== --- stable/7/share/man/man4/hptrr.4 Thu Nov 26 15:22:42 2009 (r199837) +++ stable/7/share/man/man4/hptrr.4 Thu Nov 26 15:23:25 2009 (r199838) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 14, 2007 +.Dd November 8, 2009 .Dt HPTRR 4 .Os .Sh NAME @@ -46,6 +46,14 @@ module at boot time, place the following .Bd -literal -offset indent hptrr_load="YES" .Ed +.Pp +The following tunables are settable from the loader: +.Bl -ohang +.It Va hw.hptrr.attach_generic +set to 0 to deny driver attach to chips with generic Marvell (non-HighPoint) +PCI identification. These chips are also supported by ata(4). +Some vendors are using same chips, but without providing RAID BIOS. +.El .Sh DESCRIPTION The .Nm @@ -101,6 +109,7 @@ manual page for details on support. .Pp This driver supersedes the older rr232x driver. .Sh SEE ALSO +.Xr ata 4 , .Xr cam 4 , .Xr hptmv 4 , .Xr loader 8 From owner-svn-src-all@FreeBSD.ORG Thu Nov 26 18:14:03 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A1C431065672; Thu, 26 Nov 2009 18:14:03 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8EE3F8FC0A; Thu, 26 Nov 2009 18:14:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAQIE3GM089432; Thu, 26 Nov 2009 18:14:03 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAQIE3Z2089430; Thu, 26 Nov 2009 18:14:03 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <200911261814.nAQIE3Z2089430@svn.freebsd.org> From: Jaakko Heinonen Date: Thu, 26 Nov 2009 18:14:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199840 - stable/8/sbin/mount_nfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Nov 2009 18:14:03 -0000 Author: jh Date: Thu Nov 26 18:14:03 2009 New Revision: 199840 URL: http://svn.freebsd.org/changeset/base/199840 Log: MFC r198491: Fix parsing of mount options specified with -o in case an option with value is preceded by an option without value (for example -o option1,option2=value). Options must be separated before searching for '='. Also compare pnextopt explicitly against NULL. PR: bin/134069 Approved by: trasz (mentor) Modified: stable/8/sbin/mount_nfs/mount_nfs.c Directory Properties: stable/8/sbin/mount_nfs/ (props changed) Modified: stable/8/sbin/mount_nfs/mount_nfs.c ============================================================================== --- stable/8/sbin/mount_nfs/mount_nfs.c Thu Nov 26 15:50:52 2009 (r199839) +++ stable/8/sbin/mount_nfs/mount_nfs.c Thu Nov 26 18:14:03 2009 (r199840) @@ -232,16 +232,16 @@ main(int argc, char *argv[]) char *pnextopt = NULL; char *val = ""; pass_flag_to_nmount = 1; - pval = strchr(opt, '='); pnextopt = strchr(opt, ','); + if (pnextopt != NULL) { + *pnextopt = '\0'; + pnextopt++; + } + pval = strchr(opt, '='); if (pval != NULL) { *pval = '\0'; val = pval + 1; } - if (pnextopt) { - *pnextopt = '\0'; - pnextopt++; - } if (strcmp(opt, "bg") == 0) { opflags |= BGRND; pass_flag_to_nmount=0; From owner-svn-src-all@FreeBSD.ORG Thu Nov 26 19:08:36 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3FE3210656A4; Thu, 26 Nov 2009 19:08:36 +0000 (UTC) (envelope-from fanf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 140248FC0A; Thu, 26 Nov 2009 19:08:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAQJ8Zfc090627; Thu, 26 Nov 2009 19:08:35 GMT (envelope-from fanf@svn.freebsd.org) Received: (from fanf@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAQJ8ZRP090626; Thu, 26 Nov 2009 19:08:35 GMT (envelope-from fanf@svn.freebsd.org) Message-Id: <200911261908.nAQJ8ZRP090626@svn.freebsd.org> From: Tony Finch Date: Thu, 26 Nov 2009 19:08:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199842 - head/usr.bin/unifdef X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Nov 2009 19:08:36 -0000 Author: fanf Date: Thu Nov 26 19:08:33 2009 New Revision: 199842 URL: http://svn.freebsd.org/changeset/base/199842 Log: unifdefall: optimise the loop that builds the unifdef command. The old code used a shell loop to convert each controlling macro definition into a command-line argument, reading the macro definitions file each time. The new code converts the list of controlling macros into a sed script which can run through the list of macro definitions in one go. Add some explanatory comments, since the code is quite meta. Use {} instead of () for redirecting a group of commands. Submitted by: Jonathan Nieder Modified: head/usr.bin/unifdef/unifdefall.sh Modified: head/usr.bin/unifdef/unifdefall.sh ============================================================================== --- head/usr.bin/unifdef/unifdefall.sh Thu Nov 26 19:01:19 2009 (r199841) +++ head/usr.bin/unifdef/unifdefall.sh Thu Nov 26 19:08:33 2009 (r199842) @@ -25,7 +25,7 @@ # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # -# $dotat: unifdef/unifdefall.sh,v 1.21 2009/11/25 19:54:34 fanf2 Exp $ +# $dotat: unifdef/unifdefall.sh,v 1.24 2009/11/26 12:54:39 fanf2 Exp $ # $FreeBSD$ set -e @@ -36,18 +36,26 @@ trap 'rm -r "$tmp" || exit 1' EXIT export LC_ALL=C +# list of all controlling macros unifdef -s "$@" | sort | uniq >"$tmp/ctrl" +# list of all macro definitions cpp -dM "$@" | sort | sed 's/^#define //' >"$tmp/hashdefs" -sed 's/[^A-Za-z0-9_].*$//' "$tmp/hashdefs" >"$tmp/alldef" +# list of defined macro names +sed 's/[^A-Za-z0-9_].*$//' <"$tmp/hashdefs" >"$tmp/alldef" +# list of undefined and defined controlling macros comm -23 "$tmp/ctrl" "$tmp/alldef" >"$tmp/undef" comm -12 "$tmp/ctrl" "$tmp/alldef" >"$tmp/def" -( - echo unifdef -k \\ - sed 's/.*/-U& \\/' "$tmp/undef" - while read sym - do sed -n 's/^'$sym'\(([^)]*)\)\{0,1\} /-D'$sym'=/p' "$tmp/hashdefs" - done <"$tmp/def" | +# create a sed script that extracts the controlling macro definitions +# and converts them to unifdef command-line arguments +sed 's|.*|s/^&\\(([^)]*)\\)\\{0,1\\} /-D&=/p|' <"$tmp/def" >"$tmp/script" +# create the final unifdef command +{ echo unifdef -k \\ + # convert the controlling undefined macros to -U arguments + sed 's/.*/-U& \\/' <"$tmp/undef" + # convert the controlling defined macros to quoted -D arguments + sed -nf "$tmp/script" <"$tmp/hashdefs" | sed "s/'/'\\\\''/g;s/.*/'&' \\\\/" echo '"$@"' -) >"$tmp/cmd" +} >"$tmp/cmd" +# run the command we just created sh "$tmp/cmd" "$@" From owner-svn-src-all@FreeBSD.ORG Thu Nov 26 19:09:10 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A9E87106568D; Thu, 26 Nov 2009 19:09:10 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 97DAA8FC16; Thu, 26 Nov 2009 19:09:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAQJ9AKW090678; Thu, 26 Nov 2009 19:09:10 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAQJ9AcF090676; Thu, 26 Nov 2009 19:09:10 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <200911261909.nAQJ9AcF090676@svn.freebsd.org> From: Jaakko Heinonen Date: Thu, 26 Nov 2009 19:09:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199843 - head/lib/libc/gen X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Nov 2009 19:09:10 -0000 Author: jh Date: Thu Nov 26 19:09:10 2009 New Revision: 199843 URL: http://svn.freebsd.org/changeset/base/199843 Log: Clarify that the value of the fts_info field is different in post-order. Discussed with: das Approved by: trasz (mentor) MFC after: 1 week Modified: head/lib/libc/gen/fts.3 Modified: head/lib/libc/gen/fts.3 ============================================================================== --- head/lib/libc/gen/fts.3 Thu Nov 26 19:08:33 2009 (r199842) +++ head/lib/libc/gen/fts.3 Thu Nov 26 19:09:10 2009 (r199843) @@ -28,7 +28,7 @@ .\" @(#)fts.3 8.5 (Berkeley) 4/16/94 .\" $FreeBSD$ .\" -.Dd October 5, 2009 +.Dd November 25, 2009 .Dt FTS 3 .Os .Sh NAME @@ -198,10 +198,9 @@ A directory being visited in post-order. The contents of the .Vt FTSENT structure will be unchanged from when -it was returned in pre-order, i.e., with the +the directory was visited in pre-order, except for the .Fa fts_info -field set to -.Dv FTS_D . +field. .It Dv FTS_ERR This is an error return, and the .Fa fts_errno From owner-svn-src-all@FreeBSD.ORG Thu Nov 26 19:11:44 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EEE8D106566C; Thu, 26 Nov 2009 19:11:44 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DCDC68FC17; Thu, 26 Nov 2009 19:11:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAQJBipE090785; Thu, 26 Nov 2009 19:11:44 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAQJBi37090783; Thu, 26 Nov 2009 19:11:44 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <200911261911.nAQJBi37090783@svn.freebsd.org> From: Jaakko Heinonen Date: Thu, 26 Nov 2009 19:11:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199844 - head/lib/libc/gen X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Nov 2009 19:11:45 -0000 Author: jh Date: Thu Nov 26 19:11:44 2009 New Revision: 199844 URL: http://svn.freebsd.org/changeset/base/199844 Log: Reset path name back to original correctly in fts_build() when FTS_NOCHDIR option is used. fts_build() could strip a trailing slash from path name in post-order visit if a path pointing to an empty directory was given for fts_open(). PR: bin/133907, kern/134513 Reviewed by: das Approved by: trasz (mentor) MFC after: 1 month Modified: head/lib/libc/gen/fts.c Modified: head/lib/libc/gen/fts.c ============================================================================== --- head/lib/libc/gen/fts.c Thu Nov 26 19:09:10 2009 (r199843) +++ head/lib/libc/gen/fts.c Thu Nov 26 19:11:44 2009 (r199844) @@ -842,11 +842,8 @@ mem1: saved_errno = errno; * If not changing directories, reset the path back to original * state. */ - if (ISSET(FTS_NOCHDIR)) { - if (len == sp->fts_pathlen || nitems == 0) - --cp; - *cp = '\0'; - } + if (ISSET(FTS_NOCHDIR)) + sp->fts_path[cur->fts_pathlen] = '\0'; /* * If descended after called from fts_children or after called from From owner-svn-src-all@FreeBSD.ORG Thu Nov 26 20:25:58 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E8B541065696; Thu, 26 Nov 2009 20:25:58 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D6E808FC35; Thu, 26 Nov 2009 20:25:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAQKPvkx092308; Thu, 26 Nov 2009 20:25:57 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAQKPvun092306; Thu, 26 Nov 2009 20:25:57 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200911262025.nAQKPvun092306@svn.freebsd.org> From: Alexander Motin Date: Thu, 26 Nov 2009 20:25:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199846 - head/sys/dev/sound/pci/hda X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Nov 2009 20:25:59 -0000 Author: mav Date: Thu Nov 26 20:25:57 2009 New Revision: 199846 URL: http://svn.freebsd.org/changeset/base/199846 Log: Add two Cirrus Logic codec IDs. Add GPIO setting quirk for Apple MacBookPro5,5. Submitted by: ed Modified: head/sys/dev/sound/pci/hda/hdac.c Modified: head/sys/dev/sound/pci/hda/hdac.c ============================================================================== --- head/sys/dev/sound/pci/hda/hdac.c Thu Nov 26 19:35:19 2009 (r199845) +++ head/sys/dev/sound/pci/hda/hdac.c Thu Nov 26 20:25:57 2009 (r199846) @@ -315,6 +315,7 @@ SND_DECLARE_FILE("$FreeBSD$"); * (see HDA_CODEC_STAC9221 below). */ #define APPLE_INTEL_MAC 0x76808384 +#define APPLE_MACBOOKPRO55 0xcb7910de /* LG Electronics */ #define LG_VENDORID 0x1854 @@ -605,6 +606,11 @@ static const struct { #define HDA_CODEC_CONSTRUCT(vendor, id) \ (((uint32_t)(vendor##_VENDORID) << 16) | ((id) & 0xffff)) +/* Cirrus Logic */ +#define CIRRUSLOGIC_VENDORID 0x1013 +#define HDA_CODEC_CS4206 HDA_CODEC_CONSTRUCT(CIRRUSLOGIC, 0x4206) +#define HDA_CODEC_CS4207 HDA_CODEC_CONSTRUCT(CIRRUSLOGIC, 0x4207) + /* Realtek */ #define REALTEK_VENDORID 0x10ec #define HDA_CODEC_ALC260 HDA_CODEC_CONSTRUCT(REALTEK, 0x0260) @@ -804,6 +810,8 @@ static const struct { uint32_t id; char *name; } hdac_codecs[] = { + { HDA_CODEC_CS4206, "Cirrus Logic CS4206" }, + { HDA_CODEC_CS4207, "Cirrus Logic CS4207" }, { HDA_CODEC_ALC260, "Realtek ALC260" }, { HDA_CODEC_ALC262, "Realtek ALC262" }, { HDA_CODEC_ALC267, "Realtek ALC267" }, @@ -4667,6 +4675,8 @@ static const struct { HDA_QUIRK_GPIO0 | HDA_QUIRK_OVREF50, 0}, { APPLE_INTEL_MAC, HDA_CODEC_STAC9221, HDA_QUIRK_GPIO0 | HDA_QUIRK_GPIO1, 0 }, + { APPLE_MACBOOKPRO55, HDA_CODEC_CS4206, + HDA_QUIRK_GPIO1 | HDA_QUIRK_GPIO3, 0 }, { DELL_D630_SUBVENDOR, HDA_CODEC_STAC9205X, HDA_QUIRK_GPIO0, 0 }, { DELL_V1400_SUBVENDOR, HDA_CODEC_STAC9228X, From owner-svn-src-all@FreeBSD.ORG Thu Nov 26 20:55:45 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4346C106566B; Thu, 26 Nov 2009 20:55:45 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2E4088FC15; Thu, 26 Nov 2009 20:55:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAQKtjK6092888; Thu, 26 Nov 2009 20:55:45 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAQKtijU092885; Thu, 26 Nov 2009 20:55:44 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <200911262055.nAQKtijU092885@svn.freebsd.org> From: Hiroki Sato Date: Thu, 26 Nov 2009 20:55:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199847 - in stable/8/release/doc: en_US.ISO8859-1/relnotes en_US.ISO8859-1/share/sgml share/sgml X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Nov 2009 20:55:45 -0000 Author: hrs Date: Thu Nov 26 20:55:44 2009 New Revision: 199847 URL: http://svn.freebsd.org/changeset/base/199847 Log: Add entries of Release Notes for 8.0R temporarily. Reviewed by: thompsa, linimon, and brd. Modified: stable/8/release/doc/en_US.ISO8859-1/relnotes/article.sgml stable/8/release/doc/en_US.ISO8859-1/share/sgml/release.dsl stable/8/release/doc/share/sgml/release.dsl stable/8/release/doc/share/sgml/release.ent Modified: stable/8/release/doc/en_US.ISO8859-1/relnotes/article.sgml ============================================================================== --- stable/8/release/doc/en_US.ISO8859-1/relnotes/article.sgml Thu Nov 26 20:25:57 2009 (r199846) +++ stable/8/release/doc/en_US.ISO8859-1/relnotes/article.sgml Thu Nov 26 20:55:44 2009 (r199847) @@ -4,11 +4,6 @@ %release; - - - - - ]>
@@ -57,7 +52,7 @@ Introduction This document contains the release notes for &os; - &release.current;. It + &release.current;. It describes recently added, changed, or deleted features of &os;. It also provides some notes on upgrading from previous versions of &os;. @@ -66,7 +61,7 @@ The &release.type; distribution to which these release notes apply represents the latest point along the &release.branch; development - branch since &release.branch; was created. Information regarding pre-built, binary + branch since &release.branch; was created. Information regarding pre-built, binary &release.type; distributions along this branch can be found at . @@ -87,7 +82,7 @@ This distribution of &os; &release.current; is a &release.type; distribution. It can be found at or any of its mirrors. More + url="&release.url;"> or any of its mirrors. More information on obtaining this (or other) &release.type; distributions of &os; can be found in the Obtaining @@ -100,455 +95,2340 @@ All users are encouraged to consult the release errata before installing &os;. The errata document is updated with late-breaking information discovered late in the - release cycle or after the release. Typically, it contains + release cycle or after the release. Typically, it contains information on known bugs, security advisories, and corrections to documentation. An up-to-date copy of the errata for &os; &release.current; can be found on the &os; Web site. - - What's New - - This section describes - the most user-visible new or changed features in &os; - since &release.prev;. - In general, changes described here are unique to the &release.branch; - branch unless specifically marked as &merged; features. - - - Typical release note items - document recent security advisories issued after - &release.prev;, - new drivers or hardware support, new commands or options, - major bug fixes, or contributed software upgrades. They may also - list changes to major ports/packages or release engineering - practices. Clearly the release notes cannot list every single - change made to &os; between releases; this document focuses - primarily on security advisories, user-visible changes, and major - architectural improvements. - - - Security Advisories - - - - - - - Kernel Changes - - A new &man.cpuset.2; API has been added - for thread to CPU binding and CPU resource grouping and - assignment. The &man.cpuset.1; userland utility has been added - to allow manipulation of processor sets. - - The &man.ddb.4; kernel debugger now has an output capture - facility. Input and output from &man.ddb.4; can now be captured - to a memory buffer for later inspection using &man.sysctl.8; or - a textdump. The new capture command controls - this feature. - - The &man.ddb.4; debugger now supports a simple scripting - facility, which supports a set of named scripts consisting of a - set of &man.ddb.4; commands. These commands can be managed from - within &man.ddb.4; or with the use of the new &man.ddb.8; - utility. More details can be found in the &man.ddb.4; manual - page. - - The kernel now supports a new textdump format of kernel - dumps. A textdump provides higher-level information via - mechanically generated/extracted debugging output, rather than a - simple memory dump. This facility can be used to generate brief - kernel bug reports that are rich in debugging information, but - are not dependent on kernel symbol tables or precisely - synchronized source code. More information can be found in the - &man.textdump.4; manual page. - - Kernel support for M:N threading has been removed. While - the KSE (Kernel Scheduled Entities) project was quite successful - in bringing threading to FreeBSD, the M:N approach taken by the - KSE library was never developed to its full potential. - Backwards compatibility for applications using KSE threading - will be provided via &man.libmap.conf.5; for dynamically linked - binaries. The &os; Project greatly appreciates the work of - &a.julian;, &a.deischen;, and &a.davidxu; on KSE support. - - The &os; kernel now exports information about certain kernel - features via the kern.features sysctl tree. - The &man.feature.present.3; library call provides a convenient - interface for user applications to test the presence of - features. - - The &os; kernel now has support for large - memory page mappings (superpages). - - The ULE - scheduler is now the default process scheduler - in GENERIC kernels. - - - Boot Loader Changes - - The BTX kernel used by the boot - loader has been changed to invoke BIOS routines from real - mode. This change makes it possible to boot &os; from USB - devices. - - A new gptboot boot loader has - been added to support booting from a GPT labeled disk. A - new boot command has been added to - &man.gpt.8;, which makes a GPT disk bootable by writing the - required bits of the boot loader, creating a new boot - partition if required. - - - - - Hardware Support - - The &man.cmx.4; driver, a driver for Omnikey CardMan 4040 - PCMCIA smartcard readers, has been added. - - The &man.syscons.4; driver now supports Colemak keyboard layout. - - The &man.uslcom.4; driver, a driver for Silicon - Laboratories CP2101/CP2102-based USB serial adapters, has been - imported from OpenBSD. - - - Multimedia Support - - - - - - - Network Interface Support - - The &man.ale.4; driver has been added to provide support - for Atheros AR8121/AR8113/AR8114 Gigabit/Fast Ethernet controllers. - - The &man.em.4; driver has been split into two drivers - with some common parts. The &man.em.4; driver will continue - to support adapters up to the 82575, as well as new - client/desktop adapters. A new &man.igb.4; driver - will support new server adapters. - - The &man.jme.4; driver has been added to provide support - for PCIe network adapters based on JMicron JMC250 Gigabit - Ethernet and JMC260 Fast Ethernet controllers. - - The &man.malo.4; driver has been added to provide - support for Marvell Libertas 88W8335 based PCI network - adapters. - - The firmware for the &man.mxge.4; driver has been - updated from 1.4.25 to 1.4.29. - - The &man.sf.4; driver has been overhauled to improve its - performance and to add support for checksum offloading. It - should also work on all architectures. - - The &man.re.4; driver has been overhauled to fix a - number of issues. This driver now has Wake On LAN (WOL) - support. - - The &man.vr.4; driver has been overhauled to fix a - number of outstanding issues. It also now works on all - architectures. - - The &man.wpi.4; driver has - been updated to include a number of stability fixes. - - - - - - Network Protocols - - The &man.bpf.4; packet filter and capture facility now - supports a zero-copy mode of operation, in which buffers are - loaned from a user process to the kernel. This feature can - be enabled by setting - the net.bpf.zerocopy_enable sysctl - variable to 1. - - ISDN4BSD(I4B), netatm, and all - related subsystems have been removed due to lack of - multi-processor support. - - A bug in TCP options padding, where the wrong padding - bytes were used, has been fixed. - - - - - Disks and Storage - - The &man.aac.4; driver now supports volumes larger than - 2TB in size. - - The &man.ata.4; driver now supports a spindown command for - disks; after a configurable amount of time, if no requests - have been received for a disk, the disk will be spun down - until the next request. The &man.atacontrol.8; utility now - supports a spindown command to configure - this feature. - - The &man.hptrr.4; driver has been updated to version 1.2 - from Highpoint. - - - - - File Systems - - A problem with using &man.mmap.2; on ZFS filesystems has - been fixed. - - A new kernel-mode NFS lock manager has been added, - improving performance and behavior of NFS locking. A new - &man.clear.locks.8; command has been added to clear locks held - on behalf of an NFS client. - - - - - - Userland Changes - - The &man.adduser.8; utility now supports - a option to set the mode of a new user's - home directory. - - BSD-licensed versions of &man.ar.1; and &man.ranlib.1;, - based on libarchive, have replaced the GNU - Binutils versions of these utilities. - - &man.chflags.1; now supports a flag for - verbose output and a flag to ignore errors - with the same semantics as (for example) - &man.chmod.1;. - - For compatiblity with other implementations, &man.cp.1; now - supports a flag, which is equivalent to - specifying the flags. - - BSD-licensed version of &man.cpio.1; based on - libarchive, has replaced the GNU cpio. - Note that the GNU cpio is still installed as - gcpio. - - The &man.env.1; program now supports - which will completely unset the given variable - name by removing it from the environment, - instead of just setting it to a null value. - - The &man.fdopendir.3; library function has been added. - - The &man.fetch.3; library now support HTTP 1.1 - If-Modified-Since behavior. The &man.fetch.1; program now - supports - which will only download the specified HTTP URL if the content - is newer than filename. - - &man.find.1; has been enhanced by the addition of a number - of primaries that were present in GNU find but not &os; - &man.find.1;. - - &man.jexec.8; now supports option to specify the - jail where the command will be executed. - - &man.kgdb.1; now supports a new add-kld - command to make it easier to debug crash dumps with kernel - modules. - - The &man.ls.1; program now supports a - option to specify a date format string to be used with the long - format () output. - - &man.nc.1; now supports a switch to - disable the use of TCP options. - - The &man.ping6.8; utility now returns 2 - when the packet transmission was successful but no responses - were received (this is the same behavior as &man.ping.8;). - It returned a non-zero value before this change. - - The &man.procstat.1; utility has been added to display - detailed information about processes. - - The &man.realpath.1; utility now supports - a flag to suppress warnings; it now also - accepts multiple paths on its command line. - - The &man.split.1; utility now supports a - flag to split a file into a certain number of chunks. - - The &man.tar.1; utility now supports a - flag to enable &man.compress.1;-style - compression/decompression. - - The &man.tar.1; utility now supports a - flag to ignore user/group names - on create and extract. - - The &man.tar.1; utility now supports an - flag to sparsify files on extraction. - - The &man.tar.1; utility now supports a - flag to substitute filenames based on the specified regular - expression. - - The &man.tcgetsid.3; library function has been added to - return the process group ID for the session leader for the - controlling terminal. It is defined in IEEE Std 1003.1-2001 - (POSIX). - - &man.top.1; now supports a flag to - provide per-CPU usage statistics. - - &man.zdump.8; is now working properly on 64 bit architectures. - - - &man.traceroute.8; now has the ability to print the AS - number for each hop with the new switch; a - new option allows selecting a particular - WHOIS server. - - &man.traceroute6.8; now supports a flag - to send probe packets with no upper-layer protocol, rather than - the usual UDP probe packets. - - - <filename>/etc/rc.d</filename> Scripts - - - - - - - - Contributed Software - - AMD has been updated from 6.0.10 - to 6.1.5. - - awk has been updated from 1 May - 2007 release to the 23 October 2007 release. - - bzip2 has been updated from 1.0.4 - to 1.0.5. - - CVS has been updated from 1.11.17 - to a post-1.11.22 snapshot from 10 March 2008. - - FILE has been updated from 4.23 - to 5.03. - - hostapd has been - updated from 0.5.8 to 0.5.10. - - IPFilter has been updated from - 4.1.23 to 4.1.28. - - less has been updated from - v408 to v429. - - ncurses has been updated from - 5.6-20061217 to 5.6-20080503. - - OpenSSH has been updated - from 4.5p1 to 5.1p1. - - OpenPAM has been updated from the - Figwort release to the Hydrangea release. - - sendmail has been updated from - 8.14.1 to 8.14.3. - - The timezone database has been updated from - the tzdata2008h release to - the tzdata2009j release. - - The stdtime part of libc, &man.zdump.8 and &man.zic.8 - have been updated from the tzcode2004a - release to the tzcode2009h release. - If you have upgraded from source or via the &man.freebsd-update.8, - then please run &man.tzsetup.8 to install a new /etc/localtime. - - - WPA Supplicant has been - updated from 0.5.8 to 0.5.10. - - - - - Ports/Packages Collection Infrastructure - - The &man.pkg.create.1; utility now supports - . When this option is specified and a - package tarball exists, it will not be overwritten. This is - useful when multiple packages are saved with several consecutive - runs of &man.pkg.create.1; with the - options. - - The pkg_sign and pkg_check utilities for cryptographically - signing &os; packages have been removed. They were only useful - for packages compressed using &man.gzip.1;; however - &man.bzip2.1; compression has been the norm for some time - now. - - - - - Release Engineering and Integration - - The supported version of - the GNOME desktop environment - (x11/gnome2) has been - updated from 2.20.1 to 2.22. - - - - - Documentation - - - - - - - - Upgrading from previous releases of &os; + + What's New - Beginning with &os; 6.2-RELEASE, - binary upgrades between RELEASE versions (and snapshots of the - various security branches) are supported using the - &man.freebsd-update.8; utility. The binary upgrade procedure will - update unmodified userland utilities, as well as unmodified GENERIC or - SMP kernels distributed as a part of an official &os; release. - The &man.freebsd-update.8; utility requires that the host being - upgraded have Internet connectivity. - - An older form of binary upgrade is supported through the - Upgrade option from the main &man.sysinstall.8; - menu on CDROM distribution media. This type of binary upgrade - may be useful on non-&arch.i386;, non-&arch.amd64; machines - or on systems with no Internet connectivity. - - Source-based upgrades (those based on recompiling the &os; - base system from source code) from previous versions are - supported, according to the instructions in - /usr/src/UPDATING. - - - Upgrading &os; should, of course, only be attempted after - backing up all data and configuration - files. - - + This section describes the most user-visible new or changed + features in &os; since &release.prev;, and changes shown in + Release Notes for the previous releases are marked as + [7.1R] and [7.2R]. + + Typical release note items document recent security + advisories issued after &release.prev;, new drivers or hardware + support, new commands or options, major bug fixes, or + contributed software upgrades. They may also list changes to + major ports/packages or release engineering practices. Clearly + the release notes cannot list every single change made to &os; + between releases; this document focuses primarily on security + advisories, user-visible changes, and major architectural + improvements. + + + Security Advisories + + Problems described in the following security advisories have + been fixed. For more information, consult the individual + advisories available from + . + + + + + + + + + Advisory + Date + Topic + + + + + + SA-08:05.openssh + 17 April 2008 + OpenSSH X11-forwarding privilege escalation + + + + SA-08:06.bind + 13 July 2008 + DNS cache poisoning + + + + SA-08:07.amd64 + 3 September 2008 + amd64 swapgs local privilege escalation + + + + SA-08:08.nmount + 3 September 2008 + &man.nmount.2; local arbitrary code execution + + + + SA-08:09.icmp6 + 3 September 2008 + Remote kernel panics on IPv6 connections + + + + SA-08:10.nd6 + 1 October 2008 + IPv6 Neighbor Discovery Protocol routing vulnerability + + + + SA-08:11.arc4random + 24 November 2008 + &man.arc4random.9; predictable sequence vulnerability + + + + SA-08:12.ftpd + 23 December 2008 + Cross-site request forgery in &man.ftpd.8; + + + + SA-08:13.protosw + 23 December 2008 + netgraph / bluetooth privilege escalation + + + + SA-09:01.lukemftpd + 07 January 2009 + Cross-site request forgery in + &man.lukemftpd.8; + + + + SA-09:02.openssl + 07 January 2009 + OpenSSL incorrectly checks for malformed + signatures + + + + SA-09:03.ntpd + 13 January 2009 + ntpd cryptographic signature + bypass + + + + SA-09:04.bind + 13 January 2009 + BIND DNSSEC incorrect checks for + malformed signatures + + + + SA-09:05.telnetd + 16 February 2009 + telnetd code execution + vulnerability + + + + SA-09:06.ktimer + 23 March 2009 + Local privilege escalation + + + + SA-09:07.libc + 04 April 2009 + Information leak in &man.db.3; + + + + SA-09:08.openssl + 22 April 2009 + Remotely exploitable crash in + OpenSSL + + + + SA-09:09.pipe + 10 June 2009 + Local information disclosure via direct pipe writes + + + + SA-09:10.ipv6 + 10 June 2009 + Missing permission check on SIOCSIFINFO_IN6 ioctl + + + + SA-09:11.ntpd + 10 June 2009 + ntpd stack-based buffer-overflow vulnerability + + + + SA-09:12.bind + 29 July 2009 + BIND &man.named.8; dynamic update message remote DoS + + + SA-09:14.devfs + 2 Oct 2009 + Devfs / VFS NULL pointer race condition + + + + + + + + Kernel Changes + + The &os; GENERIC kernel now + includes Trusted BSD MAC (Mandatory Access Control) support. + No MAC policy module is loaded by default. + + A loader + tunable hw.clflush_disable has been added + to avoid panic (trap 9) + at map_invalidate_cache_range() even if + Intel CPU is used. This tunable can be set + to -1 (default), 0 and + 1. The -1 is same as + the current behavior, which automatically + disables CLFLUSH on Intel CPUs without + CPUID_SS (this should occurr on Xen + only). You can specify 1 when this panic + happens on non-Intel CPUs (such as AMD's). Because disabling + CLFLUSH can reduce performance, you can try + with setting 0 on Intel CPUs + without SS to + use CLFLUSH feature. + + The &os; newbus subsystem is now MPSAFE. + + The &man.jail.8; subsystem has been updated. Changes include: + + + + A new virtualization container + named vimage has been implemented. This is + not enabled by default. To enable this, add the following + kernel options to your kernel configuration file and + rebuild the kernel: + + options VIMAGE + + Note that options SCTP in the + GENERIC kernel is not compatible with + options VIMAGE. This limitation will + be fixed in the next release. + + The vimage is a jail with a virtualized instance of + the &os; network stack. It can be created by using + &man.jail.8; command like this: + + &prompt.root; jail -c vnet name=vnet1 host.hostname=vnet1.example.net path=/ persist + + The vimage has own loopback interface and a separated + network stack including the L3 routing tables. Network + interfaces on the system can be moved by using + &man.ifconfig.8; option between the + different vimage jails and outside of them. + + Furthermore, the &man.epair.4; pseudo-interface driver + has been added to help communication between vimage jails. + It emulates a pair of back-to-back connected Ethernet + interfaces. For example, the following commands create an + interface pair of &man.epair.4;: + + &prompt.root; ifconfig epair0 create +epair0a +&prompt.root; ifconfig epair0a +epair0a: flags=8842<BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500 + ether 02:c0:64:00:07:0a +&prompt.root; ifconfig epair0b +epair0b: flags=8842<BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500 + ether 02:c0:64:00:08:0b + + The &man.epair.4; pseudo-interfaces and any physical + interfaces on the system can be moved between vimage jails + by using &man.ifconfig.8; option as + described above. Even after half of an &man.epair.4; pair + is moved, the back-to-back connection still valid and can + be used for inter-jail communication. + + Note that vimage is still considered as an + experimental feature. + + + + A jail can now have arbitrary named parameters similar + to environmental variables and the fixed jail parameters + in the previous releases have been replaced with them. + The jail name can now be used for identifying the jail in + &man.jexec.8; and &man.killall.1;. + + + + Multiple IPv4 and/or IPv6 addresses per jail are now + supported. It is even possible to have jails without + an IP address at all, which basically gives one a chrooted + environment with restricted process view and no + networking. + + + + SCTP (&man.sctp.4;) with IPv6 in jails has been + implemented. + + + + Specific CPU binding by using &man.cpuset.1; has been + implemented. Note that the current implementation allows + the superuser inside of the jail to change the CPU + bindings specified. + + + + A &man.jail.8; can start with a specific route + FIB now. + + + + The &man.ddb.8; kernel debugger now supports a + show jails subcommand. + + + + Compatibility support which permits 32-bit jail + binaries to be used on 64-bit systems to manage jails has + been added. + + + + Note that both version numbers of + jail and prison in + the &man.jail.8; have been updated for the new + features. + + + + The &man.ksyms.4;, kernel symbol table + interface driver has been added. It creates a character + device /dev/ksyms and provides + read-only access to a snapshot of the kernel symbol + table. + + The &os; Linux emulation + layer has been updated to version 2.6.16 and the default Linux + infrastructure port is + emulators/linux_base-f10 (Fedora + 10). + + The &os; virtual memory + subsystem now supports fully transparent use of + superpages for application memory; + application memory pages are dynamically promoted to or + demoted from superpages without any modification to + application code. This change offers the benefit of large + page sizes such as improved virtual memory efficiency and + reduced TLB (translation lookaside buffer) misses without + downsides like application changes and virtual memory + inflexibility. This can be enabled by setting a loader tunable + vm.pmap.pg_ps_enabled to + 1 and is enabled by default on + &arch.amd64;. + + The &man.ddb.8; kernel debugger now supports a + show mount subcommand. + + The &os; DTrace subsystem now supports a probe for + process execution. + + The &os; kernel virtual address + space has been increased to 6GB. This allows subsystems to use + larger virtual memory space than before. For example, the + &man.zfs.8; adaptive replacement cache (ARC) requires large + kernel memory space to cache file system data, so it benefits + from the increased address space. Note that the ceiling on + the kernel map size is now 60% of the size of physical memory + rather than an absolute quantity. + + The &man.kld.4; now supports installing 32-bit + system calls to the &os; syscall translation layer from kernel + modules. + + The &man.ktr.4; now supports a new KTR tracepoint in the + KTR_CALLOUT class to note when a callout + routine finishes executing. + + Types of variables used to track the amount of allocated + System V shared memory have been changed from + int to size_t. This + makes it possible to use more than 2 GB of memory for shared + memory segments on 64-bit architectures. Please note the new + BUGS section in &man.shmctl.2; and + /usr/src/UPDATING for limitations of this + temporary solution. + + The &man.sysctl.3; leaf nodes have a flag to tag + themselves as MPSAFE now. + + The &os; 32-bit system call translation layer now + supports installing 32-bit system calls for + VFS_AIO. + + The &man.clock.gettime.2; and the related system calls now + support a clock ID CLOCK_THREAD_CPUTIME_ID, + as defined in POSIX. + + The &man.cpuset.2; system call has been added. This is an + API for thread to CPU binding and CPU resource grouping and + assignment. + + The DTrace, a comprehensive dynamic tracing framework and + &man.dtrace.1; userland utility have been imported from + OpenSolaris. DTrace provides a powerful infrastructure to + permit administrators, developers, and service personnel to + concisely answer arbitrary questions about the behavior of the + operating system and user programs. + + The &man.ddb.4; kernel debugger now has an output capture + facility. Input and output from &man.ddb.4; can now be captured + to a memory buffer for later inspection using &man.sysctl.8; or + a textdump. The new capture command controls + this feature. + + The &man.ddb.4; debugger now supports a simple scripting + facility, which supports a set of named scripts consisting of a + set of &man.ddb.4; commands. These commands can be managed from + within &man.ddb.4; or with the use of the new &man.ddb.8; + utility. More details can be found in the &man.ddb.4; manual + page. + + The &man.ddb.4; ex command now supports + an mode which interprets and prints the + value at the requested address as a symbol. For example, + ex /S aio_swake + prints the name of the function currently registered in + via aio_swake hook. + + The &man.ddb.4; show conifhk command has + been added. This lists hooks currently waiting for completion + in run_interrupt_driven_config_hooks(). + + The &man.fcntl.2; system call now supports + F_DUP2FD command. This is equivalent to + &man.dup.2;, and compatible with the Sun Solaris and the IBM + AIX. + + The &os;'s &man.linux.4; ABI support now implements + sched_setaffinity() and + sched_getaffinity() using real CPU affinity + setting primitives. + + The &man.procstat.1; utility has been added. This is a + process inspection utility which provides some of the missing + functionality from &man.procfs.5; and new functionality for monitoring + and debugging specific processes. + + The client side functionality of &man.rpc.lockd.8; has been + implemented in the &os; kernel. This implementation provides the + correct semantics for &man.flock.2; style locks which are used + by the &man.lockf.1; command line tool and the &man.pidfile.3; + library. It also implements recovery from server restarts and + ensures that dirty cache blocks are written to the server before + obtaining locks (allowing multiple clients to use file locking + to safely share data). Also, a new kernel option + options NFSLOCKD has been added and enabled + by default. If the kernel support is enabled, &man.rpc.lockd.8; + automatically detects and uses the functionality. + + The &os; kernel now supports a new textdump format of kernel + dumps. A textdump provides higher-level information via + mechanically generated/extracted debugging output, rather than a + simple memory dump. This facility can be used to generate brief + kernel bug reports that are rich in debugging information, but + are not dependent on kernel symbol tables or precisely + synchronized source code. More information can be found in the + &man.textdump.4; manual page. + + The &man.wait4.2; system call now supports + flag to keep the process whose status + is returned in a waitable state and + which is equivalent to . + + The &os; kernel now has + initial support of binding interrupts to CPUs. + + The &man.sched.ule.4; scheduler is now the default + process scheduler in GENERIC + kernels. + + The sysctl + variables kern.features.compat_freebsd[456] + have been added. These are corresponding to the kernel options + COMPAT_FREEBSD[456]. + + + Boot Loader Changes + + The boot0 boot + loader now preserves volume ID at offset + 0x1b8 used in other operating systems + + The &man.boot0cfg.8; utility now supports a + new option to set the volume ID. + + The &man.boot.8; now supports 4-byte volume ID that *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Thu Nov 26 21:14:11 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 66C651065676; Thu, 26 Nov 2009 21:14:11 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5496F8FC1C; Thu, 26 Nov 2009 21:14:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAQLE9RP093312; Thu, 26 Nov 2009 21:14:09 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAQLE9BO093310; Thu, 26 Nov 2009 21:14:09 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <200911262114.nAQLE9BO093310@svn.freebsd.org> From: Hiroki Sato Date: Thu, 26 Nov 2009 21:14:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199848 - stable/8/release/doc/en_US.ISO8859-1/relnotes X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Nov 2009 21:14:11 -0000 Author: hrs Date: Thu Nov 26 21:14:09 2009 New Revision: 199848 URL: http://svn.freebsd.org/changeset/base/199848 Log: Remove newbus MPSAFE entry; it was reverted. Spotted by: attilio Modified: stable/8/release/doc/en_US.ISO8859-1/relnotes/article.sgml Modified: stable/8/release/doc/en_US.ISO8859-1/relnotes/article.sgml ============================================================================== --- stable/8/release/doc/en_US.ISO8859-1/relnotes/article.sgml Thu Nov 26 20:55:44 2009 (r199847) +++ stable/8/release/doc/en_US.ISO8859-1/relnotes/article.sgml Thu Nov 26 21:14:09 2009 (r199848) @@ -329,8 +329,6 @@ without SS to use CLFLUSH feature. - The &os; newbus subsystem is now MPSAFE. - The &man.jail.8; subsystem has been updated. Changes include: From owner-svn-src-all@FreeBSD.ORG Thu Nov 26 21:29:03 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8B1A01065676; Thu, 26 Nov 2009 21:29:03 +0000 (UTC) (envelope-from marck@rinet.ru) Received: from woozle.rinet.ru (woozle.rinet.ru [195.54.192.68]) by mx1.freebsd.org (Postfix) with ESMTP id 0A6608FC18; Thu, 26 Nov 2009 21:29:02 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by woozle.rinet.ru (8.14.3/8.14.3) with ESMTP id nAQLT1RG091690; Fri, 27 Nov 2009 00:29:01 +0300 (MSK) (envelope-from marck@rinet.ru) Date: Fri, 27 Nov 2009 00:29:01 +0300 (MSK) From: Dmitry Morozovsky To: Hiroki Sato In-Reply-To: <200911262055.nAQKtijU092885@svn.freebsd.org> Message-ID: References: <200911262055.nAQKtijU092885@svn.freebsd.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) X-NCC-RegID: ru.rinet X-OpenPGP-Key-ID: 6B691B03 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.3 (woozle.rinet.ru [0.0.0.0]); Fri, 27 Nov 2009 00:29:01 +0300 (MSK) Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org Subject: Re: svn commit: r199847 - in stable/8/release/doc: en_US.ISO8859-1/relnotes en_US.ISO8859-1/share/sgml share/sgml X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Nov 2009 21:29:03 -0000 Hiroki-san, On Thu, 26 Nov 2009, Hiroki Sato wrote: HS> Author: hrs HS> Date: Thu Nov 26 20:55:44 2009 HS> New Revision: 199847 HS> URL: http://svn.freebsd.org/changeset/base/199847 HS> HS> Log: HS> Add entries of Release Notes for 8.0R temporarily. Was two-spaces-after-centense changes intentional? HS> - branch since &release.branch; was created. Information regarding pre-built, binary HS> + branch since &release.branch; was created. Information regarding pre-built, binary [snip] -- Sincerely, D.Marck [DM5020, MCK-RIPE, DM3-RIPN] [ FreeBSD committer: marck@FreeBSD.org ] ------------------------------------------------------------------------ *** Dmitry Morozovsky --- D.Marck --- Wild Woozle --- marck@rinet.ru *** ------------------------------------------------------------------------ From owner-svn-src-all@FreeBSD.ORG Thu Nov 26 21:31:55 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7A2DC1065692; Thu, 26 Nov 2009 21:31:55 +0000 (UTC) (envelope-from gabor@FreeBSD.org) Received: from server.mypc.hu (server.mypc.hu [87.229.73.95]) by mx1.freebsd.org (Postfix) with ESMTP id 00BCD8FC14; Thu, 26 Nov 2009 21:31:54 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by server.mypc.hu (Postfix) with ESMTP id 1484B14D9D48; Thu, 26 Nov 2009 22:31:53 +0100 (CET) X-Virus-Scanned: amavisd-new at example.com Received: from server.mypc.hu ([127.0.0.1]) by localhost (server.mypc.hu [127.0.0.1]) (amavisd-new, port 10024) with LMTP id u58KBu--P4uM; Thu, 26 Nov 2009 22:31:50 +0100 (CET) Received: from [192.168.1.105] (catv-89-132-179-104.catv.broadband.hu [89.132.179.104]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by server.mypc.hu (Postfix) with ESMTPSA id 839D714D9C7A; Thu, 26 Nov 2009 22:31:50 +0100 (CET) Message-ID: <4B0EF3C2.3020605@FreeBSD.org> Date: Thu, 26 Nov 2009 22:31:46 +0100 From: Gabor Kovesdan User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Dmitry Morozovsky References: <200911262055.nAQKtijU092885@svn.freebsd.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, Hiroki Sato , src-committers@freebsd.org, svn-src-stable-8@freebsd.org Subject: Re: svn commit: r199847 - in stable/8/release/doc: en_US.ISO8859-1/relnotes en_US.ISO8859-1/share/sgml share/sgml X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Nov 2009 21:31:55 -0000 Dmitry Morozovsky escribió: > Hiroki-san, > > On Thu, 26 Nov 2009, Hiroki Sato wrote: > > HS> Author: hrs > HS> Date: Thu Nov 26 20:55:44 2009 > HS> New Revision: 199847 > HS> URL: http://svn.freebsd.org/changeset/base/199847 > HS> > HS> Log: > HS> Add entries of Release Notes for 8.0R temporarily. > > Was two-spaces-after-centense changes intentional? > This is the convention suggested by fdp-primer, so I think it was. -- Gabor Kovesdan FreeBSD Volunteer EMAIL: gabor@FreeBSD.org .:|:. gabor@kovesdan.org WEB: http://people.FreeBSD.org/~gabor .:|:. http://kovesdan.org From owner-svn-src-all@FreeBSD.ORG Thu Nov 26 21:38:04 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E9CB1106566B; Thu, 26 Nov 2009 21:38:04 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from mail.allbsd.org (gatekeeper-int.allbsd.org [IPv6:2001:2f0:104:e002::2]) by mx1.freebsd.org (Postfix) with ESMTP id 6843A8FC23; Thu, 26 Nov 2009 21:38:04 +0000 (UTC) Received: from delta.allbsd.org (p3177-ipbf416funabasi.chiba.ocn.ne.jp [123.225.92.177]) (authenticated bits=128) by mail.allbsd.org (8.14.3/8.14.3) with ESMTP id nAQLbdZh046215; Fri, 27 Nov 2009 06:37:50 +0900 (JST) (envelope-from hrs@FreeBSD.org) Received: from localhost (alph.allbsd.org [192.168.0.10]) (authenticated bits=0) by delta.allbsd.org (8.13.4/8.13.4) with ESMTP id nAQLbZXm047330; Fri, 27 Nov 2009 06:37:38 +0900 (JST) (envelope-from hrs@FreeBSD.org) Date: Fri, 27 Nov 2009 06:36:12 +0900 (JST) Message-Id: <20091127.063612.93935806.hrs@allbsd.org> To: marck@rinet.ru From: Hiroki Sato In-Reply-To: References: <200911262055.nAQKtijU092885@svn.freebsd.org> X-PGPkey-fingerprint: BDB3 443F A5DD B3D0 A530 FFD7 4F2C D3D8 2793 CF2D X-Mailer: Mew version 6.3rc1 on Emacs 22.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Multipart/Signed; protocol="application/pgp-signature"; micalg=pgp-sha1; boundary="--Security_Multipart(Fri_Nov_27_06_36_12_2009_542)--" Content-Transfer-Encoding: 7bit X-Virus-Scanned: clamav-milter 0.95.3 at gatekeeper.allbsd.org X-Virus-Status: Clean X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.3 (mail.allbsd.org [133.31.130.32]); Fri, 27 Nov 2009 06:37:56 +0900 (JST) X-Spam-Status: No, score=-4.8 required=13.0 tests=AWL,BAYES_00, CONTENT_TYPE_PRESENT, SPF_SOFTFAIL, X_MAILER_PRESENT autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on gatekeeper.allbsd.org Cc: svn-src-stable@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, svn-src-stable-8@FreeBSD.org Subject: Re: svn commit: r199847 - in stable/8/release/doc: en_US.ISO8859-1/relnotes en_US.ISO8859-1/share/sgml share/sgml X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Nov 2009 21:38:05 -0000 ----Security_Multipart(Fri_Nov_27_06_36_12_2009_542)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Dmitry Morozovsky wrote in : ma> Hiroki-san, ma> ma> On Thu, 26 Nov 2009, Hiroki Sato wrote: ma> ma> HS> Author: hrs ma> HS> Date: Thu Nov 26 20:55:44 2009 ma> HS> New Revision: 199847 ma> HS> URL: http://svn.freebsd.org/changeset/base/199847 ma> HS> ma> HS> Log: ma> HS> Add entries of Release Notes for 8.0R temporarily. ma> ma> Was two-spaces-after-centense changes intentional? ma> ma> ma> HS> - branch since &release.branch; was created. Information regarding pre-built, binary ma> HS> + branch since &release.branch; was created. Information regarding pre-built, binary Gr, I just noticed malformed white-space changes by tabification were accidentally added, too :( I will fix them when I trim the items after 8.0R. Thanks for pointing out. -- Hiroki ----Security_Multipart(Fri_Nov_27_06_36_12_2009_542)-- Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iEYEABECAAYFAksO9MwACgkQTyzT2CeTzy0lhgCeP/W1dFBMyNWv1DABC0/aA9z6 FvgAmgMcT4mXniB5/2k8mLB9DvFHHoZ3 =E3bh -----END PGP SIGNATURE----- ----Security_Multipart(Fri_Nov_27_06_36_12_2009_542)---- From owner-svn-src-all@FreeBSD.ORG Thu Nov 26 21:39:05 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 933191065696; Thu, 26 Nov 2009 21:39:05 +0000 (UTC) (envelope-from marck@rinet.ru) Received: from woozle.rinet.ru (woozle.rinet.ru [195.54.192.68]) by mx1.freebsd.org (Postfix) with ESMTP id 0EEA98FC12; Thu, 26 Nov 2009 21:39:04 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by woozle.rinet.ru (8.14.3/8.14.3) with ESMTP id nAQLd2xg091867; Fri, 27 Nov 2009 00:39:02 +0300 (MSK) (envelope-from marck@rinet.ru) Date: Fri, 27 Nov 2009 00:39:02 +0300 (MSK) From: Dmitry Morozovsky To: Gabor Kovesdan In-Reply-To: <4B0EF3C2.3020605@FreeBSD.org> Message-ID: References: <200911262055.nAQKtijU092885@svn.freebsd.org> <4B0EF3C2.3020605@FreeBSD.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) X-NCC-RegID: ru.rinet X-OpenPGP-Key-ID: 6B691B03 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.3 (woozle.rinet.ru [0.0.0.0]); Fri, 27 Nov 2009 00:39:03 +0300 (MSK) Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, Hiroki Sato , src-committers@freebsd.org, svn-src-stable-8@freebsd.org Subject: Re: svn commit: r199847 - in stable/8/release/doc: en_US.ISO8859-1/relnotes en_US.ISO8859-1/share/sgml share/sgml X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Nov 2009 21:39:05 -0000 On Thu, 26 Nov 2009, Gabor Kovesdan wrote: GK> > HS> Date: Thu Nov 26 20:55:44 2009 GK> > HS> New Revision: 199847 GK> > HS> URL: http://svn.freebsd.org/changeset/base/199847 GK> > HS> HS> Log: GK> > HS> Add entries of Release Notes for 8.0R temporarily. GK> > GK> > Was two-spaces-after-centense changes intentional? GK> > GK> This is the convention suggested by fdp-primer, so I think it was. Hmm, http://www.freebsd.org/doc/en/books/fdp-primer/writing-style.html seems to disagree: Always use two spaces at the end of sentences, as this improves readability, and eases use of tools such as Emacs. -- Sincerely, D.Marck [DM5020, MCK-RIPE, DM3-RIPN] [ FreeBSD committer: marck@FreeBSD.org ] ------------------------------------------------------------------------ *** Dmitry Morozovsky --- D.Marck --- Wild Woozle --- marck@rinet.ru *** ------------------------------------------------------------------------ From owner-svn-src-all@FreeBSD.ORG Thu Nov 26 21:42:03 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6ACCE106566B; Thu, 26 Nov 2009 21:42:03 +0000 (UTC) (envelope-from gabor@FreeBSD.org) Received: from server.mypc.hu (server.mypc.hu [87.229.73.95]) by mx1.freebsd.org (Postfix) with ESMTP id 199E38FC12; Thu, 26 Nov 2009 21:42:03 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by server.mypc.hu (Postfix) with ESMTP id 2DDBC14D9D4C; Thu, 26 Nov 2009 22:42:02 +0100 (CET) X-Virus-Scanned: amavisd-new at example.com Received: from server.mypc.hu ([127.0.0.1]) by localhost (server.mypc.hu [127.0.0.1]) (amavisd-new, port 10024) with LMTP id WHLuFJz98KTq; Thu, 26 Nov 2009 22:41:59 +0100 (CET) Received: from [192.168.1.105] (catv-89-132-179-104.catv.broadband.hu [89.132.179.104]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by server.mypc.hu (Postfix) with ESMTPSA id B226614D9D49; Thu, 26 Nov 2009 22:41:59 +0100 (CET) Message-ID: <4B0EF624.3090106@FreeBSD.org> Date: Thu, 26 Nov 2009 22:41:56 +0100 From: Gabor Kovesdan User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Dmitry Morozovsky References: <200911262055.nAQKtijU092885@svn.freebsd.org> <4B0EF3C2.3020605@FreeBSD.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, Hiroki Sato , src-committers@freebsd.org, svn-src-stable-8@freebsd.org Subject: Re: svn commit: r199847 - in stable/8/release/doc: en_US.ISO8859-1/relnotes en_US.ISO8859-1/share/sgml share/sgml X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Nov 2009 21:42:03 -0000 Dmitry Morozovsky escribió: > On Thu, 26 Nov 2009, Gabor Kovesdan wrote: > > GK> > HS> Date: Thu Nov 26 20:55:44 2009 > GK> > HS> New Revision: 199847 > GK> > HS> URL: http://svn.freebsd.org/changeset/base/199847 > GK> > HS> HS> Log: > GK> > HS> Add entries of Release Notes for 8.0R temporarily. > GK> > > GK> > Was two-spaces-after-centense changes intentional? > GK> > > GK> This is the convention suggested by fdp-primer, so I think it was. > > Hmm, http://www.freebsd.org/doc/en/books/fdp-primer/writing-style.html seems to > disagree: > > Always use two spaces at the end of sentences, as this improves readability, > and eases use of tools such as Emacs. > Sorry, from your comment I thought he fixed the whitespaces to respect this rule but now I see it wasn't that. -- Gabor Kovesdan FreeBSD Volunteer EMAIL: gabor@FreeBSD.org .:|:. gabor@kovesdan.org WEB: http://people.FreeBSD.org/~gabor .:|:. http://kovesdan.org From owner-svn-src-all@FreeBSD.ORG Thu Nov 26 22:09:37 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CA2BF106566B; Thu, 26 Nov 2009 22:09:37 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B7C008FC0A; Thu, 26 Nov 2009 22:09:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAQM9b5L094356; Thu, 26 Nov 2009 22:09:37 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAQM9bGA094354; Thu, 26 Nov 2009 22:09:37 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <200911262209.nAQM9bGA094354@svn.freebsd.org> From: Hiroki Sato Date: Thu, 26 Nov 2009 22:09:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199849 - stable/8/release/doc/en_US.ISO8859-1/relnotes X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Nov 2009 22:09:37 -0000 Author: hrs Date: Thu Nov 26 22:09:37 2009 New Revision: 199849 URL: http://svn.freebsd.org/changeset/base/199849 Log: More items: - U-Boot support library for loader(8) (ARM, PowerPC) - multiprocessor (SMP) (PowerPC) - E500 (Book-E) embedded CPU support (PowerPC) - Freescale PowerQUICCIII MPC85xx system-on-chip support (single- and dual-core) (PowerPC) - Feroceon, Sheeva embedded CPU support - Marvell Orion (88F5281), Kirkwood (88F6281) and Discovery Innovation (MV-78100) systems-on-chip support (ARM) - DS133x and DS1553 RTC support - tsec(4) Gigabit Ethernet driver - mge(4) Gigabit Ethernet driver - kernel core dump support (PowerPC) - mini dump support (ARM) - gdbserver(1) support for (ARM, PowerPC) Submitted by: raj Modified: stable/8/release/doc/en_US.ISO8859-1/relnotes/article.sgml Modified: stable/8/release/doc/en_US.ISO8859-1/relnotes/article.sgml ============================================================================== --- stable/8/release/doc/en_US.ISO8859-1/relnotes/article.sgml Thu Nov 26 21:14:09 2009 (r199848) +++ stable/8/release/doc/en_US.ISO8859-1/relnotes/article.sgml Thu Nov 26 22:09:37 2009 (r199849) @@ -448,6 +448,12 @@ epair0b: flags=8842<BROADCAST,RUNNING emulators/linux_base-f10 (Fedora 10). + The &os;/&arch.arm; now + supports mini dump. + + The &os;/&arch.powerpc; now + supports kernel core dump. + The &os; virtual memory subsystem now supports fully transparent use of superpages for application memory; @@ -603,6 +609,9 @@ epair0b: flags=8842<BROADCAST,RUNNING The &man.boot0cfg.8; utility now supports a new option to set the volume ID. + The &man.loader.8; now + supports U-Boot support library. + The &man.boot.8; now supports 4-byte volume ID that certain versions of &windows; put into the MBR and invoking PXE by pressing the F6 key on some supported BIOSes. @@ -638,6 +647,23 @@ epair0b: flags=8842<BROADCAST,RUNNING The &os; now includes experimental support for &arch.mips; platform. + Support for RTC on Dallas Semiconductor chips + has been improved. The DS133x and DS1553 are now + supported. + + The &os;/&arch.arm; now supports + Feroceon and Sheeva embedded CPU, Marvell Orion (88F5281), + Kirkwood (88F6281), Discovery Innovation (MV-78100) + systems-on-chip CPU. + + The &os;/&arch.powerpc; now + supports SMP machines + + The &os;/&arch.powerpc; now + supports E500 (Book-E) embedded CPU and Freescale + PowerQUICCIII MPC85xx system-on-chip (including single and + dual-core). + The &man.acpi.4; subsystem now supports the System Resource Affinity Table (SRAT) used to describe affinity relationships between CPUs and memory, ACPI 3.0 fields in @@ -885,6 +911,12 @@ epair0b: flags=8842<BROADCAST,RUNNING + The mge(4) driver has + been added to provide support for Marvell Gigabit Ethernet + controllers found on ARM-based SOCs (Orion, Kirkwood, + Discovery), as well as on system controllers for PowerPC + processors (MV64430, MV6446x). + The &man.miibus.4; driver now supports the Marvell 88E3016. @@ -903,6 +935,11 @@ epair0b: flags=8842<BROADCAST,RUNNING The &man.nge.4; driver has been improved and now works on all platforms. + The tsec(4) driver has been added to + provide support for Freescale integrated Three-Speed + Ethernet Controller (TSEC). This driver also works with + the enhanced version of the controller (eTSEC). + The &man.uath.4; driver for USB wireless LAN adapter based on Atheros AR5005UG and AR5005UX chipsets has been added. The &man.uathload.8; utility, a firmware @@ -1736,6 +1773,9 @@ options NFSD # for NFS server + The &man.gdbserver.1; now supports &arch.arm; + and &arch.powerpc; platforms. + The &man.gpt.8; program has been removed in favor of &man.gpart.8;. From owner-svn-src-all@FreeBSD.ORG Thu Nov 26 22:35:27 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BF842106566C; Thu, 26 Nov 2009 22:35:27 +0000 (UTC) (envelope-from raj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ADE108FC22; Thu, 26 Nov 2009 22:35:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAQMZRYn094890; Thu, 26 Nov 2009 22:35:27 GMT (envelope-from raj@svn.freebsd.org) Received: (from raj@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAQMZRrC094888; Thu, 26 Nov 2009 22:35:27 GMT (envelope-from raj@svn.freebsd.org) Message-Id: <200911262235.nAQMZRrC094888@svn.freebsd.org> From: Rafal Jaworowski Date: Thu, 26 Nov 2009 22:35:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199850 - stable/8/sys/boot/uboot/common X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Nov 2009 22:35:27 -0000 Author: raj Date: Thu Nov 26 22:35:26 2009 New Revision: 199850 URL: http://svn.freebsd.org/changeset/base/199850 Log: MFC r199534: Provide an effective (relocated) address when building modules metadata. This lets modules loaded dynamically in loader(8) work for U-Boot-based platforms. Modified: stable/8/sys/boot/uboot/common/metadata.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/boot/uboot/common/metadata.c ============================================================================== --- stable/8/sys/boot/uboot/common/metadata.c Thu Nov 26 22:09:37 2009 (r199849) +++ stable/8/sys/boot/uboot/common/metadata.c Thu Nov 26 22:35:26 2009 (r199850) @@ -231,6 +231,7 @@ md_copymodules(vm_offset_t addr) struct preloaded_file *fp; struct file_metadata *md; int c; + vm_offset_t a; c = addr != 0; /* start with the first module on the list, should be the kernel */ @@ -240,7 +241,8 @@ md_copymodules(vm_offset_t addr) MOD_TYPE(addr, fp->f_type, c); if (fp->f_args) MOD_ARGS(addr, fp->f_args, c); - MOD_ADDR(addr, fp->f_addr, c); + a = fp->f_addr - __elfN(relocation_offset); + MOD_ADDR(addr, a, c); MOD_SIZE(addr, fp->f_size, c); for (md = fp->f_metadata; md != NULL; md = md->md_next) { if (!(md->md_type & MODINFOMD_NOCOPY)) From owner-svn-src-all@FreeBSD.ORG Fri Nov 27 00:21:17 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E9F161065676; Fri, 27 Nov 2009 00:21:17 +0000 (UTC) (envelope-from kensmith@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D91C48FC12; Fri, 27 Nov 2009 00:21:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAR0LHcf096843; Fri, 27 Nov 2009 00:21:17 GMT (envelope-from kensmith@svn.freebsd.org) Received: (from kensmith@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAR0LHWJ096841; Fri, 27 Nov 2009 00:21:17 GMT (envelope-from kensmith@svn.freebsd.org) Message-Id: <200911270021.nAR0LHWJ096841@svn.freebsd.org> From: Ken Smith Date: Fri, 27 Nov 2009 00:21:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199851 - stable/8/sys/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Nov 2009 00:21:18 -0000 Author: kensmith Date: Fri Nov 27 00:21:17 2009 New Revision: 199851 URL: http://svn.freebsd.org/changeset/base/199851 Log: 8.0-RELEASE is done, shift stable/8 to -STABLE designation. Modified: stable/8/sys/conf/newvers.sh Modified: stable/8/sys/conf/newvers.sh ============================================================================== --- stable/8/sys/conf/newvers.sh Thu Nov 26 22:35:26 2009 (r199850) +++ stable/8/sys/conf/newvers.sh Fri Nov 27 00:21:17 2009 (r199851) @@ -32,7 +32,7 @@ TYPE="FreeBSD" REVISION="8.0" -BRANCH="PRERELEASE" +BRANCH="STABLE" if [ "X${BRANCH_OVERRIDE}" != "X" ]; then BRANCH=${BRANCH_OVERRIDE} fi From owner-svn-src-all@FreeBSD.ORG Fri Nov 27 00:57:39 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 76808106568D; Fri, 27 Nov 2009 00:57:39 +0000 (UTC) (envelope-from ivoras@gmail.com) Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by mx1.freebsd.org (Postfix) with ESMTP id 61E3F8FC15; Fri, 27 Nov 2009 00:57:37 +0000 (UTC) Received: by ewy26 with SMTP id 26so1344941ewy.3 for ; Thu, 26 Nov 2009 16:57:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:from:date:x-google-sender-auth:message-id:subject:to:cc :content-type:content-transfer-encoding; bh=d4OifiW0aQ3VMuW9k9zrtTTGK3Gkgd4Nc+Ovh8UPX2M=; b=uAY5crOVkQquiLd7uhF+mj4wdHY3362UBu2563kDiCf7MQr9VB0DSbPeDdYkbyk3L6 Dgz7n4ZR06oU9/0mGjzG4ZfkN2H3RfoZ6+Ojuo0MDUMfNiLOVjXRMNO7w1mUGAZ/wm23 Yhe9O01/4PoMn6VJB0vsNwIdJR7/onicNN0r4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :content-transfer-encoding; b=J5fzVGx0VBwwyKrNT62I2S6YYPQlKK67YryTsb01jC8DS5noG7UZ7zcDgqNXjiswE2 Y7gJ3d1rDbYH/Yhv2752dAPlEjNVeYlhiO56P+DhnBb5TN0MZE2GDp/HLiUbb2UUL7w3 XtEog4+kW/mMht4Bu3w6osRMVo/kM8OElDzMM= MIME-Version: 1.0 Sender: ivoras@gmail.com Received: by 10.216.89.85 with SMTP id b63mr119320wef.175.1259283457156; Thu, 26 Nov 2009 16:57:37 -0800 (PST) In-Reply-To: <200911270021.nAR0LHWJ096841@svn.freebsd.org> References: <200911270021.nAR0LHWJ096841@svn.freebsd.org> From: Ivan Voras Date: Fri, 27 Nov 2009 01:57:17 +0100 X-Google-Sender-Auth: d2a03ea8059ccd12 Message-ID: <9bbcef730911261657pdd8c245pee43128a0f200eb3@mail.gmail.com> To: Ken Smith Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org Subject: Re: svn commit: r199851 - stable/8/sys/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Nov 2009 00:57:39 -0000 2009/11/27 Ken Smith : > Author: kensmith > Date: Fri Nov 27 00:21:17 2009 > New Revision: 199851 > URL: http://svn.freebsd.org/changeset/base/199851 > > Log: > =C2=A08.0-RELEASE is done, shift stable/8 to -STABLE designation. Thank you and congratulations! From owner-svn-src-all@FreeBSD.ORG Fri Nov 27 01:02:18 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0AC401065676; Fri, 27 Nov 2009 01:02:18 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EED2E8FC27; Fri, 27 Nov 2009 01:02:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAR12HIk097676; Fri, 27 Nov 2009 01:02:17 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAR12H0V097674; Fri, 27 Nov 2009 01:02:17 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <200911270102.nAR12H0V097674@svn.freebsd.org> From: Attilio Rao Date: Fri, 27 Nov 2009 01:02:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199852 - head/sys/i386/xen X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Nov 2009 01:02:18 -0000 Author: attilio Date: Fri Nov 27 01:02:17 2009 New Revision: 199852 URL: http://svn.freebsd.org/changeset/base/199852 Log: i386 has not (yet) any DEV_ATPIC conditional than axe it out from Xen version. No objections by: kmacy Modified: head/sys/i386/xen/exception.s Modified: head/sys/i386/xen/exception.s ============================================================================== --- head/sys/i386/xen/exception.s Fri Nov 27 00:21:17 2009 (r199851) +++ head/sys/i386/xen/exception.s Fri Nov 27 01:02:17 2009 (r199852) @@ -295,10 +295,6 @@ ENTRY(fork_trampoline) SUPERALIGN_TEXT MCOUNT_LABEL(bintr) -#ifdef DEV_ATPIC -#include -#endif - #ifdef DEV_APIC .data .p2align 4 From owner-svn-src-all@FreeBSD.ORG Fri Nov 27 02:45:51 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2E9E91065731; Fri, 27 Nov 2009 02:45:51 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 049458FC13; Fri, 27 Nov 2009 02:45:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAR2jow6099630; Fri, 27 Nov 2009 02:45:50 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAR2jof9099628; Fri, 27 Nov 2009 02:45:50 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <200911270245.nAR2jof9099628@svn.freebsd.org> From: Attilio Rao Date: Fri, 27 Nov 2009 02:45:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199853 - stable/8/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Nov 2009 02:45:51 -0000 Author: attilio Date: Fri Nov 27 02:45:50 2009 New Revision: 199853 URL: http://svn.freebsd.org/changeset/base/199853 Log: MFC r199227: Add the possibility for vfs.root.mountfrom tunable to accept a list of items rather than a single one. While there fix also a nit in a comment. Sponsored by: Sandvine Incorporated Modified: stable/8/sys/kern/vfs_mount.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/kern/vfs_mount.c ============================================================================== --- stable/8/sys/kern/vfs_mount.c Fri Nov 27 01:02:17 2009 (r199852) +++ stable/8/sys/kern/vfs_mount.c Fri Nov 27 02:45:50 2009 (r199853) @@ -104,13 +104,17 @@ struct vnode *rootvnode; * The root filesystem is detailed in the kernel environment variable * vfs.root.mountfrom, which is expected to be in the general format * - * :[] + * :[][ :[] ...] * vfsname := the name of a VFS known to the kernel and capable * of being mounted as root * path := disk device name or other data used by the filesystem * to locate its physical store * - * The environment variable vfs.root.mountfrom options is a comma delimited + * If the environment variable vfs.root.mountfrom is a space separated list, + * each list element is tried in turn and the root filesystem will be mounted + * from the first one that suceeds. + * + * The environment variable vfs.root.mountfrom.options is a comma delimited * set of string mount options. These mount options must be parseable * by nmount() in the kernel. */ @@ -1643,7 +1647,7 @@ vfs_opterror(struct vfsoptlist *opts, co void vfs_mountroot(void) { - char *cp, *options; + char *cp, *cpt, *options, *tmpdev; int error, i, asked = 0; options = NULL; @@ -1695,10 +1699,15 @@ vfs_mountroot(void) */ cp = getenv("vfs.root.mountfrom"); if (cp != NULL) { - error = vfs_mountroot_try(cp, options); + cpt = cp; + while ((tmpdev = strsep(&cpt, " \t")) != NULL) { + error = vfs_mountroot_try(tmpdev, options); + if (error == 0) { + freeenv(cp); + goto mounted; + } + } freeenv(cp); - if (!error) - goto mounted; } /* From owner-svn-src-all@FreeBSD.ORG Fri Nov 27 02:47:50 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 07E6E1065692; Fri, 27 Nov 2009 02:47:50 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EA5D58FC15; Fri, 27 Nov 2009 02:47:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAR2lnSp099720; Fri, 27 Nov 2009 02:47:49 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAR2lnKi099714; Fri, 27 Nov 2009 02:47:49 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <200911270247.nAR2lnKi099714@svn.freebsd.org> From: Attilio Rao Date: Fri, 27 Nov 2009 02:47:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199854 - stable/8/sys/dev/aic7xxx X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Nov 2009 02:47:50 -0000 Author: attilio Date: Fri Nov 27 02:47:49 2009 New Revision: 199854 URL: http://svn.freebsd.org/changeset/base/199854 Log: MFC r199260: Add sysctls in ahd(4) in order to keep track of different classes of errors. So far 3 different classes are present (correctable, uncorrectable and fatal) but more can be added easilly. Sponsored by: Sandvine Incorporated Modified: stable/8/sys/dev/aic7xxx/ahd_pci.c stable/8/sys/dev/aic7xxx/aic79xx.c stable/8/sys/dev/aic7xxx/aic79xx.h stable/8/sys/dev/aic7xxx/aic79xx_osm.c stable/8/sys/dev/aic7xxx/aic79xx_osm.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/aic7xxx/ahd_pci.c ============================================================================== --- stable/8/sys/dev/aic7xxx/ahd_pci.c Fri Nov 27 02:45:50 2009 (r199853) +++ stable/8/sys/dev/aic7xxx/ahd_pci.c Fri Nov 27 02:47:49 2009 (r199854) @@ -134,6 +134,7 @@ ahd_pci_attach(device_t dev) return (error); } + ahd_sysctl(ahd); ahd_attach(ahd); return (0); } @@ -198,6 +199,7 @@ ahd_pci_map_registers(struct ahd_softc * bus_release_resource(ahd->dev_softc, regs_type, regs_id, regs); regs = NULL; + AHD_CORRECTABLE_ERROR(ahd); } else { command &= ~PCIM_CMD_PORTEN; aic_pci_write_config(ahd->dev_softc, @@ -214,6 +216,7 @@ ahd_pci_map_registers(struct ahd_softc * if (regs == NULL) { device_printf(ahd->dev_softc, "can't allocate register resources\n"); + AHD_UNCORRECTABLE_ERROR(ahd); return (ENOMEM); } ahd->tags[0] = rman_get_bustag(regs); @@ -226,6 +229,7 @@ ahd_pci_map_registers(struct ahd_softc * if (regs2 == NULL) { device_printf(ahd->dev_softc, "can't allocate register resources\n"); + AHD_UNCORRECTABLE_ERROR(ahd); return (ENOMEM); } ahd->tags[1] = rman_get_bustag(regs2); Modified: stable/8/sys/dev/aic7xxx/aic79xx.c ============================================================================== --- stable/8/sys/dev/aic7xxx/aic79xx.c Fri Nov 27 02:45:50 2009 (r199853) +++ stable/8/sys/dev/aic7xxx/aic79xx.c Fri Nov 27 02:47:49 2009 (r199854) @@ -401,6 +401,7 @@ ahd_flush_qoutfifo(struct ahd_softc *ahd if (scb == NULL) { printf("%s: Warning - GSFIFO SCB %d invalid\n", ahd_name(ahd), scbid); + AHD_CORRECTABLE_ERROR(ahd); continue; } /* @@ -525,6 +526,7 @@ rescan_fifos: if (scb == NULL) { printf("%s: Warning - DMA-up and complete " "SCB %d invalid\n", ahd_name(ahd), scbid); + AHD_CORRECTABLE_ERROR(ahd); continue; } hscb_ptr = (uint8_t *)scb->hscb; @@ -546,6 +548,7 @@ rescan_fifos: if (scb == NULL) { printf("%s: Warning - Complete Qfrz SCB %d invalid\n", ahd_name(ahd), scbid); + AHD_CORRECTABLE_ERROR(ahd); continue; } @@ -563,6 +566,7 @@ rescan_fifos: if (scb == NULL) { printf("%s: Warning - Complete SCB %d invalid\n", ahd_name(ahd), scbid); + AHD_CORRECTABLE_ERROR(ahd); continue; } @@ -870,6 +874,7 @@ ahd_run_qoutfifo(struct ahd_softc *ahd) "(cmdcmplt)\nQOUTPOS = %d\n", ahd_name(ahd), scb_index, ahd->qoutfifonext); + AHD_CORRECTABLE_ERROR(ahd); ahd_dump_card_state(ahd); } else if ((completion->sg_status & SG_STATUS_VALID) != 0) { ahd_handle_scb_status(ahd, scb); @@ -897,9 +902,11 @@ ahd_handle_hwerrint(struct ahd_softc *ah error = ahd_inb(ahd, ERROR); for (i = 0; i < num_errors; i++) { - if ((error & ahd_hard_errors[i].errno) != 0) + if ((error & ahd_hard_errors[i].errno) != 0) { printf("%s: hwerrint, %s\n", ahd_name(ahd), ahd_hard_errors[i].errmesg); + AHD_UNCORRECTABLE_ERROR(ahd); + } } ahd_dump_card_state(ahd); @@ -990,6 +997,7 @@ ahd_handle_seqint(struct ahd_softc *ahd, ahd_name(ahd)); ahd_dump_card_state(ahd); ahd_reset_channel(ahd, 'A', /*Initiate Reset*/TRUE); + AHD_UNCORRECTABLE_ERROR(ahd); break; case STATUS_OVERRUN: { @@ -1005,6 +1013,7 @@ ahd_handle_seqint(struct ahd_softc *ahd, printf("SCB %d Packetized Status Overrun", scbid); ahd_dump_card_state(ahd); ahd_reset_channel(ahd, 'A', /*Initiate Reset*/TRUE); + AHD_UNCORRECTABLE_ERROR(ahd); break; } case CFG4ISTAT_INTR: @@ -1017,6 +1026,7 @@ ahd_handle_seqint(struct ahd_softc *ahd, if (scb == NULL) { ahd_dump_card_state(ahd); printf("CFG4ISTAT: Free SCB %d referenced", scbid); + AHD_FATAL_ERROR(ahd); panic("For safety"); } ahd_outq(ahd, HADDR, scb->sense_busaddr); @@ -1044,6 +1054,7 @@ ahd_handle_seqint(struct ahd_softc *ahd, case P_MESGIN: ahd_reset_channel(ahd, 'A', /*Initiate Reset*/TRUE); printf("%s: Issued Bus Reset.\n", ahd_name(ahd)); + AHD_UNCORRECTABLE_ERROR(ahd); break; case P_COMMAND: { @@ -1068,6 +1079,7 @@ ahd_handle_seqint(struct ahd_softc *ahd, scbid = ahd_get_scbptr(ahd); scb = ahd_lookup_scb(ahd, scbid); if (scb == NULL) { + AHD_CORRECTABLE_ERROR(ahd); printf("Invalid phase with no valid SCB. " "Resetting bus.\n"); ahd_reset_channel(ahd, 'A', @@ -1127,6 +1139,7 @@ ahd_handle_seqint(struct ahd_softc *ahd, #ifdef AHD_DEBUG if ((ahd_debug & AHD_SHOW_RECOVERY) != 0) { ahd_print_path(ahd, scb); + AHD_CORRECTABLE_ERROR(ahd); printf("Unexpected command phase from " "packetized target\n"); } @@ -1214,6 +1227,7 @@ ahd_handle_seqint(struct ahd_softc *ahd, && bus_phase != P_MESGOUT) { printf("ahd_intr: HOST_MSG_LOOP bad " "phase 0x%x\n", bus_phase); + AHD_CORRECTABLE_ERROR(ahd); /* * Probably transitioned to bus free before * we got here. Just punt the message. @@ -1316,6 +1330,7 @@ ahd_handle_seqint(struct ahd_softc *ahd, ahd_name(ahd), 'A', SCSIID_TARGET(ahd, ahd_inb(ahd, SAVED_SCSIID)), lastphase, ahd_inb(ahd, SCSISIGI)); + AHD_CORRECTABLE_ERROR(ahd); break; } case MISSED_BUSFREE: @@ -1328,6 +1343,7 @@ ahd_handle_seqint(struct ahd_softc *ahd, ahd_name(ahd), 'A', SCSIID_TARGET(ahd, ahd_inb(ahd, SAVED_SCSIID)), lastphase, ahd_inb(ahd, SCSISIGI)); + AHD_CORRECTABLE_ERROR(ahd); ahd_restart(ahd); return; } @@ -1387,6 +1403,7 @@ ahd_handle_seqint(struct ahd_softc *ahd, devinfo.lun); scbid = ahd_get_scbptr(ahd); scb = ahd_lookup_scb(ahd, scbid); + AHD_CORRECTABLE_ERROR(ahd); if (scb != NULL && (scb->flags & SCB_RECOVERY_SCB) != 0) /* @@ -1570,11 +1587,13 @@ ahd_handle_scsiint(struct ahd_softc *ahd printf("%s: SCSI offset overrun detected. Resetting bus.\n", ahd_name(ahd)); + AHD_CORRECTABLE_ERROR(ahd); ahd_reset_channel(ahd, 'A', /*Initiate Reset*/TRUE); } else if ((status & SCSIRSTI) != 0) { printf("%s: Someone reset channel A\n", ahd_name(ahd)); ahd_reset_channel(ahd, 'A', /*Initiate Reset*/FALSE); + AHD_UNCORRECTABLE_ERROR(ahd); } else if ((status & SCSIPERR) != 0) { /* Make sure the sequencer is in a safe location. */ @@ -1619,6 +1638,7 @@ ahd_handle_scsiint(struct ahd_softc *ahd "valid during SELTO scb(0x%x)\n", ahd_name(ahd), scbid); ahd_dump_card_state(ahd); + AHD_UNCORRECTABLE_ERROR(ahd); } else { struct ahd_devinfo devinfo; #ifdef AHD_DEBUG @@ -1654,6 +1674,7 @@ ahd_handle_scsiint(struct ahd_softc *ahd } else if (status3 != 0) { printf("%s: SCSI Cell parity error SSTAT3 == 0x%x\n", ahd_name(ahd), status3); + AHD_CORRECTABLE_ERROR(ahd); ahd_outb(ahd, CLRSINT3, status3); } else if ((lqistat1 & (LQIPHASE_LQ|LQIPHASE_NLQ)) != 0) { @@ -1712,6 +1733,7 @@ ahd_handle_scsiint(struct ahd_softc *ahd "during unexpected busfree\n", ahd_name(ahd), scbid, mode); packetized = 0; + AHD_CORRECTABLE_ERROR(ahd); } else packetized = (scb->flags & SCB_PACKETIZED) != 0; clear_fifo = 1; @@ -1856,6 +1878,7 @@ ahd_handle_transmission_error(struct ahd ahd_scsisigi_print(curphase, &cur_col, 50); ahd_perrdiag_print(perrdiag, &cur_col, 50); printf("\n"); + AHD_CORRECTABLE_ERROR(ahd); ahd_dump_card_state(ahd); } @@ -1864,6 +1887,7 @@ ahd_handle_transmission_error(struct ahd printf("%s: Gross protocol error during incoming " "packet. lqistat1 == 0x%x. Resetting bus.\n", ahd_name(ahd), lqistat1); + AHD_UNCORRECTABLE_ERROR(ahd); } ahd_reset_channel(ahd, 'A', /*Initiate Reset*/TRUE); return; @@ -1891,6 +1915,7 @@ ahd_handle_transmission_error(struct ahd */ ahd_outb(ahd, LQCTL2, LQIRETRY); printf("LQIRetry for LQICRCI_LQ to release ACK\n"); + AHD_CORRECTABLE_ERROR(ahd); } else if ((lqistat1 & LQICRCI_NLQ) != 0) { /* * We detected a CRC error in a NON-LQ packet. @@ -1942,6 +1967,7 @@ ahd_handle_transmission_error(struct ahd if (scb == NULL) { printf("%s: No SCB valid for LQICRC_NLQ. " "Resetting bus\n", ahd_name(ahd)); + AHD_UNCORRECTABLE_ERROR(ahd); ahd_reset_channel(ahd, 'A', /*Initiate Reset*/TRUE); return; } @@ -1999,9 +2025,11 @@ ahd_handle_lqiphase_error(struct ahd_sof && (ahd_inb(ahd, MDFFSTAT) & DLZERO) != 0) { if ((lqistat1 & LQIPHASE_LQ) != 0) { printf("LQIRETRY for LQIPHASE_LQ\n"); + AHD_CORRECTABLE_ERROR(ahd); ahd_outb(ahd, LQCTL2, LQIRETRY); } else if ((lqistat1 & LQIPHASE_NLQ) != 0) { printf("LQIRETRY for LQIPHASE_NLQ\n"); + AHD_CORRECTABLE_ERROR(ahd); ahd_outb(ahd, LQCTL2, LQIRETRY); } else panic("ahd_handle_lqiphase_error: No phase errors\n"); @@ -2010,6 +2038,7 @@ ahd_handle_lqiphase_error(struct ahd_sof ahd_unpause(ahd); } else { printf("Reseting Channel for LQI Phase error\n"); + AHD_CORRECTABLE_ERROR(ahd); ahd_dump_card_state(ahd); ahd_reset_channel(ahd, 'A', /*Initiate Reset*/TRUE); } @@ -2099,6 +2128,7 @@ ahd_handle_pkt_busfree(struct ahd_softc ahd_print_path(ahd, scb); printf("Probable outgoing LQ CRC error. " "Retrying command\n"); + AHD_CORRECTABLE_ERROR(ahd); } scb->crc_retry_count++; } else { @@ -2134,6 +2164,7 @@ ahd_handle_pkt_busfree(struct ahd_softc scb = ahd_lookup_scb(ahd, scbid); ahd_print_path(ahd, scb); printf("Unexpected PKT busfree condition\n"); + AHD_UNCORRECTABLE_ERROR(ahd); ahd_dump_card_state(ahd); ahd_abort_scbs(ahd, SCB_GET_TARGET(ahd, scb), 'A', SCB_GET_LUN(scb), SCB_GET_TAG(scb), @@ -2143,6 +2174,7 @@ ahd_handle_pkt_busfree(struct ahd_softc return (1); } printf("%s: Unexpected PKT busfree condition\n", ahd_name(ahd)); + AHD_UNCORRECTABLE_ERROR(ahd); ahd_dump_card_state(ahd); /* Restart the sequencer. */ return (1); @@ -2421,6 +2453,7 @@ ahd_handle_nonpkt_busfree(struct ahd_sof ahd_lookup_phase_entry(lastphase)->phasemsg, aborted, ahd_inw(ahd, PRGMCNT)); + AHD_UNCORRECTABLE_ERROR(ahd); ahd_dump_card_state(ahd); if (lastphase != P_BUSFREE) ahd_force_renegotiation(ahd, &devinfo); @@ -2456,6 +2489,7 @@ ahd_handle_proto_violation(struct ahd_so ahd_print_devinfo(ahd, &devinfo); printf("Target did not send an IDENTIFY message. " "LASTPHASE = 0x%x.\n", lastphase); + AHD_UNCORRECTABLE_ERROR(ahd); scb = NULL; } else if (scb == NULL) { /* @@ -2464,12 +2498,14 @@ ahd_handle_proto_violation(struct ahd_so */ ahd_print_devinfo(ahd, &devinfo); printf("No SCB found during protocol violation\n"); + AHD_UNCORRECTABLE_ERROR(ahd); goto proto_violation_reset; } else { aic_set_transaction_status(scb, CAM_SEQUENCE_FAIL); if ((seq_flags & NO_CDB_SENT) != 0) { ahd_print_path(ahd, scb); printf("No or incomplete CDB sent to device.\n"); + AHD_UNCORRECTABLE_ERROR(ahd); } else if ((ahd_inb_scbram(ahd, SCB_CONTROL) & STATUS_RCVD) == 0) { /* @@ -2484,6 +2520,7 @@ ahd_handle_proto_violation(struct ahd_so } else { ahd_print_path(ahd, scb); printf("Unknown protocol violation.\n"); + AHD_UNCORRECTABLE_ERROR(ahd); ahd_dump_card_state(ahd); } } @@ -2499,6 +2536,7 @@ proto_violation_reset: found = ahd_reset_channel(ahd, 'A', TRUE); printf("%s: Issued Channel %c Bus Reset. " "%d SCBs aborted\n", ahd_name(ahd), 'A', found); + AHD_UNCORRECTABLE_ERROR(ahd); } else { /* * Leave the selection hardware off in case @@ -2521,6 +2559,7 @@ proto_violation_reset: } printf("Protocol violation %s. Attempting to abort.\n", ahd_lookup_phase_entry(curphase)->phasemsg); + AHD_UNCORRECTABLE_ERROR(ahd); } } @@ -2602,6 +2641,7 @@ ahd_clear_critical_section(struct ahd_so "%s: First Instruction 0x%x now 0x%x\n", ahd_name(ahd), ahd_name(ahd), first_instr, seqaddr); + AHD_FATAL_ERROR(ahd); ahd_dump_card_state(ahd); panic("critical section loop"); } @@ -3566,6 +3606,7 @@ ahd_setup_initiator_msgout(struct ahd_so } else if (scb == NULL) { printf("%s: WARNING. No pending message for " "I_T msgin. Issuing NO-OP\n", ahd_name(ahd)); + AHD_CORRECTABLE_ERROR(ahd); ahd->msgout_buf[ahd->msgout_index++] = MSG_NOOP; ahd->msgout_len++; ahd->msg_type = MSG_TYPE_INITIATOR_MSGOUT; @@ -3596,6 +3637,7 @@ ahd_setup_initiator_msgout(struct ahd_so ahd->msgout_len++; ahd_print_path(ahd, scb); printf("Bus Device Reset Message Sent\n"); + AHD_CORRECTABLE_ERROR(ahd); /* * Clear our selection hardware in advance of * the busfree. We may have an entry in the waiting @@ -3615,6 +3657,7 @@ ahd_setup_initiator_msgout(struct ahd_so ahd_print_path(ahd, scb); printf("Abort%s Message Sent\n", (scb->hscb->control & TAG_ENB) != 0 ? " Tag" : ""); + AHD_CORRECTABLE_ERROR(ahd); /* * Clear our selection hardware in advance of * the busfree. We may have an entry in the waiting @@ -3638,6 +3681,7 @@ ahd_setup_initiator_msgout(struct ahd_so "does not have a waiting message\n"); printf("SCSIID = %x, target_mask = %x\n", scb->hscb->scsiid, devinfo->target_mask); + AHD_FATAL_ERROR(ahd); panic("SCB = %d, SCB Control = %x:%x, MSG_OUT = %x " "SCB flags = %x", SCB_GET_TAG(scb), scb->hscb->control, ahd_inb_scbram(ahd, SCB_CONTROL), ahd_inb(ahd, MSG_OUT), @@ -5129,9 +5173,11 @@ ahd_handle_devreset(struct ahd_softc *ah lun, AC_SENT_BDR, NULL); if (message != NULL - && (verbose_level <= bootverbose)) + && (verbose_level <= bootverbose)) { + AHD_CORRECTABLE_ERROR(ahd); printf("%s: %s on %c:%d. %d SCBs aborted\n", ahd_name(ahd), message, devinfo->channel, devinfo->target, found); + } } #ifdef AHD_TARGET_MODE @@ -5509,6 +5555,7 @@ ahd_reset(struct ahd_softc *ahd, int rei if (wait == 0) { printf("%s: WARNING - Failed chip reset! " "Trying to initialize anyway.\n", ahd_name(ahd)); + AHD_FATAL_ERROR(ahd); } ahd_outb(ahd, HCNTRL, ahd->pause); @@ -5630,6 +5677,7 @@ ahd_init_scbdata(struct ahd_softc *ahd) scb_data->maxhscbs = ahd_probe_scbs(ahd); if (scb_data->maxhscbs == 0) { printf("%s: No SCB space found\n", ahd_name(ahd)); + AHD_FATAL_ERROR(ahd); return (ENXIO); } @@ -6474,6 +6522,7 @@ ahd_init(struct ahd_softc *ahd) printf("%s: WARNING. Termination is not configured correctly.\n" "%s: WARNING. SCSI bus operations may FAIL.\n", ahd_name(ahd), ahd_name(ahd)); + AHD_CORRECTABLE_ERROR(ahd); } init_done: ahd_restart(ahd); @@ -6830,6 +6879,7 @@ ahd_default_config(struct ahd_softc *ahd if (ahd_alloc_tstate(ahd, ahd->our_id, 'A') == NULL) { printf("%s: unable to allocate ahd_tmode_tstate. " "Failing attach\n", ahd_name(ahd)); + AHD_FATAL_ERROR(ahd); return (ENOMEM); } @@ -6909,6 +6959,7 @@ ahd_parse_cfgdata(struct ahd_softc *ahd, if (ahd_alloc_tstate(ahd, ahd->our_id, 'A') == NULL) { printf("%s: unable to allocate ahd_tmode_tstate. " "Failing attach\n", ahd_name(ahd)); + AHD_FATAL_ERROR(ahd); return (ENOMEM); } @@ -7135,6 +7186,7 @@ ahd_pause_and_flushwork(struct ahd_softc if (maxloops == 0) { printf("Infinite interrupt loop, INTSTAT = %x", ahd_inb(ahd, INTSTAT)); + AHD_FATAL_ERROR(ahd); } ahd->qfreeze_cnt++; ahd_outw(ahd, KERNEL_QFREEZE_COUNT, ahd->qfreeze_cnt); @@ -7440,6 +7492,7 @@ ahd_search_qinfifo(struct ahd_softc *ahd if (scb == NULL) { printf("qinpos = %d, SCB index = %d\n", qinpos, ahd->qinfifo[qinpos]); + AHD_FATAL_ERROR(ahd); panic("Loop 1\n"); } @@ -8195,20 +8248,26 @@ ahd_handle_scsi_status(struct ahd_softc switch (SIU_PKTFAIL_CODE(siu)) { case SIU_PFC_NONE: printf("No packet failure found\n"); + AHD_UNCORRECTABLE_ERROR(ahd); break; case SIU_PFC_CIU_FIELDS_INVALID: printf("Invalid Command IU Field\n"); + AHD_UNCORRECTABLE_ERROR(ahd); break; case SIU_PFC_TMF_NOT_SUPPORTED: printf("TMF not supportd\n"); + AHD_UNCORRECTABLE_ERROR(ahd); break; case SIU_PFC_TMF_FAILED: printf("TMF failed\n"); + AHD_UNCORRECTABLE_ERROR(ahd); break; case SIU_PFC_INVALID_TYPE_CODE: printf("Invalid L_Q Type code\n"); + AHD_UNCORRECTABLE_ERROR(ahd); break; case SIU_PFC_ILLEGAL_REQUEST: + AHD_UNCORRECTABLE_ERROR(ahd); printf("Illegal request\n"); default: break; @@ -9281,6 +9340,7 @@ ahd_recover_commands(struct ahd_softc *a printf("%s: Recovery Initiated - Card was %spaused\n", ahd_name(ahd), was_paused ? "" : "not "); + AHD_CORRECTABLE_ERROR(ahd); ahd_dump_card_state(ahd); ahd_pause_and_flushwork(ahd); @@ -9507,6 +9567,7 @@ ahd_other_scb_timeout(struct ahd_softc * (scb->flags & SCB_OTHERTCL_TIMEOUT) != 0 ? " again\n" : "\n"); + AHD_UNCORRECTABLE_ERROR(ahd); newtimeout = aic_get_timeout(scb); scb->flags |= SCB_OTHERTCL_TIMEOUT; found = 0; @@ -9929,6 +9990,7 @@ ahd_handle_en_lun(struct ahd_softc *ahd, if (lstate != NULL) { xpt_print_path(ccb->ccb_h.path); printf("Lun already enabled\n"); + AHD_CORRECTABLE_ERROR(ahd); ccb->ccb_h.status = CAM_LUN_ALRDY_ENA; return; } Modified: stable/8/sys/dev/aic7xxx/aic79xx.h ============================================================================== --- stable/8/sys/dev/aic7xxx/aic79xx.h Fri Nov 27 02:45:50 2009 (r199853) +++ stable/8/sys/dev/aic7xxx/aic79xx.h Fri Nov 27 02:47:49 2009 (r199854) @@ -1061,6 +1061,27 @@ typedef enum { #define AHD_MODE_UNKNOWN_MSK AHD_MK_MSK(AHD_MODE_UNKNOWN) #define AHD_MODE_ANY_MSK (~0) +typedef enum { + AHD_SYSCTL_ROOT, + AHD_SYSCTL_SUMMARY, + AHD_SYSCTL_DEBUG, + AHD_SYSCTL_NUMBER +} ahd_sysctl_types_t; + +typedef enum { + AHD_ERRORS_CORRECTABLE, + AHD_ERRORS_UNCORRECTABLE, + AHD_ERRORS_FATAL, + AHD_ERRORS_NUMBER +} ahd_sysctl_errors_t; + +#define AHD_CORRECTABLE_ERROR(sc) \ + (((sc)->summerr[AHD_ERRORS_CORRECTABLE])++) +#define AHD_UNCORRECTABLE_ERROR(sc) \ + (((sc)->summerr[AHD_ERRORS_UNCORRECTABLE])++) +#define AHD_FATAL_ERROR(sc) \ + (((sc)->summerr[AHD_ERRORS_FATAL])++) + typedef uint8_t ahd_mode_state; typedef void ahd_callback_t (void *); @@ -1159,6 +1180,13 @@ struct ahd_softc { uint32_t cmdcmplt_total; /* + * Errors statistics and printouts. + */ + struct sysctl_ctx_list sysctl_ctx[AHD_SYSCTL_NUMBER]; + struct sysctl_oid *sysctl_tree[AHD_SYSCTL_NUMBER]; + u_int summerr[AHD_ERRORS_NUMBER]; + + /* * Card characteristics */ ahd_chip chip; Modified: stable/8/sys/dev/aic7xxx/aic79xx_osm.c ============================================================================== --- stable/8/sys/dev/aic7xxx/aic79xx_osm.c Fri Nov 27 02:45:50 2009 (r199853) +++ stable/8/sys/dev/aic7xxx/aic79xx_osm.c Fri Nov 27 02:47:49 2009 (r199854) @@ -77,6 +77,63 @@ static int ahd_create_path(struct ahd_so char channel, u_int target, u_int lun, struct cam_path **path); +static const char *ahd_sysctl_node_elements[] = { + "root", + "summary", + "debug" +}; + +static const char *ahd_sysctl_node_descriptions[] = { + "root error collection for aic79xx controllers", + "summary collection for aic79xx controllers", + "debug collection for aic79xx controllers" +}; + +static const char *ahd_sysctl_errors_elements[] = { + "Cerrors", + "Uerrors", + "Ferrors" +}; + +static const char *ahd_sysctl_errors_descriptions[] = { + "Correctable errors", + "Uncorrectable errors", + "Fatal errors" +}; + +static int +ahd_set_debugcounters(SYSCTL_HANDLER_ARGS) +{ + struct ahd_softc *sc; + int error, tmpv; + + tmpv = 0; + sc = arg1; + error = sysctl_handle_int(oidp, &tmpv, 0, req); + if (error != 0 || req->newptr == NULL) + return (error); + if (tmpv < 0 || tmpv >= AHD_ERRORS_NUMBER) + return (EINVAL); + sc->summerr[arg2] = tmpv; + return (0); +} + +static int +ahd_clear_allcounters(SYSCTL_HANDLER_ARGS) +{ + struct ahd_softc *sc; + int error, tmpv; + + tmpv = 0; + sc = arg1; + error = sysctl_handle_int(oidp, &tmpv, 0, req); + if (error != 0 || req->newptr == NULL) + return (error); + if (tmpv != 0) + bzero(sc->summerr, sizeof(sc->summerr)); + return (0); +} + static int ahd_create_path(struct ahd_softc *ahd, char channel, u_int target, u_int lun, struct cam_path **path) @@ -88,6 +145,48 @@ ahd_create_path(struct ahd_softc *ahd, c path_id, target, lun)); } +void +ahd_sysctl(struct ahd_softc *ahd) +{ + u_int i; + + for (i = 0; i < AHD_SYSCTL_NUMBER; i++) + sysctl_ctx_init(&ahd->sysctl_ctx[i]); + + ahd->sysctl_tree[AHD_SYSCTL_ROOT] = + SYSCTL_ADD_NODE(&ahd->sysctl_ctx[AHD_SYSCTL_ROOT], + SYSCTL_STATIC_CHILDREN(_hw), OID_AUTO, + device_get_nameunit(ahd->dev_softc), CTLFLAG_RD, 0, + ahd_sysctl_node_descriptions[AHD_SYSCTL_ROOT]); + SYSCTL_ADD_PROC(&ahd->sysctl_ctx[AHD_SYSCTL_ROOT], + SYSCTL_CHILDREN(ahd->sysctl_tree[AHD_SYSCTL_ROOT]), + OID_AUTO, "clear", CTLTYPE_UINT | CTLFLAG_RW, ahd, + 0, ahd_clear_allcounters, "IU", + "Clear all counters"); + + for (i = AHD_SYSCTL_SUMMARY; i < AHD_SYSCTL_NUMBER; i++) + ahd->sysctl_tree[i] = + SYSCTL_ADD_NODE(&ahd->sysctl_ctx[i], + SYSCTL_CHILDREN(ahd->sysctl_tree[AHD_SYSCTL_ROOT]), + OID_AUTO, ahd_sysctl_node_elements[i], + CTLFLAG_RD, 0, + ahd_sysctl_node_descriptions[i]); + + for (i = AHD_ERRORS_CORRECTABLE; i < AHD_ERRORS_NUMBER; i++) { + SYSCTL_ADD_UINT(&ahd->sysctl_ctx[AHD_SYSCTL_SUMMARY], + SYSCTL_CHILDREN(ahd->sysctl_tree[AHD_SYSCTL_SUMMARY]), + OID_AUTO, ahd_sysctl_errors_elements[i], + CTLFLAG_RD, &ahd->summerr[i], i, + ahd_sysctl_errors_descriptions[i]); + SYSCTL_ADD_PROC(&ahd->sysctl_ctx[AHD_SYSCTL_DEBUG], + SYSCTL_CHILDREN(ahd->sysctl_tree[AHD_SYSCTL_DEBUG]), + OID_AUTO, ahd_sysctl_errors_elements[i], + CTLFLAG_RW | CTLTYPE_UINT, ahd, i, + ahd_set_debugcounters, "IU", + ahd_sysctl_errors_descriptions[i]); + } +} + int ahd_map_int(struct ahd_softc *ahd) { Modified: stable/8/sys/dev/aic7xxx/aic79xx_osm.h ============================================================================== --- stable/8/sys/dev/aic7xxx/aic79xx_osm.h Fri Nov 27 02:45:50 2009 (r199853) +++ stable/8/sys/dev/aic7xxx/aic79xx_osm.h Fri Nov 27 02:47:49 2009 (r199854) @@ -51,6 +51,7 @@ #include #include #include +#include #define AIC_PCI_CONFIG 1 #include @@ -259,6 +260,7 @@ void ahd_platform_free(struct ahd_soft int ahd_map_int(struct ahd_softc *ahd); int ahd_attach(struct ahd_softc *); int ahd_softc_comp(struct ahd_softc *lahd, struct ahd_softc *rahd); +void ahd_sysctl(struct ahd_softc *ahd); int ahd_detach(device_t); #define ahd_platform_init(arg) From owner-svn-src-all@FreeBSD.ORG Fri Nov 27 03:55:43 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2FDA31065672; Fri, 27 Nov 2009 03:55:43 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1D66C8FC1B; Fri, 27 Nov 2009 03:55:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAR3thN3001318; Fri, 27 Nov 2009 03:55:43 GMT (envelope-from sobomax@svn.freebsd.org) Received: (from sobomax@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAR3tgqp001311; Fri, 27 Nov 2009 03:55:42 GMT (envelope-from sobomax@svn.freebsd.org) Message-Id: <200911270355.nAR3tgqp001311@svn.freebsd.org> From: Maxim Sobolev Date: Fri, 27 Nov 2009 03:55:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199855 - in head/sys/boot: forth i386/libi386 i386/loader pc98/loader X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Nov 2009 03:55:43 -0000 Author: sobomax Date: Fri Nov 27 03:55:42 2009 New Revision: 199855 URL: http://svn.freebsd.org/changeset/base/199855 Log: Add new loader console type: "spinconsole". This console selects the video console which doesn't take any input from keyboard and hides all output replacing it with ``spinning'' character (useful for embedded products and custom installations). Sponsored by: Sippy Software, Inc. Added: head/sys/boot/i386/libi386/spinconsole.c - copied, changed from r199821, head/sys/boot/i386/libi386/nullconsole.c Modified: head/sys/boot/forth/loader.conf.5 head/sys/boot/i386/libi386/Makefile head/sys/boot/i386/libi386/vidconsole.c head/sys/boot/i386/loader/conf.c head/sys/boot/pc98/loader/conf.c Modified: head/sys/boot/forth/loader.conf.5 ============================================================================== --- head/sys/boot/forth/loader.conf.5 Fri Nov 27 02:47:49 2009 (r199854) +++ head/sys/boot/forth/loader.conf.5 Fri Nov 27 03:55:42 2009 (r199855) @@ -180,10 +180,15 @@ serial port speed setting. .Dq comconsole selects serial console, .Dq vidconsole -selects the video console, and +selects the video console, .Dq nullconsole selects a mute console -(useful for systems with neither a video console nor a serial port). +(useful for systems with neither a video console nor a serial port), and +.Dq spinconsole +selects the video console which prevents any input and hides all output +replacing it with +.Dq spinning +character (useful for embedded products and such). .It Va kernel .Pq Dq Pa /boot/kernel/kernel .It Va loader_conf_files Modified: head/sys/boot/i386/libi386/Makefile ============================================================================== --- head/sys/boot/i386/libi386/Makefile Fri Nov 27 02:47:49 2009 (r199854) +++ head/sys/boot/i386/libi386/Makefile Fri Nov 27 03:55:42 2009 (r199855) @@ -8,7 +8,7 @@ SRCS= biosacpi.c bioscd.c biosdisk.c bio comconsole.c devicename.c elf32_freebsd.c \ elf64_freebsd.c \ i386_copy.c i386_module.c nullconsole.c pxe.c pxetramp.s \ - smbios.c time.c vidconsole.c amd64_tramp.S + smbios.c time.c vidconsole.c amd64_tramp.S spinconsole.c # Enable PXE TFTP or NFS support, not both. .if defined(LOADER_TFTP_SUPPORT) Copied and modified: head/sys/boot/i386/libi386/spinconsole.c (from r199821, head/sys/boot/i386/libi386/nullconsole.c) ============================================================================== --- head/sys/boot/i386/libi386/nullconsole.c Thu Nov 26 08:49:46 2009 (r199821, copy source) +++ head/sys/boot/i386/libi386/spinconsole.c Fri Nov 27 03:55:42 2009 (r199855) @@ -1,8 +1,8 @@ /*- - * nullconsole.c + * spinconsole.c * - * Author: Doug Ambrisko - * Copyright (c) 2000 Whistle Communications, Inc. + * Author: Maksym Sobolyev + * Copyright (c) 2009 Sippy Software, Inc. * All rights reserved. * * Subject to the following obligations and disclaimer of warranty, use and @@ -41,48 +41,66 @@ __FBSDID("$FreeBSD$"); #include #include -static void nullc_probe(struct console *cp); -static int nullc_init(int arg); -static void nullc_putchar(int c); -static int nullc_getchar(void); -static int nullc_ischar(void); - -struct console nullconsole = { - "nullconsole", - "null port", +extern void get_pos(int *x, int *y); +extern void curs_move(int *_x, int *_y, int x, int y); +extern void vidc_biosputchar(int c); + +static void spinc_probe(struct console *cp); +static int spinc_init(int arg); +static void spinc_putchar(int c); +static int spinc_getchar(void); +static int spinc_ischar(void); + +struct console spinconsole = { + "spinconsole", + "spin port", 0, - nullc_probe, - nullc_init, - nullc_putchar, - nullc_getchar, - nullc_ischar + spinc_probe, + spinc_init, + spinc_putchar, + spinc_getchar, + spinc_ischar }; static void -nullc_probe(struct console *cp) +spinc_probe(struct console *cp) { cp->c_flags |= (C_PRESENTIN | C_PRESENTOUT); } static int -nullc_init(int arg) +spinc_init(int arg) { return(0); } static void -nullc_putchar(int c) +spinc_putchar(int c) { + static int curx, cury; + static unsigned tw_chars = 0x5C2D2F7C; /* "\-/|" */ + static time_t lasttime; + time_t now; + + now = time(NULL); + if (now < (lasttime + 1)) + return; + lasttime = now; + get_pos(&curx, &cury); + if (curx > 0) + curs_move(&curx, &cury, curx - 1, cury); + vidc_biosputchar((char)tw_chars); + tw_chars = (tw_chars >> 8) | ((tw_chars & (unsigned long)0xFF) << 24); } static int -nullc_getchar(void) +spinc_getchar(void) { return(-1); } static int -nullc_ischar(void) +spinc_ischar(void) { return(0); } Modified: head/sys/boot/i386/libi386/vidconsole.c ============================================================================== --- head/sys/boot/i386/libi386/vidconsole.c Fri Nov 27 02:47:49 2009 (r199854) +++ head/sys/boot/i386/libi386/vidconsole.c Fri Nov 27 03:55:42 2009 (r199855) @@ -57,8 +57,8 @@ static int vidc_started; void end_term(void); void bail_out(int c); void vidc_term_emu(int c); -void get_pos(void); -void curs_move(int x, int y); +void get_pos(int *x, int *y); +void curs_move(int *_x, int *_y, int x, int y); void write_char(int c, int fg, int bg); void scroll_up(int rows, int fg, int bg); void CD(void); @@ -110,8 +110,8 @@ vidc_init(int arg) #ifdef TERM_EMU /* Init terminal emulator */ end_term(); - get_pos(); - curs_move(curx, cury); + get_pos(&curx, &cury); + curs_move(&curx, &cury, curx, cury); fg_c = DEFAULT_FGCOLOR; bg_c = DEFAULT_BGCOLOR; #endif @@ -120,7 +120,7 @@ vidc_init(int arg) return (0); /* XXX reinit? */ } -static void +void vidc_biosputchar(int c) { @@ -151,7 +151,7 @@ vidc_rawputchar(int c) return; case '\r': curx = 0; - curs_move(curx, cury); + curs_move(&curx, &cury, curx, cury); return; case '\n': cury++; @@ -159,13 +159,13 @@ vidc_rawputchar(int c) scroll_up(1, fg_c, bg_c); cury--; } else { - curs_move(curx, cury); + curs_move(&curx, &cury, curx, cury); } return; case '\b': if (curx > 0) { curx--; - curs_move(curx, cury); + curs_move(&curx, &cury, curx, cury); /* write_char(' ', fg_c, bg_c); XXX destructive(!) */ return; } @@ -183,7 +183,7 @@ vidc_rawputchar(int c) cury--; } } - curs_move(curx, cury); + curs_move(&curx, &cury, curx, cury); #endif } } @@ -194,7 +194,7 @@ vidc_rawputchar(int c) * curx and cury appropriately. */ void -get_pos(void) +get_pos(int *x, int *y) { v86.ctl = 0; @@ -202,13 +202,13 @@ get_pos(void) v86.eax = 0x0300; v86.ebx = 0x0; v86int(); - curx = v86.edx & 0x00ff; - cury = (v86.edx & 0xff00) >> 8; + *x = v86.edx & 0x00ff; + *y = (v86.edx & 0xff00) >> 8; } /* Move cursor to x rows and y cols (0-based). */ void -curs_move(int x, int y) +curs_move(int *_x, int *_y, int x, int y) { v86.ctl = 0; @@ -217,8 +217,8 @@ curs_move(int x, int y) v86.ebx = 0x0; v86.edx = ((0x00ff & y) << 8) + (0x00ff & x); v86int(); - curx = x; - cury = y; + *_x = x; + *_y = y; /* If there is ctrl char at this position, cursor would be invisible. * Make it a space instead. */ @@ -277,7 +277,7 @@ void CD(void) { - get_pos(); + get_pos(&curx, &cury); if (curx > 0) { v86.ctl = 0; v86.addr = 0x10; @@ -312,7 +312,7 @@ CM(void) args[0]--; if (args[1] > 0) args[1]--; - curs_move(args[1], args[0]); + curs_move(&curx, &cury, args[1], args[0]); end_term(); } Modified: head/sys/boot/i386/loader/conf.c ============================================================================== --- head/sys/boot/i386/loader/conf.c Fri Nov 27 02:47:49 2009 (r199854) +++ head/sys/boot/i386/loader/conf.c Fri Nov 27 03:55:42 2009 (r199855) @@ -128,6 +128,7 @@ extern struct console comconsole; extern struct console dconsole; #endif extern struct console nullconsole; +extern struct console spinconsole; struct console *consoles[] = { &vidconsole, @@ -136,6 +137,7 @@ struct console *consoles[] = { &dconsole, #endif &nullconsole, + &spinconsole, NULL }; Modified: head/sys/boot/pc98/loader/conf.c ============================================================================== --- head/sys/boot/pc98/loader/conf.c Fri Nov 27 02:47:49 2009 (r199854) +++ head/sys/boot/pc98/loader/conf.c Fri Nov 27 03:55:42 2009 (r199855) @@ -100,11 +100,13 @@ struct file_format *file_formats[] = { extern struct console vidconsole; extern struct console comconsole; extern struct console nullconsole; +extern struct console spinconsole; struct console *consoles[] = { &vidconsole, &comconsole, &nullconsole, + &spinconsole, NULL }; From owner-svn-src-all@FreeBSD.ORG Fri Nov 27 03:58:21 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A0BE5106566B; Fri, 27 Nov 2009 03:58:21 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 901668FC17; Fri, 27 Nov 2009 03:58:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAR3wLto001393; Fri, 27 Nov 2009 03:58:21 GMT (envelope-from sobomax@svn.freebsd.org) Received: (from sobomax@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAR3wLrf001391; Fri, 27 Nov 2009 03:58:21 GMT (envelope-from sobomax@svn.freebsd.org) Message-Id: <200911270358.nAR3wLrf001391@svn.freebsd.org> From: Maxim Sobolev Date: Fri, 27 Nov 2009 03:58:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199856 - head/sys/boot/i386/libi386 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Nov 2009 03:58:21 -0000 Author: sobomax Date: Fri Nov 27 03:58:21 2009 New Revision: 199856 URL: http://svn.freebsd.org/changeset/base/199856 Log: Whitespace on: use tabs for identation consistently. Modified: head/sys/boot/i386/libi386/spinconsole.c Modified: head/sys/boot/i386/libi386/spinconsole.c ============================================================================== --- head/sys/boot/i386/libi386/spinconsole.c Fri Nov 27 03:55:42 2009 (r199855) +++ head/sys/boot/i386/libi386/spinconsole.c Fri Nov 27 03:58:21 2009 (r199856) @@ -82,10 +82,10 @@ spinc_putchar(int c) static time_t lasttime; time_t now; - now = time(NULL); - if (now < (lasttime + 1)) - return; - lasttime = now; + now = time(NULL); + if (now < (lasttime + 1)) + return; + lasttime = now; get_pos(&curx, &cury); if (curx > 0) curs_move(&curx, &cury, curx - 1, cury); From owner-svn-src-all@FreeBSD.ORG Fri Nov 27 04:00:52 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8D1D01065694; Fri, 27 Nov 2009 04:00:52 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7C64C8FC16; Fri, 27 Nov 2009 04:00:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAR40qMM001518; Fri, 27 Nov 2009 04:00:52 GMT (envelope-from sobomax@svn.freebsd.org) Received: (from sobomax@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAR40qjL001516; Fri, 27 Nov 2009 04:00:52 GMT (envelope-from sobomax@svn.freebsd.org) Message-Id: <200911270400.nAR40qjL001516@svn.freebsd.org> From: Maxim Sobolev Date: Fri, 27 Nov 2009 04:00:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199857 - head/sys/boot/i386/libi386 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Nov 2009 04:00:52 -0000 Author: sobomax Date: Fri Nov 27 04:00:52 2009 New Revision: 199857 URL: http://svn.freebsd.org/changeset/base/199857 Log: Whitespace-only: another instance of identation with spaces. Modified: head/sys/boot/i386/libi386/spinconsole.c Modified: head/sys/boot/i386/libi386/spinconsole.c ============================================================================== --- head/sys/boot/i386/libi386/spinconsole.c Fri Nov 27 03:58:21 2009 (r199856) +++ head/sys/boot/i386/libi386/spinconsole.c Fri Nov 27 04:00:52 2009 (r199857) @@ -79,7 +79,7 @@ spinc_putchar(int c) { static int curx, cury; static unsigned tw_chars = 0x5C2D2F7C; /* "\-/|" */ - static time_t lasttime; + static time_t lasttime; time_t now; now = time(NULL); From owner-svn-src-all@FreeBSD.ORG Fri Nov 27 06:23:48 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 44C38106566B; Fri, 27 Nov 2009 06:23:48 +0000 (UTC) (envelope-from maxim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 32FA28FC1A; Fri, 27 Nov 2009 06:23:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAR6NlQ0004280; Fri, 27 Nov 2009 06:23:47 GMT (envelope-from maxim@svn.freebsd.org) Received: (from maxim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAR6NlLf004279; Fri, 27 Nov 2009 06:23:47 GMT (envelope-from maxim@svn.freebsd.org) Message-Id: <200911270623.nAR6NlLf004279@svn.freebsd.org> From: Maxim Konovalov Date: Fri, 27 Nov 2009 06:23:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199858 - head/share/misc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Nov 2009 06:23:48 -0000 Author: maxim Date: Fri Nov 27 06:23:47 2009 New Revision: 199858 URL: http://svn.freebsd.org/changeset/base/199858 Log: o FreeBSD 8.0 added. Modified: head/share/misc/bsd-family-tree Modified: head/share/misc/bsd-family-tree ============================================================================== --- head/share/misc/bsd-family-tree Fri Nov 27 04:00:52 2009 (r199857) +++ head/share/misc/bsd-family-tree Fri Nov 27 06:23:47 2009 (r199858) @@ -232,6 +232,8 @@ FreeBSD 5.2 | | | | | | | DragonFly 2.4.0 | V | | OpenBSD 4.6 | | | | | | +FreeBSD 8.0 | | | | + | | | | | FreeBSD 8 -current | NetBSD -current OpenBSD -current | | | | | | v v v v v @@ -505,6 +507,7 @@ OpenBSD 4.5 2009-05-01 [OBD] FreeBSD 7.2 2009-05-04 [FBD] DragonFly 2.4.0 2009-09-16 [DFB] OpenBSD 4.6 2009-10-18 [OBD] +FreeBSD 8.0 2009-11-26 [FBD] Bibliography ------------------------ From owner-svn-src-all@FreeBSD.ORG Fri Nov 27 07:55:40 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8D442106566C; Fri, 27 Nov 2009 07:55:40 +0000 (UTC) (envelope-from maxim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7B9718FC08; Fri, 27 Nov 2009 07:55:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAR7teiX006040; Fri, 27 Nov 2009 07:55:40 GMT (envelope-from maxim@svn.freebsd.org) Received: (from maxim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAR7teLM006039; Fri, 27 Nov 2009 07:55:40 GMT (envelope-from maxim@svn.freebsd.org) Message-Id: <200911270755.nAR7teLM006039@svn.freebsd.org> From: Maxim Konovalov Date: Fri, 27 Nov 2009 07:55:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199859 - head/share/misc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Nov 2009 07:55:40 -0000 Author: maxim Date: Fri Nov 27 07:55:39 2009 New Revision: 199859 URL: http://svn.freebsd.org/changeset/base/199859 Log: o HEAD is FreeBSD 9-current now. Submitted by: Alex Kozlov Modified: head/share/misc/bsd-family-tree Modified: head/share/misc/bsd-family-tree ============================================================================== --- head/share/misc/bsd-family-tree Fri Nov 27 06:23:47 2009 (r199858) +++ head/share/misc/bsd-family-tree Fri Nov 27 07:55:39 2009 (r199859) @@ -232,9 +232,12 @@ FreeBSD 5.2 | | | | | | | DragonFly 2.4.0 | V | | OpenBSD 4.6 | | | | | | -FreeBSD 8.0 | | | | + *--FreeBSD | | | | + | 8.0 | | | | + | | | | | | + | V | | | | | | | | | -FreeBSD 8 -current | NetBSD -current OpenBSD -current | +FreeBSD 9 -current | NetBSD -current OpenBSD -current | | | | | | v v v v v From owner-svn-src-all@FreeBSD.ORG Fri Nov 27 10:53:47 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2B1A61065676; Fri, 27 Nov 2009 10:53:47 +0000 (UTC) (envelope-from netchild@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1A5DB8FC23; Fri, 27 Nov 2009 10:53:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nARArkEx017717; Fri, 27 Nov 2009 10:53:46 GMT (envelope-from netchild@svn.freebsd.org) Received: (from netchild@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nARArkRL017716; Fri, 27 Nov 2009 10:53:46 GMT (envelope-from netchild@svn.freebsd.org) Message-Id: <200911271053.nARArkRL017716@svn.freebsd.org> From: Alexander Leidinger Date: Fri, 27 Nov 2009 10:53:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199860 - stable/8/sbin/fsck X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Nov 2009 10:53:47 -0000 Author: netchild Date: Fri Nov 27 10:53:46 2009 New Revision: 199860 URL: http://svn.freebsd.org/changeset/base/199860 Log: MFC r199582: Fix minor resource leak in a function which was introduced by changing an err() to a return in r106254. Modified: stable/8/sbin/fsck/fsck.c Directory Properties: stable/8/sbin/fsck/ (props changed) Modified: stable/8/sbin/fsck/fsck.c ============================================================================== --- stable/8/sbin/fsck/fsck.c Fri Nov 27 07:55:39 2009 (r199859) +++ stable/8/sbin/fsck/fsck.c Fri Nov 27 10:53:46 2009 (r199860) @@ -543,8 +543,10 @@ getfslab(const char *str) if ((fd = open(str, O_RDONLY)) == -1) err(1, "cannot open `%s'", str); - if (ioctl(fd, DIOCGDINFO, &dl) == -1) + if (ioctl(fd, DIOCGDINFO, &dl) == -1) { + (void) close(fd); return(NULL); + } (void) close(fd); From owner-svn-src-all@FreeBSD.ORG Fri Nov 27 10:55:28 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 61F9B106566B; Fri, 27 Nov 2009 10:55:28 +0000 (UTC) (envelope-from netchild@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 512D18FC13; Fri, 27 Nov 2009 10:55:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nARAtSBa017821; Fri, 27 Nov 2009 10:55:28 GMT (envelope-from netchild@svn.freebsd.org) Received: (from netchild@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nARAtSP9017819; Fri, 27 Nov 2009 10:55:28 GMT (envelope-from netchild@svn.freebsd.org) Message-Id: <200911271055.nARAtSP9017819@svn.freebsd.org> From: Alexander Leidinger Date: Fri, 27 Nov 2009 10:55:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199861 - stable/8/sbin/mount_cd9660 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Nov 2009 10:55:28 -0000 Author: netchild Date: Fri Nov 27 10:55:28 2009 New Revision: 199861 URL: http://svn.freebsd.org/changeset/base/199861 Log: MFC r199584: Fix minor memory leak in a function. Modified: stable/8/sbin/mount_cd9660/mount_cd9660.c Directory Properties: stable/8/sbin/mount_cd9660/ (props changed) Modified: stable/8/sbin/mount_cd9660/mount_cd9660.c ============================================================================== --- stable/8/sbin/mount_cd9660/mount_cd9660.c Fri Nov 27 10:53:46 2009 (r199860) +++ stable/8/sbin/mount_cd9660/mount_cd9660.c Fri Nov 27 10:55:28 2009 (r199861) @@ -251,8 +251,10 @@ set_charset(struct iovec **iov, int *iov if ((cs_disk = malloc(ICONV_CSNMAXLEN)) == NULL) return (-1); - if ((cs_local = malloc(ICONV_CSNMAXLEN)) == NULL) + if ((cs_local = malloc(ICONV_CSNMAXLEN)) == NULL) { + free(cs_disk); return (-1); + } strncpy(cs_disk, ENCODING_UNICODE, ICONV_CSNMAXLEN); strncpy(cs_local, kiconv_quirkcs(localcs, KICONV_VENDOR_MICSFT), ICONV_CSNMAXLEN); From owner-svn-src-all@FreeBSD.ORG Fri Nov 27 13:00:30 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E45E51065670; Fri, 27 Nov 2009 13:00:30 +0000 (UTC) (envelope-from nyan@jp.FreeBSD.org) Received: from sakura.ccs.furiru.org (sakura.ccs.furiru.org [IPv6:2001:2f0:104:8060::1]) by mx1.freebsd.org (Postfix) with ESMTP id 8E1B38FC17; Fri, 27 Nov 2009 13:00:30 +0000 (UTC) Received: from localhost (authenticated bits=0) by sakura.ccs.furiru.org (unknown) with ESMTP id nARD0Qsn004349; Fri, 27 Nov 2009 22:00:29 +0900 (JST) (envelope-from nyan@jp.FreeBSD.org) Date: Fri, 27 Nov 2009 21:59:57 +0900 (JST) Message-Id: <20091127.215957.195637349.nyan@jp.FreeBSD.org> To: sobomax@FreeBSD.org From: TAKAHASHI Yoshihiro In-Reply-To: <200911270355.nAR3tgqp001311@svn.freebsd.org> References: <200911270355.nAR3tgqp001311@svn.freebsd.org> X-Mailer: Mew version 6.3 on Emacs 22.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r199855 - in head/sys/boot: forth i386/libi386 i386/loader pc98/loader X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Nov 2009 13:00:31 -0000 In article <200911270355.nAR3tgqp001311@svn.freebsd.org> Maxim Sobolev writes: > Log: > Add new loader console type: "spinconsole". This console selects the > video console which doesn't take any input from keyboard and hides > all output replacing it with ``spinning'' character (useful for > embedded products and custom installations). > > Modified: head/sys/boot/pc98/loader/conf.c > ============================================================================== > --- head/sys/boot/pc98/loader/conf.c Fri Nov 27 02:47:49 2009 (r199854) > +++ head/sys/boot/pc98/loader/conf.c Fri Nov 27 03:55:42 2009 (r199855) > @@ -100,11 +100,13 @@ struct file_format *file_formats[] = { > extern struct console vidconsole; > extern struct console comconsole; > extern struct console nullconsole; > +extern struct console spinconsole; > > struct console *consoles[] = { > &vidconsole, > &comconsole, > &nullconsole, > + &spinconsole, > NULL > }; > This breaks the loader for pc98. --- TAKAHASHI Yoshihiro From owner-svn-src-all@FreeBSD.ORG Fri Nov 27 13:05:14 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B0AA7106566C; Fri, 27 Nov 2009 13:05:14 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6994A8FC0C; Fri, 27 Nov 2009 13:05:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nARD5EUO020426; Fri, 27 Nov 2009 13:05:14 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nARD5ERs020424; Fri, 27 Nov 2009 13:05:14 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200911271305.nARD5ERs020424@svn.freebsd.org> From: Ed Schouten Date: Fri, 27 Nov 2009 13:05:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199862 - head/lib/libc/gen X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Nov 2009 13:05:14 -0000 Author: ed Date: Fri Nov 27 13:05:14 2009 New Revision: 199862 URL: http://svn.freebsd.org/changeset/base/199862 Log: Properly use the envp argument in execvPe(). execvPe() is called by _execvpe(), which we added to implement posix_spawnp(). We just took execvP() and added the envp argument. Unfortunately we forgot to change the implementation to use envp over environ. This fixes the following piece of code: | char * const arg[2] = { "env", NULL }; | char * const env[2] = { "FOO=BAR", NULL }; | posix_spawnp(NULL, "/usr/bin/env", NULL, NULL, arg, env); MFC after: 2 weeks Modified: head/lib/libc/gen/exec.c Modified: head/lib/libc/gen/exec.c ============================================================================== --- head/lib/libc/gen/exec.c Fri Nov 27 10:55:28 2009 (r199861) +++ head/lib/libc/gen/exec.c Fri Nov 27 13:05:14 2009 (r199862) @@ -209,7 +209,7 @@ execvPe(name, path, argv, envp) bcopy(name, buf + lp + 1, ln); buf[lp + ln + 1] = '\0'; -retry: (void)_execve(bp, argv, environ); +retry: (void)_execve(bp, argv, envp); switch (errno) { case E2BIG: goto done; @@ -228,7 +228,7 @@ retry: (void)_execve(bp, argv, environ) memp[0] = "sh"; memp[1] = bp; bcopy(argv + 1, memp + 2, cnt * sizeof(char *)); - (void)_execve(_PATH_BSHELL, memp, environ); + (void)_execve(_PATH_BSHELL, memp, envp); goto done; case ENOMEM: goto done; From owner-svn-src-all@FreeBSD.ORG Fri Nov 27 13:08:25 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 60A561065692; Fri, 27 Nov 2009 13:08:25 +0000 (UTC) (envelope-from roam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 50EE78FC15; Fri, 27 Nov 2009 13:08:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nARD8PKP020514; Fri, 27 Nov 2009 13:08:25 GMT (envelope-from roam@svn.freebsd.org) Received: (from roam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nARD8P0h020512; Fri, 27 Nov 2009 13:08:25 GMT (envelope-from roam@svn.freebsd.org) Message-Id: <200911271308.nARD8P0h020512@svn.freebsd.org> From: Peter Pentchev Date: Fri, 27 Nov 2009 13:08:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199863 - head/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Nov 2009 13:08:25 -0000 Author: roam (doc,ports committer) Date: Fri Nov 27 13:08:25 2009 New Revision: 199863 URL: http://svn.freebsd.org/changeset/base/199863 Log: Fix the cross-reference to sctp_opt_info in the text - section 3, not 2. PR: 140938 Submitted by: Bruce Cran MFC after: 2 weeks Modified: head/share/man/man4/sctp.4 Modified: head/share/man/man4/sctp.4 ============================================================================== --- head/share/man/man4/sctp.4 Fri Nov 27 13:05:14 2009 (r199862) +++ head/share/man/man4/sctp.4 Fri Nov 27 13:08:25 2009 (r199863) @@ -179,7 +179,7 @@ supports a number of socket options whic and tested with .Xr getsockopt 2 or -.Xr sctp_opt_info 2 : +.Xr sctp_opt_info 3 : .Bl -tag -width ".Dv SCTP_SET_PEER_PRIMARY_ADDR" .It Dv SCTP_NODELAY Under most circumstances, From owner-svn-src-all@FreeBSD.ORG Fri Nov 27 13:19:07 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2B69B1065670; Fri, 27 Nov 2009 13:19:07 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1B9438FC15; Fri, 27 Nov 2009 13:19:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nARDJ7Vb020780; Fri, 27 Nov 2009 13:19:07 GMT (envelope-from sobomax@svn.freebsd.org) Received: (from sobomax@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nARDJ6Qn020778; Fri, 27 Nov 2009 13:19:06 GMT (envelope-from sobomax@svn.freebsd.org) Message-Id: <200911271319.nARDJ6Qn020778@svn.freebsd.org> From: Maxim Sobolev Date: Fri, 27 Nov 2009 13:19:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199864 - head/sys/boot/pc98/loader X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Nov 2009 13:19:07 -0000 Author: sobomax Date: Fri Nov 27 13:19:06 2009 New Revision: 199864 URL: http://svn.freebsd.org/changeset/base/199864 Log: Remove spinconsole from pc98, some parts seem to be missed and it's too late (early?) to figure out what exactly. Reported by: TAKAHASHI Yoshihiro Modified: head/sys/boot/pc98/loader/conf.c Modified: head/sys/boot/pc98/loader/conf.c ============================================================================== --- head/sys/boot/pc98/loader/conf.c Fri Nov 27 13:08:25 2009 (r199863) +++ head/sys/boot/pc98/loader/conf.c Fri Nov 27 13:19:06 2009 (r199864) @@ -100,13 +100,11 @@ struct file_format *file_formats[] = { extern struct console vidconsole; extern struct console comconsole; extern struct console nullconsole; -extern struct console spinconsole; struct console *consoles[] = { &vidconsole, &comconsole, &nullconsole, - &spinconsole, NULL }; From owner-svn-src-all@FreeBSD.ORG Fri Nov 27 13:19:33 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9165C106566C for ; Fri, 27 Nov 2009 13:19:33 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from sippysoft.com (gk1.360sip.com [72.236.70.240]) by mx1.freebsd.org (Postfix) with ESMTP id 3907D8FC16 for ; Fri, 27 Nov 2009 13:19:32 +0000 (UTC) Received: from [192.168.1.38] (S0106005004e13421.vs.shawcable.net [70.71.167.197]) (authenticated bits=0) by sippysoft.com (8.14.3/8.14.3) with ESMTP id nARDJUG9059908 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 27 Nov 2009 05:19:31 -0800 (PST) (envelope-from sobomax@FreeBSD.org) Message-ID: <4B0FD1E2.2000909@FreeBSD.org> Date: Fri, 27 Nov 2009 05:19:30 -0800 From: Maxim Sobolev Organization: Sippy Software, Inc. User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: TAKAHASHI Yoshihiro References: <200911270355.nAR3tgqp001311@svn.freebsd.org> <20091127.215957.195637349.nyan@jp.FreeBSD.org> In-Reply-To: <20091127.215957.195637349.nyan@jp.FreeBSD.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r199855 - in head/sys/boot: forth i386/libi386 i386/loader pc98/loader X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Nov 2009 13:19:33 -0000 TAKAHASHI Yoshihiro wrote: > This breaks the loader for pc98. Sorry, reverted. -Maxim From owner-svn-src-all@FreeBSD.ORG Fri Nov 27 13:39:00 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4030D106566B; Fri, 27 Nov 2009 13:39:00 +0000 (UTC) (envelope-from raj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2F9048FC1B; Fri, 27 Nov 2009 13:39:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nARDd0vV021174; Fri, 27 Nov 2009 13:39:00 GMT (envelope-from raj@svn.freebsd.org) Received: (from raj@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nARDd0hI021172; Fri, 27 Nov 2009 13:39:00 GMT (envelope-from raj@svn.freebsd.org) Message-Id: <200911271339.nARDd0hI021172@svn.freebsd.org> From: Rafal Jaworowski Date: Fri, 27 Nov 2009 13:39:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199865 - stable/8/sys/dev/tsec X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Nov 2009 13:39:00 -0000 Author: raj Date: Fri Nov 27 13:38:59 2009 New Revision: 199865 URL: http://svn.freebsd.org/changeset/base/199865 Log: MFC r199580: tsec: Use IFQ_DRV macros for managing interface packet queue. This lets tsec(4) work with ALTQ. Submitted by: Marcin Ligenza Modified: stable/8/sys/dev/tsec/if_tsec.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/tsec/if_tsec.c ============================================================================== --- stable/8/sys/dev/tsec/if_tsec.c Fri Nov 27 13:19:06 2009 (r199864) +++ stable/8/sys/dev/tsec/if_tsec.c Fri Nov 27 13:38:59 2009 (r199865) @@ -716,9 +716,9 @@ tsec_start_locked(struct ifnet *ifp) bus_dmamap_sync(sc->tsec_tx_dtag, sc->tsec_tx_dmap, BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); - for (;;) { + while (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) { /* Get packet from the queue */ - IF_DEQUEUE(&ifp->if_snd, m0); + IFQ_DRV_DEQUEUE(&ifp->if_snd, m0); if (m0 == NULL) break; @@ -755,7 +755,7 @@ tsec_start_locked(struct ifnet *ifp) m0 = mtmp; if (tsec_encap(sc, m0, fcb_inserted)) { - IF_PREPEND(&ifp->if_snd, m0); + IFQ_DRV_PREPEND(&ifp->if_snd, m0); ifp->if_drv_flags |= IFF_DRV_OACTIVE; break; } From owner-svn-src-all@FreeBSD.ORG Fri Nov 27 17:25:20 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DB483106566B; Fri, 27 Nov 2009 17:25:19 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C99B38FC1C; Fri, 27 Nov 2009 17:25:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nARHPJrH025652; Fri, 27 Nov 2009 17:25:19 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nARHPJ4A025651; Fri, 27 Nov 2009 17:25:19 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <200911271725.nARHPJ4A025651@svn.freebsd.org> From: Michael Tuexen Date: Fri, 27 Nov 2009 17:25:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199866 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Nov 2009 17:25:20 -0000 Author: tuexen Date: Fri Nov 27 17:25:19 2009 New Revision: 199866 URL: http://svn.freebsd.org/changeset/base/199866 Log: Use the default stack size for the iterator thread. This fixes a crash reported by Irene Ruengeler. Approved by: rrs (mentor) MFC after: 1 month Modified: head/sys/netinet/sctp_constants.h Modified: head/sys/netinet/sctp_constants.h ============================================================================== --- head/sys/netinet/sctp_constants.h Fri Nov 27 13:38:59 2009 (r199865) +++ head/sys/netinet/sctp_constants.h Fri Nov 27 17:25:19 2009 (r199866) @@ -93,7 +93,7 @@ __FBSDID("$FreeBSD$"); #endif #define SCTP_KTRHEAD_NAME "sctp_iterator" -#define SCTP_KTHREAD_PAGES 2 +#define SCTP_KTHREAD_PAGES 0 /* If you support Multi-VRF how big to From owner-svn-src-all@FreeBSD.ORG Fri Nov 27 17:53:49 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9DC351065741; Fri, 27 Nov 2009 17:53:49 +0000 (UTC) (envelope-from fanf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8C5D48FC21; Fri, 27 Nov 2009 17:53:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nARHrn5o026214; Fri, 27 Nov 2009 17:53:49 GMT (envelope-from fanf@svn.freebsd.org) Received: (from fanf@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nARHrn3Z026212; Fri, 27 Nov 2009 17:53:49 GMT (envelope-from fanf@svn.freebsd.org) Message-Id: <200911271753.nARHrn3Z026212@svn.freebsd.org> From: Tony Finch Date: Fri, 27 Nov 2009 17:53:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199867 - head/usr.bin/unifdef X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Nov 2009 17:53:49 -0000 Author: fanf Date: Fri Nov 27 17:53:49 2009 New Revision: 199867 URL: http://svn.freebsd.org/changeset/base/199867 Log: unifdef: fix invalid array access when nesting limit exceeded If the number of nested #if blocks exceeds 64, nest() increments the nesting depth and then reports an error. The message includes the line number for the start of the current #if block, which is read from past the end of the relevant array. Avoid the out-of-bounds read by reporting the error and exiting before the nesting depth has a chance to increase. Submitted by: Jonathan Nieder Modified: head/usr.bin/unifdef/unifdef.c Modified: head/usr.bin/unifdef/unifdef.c ============================================================================== --- head/usr.bin/unifdef/unifdef.c Fri Nov 27 17:25:19 2009 (r199866) +++ head/usr.bin/unifdef/unifdef.c Fri Nov 27 17:53:49 2009 (r199867) @@ -24,17 +24,19 @@ */ /* - * This code is derived from software contributed to Berkeley by Dave Yost. + * This code was derived from software contributed to Berkeley by Dave Yost. * It was rewritten to support ANSI C by Tony Finch. The original version * of unifdef carried the 4-clause BSD copyright licence. None of its code * remains in this version (though some of the names remain) so it now * carries a more liberal licence. + * + * The latest version is available from http://dotat.at/prog/unifdef */ #include #ifdef __IDSTRING -__IDSTRING(dotat, "$dotat: unifdef/unifdef.c,v 1.188 2009/11/25 00:11:02 fanf2 Exp $"); +__IDSTRING(dotat, "$dotat: unifdef/unifdef.c,v 1.190 2009/11/27 17:21:26 fanf2 Exp $"); #endif #ifdef __FBSDID __FBSDID("$FreeBSD$"); @@ -460,9 +462,11 @@ keywordedit(const char *replacement) static void nest(void) { - depth += 1; - if (depth >= MAXDEPTH) + if (depth > MAXDEPTH-1) + abort(); /* bug */ + if (depth == MAXDEPTH-1) error("Too many levels of nesting"); + depth += 1; stifline[depth] = linenum; } static void From owner-svn-src-all@FreeBSD.ORG Fri Nov 27 20:24:12 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 190BE1065692; Fri, 27 Nov 2009 20:24:12 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 052F48FC21; Fri, 27 Nov 2009 20:24:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nARKOBDr029213; Fri, 27 Nov 2009 20:24:11 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nARKOBCa029203; Fri, 27 Nov 2009 20:24:11 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <200911272024.nARKOBCa029203@svn.freebsd.org> From: Alan Cox Date: Fri, 27 Nov 2009 20:24:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199868 - in head/sys: amd64/amd64 arm/arm dev/cxgb/ulp/tom i386/i386 ia64/ia64 mips/mips powerpc/aim powerpc/booke sparc64/sparc64 sun4v/sun4v vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Nov 2009 20:24:12 -0000 Author: alc Date: Fri Nov 27 20:24:11 2009 New Revision: 199868 URL: http://svn.freebsd.org/changeset/base/199868 Log: Simplify the invocation of vm_fault(). Specifically, eliminate the flag VM_FAULT_DIRTY. The information provided by this flag can be trivially inferred by vm_fault(). Discussed with: kib Modified: head/sys/amd64/amd64/trap.c head/sys/arm/arm/trap.c head/sys/dev/cxgb/ulp/tom/cxgb_vm.c head/sys/i386/i386/trap.c head/sys/ia64/ia64/trap.c head/sys/mips/mips/trap.c head/sys/powerpc/aim/trap.c head/sys/powerpc/booke/trap.c head/sys/sparc64/sparc64/trap.c head/sys/sun4v/sun4v/trap.c head/sys/vm/vm_fault.c head/sys/vm/vm_map.h Modified: head/sys/amd64/amd64/trap.c ============================================================================== --- head/sys/amd64/amd64/trap.c Fri Nov 27 17:53:49 2009 (r199867) +++ head/sys/amd64/amd64/trap.c Fri Nov 27 20:24:11 2009 (r199868) @@ -750,9 +750,7 @@ trap_pfault(frame, usermode) PROC_UNLOCK(p); /* Fault in the user page: */ - rv = vm_fault(map, va, ftype, - (ftype & VM_PROT_WRITE) ? VM_FAULT_DIRTY - : VM_FAULT_NORMAL); + rv = vm_fault(map, va, ftype, VM_FAULT_NORMAL); PROC_LOCK(p); --p->p_lock; Modified: head/sys/arm/arm/trap.c ============================================================================== --- head/sys/arm/arm/trap.c Fri Nov 27 17:53:49 2009 (r199867) +++ head/sys/arm/arm/trap.c Fri Nov 27 20:24:11 2009 (r199868) @@ -425,8 +425,7 @@ data_abort_handler(trapframe_t *tf) p->p_lock++; PROC_UNLOCK(p); } - error = vm_fault(map, va, ftype, (ftype & VM_PROT_WRITE) ? - VM_FAULT_DIRTY : VM_FAULT_NORMAL); + error = vm_fault(map, va, ftype, VM_FAULT_NORMAL); pcb->pcb_onfault = onfault; if (map != kernel_map) { Modified: head/sys/dev/cxgb/ulp/tom/cxgb_vm.c ============================================================================== --- head/sys/dev/cxgb/ulp/tom/cxgb_vm.c Fri Nov 27 17:53:49 2009 (r199867) +++ head/sys/dev/cxgb/ulp/tom/cxgb_vm.c Fri Nov 27 20:24:11 2009 (r199868) @@ -131,8 +131,7 @@ vm_fault_hold_user_pages(vm_map_t map, v * taken away from us before it is held */ while (*pages == NULL) { - rv = vm_fault(map, va, prot, - (prot & VM_PROT_WRITE) ? VM_FAULT_DIRTY : VM_FAULT_NORMAL); + rv = vm_fault(map, va, prot, VM_FAULT_NORMAL); if (rv) goto error; *pages = pmap_extract_and_hold(pmap, va, prot); Modified: head/sys/i386/i386/trap.c ============================================================================== --- head/sys/i386/i386/trap.c Fri Nov 27 17:53:49 2009 (r199867) +++ head/sys/i386/i386/trap.c Fri Nov 27 20:24:11 2009 (r199868) @@ -825,9 +825,7 @@ trap_pfault(frame, usermode, eva) PROC_UNLOCK(p); /* Fault in the user page: */ - rv = vm_fault(map, va, ftype, - (ftype & VM_PROT_WRITE) ? VM_FAULT_DIRTY - : VM_FAULT_NORMAL); + rv = vm_fault(map, va, ftype, VM_FAULT_NORMAL); PROC_LOCK(p); --p->p_lock; Modified: head/sys/ia64/ia64/trap.c ============================================================================== --- head/sys/ia64/ia64/trap.c Fri Nov 27 17:53:49 2009 (r199867) +++ head/sys/ia64/ia64/trap.c Fri Nov 27 20:24:11 2009 (r199868) @@ -572,8 +572,7 @@ trap(int vector, struct trapframe *tf) PROC_UNLOCK(p); /* Fault in the user page: */ - rv = vm_fault(map, va, ftype, (ftype & VM_PROT_WRITE) - ? VM_FAULT_DIRTY : VM_FAULT_NORMAL); + rv = vm_fault(map, va, ftype, VM_FAULT_NORMAL); PROC_LOCK(p); --p->p_lock; Modified: head/sys/mips/mips/trap.c ============================================================================== --- head/sys/mips/mips/trap.c Fri Nov 27 17:53:49 2009 (r199867) +++ head/sys/mips/mips/trap.c Fri Nov 27 20:24:11 2009 (r199868) @@ -538,17 +538,11 @@ dofault: struct vmspace *vm; vm_map_t map; int rv = 0; - int flag; vm = p->p_vmspace; map = &vm->vm_map; va = trunc_page((vm_offset_t)trapframe->badvaddr); - if ((vm_offset_t)trapframe->badvaddr < VM_MIN_KERNEL_ADDRESS) { - if (ftype & VM_PROT_WRITE) - flag = VM_FAULT_DIRTY; - else - flag = VM_FAULT_NORMAL; - } else { + if ((vm_offset_t)trapframe->badvaddr >= VM_MIN_KERNEL_ADDRESS) { /* * Don't allow user-mode faults in kernel * address space. @@ -564,14 +558,14 @@ dofault: ++p->p_lock; PROC_UNLOCK(p); - rv = vm_fault(map, va, ftype, flag); + rv = vm_fault(map, va, ftype, VM_FAULT_NORMAL); PROC_LOCK(p); --p->p_lock; PROC_UNLOCK(p); #ifdef VMFAULT_TRACE printf("vm_fault(%x (pmap %x), %x (%x), %x, %d) -> %x at pc %x\n", - map, &vm->vm_pmap, va, trapframe->badvaddr, ftype, flag, + map, &vm->vm_pmap, va, trapframe->badvaddr, ftype, VM_FAULT_NORMAL, rv, trapframe->pc); #endif Modified: head/sys/powerpc/aim/trap.c ============================================================================== --- head/sys/powerpc/aim/trap.c Fri Nov 27 17:53:49 2009 (r199867) +++ head/sys/powerpc/aim/trap.c Fri Nov 27 20:24:11 2009 (r199868) @@ -491,9 +491,7 @@ trap_pfault(struct trapframe *frame, int PROC_UNLOCK(p); /* Fault in the user page: */ - rv = vm_fault(map, va, ftype, - (ftype & VM_PROT_WRITE) ? VM_FAULT_DIRTY - : VM_FAULT_NORMAL); + rv = vm_fault(map, va, ftype, VM_FAULT_NORMAL); PROC_LOCK(p); --p->p_lock; Modified: head/sys/powerpc/booke/trap.c ============================================================================== --- head/sys/powerpc/booke/trap.c Fri Nov 27 17:53:49 2009 (r199867) +++ head/sys/powerpc/booke/trap.c Fri Nov 27 20:24:11 2009 (r199868) @@ -497,8 +497,7 @@ trap_pfault(struct trapframe *frame, int PROC_UNLOCK(p); /* Fault in the user page: */ - rv = vm_fault(map, va, ftype, - (ftype & VM_PROT_WRITE) ? VM_FAULT_DIRTY : VM_FAULT_NORMAL); + rv = vm_fault(map, va, ftype, VM_FAULT_NORMAL); PROC_LOCK(p); --p->p_lock; Modified: head/sys/sparc64/sparc64/trap.c ============================================================================== --- head/sys/sparc64/sparc64/trap.c Fri Nov 27 17:53:49 2009 (r199867) +++ head/sys/sparc64/sparc64/trap.c Fri Nov 27 20:24:11 2009 (r199868) @@ -409,7 +409,6 @@ trap_pfault(struct thread *td, struct tr vm_prot_t prot; vm_map_entry_t entry; u_long ctx; - int flags; int type; int rv; @@ -429,15 +428,13 @@ trap_pfault(struct thread *td, struct tr CTR4(KTR_TRAP, "trap_pfault: td=%p pm_ctx=%#lx va=%#lx ctx=%#lx", td, p->p_vmspace->vm_pmap.pm_context[curcpu], va, ctx); - if (type == T_DATA_PROTECTION) { + if (type == T_DATA_PROTECTION) prot = VM_PROT_WRITE; - flags = VM_FAULT_DIRTY; - } else { + else { if (type == T_DATA_MISS) prot = VM_PROT_READ; else prot = VM_PROT_READ | VM_PROT_EXECUTE; - flags = VM_FAULT_NORMAL; } if (ctx != TLB_CTX_KERNEL) { @@ -463,7 +460,7 @@ trap_pfault(struct thread *td, struct tr PROC_UNLOCK(p); /* Fault in the user page. */ - rv = vm_fault(&vm->vm_map, va, prot, flags); + rv = vm_fault(&vm->vm_map, va, prot, VM_FAULT_NORMAL); /* * Now the process can be swapped again. Modified: head/sys/sun4v/sun4v/trap.c ============================================================================== --- head/sys/sun4v/sun4v/trap.c Fri Nov 27 17:53:49 2009 (r199867) +++ head/sys/sun4v/sun4v/trap.c Fri Nov 27 20:24:11 2009 (r199868) @@ -460,7 +460,6 @@ trap_pfault(struct thread *td, struct tr vm_offset_t va; vm_prot_t prot; u_long ctx; - int flags; int rv; if (td == NULL) @@ -487,15 +486,13 @@ trap_pfault(struct thread *td, struct tr KASSERT(td->td_proc->p_vmspace != NULL, ("trap_pfault: vmspace NULL")); - if (type == T_DATA_PROTECTION) { + if (type == T_DATA_PROTECTION) prot = VM_PROT_WRITE; - flags = VM_FAULT_DIRTY; - } else { + else { if (type == T_DATA_MISS) prot = VM_PROT_READ; else prot = VM_PROT_READ | VM_PROT_EXECUTE; - flags = VM_FAULT_NORMAL; } if (ctx != TLB_CTX_KERNEL) { @@ -521,7 +518,7 @@ trap_pfault(struct thread *td, struct tr PROC_UNLOCK(p); /* Fault in the user page. */ - rv = vm_fault(&vm->vm_map, va, prot, flags); + rv = vm_fault(&vm->vm_map, va, prot, VM_FAULT_NORMAL); /* * Now the process can be swapped again. Modified: head/sys/vm/vm_fault.c ============================================================================== --- head/sys/vm/vm_fault.c Fri Nov 27 17:53:49 2009 (r199867) +++ head/sys/vm/vm_fault.c Fri Nov 27 20:24:11 2009 (r199868) @@ -857,19 +857,12 @@ vnode_locked: vm_object_set_writeable_dirty(fs.object); /* - * If the fault is a write, we know that this page is being - * written NOW so dirty it explicitly to save on - * pmap_is_modified() calls later. - * * If this is a NOSYNC mmap we do not want to set VPO_NOSYNC * if the page is already dirty to prevent data written with * the expectation of being synced from not being synced. * Likewise if this entry does not request NOSYNC then make * sure the page isn't marked NOSYNC. Applications sharing * data should use the same flags to avoid ping ponging. - * - * Also tell the backing pager, if any, that it should remove - * any swap backing since the page is now dirty. */ if (fs.entry->eflags & MAP_ENTRY_NOSYNC) { if (fs.m->dirty == 0) @@ -877,7 +870,17 @@ vnode_locked: } else { fs.m->oflags &= ~VPO_NOSYNC; } - if (fault_flags & VM_FAULT_DIRTY) { + + /* + * If the fault is a write, we know that this page is being + * written NOW so dirty it explicitly to save on + * pmap_is_modified() calls later. + * + * Also tell the backing pager, if any, that it should remove + * any swap backing since the page is now dirty. + */ + if ((fault_type & VM_PROT_WRITE) != 0 && + (fault_flags & VM_FAULT_CHANGE_WIRING) == 0) { vm_page_dirty(fs.m); vm_pager_page_unswapped(fs.m); } Modified: head/sys/vm/vm_map.h ============================================================================== --- head/sys/vm/vm_map.h Fri Nov 27 17:53:49 2009 (r199867) +++ head/sys/vm/vm_map.h Fri Nov 27 20:24:11 2009 (r199868) @@ -319,7 +319,6 @@ long vmspace_wired_count(struct vmspace */ #define VM_FAULT_NORMAL 0 /* Nothing special */ #define VM_FAULT_CHANGE_WIRING 1 /* Change the wiring as appropriate */ -#define VM_FAULT_DIRTY 8 /* Dirty the page */ /* * The following "find_space" options are supported by vm_map_find() From owner-svn-src-all@FreeBSD.ORG Fri Nov 27 22:08:29 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 69992106568D; Fri, 27 Nov 2009 22:08:29 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 592C98FC14; Fri, 27 Nov 2009 22:08:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nARM8Tt8031041; Fri, 27 Nov 2009 22:08:29 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nARM8TRB031039; Fri, 27 Nov 2009 22:08:29 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <200911272208.nARM8TRB031039@svn.freebsd.org> From: Alan Cox Date: Fri, 27 Nov 2009 22:08:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199869 - head/sys/vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Nov 2009 22:08:29 -0000 Author: alc Date: Fri Nov 27 22:08:29 2009 New Revision: 199869 URL: http://svn.freebsd.org/changeset/base/199869 Log: Support the new VM_PROT_COPY option on wired pages. The effect of which is that a debugger can now set a breakpoint in a program that uses mlock(2) on its text segment or mlockall(2) on its entire address space. Modified: head/sys/vm/vm_fault.c Modified: head/sys/vm/vm_fault.c ============================================================================== --- head/sys/vm/vm_fault.c Fri Nov 27 20:24:11 2009 (r199868) +++ head/sys/vm/vm_fault.c Fri Nov 27 22:08:29 2009 (r199869) @@ -273,7 +273,7 @@ RetryFault:; fs.lookup_still_valid = TRUE; if (wired) - fault_type = prot; + fault_type = prot | (fault_type & VM_PROT_COPY); fs.first_m = NULL; @@ -759,8 +759,11 @@ vnode_locked: */ pmap_copy_page(fs.m, fs.first_m); fs.first_m->valid = VM_PAGE_BITS_ALL; - } - if (fs.m) { + if (wired && (fault_flags & + VM_FAULT_CHANGE_WIRING) == 0) { + vm_page_wire(fs.first_m); + vm_page_unwire(fs.m, FALSE); + } /* * We no longer need the old page or object. */ From owner-svn-src-all@FreeBSD.ORG Sat Nov 28 00:50:09 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B92F3106566B; Sat, 28 Nov 2009 00:50:09 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A8C568FC1C; Sat, 28 Nov 2009 00:50:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAS0o9lS034132; Sat, 28 Nov 2009 00:50:09 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAS0o90U034131; Sat, 28 Nov 2009 00:50:09 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <200911280050.nAS0o90U034131@svn.freebsd.org> From: Alan Cox Date: Sat, 28 Nov 2009 00:50:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199870 - head/sys/vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Nov 2009 00:50:09 -0000 Author: alc Date: Sat Nov 28 00:50:09 2009 New Revision: 199870 URL: http://svn.freebsd.org/changeset/base/199870 Log: Properly synchronize the previous change. Modified: head/sys/vm/vm_fault.c Modified: head/sys/vm/vm_fault.c ============================================================================== --- head/sys/vm/vm_fault.c Fri Nov 27 22:08:29 2009 (r199869) +++ head/sys/vm/vm_fault.c Sat Nov 28 00:50:09 2009 (r199870) @@ -761,8 +761,10 @@ vnode_locked: fs.first_m->valid = VM_PAGE_BITS_ALL; if (wired && (fault_flags & VM_FAULT_CHANGE_WIRING) == 0) { + vm_page_lock_queues(); vm_page_wire(fs.first_m); vm_page_unwire(fs.m, FALSE); + vm_page_unlock_queues(); } /* * We no longer need the old page or object. From owner-svn-src-all@FreeBSD.ORG Sat Nov 28 11:05:23 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1BE741065784; Sat, 28 Nov 2009 11:05:23 +0000 (UTC) (envelope-from danger@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0BB4A8FC19; Sat, 28 Nov 2009 11:05:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nASB5McD052640; Sat, 28 Nov 2009 11:05:22 GMT (envelope-from danger@svn.freebsd.org) Received: (from danger@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nASB5M1M052639; Sat, 28 Nov 2009 11:05:22 GMT (envelope-from danger@svn.freebsd.org) Message-Id: <200911281105.nASB5M1M052639@svn.freebsd.org> From: Daniel Gerzo Date: Sat, 28 Nov 2009 11:05:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199871 - head/usr.bin/ldd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Nov 2009 11:05:23 -0000 Author: danger (doc committer) Date: Sat Nov 28 11:05:22 2009 New Revision: 199871 URL: http://svn.freebsd.org/changeset/base/199871 Log: - correctly render the provided example PR: docs/140962 Submitted by: mharo Modified: head/usr.bin/ldd/ldd.1 Modified: head/usr.bin/ldd/ldd.1 ============================================================================== --- head/usr.bin/ldd/ldd.1 Sat Nov 28 00:50:09 2009 (r199870) +++ head/usr.bin/ldd/ldd.1 Sat Nov 28 11:05:22 2009 (r199871) @@ -63,7 +63,7 @@ The following is an example of a shell p option. It will print a report of all ELF binaries in the current directory, which link against libc.so.6: -.Dl "find . -type f | xargs -n1 file -F " " | grep ELF | cut -f1 -d' ' | xargs ldd -f '%A %o\en' | grep libc.so.6" +.Dl "find . -type f | xargs -n1 file -F ' ' | grep ELF | cut -f1 -d' ' | xargs ldd -f '%A %o\en' | grep libc.so.6" .Sh SEE ALSO .Xr ld 1 , .Xr nm 1 , From owner-svn-src-all@FreeBSD.ORG Sat Nov 28 11:13:51 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 31B5D106566B; Sat, 28 Nov 2009 11:13:51 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 217FD8FC13; Sat, 28 Nov 2009 11:13:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nASBDoSY052814; Sat, 28 Nov 2009 11:13:50 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nASBDogi052811; Sat, 28 Nov 2009 11:13:50 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200911281113.nASBDogi052811@svn.freebsd.org> From: Ed Schouten Date: Sat, 28 Nov 2009 11:13:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199872 - head/sys/dev/uart X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Nov 2009 11:13:51 -0000 Author: ed Date: Sat Nov 28 11:13:50 2009 New Revision: 199872 URL: http://svn.freebsd.org/changeset/base/199872 Log: Remove unneeded includes of . Modified: head/sys/dev/uart/uart_core.c head/sys/dev/uart/uart_tty.c Modified: head/sys/dev/uart/uart_core.c ============================================================================== --- head/sys/dev/uart/uart_core.c Sat Nov 28 11:05:22 2009 (r199871) +++ head/sys/dev/uart/uart_core.c Sat Nov 28 11:13:50 2009 (r199872) @@ -45,7 +45,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: head/sys/dev/uart/uart_tty.c ============================================================================== --- head/sys/dev/uart/uart_tty.c Sat Nov 28 11:05:22 2009 (r199871) +++ head/sys/dev/uart/uart_tty.c Sat Nov 28 11:13:50 2009 (r199872) @@ -39,7 +39,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include From owner-svn-src-all@FreeBSD.ORG Sat Nov 28 11:27:37 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8867E1065676; Sat, 28 Nov 2009 11:27:37 +0000 (UTC) (envelope-from danger@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 781818FC1F; Sat, 28 Nov 2009 11:27:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nASBRbiM053083; Sat, 28 Nov 2009 11:27:37 GMT (envelope-from danger@svn.freebsd.org) Received: (from danger@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nASBRbJX053080; Sat, 28 Nov 2009 11:27:37 GMT (envelope-from danger@svn.freebsd.org) Message-Id: <200911281127.nASBRbJX053080@svn.freebsd.org> From: Daniel Gerzo Date: Sat, 28 Nov 2009 11:27:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199873 - head/lib/libc/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Nov 2009 11:27:37 -0000 Author: danger (doc committer) Date: Sat Nov 28 11:27:37 2009 New Revision: 199873 URL: http://svn.freebsd.org/changeset/base/199873 Log: - correct xref sections PR: docs/140940 Submitted by: Bruce Cran MFC after: 1 week Modified: head/lib/libc/net/sctp_send.3 head/lib/libc/net/sctp_sendmsg.3 Modified: head/lib/libc/net/sctp_send.3 ============================================================================== --- head/lib/libc/net/sctp_send.3 Sat Nov 28 11:13:50 2009 (r199872) +++ head/lib/libc/net/sctp_send.3 Sat Nov 28 11:27:37 2009 (r199873) @@ -111,7 +111,7 @@ The argument is an opaque 32 bit value that is passed transparently through the stack to the peer endpoint. It will be available on reception of a message (see -.Xr sctp_recvmsg 2 ) . +.Xr sctp_recvmsg 3 ) . Note that the stack passes this value without regard to byte order. .Pp Modified: head/lib/libc/net/sctp_sendmsg.3 ============================================================================== --- head/lib/libc/net/sctp_sendmsg.3 Sat Nov 28 11:13:50 2009 (r199872) +++ head/lib/libc/net/sctp_sendmsg.3 Sat Nov 28 11:27:37 2009 (r199873) @@ -103,13 +103,13 @@ is set to the message is not transmitted. .Pp No indication of failure to deliver is implicit in a -.Xr sctp_sendmsg 2 +.Xr sctp_sendmsg 3 call. Locally detected errors are indicated by a return value of -1. .Pp If no space is available at the socket to hold the message to be transmitted, then -.Xr sctp_sendmsg 2 +.Xr sctp_sendmsg 3 normally blocks, unless the socket has been placed in non-blocking I/O mode. The @@ -123,7 +123,7 @@ argument is an opaque 32 bit value that through the stack to the peer endpoint. It will be available on reception of a message (see -.Xr sctp_recvmsg 2 ) . +.Xr sctp_recvmsg 3 ) . Note that the stack passes this value without regard to byte order. .Pp From owner-svn-src-all@FreeBSD.ORG Sat Nov 28 11:57:26 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 20B39106566B; Sat, 28 Nov 2009 11:57:26 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 10C4B8FC14; Sat, 28 Nov 2009 11:57:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nASBvPws053608; Sat, 28 Nov 2009 11:57:25 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nASBvPXP053606; Sat, 28 Nov 2009 11:57:25 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200911281157.nASBvPXP053606@svn.freebsd.org> From: Ed Schouten Date: Sat, 28 Nov 2009 11:57:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199874 - head/contrib/telnet/telnet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Nov 2009 11:57:26 -0000 Author: ed Date: Sat Nov 28 11:57:25 2009 New Revision: 199874 URL: http://svn.freebsd.org/changeset/base/199874 Log: Use instead of . only works on FreeBSD by accident. Modified: head/contrib/telnet/telnet/externs.h Modified: head/contrib/telnet/telnet/externs.h ============================================================================== --- head/contrib/telnet/telnet/externs.h Sat Nov 28 11:27:37 2009 (r199873) +++ head/contrib/telnet/telnet/externs.h Sat Nov 28 11:57:25 2009 (r199874) @@ -57,7 +57,7 @@ #include #ifdef USE_TERMIO # ifndef VINTR -# include +# include # endif # define termio termios #endif From owner-svn-src-all@FreeBSD.ORG Sat Nov 28 11:57:44 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 06FD61065703; Sat, 28 Nov 2009 11:57:44 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E9C3E8FC1C; Sat, 28 Nov 2009 11:57:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nASBvhr7053656; Sat, 28 Nov 2009 11:57:43 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nASBvhYV053646; Sat, 28 Nov 2009 11:57:43 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <200911281157.nASBvhYV053646@svn.freebsd.org> From: Edward Tomasz Napierala Date: Sat, 28 Nov 2009 11:57:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199875 - head/sys/geom/label X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Nov 2009 11:57:44 -0000 Author: trasz Date: Sat Nov 28 11:57:43 2009 New Revision: 199875 URL: http://svn.freebsd.org/changeset/base/199875 Log: Provide a set of sysctls and tunables to disable device node creation for specific "kinds" of disk labels - for example, GPT UUIDs. Reason for this is that sometimes, other GEOM classes attach to these device nodes instead of the proper ones - e.g. they attach to /dev/gptid/XXX instead of /dev/ada0p2, which is annoying. Reviewed by: pjd (earlier version) MFC after: 1 month Modified: head/sys/geom/label/g_label.c head/sys/geom/label/g_label.h head/sys/geom/label/g_label_ext2fs.c head/sys/geom/label/g_label_gpt.c head/sys/geom/label/g_label_iso9660.c head/sys/geom/label/g_label_msdosfs.c head/sys/geom/label/g_label_ntfs.c head/sys/geom/label/g_label_reiserfs.c head/sys/geom/label/g_label_ufs.c Modified: head/sys/geom/label/g_label.c ============================================================================== --- head/sys/geom/label/g_label.c Sat Nov 28 11:57:25 2009 (r199874) +++ head/sys/geom/label/g_label.c Sat Nov 28 11:57:43 2009 (r199875) @@ -34,7 +34,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -316,6 +315,8 @@ g_label_taste(struct g_class *mp, struct for (i = 0; g_labels[i] != NULL; i++) { char label[64]; + if (g_labels[i]->ld_enabled == 0) + continue; g_topology_unlock(); g_labels[i]->ld_taste(cp, label, sizeof(label)); g_topology_lock(); Modified: head/sys/geom/label/g_label.h ============================================================================== --- head/sys/geom/label/g_label.h Sat Nov 28 11:57:25 2009 (r199874) +++ head/sys/geom/label/g_label.h Sat Nov 28 11:57:43 2009 (r199875) @@ -30,6 +30,9 @@ #define _G_LABEL_H_ #include +#ifdef _KERNEL +#include +#endif #define G_LABEL_CLASS_NAME "LABEL" @@ -56,23 +59,34 @@ extern u_int g_label_debug; } \ } while (0) +SYSCTL_DECL(_kern_geom_label); + +#define G_LABEL_INIT(kind, label, descr) \ + SYSCTL_NODE(_kern_geom_label, OID_AUTO, kind, CTLFLAG_RD, \ + NULL, ""); \ + SYSCTL_INT(_kern_geom_label_##kind, OID_AUTO, enable, \ + CTLFLAG_RW, &label.ld_enabled, 1, descr); \ + TUNABLE_INT("kern.geom.label." __XSTRING(kind) ".enable", \ + &label.ld_enabled) + typedef void g_label_taste_t (struct g_consumer *cp, char *label, size_t size); struct g_label_desc { g_label_taste_t *ld_taste; char *ld_dir; + int ld_enabled; }; /* Supported labels. */ -extern const struct g_label_desc g_label_ufs_id; -extern const struct g_label_desc g_label_ufs_volume; -extern const struct g_label_desc g_label_iso9660; -extern const struct g_label_desc g_label_msdosfs; -extern const struct g_label_desc g_label_ext2fs; -extern const struct g_label_desc g_label_reiserfs; -extern const struct g_label_desc g_label_ntfs; -extern const struct g_label_desc g_label_gpt; -extern const struct g_label_desc g_label_gpt_uuid; +extern struct g_label_desc g_label_ufs_id; +extern struct g_label_desc g_label_ufs_volume; +extern struct g_label_desc g_label_iso9660; +extern struct g_label_desc g_label_msdosfs; +extern struct g_label_desc g_label_ext2fs; +extern struct g_label_desc g_label_reiserfs; +extern struct g_label_desc g_label_ntfs; +extern struct g_label_desc g_label_gpt; +extern struct g_label_desc g_label_gpt_uuid; #endif /* _KERNEL */ struct g_label_metadata { Modified: head/sys/geom/label/g_label_ext2fs.c ============================================================================== --- head/sys/geom/label/g_label_ext2fs.c Sat Nov 28 11:57:25 2009 (r199874) +++ head/sys/geom/label/g_label_ext2fs.c Sat Nov 28 11:57:43 2009 (r199875) @@ -86,7 +86,10 @@ exit_free: g_free(fs); } -const struct g_label_desc g_label_ext2fs = { +struct g_label_desc g_label_ext2fs = { .ld_taste = g_label_ext2fs_taste, - .ld_dir = "ext2fs" + .ld_dir = "ext2fs", + .ld_enabled = 1 }; + +G_LABEL_INIT(ext2fs, g_label_ext2fs, "Create device nodes for EXT2FS volumes"); Modified: head/sys/geom/label/g_label_gpt.c ============================================================================== --- head/sys/geom/label/g_label_gpt.c Sat Nov 28 11:57:25 2009 (r199874) +++ head/sys/geom/label/g_label_gpt.c Sat Nov 28 11:57:43 2009 (r199875) @@ -153,12 +153,17 @@ g_label_gpt_uuid_taste(struct g_consumer snprintf_uuid(label, size, &part_gpt_entry->ent.ent_uuid); } -const struct g_label_desc g_label_gpt = { +struct g_label_desc g_label_gpt = { .ld_taste = g_label_gpt_taste, - .ld_dir = G_LABEL_GPT_VOLUME_DIR + .ld_dir = G_LABEL_GPT_VOLUME_DIR, + .ld_enabled = 1 }; -const struct g_label_desc g_label_gpt_uuid = { +struct g_label_desc g_label_gpt_uuid = { .ld_taste = g_label_gpt_uuid_taste, - .ld_dir = G_LABEL_GPT_ID_DIR + .ld_dir = G_LABEL_GPT_ID_DIR, + .ld_enabled = 1 }; + +G_LABEL_INIT(gpt, g_label_gpt, "Create device nodes for GPT labels"); +G_LABEL_INIT(gptid, g_label_gpt_uuid, "Create device nodes for GPT UUIDs"); Modified: head/sys/geom/label/g_label_iso9660.c ============================================================================== --- head/sys/geom/label/g_label_iso9660.c Sat Nov 28 11:57:25 2009 (r199874) +++ head/sys/geom/label/g_label_iso9660.c Sat Nov 28 11:57:43 2009 (r199875) @@ -78,7 +78,10 @@ g_label_iso9660_taste(struct g_consumer } } -const struct g_label_desc g_label_iso9660 = { +struct g_label_desc g_label_iso9660 = { .ld_taste = g_label_iso9660_taste, - .ld_dir = G_LABEL_ISO9660_DIR + .ld_dir = G_LABEL_ISO9660_DIR, + .ld_enabled = 1 }; + +G_LABEL_INIT(iso9660, g_label_iso9660, "Create device nodes for ISO9660 volume names"); Modified: head/sys/geom/label/g_label_msdosfs.c ============================================================================== --- head/sys/geom/label/g_label_msdosfs.c Sat Nov 28 11:57:25 2009 (r199874) +++ head/sys/geom/label/g_label_msdosfs.c Sat Nov 28 11:57:43 2009 (r199875) @@ -216,7 +216,10 @@ error: g_free(sector); } -const struct g_label_desc g_label_msdosfs = { +struct g_label_desc g_label_msdosfs = { .ld_taste = g_label_msdosfs_taste, - .ld_dir = G_LABEL_MSDOSFS_DIR + .ld_dir = G_LABEL_MSDOSFS_DIR, + .ld_enabled = 1 }; + +G_LABEL_INIT(msdosfs, g_label_msdosfs, "Create device nodes for MSDOSFS volumes"); Modified: head/sys/geom/label/g_label_ntfs.c ============================================================================== --- head/sys/geom/label/g_label_ntfs.c Sat Nov 28 11:57:25 2009 (r199874) +++ head/sys/geom/label/g_label_ntfs.c Sat Nov 28 11:57:43 2009 (r199875) @@ -114,7 +114,10 @@ done: g_free(filerecp); } -const struct g_label_desc g_label_ntfs = { +struct g_label_desc g_label_ntfs = { .ld_taste = g_label_ntfs_taste, - .ld_dir = G_LABEL_NTFS_DIR + .ld_dir = G_LABEL_NTFS_DIR, + .ld_enabled = 1 }; + +G_LABEL_INIT(ntfs, g_label_ntfs, "Create device nodes for NTFS volumes"); Modified: head/sys/geom/label/g_label_reiserfs.c ============================================================================== --- head/sys/geom/label/g_label_reiserfs.c Sat Nov 28 11:57:25 2009 (r199874) +++ head/sys/geom/label/g_label_reiserfs.c Sat Nov 28 11:57:43 2009 (r199875) @@ -111,7 +111,10 @@ exit_free: g_free(fs); } -const struct g_label_desc g_label_reiserfs = { +struct g_label_desc g_label_reiserfs = { .ld_taste = g_label_reiserfs_taste, - .ld_dir = "reiserfs" + .ld_dir = "reiserfs", + .ld_enabled = 1 }; + +G_LABEL_INIT(reiserfs, g_label_reiserfs, "Create device nodes for REISERFS volumes"); Modified: head/sys/geom/label/g_label_ufs.c ============================================================================== --- head/sys/geom/label/g_label_ufs.c Sat Nov 28 11:57:25 2009 (r199874) +++ head/sys/geom/label/g_label_ufs.c Sat Nov 28 11:57:43 2009 (r199875) @@ -137,13 +137,17 @@ g_label_ufs_id_taste(struct g_consumer * g_label_ufs_taste_common(cp, label, size, G_LABEL_UFS_ID); } - -const struct g_label_desc g_label_ufs_volume = { +struct g_label_desc g_label_ufs_volume = { .ld_taste = g_label_ufs_volume_taste, - .ld_dir = G_LABEL_UFS_VOLUME_DIR + .ld_dir = G_LABEL_UFS_VOLUME_DIR, + .ld_enabled = 1 }; -const struct g_label_desc g_label_ufs_id = { +struct g_label_desc g_label_ufs_id = { .ld_taste = g_label_ufs_id_taste, - .ld_dir = G_LABEL_UFS_ID_DIR + .ld_dir = G_LABEL_UFS_ID_DIR, + .ld_enabled = 1 }; + +G_LABEL_INIT(ufsid, g_label_ufs_id, "Create device nodes for UFS file system IDs"); +G_LABEL_INIT(ufs, g_label_ufs_volume, "Create device nodes for UFS volume names"); From owner-svn-src-all@FreeBSD.ORG Sat Nov 28 13:20:29 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5775D106568B; Sat, 28 Nov 2009 13:20:29 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 478DA8FC1D; Sat, 28 Nov 2009 13:20:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nASDKT39055227; Sat, 28 Nov 2009 13:20:29 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nASDKTa5055225; Sat, 28 Nov 2009 13:20:29 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200911281320.nASDKTa5055225@svn.freebsd.org> From: Ed Schouten Date: Sat, 28 Nov 2009 13:20:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199876 - head/sys/dev/usb/serial X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Nov 2009 13:20:29 -0000 Author: ed Date: Sat Nov 28 13:20:29 2009 New Revision: 199876 URL: http://svn.freebsd.org/changeset/base/199876 Log: Remove unneeded inclusion of . Modified: head/sys/dev/usb/serial/usb_serial.h Modified: head/sys/dev/usb/serial/usb_serial.h ============================================================================== --- head/sys/dev/usb/serial/usb_serial.h Sat Nov 28 11:57:43 2009 (r199875) +++ head/sys/dev/usb/serial/usb_serial.h Sat Nov 28 13:20:29 2009 (r199876) @@ -70,7 +70,6 @@ #include #include #include -#include /* Module interface related macros */ #define UCOM_MODVER 1 From owner-svn-src-all@FreeBSD.ORG Sat Nov 28 14:29:32 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C4F8A1065672; Sat, 28 Nov 2009 14:29:32 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9B2AA8FC0C; Sat, 28 Nov 2009 14:29:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nASETWgq056470; Sat, 28 Nov 2009 14:29:32 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nASETWwM056467; Sat, 28 Nov 2009 14:29:32 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200911281429.nASETWwM056467@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 28 Nov 2009 14:29:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199877 - head/libexec/rtld-elf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Nov 2009 14:29:32 -0000 Author: kib Date: Sat Nov 28 14:29:32 2009 New Revision: 199877 URL: http://svn.freebsd.org/changeset/base/199877 Log: Allow to load not-openable dso when tracing. This fixes ldd on such dso or dso linked to non-openable object. Remove '\n' at the end of error message. End comments with dot. MFC after: 3 weeks (together with r199829) Modified: head/libexec/rtld-elf/rtld.c head/libexec/rtld-elf/rtld.h Modified: head/libexec/rtld-elf/rtld.c ============================================================================== --- head/libexec/rtld-elf/rtld.c Sat Nov 28 13:20:29 2009 (r199876) +++ head/libexec/rtld-elf/rtld.c Sat Nov 28 14:29:32 2009 (r199877) @@ -1571,9 +1571,10 @@ do_load_object(int fd, const char *name, object_add_name(obj, name); obj->path = path; digest_dynamic(obj, 0); - if (obj->z_noopen && (flags & RTLD_LO_DLOPEN)) { + if (obj->z_noopen && (flags & (RTLD_LO_DLOPEN | RTLD_LO_TRACE)) == + RTLD_LO_DLOPEN) { dbg("refusing to load non-loadable \"%s\"", obj->path); - _rtld_error("Cannot dlopen non-loadable %s\n", obj->path); + _rtld_error("Cannot dlopen non-loadable %s", obj->path); munmap(obj->mapbase, obj->mapsize); obj_free(obj); return (NULL); @@ -2006,6 +2007,8 @@ dlopen(const char *name, int mode) lo_flags = RTLD_LO_DLOPEN; if (mode & RTLD_NOLOAD) lo_flags |= RTLD_LO_NOLOAD; + if (ld_tracing != NULL) + lo_flags |= RTLD_LO_TRACE; objlist_init(&initlist); Modified: head/libexec/rtld-elf/rtld.h ============================================================================== --- head/libexec/rtld-elf/rtld.h Sat Nov 28 13:20:29 2009 (r199876) +++ head/libexec/rtld-elf/rtld.h Sat Nov 28 14:29:32 2009 (r199877) @@ -242,8 +242,9 @@ typedef struct Struct_Obj_Entry { dlsym. */ /* Flags for load_object(). */ -#define RTLD_LO_NOLOAD 0x01 /* dlopen() specified RTLD_NOLOAD */ -#define RTLD_LO_DLOPEN 0x02 /* load_object() called from dlopen(). */ +#define RTLD_LO_NOLOAD 0x01 /* dlopen() specified RTLD_NOLOAD. */ +#define RTLD_LO_DLOPEN 0x02 /* Load_object() called from dlopen(). */ +#define RTLD_LO_TRACE 0x04 /* Only tracing. */ /* * Symbol cache entry used during relocation to avoid multiple lookups From owner-svn-src-all@FreeBSD.ORG Sat Nov 28 14:34:28 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E739D1065672; Sat, 28 Nov 2009 14:34:28 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D75CD8FC12; Sat, 28 Nov 2009 14:34:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nASEYSLx056952; Sat, 28 Nov 2009 14:34:28 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nASEYS2I056950; Sat, 28 Nov 2009 14:34:28 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200911281434.nASEYS2I056950@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 28 Nov 2009 14:34:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199878 - head/lib/libthr X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Nov 2009 14:34:29 -0000 Author: kib Date: Sat Nov 28 14:34:28 2009 New Revision: 199878 URL: http://svn.freebsd.org/changeset/base/199878 Log: Revert r199830 for now. Too many ports dlopen() libraries linked with libthr, but forgot to link main binary with it. Modified: head/lib/libthr/Makefile Modified: head/lib/libthr/Makefile ============================================================================== --- head/lib/libthr/Makefile Sat Nov 28 14:29:32 2009 (r199877) +++ head/lib/libthr/Makefile Sat Nov 28 14:34:28 2009 (r199878) @@ -25,7 +25,7 @@ CFLAGS+=-I${.CURDIR}/../../libexec/rtld- CFLAGS+=-I${.CURDIR}/../../libexec/rtld-elf/${MACHINE_ARCH} CFLAGS+=-I${.CURDIR}/../libthread_db CFLAGS+=-Winline -LDFLAGS+=-Wl,-znodelete -Wl,-znodlopen +LDFLAGS+=-Wl,-znodelete VERSION_DEF=${.CURDIR}/../libc/Versions.def SYMBOL_MAPS=${.CURDIR}/pthread.map From owner-svn-src-all@FreeBSD.ORG Sat Nov 28 14:52:45 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DBE7B1065672; Sat, 28 Nov 2009 14:52:45 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B19398FC13; Sat, 28 Nov 2009 14:52:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nASEqjtj058120; Sat, 28 Nov 2009 14:52:45 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nASEqj6S058119; Sat, 28 Nov 2009 14:52:45 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200911281452.nASEqj6S058119@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sat, 28 Nov 2009 14:52:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199879 - stable/6/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Nov 2009 14:52:46 -0000 Author: bz Date: Sat Nov 28 14:52:45 2009 New Revision: 199879 URL: http://svn.freebsd.org/changeset/base/199879 Log: Try to cleanup mergeinfo from r199811. I am sure jhb will either be glad or mad at me on Monday;-) Modified: Directory Properties: stable/6/sys/Makefile (props changed) stable/6/sys/alpha/ (props changed) stable/6/sys/amd64/ (props changed) stable/6/sys/arm/ (props changed) stable/6/sys/boot/ (props changed) stable/6/sys/bsm/ (props changed) stable/6/sys/cam/ (props changed) stable/6/sys/coda/ (props changed) stable/6/sys/compat/ (props changed) stable/6/sys/contrib/ (props changed) stable/6/sys/crypto/ (props changed) stable/6/sys/ddb/ (props changed) stable/6/sys/dev/ (props changed) stable/6/sys/doc/ (props changed) stable/6/sys/fs/ (props changed) stable/6/sys/gdb/ (props changed) stable/6/sys/geom/ (props changed) stable/6/sys/gnu/ (props changed) stable/6/sys/i386/ (props changed) stable/6/sys/i4b/ (props changed) stable/6/sys/ia64/ (props changed) stable/6/sys/isa/ (props changed) stable/6/sys/isofs/ (props changed) stable/6/sys/kern/ (props changed) stable/6/sys/libkern/ (props changed) stable/6/sys/modules/ (props changed) stable/6/sys/net/ (props changed) stable/6/sys/net80211/ (props changed) stable/6/sys/netatalk/ (props changed) stable/6/sys/netatm/ (props changed) stable/6/sys/netgraph/ (props changed) stable/6/sys/netinet/ (props changed) stable/6/sys/netinet6/ (props changed) stable/6/sys/netipsec/ (props changed) stable/6/sys/netipx/ (props changed) stable/6/sys/netkey/ (props changed) stable/6/sys/netnatm/ (props changed) stable/6/sys/netncp/ (props changed) stable/6/sys/netsmb/ (props changed) stable/6/sys/nfs/ (props changed) stable/6/sys/nfs4client/ (props changed) stable/6/sys/nfsclient/ (props changed) stable/6/sys/nfsserver/ (props changed) stable/6/sys/nlm/ (props changed) stable/6/sys/opencrypto/ (props changed) stable/6/sys/pc98/ (props changed) stable/6/sys/pccard/ (props changed) stable/6/sys/pci/ (props changed) stable/6/sys/posix4/ (props changed) stable/6/sys/powerpc/ (props changed) stable/6/sys/rpc/ (props changed) stable/6/sys/security/ (props changed) stable/6/sys/sparc64/ (props changed) stable/6/sys/sys/ (props changed) stable/6/sys/tools/ (props changed) stable/6/sys/ufs/ (props changed) stable/6/sys/vm/ (props changed) stable/6/sys/xdr/ (props changed) From owner-svn-src-all@FreeBSD.ORG Sat Nov 28 15:23:53 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C81CC1065670; Sat, 28 Nov 2009 15:23:53 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9D3AE8FC0A; Sat, 28 Nov 2009 15:23:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nASFNr0j059242; Sat, 28 Nov 2009 15:23:53 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nASFNr5e059241; Sat, 28 Nov 2009 15:23:53 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200911281523.nASFNr5e059241@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sat, 28 Nov 2009 15:23:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199880 - stable/6/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Nov 2009 15:23:53 -0000 Author: bz Date: Sat Nov 28 15:23:53 2009 New Revision: 199880 URL: http://svn.freebsd.org/changeset/base/199880 Log: Also purge the superfluous mergeinfo for r198502 itself. svn propget -R svn:mergeinfo sys/ thinks it should be ok again now. Modified: Directory Properties: stable/6/sys/Makefile (props changed) stable/6/sys/alpha/ (props changed) stable/6/sys/amd64/ (props changed) stable/6/sys/arm/ (props changed) stable/6/sys/boot/ (props changed) stable/6/sys/bsm/ (props changed) stable/6/sys/cam/ (props changed) stable/6/sys/coda/ (props changed) stable/6/sys/compat/ (props changed) stable/6/sys/contrib/ (props changed) stable/6/sys/crypto/ (props changed) stable/6/sys/ddb/ (props changed) stable/6/sys/dev/ (props changed) stable/6/sys/doc/ (props changed) stable/6/sys/fs/ (props changed) stable/6/sys/gdb/ (props changed) stable/6/sys/geom/ (props changed) stable/6/sys/gnu/ (props changed) stable/6/sys/i386/ (props changed) stable/6/sys/i4b/ (props changed) stable/6/sys/ia64/ (props changed) stable/6/sys/isa/ (props changed) stable/6/sys/isofs/ (props changed) stable/6/sys/kern/ (props changed) stable/6/sys/libkern/ (props changed) stable/6/sys/modules/ (props changed) stable/6/sys/net/ (props changed) stable/6/sys/net80211/ (props changed) stable/6/sys/netatalk/ (props changed) stable/6/sys/netatm/ (props changed) stable/6/sys/netgraph/ (props changed) stable/6/sys/netinet/ (props changed) stable/6/sys/netinet6/ (props changed) stable/6/sys/netipsec/ (props changed) stable/6/sys/netipx/ (props changed) stable/6/sys/netkey/ (props changed) stable/6/sys/netnatm/ (props changed) stable/6/sys/netncp/ (props changed) stable/6/sys/netsmb/ (props changed) stable/6/sys/nfs/ (props changed) stable/6/sys/nfs4client/ (props changed) stable/6/sys/nfsclient/ (props changed) stable/6/sys/nfsserver/ (props changed) stable/6/sys/nlm/ (props changed) stable/6/sys/opencrypto/ (props changed) stable/6/sys/pc98/ (props changed) stable/6/sys/pccard/ (props changed) stable/6/sys/pci/ (props changed) stable/6/sys/posix4/ (props changed) stable/6/sys/powerpc/ (props changed) stable/6/sys/rpc/ (props changed) stable/6/sys/security/ (props changed) stable/6/sys/sparc64/ (props changed) stable/6/sys/sys/ (props changed) stable/6/sys/tools/ (props changed) stable/6/sys/ufs/ (props changed) stable/6/sys/vm/ (props changed) stable/6/sys/xdr/ (props changed) From owner-svn-src-all@FreeBSD.ORG Sat Nov 28 16:25:56 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 69B881065672; Sat, 28 Nov 2009 16:25:56 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 589758FC15; Sat, 28 Nov 2009 16:25:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nASGPuj2060775; Sat, 28 Nov 2009 16:25:56 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nASGPu8Y060774; Sat, 28 Nov 2009 16:25:56 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200911281625.nASGPu8Y060774@svn.freebsd.org> From: Ed Schouten Date: Sat, 28 Nov 2009 16:25:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199881 - head/sys/dev/syscons X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Nov 2009 16:25:56 -0000 Author: ed Date: Sat Nov 28 16:25:55 2009 New Revision: 199881 URL: http://svn.freebsd.org/changeset/base/199881 Log: Include , instead of doing it through . I want to prevent the header polution of eventually. Modified: head/sys/dev/syscons/sysmouse.c Modified: head/sys/dev/syscons/sysmouse.c ============================================================================== --- head/sys/dev/syscons/sysmouse.c Sat Nov 28 15:23:53 2009 (r199880) +++ head/sys/dev/syscons/sysmouse.c Sat Nov 28 16:25:55 2009 (r199881) @@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include From owner-svn-src-all@FreeBSD.ORG Sat Nov 28 16:30:06 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C7702106566C; Sat, 28 Nov 2009 16:30:06 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B66F48FC13; Sat, 28 Nov 2009 16:30:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nASGU6bR060894; Sat, 28 Nov 2009 16:30:06 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nASGU6hn060892; Sat, 28 Nov 2009 16:30:06 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200911281630.nASGU6hn060892@svn.freebsd.org> From: Ed Schouten Date: Sat, 28 Nov 2009 16:30:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199882 - head/sys/compat/svr4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Nov 2009 16:30:06 -0000 Author: ed Date: Sat Nov 28 16:30:06 2009 New Revision: 199882 URL: http://svn.freebsd.org/changeset/base/199882 Log: Include instead of . Right now includes , which provides the TTY ioctls to the svr4 code. We need both struct termios and the ioctls, so include for now. Modified: head/sys/compat/svr4/svr4_termios.c Modified: head/sys/compat/svr4/svr4_termios.c ============================================================================== --- head/sys/compat/svr4/svr4_termios.c Sat Nov 28 16:25:55 2009 (r199881) +++ head/sys/compat/svr4/svr4_termios.c Sat Nov 28 16:30:06 2009 (r199882) @@ -34,7 +34,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #include From owner-svn-src-all@FreeBSD.ORG Sat Nov 28 16:47:42 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C0E4F106566C; Sat, 28 Nov 2009 16:47:42 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AFC0B8FC14; Sat, 28 Nov 2009 16:47:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nASGlgN8061241; Sat, 28 Nov 2009 16:47:42 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nASGlg4o061239; Sat, 28 Nov 2009 16:47:42 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200911281647.nASGlg4o061239@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sat, 28 Nov 2009 16:47:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199883 - head/sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Nov 2009 16:47:42 -0000 Author: bz Date: Sat Nov 28 16:47:42 2009 New Revision: 199883 URL: http://svn.freebsd.org/changeset/base/199883 Log: Add SDT_PROBE[1-5] in the same way we have SDT_PROBE_DEFINE[1-5] to avoid having to add all the unused trailing arguments as zeros. MFC after: 6 days Modified: head/sys/sys/sdt.h Modified: head/sys/sys/sdt.h ============================================================================== --- head/sys/sys/sdt.h Sat Nov 28 16:30:06 2009 (r199882) +++ head/sys/sys/sdt.h Sat Nov 28 16:47:42 2009 (r199883) @@ -59,6 +59,12 @@ #define SDT_PROBE_DEFINE4(prov, mod, func, name, arg0, arg1, arg2, arg3) #define SDT_PROBE_DEFINE5(prov, mod, func, name, arg0, arg1, arg2, arg3, arg4) +#define SDT_PROBE1(prov, mod, func, name, arg0) +#define SDT_PROBE2(prov, mod, func, name, arg0, arg1) +#define SDT_PROBE3(prov, mod, func, name, arg0, arg1, arg2) +#define SDT_PROBE4(prov, mod, func, name, arg0, arg1, arg2, arg3) +#define SDT_PROBE5(prov, mod, func, name, arg0, arg1, arg2, arg3, arg4) + #else /* @@ -192,6 +198,17 @@ struct sdt_provider { SDT_PROBE_ARGTYPE(prov, mod, func, name, 3, arg3); \ SDT_PROBE_ARGTYPE(prov, mod, func, name, 4, arg4) +#define SDT_PROBE1(prov, mod, func, name, arg0) \ + SDT_PROBE(prov, mod, func, name, arg0, 0, 0, 0, 0) +#define SDT_PROBE2(prov, mod, func, name, arg0, arg1) \ + SDT_PROBE(prov, mod, func, name, arg0, arg1, 0, 0, 0) +#define SDT_PROBE3(prov, mod, func, name, arg0, arg1, arg2) \ + SDT_PROBE(prov, mod, func, name, arg0, arg1, arg2, 0, 0) +#define SDT_PROBE4(prov, mod, func, name, arg0, arg1, arg2, arg3) \ + SDT_PROBE(prov, mod, func, name, arg0, arg1, arg2, arg3, 0) +#define SDT_PROBE5(prov, mod, func, name, arg0, arg1, arg2, arg3, arg4) \ + SDT_PROBE(prov, mod, func, name, arg0, arg1, arg2, arg3, arg4) + typedef int (*sdt_argtype_listall_func_t)(struct sdt_argtype *, void *); typedef int (*sdt_probe_listall_func_t)(struct sdt_probe *, void *); typedef int (*sdt_provider_listall_func_t)(struct sdt_provider *, void *); From owner-svn-src-all@FreeBSD.ORG Sat Nov 28 16:54:20 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1B666106566C; Sat, 28 Nov 2009 16:54:20 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0A2D68FC0A; Sat, 28 Nov 2009 16:54:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nASGsIus061394; Sat, 28 Nov 2009 16:54:18 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nASGsIm5061392; Sat, 28 Nov 2009 16:54:18 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200911281654.nASGsIm5061392@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sat, 28 Nov 2009 16:54:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199884 - head/sys/opencrypto X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Nov 2009 16:54:20 -0000 Author: bz Date: Sat Nov 28 16:54:18 2009 New Revision: 199884 URL: http://svn.freebsd.org/changeset/base/199884 Log: Define an SDT provider for "opencrypto". MFC after: 6 days Modified: head/sys/opencrypto/crypto.c Modified: head/sys/opencrypto/crypto.c ============================================================================== --- head/sys/opencrypto/crypto.c Sat Nov 28 16:47:42 2009 (r199883) +++ head/sys/opencrypto/crypto.c Sat Nov 28 16:54:18 2009 (r199884) @@ -57,6 +57,7 @@ __FBSDID("$FreeBSD$"); #define CRYPTO_TIMING /* enable timing support */ #include "opt_ddb.h" +#include "opt_kdtrace.h" #include #include @@ -68,6 +69,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -80,6 +82,8 @@ __FBSDID("$FreeBSD$"); #include #include "cryptodev_if.h" +SDT_PROVIDER_DEFINE(opencrypto); + /* * Crypto drivers register themselves by allocating a slot in the * crypto_drivers table with crypto_get_driverid() and then registering From owner-svn-src-all@FreeBSD.ORG Sat Nov 28 17:20:42 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 11CB11065679; Sat, 28 Nov 2009 17:20:42 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0006E8FC16; Sat, 28 Nov 2009 17:20:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nASHKf7r062009; Sat, 28 Nov 2009 17:20:41 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nASHKfou062007; Sat, 28 Nov 2009 17:20:41 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200911281720.nASHKfou062007@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sat, 28 Nov 2009 17:20:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199885 - head/sys/opencrypto X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Nov 2009 17:20:42 -0000 Author: bz Date: Sat Nov 28 17:20:41 2009 New Revision: 199885 URL: http://svn.freebsd.org/changeset/base/199885 Log: Add SDT probes for opencrypto:deflate:deflate_gobal:*. They are not nice but they were helpful. MFC after: 6 days Modified: head/sys/opencrypto/deflate.c Modified: head/sys/opencrypto/deflate.c ============================================================================== --- head/sys/opencrypto/deflate.c Sat Nov 28 16:54:18 2009 (r199884) +++ head/sys/opencrypto/deflate.c Sat Nov 28 17:20:41 2009 (r199885) @@ -35,16 +35,30 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_kdtrace.h" + #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; @@ -68,6 +82,8 @@ deflate_global(data, size, decomp, out) int error, i = 0, j; struct deflate_buf buf[ZBUF]; + SDT_PROBE2(opencrypto, deflate, deflate_global, entry, decomp, size); + bzero(&zbuf, sizeof(z_stream)); for (j = 0; j < ZBUF; j++) buf[j].flag = 0; @@ -81,8 +97,11 @@ deflate_global(data, size, decomp, out) if (!decomp) { buf[i].out = malloc((u_long) size, M_CRYPTO_DATA, M_NOWAIT); - if (buf[i].out == NULL) + if (buf[i].out == NULL) { + SDT_PROBE3(opencrypto, deflate, deflate_global, bad, + decomp, 0, __LINE__); goto bad; + } buf[i].size = size; buf[i].flag = 1; i++; @@ -96,8 +115,11 @@ deflate_global(data, size, decomp, out) buf[i].out = malloc((u_long) (size * 4), M_CRYPTO_DATA, M_NOWAIT); - if (buf[i].out == NULL) + if (buf[i].out == NULL) { + SDT_PROBE3(opencrypto, deflate, deflate_global, bad, + decomp, 0, __LINE__); goto bad; + } buf[i].size = size * 4; buf[i].flag = 1; i++; @@ -110,36 +132,67 @@ deflate_global(data, size, decomp, out) deflateInit2(&zbuf, Z_DEFAULT_COMPRESSION, Z_METHOD, window_deflate, Z_MEMLEVEL, Z_DEFAULT_STRATEGY); - if (error != Z_OK) + if (error != Z_OK) { + SDT_PROBE3(opencrypto, deflate, deflate_global, bad, + decomp, error, __LINE__); goto bad; + } for (;;) { error = decomp ? inflate(&zbuf, Z_PARTIAL_FLUSH) : deflate(&zbuf, Z_PARTIAL_FLUSH); - if (error != Z_OK && error != Z_STREAM_END) + 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; + } else if (zbuf.avail_in == 0 && zbuf.avail_out != 0) goto end; else if (zbuf.avail_out == 0 && i < (ZBUF - 1)) { /* we need more output space, allocate size */ buf[i].out = malloc((u_long) size, M_CRYPTO_DATA, M_NOWAIT); - if (buf[i].out == NULL) + if (buf[i].out == NULL) { + SDT_PROBE3(opencrypto, deflate, deflate_global, + bad, decomp, 0, __LINE__); goto bad; + } zbuf.next_out = buf[i].out; buf[i].size = size; buf[i].flag = 1; zbuf.avail_out = buf[i].size; i++; - } else + } else { + /* + * 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; + } } end: result = count = zbuf.total_out; *out = malloc((u_long) result, M_CRYPTO_DATA, M_NOWAIT); - if (*out == NULL) + if (*out == NULL) { + SDT_PROBE3(opencrypto, deflate, deflate_global, bad, + decomp, 0, __LINE__); goto bad; + } if (decomp) inflateEnd(&zbuf); else @@ -160,6 +213,7 @@ end: } } *out = output; + SDT_PROBE2(opencrypto, deflate, deflate_global, return, decomp, result); return result; bad: From owner-svn-src-all@FreeBSD.ORG Sat Nov 28 17:33:21 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 129BD1065670; Sat, 28 Nov 2009 17:33:21 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F41268FC0C; Sat, 28 Nov 2009 17:33:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nASHXJkM062285; Sat, 28 Nov 2009 17:33:19 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nASHXJjp062278; Sat, 28 Nov 2009 17:33:19 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <200911281733.nASHXJjp062278@svn.freebsd.org> From: Nathan Whitehorn Date: Sat, 28 Nov 2009 17:33:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199886 - in head/sys/powerpc: aim booke include powerpc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Nov 2009 17:33:21 -0000 Author: nwhitehorn Date: Sat Nov 28 17:33:19 2009 New Revision: 199886 URL: http://svn.freebsd.org/changeset/base/199886 Log: Add a CPU features framework on PowerPC and simplify CPU setup a little more. This provides three new sysctls to user space: hw.cpu_features - A bitmask of available CPU features hw.floatingpoint - Whether or not there is hardware FP support hw.altivec - Whether or not Altivec is available PR: powerpc/139154 MFC after: 10 days Modified: head/sys/powerpc/aim/machdep.c head/sys/powerpc/aim/ofw_machdep.c head/sys/powerpc/booke/machdep.c head/sys/powerpc/include/cpu.h head/sys/powerpc/include/md_var.h head/sys/powerpc/powerpc/cpu.c Modified: head/sys/powerpc/aim/machdep.c ============================================================================== --- head/sys/powerpc/aim/machdep.c Sat Nov 28 17:20:41 2009 (r199885) +++ head/sys/powerpc/aim/machdep.c Sat Nov 28 17:33:19 2009 (r199886) @@ -130,7 +130,6 @@ extern vm_offset_t ksym_start, ksym_end; int cold = 1; int cacheline_size = 32; -int ppc64 = 0; int hw_direct_map = 1; struct pcpu __pcpu[MAXCPU]; @@ -256,6 +255,7 @@ powerpc_init(u_int startkernel, u_int en char *env; uint32_t msr, scratch; uint8_t *cache_check; + int ppc64; end = 0; kmdp = NULL; @@ -405,12 +405,15 @@ powerpc_init(u_int startkernel, u_int en mfsprg2 %1;" : "=r"(scratch), "=r"(ppc64)); + if (ppc64) + cpu_features |= PPC_FEATURE_64; + /* * Now copy restorebridge into all the handlers, if necessary, * and set up the trap tables. */ - if (ppc64) { + if (cpu_features & PPC_FEATURE_64) { /* Patch the two instances of rfi -> rfid */ bcopy(&rfid_patch,&rfi_patch1,4); #ifdef KDB @@ -489,7 +492,7 @@ powerpc_init(u_int startkernel, u_int en * in case the platform module had a better idea of what we * should do. */ - if (ppc64) + if (cpu_features & PPC_FEATURE_64) pmap_mmu_install(MMU_TYPE_G5, BUS_PROBE_GENERIC); else pmap_mmu_install(MMU_TYPE_OEA, BUS_PROBE_GENERIC); Modified: head/sys/powerpc/aim/ofw_machdep.c ============================================================================== --- head/sys/powerpc/aim/ofw_machdep.c Sat Nov 28 17:20:41 2009 (r199885) +++ head/sys/powerpc/aim/ofw_machdep.c Sat Nov 28 17:33:19 2009 (r199886) @@ -54,6 +54,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -336,7 +337,7 @@ openfirmware(void *args) /* * Clear battable[] translations */ - if (!ppc64) { + if (!(cpu_features & PPC_FEATURE_64)) { __asm __volatile("mtdbatu 2, %0\n" "mtdbatu 3, %0" : : "r" (0)); } Modified: head/sys/powerpc/booke/machdep.c ============================================================================== --- head/sys/powerpc/booke/machdep.c Sat Nov 28 17:20:41 2009 (r199885) +++ head/sys/powerpc/booke/machdep.c Sat Nov 28 17:33:19 2009 (r199886) @@ -179,7 +179,6 @@ SYSCTL_INT(_machdep, CPU_CACHELINE, cach CTLFLAG_RD, &cacheline_size, 0, ""); int hw_direct_map = 0; -int ppc64 = 0; static void cpu_e500_startup(void *); SYSINIT(cpu, SI_SUB_CPU, SI_ORDER_FIRST, cpu_e500_startup, NULL); Modified: head/sys/powerpc/include/cpu.h ============================================================================== --- head/sys/powerpc/include/cpu.h Sat Nov 28 17:20:41 2009 (r199885) +++ head/sys/powerpc/include/cpu.h Sat Nov 28 17:33:19 2009 (r199886) @@ -39,6 +39,27 @@ #include #include +/* + * CPU Feature Attributes + * + * These are defined in the PowerPC ELF ABI for the AT_HWCAP vector, + * and are exported to userland via the machdep.cpu_features + * sysctl. + */ + +extern int cpu_features; + +#define PPC_FEATURE_32 0x80000000 /* Always true */ +#define PPC_FEATURE_64 0x40000000 /* Defined on a 64-bit CPU */ +#define PPC_FEATURE_HAS_ALTIVEC 0x10000000 +#define PPC_FEATURE_HAS_FPU 0x08000000 +#define PPC_FEATURE_HAS_MMU 0x04000000 +#define PPC_FEATURE_UNIFIED_CACHE 0x01000000 + +#define PPC_FEATURE_BITMASK \ + "\20" \ + "\040PPC32\037PPC64\035ALTIVEC\034FPU\033MMU\031UNIFIEDCACHE" + #define TRAPF_USERMODE(frame) (((frame)->srr1 & PSL_PR) != 0) #define TRAPF_PC(frame) ((frame)->srr0) Modified: head/sys/powerpc/include/md_var.h ============================================================================== --- head/sys/powerpc/include/md_var.h Sat Nov 28 17:20:41 2009 (r199885) +++ head/sys/powerpc/include/md_var.h Sat Nov 28 17:33:19 2009 (r199886) @@ -46,7 +46,6 @@ extern u_long ns_per_tick; extern int powerpc_pow_enabled; extern int cacheline_size; -extern int ppc64; extern int hw_direct_map; void __syncicache(void *, int); Modified: head/sys/powerpc/powerpc/cpu.c ============================================================================== --- head/sys/powerpc/powerpc/cpu.c Sat Nov 28 17:20:41 2009 (r199885) +++ head/sys/powerpc/powerpc/cpu.c Sat Nov 28 17:33:19 2009 (r199886) @@ -67,6 +67,7 @@ #include #include +#include #include #include #include @@ -74,59 +75,102 @@ int powerpc_pow_enabled; +static void cpu_6xx_setup(int cpuid, uint16_t vers); +static void cpu_e500_setup(int cpuid, uint16_t vers); +static void cpu_970_setup(int cpuid, uint16_t vers); + struct cputab { const char *name; uint16_t version; uint16_t revfmt; + int features; /* Do not include PPC_FEATURE_32 or + * PPC_FEATURE_HAS_MMU */ + void (*cpu_setup)(int cpuid, uint16_t vers); }; #define REVFMT_MAJMIN 1 /* %u.%u */ #define REVFMT_HEX 2 /* 0x%04x */ #define REVFMT_DEC 3 /* %u */ static const struct cputab models[] = { - { "Motorola PowerPC 601", MPC601, REVFMT_DEC }, - { "Motorola PowerPC 602", MPC602, REVFMT_DEC }, - { "Motorola PowerPC 603", MPC603, REVFMT_MAJMIN }, - { "Motorola PowerPC 603e", MPC603e, REVFMT_MAJMIN }, - { "Motorola PowerPC 603ev", MPC603ev, REVFMT_MAJMIN }, - { "Motorola PowerPC 604", MPC604, REVFMT_MAJMIN }, - { "Motorola PowerPC 604ev", MPC604ev, REVFMT_MAJMIN }, - { "Motorola PowerPC 620", MPC620, REVFMT_HEX }, - { "Motorola PowerPC 750", MPC750, REVFMT_MAJMIN }, - { "IBM PowerPC 750FX", IBM750FX, REVFMT_MAJMIN }, - { "IBM PowerPC 970", IBM970, REVFMT_MAJMIN }, - { "IBM PowerPC 970FX", IBM970FX, REVFMT_MAJMIN }, - { "IBM PowerPC 970GX", IBM970GX, REVFMT_MAJMIN }, - { "IBM PowerPC 970MP", IBM970MP, REVFMT_MAJMIN }, - { "Motorola PowerPC 7400", MPC7400, REVFMT_MAJMIN }, - { "Motorola PowerPC 7410", MPC7410, REVFMT_MAJMIN }, - { "Motorola PowerPC 7450", MPC7450, REVFMT_MAJMIN }, - { "Motorola PowerPC 7455", MPC7455, REVFMT_MAJMIN }, - { "Motorola PowerPC 7457", MPC7457, REVFMT_MAJMIN }, - { "Motorola PowerPC 7447A", MPC7447A, REVFMT_MAJMIN }, - { "Motorola PowerPC 7448", MPC7448, REVFMT_MAJMIN }, - { "Motorola PowerPC 8240", MPC8240, REVFMT_MAJMIN }, - { "Freescale e500v1 core", FSL_E500v1, REVFMT_MAJMIN }, - { "Freescale e500v2 core", FSL_E500v2, REVFMT_MAJMIN }, - { "Unknown PowerPC CPU", 0, REVFMT_HEX } + { "Motorola PowerPC 601", MPC601, REVFMT_DEC, + PPC_FEATURE_HAS_FPU | PPC_FEATURE_UNIFIED_CACHE, cpu_6xx_setup }, + { "Motorola PowerPC 602", MPC602, REVFMT_DEC, + PPC_FEATURE_HAS_FPU, cpu_6xx_setup }, + { "Motorola PowerPC 603", MPC603, REVFMT_MAJMIN, + PPC_FEATURE_HAS_FPU, cpu_6xx_setup }, + { "Motorola PowerPC 603e", MPC603e, REVFMT_MAJMIN, + PPC_FEATURE_HAS_FPU, cpu_6xx_setup }, + { "Motorola PowerPC 603ev", MPC603ev, REVFMT_MAJMIN, + PPC_FEATURE_HAS_FPU, cpu_6xx_setup }, + { "Motorola PowerPC 604", MPC604, REVFMT_MAJMIN, + PPC_FEATURE_HAS_FPU, cpu_6xx_setup }, + { "Motorola PowerPC 604ev", MPC604ev, REVFMT_MAJMIN, + PPC_FEATURE_HAS_FPU, cpu_6xx_setup }, + { "Motorola PowerPC 620", MPC620, REVFMT_HEX, + PPC_FEATURE_64 | PPC_FEATURE_HAS_FPU, NULL }, + { "Motorola PowerPC 750", MPC750, REVFMT_MAJMIN, + PPC_FEATURE_HAS_FPU, cpu_6xx_setup }, + { "IBM PowerPC 750FX", IBM750FX, REVFMT_MAJMIN, + PPC_FEATURE_HAS_FPU, cpu_6xx_setup }, + { "IBM PowerPC 970", IBM970, REVFMT_MAJMIN, + PPC_FEATURE_64 | PPC_FEATURE_HAS_ALTIVEC | PPC_FEATURE_HAS_FPU, + cpu_970_setup }, + { "IBM PowerPC 970FX", IBM970FX, REVFMT_MAJMIN, + PPC_FEATURE_64 | PPC_FEATURE_HAS_ALTIVEC | PPC_FEATURE_HAS_FPU, + cpu_970_setup }, + { "IBM PowerPC 970GX", IBM970GX, REVFMT_MAJMIN, + PPC_FEATURE_64 | PPC_FEATURE_HAS_ALTIVEC | PPC_FEATURE_HAS_FPU, + cpu_970_setup }, + { "IBM PowerPC 970MP", IBM970MP, REVFMT_MAJMIN, + PPC_FEATURE_64 | PPC_FEATURE_HAS_ALTIVEC | PPC_FEATURE_HAS_FPU, + cpu_970_setup }, + { "Motorola PowerPC 7400", MPC7400, REVFMT_MAJMIN, + PPC_FEATURE_HAS_ALTIVEC | PPC_FEATURE_HAS_FPU, cpu_6xx_setup }, + { "Motorola PowerPC 7410", MPC7410, REVFMT_MAJMIN, + PPC_FEATURE_HAS_ALTIVEC | PPC_FEATURE_HAS_FPU, cpu_6xx_setup }, + { "Motorola PowerPC 7450", MPC7450, REVFMT_MAJMIN, + PPC_FEATURE_HAS_ALTIVEC | PPC_FEATURE_HAS_FPU, cpu_6xx_setup }, + { "Motorola PowerPC 7455", MPC7455, REVFMT_MAJMIN, + PPC_FEATURE_HAS_ALTIVEC | PPC_FEATURE_HAS_FPU, cpu_6xx_setup }, + { "Motorola PowerPC 7457", MPC7457, REVFMT_MAJMIN, + PPC_FEATURE_HAS_ALTIVEC | PPC_FEATURE_HAS_FPU, cpu_6xx_setup }, + { "Motorola PowerPC 7447A", MPC7447A, REVFMT_MAJMIN, + PPC_FEATURE_HAS_ALTIVEC | PPC_FEATURE_HAS_FPU, cpu_6xx_setup }, + { "Motorola PowerPC 7448", MPC7448, REVFMT_MAJMIN, + PPC_FEATURE_HAS_ALTIVEC | PPC_FEATURE_HAS_FPU, cpu_6xx_setup }, + { "Motorola PowerPC 8240", MPC8240, REVFMT_MAJMIN, + PPC_FEATURE_HAS_FPU, cpu_6xx_setup }, + { "Motorola PowerPC 8245", MPC8245, REVFMT_MAJMIN, + PPC_FEATURE_HAS_FPU, cpu_6xx_setup }, + { "Freescale e500v1 core", FSL_E500v1, REVFMT_MAJMIN, + 0, cpu_e500_setup }, + { "Freescale e500v2 core", FSL_E500v2, REVFMT_MAJMIN, + 0, cpu_e500_setup }, + { "Unknown PowerPC CPU", 0, REVFMT_HEX, 0, NULL }, }; +static void cpu_6xx_print_cacheinfo(u_int, uint16_t); +static int cpu_feature_bit(SYSCTL_HANDLER_ARGS); + static char model[64]; SYSCTL_STRING(_hw, HW_MODEL, model, CTLFLAG_RD, model, 0, ""); -static void cpu_print_speed(void); - -static void cpu_6xx_setup(int cpuid, uint16_t vers); -static void cpu_6xx_print_cacheinfo(u_int, uint16_t); -static void cpu_e500_setup(int cpuid, uint16_t vers); -#ifndef E500 -static void cpu_970_setup(int cpuid, uint16_t vers); -#endif +int cpu_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU; +SYSCTL_OPAQUE(_hw, OID_AUTO, cpu_features, CTLTYPE_INT | CTLFLAG_RD, + &cpu_features, sizeof(cpu_features), "IX", "PowerPC CPU features"); + +/* Provide some user-friendly aliases for bits in cpu_features */ +SYSCTL_PROC(_hw, OID_AUTO, floatingpoint, CTLTYPE_INT | CTLFLAG_RD, + 0, PPC_FEATURE_HAS_FPU, cpu_feature_bit, "I", + "Floating point instructions executed in hardware"); +SYSCTL_PROC(_hw, OID_AUTO, altivec, CTLTYPE_INT | CTLFLAG_RD, + 0, PPC_FEATURE_HAS_ALTIVEC, cpu_feature_bit, "I", "CPU supports Altivec"); void cpu_setup(u_int cpuid) { u_int pvr, maj, min; uint16_t vers, rev, revfmt; + uint64_t cps; const struct cputab *cp; const char *name; @@ -175,57 +219,19 @@ cpu_setup(u_int cpuid) break; } + if (cpu_est_clockrate(0, &cps) == 0) + printf(", %lld.%02lld MHz", cps / 1000000, (cps / 10000) % 100); + printf("\n"); + + cpu_features |= cp->features; + printf("cpu%d: Features %b\n", cpuid, cpu_features, + PPC_FEATURE_BITMASK); + /* * Configure CPU */ - switch (vers) { - case MPC603: - case MPC603e: - case MPC603ev: - case MPC604ev: - case MPC750: - case IBM750FX: - case MPC7400: - case MPC7410: - case MPC7447A: - case MPC7448: - case MPC7450: - case MPC7455: - case MPC7457: - case MPC8240: - case MPC8245: - cpu_6xx_setup(cpuid, vers); - break; - -#ifndef E500 - case IBM970: - case IBM970FX: - case IBM970GX: - case IBM970MP: - cpu_970_setup(cpuid, vers); - break; -#endif - - case FSL_E500v1: - case FSL_E500v2: - cpu_e500_setup(cpuid, vers); - break; - - default: - /* HID setup is unknown */ - break; - } - - printf("\n"); -} - -void -cpu_print_speed(void) -{ - uint64_t cps; - - if (cpu_est_clockrate(0, &cps) == 0) - printf(", %lld.%02lld MHz", cps / 1000000, (cps / 10000) % 100); + if (cp->cpu_setup != NULL) + cp->cpu_setup(cpuid, vers); } /* Get current clock frequency for the given cpu id. */ @@ -351,9 +357,6 @@ cpu_6xx_setup(int cpuid, uint16_t vers) mtspr(SPR_HID0, hid0); - cpu_print_speed(); - printf("\n"); - if (bootverbose) cpu_6xx_print_cacheinfo(cpuid, vers); @@ -370,7 +373,7 @@ cpu_6xx_setup(int cpuid, uint16_t vers) break; } - printf("cpu%d: HID0 %b", cpuid, (int)hid0, bitmask); + printf("cpu%d: HID0 %b\n", cpuid, (int)hid0, bitmask); } @@ -429,16 +432,14 @@ cpu_e500_setup(int cpuid, uint16_t vers) { register_t hid0; - printf("\n"); - hid0 = mfspr(SPR_HID0); - printf("cpu%d: HID0 %b", cpuid, (int)hid0, HID0_E500_BITMASK); + printf("cpu%d: HID0 %b\n", cpuid, (int)hid0, HID0_E500_BITMASK); } -#ifndef E500 static void cpu_970_setup(int cpuid, uint16_t vers) { +#ifdef AIM uint32_t hid0_hi, hid0_lo; __asm __volatile ("mfspr %0,%2; clrldi %1,%0,32; srdi %0,%0,32;" @@ -458,11 +459,19 @@ cpu_970_setup(int cpuid, uint16_t vers) sync; isync" :: "r" (hid0_hi), "r"(hid0_lo), "K" (SPR_HID0)); - cpu_print_speed(); - printf("\n"); - __asm __volatile ("mfspr %0,%1; srdi %0,%0,32;" : "=r" (hid0_hi) : "K" (SPR_HID0)); - printf("cpu%d: HID0 %b", cpuid, (int)(hid0_hi), HID0_970_BITMASK); -} + printf("cpu%d: HID0 %b\n", cpuid, (int)(hid0_hi), HID0_970_BITMASK); #endif +} + +static int +cpu_feature_bit(SYSCTL_HANDLER_ARGS) +{ + int result; + + result = (cpu_features & arg2) ? 1 : 0; + + return (sysctl_handle_int(oidp, &result, 0, req)); +} + From owner-svn-src-all@FreeBSD.ORG Sat Nov 28 17:44:58 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5D88E1065676; Sat, 28 Nov 2009 17:44:58 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 32D388FC18; Sat, 28 Nov 2009 17:44:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nASHiwvj062520; Sat, 28 Nov 2009 17:44:58 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nASHiw7e062518; Sat, 28 Nov 2009 17:44:58 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200911281744.nASHiw7e062518@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sat, 28 Nov 2009 17:44:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199887 - head/sys/opencrypto X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Nov 2009 17:44:58 -0000 Author: bz Date: Sat Nov 28 17:44:57 2009 New Revision: 199887 URL: http://svn.freebsd.org/changeset/base/199887 Log: Z_PARTIAL_FLUSH is marked deprecated. Z_SYNC_FLUSH is the suggested replacement but only use it for inflate. For deflate use Z_FINISH as Z_SYNC_FLUSH adds a trailing marker in some cases that inflate(), despite the comment in zlib, does npt seem to cope well with, resulting in errors when uncompressing exactly fills the outbut buffer without a Z_STREAM_END and a successive call returns an error. MFC after: 6 days Modified: head/sys/opencrypto/deflate.c Modified: head/sys/opencrypto/deflate.c ============================================================================== --- head/sys/opencrypto/deflate.c Sat Nov 28 17:33:19 2009 (r199886) +++ head/sys/opencrypto/deflate.c Sat Nov 28 17:44:57 2009 (r199887) @@ -138,8 +138,8 @@ deflate_global(data, size, decomp, out) goto bad; } for (;;) { - error = decomp ? inflate(&zbuf, Z_PARTIAL_FLUSH) : - deflate(&zbuf, Z_PARTIAL_FLUSH); + 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, @@ -153,9 +153,13 @@ deflate_global(data, size, decomp, out) zbuf.state->dummy, zbuf.total_out); goto bad; } - else if (zbuf.avail_in == 0 && zbuf.avail_out != 0) - goto end; - else if (zbuf.avail_out == 0 && i < (ZBUF - 1)) { + 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) { /* we need more output space, allocate size */ buf[i].out = malloc((u_long) size, M_CRYPTO_DATA, M_NOWAIT); @@ -170,6 +174,7 @@ deflate_global(data, size, decomp, out) zbuf.avail_out = buf[i].size; i++; } else { + /* Unexpect result. */ /* * Unfortunately we are limited to 5 arguments, * thus, again, use two probes. @@ -184,7 +189,6 @@ deflate_global(data, size, decomp, out) } } -end: result = count = zbuf.total_out; *out = malloc((u_long) result, M_CRYPTO_DATA, M_NOWAIT); From owner-svn-src-all@FreeBSD.ORG Sat Nov 28 17:48:26 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 71FB6106566B; Sat, 28 Nov 2009 17:48:25 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5FE088FC19; Sat, 28 Nov 2009 17:48:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nASHmP5L062628; Sat, 28 Nov 2009 17:48:25 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nASHmPOx062624; Sat, 28 Nov 2009 17:48:25 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <200911281748.nASHmPOx062624@svn.freebsd.org> From: Nathan Whitehorn Date: Sat, 28 Nov 2009 17:48:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199888 - head/sys/dev/adb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Nov 2009 17:48:26 -0000 Author: nwhitehorn Date: Sat Nov 28 17:48:25 2009 New Revision: 199888 URL: http://svn.freebsd.org/changeset/base/199888 Log: Add support for interpreting taps on ADB touchpads as a button click. Submitted by: Andreas Tobler MFC after: 2 weeks Modified: head/sys/dev/adb/adb.h head/sys/dev/adb/adb_bus.c head/sys/dev/adb/adb_mouse.c Modified: head/sys/dev/adb/adb.h ============================================================================== --- head/sys/dev/adb/adb.h Sat Nov 28 17:44:57 2009 (r199887) +++ head/sys/dev/adb/adb.h Sat Nov 28 17:48:25 2009 (r199888) @@ -69,6 +69,7 @@ uint8_t adb_get_device_handler(device_t uint8_t adb_set_device_handler(device_t dev, uint8_t newhandler); size_t adb_read_register(device_t dev, u_char reg, void *data); +size_t adb_write_register(device_t dev, u_char reg, size_t len, void *data); /* Bits for implementing ADB host bus adapters */ extern devclass_t adb_devclass; Modified: head/sys/dev/adb/adb_bus.c ============================================================================== --- head/sys/dev/adb/adb_bus.c Sat Nov 28 17:44:57 2009 (r199887) +++ head/sys/dev/adb/adb_bus.c Sat Nov 28 17:48:25 2009 (r199888) @@ -402,3 +402,21 @@ adb_read_register(device_t dev, u_char r return (result); } +size_t +adb_write_register(device_t dev, u_char reg, size_t len, void *data) +{ + struct adb_softc *sc; + struct adb_devinfo *dinfo; + size_t result; + + dinfo = device_get_ivars(dev); + sc = device_get_softc(device_get_parent(dev)); + + result = adb_send_raw_packet_sync(sc->sc_dev,dinfo->address, + ADB_COMMAND_LISTEN, reg, len, (u_char *)data, NULL); + + result = adb_send_raw_packet_sync(sc->sc_dev,dinfo->address, + ADB_COMMAND_TALK, reg, 0, NULL, NULL); + + return (result); +} Modified: head/sys/dev/adb/adb_mouse.c ============================================================================== --- head/sys/dev/adb/adb_mouse.c Sat Nov 28 17:44:57 2009 (r199887) +++ head/sys/dev/adb/adb_mouse.c Sat Nov 28 17:48:25 2009 (r199888) @@ -35,6 +35,7 @@ #include #include #include +#include #include #include #include @@ -51,6 +52,8 @@ static int adb_mouse_probe(device_t dev); static int adb_mouse_attach(device_t dev); static int adb_mouse_detach(device_t dev); +static void adb_init_trackpad(device_t dev); +static int adb_tapping_sysctl(SYSCTL_HANDLER_ARGS); static d_open_t ams_open; static d_close_t ams_close; @@ -77,6 +80,8 @@ struct adb_mouse_softc { u_char id[4]; int buttons; + u_int sc_tapping; + int button_buf; int last_buttons; int xdelta, ydelta; @@ -167,6 +172,8 @@ adb_mouse_attach(device_t dev) sc->mode.packetsize = 5; sc->buttons = 0; + sc->sc_tapping = 0; + sc->button_buf = 0; sc->last_buttons = 0; sc->packet_read_len = 0; @@ -205,6 +212,7 @@ adb_mouse_attach(device_t dev) case 3: sc->flags |= AMS_TOUCHPAD; sc->hw.type = MOUSE_PAD; + adb_init_trackpad(dev); description = "Touchpad"; break; } @@ -259,6 +267,70 @@ adb_mouse_detach(device_t dev) return (0); } +static void +adb_init_trackpad(device_t dev) +{ + struct adb_mouse_softc *sc; + struct sysctl_ctx_list *ctx; + struct sysctl_oid *tree; + + size_t r1_len; + u_char r1[8]; + u_char r2[8]; + + sc = device_get_softc(dev); + + r1_len = adb_read_register(dev, 1, r1); + + /* An Extended Mouse register1 must return 8 bytes. */ + if (r1_len != 8) + return; + + if((r1[6] != 0x0d)) + { + r1[6] = 0x0d; + + adb_write_register(dev, 1, 8, r1); + + r1_len = adb_read_register(dev, 1, r1); + + if (r1[6] != 0x0d) + { + device_printf(dev, "ADB Mouse = 0x%x " + "(non-Extended Mode)\n", r1[6]); + return; + } else { + device_printf(dev, "ADB Mouse = 0x%x " + "(Extended Mode)\n", r1[6]); + + /* Set ADB Extended Features to default values, + enabled. */ + r2[0] = 0x19; /* Clicking: 0x19 disabled 0x99 enabled */ + r2[1] = 0x94; /* Dragging: 0x14 disabled 0x94 enabled */ + r2[2] = 0x19; + r2[3] = 0xff; /* DragLock: 0xff disabled 0xb2 enabled */ + r2[4] = 0xb2; + r2[5] = 0x8a; + r2[6] = 0x1b; + + r2[7] = 0x57; /* 0x57 bits 3:0 for W mode */ + + adb_write_register(dev, 2, 8, r2); + + } + } + + /* + * Set up sysctl + */ + ctx = device_get_sysctl_ctx(dev); + tree = device_get_sysctl_tree(dev); + SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, "tapping", + CTLTYPE_INT | CTLFLAG_RW, sc, 0, adb_tapping_sysctl, + "I", "Tapping the pad causes button events"); + return; +} + static u_int adb_mouse_receive_packet(device_t dev, u_char status, u_char command, u_char reg, int len, u_char *data) @@ -266,7 +338,7 @@ adb_mouse_receive_packet(device_t dev, u struct adb_mouse_softc *sc; int i = 0; int xdelta, ydelta; - int buttons; + int buttons, tmp_buttons; sc = device_get_softc(dev); @@ -298,6 +370,30 @@ adb_mouse_receive_packet(device_t dev, u if (ydelta & (0x40 << 3*(len-2))) ydelta |= 0xffffffc0 << 3*(len - 2); + if ((sc->flags & AMS_TOUCHPAD) && (sc->sc_tapping == 1)) { + tmp_buttons = buttons; + if (buttons == 0x12) { + /* Map a double tap on button 3. + Keep the button state for the next sequence. + A double tap sequence is followed by a single tap + sequence. + */ + tmp_buttons = 0x3; + sc->button_buf = tmp_buttons; + } else if (buttons == 0x2) { + /* Map a single tap on button 2. But only if it is + not a successor from a double tap. + */ + if (sc->button_buf != 0x3) + tmp_buttons = 0x2; + else + tmp_buttons = 0; + + sc->button_buf = 0; + } + buttons = tmp_buttons; + } + /* * Some mice report high-numbered buttons on the wrong button number, * so set the highest-numbered real button as pressed if there are @@ -554,3 +650,36 @@ ams_ioctl(struct cdev *dev, u_long cmd, return (0); } +static int +adb_tapping_sysctl(SYSCTL_HANDLER_ARGS) +{ + struct adb_mouse_softc *sc = arg1; + device_t dev; + int error; + u_char r2[8]; + u_int tapping; + + dev = sc->sc_dev; + tapping = sc->sc_tapping; + + error = sysctl_handle_int(oidp, &tapping, 0, req); + + if (error || !req->newptr) + return (error); + + if (tapping == 1) { + adb_read_register(dev, 2, r2); + r2[0] = 0x99; /* enable tapping. */ + adb_write_register(dev, 2, 8, r2); + sc->sc_tapping = 1; + } else if (tapping == 0) { + adb_read_register(dev, 2, r2); + r2[0] = 0x19; /* disable tapping. */ + adb_write_register(dev, 2, 8, r2); + sc->sc_tapping = 0; + } + else + return (EINVAL); + + return (0); +} From owner-svn-src-all@FreeBSD.ORG Sat Nov 28 18:34:35 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DF6D91065672; Sat, 28 Nov 2009 18:34:35 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CD8E18FC14; Sat, 28 Nov 2009 18:34:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nASIYZGk063680; Sat, 28 Nov 2009 18:34:35 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nASIYZPq063677; Sat, 28 Nov 2009 18:34:35 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <200911281834.nASIYZPq063677@svn.freebsd.org> From: Nathan Whitehorn Date: Sat, 28 Nov 2009 18:34:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199889 - stable/8/sys/powerpc/aim X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Nov 2009 18:34:36 -0000 Author: nwhitehorn Date: Sat Nov 28 18:34:35 2009 New Revision: 199889 URL: http://svn.freebsd.org/changeset/base/199889 Log: MFC r197961,197962: Fix two typos that caused DSISR and CR not to be preserved across context switches. Modified: stable/8/sys/powerpc/aim/swtch.S stable/8/sys/powerpc/aim/trap_subr.S Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/powerpc/aim/swtch.S ============================================================================== --- stable/8/sys/powerpc/aim/swtch.S Sat Nov 28 17:48:25 2009 (r199888) +++ stable/8/sys/powerpc/aim/swtch.S Sat Nov 28 18:34:35 2009 (r199889) @@ -171,7 +171,7 @@ ENTRY(savectx) mr %r12,%r2 stmw %r12,PCB_CONTEXT(%r3) /* Save the non-volatile GP regs */ mfcr %r4 /* Save the condition register */ - stw %r4,PCB_CONTEXT(%r3) + stw %r4,PCB_CR(%r3) blr /* Modified: stable/8/sys/powerpc/aim/trap_subr.S ============================================================================== --- stable/8/sys/powerpc/aim/trap_subr.S Sat Nov 28 17:48:25 2009 (r199888) +++ stable/8/sys/powerpc/aim/trap_subr.S Sat Nov 28 18:34:35 2009 (r199889) @@ -451,7 +451,7 @@ disitrap: lwz %r30,(PC_TEMPSAVE+CPUSAVE_AIM_DAR)(%r1) /* get DAR */ stw %r30,(PC_DBSAVE +CPUSAVE_AIM_DAR)(%r1) /* save DAR */ lwz %r30,(PC_TEMPSAVE+CPUSAVE_AIM_DSISR)(%r1) /* get DSISR */ - lwz %r30,(PC_DBSAVE +CPUSAVE_AIM_DSISR)(%r1) /* save DSISR */ + stw %r30,(PC_DBSAVE +CPUSAVE_AIM_DSISR)(%r1) /* save DSISR */ lwz %r30,(PC_DISISAVE+CPUSAVE_R28)(%r1) /* get r28 */ stw %r30,(PC_DBSAVE +CPUSAVE_R28)(%r1) /* save r28 */ lwz %r31,(PC_DISISAVE+CPUSAVE_R29)(%r1) /* get r29 */ From owner-svn-src-all@FreeBSD.ORG Sat Nov 28 18:36:58 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E0C09106566C; Sat, 28 Nov 2009 18:36:58 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B498E8FC16; Sat, 28 Nov 2009 18:36:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nASIawIB063770; Sat, 28 Nov 2009 18:36:58 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nASIawIM063767; Sat, 28 Nov 2009 18:36:58 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <200911281836.nASIawIM063767@svn.freebsd.org> From: Nathan Whitehorn Date: Sat, 28 Nov 2009 18:36:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199890 - stable/8/sys/powerpc/aim X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Nov 2009 18:36:59 -0000 Author: nwhitehorn Date: Sat Nov 28 18:36:58 2009 New Revision: 199890 URL: http://svn.freebsd.org/changeset/base/199890 Log: MFC r198400: Do not map the trap vectors into the kernel's address space. They are only used in real mode and keeping them mapped only serves to make NULL a valid address, which results in silent NULL pointer deferences. Suggested by: Patrick Kerharo Obtained from: projects/ppc64 Modified: stable/8/sys/powerpc/aim/mmu_oea64.c stable/8/sys/powerpc/aim/trap_subr.S Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/powerpc/aim/mmu_oea64.c ============================================================================== --- stable/8/sys/powerpc/aim/mmu_oea64.c Sat Nov 28 18:34:35 2009 (r199889) +++ stable/8/sys/powerpc/aim/mmu_oea64.c Sat Nov 28 18:36:58 2009 (r199890) @@ -869,15 +869,17 @@ moea64_bridge_bootstrap(mmu_t mmup, vm_o ENABLE_TRANS(msr); /* - * Map certain important things, like ourselves and the exception - * vectors + * Map certain important things, like ourselves. + * + * NOTE: We do not map the exception vector space. That code is + * used only in real mode, and leaving it unmapped allows us to + * catch NULL pointer deferences, instead of making NULL a valid + * address. */ DISABLE_TRANS(msr); for (pa = kernelstart & ~PAGE_MASK; pa < kernelend; pa += PAGE_SIZE) moea64_kenter(mmup, pa, pa); - for (pa = EXC_RSVD; pa < EXC_LAST; pa += PAGE_SIZE) - moea64_kenter(mmup, pa, pa); ENABLE_TRANS(msr); if (!ofw_real_mode) { Modified: stable/8/sys/powerpc/aim/trap_subr.S ============================================================================== --- stable/8/sys/powerpc/aim/trap_subr.S Sat Nov 28 18:34:35 2009 (r199889) +++ stable/8/sys/powerpc/aim/trap_subr.S Sat Nov 28 18:36:58 2009 (r199890) @@ -275,10 +275,16 @@ CNAME(restorebridgesize) = .-CNAME(resto /* * Processor reset exception handler. These are typically * the first instructions the processor executes after a - * software reset. + * software reset. We do this in two bits so that we are + * not still hanging around in the trap handling region + * once the MMU is turned on. */ .globl CNAME(rstcode), CNAME(rstsize) CNAME(rstcode): + ba cpu_reset +CNAME(rstsize) = . - CNAME(rstcode) + +cpu_reset: bl 1f .space 124 @@ -296,7 +302,6 @@ CNAME(rstcode): /* Should not be reached */ 9: b 9b -CNAME(rstsize) = . - CNAME(rstcode) #endif /* From owner-svn-src-all@FreeBSD.ORG Sat Nov 28 19:37:58 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 79D18106566B; Sat, 28 Nov 2009 19:37:58 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 668B58FC16; Sat, 28 Nov 2009 19:37:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nASJbwaw065137; Sat, 28 Nov 2009 19:37:58 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nASJbwbl065123; Sat, 28 Nov 2009 19:37:58 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <200911281937.nASJbwbl065123@svn.freebsd.org> From: Nathan Whitehorn Date: Sat, 28 Nov 2009 19:37:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199891 - in stable/8/sys/powerpc: aim booke include powerpc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Nov 2009 19:37:58 -0000 Author: nwhitehorn Date: Sat Nov 28 19:37:58 2009 New Revision: 199891 URL: http://svn.freebsd.org/changeset/base/199891 Log: MFC r198212,198378,198427,198428,198723,198724,198725,198731: SMP support for PowerPC G5 systems. r198724: Fix a race in casuword() exposed by csup. casuword() non-atomically read the current value of its argument before atomically replacing it, which could occasionally return the wrong value on an SMP system. This resulted in user mutex operations hanging when using threaded applications. r198723,198725,198731: Loop on blocked threads when using ULE scheduler, removing an XXX MP comment. r198427: Add some more paranoia to setting HID registers, and update the AIM clock routines to work better with SMP. r198378: Add SMP support on U3-based G5 systems. While here, correct the 64-bit tlbie function to set the CPU to 64-bit mode correctly. r198212: Don't assume that physical addresses are identity mapped. This allows the second processor on G5 systems to start. Modified: stable/8/sys/powerpc/aim/clock.c stable/8/sys/powerpc/aim/copyinout.c stable/8/sys/powerpc/aim/machdep.c stable/8/sys/powerpc/aim/mmu_oea64.c stable/8/sys/powerpc/aim/mp_cpudep.c stable/8/sys/powerpc/aim/platform_chrp.c stable/8/sys/powerpc/aim/swtch.S stable/8/sys/powerpc/booke/mp_cpudep.c stable/8/sys/powerpc/include/pcpu.h stable/8/sys/powerpc/include/smp.h stable/8/sys/powerpc/include/spr.h stable/8/sys/powerpc/powerpc/cpu.c stable/8/sys/powerpc/powerpc/mp_machdep.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/powerpc/aim/clock.c ============================================================================== --- stable/8/sys/powerpc/aim/clock.c Sat Nov 28 18:36:58 2009 (r199890) +++ stable/8/sys/powerpc/aim/clock.c Sat Nov 28 19:37:58 2009 (r199891) @@ -95,8 +95,7 @@ static struct timecounter decr_timecount void decr_intr(struct trapframe *frame) { - long tick; - int nticks; + int32_t tick, nticks; /* * Check whether we are initialized. @@ -113,12 +112,15 @@ decr_intr(struct trapframe *frame) tick += ticks_per_intr; mtdec(tick); - if (PCPU_GET(cpuid) == 0) { - while (nticks-- > 0) + while (nticks-- > 0) { + if (PCPU_GET(cpuid) == 0) hardclock(TRAPF_USERMODE(frame), TRAPF_PC(frame)); - } else { - while (nticks-- > 0) + else hardclock_cpu(TRAPF_USERMODE(frame)); + + statclock(TRAPF_USERMODE(frame)); + if (profprocs != 0) + profclock(TRAPF_USERMODE(frame), TRAPF_PC(frame)); } } @@ -145,6 +147,8 @@ decr_init(void) ticks_per_intr = ticks_per_sec / hz; mtdec(ticks_per_intr); + set_cputicker(mftb, ticks_per_sec, 0); + mtmsr(msr); } Modified: stable/8/sys/powerpc/aim/copyinout.c ============================================================================== --- stable/8/sys/powerpc/aim/copyinout.c Sat Nov 28 18:36:58 2009 (r199890) +++ stable/8/sys/powerpc/aim/copyinout.c Sat Nov 28 19:37:58 2009 (r199891) @@ -347,8 +347,19 @@ casuword(volatile u_long *addr, u_long o return (-1); } - val = *p; - (void) atomic_cmpset_32((volatile uint32_t *)p, old, new); + __asm __volatile ( + "1:\tlwarx %0, 0, %2\n\t" /* load old value */ + "cmplw %3, %0\n\t" /* compare */ + "bne 2f\n\t" /* exit if not equal */ + "stwcx. %4, 0, %2\n\t" /* attempt to store */ + "bne- 1b\n\t" /* spin if failed */ + "b 3f\n\t" /* we've succeeded */ + "2:\n\t" + "stwcx. %0, 0, %2\n\t" /* clear reservation (74xx) */ + "3:\n\t" + : "=&r" (val), "=m" (*p) + : "r" (p), "r" (old), "r" (new), "m" (*p) + : "cc", "memory"); td->td_pcb->pcb_onfault = NULL; Modified: stable/8/sys/powerpc/aim/machdep.c ============================================================================== --- stable/8/sys/powerpc/aim/machdep.c Sat Nov 28 18:36:58 2009 (r199890) +++ stable/8/sys/powerpc/aim/machdep.c Sat Nov 28 19:37:58 2009 (r199891) @@ -885,6 +885,8 @@ cpu_initclocks(void) { decr_tc_init(); + stathz = hz; + profhz = hz; } /* Modified: stable/8/sys/powerpc/aim/mmu_oea64.c ============================================================================== --- stable/8/sys/powerpc/aim/mmu_oea64.c Sat Nov 28 18:36:58 2009 (r199890) +++ stable/8/sys/powerpc/aim/mmu_oea64.c Sat Nov 28 19:37:58 2009 (r199891) @@ -182,35 +182,28 @@ va_to_vsid(pmap_t pm, vm_offset_t va) * Just to add to the fun, exceptions must be off as well * so that we can't trap in 64-bit mode. What a pain. */ +struct mtx tlbie_mutex; static __inline void TLBIE(pmap_t pmap, vm_offset_t va) { - register_t msr; - register_t scratch; - uint64_t vpn; register_t vpn_hi, vpn_lo; - -#if 1 - /* - * CPU documentation says that tlbie takes the VPN, not the - * VA. I think the code below does this correctly. We will see. - */ + register_t msr; + register_t scratch; vpn = (uint64_t)(va & ADDR_PIDX); if (pmap != NULL) vpn |= (va_to_vsid(pmap,va) << 28); -#else - vpn = va; -#endif vpn_hi = (uint32_t)(vpn >> 32); vpn_lo = (uint32_t)vpn; + mtx_lock_spin(&tlbie_mutex); __asm __volatile("\ mfmsr %0; \ clrldi %1,%0,49; \ - insrdi %1,1,1,0; \ + mtmsr %1; \ + insrdi %1,%5,1,0; \ mtmsrd %1; \ ptesync; \ \ @@ -222,7 +215,8 @@ TLBIE(pmap_t pmap, vm_offset_t va) { eieio; \ tlbsync; \ ptesync;" - : "=r"(msr), "=r"(scratch) : "r"(vpn_hi), "r"(vpn_lo), "r"(32)); + : "=r"(msr), "=r"(scratch) : "r"(vpn_hi), "r"(vpn_lo), "r"(32), "r"(1)); + mtx_unlock_spin(&tlbie_mutex); } #define DISABLE_TRANS(msr) msr = mfmsr(); mtmsr(msr & ~PSL_DR); isync() @@ -352,7 +346,7 @@ static int moea64_pte_insert(u_int, str * PVO calls. */ static int moea64_pvo_enter(pmap_t, uma_zone_t, struct pvo_head *, - vm_offset_t, vm_offset_t, uint64_t, int, int); + vm_offset_t, vm_offset_t, uint64_t, int); static void moea64_pvo_remove(struct pvo_entry *, int); static struct pvo_entry *moea64_pvo_find_va(pmap_t, vm_offset_t, int *); static struct lpte *moea64_pvo_to_pte(const struct pvo_entry *, int); @@ -825,6 +819,11 @@ moea64_bridge_bootstrap(mmu_t mmup, vm_o MTX_RECURSE); /* + * Initialize the TLBIE lock. TLBIE can only be executed by one CPU. + */ + mtx_init(&tlbie_mutex, "tlbie mutex", NULL, MTX_SPIN); + + /* * Initialise the unmanaged pvo pool. */ moea64_bpvo_pool = (struct pvo_entry *)moea64_bootstrap_alloc( @@ -1259,7 +1258,7 @@ moea64_enter_locked(pmap_t pmap, vm_offs pvo_flags |= PVO_FAKE; error = moea64_pvo_enter(pmap, zone, pvo_head, va, VM_PAGE_TO_PHYS(m), - pte_lo, pvo_flags, 0); + pte_lo, pvo_flags); if (pmap == kernel_pmap) TLBIE(pmap, va); @@ -1432,16 +1431,15 @@ moea64_uma_page_alloc(uma_zone_t zone, i if (pvo_allocator_start >= pvo_allocator_end) panic("Ran out of PVO allocator buffer space!"); - /* Now call pvo_enter in recursive mode */ moea64_pvo_enter(kernel_pmap, moea64_upvo_zone, &moea64_pvo_kunmanaged, va, VM_PAGE_TO_PHYS(m), LPTE_M, - PVO_WIRED | PVO_BOOTSTRAP, 1); + PVO_WIRED | PVO_BOOTSTRAP); TLBIE(kernel_pmap, va); - + if (needed_lock) PMAP_UNLOCK(kernel_pmap); - + if ((wait & M_ZERO) && (m->flags & PG_ZERO) == 0) bzero((void *)va, PAGE_SIZE); @@ -1584,7 +1582,7 @@ moea64_kenter(mmu_t mmu, vm_offset_t va, PMAP_LOCK(kernel_pmap); error = moea64_pvo_enter(kernel_pmap, moea64_upvo_zone, &moea64_pvo_kunmanaged, va, pa, pte_lo, - PVO_WIRED | VM_PROT_EXECUTE, 0); + PVO_WIRED | VM_PROT_EXECUTE); TLBIE(kernel_pmap, va); @@ -1972,14 +1970,29 @@ static void tlbia(void) { vm_offset_t i; + register_t msr, scratch; - for (i = 0; i < 0xFF000; i += 0x00001000) - TLBIE(NULL,i); + for (i = 0; i < 0xFF000; i += 0x00001000) { + __asm __volatile("\ + mfmsr %0; \ + mr %1, %0; \ + insrdi %1,%3,1,0; \ + mtmsrd %1; \ + ptesync; \ + \ + tlbiel %2; \ + \ + mtmsrd %0; \ + eieio; \ + tlbsync; \ + ptesync;" + : "=r"(msr), "=r"(scratch) : "r"(i), "r"(1)); + } } static int moea64_pvo_enter(pmap_t pm, uma_zone_t zone, struct pvo_head *pvo_head, - vm_offset_t va, vm_offset_t pa, uint64_t pte_lo, int flags, int recurse) + vm_offset_t va, vm_offset_t pa, uint64_t pte_lo, int flags) { struct pvo_entry *pvo; uint64_t vsid; @@ -2015,16 +2028,14 @@ moea64_pvo_enter(pmap_t pm, uma_zone_t z * Remove any existing mapping for this page. Reuse the pvo entry if * there is a mapping. */ - if (!recurse) - LOCK_TABLE(); + LOCK_TABLE(); LIST_FOREACH(pvo, &moea64_pvo_table[ptegidx], pvo_olink) { if (pvo->pvo_pmap == pm && PVO_VADDR(pvo) == va) { if ((pvo->pvo_pte.lpte.pte_lo & LPTE_RPGN) == pa && (pvo->pvo_pte.lpte.pte_lo & LPTE_PP) == (pte_lo & LPTE_PP)) { - if (!recurse) - UNLOCK_TABLE(); + UNLOCK_TABLE(); return (0); } moea64_pvo_remove(pvo, -1); @@ -2045,12 +2056,19 @@ moea64_pvo_enter(pmap_t pm, uma_zone_t z moea64_bpvo_pool_index++; bootstrap = 1; } else { + /* + * Note: drop the table around the UMA allocation in + * case the UMA allocator needs to manipulate the page + * table. The mapping we are working with is already + * protected by the PMAP lock. + */ + UNLOCK_TABLE(); pvo = uma_zalloc(zone, M_NOWAIT); + LOCK_TABLE(); } if (pvo == NULL) { - if (!recurse) - UNLOCK_TABLE(); + UNLOCK_TABLE(); return (ENOMEM); } @@ -2097,8 +2115,7 @@ moea64_pvo_enter(pmap_t pm, uma_zone_t z moea64_pte_overflow++; } - if (!recurse) - UNLOCK_TABLE(); + UNLOCK_TABLE(); return (first ? ENOENT : 0); } Modified: stable/8/sys/powerpc/aim/mp_cpudep.c ============================================================================== --- stable/8/sys/powerpc/aim/mp_cpudep.c Sat Nov 28 18:36:58 2009 (r199890) +++ stable/8/sys/powerpc/aim/mp_cpudep.c Sat Nov 28 19:37:58 2009 (r199891) @@ -48,14 +48,34 @@ __FBSDID("$FreeBSD$"); #include #include -extern void *rstcode; -extern register_t l2cr_config; -extern register_t l3cr_config; - void *ap_pcpu; +static register_t bsp_state[8] __aligned(8); + +static void cpudep_save_config(void *dummy); +SYSINIT(cpu_save_config, SI_SUB_CPU, SI_ORDER_ANY, cpudep_save_config, NULL); + +uintptr_t +cpudep_ap_bootstrap(void) +{ + register_t msr, sp; + + msr = PSL_KERNSET & ~PSL_EE; + mtmsr(msr); + isync(); + + __asm __volatile("mtsprg 0, %0" :: "r"(ap_pcpu)); + powerpc_sync(); + + pcpup->pc_curthread = pcpup->pc_idlethread; + pcpup->pc_curpcb = pcpup->pc_curthread->td_pcb; + sp = pcpup->pc_curpcb->pcb_sp; + + return (sp); +} + static register_t -l2_enable(void) +mpc745x_l2_enable(register_t l2cr_config) { register_t ccr; @@ -77,7 +97,7 @@ l2_enable(void) } static register_t -l3_enable(void) +mpc745x_l3_enable(register_t l3cr_config) { register_t ccr; @@ -109,7 +129,7 @@ l3_enable(void) } static register_t -l1d_enable(void) +mpc745x_l1d_enable(void) { register_t hid; @@ -127,7 +147,7 @@ l1d_enable(void) } static register_t -l1i_enable(void) +mpc745x_l1i_enable(void) { register_t hid; @@ -144,43 +164,118 @@ l1i_enable(void) return (hid); } -uint32_t -cpudep_ap_bootstrap(void) +static void +cpudep_save_config(void *dummy) { - uint32_t hid, msr, reg, sp; - - // reg = mfspr(SPR_MSSCR0); - // mtspr(SPR_MSSCR0, reg | 0x3); - - __asm __volatile("mtsprg 0, %0" :: "r"(ap_pcpu)); - powerpc_sync(); + uint16_t vers; - __asm __volatile("mtspr 1023,%0" :: "r"(PCPU_GET(cpuid))); - __asm __volatile("mfspr %0,1023" : "=r"(pcpup->pc_pir)); - - msr = PSL_FP | PSL_IR | PSL_DR | PSL_ME | PSL_RI; - powerpc_sync(); - isync(); - mtmsr(msr); - isync(); + vers = mfpvr() >> 16; - if (l3cr_config != 0) - reg = l3_enable(); - if (l2cr_config != 0) - reg = l2_enable(); - reg = l1d_enable(); - reg = l1i_enable(); - - hid = mfspr(SPR_HID0); - hid &= ~(HID0_DOZE | HID0_SLEEP); - hid |= HID0_NAP | HID0_DPM; - mtspr(SPR_HID0, hid); - isync(); - - pcpup->pc_curthread = pcpup->pc_idlethread; - pcpup->pc_curpcb = pcpup->pc_curthread->td_pcb; - sp = pcpup->pc_curpcb->pcb_sp; + switch(vers) { + case IBM970: + case IBM970FX: + case IBM970MP: + __asm __volatile ("mfspr %0,%2; mr %1,%0; srdi %0,%0,32" + : "=r" (bsp_state[0]),"=r" (bsp_state[1]) : "K" (SPR_HID0)); + __asm __volatile ("mfspr %0,%2; mr %1,%0; srdi %0,%0,32" + : "=r" (bsp_state[2]),"=r" (bsp_state[3]) : "K" (SPR_HID1)); + __asm __volatile ("mfspr %0,%2; mr %1,%0; srdi %0,%0,32" + : "=r" (bsp_state[4]),"=r" (bsp_state[5]) : "K" (SPR_HID4)); + __asm __volatile ("mfspr %0,%2; mr %1,%0; srdi %0,%0,32" + : "=r" (bsp_state[6]),"=r" (bsp_state[7]) : "K" (SPR_HID5)); + + powerpc_sync(); + + break; + case MPC7450: + case MPC7455: + case MPC7457: + /* Only MPC745x CPUs have an L3 cache. */ + bsp_state[3] = mfspr(SPR_L3CR); + + /* Fallthrough */ + case MPC7400: + case MPC7410: + case MPC7447A: + case MPC7448: + bsp_state[2] = mfspr(SPR_L2CR); + bsp_state[1] = mfspr(SPR_HID1); + bsp_state[0] = mfspr(SPR_HID0); + break; + } +} - return (sp); +void +cpudep_ap_setup() +{ + register_t reg; + uint16_t vers; + + vers = mfpvr() >> 16; + + switch(vers) { + case IBM970: + case IBM970FX: + case IBM970MP: + /* Set HIOR to 0 */ + __asm __volatile("mtspr 311,%0" :: "r"(0)); + powerpc_sync(); + + /* + * The 970 has strange rules about how to update HID registers. + * See Table 2-3, 970MP manual + */ + + __asm __volatile("mtasr %0; sync" :: "r"(0)); + __asm __volatile(" \ + ld %0,0(%2); \ + sync; isync; \ + mtspr %1, %0; \ + mfspr %0, %1; mfspr %0, %1; mfspr %0, %1; \ + mfspr %0, %1; mfspr %0, %1; mfspr %0, %1; \ + sync; isync" + : "=r"(reg) : "K"(SPR_HID0), "r"(bsp_state)); + __asm __volatile("ld %0, 8(%2); sync; isync; \ + mtspr %1, %0; mtspr %1, %0; sync; isync" + : "=r"(reg) : "K"(SPR_HID1), "r"(bsp_state)); + __asm __volatile("ld %0, 16(%2); sync; isync; \ + mtspr %1, %0; sync; isync;" + : "=r"(reg) : "K"(SPR_HID4), "r"(bsp_state)); + __asm __volatile("ld %0, 24(%2); sync; isync; \ + mtspr %1, %0; sync; isync;" + : "=r"(reg) : "K"(SPR_HID5), "r"(bsp_state)); + + powerpc_sync(); + 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: + /* XXX: Program the CPU ID into PIR */ + __asm __volatile("mtspr 1023,%0" :: "r"(PCPU_GET(cpuid))); + + powerpc_sync(); + isync(); + + mtspr(SPR_HID0, bsp_state[0]); isync(); + mtspr(SPR_HID1, bsp_state[1]); isync(); + + reg = mpc745x_l2_enable(bsp_state[2]); + reg = mpc745x_l1d_enable(); + reg = mpc745x_l1i_enable(); + + break; + default: + printf("WARNING: Unknown CPU type. Cache performace may be " + "suboptimal.\n"); + break; + } } Modified: stable/8/sys/powerpc/aim/platform_chrp.c ============================================================================== --- stable/8/sys/powerpc/aim/platform_chrp.c Sat Nov 28 18:36:58 2009 (r199890) +++ stable/8/sys/powerpc/aim/platform_chrp.c Sat Nov 28 19:37:58 2009 (r199891) @@ -35,11 +35,14 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include #include #include #include +#include #include #include @@ -220,6 +223,7 @@ chrp_smp_start_cpu(platform_t plat, stru #ifdef SMP phandle_t cpu; volatile uint8_t *rstvec; + static volatile uint8_t *rstvec_virtbase = NULL; int res, reset, timeout; cpu = pc->pc_hwref; @@ -229,15 +233,20 @@ chrp_smp_start_cpu(platform_t plat, stru ap_pcpu = pc; - rstvec = (uint8_t *)(0x80000000 + reset); + if (rstvec_virtbase == NULL) + rstvec_virtbase = pmap_mapdev(0x80000000, PAGE_SIZE); + + rstvec = rstvec_virtbase + reset; *rstvec = 4; + (void)(*rstvec); powerpc_sync(); DELAY(1); *rstvec = 0; + (void)(*rstvec); powerpc_sync(); - timeout = 1000; + timeout = 10000; while (!pc->pc_awake && timeout--) DELAY(100); Modified: stable/8/sys/powerpc/aim/swtch.S ============================================================================== --- stable/8/sys/powerpc/aim/swtch.S Sat Nov 28 18:36:58 2009 (r199890) +++ stable/8/sys/powerpc/aim/swtch.S Sat Nov 28 19:37:58 2009 (r199891) @@ -57,6 +57,7 @@ */ #include "assym.s" +#include "opt_sched.h" #include @@ -81,36 +82,36 @@ ENTRY(cpu_throw) * Switch to a new thread saving the current state in the old thread. */ ENTRY(cpu_switch) - stw %r5,TD_LOCK(%r3) /* ULE: update old thread's lock */ - /* XXX needs to change for MP */ - - lwz %r5,TD_PCB(%r3) /* Get the old thread's PCB ptr */ + lwz %r6,TD_PCB(%r3) /* Get the old thread's PCB ptr */ mr %r12,%r2 - stmw %r12,PCB_CONTEXT(%r5) /* Save the non-volatile GP regs. + stmw %r12,PCB_CONTEXT(%r6) /* Save the non-volatile GP regs. These can now be used for scratch */ mfcr %r16 /* Save the condition register */ - stw %r16,PCB_CR(%r5) + stw %r16,PCB_CR(%r6) mflr %r16 /* Save the link register */ - stw %r16,PCB_LR(%r5) + stw %r16,PCB_LR(%r6) mfsr %r16,USER_SR /* Save USER_SR for copyin/out */ isync - stw %r16,PCB_AIM_USR(%r5) - stw %r1,PCB_SP(%r5) /* Save the stack pointer */ + stw %r16,PCB_AIM_USR(%r6) + stw %r1,PCB_SP(%r6) /* Save the stack pointer */ mr %r14,%r3 /* Copy the old thread ptr... */ mr %r15,%r4 /* and the new thread ptr in scratch */ + mr %r16,%r5 /* and the new lock */ + mr %r17,%r6 /* and the PCB */ - lwz %r6,PCB_FLAGS(%r5) + lwz %r7,PCB_FLAGS(%r17) /* Save FPU context if needed */ - andi. %r6, %r6, PCB_FPU + andi. %r7, %r7, PCB_FPU beq .L1 bl save_fpu .L1: - lwz %r6,PCB_FLAGS(%r5) + mr %r3,%r14 /* restore old thread ptr */ + lwz %r7,PCB_FLAGS(%r17) /* Save Altivec context if needed */ - andi. %r6, %r6, PCB_VEC + andi. %r7, %r7, PCB_VEC beq .L2 bl save_vec @@ -118,7 +119,19 @@ ENTRY(cpu_switch) mr %r3,%r14 /* restore old thread ptr */ bl pmap_deactivate /* Deactivate the current pmap */ + stw %r16,TD_LOCK(%r14) /* ULE: update old thread's lock */ + cpu_switchin: +#if defined(SMP) && defined(SCHED_ULE) + /* Wait for the new thread to become unblocked */ + lis %r6,blocked_lock@ha + addi %r6,%r6,blocked_lock@l +blocked_loop: + lwz %r7,TD_LOCK(%r15) + cmpw %r6,%r7 + beq blocked_loop +#endif + mfsprg %r7,0 /* Get the pcpu pointer */ stw %r15,PC_CURTHREAD(%r7) /* Store new current thread */ lwz %r17,TD_PCB(%r15) /* Store new current PCB */ Modified: stable/8/sys/powerpc/booke/mp_cpudep.c ============================================================================== --- stable/8/sys/powerpc/booke/mp_cpudep.c Sat Nov 28 18:36:58 2009 (r199890) +++ stable/8/sys/powerpc/booke/mp_cpudep.c Sat Nov 28 19:37:58 2009 (r199891) @@ -47,7 +47,7 @@ extern void icache_inval(void); volatile void *ap_pcpu; -uint32_t +uintptr_t cpudep_ap_bootstrap() { uint32_t msr, sp, csr; @@ -78,3 +78,8 @@ cpudep_ap_bootstrap() return (sp); } + +void +cpudep_ap_setup() +{ +} Modified: stable/8/sys/powerpc/include/pcpu.h ============================================================================== --- stable/8/sys/powerpc/include/pcpu.h Sat Nov 28 18:36:58 2009 (r199890) +++ stable/8/sys/powerpc/include/pcpu.h Sat Nov 28 19:37:58 2009 (r199891) @@ -43,8 +43,8 @@ struct pmap; struct thread *pc_vecthread; /* current vec user */ \ uintptr_t pc_hwref; \ uint32_t pc_pir; \ - int pc_bsp:1; \ - int pc_awake:1; \ + int pc_bsp; \ + volatile int pc_awake; \ uint32_t pc_ipimask; \ register_t pc_tempsave[CPUSAVE_LEN]; \ register_t pc_disisave[CPUSAVE_LEN]; \ Modified: stable/8/sys/powerpc/include/smp.h ============================================================================== --- stable/8/sys/powerpc/include/smp.h Sat Nov 28 18:36:58 2009 (r199890) +++ stable/8/sys/powerpc/include/smp.h Sat Nov 28 19:37:58 2009 (r199891) @@ -48,7 +48,8 @@ struct cpuref { }; void pmap_cpu_bootstrap(int); -uint32_t cpudep_ap_bootstrap(void); +uintptr_t cpudep_ap_bootstrap(void); +void cpudep_ap_setup(void); void machdep_ap_bootstrap(void); #endif /* !LOCORE */ Modified: stable/8/sys/powerpc/include/spr.h ============================================================================== --- stable/8/sys/powerpc/include/spr.h Sat Nov 28 18:36:58 2009 (r199890) +++ stable/8/sys/powerpc/include/spr.h Sat Nov 28 19:37:58 2009 (r199891) @@ -50,7 +50,7 @@ #define mtspr64(reg,valhi,vallo,scratch) \ __asm __volatile(" \ mfmsr %0; \ - insrdi %0,1,1,0; \ + insrdi %0,%5,1,0; \ mtmsrd %0; \ isync; \ \ @@ -62,13 +62,13 @@ clrldi %0,%0,1; \ mtmsrd %0; \ isync;" \ - : "=r"(scratch), "=r"(valhi) : "r"(vallo), "K"(reg), "r"(32)) + : "=r"(scratch), "=r"(valhi) : "r"(vallo), "K"(reg), "r"(32), "r"(1)) #define mfspr64upper(reg,scratch) \ ( { register_t val; \ __asm __volatile(" \ mfmsr %0; \ - insrdi %0,1,1,0; \ + insrdi %0,%4,1,0; \ mtmsrd %0; \ isync; \ \ @@ -78,7 +78,7 @@ clrldi %0,%0,1; \ mtmsrd %0; \ isync;" \ - : "=r"(scratch), "=r"(val) : "K"(reg), "r"(32)); \ + : "=r"(scratch), "=r"(val) : "K"(reg), "r"(32), "r"(1)); \ val; } ) #endif /* _LOCORE */ Modified: stable/8/sys/powerpc/powerpc/cpu.c ============================================================================== --- stable/8/sys/powerpc/powerpc/cpu.c Sat Nov 28 18:36:58 2009 (r199890) +++ stable/8/sys/powerpc/powerpc/cpu.c Sat Nov 28 19:37:58 2009 (r199891) @@ -69,6 +69,7 @@ #include #include #include +#include #include int powerpc_pow_enabled; @@ -112,9 +113,6 @@ static const struct cputab models[] = { static char model[64]; SYSCTL_STRING(_hw, HW_MODEL, model, CTLFLAG_RD, model, 0, ""); -register_t l2cr_config = 0; -register_t l3cr_config = 0; - static void cpu_print_speed(void); static void cpu_print_cacheinfo(u_int, uint16_t); @@ -258,11 +256,6 @@ cpu_setup(u_int cpuid) case MPC7450: case MPC7455: case MPC7457: - /* Only MPC745x CPUs have an L3 cache. */ - - l3cr_config = mfspr(SPR_L3CR); - - /* Fallthrough */ case MPC750: case IBM750FX: case MPC7400: @@ -272,8 +265,6 @@ cpu_setup(u_int cpuid) cpu_print_speed(); printf("\n"); - l2cr_config = mfspr(SPR_L2CR); - if (bootverbose) cpu_print_cacheinfo(cpuid, vers); break; @@ -366,15 +357,15 @@ cpu_print_cacheinfo(u_int cpuid, uint16_ printf("L1 D-cache %sabled\n", (hid & HID0_DCE) ? "en" : "dis"); printf("cpu%u: ", cpuid); - if (l2cr_config & L2CR_L2E) { + if (mfspr(SPR_L2CR) & L2CR_L2E) { switch (vers) { case MPC7450: case MPC7455: case MPC7457: printf("256KB L2 cache, "); - if (l3cr_config & L3CR_L3E) + if (mfspr(SPR_L3CR) & L3CR_L3E) printf("%cMB L3 backside cache", - l3cr_config & L3CR_L3SIZ ? '2' : '1'); + mfspr(SPR_L3CR) & L3CR_L3SIZ ? '2' : '1'); else printf("L3 cache disabled"); printf("\n"); @@ -383,7 +374,7 @@ cpu_print_cacheinfo(u_int cpuid, uint16_ printf("512KB L2 cache\n"); break; default: - switch (l2cr_config & L2CR_L2SIZ) { + switch (mfspr(SPR_L2CR) & L2CR_L2SIZ) { case L2SIZ_256K: printf("256KB "); break; @@ -394,9 +385,9 @@ cpu_print_cacheinfo(u_int cpuid, uint16_ printf("1MB "); break; } - printf("write-%s", (l2cr_config & L2CR_L2WT) + printf("write-%s", (mfspr(SPR_L2CR) & L2CR_L2WT) ? "through" : "back"); - if (l2cr_config & L2CR_L2PE) + if (mfspr(SPR_L2CR) & L2CR_L2PE) printf(", with parity"); printf(" backside cache\n"); break; Modified: stable/8/sys/powerpc/powerpc/mp_machdep.c ============================================================================== --- stable/8/sys/powerpc/powerpc/mp_machdep.c Sat Nov 28 18:36:58 2009 (r199890) +++ stable/8/sys/powerpc/powerpc/mp_machdep.c Sat Nov 28 19:37:58 2009 (r199891) @@ -64,7 +64,10 @@ static u_int ipi_msg_cnt[32]; void machdep_ap_bootstrap(void) { + /* Set up important bits on the CPU (HID registers, etc.) */ + cpudep_ap_setup(); + /* Set PIR */ PCPU_SET(pir, mfspr(SPR_PIR)); PCPU_SET(awake, 1); __asm __volatile("msync; isync"); @@ -78,7 +81,7 @@ machdep_ap_bootstrap(void) __asm __volatile("mtdec %0" :: "r"(ap_decr)); atomic_add_int(&ap_awake, 1); - CTR1(KTR_SMP, "SMP: AP CPU%d launched", PCPU_GET(cpuid)); + printf("SMP: AP CPU #%d launched\n", PCPU_GET(cpuid)); /* Initialize curthread */ PCPU_SET(curthread, PCPU_GET(idlethread)); @@ -86,6 +89,8 @@ machdep_ap_bootstrap(void) /* Let the DEC and external interrupts go */ mtmsr(mfmsr() | PSL_EE); + + /* Announce ourselves awake, and enter the scheduler */ sched_throw(NULL); } @@ -247,6 +252,9 @@ cpu_mp_unleash(void *dummy) mp_ncpus, cpus, smp_cpus); } + /* Let the APs get into the scheduler */ + DELAY(10000); + smp_active = 1; smp_started = 1; } From owner-svn-src-all@FreeBSD.ORG Sat Nov 28 20:02:45 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A0CA6106568D; Sat, 28 Nov 2009 20:02:45 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 859EB8FC08; Sat, 28 Nov 2009 20:02:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nASK2j09065635; Sat, 28 Nov 2009 20:02:45 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nASK2jcb065633; Sat, 28 Nov 2009 20:02:45 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <200911282002.nASK2jcb065633@svn.freebsd.org> From: Nathan Whitehorn Date: Sat, 28 Nov 2009 20:02:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199892 - stable/8/sys/powerpc/aim X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Nov 2009 20:02:45 -0000 Author: nwhitehorn Date: Sat Nov 28 20:02:45 2009 New Revision: 199892 URL: http://svn.freebsd.org/changeset/base/199892 Log: MFC r199226: Provide a real fix to the too-many-translations problem when booting from CD on 64-bit hardware to replace existing band-aids. This occurred when the preloaded mdroot required too many mappings for the static buffer. Since we only use the translations buffer once, allocate a dynamic buffer on the stack. This early in the boot process, the call chain is quite short and we can be assured of having sufficient stack space. Modified: stable/8/sys/powerpc/aim/mmu_oea64.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/powerpc/aim/mmu_oea64.c ============================================================================== --- stable/8/sys/powerpc/aim/mmu_oea64.c Sat Nov 28 19:37:58 2009 (r199891) +++ stable/8/sys/powerpc/aim/mmu_oea64.c Sat Nov 28 20:02:45 2009 (r199892) @@ -264,7 +264,6 @@ static struct mem_region *pregions; extern u_int phys_avail_count; extern int regions_sz, pregions_sz; extern int ofw_real_mode; -static struct ofw_map translations[96]; extern struct pmap ofw_pmap; @@ -709,17 +708,73 @@ moea64_bridge_cpu_bootstrap(mmu_t mmup, } static void +moea64_add_ofw_mappings(mmu_t mmup, phandle_t mmu, size_t sz) +{ + struct ofw_map translations[sz/sizeof(struct ofw_map)]; + register_t msr; + vm_offset_t off; + int i, ofw_mappings; + + bzero(translations, sz); + if (OF_getprop(mmu, "translations", translations, sz) == -1) + panic("moea64_bootstrap: can't get ofw translations"); + + CTR0(KTR_PMAP, "moea64_add_ofw_mappings: translations"); + sz /= sizeof(*translations); + qsort(translations, sz, sizeof (*translations), om_cmp); + + for (i = 0, ofw_mappings = 0; i < sz; i++) { + CTR3(KTR_PMAP, "translation: pa=%#x va=%#x len=%#x", + (uint32_t)(translations[i].om_pa_lo), translations[i].om_va, + translations[i].om_len); + + if (translations[i].om_pa_lo % PAGE_SIZE) + panic("OFW translation not page-aligned!"); + + if (translations[i].om_pa_hi) + panic("OFW translations above 32-bit boundary!"); + + /* Now enter the pages for this mapping */ + + /* + * Lock the ofw pmap. pmap_kenter(), which we use for the + * pages the kernel also needs, does its own locking. + */ + PMAP_LOCK(&ofw_pmap); + DISABLE_TRANS(msr); + for (off = 0; off < translations[i].om_len; off += PAGE_SIZE) { + struct vm_page m; + + /* Map low memory mappings into the kernel pmap, too. + * These are typically mappings made by the loader, + * so we need them if we want to keep executing. */ + + if (translations[i].om_va + off < SEGMENT_LENGTH) + moea64_kenter(mmup, translations[i].om_va + off, + translations[i].om_va + off); + + m.phys_addr = translations[i].om_pa_lo + off; + moea64_enter_locked(&ofw_pmap, + translations[i].om_va + off, &m, VM_PROT_ALL, 1); + + ofw_mappings++; + } + ENABLE_TRANS(msr); + PMAP_UNLOCK(&ofw_pmap); + } +} + +static void moea64_bridge_bootstrap(mmu_t mmup, vm_offset_t kernelstart, vm_offset_t kernelend) { ihandle_t mmui; phandle_t chosen; phandle_t mmu; - int sz; + size_t sz; int i, j; - int ofw_mappings; vm_size_t size, physsz, hwphyssz; vm_offset_t pa, va, off; - uint32_t msr; + register_t msr; void *dpcpu; /* We don't have a direct map since there is no BAT */ @@ -865,7 +920,6 @@ moea64_bridge_bootstrap(mmu_t mmup, vm_o off = (vm_offset_t)(moea64_bpvo_pool); for (pa = off; pa < off + size; pa += PAGE_SIZE) moea64_kenter(mmup, pa, pa); - ENABLE_TRANS(msr); /* * Map certain important things, like ourselves. @@ -876,7 +930,6 @@ moea64_bridge_bootstrap(mmu_t mmup, vm_o * address. */ - DISABLE_TRANS(msr); for (pa = kernelstart & ~PAGE_MASK; pa < kernelend; pa += PAGE_SIZE) moea64_kenter(mmup, pa, pa); ENABLE_TRANS(msr); @@ -897,57 +950,10 @@ moea64_bridge_bootstrap(mmu_t mmup, vm_o panic("moea64_bootstrap: can't get mmu package"); if ((sz = OF_getproplen(mmu, "translations")) == -1) panic("moea64_bootstrap: can't get ofw translation count"); - if (sz > sizeof(translations)) - panic("moea64_bootstrap: too many ofw translations (%d)", - sz/sizeof(*translations)); - - bzero(translations, sz); - if (OF_getprop(mmu, "translations", translations, sz) == -1) - panic("moea64_bootstrap: can't get ofw translations"); - - CTR0(KTR_PMAP, "moea64_bootstrap: translations"); - sz /= sizeof(*translations); - qsort(translations, sz, sizeof (*translations), om_cmp); - - for (i = 0, ofw_mappings = 0; i < sz; i++) { - CTR3(KTR_PMAP, "translation: pa=%#x va=%#x len=%#x", - (uint32_t)(translations[i].om_pa_lo), translations[i].om_va, - translations[i].om_len); - - if (translations[i].om_pa_lo % PAGE_SIZE) - panic("OFW translation not page-aligned!"); - - if (translations[i].om_pa_hi) - panic("OFW translations above 32-bit boundary!"); - - /* Now enter the pages for this mapping */ - - /* - * Lock the ofw pmap. pmap_kenter(), which we use for the - * pages the kernel also needs, does its own locking. - */ - PMAP_LOCK(&ofw_pmap); - DISABLE_TRANS(msr); - for (off = 0; off < translations[i].om_len; off += PAGE_SIZE) { - struct vm_page m; - - /* Map low memory mappings into the kernel pmap, too. - * These are typically mappings made by the loader, - * so we need them if we want to keep executing. */ - - if (translations[i].om_va + off < SEGMENT_LENGTH) - moea64_kenter(mmup, translations[i].om_va + off, - translations[i].om_va + off); + if (sz > 6144 /* tmpstksz - 2 KB headroom */) + panic("moea64_bootstrap: too many ofw translations"); - m.phys_addr = translations[i].om_pa_lo + off; - moea64_enter_locked(&ofw_pmap, - translations[i].om_va + off, &m, VM_PROT_ALL, 1); - - ofw_mappings++; - } - ENABLE_TRANS(msr); - PMAP_UNLOCK(&ofw_pmap); - } + moea64_add_ofw_mappings(mmup, mmu, sz); } #ifdef SMP From owner-svn-src-all@FreeBSD.ORG Sat Nov 28 21:01:16 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0EDC9106566C; Sat, 28 Nov 2009 21:01:16 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F190E8FC0C; Sat, 28 Nov 2009 21:01:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nASL1FvK066840; Sat, 28 Nov 2009 21:01:15 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nASL1Fj4066839; Sat, 28 Nov 2009 21:01:15 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <200911282101.nASL1Fj4066839@svn.freebsd.org> From: Marcel Moolenaar Date: Sat, 28 Nov 2009 21:01:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199893 - in head/sys/ia64: ia64 include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Nov 2009 21:01:16 -0000 Author: marcel Date: Sat Nov 28 21:01:15 2009 New Revision: 199893 URL: http://svn.freebsd.org/changeset/base/199893 Log: Eliminate teh use of MAXCPU in static arrays of interrupt counters by adding statistics counters to the PCPU structure. Export the counters through sysctl by giving each PCPU structure its own sysctl context. While here, fix cnt.v_intr by not just having it count clock interrupts, but every interrupt and add more counters for each interrupt source. Modified: head/sys/ia64/ia64/interrupt.c head/sys/ia64/ia64/machdep.c head/sys/ia64/include/pcpu.h Modified: head/sys/ia64/ia64/interrupt.c ============================================================================== --- head/sys/ia64/ia64/interrupt.c Sat Nov 28 20:02:45 2009 (r199892) +++ head/sys/ia64/ia64/interrupt.c Sat Nov 28 21:01:15 2009 (r199893) @@ -84,28 +84,6 @@ dummy_perf(unsigned long vector, struct void (*perf_irq)(unsigned long, struct trapframe *) = dummy_perf; -static unsigned int ints[MAXCPU]; -SYSCTL_OPAQUE(_debug, OID_AUTO, ints, CTLFLAG_RW, &ints, sizeof(ints), "IU", - ""); - -static unsigned int clks[MAXCPU]; -#ifdef SMP -SYSCTL_OPAQUE(_debug, OID_AUTO, clks, CTLFLAG_RW, &clks, sizeof(clks), "IU", - ""); -#else -SYSCTL_INT(_debug, OID_AUTO, clks, CTLFLAG_RW, clks, 0, ""); -#endif - -#ifdef SMP -static unsigned int asts[MAXCPU]; -SYSCTL_OPAQUE(_debug, OID_AUTO, asts, CTLFLAG_RW, &asts, sizeof(asts), "IU", - ""); - -static unsigned int rdvs[MAXCPU]; -SYSCTL_OPAQUE(_debug, OID_AUTO, rdvs, CTLFLAG_RW, &rdvs, sizeof(rdvs), "IU", - ""); -#endif - SYSCTL_NODE(_debug, OID_AUTO, clock, CTLFLAG_RW, 0, "clock statistics"); static int adjust_edges = 0; @@ -139,6 +117,8 @@ interrupt(struct trapframe *tf) td = curthread; + PCPU_INC(cnt.v_intr); + vector = tf->tf_special.ifa; next: @@ -147,28 +127,30 @@ interrupt(struct trapframe *tf) * read the vector. */ if (vector == 0) { + PCPU_INC(stats.pcs_nextints); inta = ib->ib_inta; - printf("ExtINT interrupt: vector=%u\n", (int)inta); if (inta == 15) { + PCPU_INC(stats.pcs_nstrays); __asm __volatile("mov cr.eoi = r0;; srlz.d"); goto stray; } vector = (int)inta; - } else if (vector == 15) + } else if (vector == 15) { + PCPU_INC(stats.pcs_nstrays); goto stray; + } if (vector == CLOCK_VECTOR) {/* clock interrupt */ /* CTR0(KTR_INTR, "clock interrupt"); */ itc = ia64_get_itc(); - PCPU_INC(cnt.v_intr); + PCPU_INC(stats.pcs_nclks); #ifdef EVCNT_COUNTERS clock_intr_evcnt.ev_count++; #else intrcnt[INTRCNT_CLOCK]++; #endif - clks[PCPU_GET(cpuid)]++; critical_enter(); @@ -211,17 +193,19 @@ interrupt(struct trapframe *tf) #ifdef SMP } else if (vector == ipi_vector[IPI_AST]) { - asts[PCPU_GET(cpuid)]++; + PCPU_INC(stats.pcs_nasts); CTR1(KTR_SMP, "IPI_AST, cpuid=%d", PCPU_GET(cpuid)); } else if (vector == ipi_vector[IPI_HIGH_FP]) { + PCPU_INC(stats.pcs_nhighfps); ia64_highfp_save_ipi(); } else if (vector == ipi_vector[IPI_RENDEZVOUS]) { - rdvs[PCPU_GET(cpuid)]++; + PCPU_INC(stats.pcs_nrdvs); CTR1(KTR_SMP, "IPI_RENDEZVOUS, cpuid=%d", PCPU_GET(cpuid)); enable_intr(); smp_rendezvous_action(); disable_intr(); } else if (vector == ipi_vector[IPI_STOP]) { + PCPU_INC(stats.pcs_nstops); cpumask_t mybit = PCPU_GET(cpumask); /* Make sure IPI_STOP_HARD is mapped to IPI_STOP. */ @@ -235,6 +219,7 @@ interrupt(struct trapframe *tf) atomic_clear_int(&started_cpus, mybit); atomic_clear_int(&stopped_cpus, mybit); } else if (vector == ipi_vector[IPI_PREEMPT]) { + PCPU_INC(stats.pcs_npreempts); CTR1(KTR_SMP, "IPI_PREEMPT, cpuid=%d", PCPU_GET(cpuid)); __asm __volatile("mov cr.eoi = r0;; srlz.d"); enable_intr(); @@ -243,7 +228,7 @@ interrupt(struct trapframe *tf) goto stray; #endif } else { - ints[PCPU_GET(cpuid)]++; + PCPU_INC(stats.pcs_nhwints); atomic_add_int(&td->td_intr_nesting_level, 1); ia64_dispatch_intr(tf, vector); atomic_subtract_int(&td->td_intr_nesting_level, 1); Modified: head/sys/ia64/ia64/machdep.c ============================================================================== --- head/sys/ia64/ia64/machdep.c Sat Nov 28 20:02:45 2009 (r199892) +++ head/sys/ia64/ia64/machdep.c Sat Nov 28 21:01:15 2009 (r199893) @@ -139,8 +139,6 @@ SYSCTL_STRING(_hw, OID_AUTO, family, CTL extern vm_offset_t ksym_start, ksym_end; #endif -static void cpu_startup(void *); -SYSINIT(cpu, SI_SUB_CPU, SI_ORDER_FIRST, cpu_startup, NULL); struct msgbuf *msgbufp = NULL; @@ -247,9 +245,11 @@ identifycpu(void) } static void -cpu_startup(dummy) - void *dummy; +cpu_startup(void *dummy) { + char nodename[16]; + struct pcpu *pc; + struct pcpu_stats *pcs; /* * Good {morning,afternoon,evening,night}. @@ -302,7 +302,67 @@ cpu_startup(dummy) */ ia64_probe_sapics(); ia64_mca_init(); + + /* + * Create sysctl tree for per-CPU information. + */ + SLIST_FOREACH(pc, &cpuhead, pc_allcpu) { + pcs = &pc->pc_stats; + snprintf(nodename, sizeof(nodename), "cpu%u", pc->pc_cpuid); + sysctl_ctx_init(&pcs->pcs_sysctl_ctx); + pcs->pcs_sysctl_tree = SYSCTL_ADD_NODE(&pcs->pcs_sysctl_ctx, + SYSCTL_STATIC_CHILDREN(_machdep), OID_AUTO, nodename, + CTLFLAG_RD, NULL, ""); + if (pcs->pcs_sysctl_tree == NULL) + continue; + + SYSCTL_ADD_ULONG(&pcs->pcs_sysctl_ctx, + SYSCTL_CHILDREN(pcs->pcs_sysctl_tree), OID_AUTO, + "nasts", CTLFLAG_RD, &pcs->pcs_nasts, + "Number of IPI_AST interrupts"); + + SYSCTL_ADD_ULONG(&pcs->pcs_sysctl_ctx, + SYSCTL_CHILDREN(pcs->pcs_sysctl_tree), OID_AUTO, + "nclks", CTLFLAG_RD, &pcs->pcs_nclks, + "Number of clock interrupts"); + + SYSCTL_ADD_ULONG(&pcs->pcs_sysctl_ctx, + SYSCTL_CHILDREN(pcs->pcs_sysctl_tree), OID_AUTO, + "nextints", CTLFLAG_RD, &pcs->pcs_nextints, + "Number of ExtINT interrupts"); + + SYSCTL_ADD_ULONG(&pcs->pcs_sysctl_ctx, + SYSCTL_CHILDREN(pcs->pcs_sysctl_tree), OID_AUTO, + "nhighfps", CTLFLAG_RD, &pcs->pcs_nhighfps, + "Number of IPI_HIGH_FP interrupts"); + + SYSCTL_ADD_ULONG(&pcs->pcs_sysctl_ctx, + SYSCTL_CHILDREN(pcs->pcs_sysctl_tree), OID_AUTO, + "nhwints", CTLFLAG_RD, &pcs->pcs_nhwints, + "Number of hardware (device) interrupts"); + + SYSCTL_ADD_ULONG(&pcs->pcs_sysctl_ctx, + SYSCTL_CHILDREN(pcs->pcs_sysctl_tree), OID_AUTO, + "npreempts", CTLFLAG_RD, &pcs->pcs_npreempts, + "Number of IPI_PREEMPT interrupts"); + + SYSCTL_ADD_ULONG(&pcs->pcs_sysctl_ctx, + SYSCTL_CHILDREN(pcs->pcs_sysctl_tree), OID_AUTO, + "nrdvs", CTLFLAG_RD, &pcs->pcs_nrdvs, + "Number of IPI_RENDEZVOUS interrupts"); + + SYSCTL_ADD_ULONG(&pcs->pcs_sysctl_ctx, + SYSCTL_CHILDREN(pcs->pcs_sysctl_tree), OID_AUTO, + "nstops", CTLFLAG_RD, &pcs->pcs_nstops, + "Number of IPI_STOP interrupts"); + + SYSCTL_ADD_ULONG(&pcs->pcs_sysctl_ctx, + SYSCTL_CHILDREN(pcs->pcs_sysctl_tree), OID_AUTO, + "nstrays", CTLFLAG_RD, &pcs->pcs_nstrays, + "Number of stray vectors"); + } } +SYSINIT(cpu_startup, SI_SUB_CPU, SI_ORDER_FIRST, cpu_startup, NULL); void cpu_boot(int howto) Modified: head/sys/ia64/include/pcpu.h ============================================================================== --- head/sys/ia64/include/pcpu.h Sat Nov 28 20:02:45 2009 (r199892) +++ head/sys/ia64/include/pcpu.h Sat Nov 28 21:01:15 2009 (r199893) @@ -30,8 +30,24 @@ #ifndef _MACHINE_PCPU_H_ #define _MACHINE_PCPU_H_ +#include #include +struct pcpu_stats { + struct sysctl_ctx_list pcs_sysctl_ctx; + struct sysctl_oid *pcs_sysctl_tree; + + u_long pcs_nasts; /* IPI_AST counter. */ + u_long pcs_nclks; /* Clock interrupt counter. */ + u_long pcs_nextints; /* ExtINT counter. */ + u_long pcs_nhighfps; /* IPI_HIGH_FP counter. */ + u_long pcs_nhwints; /* Hardware int. counter. */ + u_long pcs_npreempts; /* IPI_PREEMPT counter. */ + u_long pcs_nrdvs; /* IPI_RENDEZVOUS counter. */ + u_long pcs_nstops; /* IPI_STOP counter. */ + u_long pcs_nstrays; /* Stray interrupt counter. */ +}; + #define PCPU_MD_FIELDS \ struct pcb pc_pcb; /* Used by IPI_STOP */ \ struct pmap *pc_current_pmap; /* active pmap */ \ @@ -39,7 +55,8 @@ uint64_t pc_clock; /* Clock counter. */ \ uint64_t pc_clockadj; /* Clock adjust. */ \ uint32_t pc_awake:1; /* CPU is awake? */ \ - uint32_t pc_acpi_id /* ACPI CPU id. */ + uint32_t pc_acpi_id; /* ACPI CPU id. */ \ + struct pcpu_stats pc_stats #ifdef _KERNEL From owner-svn-src-all@FreeBSD.ORG Sat Nov 28 21:01:26 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C712D1065785; Sat, 28 Nov 2009 21:01:26 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B752A8FC08; Sat, 28 Nov 2009 21:01:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nASL1Qgm066879; Sat, 28 Nov 2009 21:01:26 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nASL1QiL066877; Sat, 28 Nov 2009 21:01:26 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200911282101.nASL1QiL066877@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sat, 28 Nov 2009 21:01:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199894 - head/sys/netipsec X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Nov 2009 21:01:26 -0000 Author: bz Date: Sat Nov 28 21:01:26 2009 New Revision: 199894 URL: http://svn.freebsd.org/changeset/base/199894 Log: Correct a typo. MFC after: 6 days Modified: head/sys/netipsec/ipsec_mbuf.c Modified: head/sys/netipsec/ipsec_mbuf.c ============================================================================== --- head/sys/netipsec/ipsec_mbuf.c Sat Nov 28 21:01:15 2009 (r199893) +++ head/sys/netipsec/ipsec_mbuf.c Sat Nov 28 21:01:26 2009 (r199894) @@ -69,7 +69,7 @@ m_makespace(struct mbuf *m0, int skip, i * At this point skip is the offset into the mbuf m * where the new header should be placed. Figure out * if there's space to insert the new header. If so, - * and copying the remainder makese sense then do so. + * and copying the remainder makes sense then do so. * Otherwise insert a new mbuf in the chain, splitting * the contents of m as needed. */ From owner-svn-src-all@FreeBSD.ORG Sat Nov 28 21:08:19 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 707C6106568B; Sat, 28 Nov 2009 21:08:19 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 550C58FC12; Sat, 28 Nov 2009 21:08:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nASL8Jxt067055; Sat, 28 Nov 2009 21:08:19 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nASL8J0Y067052; Sat, 28 Nov 2009 21:08:19 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200911282108.nASL8J0Y067052@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sat, 28 Nov 2009 21:08:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199895 - head/sys/opencrypto X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Nov 2009 21:08:19 -0000 Author: bz Date: Sat Nov 28 21:08:19 2009 New Revision: 199895 URL: http://svn.freebsd.org/changeset/base/199895 Log: Change memory managment from a fixed size array to a list. This is needed to avoid running into out of buffer situations where we cannot alloc a new buffer because we hit the array size limit (ZBUF). Use a combined allocation for the struct and the actual data buffer to not increase the number of malloc calls. [1] Defer initialization of zbuf until we actually need it. Make sure the output buffer will be large enough in all cases. Details discussed with: kib [1] Reviewed by: kib [1] MFC after: 6 days Modified: head/sys/opencrypto/deflate.c head/sys/opencrypto/deflate.h Modified: head/sys/opencrypto/deflate.c ============================================================================== --- head/sys/opencrypto/deflate.c Sat Nov 28 21:01:26 2009 (r199894) +++ head/sys/opencrypto/deflate.c Sat Nov 28 21:08:19 2009 (r199895) @@ -79,64 +79,59 @@ deflate_global(data, size, decomp, out) z_stream zbuf; u_int8_t *output; u_int32_t count, result; - int error, i = 0, j; - struct deflate_buf buf[ZBUF]; + int error, i; + struct deflate_buf *bufh, *bufp; SDT_PROBE2(opencrypto, deflate, deflate_global, entry, decomp, size); - bzero(&zbuf, sizeof(z_stream)); - for (j = 0; j < ZBUF; j++) - buf[j].flag = 0; - - zbuf.next_in = data; /* data that is going to be processed */ - zbuf.zalloc = z_alloc; - zbuf.zfree = z_free; - zbuf.opaque = Z_NULL; - zbuf.avail_in = size; /* Total length of data to be processed */ - + bufh = bufp = NULL; if (!decomp) { - buf[i].out = malloc((u_long) size, M_CRYPTO_DATA, - M_NOWAIT); - if (buf[i].out == NULL) { - SDT_PROBE3(opencrypto, deflate, deflate_global, bad, - decomp, 0, __LINE__); - goto bad; - } - buf[i].size = size; - buf[i].flag = 1; - i++; + 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 + * updated while the decompression is going on. */ - - buf[i].out = malloc((u_long) (size * 4), - M_CRYPTO_DATA, M_NOWAIT); - if (buf[i].out == NULL) { - SDT_PROBE3(opencrypto, deflate, deflate_global, bad, - decomp, 0, __LINE__); - goto bad; - } - buf[i].size = size * 4; - buf[i].flag = 1; + 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; - zbuf.next_out = buf[0].out; - zbuf.avail_out = buf[0].size; + 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); @@ -160,19 +155,22 @@ deflate_global(data, size, decomp, out) /* Done. */ break; } else if (zbuf.avail_out == 0) { - /* we need more output space, allocate size */ - buf[i].out = malloc((u_long) size, + 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 (buf[i].out == NULL) { + if (p == NULL) { SDT_PROBE3(opencrypto, deflate, deflate_global, bad, decomp, 0, __LINE__); goto bad; } - zbuf.next_out = buf[i].out; - buf[i].size = size; - buf[i].flag = 1; - zbuf.avail_out = buf[i].size; - i++; + 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. */ /* @@ -191,7 +189,7 @@ deflate_global(data, size, decomp, out) result = count = zbuf.total_out; - *out = malloc((u_long) result, M_CRYPTO_DATA, M_NOWAIT); + *out = malloc(result, M_CRYPTO_DATA, M_NOWAIT); if (*out == NULL) { SDT_PROBE3(opencrypto, deflate, deflate_global, bad, decomp, 0, __LINE__); @@ -202,17 +200,22 @@ deflate_global(data, size, decomp, out) else deflateEnd(&zbuf); output = *out; - for (j = 0; buf[j].flag != 0; j++) { - if (count > buf[j].size) { - bcopy(buf[j].out, *out, buf[j].size); - *out += buf[j].size; - free(buf[j].out, M_CRYPTO_DATA); - count -= buf[j].size; + 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(buf[j].out, *out, count); + /* It should be the last buffer. */ + bcopy(bufp->data, *out, count); *out += count; - free(buf[j].out, M_CRYPTO_DATA); + free(bufp, M_CRYPTO_DATA); + bufp = NULL; count = 0; } } @@ -221,13 +224,19 @@ deflate_global(data, size, decomp, out) return result; bad: - *out = NULL; - for (j = 0; buf[j].flag != 0; j++) - free(buf[j].out, M_CRYPTO_DATA); 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; } Modified: head/sys/opencrypto/deflate.h ============================================================================== --- head/sys/opencrypto/deflate.h Sat Nov 28 21:01:26 2009 (r199894) +++ head/sys/opencrypto/deflate.h Sat Nov 28 21:08:19 2009 (r199895) @@ -47,10 +47,14 @@ u_int32_t deflate_global(u_int8_t *, u_i void *z_alloc(void *, u_int, u_int); void z_free(void *, void *); +/* + * We are going to use a combined allocation to hold the metadata + * from the struct immediately followed by the real application data. + */ struct deflate_buf { - u_int8_t *out; - u_int32_t size; - int flag; + struct deflate_buf *next; + uint32_t size; + uint8_t data[]; }; #endif /* _CRYPTO_DEFLATE_H_ */ From owner-svn-src-all@FreeBSD.ORG Sat Nov 28 21:40:58 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F307D106566B; Sat, 28 Nov 2009 21:40:57 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E31EC8FC0A; Sat, 28 Nov 2009 21:40:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nASLevcL067740; Sat, 28 Nov 2009 21:40:57 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nASLevDa067738; Sat, 28 Nov 2009 21:40:57 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200911282140.nASLevDa067738@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sat, 28 Nov 2009 21:40:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199896 - head/sys/netipsec X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Nov 2009 21:40:58 -0000 Author: bz Date: Sat Nov 28 21:40:57 2009 New Revision: 199896 URL: http://svn.freebsd.org/changeset/base/199896 Log: Directly send data uncompressed if the packet payload size is lower than the compression algorithm threshold. MFC after: 6 days Modified: head/sys/netipsec/xform_ipcomp.c Modified: head/sys/netipsec/xform_ipcomp.c ============================================================================== --- head/sys/netipsec/xform_ipcomp.c Sat Nov 28 21:08:19 2009 (r199895) +++ head/sys/netipsec/xform_ipcomp.c Sat Nov 28 21:40:57 2009 (r199896) @@ -343,6 +343,17 @@ ipcomp_output( ipcompx = sav->tdb_compalgxform; IPSEC_ASSERT(ipcompx != NULL, ("null compression xform")); + /* + * Do not touch the packet in case our payload to compress + * is lower than the minimal threshold of the compression + * alogrithm. We will just send out the data uncompressed. + * See RFC 3173, 2.2. Non-Expansion Policy. + */ + if (m->m_pkthdr.len <= ipcompx->minlen) { + /* XXX-BZ V_ipcompstat.threshold++; */ + return ipsec_process_done(m, isr); + } + ralen = m->m_pkthdr.len - skip; /* Raw payload length before comp. */ hlen = IPCOMP_HLENGTH; From owner-svn-src-all@FreeBSD.ORG Sat Nov 28 21:42:40 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 016F8106566C; Sat, 28 Nov 2009 21:42:40 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E5AEF8FC18; Sat, 28 Nov 2009 21:42:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nASLgdG8067814; Sat, 28 Nov 2009 21:42:39 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nASLgdrA067812; Sat, 28 Nov 2009 21:42:39 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200911282142.nASLgdrA067812@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sat, 28 Nov 2009 21:42:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199897 - head/sys/netipsec X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Nov 2009 21:42:40 -0000 Author: bz Date: Sat Nov 28 21:42:39 2009 New Revision: 199897 URL: http://svn.freebsd.org/changeset/base/199897 Log: Remove whitespace. MFC after: 6 days Modified: head/sys/netipsec/xform_ipcomp.c Modified: head/sys/netipsec/xform_ipcomp.c ============================================================================== --- head/sys/netipsec/xform_ipcomp.c Sat Nov 28 21:40:57 2009 (r199896) +++ head/sys/netipsec/xform_ipcomp.c Sat Nov 28 21:42:39 2009 (r199897) @@ -363,12 +363,12 @@ ipcomp_output( switch (sav->sah->saidx.dst.sa.sa_family) { #ifdef INET case AF_INET: - maxpacketsize = IP_MAXPACKET; + maxpacketsize = IP_MAXPACKET; break; #endif /* INET */ #ifdef INET6 case AF_INET6: - maxpacketsize = IPV6_MAXPACKET; + maxpacketsize = IPV6_MAXPACKET; break; #endif /* INET6 */ default: @@ -565,7 +565,7 @@ ipcomp_output_cb(struct cryptop *crp) DPRINTF(("%s: unknown/unsupported protocol " "family %d, IPCA %s/%08lx\n", __func__, sav->sah->saidx.dst.sa.sa_family, - ipsec_address(&sav->sah->saidx.dst), + ipsec_address(&sav->sah->saidx.dst), (u_long) ntohl(sav->spi))); error = EPFNOSUPPORT; goto bad; From owner-svn-src-all@FreeBSD.ORG Sat Nov 28 23:50:49 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 14AE31065670; Sat, 28 Nov 2009 23:50:49 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 02D158FC19; Sat, 28 Nov 2009 23:50:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nASNonKD070517; Sat, 28 Nov 2009 23:50:49 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nASNom1a070511; Sat, 28 Nov 2009 23:50:48 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200911282350.nASNom1a070511@svn.freebsd.org> From: Ed Schouten Date: Sat, 28 Nov 2009 23:50:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199898 - in head: include sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Nov 2009 23:50:49 -0000 Author: ed Date: Sat Nov 28 23:50:48 2009 New Revision: 199898 URL: http://svn.freebsd.org/changeset/base/199898 Log: Decompose . The header file is hardlinked to . It contains both the structures and the flag definitions, but also the C library interface that's implemented by the C library. This header file has the typical problem of including too many random things and being badly ordered. Instead of trying to fix this, decompose it into two header files: - , which contains struct termios and the flags. - , which includes and contains the C library interface. This means userspace has to include for struct termios, while kernelspace code has to include . Also add a , which prints a warning message before including . I am aware that there are some applications that use this header file as well. Added: head/include/termios.h - copied, changed from r199870, head/sys/sys/termios.h head/sys/sys/_termios.h - copied, changed from r199870, head/sys/sys/termios.h Modified: head/include/Makefile head/sys/sys/termios.h head/sys/sys/tty.h Modified: head/include/Makefile ============================================================================== --- head/include/Makefile Sat Nov 28 21:42:39 2009 (r199897) +++ head/include/Makefile Sat Nov 28 23:50:48 2009 (r199898) @@ -21,7 +21,7 @@ INCS= a.out.h ar.h assert.h bitstring.h res_update.h resolv.h runetype.h search.h setjmp.h \ signal.h spawn.h stab.h \ stdbool.h stddef.h stdio.h stdlib.h string.h stringlist.h \ - strings.h sysexits.h tar.h tgmath.h \ + strings.h sysexits.h tar.h termios.h tgmath.h \ time.h timeconv.h timers.h ttyent.h \ ulimit.h unistd.h utime.h utmp.h uuid.h varargs.h vis.h wchar.h \ wctype.h wordexp.h @@ -31,7 +31,7 @@ MHDRS= float.h floatingpoint.h stdarg.h PHDRS= sched.h semaphore.h _semaphore.h LHDRS= aio.h errno.h fcntl.h linker_set.h poll.h stdint.h syslog.h \ - termios.h ucontext.h + ucontext.h LDIRS= bsm cam geom net net80211 netatalk netgraph netinet netinet6 \ netipsec ${_netipx} netnatm ${_netncp} netsmb \ Copied and modified: head/include/termios.h (from r199870, head/sys/sys/termios.h) ============================================================================== --- head/sys/sys/termios.h Sat Nov 28 00:50:09 2009 (r199870, copy source) +++ head/include/termios.h Sat Nov 28 23:50:48 2009 (r199898) @@ -30,208 +30,22 @@ * $FreeBSD$ */ -#ifndef _SYS_TERMIOS_H_ -#define _SYS_TERMIOS_H_ +#ifndef _TERMIOS_H_ +#define _TERMIOS_H_ +#include +#include #include + #ifndef _PID_T_DECLARED typedef __pid_t pid_t; #define _PID_T_DECLARED #endif -/* - * Special Control Characters - * - * Index into c_cc[] character array. - * - * Name Subscript Enabled by - */ -#define VEOF 0 /* ICANON */ -#define VEOL 1 /* ICANON */ -#ifndef _POSIX_SOURCE -#define VEOL2 2 /* ICANON together with IEXTEN */ -#endif -#define VERASE 3 /* ICANON */ -#ifndef _POSIX_SOURCE -#define VWERASE 4 /* ICANON together with IEXTEN */ -#endif -#define VKILL 5 /* ICANON */ -#ifndef _POSIX_SOURCE -#define VREPRINT 6 /* ICANON together with IEXTEN */ -#define VERASE2 7 /* ICANON */ -#endif -/* 7 ex-spare 1 */ -#define VINTR 8 /* ISIG */ -#define VQUIT 9 /* ISIG */ -#define VSUSP 10 /* ISIG */ -#ifndef _POSIX_SOURCE -#define VDSUSP 11 /* ISIG together with IEXTEN */ -#endif -#define VSTART 12 /* IXON, IXOFF */ -#define VSTOP 13 /* IXON, IXOFF */ -#ifndef _POSIX_SOURCE -#define VLNEXT 14 /* IEXTEN */ -#define VDISCARD 15 /* IEXTEN */ -#endif -#define VMIN 16 /* !ICANON */ -#define VTIME 17 /* !ICANON */ -#ifndef _POSIX_SOURCE -#define VSTATUS 18 /* ICANON together with IEXTEN */ -/* 19 spare 2 */ -#endif -#define NCCS 20 - -#define _POSIX_VDISABLE 0xff - -/* - * Input flags - software input processing - */ -#define IGNBRK 0x00000001 /* ignore BREAK condition */ -#define BRKINT 0x00000002 /* map BREAK to SIGINTR */ -#define IGNPAR 0x00000004 /* ignore (discard) parity errors */ -#define PARMRK 0x00000008 /* mark parity and framing errors */ -#define INPCK 0x00000010 /* enable checking of parity errors */ -#define ISTRIP 0x00000020 /* strip 8th bit off chars */ -#define INLCR 0x00000040 /* map NL into CR */ -#define IGNCR 0x00000080 /* ignore CR */ -#define ICRNL 0x00000100 /* map CR to NL (ala CRMOD) */ -#define IXON 0x00000200 /* enable output flow control */ -#define IXOFF 0x00000400 /* enable input flow control */ -#ifndef _POSIX_SOURCE -#define IXANY 0x00000800 /* any char will restart after stop */ -#define IMAXBEL 0x00002000 /* ring bell on input queue full */ -#endif /*_POSIX_SOURCE */ - -/* - * Output flags - software output processing - */ -#define OPOST 0x00000001 /* enable following output processing */ #ifndef _POSIX_SOURCE -#define ONLCR 0x00000002 /* map NL to CR-NL (ala CRMOD) */ -#define TABDLY 0x00000004 /* tab delay mask */ -#define TAB0 0x00000000 /* no tab delay and expansion */ -#define TAB3 0x00000004 /* expand tabs to spaces */ -#ifndef _KERNEL #define OXTABS TAB3 -#endif /* !_KERNEL */ -#define ONOEOT 0x00000008 /* discard EOT's (^D) on output) */ -#define OCRNL 0x00000010 /* map CR to NL on output */ -#define ONOCR 0x00000020 /* no CR output at column 0 */ -#define ONLRET 0x00000040 /* NL performs CR function */ -#endif /*_POSIX_SOURCE */ - -/* - * Control flags - hardware control of terminal - */ -#ifndef _POSIX_SOURCE -#define CIGNORE 0x00000001 /* ignore control flags */ -#endif -#define CSIZE 0x00000300 /* character size mask */ -#define CS5 0x00000000 /* 5 bits (pseudo) */ -#define CS6 0x00000100 /* 6 bits */ -#define CS7 0x00000200 /* 7 bits */ -#define CS8 0x00000300 /* 8 bits */ -#define CSTOPB 0x00000400 /* send 2 stop bits */ -#define CREAD 0x00000800 /* enable receiver */ -#define PARENB 0x00001000 /* parity enable */ -#define PARODD 0x00002000 /* odd parity, else even */ -#define HUPCL 0x00004000 /* hang up on last close */ -#define CLOCAL 0x00008000 /* ignore modem status lines */ -#ifndef _POSIX_SOURCE -#define CCTS_OFLOW 0x00010000 /* CTS flow control of output */ -#define CRTSCTS (CCTS_OFLOW | CRTS_IFLOW) -#define CRTS_IFLOW 0x00020000 /* RTS flow control of input */ -#define CDTR_IFLOW 0x00040000 /* DTR flow control of input */ -#define CDSR_OFLOW 0x00080000 /* DSR flow control of output */ -#define CCAR_OFLOW 0x00100000 /* DCD flow control of output */ -#ifndef _KERNEL #define MDMBUF CCAR_OFLOW -#endif /* !_KERNEL */ -#endif - - -/* - * "Local" flags - dumping ground for other state - * - * Warning: some flags in this structure begin with - * the letter "I" and look like they belong in the - * input flag. - */ - -#ifndef _POSIX_SOURCE -#define ECHOKE 0x00000001 /* visual erase for line kill */ -#endif /*_POSIX_SOURCE */ -#define ECHOE 0x00000002 /* visually erase chars */ -#define ECHOK 0x00000004 /* echo NL after line kill */ -#define ECHO 0x00000008 /* enable echoing */ -#define ECHONL 0x00000010 /* echo NL even if ECHO is off */ -#ifndef _POSIX_SOURCE -#define ECHOPRT 0x00000020 /* visual erase mode for hardcopy */ -#define ECHOCTL 0x00000040 /* echo control chars as ^(Char) */ -#endif /*_POSIX_SOURCE */ -#define ISIG 0x00000080 /* enable signals INTR, QUIT, [D]SUSP */ -#define ICANON 0x00000100 /* canonicalize input lines */ -#ifndef _POSIX_SOURCE -#define ALTWERASE 0x00000200 /* use alternate WERASE algorithm */ -#endif /*_POSIX_SOURCE */ -#define IEXTEN 0x00000400 /* enable DISCARD and LNEXT */ -#define EXTPROC 0x00000800 /* external processing */ -#define TOSTOP 0x00400000 /* stop background jobs from output */ -#ifndef _POSIX_SOURCE -#define FLUSHO 0x00800000 /* output being flushed (state) */ -#define NOKERNINFO 0x02000000 /* no kernel output from VSTATUS */ -#define PENDIN 0x20000000 /* XXX retype pending input (state) */ -#endif /*_POSIX_SOURCE */ -#define NOFLSH 0x80000000 /* don't flush after interrupt */ - -typedef unsigned int tcflag_t; -typedef unsigned char cc_t; -typedef unsigned int speed_t; - -struct termios { - tcflag_t c_iflag; /* input flags */ - tcflag_t c_oflag; /* output flags */ - tcflag_t c_cflag; /* control flags */ - tcflag_t c_lflag; /* local flags */ - cc_t c_cc[NCCS]; /* control chars */ - speed_t c_ispeed; /* input speed */ - speed_t c_ospeed; /* output speed */ -}; - -/* - * Standard speeds - */ -#define B0 0 -#define B50 50 -#define B75 75 -#define B110 110 -#define B134 134 -#define B150 150 -#define B200 200 -#define B300 300 -#define B600 600 -#define B1200 1200 -#define B1800 1800 -#define B2400 2400 -#define B4800 4800 -#define B9600 9600 -#define B19200 19200 -#define B38400 38400 -#ifndef _POSIX_SOURCE -#define B7200 7200 -#define B14400 14400 -#define B28800 28800 -#define B57600 57600 -#define B76800 76800 -#define B115200 115200 -#define B230400 230400 -#define B460800 460800 -#define B921600 921600 -#define EXTA 19200 -#define EXTB 38400 -#endif /* !_POSIX_SOURCE */ - -#ifndef _KERNEL +#endif #ifndef _POSIX_SOURCE #define CCEQ(val, c) ((c) == (val) && (val) != _POSIX_VDISABLE) @@ -255,8 +69,6 @@ struct termios { #define TCIOFF 3 #define TCION 4 -#include - __BEGIN_DECLS speed_t cfgetispeed(const struct termios *); speed_t cfgetospeed(const struct termios *); @@ -280,23 +92,9 @@ int cfsetspeed(struct termios *, speed_t #endif __END_DECLS -#endif /* !_KERNEL */ +#endif /* !_TERMIOS_H_ */ #ifndef _POSIX_SOURCE - -/* - * Include tty ioctl's that aren't just for backwards compatibility - * with the old tty driver. These ioctl definitions were previously - * in . - */ #include -#endif - -/* - * END OF PROTECTED INCLUDE. - */ -#endif /* !_SYS_TERMIOS_H_ */ - -#ifndef _POSIX_SOURCE #include #endif Copied and modified: head/sys/sys/_termios.h (from r199870, head/sys/sys/termios.h) ============================================================================== --- head/sys/sys/termios.h Sat Nov 28 00:50:09 2009 (r199870, copy source) +++ head/sys/sys/_termios.h Sat Nov 28 23:50:48 2009 (r199898) @@ -30,14 +30,8 @@ * $FreeBSD$ */ -#ifndef _SYS_TERMIOS_H_ -#define _SYS_TERMIOS_H_ - -#include -#ifndef _PID_T_DECLARED -typedef __pid_t pid_t; -#define _PID_T_DECLARED -#endif +#ifndef _SYS__TERMIOS_H_ +#define _SYS__TERMIOS_H_ /* * Special Control Characters @@ -111,9 +105,6 @@ typedef __pid_t pid_t; #define TABDLY 0x00000004 /* tab delay mask */ #define TAB0 0x00000000 /* no tab delay and expansion */ #define TAB3 0x00000004 /* expand tabs to spaces */ -#ifndef _KERNEL -#define OXTABS TAB3 -#endif /* !_KERNEL */ #define ONOEOT 0x00000008 /* discard EOT's (^D) on output) */ #define OCRNL 0x00000010 /* map CR to NL on output */ #define ONOCR 0x00000020 /* no CR output at column 0 */ @@ -144,9 +135,6 @@ typedef __pid_t pid_t; #define CDTR_IFLOW 0x00040000 /* DTR flow control of input */ #define CDSR_OFLOW 0x00080000 /* DSR flow control of output */ #define CCAR_OFLOW 0x00100000 /* DCD flow control of output */ -#ifndef _KERNEL -#define MDMBUF CCAR_OFLOW -#endif /* !_KERNEL */ #endif @@ -184,20 +172,6 @@ typedef __pid_t pid_t; #endif /*_POSIX_SOURCE */ #define NOFLSH 0x80000000 /* don't flush after interrupt */ -typedef unsigned int tcflag_t; -typedef unsigned char cc_t; -typedef unsigned int speed_t; - -struct termios { - tcflag_t c_iflag; /* input flags */ - tcflag_t c_oflag; /* output flags */ - tcflag_t c_cflag; /* control flags */ - tcflag_t c_lflag; /* local flags */ - cc_t c_cc[NCCS]; /* control chars */ - speed_t c_ispeed; /* input speed */ - speed_t c_ospeed; /* output speed */ -}; - /* * Standard speeds */ @@ -231,72 +205,18 @@ struct termios { #define EXTB 38400 #endif /* !_POSIX_SOURCE */ -#ifndef _KERNEL - -#ifndef _POSIX_SOURCE -#define CCEQ(val, c) ((c) == (val) && (val) != _POSIX_VDISABLE) -#endif - -/* - * Commands passed to tcsetattr() for setting the termios structure. - */ -#define TCSANOW 0 /* make change immediate */ -#define TCSADRAIN 1 /* drain output, then change */ -#define TCSAFLUSH 2 /* drain output, flush input */ -#ifndef _POSIX_SOURCE -#define TCSASOFT 0x10 /* flag - don't alter h.w. state */ -#endif - -#define TCIFLUSH 1 -#define TCOFLUSH 2 -#define TCIOFLUSH 3 -#define TCOOFF 1 -#define TCOON 2 -#define TCIOFF 3 -#define TCION 4 - -#include - -__BEGIN_DECLS -speed_t cfgetispeed(const struct termios *); -speed_t cfgetospeed(const struct termios *); -int cfsetispeed(struct termios *, speed_t); -int cfsetospeed(struct termios *, speed_t); -int tcgetattr(int, struct termios *); -int tcsetattr(int, int, const struct termios *); -int tcdrain(int); -int tcflow(int, int); -int tcflush(int, int); -int tcsendbreak(int, int); - -#if __POSIX_VISIBLE >= 200112 || __BSD_VISIBLE -pid_t tcgetsid(int); -#endif -#if __BSD_VISIBLE -int tcsetsid(int, pid_t); - -void cfmakeraw(struct termios *); -int cfsetspeed(struct termios *, speed_t); -#endif -__END_DECLS - -#endif /* !_KERNEL */ - -#ifndef _POSIX_SOURCE - -/* - * Include tty ioctl's that aren't just for backwards compatibility - * with the old tty driver. These ioctl definitions were previously - * in . - */ -#include -#endif +typedef unsigned int tcflag_t; +typedef unsigned char cc_t; +typedef unsigned int speed_t; -/* - * END OF PROTECTED INCLUDE. - */ -#endif /* !_SYS_TERMIOS_H_ */ +struct termios { + tcflag_t c_iflag; /* input flags */ + tcflag_t c_oflag; /* output flags */ + tcflag_t c_cflag; /* control flags */ + tcflag_t c_lflag; /* local flags */ + cc_t c_cc[NCCS]; /* control chars */ + speed_t c_ispeed; /* input speed */ + speed_t c_ospeed; /* output speed */ +}; -#ifndef _POSIX_SOURCE -#include -#endif +#endif /* !_SYS__TERMIOS_H_ */ Modified: head/sys/sys/termios.h ============================================================================== --- head/sys/sys/termios.h Sat Nov 28 21:42:39 2009 (r199897) +++ head/sys/sys/termios.h Sat Nov 28 23:50:48 2009 (r199898) @@ -1,302 +1,5 @@ -/*- - * Copyright (c) 1988, 1989, 1993, 1994 - * The Regents of the University of California. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 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. - * - * 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. - * - * @(#)termios.h 8.3 (Berkeley) 3/28/94 - * $FreeBSD$ - */ - -#ifndef _SYS_TERMIOS_H_ -#define _SYS_TERMIOS_H_ - -#include -#ifndef _PID_T_DECLARED -typedef __pid_t pid_t; -#define _PID_T_DECLARED -#endif - -/* - * Special Control Characters - * - * Index into c_cc[] character array. - * - * Name Subscript Enabled by - */ -#define VEOF 0 /* ICANON */ -#define VEOL 1 /* ICANON */ -#ifndef _POSIX_SOURCE -#define VEOL2 2 /* ICANON together with IEXTEN */ -#endif -#define VERASE 3 /* ICANON */ -#ifndef _POSIX_SOURCE -#define VWERASE 4 /* ICANON together with IEXTEN */ -#endif -#define VKILL 5 /* ICANON */ -#ifndef _POSIX_SOURCE -#define VREPRINT 6 /* ICANON together with IEXTEN */ -#define VERASE2 7 /* ICANON */ -#endif -/* 7 ex-spare 1 */ -#define VINTR 8 /* ISIG */ -#define VQUIT 9 /* ISIG */ -#define VSUSP 10 /* ISIG */ -#ifndef _POSIX_SOURCE -#define VDSUSP 11 /* ISIG together with IEXTEN */ -#endif -#define VSTART 12 /* IXON, IXOFF */ -#define VSTOP 13 /* IXON, IXOFF */ -#ifndef _POSIX_SOURCE -#define VLNEXT 14 /* IEXTEN */ -#define VDISCARD 15 /* IEXTEN */ -#endif -#define VMIN 16 /* !ICANON */ -#define VTIME 17 /* !ICANON */ -#ifndef _POSIX_SOURCE -#define VSTATUS 18 /* ICANON together with IEXTEN */ -/* 19 spare 2 */ -#endif -#define NCCS 20 - -#define _POSIX_VDISABLE 0xff - -/* - * Input flags - software input processing - */ -#define IGNBRK 0x00000001 /* ignore BREAK condition */ -#define BRKINT 0x00000002 /* map BREAK to SIGINTR */ -#define IGNPAR 0x00000004 /* ignore (discard) parity errors */ -#define PARMRK 0x00000008 /* mark parity and framing errors */ -#define INPCK 0x00000010 /* enable checking of parity errors */ -#define ISTRIP 0x00000020 /* strip 8th bit off chars */ -#define INLCR 0x00000040 /* map NL into CR */ -#define IGNCR 0x00000080 /* ignore CR */ -#define ICRNL 0x00000100 /* map CR to NL (ala CRMOD) */ -#define IXON 0x00000200 /* enable output flow control */ -#define IXOFF 0x00000400 /* enable input flow control */ -#ifndef _POSIX_SOURCE -#define IXANY 0x00000800 /* any char will restart after stop */ -#define IMAXBEL 0x00002000 /* ring bell on input queue full */ -#endif /*_POSIX_SOURCE */ - -/* - * Output flags - software output processing - */ -#define OPOST 0x00000001 /* enable following output processing */ -#ifndef _POSIX_SOURCE -#define ONLCR 0x00000002 /* map NL to CR-NL (ala CRMOD) */ -#define TABDLY 0x00000004 /* tab delay mask */ -#define TAB0 0x00000000 /* no tab delay and expansion */ -#define TAB3 0x00000004 /* expand tabs to spaces */ -#ifndef _KERNEL -#define OXTABS TAB3 -#endif /* !_KERNEL */ -#define ONOEOT 0x00000008 /* discard EOT's (^D) on output) */ -#define OCRNL 0x00000010 /* map CR to NL on output */ -#define ONOCR 0x00000020 /* no CR output at column 0 */ -#define ONLRET 0x00000040 /* NL performs CR function */ -#endif /*_POSIX_SOURCE */ - -/* - * Control flags - hardware control of terminal - */ -#ifndef _POSIX_SOURCE -#define CIGNORE 0x00000001 /* ignore control flags */ -#endif -#define CSIZE 0x00000300 /* character size mask */ -#define CS5 0x00000000 /* 5 bits (pseudo) */ -#define CS6 0x00000100 /* 6 bits */ -#define CS7 0x00000200 /* 7 bits */ -#define CS8 0x00000300 /* 8 bits */ -#define CSTOPB 0x00000400 /* send 2 stop bits */ -#define CREAD 0x00000800 /* enable receiver */ -#define PARENB 0x00001000 /* parity enable */ -#define PARODD 0x00002000 /* odd parity, else even */ -#define HUPCL 0x00004000 /* hang up on last close */ -#define CLOCAL 0x00008000 /* ignore modem status lines */ -#ifndef _POSIX_SOURCE -#define CCTS_OFLOW 0x00010000 /* CTS flow control of output */ -#define CRTSCTS (CCTS_OFLOW | CRTS_IFLOW) -#define CRTS_IFLOW 0x00020000 /* RTS flow control of input */ -#define CDTR_IFLOW 0x00040000 /* DTR flow control of input */ -#define CDSR_OFLOW 0x00080000 /* DSR flow control of output */ -#define CCAR_OFLOW 0x00100000 /* DCD flow control of output */ -#ifndef _KERNEL -#define MDMBUF CCAR_OFLOW -#endif /* !_KERNEL */ -#endif - - -/* - * "Local" flags - dumping ground for other state - * - * Warning: some flags in this structure begin with - * the letter "I" and look like they belong in the - * input flag. - */ - -#ifndef _POSIX_SOURCE -#define ECHOKE 0x00000001 /* visual erase for line kill */ -#endif /*_POSIX_SOURCE */ -#define ECHOE 0x00000002 /* visually erase chars */ -#define ECHOK 0x00000004 /* echo NL after line kill */ -#define ECHO 0x00000008 /* enable echoing */ -#define ECHONL 0x00000010 /* echo NL even if ECHO is off */ -#ifndef _POSIX_SOURCE -#define ECHOPRT 0x00000020 /* visual erase mode for hardcopy */ -#define ECHOCTL 0x00000040 /* echo control chars as ^(Char) */ -#endif /*_POSIX_SOURCE */ -#define ISIG 0x00000080 /* enable signals INTR, QUIT, [D]SUSP */ -#define ICANON 0x00000100 /* canonicalize input lines */ -#ifndef _POSIX_SOURCE -#define ALTWERASE 0x00000200 /* use alternate WERASE algorithm */ -#endif /*_POSIX_SOURCE */ -#define IEXTEN 0x00000400 /* enable DISCARD and LNEXT */ -#define EXTPROC 0x00000800 /* external processing */ -#define TOSTOP 0x00400000 /* stop background jobs from output */ -#ifndef _POSIX_SOURCE -#define FLUSHO 0x00800000 /* output being flushed (state) */ -#define NOKERNINFO 0x02000000 /* no kernel output from VSTATUS */ -#define PENDIN 0x20000000 /* XXX retype pending input (state) */ -#endif /*_POSIX_SOURCE */ -#define NOFLSH 0x80000000 /* don't flush after interrupt */ - -typedef unsigned int tcflag_t; -typedef unsigned char cc_t; -typedef unsigned int speed_t; - -struct termios { - tcflag_t c_iflag; /* input flags */ - tcflag_t c_oflag; /* output flags */ - tcflag_t c_cflag; /* control flags */ - tcflag_t c_lflag; /* local flags */ - cc_t c_cc[NCCS]; /* control chars */ - speed_t c_ispeed; /* input speed */ - speed_t c_ospeed; /* output speed */ -}; - -/* - * Standard speeds - */ -#define B0 0 -#define B50 50 -#define B75 75 -#define B110 110 -#define B134 134 -#define B150 150 -#define B200 200 -#define B300 300 -#define B600 600 -#define B1200 1200 -#define B1800 1800 -#define B2400 2400 -#define B4800 4800 -#define B9600 9600 -#define B19200 19200 -#define B38400 38400 -#ifndef _POSIX_SOURCE -#define B7200 7200 -#define B14400 14400 -#define B28800 28800 -#define B57600 57600 -#define B76800 76800 -#define B115200 115200 -#define B230400 230400 -#define B460800 460800 -#define B921600 921600 -#define EXTA 19200 -#define EXTB 38400 -#endif /* !_POSIX_SOURCE */ - -#ifndef _KERNEL - -#ifndef _POSIX_SOURCE -#define CCEQ(val, c) ((c) == (val) && (val) != _POSIX_VDISABLE) -#endif - -/* - * Commands passed to tcsetattr() for setting the termios structure. - */ -#define TCSANOW 0 /* make change immediate */ -#define TCSADRAIN 1 /* drain output, then change */ -#define TCSAFLUSH 2 /* drain output, flush input */ -#ifndef _POSIX_SOURCE -#define TCSASOFT 0x10 /* flag - don't alter h.w. state */ -#endif - -#define TCIFLUSH 1 -#define TCOFLUSH 2 -#define TCIOFLUSH 3 -#define TCOOFF 1 -#define TCOON 2 -#define TCIOFF 3 -#define TCION 4 - -#include - -__BEGIN_DECLS -speed_t cfgetispeed(const struct termios *); -speed_t cfgetospeed(const struct termios *); -int cfsetispeed(struct termios *, speed_t); -int cfsetospeed(struct termios *, speed_t); -int tcgetattr(int, struct termios *); -int tcsetattr(int, int, const struct termios *); -int tcdrain(int); -int tcflow(int, int); -int tcflush(int, int); -int tcsendbreak(int, int); - -#if __POSIX_VISIBLE >= 200112 || __BSD_VISIBLE -pid_t tcgetsid(int); -#endif -#if __BSD_VISIBLE -int tcsetsid(int, pid_t); - -void cfmakeraw(struct termios *); -int cfsetspeed(struct termios *, speed_t); -#endif -__END_DECLS - -#endif /* !_KERNEL */ - -#ifndef _POSIX_SOURCE - -/* - * Include tty ioctl's that aren't just for backwards compatibility - * with the old tty driver. These ioctl definitions were previously - * in . - */ -#include -#endif - -/* - * END OF PROTECTED INCLUDE. - */ -#endif /* !_SYS_TERMIOS_H_ */ - -#ifndef _POSIX_SOURCE -#include +/* $FreeBSD$ */ +#ifdef __GNUC__ +#warning "this file includes which is deprecated, use instead" #endif +#include Modified: head/sys/sys/tty.h ============================================================================== --- head/sys/sys/tty.h Sat Nov 28 21:42:39 2009 (r199897) +++ head/sys/sys/tty.h Sat Nov 28 23:50:48 2009 (r199898) @@ -38,7 +38,7 @@ #include #include #include -#include +#include #include #include