From owner-svn-src-head@FreeBSD.ORG Sun Nov 9 01:10:21 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 82FD91065678; Sun, 9 Nov 2008 01:10:21 +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 730A58FC0C; Sun, 9 Nov 2008 01:10:21 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA91ALuD026622; Sun, 9 Nov 2008 01:10:21 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA91ALkc026621; Sun, 9 Nov 2008 01:10:21 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <200811090110.mA91ALkc026621@svn.freebsd.org> From: Hiroki Sato Date: Sun, 9 Nov 2008 01:10: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: r184777 - head/usr.bin/sed X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Nov 2008 01:10:21 -0000 Author: hrs Date: Sun Nov 9 01:10:21 2008 New Revision: 184777 URL: http://svn.freebsd.org/changeset/base/184777 Log: Add workaround for a back reference when no corresponding parenthesized subexpression is defined. For example, the following command line caused unexpected behavior like segmentation fault: % echo test | sed -e 's/test/\1/' PR: bin/126682 MFC after: 1 week Modified: head/usr.bin/sed/compile.c Modified: head/usr.bin/sed/compile.c ============================================================================== --- head/usr.bin/sed/compile.c Sun Nov 9 00:49:36 2008 (r184776) +++ head/usr.bin/sed/compile.c Sun Nov 9 01:10:21 2008 (r184777) @@ -324,9 +324,17 @@ nonsel: /* Now parse the command */ if (p == NULL) errx(1, "%lu: %s: unterminated substitute pattern", linenum, fname); + + /* Compile RE with no case sensitivity temporarily */ + if (*re == '\0') + cmd->u.s->re = NULL; + else + cmd->u.s->re = compile_re(re, 0); --p; p = compile_subst(p, cmd->u.s); p = compile_flags(p, cmd->u.s); + + /* Recompile RE with case sensitivity from "I" flag if any */ if (*re == '\0') cmd->u.s->re = NULL; else From owner-svn-src-head@FreeBSD.ORG Sun Nov 9 01:53:06 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5A23D1065670; Sun, 9 Nov 2008 01:53:06 +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 4A2CC8FC12; Sun, 9 Nov 2008 01:53:06 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA91r6eL027363; Sun, 9 Nov 2008 01:53:06 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA91r6b9027362; Sun, 9 Nov 2008 01:53:06 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200811090153.mA91r6b9027362@svn.freebsd.org> From: Kip Macy Date: Sun, 9 Nov 2008 01:53: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: r184778 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Nov 2008 01:53:06 -0000 Author: kmacy Date: Sun Nov 9 01:53:06 2008 New Revision: 184778 URL: http://svn.freebsd.org/changeset/base/184778 Log: make kern.ipc.nmbclusters actually have a useful effect on nmbclusters et al. initialize pkthdr in field order Modified: head/sys/kern/kern_mbuf.c Modified: head/sys/kern/kern_mbuf.c ============================================================================== --- head/sys/kern/kern_mbuf.c Sun Nov 9 01:10:21 2008 (r184777) +++ head/sys/kern/kern_mbuf.c Sun Nov 9 01:53:06 2008 (r184778) @@ -104,13 +104,14 @@ struct mbstat mbstat; static void tunable_mbinit(void *dummy) { + TUNABLE_INT_FETCH("kern.ipc.nmbclusters", &nmbclusters); /* This has to be done before VM init. */ - nmbclusters = 1024 + maxusers * 64; + if (nmbclusters == 0) + nmbclusters = 1024 + maxusers * 64; nmbjumbop = nmbclusters / 2; nmbjumbo9 = nmbjumbop / 2; nmbjumbo16 = nmbjumbo9 / 2; - TUNABLE_INT_FETCH("kern.ipc.nmbclusters", &nmbclusters); } SYSINIT(tunable_mbinit, SI_SUB_TUNABLES, SI_ORDER_ANY, tunable_mbinit, NULL); @@ -409,8 +410,8 @@ mb_ctor_mbuf(void *mem, int size, void * if (flags & M_PKTHDR) { m->m_data = m->m_pktdat; m->m_pkthdr.rcvif = NULL; - m->m_pkthdr.len = 0; m->m_pkthdr.header = NULL; + m->m_pkthdr.len = 0; m->m_pkthdr.csum_flags = 0; m->m_pkthdr.csum_data = 0; m->m_pkthdr.tso_segsz = 0; From owner-svn-src-head@FreeBSD.ORG Sun Nov 9 06:44:54 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 581E2106568D; Sun, 9 Nov 2008 06:44:54 +0000 (UTC) (envelope-from matteo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 47D9A8FC17; Sun, 9 Nov 2008 06:44:54 +0000 (UTC) (envelope-from matteo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA96iroM032671; Sun, 9 Nov 2008 06:44:53 GMT (envelope-from matteo@svn.freebsd.org) Received: (from matteo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA96ira1032670; Sun, 9 Nov 2008 06:44:53 GMT (envelope-from matteo@svn.freebsd.org) Message-Id: <200811090644.mA96ira1032670@svn.freebsd.org> From: Matteo Riondato Date: Sun, 9 Nov 2008 06: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: r184779 - head/usr.sbin/cron/crontab X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Nov 2008 06:44:54 -0000 Author: matteo Date: Sun Nov 9 06:44:53 2008 New Revision: 184779 URL: http://svn.freebsd.org/changeset/base/184779 Log: Be paranoid and use snprintf PR: bin/122137 Submitted by: Steven Kreuzer MFC after: 3 days Modified: head/usr.sbin/cron/crontab/crontab.c Modified: head/usr.sbin/cron/crontab/crontab.c ============================================================================== --- head/usr.sbin/cron/crontab/crontab.c Sun Nov 9 01:53:06 2008 (r184778) +++ head/usr.sbin/cron/crontab/crontab.c Sun Nov 9 06:44:53 2008 (r184779) @@ -263,7 +263,7 @@ list_cmd() { FILE *f; log_it(RealUser, Pid, "LIST", User); - (void) sprintf(n, CRON_TAB(User)); + (void) snprintf(n, sizeof(n), CRON_TAB(User)); if (!(f = fopen(n, "r"))) { if (errno == ENOENT) errx(ERROR_EXIT, "no crontab for %s", User); @@ -293,7 +293,7 @@ delete_cmd() { } log_it(RealUser, Pid, "DELETE", User); - (void) sprintf(n, CRON_TAB(User)); + (void) snprintf(n, sizeof(n), CRON_TAB(User)); if (unlink(n)) { if (errno == ENOENT) errx(ERROR_EXIT, "no crontab for %s", User); @@ -327,7 +327,7 @@ edit_cmd() { char new_md5[MD5_SIZE]; log_it(RealUser, Pid, "BEGIN EDIT", User); - (void) sprintf(n, CRON_TAB(User)); + (void) snprintf(n, sizeof(n), CRON_TAB(User)); if (!(f = fopen(n, "r"))) { if (errno != ENOENT) err(ERROR_EXIT, "%s", n); @@ -337,7 +337,7 @@ edit_cmd() { } um = umask(077); - (void) sprintf(Filename, "/tmp/crontab.XXXXXXXXXX"); + (void) snprintf(Filename, sizeof(Filename), "/tmp/crontab.XXXXXXXXXX"); if ((t = mkstemp(Filename)) == -1) { warn("%s", Filename); (void) umask(um); @@ -504,8 +504,8 @@ replace_cmd() { return (-2); } - (void) sprintf(n, "tmp.%d", Pid); - (void) sprintf(tn, CRON_TAB(n)); + (void) snprintf(n, sizeof(n), "tmp.%d", Pid); + (void) snprintf(tn, sizeof(n), CRON_TAB(n)); if (!(tmp = fopen(tn, "w+"))) { warn("%s", tn); return (-2); @@ -592,7 +592,7 @@ replace_cmd() { return (-2); } - (void) sprintf(n, CRON_TAB(User)); + (void) snprintf(n, sizeof(n), CRON_TAB(User)); if (rename(tn, n)) { warn("error renaming %s to %s", tn, n); unlink(tn); From owner-svn-src-head@FreeBSD.ORG Sun Nov 9 07:34:12 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 009381065670; Sun, 9 Nov 2008 07:34:12 +0000 (UTC) (envelope-from matteo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E49238FC16; Sun, 9 Nov 2008 07:34:11 +0000 (UTC) (envelope-from matteo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA97YBs7033554; Sun, 9 Nov 2008 07:34:11 GMT (envelope-from matteo@svn.freebsd.org) Received: (from matteo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA97YBld033553; Sun, 9 Nov 2008 07:34:11 GMT (envelope-from matteo@svn.freebsd.org) Message-Id: <200811090734.mA97YBld033553@svn.freebsd.org> From: Matteo Riondato Date: Sun, 9 Nov 2008 07:34: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: r184780 - head/usr.sbin/cron/crontab X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Nov 2008 07:34:12 -0000 Author: matteo Date: Sun Nov 9 07:34:11 2008 New Revision: 184780 URL: http://svn.freebsd.org/changeset/base/184780 Log: Don't leave files in /var/cront/tabs when interrupted PR: 17363 MFC after: 3 days Modified: head/usr.sbin/cron/crontab/crontab.c Modified: head/usr.sbin/cron/crontab/crontab.c ============================================================================== --- head/usr.sbin/cron/crontab/crontab.c Sun Nov 9 06:44:53 2008 (r184779) +++ head/usr.sbin/cron/crontab/crontab.c Sun Nov 9 07:34:11 2008 (r184780) @@ -63,6 +63,7 @@ static FILE *NewCrontab; static int CheckErrorCount; static enum opt_t Option; static struct passwd *pw; +static char *tmp_path; static void list_cmd(void), delete_cmd(void), edit_cmd(void), @@ -486,6 +487,16 @@ edit_cmd() { } +void +static remove_tmp(int sig) +{ + if (tmp_path) { + unlink(tmp_path); + } + exit(ERROR_EXIT); +} + + /* returns 0 on success * -1 on syntax error * -2 on install error @@ -498,6 +509,7 @@ replace_cmd() { entry *e; time_t now = time(NULL); char **envp = env_init(); + void (*f[3])(); if (envp == NULL) { warnx("cannot allocate memory"); @@ -506,6 +518,13 @@ replace_cmd() { (void) snprintf(n, sizeof(n), "tmp.%d", Pid); (void) snprintf(tn, sizeof(n), CRON_TAB(n)); + + /* Set up to remove the temp file if interrupted by a signal. */ + f[0] = signal(SIGHUP, remove_tmp); + f[1] = signal(SIGINT, remove_tmp); + f[2] = signal(SIGTERM, remove_tmp); + tmp_path = tn; + if (!(tmp = fopen(tn, "w+"))) { warn("%s", tn); return (-2); @@ -598,6 +617,13 @@ replace_cmd() { unlink(tn); return (-2); } + + /* Restore the default signal handlers. */ + tmp_path = NULL; + signal(SIGHUP, f[0]); + signal(SIGINT, f[1]); + signal(SIGTERM, f[2]); + log_it(RealUser, Pid, "REPLACE", User); poke_daemon(); From owner-svn-src-head@FreeBSD.ORG Sun Nov 9 07:58:23 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A4D9F1065688; Sun, 9 Nov 2008 07:58:23 +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 942F18FC12; Sun, 9 Nov 2008 07:58:23 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA97wNnA033973; Sun, 9 Nov 2008 07:58:23 GMT (envelope-from sobomax@svn.freebsd.org) Received: (from sobomax@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA97wNKt033972; Sun, 9 Nov 2008 07:58:23 GMT (envelope-from sobomax@svn.freebsd.org) Message-Id: <200811090758.mA97wNKt033972@svn.freebsd.org> From: Maxim Sobolev Date: Sun, 9 Nov 2008 07:58: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: r184781 - head/usr.sbin/mergemaster X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Nov 2008 07:58:23 -0000 Author: sobomax Date: Sun Nov 9 07:58:23 2008 New Revision: 184781 URL: http://svn.freebsd.org/changeset/base/184781 Log: Ignore files that only differ in CVS Id tag. MFC after: 2 weeks Modified: head/usr.sbin/mergemaster/mergemaster.sh Modified: head/usr.sbin/mergemaster/mergemaster.sh ============================================================================== --- head/usr.sbin/mergemaster/mergemaster.sh Sun Nov 9 07:34:11 2008 (r184780) +++ head/usr.sbin/mergemaster/mergemaster.sh Sun Nov 9 07:58:23 2008 (r184781) @@ -947,6 +947,20 @@ for COMPFILE in `find . -type f -size +0 echo " *** Temp ${COMPFILE} and installed have the same CVS Id, deleting" rm "${COMPFILE}" ;; + + *) + tempfoo=`basename $0` + TMPFILE1=`mktemp -t ${tempfoo}` || break + TMPFILE2=`mktemp -t ${tempfoo}` || break + sed "s/[$]${CVS_ID_TAG}:.*[$]//g" "${DESTDIR}${COMPFILE#.}" > "${TMPFILE1}" + sed "s/[$]${CVS_ID_TAG}:.*[$]//g" "${COMPFILE}" > "${TMPFILE2}" + if diff -q ${DIFF_OPTIONS} "${TMPFILE1}" "${TMPFILE2}" > \ + /dev/null 2>&1; then + echo " *** Temp ${COMPFILE} and installed are the same except CVS Id, deleting" + rm "${COMPFILE}" + fi + rm -f "${TMPFILE1}" "${TMPFILE2}" + ;; esac ;; esac From owner-svn-src-head@FreeBSD.ORG Sun Nov 9 08:36:35 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D0D171065673; Sun, 9 Nov 2008 08:36:35 +0000 (UTC) (envelope-from jkoshy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BF13A8FC13; Sun, 9 Nov 2008 08:36:35 +0000 (UTC) (envelope-from jkoshy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA98aZW1034732; Sun, 9 Nov 2008 08:36:35 GMT (envelope-from jkoshy@svn.freebsd.org) Received: (from jkoshy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA98aZAD034731; Sun, 9 Nov 2008 08:36:35 GMT (envelope-from jkoshy@svn.freebsd.org) Message-Id: <200811090836.mA98aZAD034731@svn.freebsd.org> From: Joseph Koshy Date: Sun, 9 Nov 2008 08:36: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: r184782 - head/usr.sbin/pmccontrol X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Nov 2008 08:36:35 -0000 Author: jkoshy Date: Sun Nov 9 08:36:35 2008 New Revision: 184782 URL: http://svn.freebsd.org/changeset/base/184782 Log: Change the meaning of a "*" argument to option -c to mean 'all unhalted CPUs', instead of 'all CPUs'. This change brings pmccontrol(8) in line with pmcstat(8). Modified: head/usr.sbin/pmccontrol/pmccontrol.c Modified: head/usr.sbin/pmccontrol/pmccontrol.c ============================================================================== --- head/usr.sbin/pmccontrol/pmccontrol.c Sun Nov 9 07:58:23 2008 (r184781) +++ head/usr.sbin/pmccontrol/pmccontrol.c Sun Nov 9 08:36:35 2008 (r184782) @@ -133,21 +133,33 @@ pmcc_init_debug(void) static int pmcc_do_enable_disable(struct pmcc_op_list *op_list) { - unsigned char op; int c, error, i, j, ncpu, npmc, t; - int cpu, pmc; + cpumask_t haltedcpus, cpumask; struct pmcc_op *np; unsigned char *map; + unsigned char op; + int cpu, pmc; + size_t dummy; if ((ncpu = pmc_ncpu()) < 0) err(EX_OSERR, "Unable to determine the number of cpus"); - /* determine the maximum number of PMCs in any CPU */ + /* Determine the set of active CPUs. */ + cpumask = (1 << ncpu) - 1; + dummy = sizeof(int); + haltedcpus = (cpumask_t) 0; + if (ncpu > 1 && sysctlbyname("machdep.hlt_cpus", &haltedcpus, + &dummy, NULL, 0) < 0) + err(EX_OSERR, "ERROR: Cannot determine which CPUs are " + "halted"); + cpumask &= ~haltedcpus; + + /* Determine the maximum number of PMCs in any CPU. */ npmc = 0; for (c = 0; c < ncpu; c++) { if ((t = pmc_npmc(c)) < 0) - err(EX_OSERR, "Unable to determine the number of PMCs in " - "CPU %d", c); + err(EX_OSERR, "Unable to determine the number of " + "PMCs in CPU %d", c); npmc = t > npmc ? t : npmc; } @@ -187,8 +199,10 @@ pmcc_do_enable_disable(struct pmcc_op_li #define MAP(M,C,P) (*((M) + (C)*npmc + (P))) if (cpu == PMCC_CPU_ALL) - for (i = 0; i < ncpu; i++) - SET_PMCS(i, pmc, op); + for (i = 0; i < ncpu; i++) { + if ((1 << i) & cpumask) + SET_PMCS(i, pmc, op); + } else SET_PMCS(cpu, pmc, op); } From owner-svn-src-head@FreeBSD.ORG Sun Nov 9 08:39:53 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7379C1065678; Sun, 9 Nov 2008 08:39:53 +0000 (UTC) (envelope-from jkoshy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 617988FC08; Sun, 9 Nov 2008 08:39:53 +0000 (UTC) (envelope-from jkoshy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA98dr0T034826; Sun, 9 Nov 2008 08:39:53 GMT (envelope-from jkoshy@svn.freebsd.org) Received: (from jkoshy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA98dr79034825; Sun, 9 Nov 2008 08:39:53 GMT (envelope-from jkoshy@svn.freebsd.org) Message-Id: <200811090839.mA98dr79034825@svn.freebsd.org> From: Joseph Koshy Date: Sun, 9 Nov 2008 08:39: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: r184783 - head/usr.sbin/pmccontrol X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Nov 2008 08:39:53 -0000 Author: jkoshy Date: Sun Nov 9 08:39:52 2008 New Revision: 184783 URL: http://svn.freebsd.org/changeset/base/184783 Log: - Document the changed meaning of a '*' argument to option "-c". - Tweak grammar. Modified: head/usr.sbin/pmccontrol/pmccontrol.8 Modified: head/usr.sbin/pmccontrol/pmccontrol.8 ============================================================================== --- head/usr.sbin/pmccontrol/pmccontrol.8 Sun Nov 9 08:36:35 2008 (r184782) +++ head/usr.sbin/pmccontrol/pmccontrol.8 Sun Nov 9 08:39:52 2008 (r184783) @@ -1,4 +1,4 @@ -.\" Copyright (c) 2003 Joseph Koshy. All rights reserved. +.\" Copyright (c) 2003,2008 Joseph Koshy. All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions @@ -23,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 15, 2003 +.Dd November 9, 2008 .Os .Dt PMCCONTROL 8 .Sh NAME @@ -52,13 +52,13 @@ The following options are available: .Bl -tag -width indent .It Fl c Ar cpu Subsequent enable and disable options affect the CPU -denoted by +denoted by argument .Ar cpu . The argument .Ar cpu -is either a number denoting a CPU number in the system, or the string +is a number denoting a CPU in the system, or .Dq Li * , -denoting all CPUs in the system. +denoting all unhalted CPUs in the system. .It Fl d Ar pmc Disable PMC number .Ar pmc @@ -67,7 +67,7 @@ on the CPU specified by preventing it from being used till subsequently re-enabled. The argument .Ar pmc -is either a number denoting a specified PMC, or the string +is a number denoting a specific PMC, or .Dq Li * denoting all the PMCs on the specified CPU. .Pp @@ -81,7 +81,7 @@ on the CPU specified by allowing it to be used in the future. The argument .Ar pmc -is either a number denoting a specified PMC, or the string +is a number denoting a specific PMC, or .Dq Li * denoting all the PMCs on the specified CPU. If PMC From owner-svn-src-head@FreeBSD.ORG Sun Nov 9 08:48:17 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1033) id 8C32A1065688; Sun, 9 Nov 2008 08:48:17 +0000 (UTC) Date: Sun, 9 Nov 2008 08:48:17 +0000 From: Alexey Dokuchaev To: Matteo Riondato Message-ID: <20081109084817.GA23323@FreeBSD.org> References: <200811090734.mA97YBld033553@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <200811090734.mA97YBld033553@svn.freebsd.org> User-Agent: Mutt/1.4.2.1i Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r184780 - head/usr.sbin/cron/crontab X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Nov 2008 08:48:17 -0000 On Sun, Nov 09, 2008 at 07:34:11AM +0000, Matteo Riondato wrote: > > +void > +static remove_tmp(int sig) > +{ > + if (tmp_path) { > + unlink(tmp_path); > + } > + exit(ERROR_EXIT); > +} This looks weird: `static' should be on same line as `void' as `static void' (so ^remove_tmp would match). It will also always exit with ERROR_EXIT, which does not look right, does it? ./danfe From owner-svn-src-head@FreeBSD.ORG Sun Nov 9 09:01:10 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 273F6106567C; Sun, 9 Nov 2008 09:01:10 +0000 (UTC) (envelope-from matteo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 14DF88FC24; Sun, 9 Nov 2008 09:01:10 +0000 (UTC) (envelope-from matteo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA9919pT035252; Sun, 9 Nov 2008 09:01:09 GMT (envelope-from matteo@svn.freebsd.org) Received: (from matteo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA9919m3035251; Sun, 9 Nov 2008 09:01:09 GMT (envelope-from matteo@svn.freebsd.org) Message-Id: <200811090901.mA9919m3035251@svn.freebsd.org> From: Matteo Riondato Date: Sun, 9 Nov 2008 09:01:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184784 - head/usr.sbin/cron/crontab X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Nov 2008 09:01:10 -0000 Author: matteo Date: Sun Nov 9 09:01:09 2008 New Revision: 184784 URL: http://svn.freebsd.org/changeset/base/184784 Log: Revert to previous revision. I should not commit anything at 3.50 AM. In addition to danfe's comments, I got others. I'll work on a better version of the patch. Modified: head/usr.sbin/cron/crontab/crontab.c Modified: head/usr.sbin/cron/crontab/crontab.c ============================================================================== --- head/usr.sbin/cron/crontab/crontab.c Sun Nov 9 08:39:52 2008 (r184783) +++ head/usr.sbin/cron/crontab/crontab.c Sun Nov 9 09:01:09 2008 (r184784) @@ -63,7 +63,6 @@ static FILE *NewCrontab; static int CheckErrorCount; static enum opt_t Option; static struct passwd *pw; -static char *tmp_path; static void list_cmd(void), delete_cmd(void), edit_cmd(void), @@ -487,16 +486,6 @@ edit_cmd() { } -void -static remove_tmp(int sig) -{ - if (tmp_path) { - unlink(tmp_path); - } - exit(ERROR_EXIT); -} - - /* returns 0 on success * -1 on syntax error * -2 on install error @@ -519,12 +508,6 @@ replace_cmd() { (void) snprintf(n, sizeof(n), "tmp.%d", Pid); (void) snprintf(tn, sizeof(n), CRON_TAB(n)); - /* Set up to remove the temp file if interrupted by a signal. */ - f[0] = signal(SIGHUP, remove_tmp); - f[1] = signal(SIGINT, remove_tmp); - f[2] = signal(SIGTERM, remove_tmp); - tmp_path = tn; - if (!(tmp = fopen(tn, "w+"))) { warn("%s", tn); return (-2); @@ -618,12 +601,6 @@ replace_cmd() { return (-2); } - /* Restore the default signal handlers. */ - tmp_path = NULL; - signal(SIGHUP, f[0]); - signal(SIGINT, f[1]); - signal(SIGTERM, f[2]); - log_it(RealUser, Pid, "REPLACE", User); poke_daemon(); From owner-svn-src-head@FreeBSD.ORG Sun Nov 9 09:24:01 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9D0B91065677; Sun, 9 Nov 2008 09:24:01 +0000 (UTC) (envelope-from rafan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 71ACE8FC0A; Sun, 9 Nov 2008 09:24:01 +0000 (UTC) (envelope-from rafan@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA99O1Wn035850; Sun, 9 Nov 2008 09:24:01 GMT (envelope-from rafan@svn.freebsd.org) Received: (from rafan@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA99O1mh035849; Sun, 9 Nov 2008 09:24:01 GMT (envelope-from rafan@svn.freebsd.org) Message-Id: <200811090924.mA99O1mh035849@svn.freebsd.org> From: Rong-En Fan Date: Sun, 9 Nov 2008 09:24: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: r184788 - head/contrib/ncurses X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Nov 2008 09:24:01 -0000 Author: rafan Date: Sun Nov 9 09:24:01 2008 New Revision: 184788 URL: http://svn.freebsd.org/changeset/base/184788 Log: - Bootstrap mergeinfo Modified: head/contrib/ncurses/ (props changed) From owner-svn-src-head@FreeBSD.ORG Sun Nov 9 09:30:05 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DFABC106567C for ; Sun, 9 Nov 2008 09:30:05 +0000 (UTC) (envelope-from rionda@gmail.com) Received: from rv-out-0506.google.com (rv-out-0506.google.com [209.85.198.233]) by mx1.freebsd.org (Postfix) with ESMTP id 85C0F8FC16 for ; Sun, 9 Nov 2008 09:30:05 +0000 (UTC) (envelope-from rionda@gmail.com) Received: by rv-out-0506.google.com with SMTP id b25so1851095rvf.43 for ; Sun, 09 Nov 2008 01:30:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:sender :to:subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references :x-google-sender-auth; bh=m6bDywjpCIaZ144QcIX+FJAMt/EgoB4F5Yl4hfCcP4g=; b=UOoLrHca5qago8S2Hfn0iuNRELr52y7Lo0F0kOYGTDJott3L8cYP659wX78q3IzIx+ q31J+o5P8rzJHWat3RP38/8cNceFuvBMV260rj7CmiqRWZNHQlHdlgU2kMuwLXnS2B2O tqe+o1WhjpuevLKPf2SViD+BoI0NVMAX6qXoU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references:x-google-sender-auth; b=w3h1KY1MDJr/K2QmVVc0wN1aYzGPusdqtofC/DE/H07w/ZCCaClOaJ7kItuqinuZ1a x6phPHDOdComDsJ59Prdsfj+saVyi1ArR8Ry2zbQiFBJ0ZZVI7SKcZxsCtt6qr5EubSB hIpTyt3Xu7tJPI65nq6X/YnF/w0SiUSopuCCM= Received: by 10.141.153.17 with SMTP id f17mr2861060rvo.99.1226221635680; Sun, 09 Nov 2008 01:07:15 -0800 (PST) Received: by 10.141.195.9 with HTTP; Sun, 9 Nov 2008 01:07:15 -0800 (PST) Message-ID: Date: Sun, 9 Nov 2008 04:07:15 -0500 From: "Matteo Riondato" Sender: rionda@gmail.com To: "Alexey Dokuchaev" In-Reply-To: <20081109084817.GA23323@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <200811090734.mA97YBld033553@svn.freebsd.org> <20081109084817.GA23323@FreeBSD.org> X-Google-Sender-Auth: 2215ecc7819451a8 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r184780 - head/usr.sbin/cron/crontab X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Nov 2008 09:30:06 -0000 On Sun, Nov 9, 2008 at 3:48 AM, Alexey Dokuchaev wrote: > On Sun, Nov 09, 2008 at 07:34:11AM +0000, Matteo Riondato wrote: >> >> +void >> +static remove_tmp(int sig) >> +{ >> + if (tmp_path) { >> + unlink(tmp_path); >> + } >> + exit(ERROR_EXIT); >> +} > > This looks weird: `static' should be on same line as `void' as `static > void' (so ^remove_tmp would match). It will also always exit with > ERROR_EXIT, which does not look right, does it? Sure. I reverted the file back to the previous revision. I got other comments which suggest I should work on a better version of the patch. I'll do it later today... Sorry for the noise. Best regards -- Matteo Riondato FreeBSD Committer (http://www.freebsd.org) G.U.F.I. Staff Member (http://www.gufi.org) FreeSBIE Developer (http://www.freesbie.org) From owner-svn-src-head@FreeBSD.ORG Sun Nov 9 10:11:54 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 25AD11065676; Sun, 9 Nov 2008 10:11:54 +0000 (UTC) (envelope-from alexander@leidinger.net) Received: from redbull.bpaserver.net (redbullneu.bpaserver.net [213.198.78.217]) by mx1.freebsd.org (Postfix) with ESMTP id A241E8FC13; Sun, 9 Nov 2008 10:11:53 +0000 (UTC) (envelope-from alexander@leidinger.net) Received: from outgoing.leidinger.net (pD9E2F98A.dip.t-dialin.net [217.226.249.138]) by redbull.bpaserver.net (Postfix) with ESMTP id 1DF0C2E25E; Sun, 9 Nov 2008 11:11:44 +0100 (CET) Received: from webmail.leidinger.net (webmail.leidinger.net [192.168.1.102]) by outgoing.leidinger.net (Postfix) with ESMTP id 66CAB355EF; Sun, 9 Nov 2008 11:11:34 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=Leidinger.net; s=outgoing-alex; t=1226225494; bh=B9FlBm49AkC7J5z4/qg5LJCe33uh/bKZn iN/c2DzLg8=; h=Message-ID:Date:From:To:Cc:Subject:References: In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=bZCIs8s97Cy8vykHCGTwjq29gAKeuvxM2LEQj/xxMgcXyw5Xssa0gL4K0VNCs1Hd9 VvOad8uXqKiWRPNpIUcVqkP5vLBUgGyDM3QeUlzXn6q2gocrfVG1N7Y09KfiHdqEEVS DoZhL3b+lNJVJJeWy+hX0IG673r+ZPXSaFL2XLbYjrKd6xcZ1WlRzWX8mL2mfMY7KY3 x6bRc9y2L4sgMixp1NUcw+OAk4HBczZFfpOp77Z0v+ejmyJJy2TP44hGiLgiTQHRaU0 TjIi/vZOnWY6Su7Y5+08vUdJTeBXBsRPAtWIkci83eDPgmr0B8QjyxIJIyEp78FNMKo vaxvSxNXQ== Received: (from www@localhost) by webmail.leidinger.net (8.14.2/8.13.8/Submit) id mA9ABYLf089965; Sun, 9 Nov 2008 11:11:34 +0100 (CET) (envelope-from Alexander@Leidinger.net) Received: from 192.168.2.100 ([192.168.2.100]) by webmail.leidinger.net (Horde Framework) with HTTP; Sun, 09 Nov 2008 11:11:33 +0100 Message-ID: <20081109111133.88165rocbmwehckc@webmail.leidinger.net> X-Priority: 3 (Normal) Date: Sun, 09 Nov 2008 11:11:33 +0100 From: Alexander Leidinger To: Maxim Sobolev References: <200811090758.mA97wNKt033972@svn.freebsd.org> In-Reply-To: <200811090758.mA97wNKt033972@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; DelSp="Yes"; format="flowed" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable User-Agent: Internet Messaging Program (IMP) H3 (4.3) / FreeBSD-8.0 X-BPAnet-MailScanner-Information: Please contact the ISP for more information X-MailScanner-ID: 1DF0C2E25E.6CF24 X-BPAnet-MailScanner: Found to be clean X-BPAnet-MailScanner-SpamCheck: not spam, ORDB-RBL, SpamAssassin (not cached, score=-14.813, required 6, BAYES_00 -15.00, DKIM_SIGNED 0.00, DKIM_VERIFIED -0.00, NO_RDNS2 0.01, RDNS_DYNAMIC 0.10, TW_SV 0.08) X-BPAnet-MailScanner-From: alexander@leidinger.net X-Spam-Status: No Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r184781 - head/usr.sbin/mergemaster X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Nov 2008 10:11:54 -0000 Quoting Maxim Sobolev (from Sun, 9 Nov 2008 =20 07:58:23 +0000 (UTC)): > Author: sobomax > Date: Sun Nov 9 07:58:23 2008 > New Revision: 184781 > URL: http://svn.freebsd.org/changeset/base/184781 > > Log: > Ignore files that only differ in CVS Id tag. I would like to have (ideally automatic) replacement of files in this =20 case. Is it still possible to get the new file there with mergemaster =20 after this patch? Bye, Alexander. > MFC after:=092 weeks > > Modified: > head/usr.sbin/mergemaster/mergemaster.sh > > Modified: head/usr.sbin/mergemaster/mergemaster.sh > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=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.sbin/mergemaster/mergemaster.sh=09Sun Nov 9 07:34:11 =20 > 2008=09(r184780) > +++ head/usr.sbin/mergemaster/mergemaster.sh=09Sun Nov 9 07:58:23 =20 > 2008=09(r184781) > @@ -947,6 +947,20 @@ for COMPFILE in `find . -type f -size +0 > echo " *** Temp ${COMPFILE} and installed have the same CVS =20 > Id, deleting" > rm "${COMPFILE}" > ;; > + > + *) > + tempfoo=3D`basename $0` > + TMPFILE1=3D`mktemp -t ${tempfoo}` || break > + TMPFILE2=3D`mktemp -t ${tempfoo}` || break > + sed "s/[$]${CVS_ID_TAG}:.*[$]//g" "${DESTDIR}${COMPFILE#.}" > =20 > "${TMPFILE1}" > + sed "s/[$]${CVS_ID_TAG}:.*[$]//g" "${COMPFILE}" > "${TMPFILE2}" > + if diff -q ${DIFF_OPTIONS} "${TMPFILE1}" "${TMPFILE2}" > \ > + /dev/null 2>&1; then > + echo " *** Temp ${COMPFILE} and installed are the same =20 > except CVS Id, deleting" > + rm "${COMPFILE}" > + fi > + rm -f "${TMPFILE1}" "${TMPFILE2}" > + ;; > esac > ;; > esac > > --=20 BOFH excuse #171: NOTICE: alloc: /dev/null: filesystem full http://www.Leidinger.net Alexander @ Leidinger.net: PGP ID =3D B0063FE7 http://www.FreeBSD.org netchild @ FreeBSD.org : PGP ID =3D 72077137 From owner-svn-src-head@FreeBSD.ORG Sun Nov 9 10:25:51 2008 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: by hub.freebsd.org (Postfix, from userid 1033) id B859B1065676; Sun, 9 Nov 2008 10:25:51 +0000 (UTC) Date: Sun, 9 Nov 2008 10:25:51 +0000 From: Alexey Dokuchaev To: Alexander Leidinger Message-ID: <20081109102551.GA61113@FreeBSD.org> References: <200811090758.mA97wNKt033972@svn.freebsd.org> <20081109111133.88165rocbmwehckc@webmail.leidinger.net> Mime-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <20081109111133.88165rocbmwehckc@webmail.leidinger.net> User-Agent: Mutt/1.4.2.1i Cc: svn-src-head@FreeBSD.org, Maxim Sobolev , svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r184781 - head/usr.sbin/mergemaster X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Nov 2008 10:25:51 -0000 On Sun, Nov 09, 2008 at 11:11:33AM +0100, Alexander Leidinger wrote: > Quoting Maxim Sobolev (from Sun, 9 Nov 2008 > 07:58:23 +0000 (UTC)): > > >Author: sobomax > >Date: Sun Nov 9 07:58:23 2008 > >New Revision: 184781 > >URL: http://svn.freebsd.org/changeset/base/184781 > > > >Log: > > Ignore files that only differ in CVS Id tag. > > I would like to have (ideally automatic) replacement of files in this > case. Seconded. Methinks it would be nice to have CVS Id's updated, either automagically or via interactive process, but certainly not silently ignored. ./danfe From owner-svn-src-head@FreeBSD.ORG Sun Nov 9 10:34:54 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 999481065679; Sun, 9 Nov 2008 10:34:54 +0000 (UTC) (envelope-from marc@blackend.org) Received: from abigail.blackend.org (ns0.blackend.org [82.227.222.164]) by mx1.freebsd.org (Postfix) with ESMTP id DCD0F8FC0C; Sun, 9 Nov 2008 10:34:53 +0000 (UTC) (envelope-from marc@blackend.org) Received: from gothic.blackend.org (gothic.blackend.org [192.168.1.203]) by abigail.blackend.org (8.13.4/8.13.3) with ESMTP id mA9AN8cJ071086; Sun, 9 Nov 2008 11:23:08 +0100 (CET) (envelope-from marc@abigail.blackend.org) Received: from gothic.blackend.org (localhost [127.0.0.1]) by gothic.blackend.org (8.14.3/8.14.1) with ESMTP id mA9AN3g9032785; Sun, 9 Nov 2008 11:23:03 +0100 (CET) (envelope-from marc@gothic.blackend.org) Received: (from marc@localhost) by gothic.blackend.org (8.14.3/8.14.3/Submit) id mA9AN2Re032784; Sun, 9 Nov 2008 11:23:02 +0100 (CET) (envelope-from marc) Resent-From: marc@blackend.org Resent-Date: Sun, 9 Nov 2008 11:23:02 +0100 Resent-Message-ID: <20081109102302.GA32770@gothic.blackend.org> Resent-To: src-committers@freebsd.org, svn-src-head@freebsd.org Date: Sat, 8 Nov 2008 15:08:13 +0100 From: Marc Fonvieille To: Raphael Becker Message-ID: <20081108140813.GA1039@gothic.blackend.org> References: <200811072201.mA7M1VlX093904@svn.freebsd.org> <20081108001032.GA21542@ma.sigsys.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="vkogqOf2sHV7VnPd" Content-Disposition: inline In-Reply-To: <20081108001032.GA21542@ma.sigsys.de> X-Useless-Header: blackend.org X-Operating-System: FreeBSD 7.1-PRERELEASE User-Agent: Mutt/1.5.18 (2008-05-17) Cc: svn-src-all@freebsd.org Subject: Re: svn commit: r184753 - head/usr.sbin/sysinstall X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Nov 2008 10:34:54 -0000 --vkogqOf2sHV7VnPd Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Nov 08, 2008 at 01:10:32AM +0100, Raphael Becker wrote: > On Fri, Nov 07, 2008 at 10:01:31PM +0000, Marc Fonvieille wrote: > > + "This will give you ready access to over 19,000 ported software pa= ckages,\n" > > + "at a cost of around 445MB of disk space when \"clean\" and possib= ly\n" >=20 >=20 > I see around 700M here, my ports are configured "read-only", so all > work/, packages/ distfiles/ and so on are outside /usr/ports, updates > are done by cvsup: >=20 > # df -mi /usr/ports/ > Filesystem 1M-blocks Used Avail Capacity iused ifree %iused Mounted on > /dev/md0 1039 712 119 86% 129743 478895 21% /usr/ports >=20 > # du -sm /usr/ports/=20 > 713 /usr/ports/ >=20 > It heavily depends on inode-sizes. >=20 > I have about 130k inodes in use which cause a "theoretical minimum"=20 > of 508MB disk on filesystems with 4k inode-density, about 1G with 8k > inodes (default is 8k, see by newfs(8)) >=20 > -i bytes > Specify the density of inodes in the file system. The default is > to create an inode for every (4 * frag-size) bytes of data space. >=20 > -f frag-size > The fragment size of the file system in bytes. It must be a > power of two ranging in value between blocksize/8 and blocksize. > The default is 2048 bytes. >=20 >=20 > An uncompressed tarball (without the "inode-overhead") of=20 > /usr/ports/ is around 600MB here: >=20 > # tar cf - /usr/ports/ | wc -c > tar: Removing leading '/' from member names > 629196800 >=20 > or 600MB. >=20 > How did you measure / calculate 445MB?=20 >=20 If I do a csup after a rm -rf /usr/ports I get 402M according to "du -sh", so if we add INDEXes we should be close to 440M. I used 445MB to be consistent with what we have in http://www.freebsd.org/cgi/cvsweb.cgi/doc/share/sgml/freebsd.ent.diff?r1=3D= 1.100;r2=3D1.101 --=20 Marc --vkogqOf2sHV7VnPd Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.4 (FreeBSD) iD8DBQFJFZ1MzQ9RwE+OdOgRApJGAKCUjG0DQOoJ2g0h8tRZcNSEYxNA2ACeJTVF ngi7ODM7A/FTr9H4PuuXaXA= =daqS -----END PGP SIGNATURE----- --vkogqOf2sHV7VnPd-- From owner-svn-src-head@FreeBSD.ORG Sun Nov 9 10:45:14 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 89ED91065672; Sun, 9 Nov 2008 10:45: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 730878FC0A; Sun, 9 Nov 2008 10:45:14 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA9AjE7q037337; Sun, 9 Nov 2008 10:45:14 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA9AjDDq037323; Sun, 9 Nov 2008 10:45:13 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200811091045.mA9AjDDq037323@svn.freebsd.org> From: Ed Schouten Date: Sun, 9 Nov 2008 10:45: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: r184789 - in head: lib/libc/amd64/sys lib/libc/arm/sys lib/libc/i386/sys lib/libc/ia64/sys lib/libc/mips/sys lib/libc/powerpc/sys lib/libc/sparc64/sys sys/amd64/linux32 sys/compat/freeb... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Nov 2008 10:45:14 -0000 Author: ed Date: Sun Nov 9 10:45:13 2008 New Revision: 184789 URL: http://svn.freebsd.org/changeset/base/184789 Log: Mark uname(), getdomainname() and setdomainname() with COMPAT_FREEBSD4. Looking at our source code history, it seems the uname(), getdomainname() and setdomainname() system calls got deprecated somewhere after FreeBSD 1.1, but they have never been phased out properly. Because we don't have a COMPAT_FREEBSD1, just use COMPAT_FREEBSD4. Also fix the Linuxolator to build without the setdomainname() routine by just making it call userland_sysctl on kern.domainname. Also replace the setdomainname()'s implementation to use this approach, because we're duplicating code with sysctl_domainname(). I wasn't able to keep these three routines working in our COMPAT_FREEBSD32, because that would require yet another keyword for syscalls.master (COMPAT4+NOPROTO). Because this routine is probably unused already, this won't be a problem in practice. If it turns out to be a problem, we'll just restore this functionality. Reviewed by: rdivacky, kib Modified: head/lib/libc/amd64/sys/Makefile.inc head/lib/libc/arm/sys/Makefile.inc head/lib/libc/i386/sys/Makefile.inc head/lib/libc/ia64/sys/Makefile.inc head/lib/libc/mips/sys/Makefile.inc head/lib/libc/powerpc/sys/Makefile.inc head/lib/libc/sparc64/sys/Makefile.inc head/sys/amd64/linux32/syscalls.master head/sys/compat/freebsd32/syscalls.master head/sys/compat/linux/linux_misc.c head/sys/i386/linux/syscalls.master head/sys/kern/kern_xxx.c head/sys/kern/syscalls.master head/sys/sys/priv.h Modified: head/lib/libc/amd64/sys/Makefile.inc ============================================================================== --- head/lib/libc/amd64/sys/Makefile.inc Sun Nov 9 09:24:01 2008 (r184788) +++ head/lib/libc/amd64/sys/Makefile.inc Sun Nov 9 10:45:13 2008 (r184789) @@ -7,8 +7,7 @@ MDASM= vfork.S brk.S cerror.S exect.S ge reboot.S sbrk.S setlogin.S sigreturn.S # Don't generate default code for these syscalls: -NOASM= break.o exit.o getdomainname.o getlogin.o openbsd_poll.o \ - setdomainname.o sstk.o uname.o vfork.o yield.o +NOASM= break.o exit.o getlogin.o openbsd_poll.o sstk.o vfork.o yield.o PSEUDO= _getlogin.o _exit.o .if !defined(WITHOUT_SYSCALL_COMPAT) Modified: head/lib/libc/arm/sys/Makefile.inc ============================================================================== --- head/lib/libc/arm/sys/Makefile.inc Sun Nov 9 09:24:01 2008 (r184788) +++ head/lib/libc/arm/sys/Makefile.inc Sun Nov 9 10:45:13 2008 (r184789) @@ -3,8 +3,7 @@ MDASM= Ovfork.S brk.S cerror.S pipe.S ptrace.S sbrk.S shmat.S sigreturn.S syscall.S # Don't generate default code for these syscalls: -NOASM= break.o exit.o getdomainname.o getlogin.o openbsd_poll.o \ - setdomainname.o sstk.o uname.o vfork.o yield.o +NOASM= break.o exit.o getlogin.o openbsd_poll.o sstk.o vfork.o yield.o PSEUDO= _exit.o _getlogin.o .if !defined(WITHOUT_SYSCALL_COMPAT) Modified: head/lib/libc/i386/sys/Makefile.inc ============================================================================== --- head/lib/libc/i386/sys/Makefile.inc Sun Nov 9 09:24:01 2008 (r184788) +++ head/lib/libc/i386/sys/Makefile.inc Sun Nov 9 10:45:13 2008 (r184789) @@ -12,8 +12,7 @@ MDASM= Ovfork.S brk.S cerror.S exect.S g reboot.S sbrk.S setlogin.S sigreturn.S syscall.S # Don't generate default code for these syscalls: -NOASM= break.o exit.o getdomainname.o getlogin.o openbsd_poll.o \ - setdomainname.o sstk.o uname.o vfork.o yield.o +NOASM= break.o exit.o getlogin.o openbsd_poll.o sstk.o vfork.o yield.o PSEUDO= _getlogin.o _exit.o .if !defined(WITHOUT_SYSCALL_COMPAT) Modified: head/lib/libc/ia64/sys/Makefile.inc ============================================================================== --- head/lib/libc/ia64/sys/Makefile.inc Sun Nov 9 09:24:01 2008 (r184788) +++ head/lib/libc/ia64/sys/Makefile.inc Sun Nov 9 10:45:13 2008 (r184789) @@ -4,8 +4,7 @@ MDASM+= Ovfork.S brk.S cerror.S exect.S sbrk.S setlogin.S sigreturn.S swapcontext.S # Don't generate default code for these syscalls: -NOASM= break.o exit.o getdomainname.o getlogin.o openbsd_poll.o \ - setdomainname.o sstk.o uname.o vfork.o yield.o +NOASM= break.o exit.o getlogin.o openbsd_poll.o sstk.o vfork.o yield.o PSEUDO= _getlogin.o _exit.o .if !defined(WITHOUT_SYSCALL_COMPAT) Modified: head/lib/libc/mips/sys/Makefile.inc ============================================================================== --- head/lib/libc/mips/sys/Makefile.inc Sun Nov 9 09:24:01 2008 (r184788) +++ head/lib/libc/mips/sys/Makefile.inc Sun Nov 9 10:45:13 2008 (r184789) @@ -4,9 +4,8 @@ MDASM= Ovfork.S brk.S cerror.S exect.S fork.S pipe.S ptrace.S sbrk.S shmat.S syscall.S # Don't generate default code for these syscalls: -NOASM= break.o exit.o ftruncate.o getdomainname.o getlogin.o \ - lseek.o mmap.o openbsd_poll.o pread.o \ - pwrite.o setdomainname.o sstk.o truncate.o uname.o vfork.o yield.o +NOASM= break.o exit.o ftruncate.o getlogin.o lseek.o mmap.o \ + openbsd_poll.o pread.o pwrite.o sstk.o truncate.o vfork.o yield.o PSEUDO= _exit.o _getlogin.o .if !defined(WITHOUT_SYSCALL_COMPAT) Modified: head/lib/libc/powerpc/sys/Makefile.inc ============================================================================== --- head/lib/libc/powerpc/sys/Makefile.inc Sun Nov 9 09:24:01 2008 (r184788) +++ head/lib/libc/powerpc/sys/Makefile.inc Sun Nov 9 10:45:13 2008 (r184789) @@ -3,8 +3,7 @@ MDASM+= brk.S cerror.S exect.S pipe.S ptrace.S sbrk.S setlogin.S # Don't generate default code for these syscalls: -NOASM= break.o exit.o getdomainname.o getlogin.o openbsd_poll.o \ - setdomainname.o sstk.o uname.o yield.o +NOASM= break.o exit.o getlogin.o openbsd_poll.o sstk.o yield.o PSEUDO= _getlogin.o _exit.o .if !defined(WITHOUT_SYSCALL_COMPAT) Modified: head/lib/libc/sparc64/sys/Makefile.inc ============================================================================== --- head/lib/libc/sparc64/sys/Makefile.inc Sun Nov 9 09:24:01 2008 (r184788) +++ head/lib/libc/sparc64/sys/Makefile.inc Sun Nov 9 10:45:13 2008 (r184789) @@ -18,8 +18,7 @@ CFLAGS+= -DSUN4V MDASM+= brk.S cerror.S exect.S pipe.S ptrace.S sbrk.S setlogin.S sigaction.S # Don't generate default code for these syscalls: -NOASM= break.o exit.o getdomainname.o getlogin.o openbsd_poll.o \ - setdomainname.o sstk.o uname.o yield.o +NOASM= break.o exit.o getlogin.o openbsd_poll.o sstk.o yield.o PSEUDO= _getlogin.o _exit.o .if !defined(WITHOUT_SYSCALL_COMPAT) Modified: head/sys/amd64/linux32/syscalls.master ============================================================================== --- head/sys/amd64/linux32/syscalls.master Sun Nov 9 09:24:01 2008 (r184788) +++ head/sys/amd64/linux32/syscalls.master Sun Nov 9 10:45:13 2008 (r184789) @@ -216,7 +216,7 @@ ; linux uses some strange calling convention here so we have to use the dummy arg 120 AUE_RFORK STD { int linux_clone(l_int flags, void *stack, \ void *parent_tidptr, int dummy, void * child_tidptr); } -121 AUE_SYSCTL NOPROTO { int setdomainname(char *name, \ +121 AUE_SYSCTL STD { int linux_setdomainname(char *name, \ int len); } 122 AUE_NULL STD { int linux_newuname( \ struct l_new_utsname *buf); } Modified: head/sys/compat/freebsd32/syscalls.master ============================================================================== --- head/sys/compat/freebsd32/syscalls.master Sun Nov 9 09:24:01 2008 (r184788) +++ head/sys/compat/freebsd32/syscalls.master Sun Nov 9 10:45:13 2008 (r184789) @@ -295,11 +295,9 @@ 160 AUE_LGETFH UNIMPL lgetfh 161 AUE_NFS_GETFH NOPROTO { int getfh(char *fname, \ struct fhandle *fhp); } -162 AUE_SYSCTL NOPROTO { int getdomainname(char *domainname, \ - int len); } -163 AUE_SYSCTL NOPROTO { int setdomainname(char *domainname, \ - int len); } -164 AUE_NULL NOPROTO { int uname(struct utsname *name); } +162 AUE_NULL OBSOL getdomainname +163 AUE_NULL OBSOL setdomainname +164 AUE_NULL OBSOL uname 165 AUE_SYSARCH NOPROTO { int sysarch(int op, char *parms); } 166 AUE_RTPRIO NOPROTO { int rtprio(int function, pid_t pid, \ struct rtprio *rtp); } Modified: head/sys/compat/linux/linux_misc.c ============================================================================== --- head/sys/compat/linux/linux_misc.c Sun Nov 9 09:24:01 2008 (r184788) +++ head/sys/compat/linux/linux_misc.c Sun Nov 9 10:45:13 2008 (r184789) @@ -1682,6 +1682,7 @@ int linux_sethostname(struct thread *td, struct linux_sethostname_args *args) { int name[2]; + int error; #ifdef DEBUG if (ldebug(sethostname)) @@ -1690,8 +1691,31 @@ linux_sethostname(struct thread *td, str name[0] = CTL_KERN; name[1] = KERN_HOSTNAME; - return (userland_sysctl(td, name, 2, 0, 0, 0, args->hostname, - args->len, 0, 0)); + mtx_lock(&Giant); + error = userland_sysctl(td, name, 2, 0, 0, 0, args->hostname, + args->len, 0, 0); + mtx_unlock(&Giant); + return (error); +} + +int +linux_setdomainname(struct thread *td, struct linux_setdomainname_args *args) +{ + int name[2]; + int error; + +#ifdef DEBUG + if (ldebug(setdomainname)) + printf(ARGS(setdomainname, "*, %i"), args->len); +#endif + + name[0] = CTL_KERN; + name[1] = KERN_NISDOMAINNAME; + mtx_lock(&Giant); + error = userland_sysctl(td, name, 2, 0, 0, 0, args->name, + args->len, 0, 0); + mtx_unlock(&Giant); + return (error); } int Modified: head/sys/i386/linux/syscalls.master ============================================================================== --- head/sys/i386/linux/syscalls.master Sun Nov 9 09:24:01 2008 (r184788) +++ head/sys/i386/linux/syscalls.master Sun Nov 9 10:45:13 2008 (r184789) @@ -217,7 +217,7 @@ ; linux uses some strange calling convention here so we have to use the dummy arg 120 AUE_RFORK STD { int linux_clone(l_int flags, void *stack, \ void *parent_tidptr, int dummy, void * child_tidptr); } -121 AUE_SYSCTL NOPROTO { int setdomainname(char *name, \ +121 AUE_SYSCTL STD { int linux_setdomainname(char *name, \ int len); } 122 AUE_NULL STD { int linux_newuname( \ struct l_new_utsname *buf); } Modified: head/sys/kern/kern_xxx.c ============================================================================== --- head/sys/kern/kern_xxx.c Sun Nov 9 09:24:01 2008 (r184788) +++ head/sys/kern/kern_xxx.c Sun Nov 9 10:45:13 2008 (r184789) @@ -148,8 +148,9 @@ oquota(td, uap) } #endif /* COMPAT_43 */ +#ifdef COMPAT_FREEBSD4 /* - * This is the FreeBSD-1.1 compatable uname(2) interface. These days it is + * This is the FreeBSD-1.1 compatible uname(2) interface. These days it is * done in libc as a wrapper around a bunch of sysctl's. This must maintain * the old 1.1 binary ABI. */ @@ -163,9 +164,7 @@ struct uname_args { #endif /* ARGSUSED */ int -uname(td, uap) - struct thread *td; - struct uname_args *uap; +freebsd4_uname(struct thread *td, struct freebsd4_uname_args *uap) { int name[2], error; size_t len; @@ -242,22 +241,20 @@ struct getdomainname_args { #endif /* ARGSUSED */ int -getdomainname(td, uap) - struct thread *td; - struct getdomainname_args *uap; +freebsd4_getdomainname(struct thread *td, + struct freebsd4_getdomainname_args *uap) { - INIT_VPROCG(TD_TO_VPROCG(td)); - char tmpdomainname[MAXHOSTNAMELEN]; - int domainnamelen; - - mtx_lock(&hostname_mtx); - bcopy(V_domainname, tmpdomainname, sizeof(tmpdomainname)); - mtx_unlock(&hostname_mtx); - - domainnamelen = strlen(tmpdomainname) + 1; - if ((u_int)uap->len > domainnamelen) - uap->len = domainnamelen; - return (copyout(tmpdomainname, uap->domainname, uap->len)); + int name[2]; + int error; + size_t len = uap->len; + + name[0] = CTL_KERN; + name[1] = KERN_NISDOMAINNAME; + mtx_lock(&Giant); + error = userland_sysctl(td, name, 2, uap->domainname, &len, + 1, 0, 0, 0, 0); + mtx_unlock(&Giant); + return(error); } #ifndef _SYS_SYSPROTO_H_ @@ -268,26 +265,18 @@ struct setdomainname_args { #endif /* ARGSUSED */ int -setdomainname(td, uap) - struct thread *td; - struct setdomainname_args *uap; +freebsd4_setdomainname(struct thread *td, + struct freebsd4_setdomainname_args *uap) { - INIT_VPROCG(TD_TO_VPROCG(td)); - char tmpdomainname[MAXHOSTNAMELEN]; - int error, domainnamelen; - - error = priv_check(td, PRIV_SETDOMAINNAME); - if (error) - return (error); - if ((u_int)uap->len > sizeof(tmpdomainname) - 1) - return (EINVAL); - domainnamelen = uap->len; - error = copyin(uap->domainname, tmpdomainname, uap->len); - if (error == 0) { - tmpdomainname[domainnamelen] = 0; - mtx_lock(&hostname_mtx); - bcopy(tmpdomainname, V_domainname, sizeof(V_domainname)); - mtx_unlock(&hostname_mtx); - } + int name[2]; + int error; + + name[0] = CTL_KERN; + name[1] = KERN_NISDOMAINNAME; + mtx_lock(&Giant); + error = userland_sysctl(td, name, 2, 0, 0, 0, uap->domainname, + uap->len, 0, 0); + mtx_unlock(&Giant); return (error); } +#endif /* COMPAT_FREEBSD4 */ Modified: head/sys/kern/syscalls.master ============================================================================== --- head/sys/kern/syscalls.master Sun Nov 9 09:24:01 2008 (r184788) +++ head/sys/kern/syscalls.master Sun Nov 9 10:45:13 2008 (r184789) @@ -320,11 +320,11 @@ struct fhandle *fhp); } 161 AUE_NFS_GETFH STD { int getfh(char *fname, \ struct fhandle *fhp); } -162 AUE_SYSCTL STD { int getdomainname(char *domainname, \ +162 AUE_SYSCTL COMPAT4 { int getdomainname(char *domainname, \ int len); } -163 AUE_SYSCTL STD { int setdomainname(char *domainname, \ +163 AUE_SYSCTL COMPAT4 { int setdomainname(char *domainname, \ int len); } -164 AUE_NULL STD { int uname(struct utsname *name); } +164 AUE_NULL COMPAT4 { int uname(struct utsname *name); } 165 AUE_SYSARCH STD { int sysarch(int op, char *parms); } 166 AUE_RTPRIO STD { int rtprio(int function, pid_t pid, \ struct rtprio *rtp); } Modified: head/sys/sys/priv.h ============================================================================== --- head/sys/sys/priv.h Sun Nov 9 09:24:01 2008 (r184788) +++ head/sys/sys/priv.h Sun Nov 9 10:45:13 2008 (r184789) @@ -84,7 +84,6 @@ #define PRIV_CLOCK_SETTIME 17 /* Can call clock_settime. */ #define PRIV_SETTIMEOFDAY 18 /* Can call settimeofday. */ #define PRIV_SETHOSTID 19 /* Can call sethostid. */ -#define PRIV_SETDOMAINNAME 20 /* Can call setdomainname. */ /* * Audit subsystem privileges. From owner-svn-src-head@FreeBSD.ORG Sun Nov 9 10:48:07 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 52DA0106564A; Sun, 9 Nov 2008 10:48:07 +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 3E2ED8FC17; Sun, 9 Nov 2008 10:48:07 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA9Am7a9039472; Sun, 9 Nov 2008 10:48:07 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA9Am6ss039456; Sun, 9 Nov 2008 10:48:06 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200811091048.mA9Am6ss039456@svn.freebsd.org> From: Ed Schouten Date: Sun, 9 Nov 2008 10:48: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: r184790 - in head/sys: amd64/linux32 compat/freebsd32 i386/linux kern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Nov 2008 10:48:07 -0000 Author: ed Date: Sun Nov 9 10:48:06 2008 New Revision: 184790 URL: http://svn.freebsd.org/changeset/base/184790 Log: Regenerate system call tables for r184789. Modified: head/sys/amd64/linux32/linux32_proto.h head/sys/amd64/linux32/linux32_syscall.h head/sys/amd64/linux32/linux32_sysent.c head/sys/compat/freebsd32/freebsd32_proto.h head/sys/compat/freebsd32/freebsd32_syscall.h head/sys/compat/freebsd32/freebsd32_syscalls.c head/sys/compat/freebsd32/freebsd32_sysent.c head/sys/i386/linux/linux_proto.h head/sys/i386/linux/linux_syscall.h head/sys/i386/linux/linux_sysent.c head/sys/kern/init_sysent.c head/sys/kern/syscalls.c head/sys/kern/systrace_args.c head/sys/sys/syscall.h head/sys/sys/syscall.mk head/sys/sys/sysproto.h Modified: head/sys/amd64/linux32/linux32_proto.h ============================================================================== --- head/sys/amd64/linux32/linux32_proto.h Sun Nov 9 10:45:13 2008 (r184789) +++ head/sys/amd64/linux32/linux32_proto.h Sun Nov 9 10:48:06 2008 (r184790) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: src/sys/amd64/linux32/syscalls.master,v 1.34 2008/05/13 20:01:26 rdivacky Exp + * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 184789 2008-11-09 10:45:13Z ed */ #ifndef _LINUX_SYSPROTO_H_ @@ -378,6 +378,10 @@ struct linux_clone_args { char dummy_l_[PADL_(int)]; int dummy; char dummy_r_[PADR_(int)]; char child_tidptr_l_[PADL_(void *)]; void * child_tidptr; char child_tidptr_r_[PADR_(void *)]; }; +struct linux_setdomainname_args { + char name_l_[PADL_(char *)]; char * name; char name_r_[PADR_(char *)]; + char len_l_[PADL_(int)]; int len; char len_r_[PADR_(int)]; +}; struct linux_newuname_args { char buf_l_[PADL_(struct l_new_utsname *)]; struct l_new_utsname * buf; char buf_r_[PADR_(struct l_new_utsname *)]; }; @@ -1077,6 +1081,7 @@ int linux_sysinfo(struct thread *, struc int linux_ipc(struct thread *, struct linux_ipc_args *); int linux_sigreturn(struct thread *, struct linux_sigreturn_args *); int linux_clone(struct thread *, struct linux_clone_args *); +int linux_setdomainname(struct thread *, struct linux_setdomainname_args *); int linux_newuname(struct thread *, struct linux_newuname_args *); int linux_adjtimex(struct thread *, struct linux_adjtimex_args *); int linux_mprotect(struct thread *, struct linux_mprotect_args *); @@ -1339,6 +1344,7 @@ int linux_vmsplice(struct thread *, stru #define LINUX_SYS_AUE_linux_ipc AUE_NULL #define LINUX_SYS_AUE_linux_sigreturn AUE_SIGRETURN #define LINUX_SYS_AUE_linux_clone AUE_RFORK +#define LINUX_SYS_AUE_linux_setdomainname AUE_SYSCTL #define LINUX_SYS_AUE_linux_newuname AUE_NULL #define LINUX_SYS_AUE_linux_adjtimex AUE_ADJTIME #define LINUX_SYS_AUE_linux_mprotect AUE_MPROTECT Modified: head/sys/amd64/linux32/linux32_syscall.h ============================================================================== --- head/sys/amd64/linux32/linux32_syscall.h Sun Nov 9 10:45:13 2008 (r184789) +++ head/sys/amd64/linux32/linux32_syscall.h Sun Nov 9 10:48:06 2008 (r184790) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: src/sys/amd64/linux32/syscalls.master,v 1.34 2008/05/13 20:01:26 rdivacky Exp + * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 184789 2008-11-09 10:45:13Z ed */ #define LINUX_SYS_exit 1 @@ -112,7 +112,7 @@ #define LINUX_SYS_fsync 118 #define LINUX_SYS_linux_sigreturn 119 #define LINUX_SYS_linux_clone 120 -#define LINUX_SYS_setdomainname 121 +#define LINUX_SYS_linux_setdomainname 121 #define LINUX_SYS_linux_newuname 122 #define LINUX_SYS_linux_adjtimex 124 #define LINUX_SYS_linux_mprotect 125 Modified: head/sys/amd64/linux32/linux32_sysent.c ============================================================================== --- head/sys/amd64/linux32/linux32_sysent.c Sun Nov 9 10:45:13 2008 (r184789) +++ head/sys/amd64/linux32/linux32_sysent.c Sun Nov 9 10:48:06 2008 (r184790) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: src/sys/amd64/linux32/syscalls.master,v 1.34 2008/05/13 20:01:26 rdivacky Exp + * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 184789 2008-11-09 10:45:13Z ed */ #include "opt_compat.h" @@ -140,7 +140,7 @@ struct sysent linux_sysent[] = { { AS(fsync_args), (sy_call_t *)fsync, AUE_FSYNC, NULL, 0, 0 }, /* 118 = fsync */ { AS(linux_sigreturn_args), (sy_call_t *)linux_sigreturn, AUE_SIGRETURN, NULL, 0, 0 }, /* 119 = linux_sigreturn */ { AS(linux_clone_args), (sy_call_t *)linux_clone, AUE_RFORK, NULL, 0, 0 }, /* 120 = linux_clone */ - { AS(setdomainname_args), (sy_call_t *)setdomainname, AUE_SYSCTL, NULL, 0, 0 }, /* 121 = setdomainname */ + { AS(linux_setdomainname_args), (sy_call_t *)linux_setdomainname, AUE_SYSCTL, NULL, 0, 0 }, /* 121 = linux_setdomainname */ { AS(linux_newuname_args), (sy_call_t *)linux_newuname, AUE_NULL, NULL, 0, 0 }, /* 122 = linux_newuname */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 123 = modify_ldt */ { 0, (sy_call_t *)linux_adjtimex, AUE_ADJTIME, NULL, 0, 0 }, /* 124 = linux_adjtimex */ Modified: head/sys/compat/freebsd32/freebsd32_proto.h ============================================================================== --- head/sys/compat/freebsd32/freebsd32_proto.h Sun Nov 9 10:45:13 2008 (r184789) +++ head/sys/compat/freebsd32/freebsd32_proto.h Sun Nov 9 10:48:06 2008 (r184790) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 184588 2008-11-03 10:38:00Z dfr + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 184789 2008-11-09 10:45:13Z ed */ #ifndef _FREEBSD32_SYSPROTO_H_ Modified: head/sys/compat/freebsd32/freebsd32_syscall.h ============================================================================== --- head/sys/compat/freebsd32/freebsd32_syscall.h Sun Nov 9 10:45:13 2008 (r184789) +++ head/sys/compat/freebsd32/freebsd32_syscall.h Sun Nov 9 10:48:06 2008 (r184790) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 184588 2008-11-03 10:38:00Z dfr + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 184789 2008-11-09 10:45:13Z ed */ #define FREEBSD32_SYS_syscall 0 @@ -156,9 +156,9 @@ #define FREEBSD32_SYS_freebsd4_freebsd32_statfs 157 #define FREEBSD32_SYS_freebsd4_freebsd32_fstatfs 158 #define FREEBSD32_SYS_getfh 161 -#define FREEBSD32_SYS_getdomainname 162 -#define FREEBSD32_SYS_setdomainname 163 -#define FREEBSD32_SYS_uname 164 + /* 162 is obsolete getdomainname */ + /* 163 is obsolete setdomainname */ + /* 164 is obsolete uname */ #define FREEBSD32_SYS_sysarch 165 #define FREEBSD32_SYS_rtprio 166 #define FREEBSD32_SYS_freebsd32_semsys 169 Modified: head/sys/compat/freebsd32/freebsd32_syscalls.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_syscalls.c Sun Nov 9 10:45:13 2008 (r184789) +++ head/sys/compat/freebsd32/freebsd32_syscalls.c Sun Nov 9 10:48:06 2008 (r184790) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 184588 2008-11-03 10:38:00Z dfr + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 184789 2008-11-09 10:45:13Z ed */ const char *freebsd32_syscallnames[] = { @@ -169,9 +169,9 @@ const char *freebsd32_syscallnames[] = { "#159", /* 159 = nosys */ "#160", /* 160 = lgetfh */ "getfh", /* 161 = getfh */ - "getdomainname", /* 162 = getdomainname */ - "setdomainname", /* 163 = setdomainname */ - "uname", /* 164 = uname */ + "obs_getdomainname", /* 162 = obsolete getdomainname */ + "obs_setdomainname", /* 163 = obsolete setdomainname */ + "obs_uname", /* 164 = obsolete uname */ "sysarch", /* 165 = sysarch */ "rtprio", /* 166 = rtprio */ "#167", /* 167 = nosys */ Modified: head/sys/compat/freebsd32/freebsd32_sysent.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_sysent.c Sun Nov 9 10:45:13 2008 (r184789) +++ head/sys/compat/freebsd32/freebsd32_sysent.c Sun Nov 9 10:48:06 2008 (r184790) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 184588 2008-11-03 10:38:00Z dfr + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 184789 2008-11-09 10:45:13Z ed */ #include "opt_compat.h" @@ -200,9 +200,9 @@ struct sysent freebsd32_sysent[] = { { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 159 = nosys */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 160 = lgetfh */ { AS(getfh_args), (sy_call_t *)getfh, AUE_NFS_GETFH, NULL, 0, 0 }, /* 161 = getfh */ - { AS(getdomainname_args), (sy_call_t *)getdomainname, AUE_SYSCTL, NULL, 0, 0 }, /* 162 = getdomainname */ - { AS(setdomainname_args), (sy_call_t *)setdomainname, AUE_SYSCTL, NULL, 0, 0 }, /* 163 = setdomainname */ - { AS(uname_args), (sy_call_t *)uname, AUE_NULL, NULL, 0, 0 }, /* 164 = uname */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 162 = obsolete getdomainname */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 163 = obsolete setdomainname */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 164 = obsolete uname */ { AS(sysarch_args), (sy_call_t *)sysarch, AUE_SYSARCH, NULL, 0, 0 }, /* 165 = sysarch */ { AS(rtprio_args), (sy_call_t *)rtprio, AUE_RTPRIO, NULL, 0, 0 }, /* 166 = rtprio */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 167 = nosys */ Modified: head/sys/i386/linux/linux_proto.h ============================================================================== --- head/sys/i386/linux/linux_proto.h Sun Nov 9 10:45:13 2008 (r184789) +++ head/sys/i386/linux/linux_proto.h Sun Nov 9 10:48:06 2008 (r184790) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: src/sys/i386/linux/syscalls.master,v 1.93 2008/05/13 20:01:27 rdivacky Exp + * created from FreeBSD: head/sys/i386/linux/syscalls.master 184789 2008-11-09 10:45:13Z ed */ #ifndef _LINUX_SYSPROTO_H_ @@ -381,6 +381,10 @@ struct linux_clone_args { char dummy_l_[PADL_(int)]; int dummy; char dummy_r_[PADR_(int)]; char child_tidptr_l_[PADL_(void *)]; void * child_tidptr; char child_tidptr_r_[PADR_(void *)]; }; +struct linux_setdomainname_args { + char name_l_[PADL_(char *)]; char * name; char name_r_[PADR_(char *)]; + char len_l_[PADL_(int)]; int len; char len_r_[PADR_(int)]; +}; struct linux_newuname_args { char buf_l_[PADL_(struct l_new_utsname *)]; struct l_new_utsname * buf; char buf_r_[PADR_(struct l_new_utsname *)]; }; @@ -1097,6 +1101,7 @@ int linux_sysinfo(struct thread *, struc int linux_ipc(struct thread *, struct linux_ipc_args *); int linux_sigreturn(struct thread *, struct linux_sigreturn_args *); int linux_clone(struct thread *, struct linux_clone_args *); +int linux_setdomainname(struct thread *, struct linux_setdomainname_args *); int linux_newuname(struct thread *, struct linux_newuname_args *); int linux_modify_ldt(struct thread *, struct linux_modify_ldt_args *); int linux_adjtimex(struct thread *, struct linux_adjtimex_args *); @@ -1360,6 +1365,7 @@ int linux_vmsplice(struct thread *, stru #define LINUX_SYS_AUE_linux_ipc AUE_NULL #define LINUX_SYS_AUE_linux_sigreturn AUE_SIGRETURN #define LINUX_SYS_AUE_linux_clone AUE_RFORK +#define LINUX_SYS_AUE_linux_setdomainname AUE_SYSCTL #define LINUX_SYS_AUE_linux_newuname AUE_NULL #define LINUX_SYS_AUE_linux_modify_ldt AUE_NULL #define LINUX_SYS_AUE_linux_adjtimex AUE_ADJTIME Modified: head/sys/i386/linux/linux_syscall.h ============================================================================== --- head/sys/i386/linux/linux_syscall.h Sun Nov 9 10:45:13 2008 (r184789) +++ head/sys/i386/linux/linux_syscall.h Sun Nov 9 10:48:06 2008 (r184790) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: src/sys/i386/linux/syscalls.master,v 1.93 2008/05/13 20:01:27 rdivacky Exp + * created from FreeBSD: head/sys/i386/linux/syscalls.master 184789 2008-11-09 10:45:13Z ed */ #define LINUX_SYS_exit 1 @@ -116,7 +116,7 @@ #define LINUX_SYS_fsync 118 #define LINUX_SYS_linux_sigreturn 119 #define LINUX_SYS_linux_clone 120 -#define LINUX_SYS_setdomainname 121 +#define LINUX_SYS_linux_setdomainname 121 #define LINUX_SYS_linux_newuname 122 #define LINUX_SYS_linux_modify_ldt 123 #define LINUX_SYS_linux_adjtimex 124 Modified: head/sys/i386/linux/linux_sysent.c ============================================================================== --- head/sys/i386/linux/linux_sysent.c Sun Nov 9 10:45:13 2008 (r184789) +++ head/sys/i386/linux/linux_sysent.c Sun Nov 9 10:48:06 2008 (r184790) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: src/sys/i386/linux/syscalls.master,v 1.93 2008/05/13 20:01:27 rdivacky Exp + * created from FreeBSD: head/sys/i386/linux/syscalls.master 184789 2008-11-09 10:45:13Z ed */ #include @@ -139,7 +139,7 @@ struct sysent linux_sysent[] = { { AS(fsync_args), (sy_call_t *)fsync, AUE_FSYNC, NULL, 0, 0 }, /* 118 = fsync */ { AS(linux_sigreturn_args), (sy_call_t *)linux_sigreturn, AUE_SIGRETURN, NULL, 0, 0 }, /* 119 = linux_sigreturn */ { AS(linux_clone_args), (sy_call_t *)linux_clone, AUE_RFORK, NULL, 0, 0 }, /* 120 = linux_clone */ - { AS(setdomainname_args), (sy_call_t *)setdomainname, AUE_SYSCTL, NULL, 0, 0 }, /* 121 = setdomainname */ + { AS(linux_setdomainname_args), (sy_call_t *)linux_setdomainname, AUE_SYSCTL, NULL, 0, 0 }, /* 121 = linux_setdomainname */ { AS(linux_newuname_args), (sy_call_t *)linux_newuname, AUE_NULL, NULL, 0, 0 }, /* 122 = linux_newuname */ { AS(linux_modify_ldt_args), (sy_call_t *)linux_modify_ldt, AUE_NULL, NULL, 0, 0 }, /* 123 = linux_modify_ldt */ { 0, (sy_call_t *)linux_adjtimex, AUE_ADJTIME, NULL, 0, 0 }, /* 124 = linux_adjtimex */ Modified: head/sys/kern/init_sysent.c ============================================================================== --- head/sys/kern/init_sysent.c Sun Nov 9 10:45:13 2008 (r184789) +++ head/sys/kern/init_sysent.c Sun Nov 9 10:48:06 2008 (r184790) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/kern/syscalls.master 184588 2008-11-03 10:38:00Z dfr + * created from FreeBSD: head/sys/kern/syscalls.master 184789 2008-11-09 10:45:13Z ed */ #include "opt_compat.h" @@ -190,9 +190,9 @@ struct sysent sysent[] = { { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 159 = nosys */ { AS(lgetfh_args), (sy_call_t *)lgetfh, AUE_LGETFH, NULL, 0, 0 }, /* 160 = lgetfh */ { AS(getfh_args), (sy_call_t *)getfh, AUE_NFS_GETFH, NULL, 0, 0 }, /* 161 = getfh */ - { AS(getdomainname_args), (sy_call_t *)getdomainname, AUE_SYSCTL, NULL, 0, 0 }, /* 162 = getdomainname */ - { AS(setdomainname_args), (sy_call_t *)setdomainname, AUE_SYSCTL, NULL, 0, 0 }, /* 163 = setdomainname */ - { AS(uname_args), (sy_call_t *)uname, AUE_NULL, NULL, 0, 0 }, /* 164 = uname */ + { compat4(AS(freebsd4_getdomainname_args),getdomainname), AUE_SYSCTL, NULL, 0, 0 }, /* 162 = old getdomainname */ + { compat4(AS(freebsd4_setdomainname_args),setdomainname), AUE_SYSCTL, NULL, 0, 0 }, /* 163 = old setdomainname */ + { compat4(AS(freebsd4_uname_args),uname), AUE_NULL, NULL, 0, 0 }, /* 164 = old uname */ { AS(sysarch_args), (sy_call_t *)sysarch, AUE_SYSARCH, NULL, 0, 0 }, /* 165 = sysarch */ { AS(rtprio_args), (sy_call_t *)rtprio, AUE_RTPRIO, NULL, 0, 0 }, /* 166 = rtprio */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 167 = nosys */ Modified: head/sys/kern/syscalls.c ============================================================================== --- head/sys/kern/syscalls.c Sun Nov 9 10:45:13 2008 (r184789) +++ head/sys/kern/syscalls.c Sun Nov 9 10:48:06 2008 (r184790) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/kern/syscalls.master 184588 2008-11-03 10:38:00Z dfr + * created from FreeBSD: head/sys/kern/syscalls.master 184789 2008-11-09 10:45:13Z ed */ const char *syscallnames[] = { @@ -169,9 +169,9 @@ const char *syscallnames[] = { "#159", /* 159 = nosys */ "lgetfh", /* 160 = lgetfh */ "getfh", /* 161 = getfh */ - "getdomainname", /* 162 = getdomainname */ - "setdomainname", /* 163 = setdomainname */ - "uname", /* 164 = uname */ + "compat4.getdomainname", /* 162 = old getdomainname */ + "compat4.setdomainname", /* 163 = old setdomainname */ + "compat4.uname", /* 164 = old uname */ "sysarch", /* 165 = sysarch */ "rtprio", /* 166 = rtprio */ "#167", /* 167 = nosys */ Modified: head/sys/kern/systrace_args.c ============================================================================== --- head/sys/kern/systrace_args.c Sun Nov 9 10:45:13 2008 (r184789) +++ head/sys/kern/systrace_args.c Sun Nov 9 10:48:06 2008 (r184790) @@ -864,29 +864,6 @@ systrace_args(int sysnum, void *params, *n_args = 2; break; } - /* getdomainname */ - case 162: { - struct getdomainname_args *p = params; - uarg[0] = (intptr_t) p->domainname; /* char * */ - iarg[1] = p->len; /* int */ - *n_args = 2; - break; - } - /* setdomainname */ - case 163: { - struct setdomainname_args *p = params; - uarg[0] = (intptr_t) p->domainname; /* char * */ - iarg[1] = p->len; /* int */ - *n_args = 2; - break; - } - /* uname */ - case 164: { - struct uname_args *p = params; - uarg[0] = (intptr_t) p->name; /* struct utsname * */ - *n_args = 1; - break; - } /* sysarch */ case 165: { struct sysarch_args *p = params; @@ -4441,42 +4418,6 @@ systrace_setargdesc(int sysnum, int ndx, break; }; break; - /* getdomainname */ - case 162: - switch(ndx) { - case 0: - p = "char *"; - break; - case 1: - p = "int"; - break; - default: - break; - }; - break; - /* setdomainname */ - case 163: - switch(ndx) { - case 0: - p = "char *"; - break; - case 1: - p = "int"; - break; - default: - break; - }; - break; - /* uname */ - case 164: - switch(ndx) { - case 0: - p = "struct utsname *"; - break; - default: - break; - }; - break; /* sysarch */ case 165: switch(ndx) { Modified: head/sys/sys/syscall.h ============================================================================== --- head/sys/sys/syscall.h Sun Nov 9 10:45:13 2008 (r184789) +++ head/sys/sys/syscall.h Sun Nov 9 10:48:06 2008 (r184790) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/kern/syscalls.master 184588 2008-11-03 10:38:00Z dfr + * created from FreeBSD: head/sys/kern/syscalls.master 184789 2008-11-09 10:45:13Z ed */ #define SYS_syscall 0 @@ -161,9 +161,9 @@ #define SYS_freebsd4_fstatfs 158 #define SYS_lgetfh 160 #define SYS_getfh 161 -#define SYS_getdomainname 162 -#define SYS_setdomainname 163 -#define SYS_uname 164 +#define SYS_freebsd4_getdomainname 162 +#define SYS_freebsd4_setdomainname 163 +#define SYS_freebsd4_uname 164 #define SYS_sysarch 165 #define SYS_rtprio 166 #define SYS_semsys 169 Modified: head/sys/sys/syscall.mk ============================================================================== --- head/sys/sys/syscall.mk Sun Nov 9 10:45:13 2008 (r184789) +++ head/sys/sys/syscall.mk Sun Nov 9 10:48:06 2008 (r184790) @@ -1,7 +1,7 @@ # FreeBSD system call names. # DO NOT EDIT-- this file is automatically generated. # $FreeBSD$ -# created from FreeBSD: head/sys/kern/syscalls.master 184588 2008-11-03 10:38:00Z dfr +# created from FreeBSD: head/sys/kern/syscalls.master 184789 2008-11-09 10:45:13Z ed MIASM = \ syscall.o \ exit.o \ @@ -113,9 +113,9 @@ MIASM = \ freebsd4_fstatfs.o \ lgetfh.o \ getfh.o \ - getdomainname.o \ - setdomainname.o \ - uname.o \ + freebsd4_getdomainname.o \ + freebsd4_setdomainname.o \ + freebsd4_uname.o \ sysarch.o \ rtprio.o \ semsys.o \ Modified: head/sys/sys/sysproto.h ============================================================================== --- head/sys/sys/sysproto.h Sun Nov 9 10:45:13 2008 (r184789) +++ head/sys/sys/sysproto.h Sun Nov 9 10:48:06 2008 (r184790) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/kern/syscalls.master 184588 2008-11-03 10:38:00Z dfr + * created from FreeBSD: head/sys/kern/syscalls.master 184789 2008-11-09 10:45:13Z ed */ #ifndef _SYS_SYSPROTO_H_ @@ -500,17 +500,6 @@ struct getfh_args { char fname_l_[PADL_(char *)]; char * fname; char fname_r_[PADR_(char *)]; char fhp_l_[PADL_(struct fhandle *)]; struct fhandle * fhp; char fhp_r_[PADR_(struct fhandle *)]; }; -struct getdomainname_args { - char domainname_l_[PADL_(char *)]; char * domainname; char domainname_r_[PADR_(char *)]; - char len_l_[PADL_(int)]; int len; char len_r_[PADR_(int)]; -}; -struct setdomainname_args { - char domainname_l_[PADL_(char *)]; char * domainname; char domainname_r_[PADR_(char *)]; - char len_l_[PADL_(int)]; int len; char len_r_[PADR_(int)]; -}; -struct uname_args { - char name_l_[PADL_(struct utsname *)]; struct utsname * name; char name_r_[PADR_(struct utsname *)]; -}; struct sysarch_args { char op_l_[PADL_(int)]; int op; char op_r_[PADR_(int)]; char parms_l_[PADL_(char *)]; char * parms; char parms_r_[PADR_(char *)]; @@ -1743,9 +1732,6 @@ int nlm_syscall(struct thread *, struct int nfssvc(struct thread *, struct nfssvc_args *); int lgetfh(struct thread *, struct lgetfh_args *); int getfh(struct thread *, struct getfh_args *); -int getdomainname(struct thread *, struct getdomainname_args *); -int setdomainname(struct thread *, struct setdomainname_args *); -int uname(struct thread *, struct uname_args *); int sysarch(struct thread *, struct sysarch_args *); int rtprio(struct thread *, struct rtprio_args *); int semsys(struct thread *, struct semsys_args *); @@ -2181,6 +2167,17 @@ struct freebsd4_fstatfs_args { char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; char buf_l_[PADL_(struct ostatfs *)]; struct ostatfs * buf; char buf_r_[PADR_(struct ostatfs *)]; }; +struct freebsd4_getdomainname_args { + char domainname_l_[PADL_(char *)]; char * domainname; char domainname_r_[PADR_(char *)]; + char len_l_[PADL_(int)]; int len; char len_r_[PADR_(int)]; +}; +struct freebsd4_setdomainname_args { + char domainname_l_[PADL_(char *)]; char * domainname; char domainname_r_[PADR_(char *)]; + char len_l_[PADL_(int)]; int len; char len_r_[PADR_(int)]; +}; +struct freebsd4_uname_args { + char name_l_[PADL_(struct utsname *)]; struct utsname * name; char name_r_[PADR_(struct utsname *)]; +}; struct freebsd4_fhstatfs_args { char u_fhp_l_[PADL_(const struct fhandle *)]; const struct fhandle * u_fhp; char u_fhp_r_[PADR_(const struct fhandle *)]; char buf_l_[PADL_(struct ostatfs *)]; struct ostatfs * buf; char buf_r_[PADR_(struct ostatfs *)]; @@ -2205,6 +2202,9 @@ struct freebsd4_sigreturn_args { int freebsd4_getfsstat(struct thread *, struct freebsd4_getfsstat_args *); int freebsd4_statfs(struct thread *, struct freebsd4_statfs_args *); int freebsd4_fstatfs(struct thread *, struct freebsd4_fstatfs_args *); +int freebsd4_getdomainname(struct thread *, struct freebsd4_getdomainname_args *); +int freebsd4_setdomainname(struct thread *, struct freebsd4_setdomainname_args *); +int freebsd4_uname(struct thread *, struct freebsd4_uname_args *); int freebsd4_fhstatfs(struct thread *, struct freebsd4_fhstatfs_args *); int freebsd4_sendfile(struct thread *, struct freebsd4_sendfile_args *); int freebsd4_sigaction(struct thread *, struct freebsd4_sigaction_args *); @@ -2325,9 +2325,6 @@ int freebsd4_sigreturn(struct thread *, #define SYS_AUE_nfssvc AUE_NFS_SVC #define SYS_AUE_lgetfh AUE_LGETFH #define SYS_AUE_getfh AUE_NFS_GETFH -#define SYS_AUE_getdomainname AUE_SYSCTL -#define SYS_AUE_setdomainname AUE_SYSCTL -#define SYS_AUE_uname AUE_NULL #define SYS_AUE_sysarch AUE_SYSARCH #define SYS_AUE_rtprio AUE_RTPRIO #define SYS_AUE_semsys AUE_SEMSYS From owner-svn-src-head@FreeBSD.ORG Sun Nov 9 13:20:32 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C9A7D106564A; Sun, 9 Nov 2008 13:20:32 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.terabit.net.ua (mail.terabit.net.ua [195.137.202.147]) by mx1.freebsd.org (Postfix) with ESMTP id 649E28FC08; Sun, 9 Nov 2008 13:20:32 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from skuns.zoral.com.ua ([91.193.166.194] helo=mail.zoral.com.ua) by mail.terabit.net.ua with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63 (FreeBSD)) (envelope-from ) id 1KzADO-000N4G-FL; Sun, 09 Nov 2008 15:20:30 +0200 Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id mA9DKRXC049500 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 9 Nov 2008 15:20:28 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.3/8.14.3) with ESMTP id mA9DKR1E072063; Sun, 9 Nov 2008 15:20:27 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.3/8.14.3/Submit) id mA9DKRim072061; Sun, 9 Nov 2008 15:20:27 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 9 Nov 2008 15:20:26 +0200 From: Kostik Belousov To: Matteo Riondato Message-ID: <20081109132026.GL18100@deviant.kiev.zoral.com.ua> References: <200811090644.mA96ira1032670@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="EyugWz6C5819Q3pC" Content-Disposition: inline In-Reply-To: <200811090644.mA96ira1032670@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: ClamAV version 0.93.3, clamav-milter version 0.93.3 on skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua X-Virus-Scanned: mail.terabit.net.ua 1KzADO-000N4G-FL 5b74bafc673dcc8b9e2e65ee58c8fae9 X-Terabit: YES Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r184779 - head/usr.sbin/cron/crontab X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Nov 2008 13:20:32 -0000 --EyugWz6C5819Q3pC Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Nov 09, 2008 at 06:44:53AM +0000, Matteo Riondato wrote: > Author: matteo > Date: Sun Nov 9 06:44:53 2008 > New Revision: 184779 > URL: http://svn.freebsd.org/changeset/base/184779 >=20 > Log: > Be paranoid and use snprintf > =20 > PR: bin/122137 > Submitted by: Steven Kreuzer > MFC after: 3 days >=20 > Modified: > head/usr.sbin/cron/crontab/crontab.c >=20 > Modified: head/usr.sbin/cron/crontab/crontab.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.sbin/cron/crontab/crontab.c Sun Nov 9 01:53:06 2008 (r18477= 8) > +++ head/usr.sbin/cron/crontab/crontab.c Sun Nov 9 06:44:53 2008 (r18477= 9) > @@ -263,7 +263,7 @@ list_cmd() { > FILE *f; > =20 > log_it(RealUser, Pid, "LIST", User); > - (void) sprintf(n, CRON_TAB(User)); > + (void) snprintf(n, sizeof(n), CRON_TAB(User)); This note is probably also about paranoia instead of exploitable bug. I think that it is better to use %s format explicitely instead of expecting no '%' in the CRON_TAB(User). > if (!(f =3D fopen(n, "r"))) { > if (errno =3D=3D ENOENT) > errx(ERROR_EXIT, "no crontab for %s", User); > @@ -293,7 +293,7 @@ delete_cmd() { > } > =20 > log_it(RealUser, Pid, "DELETE", User); > - (void) sprintf(n, CRON_TAB(User)); > + (void) snprintf(n, sizeof(n), CRON_TAB(User)); > if (unlink(n)) { > if (errno =3D=3D ENOENT) > errx(ERROR_EXIT, "no crontab for %s", User); > @@ -327,7 +327,7 @@ edit_cmd() { > char new_md5[MD5_SIZE]; > =20 > log_it(RealUser, Pid, "BEGIN EDIT", User); > - (void) sprintf(n, CRON_TAB(User)); > + (void) snprintf(n, sizeof(n), CRON_TAB(User)); > if (!(f =3D fopen(n, "r"))) { > if (errno !=3D ENOENT) > err(ERROR_EXIT, "%s", n); > @@ -337,7 +337,7 @@ edit_cmd() { > } > =20 > um =3D umask(077); > - (void) sprintf(Filename, "/tmp/crontab.XXXXXXXXXX"); > + (void) snprintf(Filename, sizeof(Filename), "/tmp/crontab.XXXXXXXXXX"); > if ((t =3D mkstemp(Filename)) =3D=3D -1) { > warn("%s", Filename); > (void) umask(um); > @@ -504,8 +504,8 @@ replace_cmd() { > return (-2); > } > =20 > - (void) sprintf(n, "tmp.%d", Pid); > - (void) sprintf(tn, CRON_TAB(n)); > + (void) snprintf(n, sizeof(n), "tmp.%d", Pid); > + (void) snprintf(tn, sizeof(n), CRON_TAB(n)); > if (!(tmp =3D fopen(tn, "w+"))) { > warn("%s", tn); > return (-2); > @@ -592,7 +592,7 @@ replace_cmd() { > return (-2); > } > =20 > - (void) sprintf(n, CRON_TAB(User)); > + (void) snprintf(n, sizeof(n), CRON_TAB(User)); > if (rename(tn, n)) { > warn("error renaming %s to %s", tn, n); > unlink(tn); --EyugWz6C5819Q3pC Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iEYEARECAAYFAkkW45oACgkQC3+MBN1Mb4gfYQCg5TMAnQ+cJEhlagqffYeSSLn9 qyMAn1eJYaBBWg8z9rIKQqOkyk0sxfBk =XRk+ -----END PGP SIGNATURE----- --EyugWz6C5819Q3pC-- From owner-svn-src-head@FreeBSD.ORG Sun Nov 9 13:58:15 2008 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9A8B6106568B; Sun, 9 Nov 2008 13:58:15 +0000 (UTC) (envelope-from trhodes@FreeBSD.org) Received: from pittgoth.com (pittgoth.com [205.134.163.206]) by mx1.freebsd.org (Postfix) with ESMTP id 539108FC0A; Sun, 9 Nov 2008 13:58:15 +0000 (UTC) (envelope-from trhodes@FreeBSD.org) Received: from localhost.fbsdsecure.org (c-68-83-213-214.hsd1.va.comcast.net [68.83.213.214]) (authenticated bits=0) by pittgoth.com (8.14.2/8.14.2) with ESMTP id mA9DK06m062929 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Sun, 9 Nov 2008 08:20:01 -0500 (EST) (envelope-from trhodes@FreeBSD.org) Date: Sun, 9 Nov 2008 08:19:58 -0500 From: Tom Rhodes To: Alexey Dokuchaev Message-Id: <20081109081958.140b26f7.trhodes@FreeBSD.org> In-Reply-To: <20081109102551.GA61113@FreeBSD.org> References: <200811090758.mA97wNKt033972@svn.freebsd.org> <20081109111133.88165rocbmwehckc@webmail.leidinger.net> <20081109102551.GA61113@FreeBSD.org> X-Mailer: Sylpheed version 1.0.6 (GTK+ 1.2.10; 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, Alexander@Leidinger.net, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, sobomax@FreeBSD.org Subject: Re: svn commit: r184781 - head/usr.sbin/mergemaster X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Nov 2008 13:58:15 -0000 On Sun, 9 Nov 2008 10:25:51 +0000 Alexey Dokuchaev wrote: > On Sun, Nov 09, 2008 at 11:11:33AM +0100, Alexander Leidinger wrote: > > Quoting Maxim Sobolev (from Sun, 9 Nov 2008 > > 07:58:23 +0000 (UTC)): > > > > >Author: sobomax > > >Date: Sun Nov 9 07:58:23 2008 > > >New Revision: 184781 > > >URL: http://svn.freebsd.org/changeset/base/184781 > > > > > >Log: > > > Ignore files that only differ in CVS Id tag. > > > > I would like to have (ideally automatic) replacement of files in this > > case. > > Seconded. Methinks it would be nice to have CVS Id's updated, either > automagically or via interactive process, but certainly not silently > ignored. > > ./danfe > Doesn't "mergemaster -Ui" just do that? And yes, I agree, ignoring files this way is probably a bad idea. -- Tom Rhodes From owner-svn-src-head@FreeBSD.ORG Sun Nov 9 14:06:45 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C1B6A1065700; Sun, 9 Nov 2008 14:06: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 AD4EF8FC14; Sun, 9 Nov 2008 14:06:45 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA9E6jFO043118; Sun, 9 Nov 2008 14:06:45 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA9E6jBe043116; Sun, 9 Nov 2008 14:06:45 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200811091406.mA9E6jBe043116@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sun, 9 Nov 2008 14:06: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: r184797 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Nov 2008 14:06:45 -0000 Author: bz Date: Sun Nov 9 14:06:44 2008 New Revision: 184797 URL: http://svn.freebsd.org/changeset/base/184797 Log: For consistency work on the local object passed into the function for the lock operation instead using the global name. Submitted by: ganbold MFC after: 2 months Modified: head/sys/netinet/ip_fw2.c Modified: head/sys/netinet/ip_fw2.c ============================================================================== --- head/sys/netinet/ip_fw2.c Sun Nov 9 14:06:17 2008 (r184796) +++ head/sys/netinet/ip_fw2.c Sun Nov 9 14:06:44 2008 (r184797) @@ -1803,14 +1803,14 @@ add_table_entry(struct ip_fw_chain *ch, ent->addr.sin_len = ent->mask.sin_len = 8; ent->mask.sin_addr.s_addr = htonl(mlen ? ~((1 << (32 - mlen)) - 1) : 0); ent->addr.sin_addr.s_addr = addr & ent->mask.sin_addr.s_addr; - IPFW_WLOCK(&V_layer3_chain); + IPFW_WLOCK(ch); if (rnh->rnh_addaddr(&ent->addr, &ent->mask, rnh, (void *)ent) == NULL) { - IPFW_WUNLOCK(&V_layer3_chain); + IPFW_WUNLOCK(ch); free(ent, M_IPFW_TBL); return (EEXIST); } - IPFW_WUNLOCK(&V_layer3_chain); + IPFW_WUNLOCK(ch); return (0); } From owner-svn-src-head@FreeBSD.ORG Sun Nov 9 14:38:25 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B090A106567B; Sun, 9 Nov 2008 14:38:25 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.terabit.net.ua (mail.terabit.net.ua [195.137.202.147]) by mx1.freebsd.org (Postfix) with ESMTP id 471568FC14; Sun, 9 Nov 2008 14:38:25 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from skuns.zoral.com.ua ([91.193.166.194] helo=mail.zoral.com.ua) by mail.terabit.net.ua with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63 (FreeBSD)) (envelope-from ) id 1KzBQl-0003HM-5z; Sun, 09 Nov 2008 16:38:23 +0200 Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id mA9EcKSq053172 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 9 Nov 2008 16:38:20 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.3/8.14.3) with ESMTP id mA9EcKr3074052; Sun, 9 Nov 2008 16:38:20 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.3/8.14.3/Submit) id mA9EcJA6074051; Sun, 9 Nov 2008 16:38:19 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 9 Nov 2008 16:38:19 +0200 From: Kostik Belousov To: Matteo Riondato Message-ID: <20081109143819.GO18100@deviant.kiev.zoral.com.ua> References: <200811090644.mA96ira1032670@svn.freebsd.org> <20081109132026.GL18100@deviant.kiev.zoral.com.ua> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="hA47Z5c7pMOLFxYj" Content-Disposition: inline In-Reply-To: <20081109132026.GL18100@deviant.kiev.zoral.com.ua> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: ClamAV version 0.93.3, clamav-milter version 0.93.3 on skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua X-Virus-Scanned: mail.terabit.net.ua 1KzBQl-0003HM-5z 57a501e97732323432956a453b2bb400 X-Terabit: YES Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r184779 - head/usr.sbin/cron/crontab X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Nov 2008 14:38:25 -0000 --hA47Z5c7pMOLFxYj Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Nov 09, 2008 at 03:20:26PM +0200, Kostik Belousov wrote: > On Sun, Nov 09, 2008 at 06:44:53AM +0000, Matteo Riondato wrote: > > Author: matteo > > Date: Sun Nov 9 06:44:53 2008 > > New Revision: 184779 > > URL: http://svn.freebsd.org/changeset/base/184779 > >=20 > > Log: > > Be paranoid and use snprintf > > =20 > > PR: bin/122137 > > Submitted by: Steven Kreuzer > > MFC after: 3 days > >=20 > > Modified: > > head/usr.sbin/cron/crontab/crontab.c > >=20 > > Modified: head/usr.sbin/cron/crontab/crontab.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.sbin/cron/crontab/crontab.c Sun Nov 9 01:53:06 2008 (r184= 778) > > +++ head/usr.sbin/cron/crontab/crontab.c Sun Nov 9 06:44:53 2008 (r184= 779) > > @@ -263,7 +263,7 @@ list_cmd() { > > FILE *f; > > =20 > > log_it(RealUser, Pid, "LIST", User); > > - (void) sprintf(n, CRON_TAB(User)); > > + (void) snprintf(n, sizeof(n), CRON_TAB(User)); > This note is probably also about paranoia instead of exploitable bug. > I think that it is better to use %s format explicitely instead of > expecting no '%' in the CRON_TAB(User). Please, ignore this. I should have looked at the actual code. --hA47Z5c7pMOLFxYj Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iEYEARECAAYFAkkW9dsACgkQC3+MBN1Mb4gG/ACfcYQ3yoHewHoYFlrDkrcPGfeV oWEAoN3/Q004t/j0zoJ6oNwuFu5wiqI5 =hS4L -----END PGP SIGNATURE----- --hA47Z5c7pMOLFxYj-- From owner-svn-src-head@FreeBSD.ORG Sun Nov 9 17:07:53 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4339F1065676; Sun, 9 Nov 2008 17:07:53 +0000 (UTC) (envelope-from jkoshy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 32F7B8FC0A; Sun, 9 Nov 2008 17:07:53 +0000 (UTC) (envelope-from jkoshy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA9H7rwU046479; Sun, 9 Nov 2008 17:07:53 GMT (envelope-from jkoshy@svn.freebsd.org) Received: (from jkoshy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA9H7rVL046478; Sun, 9 Nov 2008 17:07:53 GMT (envelope-from jkoshy@svn.freebsd.org) Message-Id: <200811091707.mA9H7rVL046478@svn.freebsd.org> From: Joseph Koshy Date: Sun, 9 Nov 2008 17:07: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: r184801 - head/sys/dev/hwpmc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Nov 2008 17:07:53 -0000 Author: jkoshy Date: Sun Nov 9 17:07:52 2008 New Revision: 184801 URL: http://svn.freebsd.org/changeset/base/184801 Log: Style tweak. Modified: head/sys/dev/hwpmc/hwpmc_logging.c Modified: head/sys/dev/hwpmc/hwpmc_logging.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_logging.c Sun Nov 9 14:32:58 2008 (r184800) +++ head/sys/dev/hwpmc/hwpmc_logging.c Sun Nov 9 17:07:52 2008 (r184801) @@ -973,8 +973,8 @@ pmclog_initialize() /* create global pool of log buffers */ for (n = 0; n < pmc_nlogbuffers; n++) { - plb = malloc(1024 * pmclog_buffer_size, - M_PMC, M_ZERO|M_WAITOK); + plb = malloc(1024 * pmclog_buffer_size, M_PMC, + M_WAITOK|M_ZERO); PMCLOG_INIT_BUFFER_DESCRIPTOR(plb); TAILQ_INSERT_HEAD(&pmc_bufferlist, plb, plb_next); } From owner-svn-src-head@FreeBSD.ORG Sun Nov 9 17:37:54 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A27C9106567F; Sun, 9 Nov 2008 17:37:54 +0000 (UTC) (envelope-from jkoshy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9128B8FC0A; Sun, 9 Nov 2008 17:37:54 +0000 (UTC) (envelope-from jkoshy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA9HbsCI047045; Sun, 9 Nov 2008 17:37:54 GMT (envelope-from jkoshy@svn.freebsd.org) Received: (from jkoshy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA9HbssM047036; Sun, 9 Nov 2008 17:37:54 GMT (envelope-from jkoshy@svn.freebsd.org) Message-Id: <200811091737.mA9HbssM047036@svn.freebsd.org> From: Joseph Koshy Date: Sun, 9 Nov 2008 17:37: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: r184802 - in head/sys: amd64/include conf dev/hwpmc i386/include modules/hwpmc sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Nov 2008 17:37:54 -0000 Author: jkoshy Date: Sun Nov 9 17:37:54 2008 New Revision: 184802 URL: http://svn.freebsd.org/changeset/base/184802 Log: - Separate PMC class dependent code from other kinds of machine dependencies. A 'struct pmc_classdep' structure describes operations on PMCs; 'struct pmc_mdep' contains one or more 'struct pmc_classdep' structures depending on the CPU in question. Inside PMC class dependent code, row indices are relative to the PMCs supported by the PMC class; MI code in "hwpmc_mod.c" translates global row indices before invoking class dependent operations. - Augment the OP_GETCPUINFO request with the number of PMCs present in a PMC class. - Move code common to Intel CPUs to file "hwpmc_intel.c". - Move TSC handling to file "hwpmc_tsc.c". Added: head/sys/dev/hwpmc/hwpmc_intel.c (contents, props changed) head/sys/dev/hwpmc/hwpmc_tsc.c (contents, props changed) head/sys/dev/hwpmc/hwpmc_tsc.h (contents, props changed) Modified: head/sys/amd64/include/pmc_mdep.h head/sys/conf/files.amd64 head/sys/conf/files.i386 head/sys/conf/files.pc98 head/sys/dev/hwpmc/hwpmc_amd.c head/sys/dev/hwpmc/hwpmc_amd.h head/sys/dev/hwpmc/hwpmc_mod.c head/sys/dev/hwpmc/hwpmc_pentium.c head/sys/dev/hwpmc/hwpmc_pentium.h head/sys/dev/hwpmc/hwpmc_piv.c head/sys/dev/hwpmc/hwpmc_piv.h head/sys/dev/hwpmc/hwpmc_ppro.c head/sys/dev/hwpmc/hwpmc_ppro.h head/sys/dev/hwpmc/hwpmc_x86.c head/sys/i386/include/pmc_mdep.h head/sys/modules/hwpmc/Makefile head/sys/sys/pmc.h Modified: head/sys/amd64/include/pmc_mdep.h ============================================================================== --- head/sys/amd64/include/pmc_mdep.h Sun Nov 9 17:07:52 2008 (r184801) +++ head/sys/amd64/include/pmc_mdep.h Sun Nov 9 17:37:54 2008 (r184802) @@ -35,8 +35,34 @@ #ifndef _MACHINE_PMC_MDEP_H #define _MACHINE_PMC_MDEP_H 1 +#ifdef _KERNEL +struct pmc_mdep; +#endif + #include #include +#include + +/* + * Intel processors implementing V2 and later of the Intel performance + * measurement architecture have PMCs of the following classes: TSC, + * IAF and IAP. + */ +#define PMC_MDEP_CLASS_INDEX_TSC 0 +#define PMC_MDEP_CLASS_INDEX_K8 1 +#define PMC_MDEP_CLASS_INDEX_P4 1 +#define PMC_MDEP_CLASS_INDEX_IAF 1 +#define PMC_MDEP_CLASS_INDEX_IAP 2 + +/* + * On the amd64 platform we support the following PMCs. + * + * TSC The timestamp counter + * K8 AMD Athlon64 and Opteron PMCs in 64 bit mode. + * PIV Intel P4/HTT and P4/EMT64 + * IAP Intel Core/Core2/Atom CPUs in 64 bits mode. + * IAF Intel fixed-function PMCs in Core2 and later CPUs. + */ union pmc_md_op_pmcallocate { struct pmc_md_amd_op_pmcallocate pm_amd; @@ -55,8 +81,6 @@ union pmc_md_pmc { struct pmc_md_p4_pmc pm_p4; }; -struct pmc; - #define PMC_TRAPFRAME_TO_PC(TF) ((TF)->tf_rip) #define PMC_TRAPFRAME_TO_FP(TF) ((TF)->tf_rbp) #define PMC_TRAPFRAME_TO_USER_SP(TF) ((TF)->tf_rsp) @@ -88,5 +112,10 @@ struct pmc; void start_exceptions(void), end_exceptions(void); void pmc_x86_lapic_enable_pmc_interrupt(void); -#endif +struct pmc_mdep *pmc_amd_initialize(void); +void pmc_amd_finalize(struct pmc_mdep *_md); +struct pmc_mdep *pmc_intel_initialize(void); +void pmc_intel_finalize(struct pmc_mdep *_md); + +#endif /* _KERNEL */ #endif /* _MACHINE_PMC_MDEP_H */ Modified: head/sys/conf/files.amd64 ============================================================================== --- head/sys/conf/files.amd64 Sun Nov 9 17:07:52 2008 (r184801) +++ head/sys/conf/files.amd64 Sun Nov 9 17:37:54 2008 (r184802) @@ -188,7 +188,9 @@ dev/hptrr/hptrr_os_bsd.c optional hptrr dev/hptrr/hptrr_osm_bsd.c optional hptrr dev/hptrr/hptrr_config.c optional hptrr dev/hwpmc/hwpmc_amd.c optional hwpmc +dev/hwpmc/hwpmc_intel.c optional hwpmc dev/hwpmc/hwpmc_piv.c optional hwpmc +dev/hwpmc/hwpmc_tsc.c optional hwpmc dev/hwpmc/hwpmc_x86.c optional hwpmc dev/k8temp/k8temp.c optional k8temp dev/kbd/kbd.c optional atkbd | sc | ukbd Modified: head/sys/conf/files.i386 ============================================================================== --- head/sys/conf/files.i386 Sun Nov 9 17:07:52 2008 (r184801) +++ head/sys/conf/files.i386 Sun Nov 9 17:37:54 2008 (r184802) @@ -186,9 +186,11 @@ dev/hptrr/hptrr_os_bsd.c optional hptrr dev/hptrr/hptrr_osm_bsd.c optional hptrr dev/hptrr/hptrr_config.c optional hptrr dev/hwpmc/hwpmc_amd.c optional hwpmc +dev/hwpmc/hwpmc_intel.c optional hwpmc dev/hwpmc/hwpmc_pentium.c optional hwpmc dev/hwpmc/hwpmc_piv.c optional hwpmc dev/hwpmc/hwpmc_ppro.c optional hwpmc +dev/hwpmc/hwpmc_tsc.c optional hwpmc dev/hwpmc/hwpmc_x86.c optional hwpmc dev/ichwd/ichwd.c optional ichwd dev/if_ndis/if_ndis.c optional ndis Modified: head/sys/conf/files.pc98 ============================================================================== --- head/sys/conf/files.pc98 Sun Nov 9 17:07:52 2008 (r184801) +++ head/sys/conf/files.pc98 Sun Nov 9 17:37:54 2008 (r184802) @@ -110,9 +110,11 @@ dev/ed/if_ed_wd80x3.c optional ed isa dev/fb/fb.c optional fb | gdc dev/fe/if_fe_cbus.c optional fe isa dev/hwpmc/hwpmc_amd.c optional hwpmc +dev/hwpmc/hwpmc_intel.c optional hwpmc dev/hwpmc/hwpmc_pentium.c optional hwpmc dev/hwpmc/hwpmc_piv.c optional hwpmc dev/hwpmc/hwpmc_ppro.c optional hwpmc +dev/hwpmc/hwpmc_tsc.c optional hwpmc dev/hwpmc/hwpmc_x86.c optional hwpmc dev/io/iodev.c optional io dev/kbd/kbd.c optional pckbd | sc | ukbd Modified: head/sys/dev/hwpmc/hwpmc_amd.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_amd.c Sun Nov 9 17:07:52 2008 (r184801) +++ head/sys/dev/hwpmc/hwpmc_amd.c Sun Nov 9 17:37:54 2008 (r184802) @@ -26,7 +26,6 @@ * 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 @@ -64,18 +63,6 @@ static struct amd_descr amd_pmcdesc[AMD { .pm_descr = { - .pd_name = "TSC", - .pd_class = PMC_CLASS_TSC, - .pd_caps = PMC_CAP_READ, - .pd_width = 64 - }, - .pm_evsel = MSR_TSC, - .pm_perfctr = 0 /* unused */ - }, - - { - .pm_descr = - { .pd_name = "", .pd_class = -1, .pd_caps = AMD_PMC_CAPS, @@ -258,6 +245,16 @@ const int amd_event_codes_size = sizeof(amd_event_codes) / sizeof(amd_event_codes[0]); /* + * Per-processor information + */ + +struct amd_cpu { + struct pmc_hw pc_amdpmcs[AMD_NPMCS]; +}; + +static struct amd_cpu **amd_pcpu; + +/* * read a pmc register */ @@ -267,17 +264,17 @@ amd_read_pmc(int cpu, int ri, pmc_value_ enum pmc_mode mode; const struct amd_descr *pd; struct pmc *pm; - const struct pmc_hw *phw; pmc_value_t tmp; KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), ("[amd,%d] illegal CPU value %d", __LINE__, cpu)); KASSERT(ri >= 0 && ri < AMD_NPMCS, ("[amd,%d] illegal row-index %d", __LINE__, ri)); + KASSERT(amd_pcpu[cpu], + ("[amd,%d] null per-cpu, cpu %d", __LINE__, cpu)); - phw = pmc_pcpu[cpu]->pc_hwpmcs[ri]; - pd = &amd_pmcdesc[ri]; - pm = phw->phw_pmc; + pm = amd_pcpu[cpu]->pc_amdpmcs[ri].phw_pmc; + pd = &amd_pmcdesc[ri]; KASSERT(pm != NULL, ("[amd,%d] No owner for HWPMC [cpu%d,pmc%d]", __LINE__, @@ -287,15 +284,6 @@ amd_read_pmc(int cpu, int ri, pmc_value_ PMCDBG(MDP,REA,1,"amd-read id=%d class=%d", ri, pd->pm_descr.pd_class); - /* Reading the TSC is a special case */ - if (pd->pm_descr.pd_class == PMC_CLASS_TSC) { - KASSERT(PMC_IS_COUNTING_MODE(mode), - ("[amd,%d] TSC counter in non-counting mode", __LINE__)); - *v = rdtsc(); - PMCDBG(MDP,REA,2,"amd-read id=%d -> %jd", ri, *v); - return 0; - } - #ifdef DEBUG KASSERT(pd->pm_descr.pd_class == amd_pmc_class, ("[amd,%d] unknown PMC class (%d)", __LINE__, @@ -324,18 +312,16 @@ static int amd_write_pmc(int cpu, int ri, pmc_value_t v) { const struct amd_descr *pd; - struct pmc *pm; - const struct pmc_hw *phw; enum pmc_mode mode; + struct pmc *pm; KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), ("[amd,%d] illegal CPU value %d", __LINE__, cpu)); KASSERT(ri >= 0 && ri < AMD_NPMCS, ("[amd,%d] illegal row-index %d", __LINE__, ri)); - phw = pmc_pcpu[cpu]->pc_hwpmcs[ri]; - pd = &amd_pmcdesc[ri]; - pm = phw->phw_pmc; + pm = amd_pcpu[cpu]->pc_amdpmcs[ri].phw_pmc; + pd = &amd_pmcdesc[ri]; KASSERT(pm != NULL, ("[amd,%d] PMC not owned (cpu%d,pmc%d)", __LINE__, @@ -343,9 +329,6 @@ amd_write_pmc(int cpu, int ri, pmc_value mode = PMC_TO_MODE(pm); - if (pd->pm_descr.pd_class == PMC_CLASS_TSC) - return 0; - #ifdef DEBUG KASSERT(pd->pm_descr.pd_class == amd_pmc_class, ("[amd,%d] unknown PMC class (%d)", __LINE__, @@ -380,7 +363,7 @@ amd_config_pmc(int cpu, int ri, struct p KASSERT(ri >= 0 && ri < AMD_NPMCS, ("[amd,%d] illegal row-index %d", __LINE__, ri)); - phw = pmc_pcpu[cpu]->pc_hwpmcs[ri]; + phw = &amd_pcpu[cpu]->pc_amdpmcs[ri]; KASSERT(pm == NULL || phw->phw_pmc == NULL, ("[amd,%d] pm=%p phw->pm=%p hwpmc not unconfigured", @@ -397,7 +380,7 @@ amd_config_pmc(int cpu, int ri, struct p static int amd_get_config(int cpu, int ri, struct pmc **ppm) { - *ppm = pmc_pcpu[cpu]->pc_hwpmcs[ri]->phw_pmc; + *ppm = amd_pcpu[cpu]->pc_amdpmcs[ri].phw_pmc; return 0; } @@ -474,18 +457,6 @@ amd_allocate_pmc(int cpu, int ri, struct if ((pd->pd_caps & caps) != caps) return EPERM; - if (pd->pd_class == PMC_CLASS_TSC) { - /* TSC's are always allocated in system-wide counting mode */ - if (a->pm_ev != PMC_EV_TSC_TSC || - a->pm_mode != PMC_MODE_SC) - return EINVAL; - return 0; - } - -#ifdef DEBUG - KASSERT(pd->pd_class == amd_pmc_class, - ("[amd,%d] Unknown PMC class (%d)", __LINE__, pd->pd_class)); -#endif pe = a->pm_ev; @@ -556,7 +527,7 @@ amd_release_pmc(int cpu, int ri, struct KASSERT(ri >= 0 && ri < AMD_NPMCS, ("[amd,%d] illegal row-index %d", __LINE__, ri)); - phw = pmc_pcpu[cpu]->pc_hwpmcs[ri]; + phw = &amd_pcpu[cpu]->pc_amdpmcs[ri]; KASSERT(phw->phw_pmc == NULL, ("[amd,%d] PHW pmc %p non-NULL", __LINE__, phw->phw_pmc)); @@ -588,7 +559,7 @@ amd_start_pmc(int cpu, int ri) KASSERT(ri >= 0 && ri < AMD_NPMCS, ("[amd,%d] illegal row-index %d", __LINE__, ri)); - phw = pmc_pcpu[cpu]->pc_hwpmcs[ri]; + phw = &amd_pcpu[cpu]->pc_amdpmcs[ri]; pm = phw->phw_pmc; pd = &amd_pmcdesc[ri]; @@ -598,15 +569,6 @@ amd_start_pmc(int cpu, int ri) PMCDBG(MDP,STA,1,"amd-start cpu=%d ri=%d", cpu, ri); - if (pd->pm_descr.pd_class == PMC_CLASS_TSC) - return 0; /* TSCs are always running */ - -#ifdef DEBUG - KASSERT(pd->pm_descr.pd_class == amd_pmc_class, - ("[amd,%d] unknown PMC class (%d)", __LINE__, - pd->pm_descr.pd_class)); -#endif - KASSERT(AMD_PMC_IS_STOPPED(pd->pm_evsel), ("[amd,%d] pmc%d,cpu%d: Starting active PMC \"%s\"", __LINE__, ri, cpu, pd->pm_descr.pd_name)); @@ -637,24 +599,13 @@ amd_stop_pmc(int cpu, int ri) KASSERT(ri >= 0 && ri < AMD_NPMCS, ("[amd,%d] illegal row-index %d", __LINE__, ri)); - phw = pmc_pcpu[cpu]->pc_hwpmcs[ri]; + phw = &amd_pcpu[cpu]->pc_amdpmcs[ri]; pm = phw->phw_pmc; pd = &amd_pmcdesc[ri]; KASSERT(pm != NULL, ("[amd,%d] cpu%d,pmc%d no PMC to stop", __LINE__, cpu, ri)); - - /* can't stop a TSC */ - if (pd->pm_descr.pd_class == PMC_CLASS_TSC) - return 0; - -#ifdef DEBUG - KASSERT(pd->pm_descr.pd_class == amd_pmc_class, - ("[amd,%d] unknown PMC class (%d)", __LINE__, - pd->pm_descr.pd_class)); -#endif - KASSERT(!AMD_PMC_IS_STOPPED(pd->pm_evsel), ("[amd,%d] PMC%d, CPU%d \"%s\" already stopped", __LINE__, ri, cpu, pd->pm_descr.pd_name)); @@ -677,10 +628,10 @@ amd_stop_pmc(int cpu, int ri) static int amd_intr(int cpu, struct trapframe *tf) { - int i, error, retval, ri; + int i, error, retval; uint32_t config, evsel, perfctr; struct pmc *pm; - struct pmc_cpu *pc; + struct amd_cpu *pac; struct pmc_hw *phw; pmc_value_t v; @@ -692,11 +643,10 @@ amd_intr(int cpu, struct trapframe *tf) retval = 0; - pc = pmc_pcpu[cpu]; + pac = amd_pcpu[cpu]; /* * look for all PMCs that have interrupted: - * - skip over the TSC [PMC#0] * - look for a running, sampling PMC which has overflowed * and which has a valid 'struct pmc' association * @@ -708,14 +658,12 @@ amd_intr(int cpu, struct trapframe *tf) * interrupt at a time. */ - for (i = 0; retval == 0 && i < AMD_NPMCS-1; i++) { - - ri = i + 1; /* row index; TSC is at ri == 0 */ + for (i = 0; retval == 0 && i < AMD_NPMCS; i++) { if (!AMD_PMC_HAS_OVERFLOWED(i)) continue; - phw = pc->pc_hwpmcs[ri]; + phw = &pac->pc_amdpmcs[i]; KASSERT(phw != NULL, ("[amd,%d] null PHW pointer", __LINE__)); @@ -769,7 +717,7 @@ amd_describe(int cpu, int ri, struct pmc KASSERT(ri >= 0 && ri < AMD_NPMCS, ("[amd,%d] row-index %d out of range", __LINE__, ri)); - phw = pmc_pcpu[cpu]->pc_hwpmcs[ri]; + phw = &amd_pcpu[cpu]->pc_amdpmcs[ri]; pd = &amd_pmcdesc[ri]; if ((error = copystr(pd->pm_descr.pd_name, pi->pm_name, @@ -804,33 +752,20 @@ amd_get_msr(int ri, uint32_t *msr) ("[amd,%d] ri %d out of range", __LINE__, ri)); *msr = amd_pmcdesc[ri].pm_perfctr - AMD_PMC_PERFCTR_0; - return 0; + + return (0); } /* * processor dependent initialization. */ -/* - * Per-processor data structure - * - * [common stuff] - * [5 struct pmc_hw pointers] - * [5 struct pmc_hw structures] - */ - -struct amd_cpu { - struct pmc_cpu pc_common; - struct pmc_hw *pc_hwpmcs[AMD_NPMCS]; - struct pmc_hw pc_amdpmcs[AMD_NPMCS]; -}; - - static int -amd_init(int cpu) +amd_pcpu_init(struct pmc_mdep *md, int cpu) { - int n; - struct amd_cpu *pcs; + int classindex, first_ri, n; + struct pmc_cpu *pc; + struct amd_cpu *pac; struct pmc_hw *phw; KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), @@ -838,29 +773,32 @@ amd_init(int cpu) PMCDBG(MDP,INI,1,"amd-init cpu=%d", cpu); - pcs = malloc(sizeof(struct amd_cpu), M_PMC, + amd_pcpu[cpu] = pac = malloc(sizeof(struct amd_cpu), M_PMC, M_WAITOK|M_ZERO); - phw = &pcs->pc_amdpmcs[0]; - /* - * Initialize the per-cpu mutex and set the content of the - * hardware descriptors to a known state. + * Set the content of the hardware descriptors to a known + * state and initialize pointers in the MI per-cpu descriptor. */ + pc = pmc_pcpu[cpu]; +#if defined(__amd64__) + classindex = PMC_MDEP_CLASS_INDEX_K8; +#elif defined(__i386__) + classindex = md->pmd_cputype == PMC_CPU_AMD_K8 ? + PMC_MDEP_CLASS_INDEX_K8 : PMC_MDEP_CLASS_INDEX_K7; +#endif + first_ri = md->pmd_classdep[classindex].pcd_ri; - for (n = 0; n < AMD_NPMCS; n++, phw++) { + KASSERT(pc != NULL, ("[amd,%d] NULL per-cpu pointer", __LINE__)); + + for (n = 0, phw = pac->pc_amdpmcs; n < AMD_NPMCS; n++, phw++) { phw->phw_state = PMC_PHW_FLAG_IS_ENABLED | PMC_PHW_CPU_TO_STATE(cpu) | PMC_PHW_INDEX_TO_STATE(n); phw->phw_pmc = NULL; - pcs->pc_hwpmcs[n] = phw; + pc->pc_hwpmcs[n + first_ri] = phw; } - /* Mark the TSC as shareable */ - pcs->pc_hwpmcs[0]->phw_state |= PMC_PHW_FLAG_IS_SHAREABLE; - - pmc_pcpu[cpu] = (struct pmc_cpu *) pcs; - - return 0; + return (0); } @@ -870,11 +808,12 @@ amd_init(int cpu) */ static int -amd_cleanup(int cpu) +amd_pcpu_fini(struct pmc_mdep *md, int cpu) { - int i; + int classindex, first_ri, i; uint32_t evsel; - struct pmc_cpu *pcs; + struct pmc_cpu *pc; + struct amd_cpu *pac; KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), ("[amd,%d] insane cpu number (%d)", __LINE__, cpu)); @@ -884,7 +823,6 @@ amd_cleanup(int cpu) /* * First, turn off all PMCs on this CPU. */ - for (i = 0; i < 4; i++) { /* XXX this loop is now not needed */ evsel = rdmsr(AMD_PMC_EVSEL_0 + i); evsel &= ~AMD_PMC_ENABLE; @@ -894,25 +832,42 @@ amd_cleanup(int cpu) /* * Next, free up allocated space. */ + if ((pac = amd_pcpu[cpu]) == NULL) + return (0); - if ((pcs = pmc_pcpu[cpu]) == NULL) - return 0; + amd_pcpu[cpu] = NULL; #ifdef DEBUG - /* check the TSC */ - KASSERT(pcs->pc_hwpmcs[0]->phw_pmc == NULL, - ("[amd,%d] CPU%d,PMC0 still in use", __LINE__, cpu)); - for (i = 1; i < AMD_NPMCS; i++) { - KASSERT(pcs->pc_hwpmcs[i]->phw_pmc == NULL, + for (i = 0; i < AMD_NPMCS; i++) { + KASSERT(pac->pc_amdpmcs[i].phw_pmc == NULL, ("[amd,%d] CPU%d/PMC%d in use", __LINE__, cpu, i)); KASSERT(AMD_PMC_IS_STOPPED(AMD_PMC_EVSEL_0 + (i-1)), ("[amd,%d] CPU%d/PMC%d not stopped", __LINE__, cpu, i)); } #endif - pmc_pcpu[cpu] = NULL; - free(pcs, M_PMC); - return 0; + pc = pmc_pcpu[cpu]; + KASSERT(pc != NULL, ("[amd,%d] NULL per-cpu state", __LINE__)); + +#if defined(__amd64__) + classindex = PMC_MDEP_CLASS_INDEX_K8; +#elif defined(__i386__) + classindex = md->pmd_cputype == PMC_CPU_AMD_K8 ? PMC_MDEP_CLASS_INDEX_K8 : + PMC_MDEP_CLASS_INDEX_K7; +#endif + first_ri = md->pmd_classdep[classindex].pcd_ri; + + /* + * Reset pointers in the MI 'per-cpu' state. + */ + for (i = 0; i < AMD_NPMCS; i++) { + pc->pc_hwpmcs[i + first_ri] = NULL; + } + + + free(pac, M_PMC); + + return (0); } /* @@ -922,11 +877,12 @@ amd_cleanup(int cpu) struct pmc_mdep * pmc_amd_initialize(void) { + int classindex, error, i, nclasses, ncpus; + struct pmc_classdep *pcd; enum pmc_cputype cputype; - enum pmc_class class; struct pmc_mdep *pmc_mdep; + enum pmc_class class; char *name; - int i; /* * The presence of hardware performance counters on the AMD @@ -939,12 +895,16 @@ pmc_amd_initialize(void) class = cputype = -1; name = NULL; switch (cpu_id & 0xF00) { +#if defined(__i386__) case 0x600: /* Athlon(tm) processor */ + classindex = PMC_MDEP_CLASS_INDEX_K7; cputype = PMC_CPU_AMD_K7; class = PMC_CLASS_K7; name = "K7"; break; +#endif case 0xF00: /* Athlon64/Opteron processor */ + classindex = PMC_MDEP_CLASS_INDEX_K8; cputype = PMC_CPU_AMD_K8; class = PMC_CLASS_K8; name = "K8"; @@ -960,53 +920,121 @@ pmc_amd_initialize(void) amd_pmc_class = class; #endif - pmc_mdep = malloc(sizeof(struct pmc_mdep), - M_PMC, M_WAITOK|M_ZERO); + /* + * Allocate space for pointers to PMC HW descriptors and for + * the MDEP structure used by MI code. + */ + amd_pcpu = malloc(sizeof(struct amd_cpu *) * pmc_cpu_max(), M_PMC, + M_WAITOK|M_ZERO); - pmc_mdep->pmd_cputype = cputype; - pmc_mdep->pmd_npmc = AMD_NPMCS; + /* + * These processors have two classes of PMCs: the TSC and + * programmable PMCs. + */ + nclasses = 2; + pmc_mdep = malloc(sizeof(struct pmc_mdep) + nclasses * sizeof (struct pmc_classdep), + M_PMC, M_WAITOK|M_ZERO); - /* this processor has two classes of usable PMCs */ - pmc_mdep->pmd_nclass = 2; + pmc_mdep->pmd_cputype = cputype; + pmc_mdep->pmd_nclass = nclasses; - /* TSC */ - pmc_mdep->pmd_classes[0].pm_class = PMC_CLASS_TSC; - pmc_mdep->pmd_classes[0].pm_caps = PMC_CAP_READ; - pmc_mdep->pmd_classes[0].pm_width = 64; - - /* AMD K7/K8 PMCs */ - pmc_mdep->pmd_classes[1].pm_class = class; - pmc_mdep->pmd_classes[1].pm_caps = AMD_PMC_CAPS; - pmc_mdep->pmd_classes[1].pm_width = 48; + ncpus = pmc_cpu_max(); - pmc_mdep->pmd_nclasspmcs[0] = 1; - pmc_mdep->pmd_nclasspmcs[1] = (AMD_NPMCS-1); + /* Initialize the TSC. */ + error = pmc_tsc_initialize(pmc_mdep, ncpus); + if (error) + goto error; + + /* Initialize AMD K7 and K8 PMC handling. */ + pcd = &pmc_mdep->pmd_classdep[classindex]; + + pcd->pcd_caps = AMD_PMC_CAPS; + pcd->pcd_class = class; + pcd->pcd_num = AMD_NPMCS; + pcd->pcd_ri = pmc_mdep->pmd_npmc; + pcd->pcd_width = 48; /* fill in the correct pmc name and class */ - for (i = 1; i < AMD_NPMCS; i++) { + for (i = 0; i < AMD_NPMCS; i++) { (void) snprintf(amd_pmcdesc[i].pm_descr.pd_name, sizeof(amd_pmcdesc[i].pm_descr.pd_name), "%s-%d", name, i-1); amd_pmcdesc[i].pm_descr.pd_class = class; } - pmc_mdep->pmd_init = amd_init; - pmc_mdep->pmd_cleanup = amd_cleanup; - pmc_mdep->pmd_switch_in = amd_switch_in; - pmc_mdep->pmd_switch_out = amd_switch_out; - pmc_mdep->pmd_read_pmc = amd_read_pmc; - pmc_mdep->pmd_write_pmc = amd_write_pmc; - pmc_mdep->pmd_config_pmc = amd_config_pmc; - pmc_mdep->pmd_get_config = amd_get_config; - pmc_mdep->pmd_allocate_pmc = amd_allocate_pmc; - pmc_mdep->pmd_release_pmc = amd_release_pmc; - pmc_mdep->pmd_start_pmc = amd_start_pmc; - pmc_mdep->pmd_stop_pmc = amd_stop_pmc; - pmc_mdep->pmd_intr = amd_intr; - pmc_mdep->pmd_describe = amd_describe; - pmc_mdep->pmd_get_msr = amd_get_msr; /* i386 */ + pcd->pcd_allocate_pmc = amd_allocate_pmc; + pcd->pcd_config_pmc = amd_config_pmc; + pcd->pcd_describe = amd_describe; + pcd->pcd_get_config = amd_get_config; + pcd->pcd_get_msr = amd_get_msr; + pcd->pcd_pcpu_fini = amd_pcpu_fini; + pcd->pcd_pcpu_init = amd_pcpu_init; + pcd->pcd_read_pmc = amd_read_pmc; + pcd->pcd_release_pmc = amd_release_pmc; + pcd->pcd_start_pmc = amd_start_pmc; + pcd->pcd_stop_pmc = amd_stop_pmc; + pcd->pcd_write_pmc = amd_write_pmc; + + pmc_mdep->pmd_pcpu_init = NULL; + pmc_mdep->pmd_pcpu_fini = NULL; + pmc_mdep->pmd_intr = amd_intr; + pmc_mdep->pmd_switch_in = amd_switch_in; + pmc_mdep->pmd_switch_out = amd_switch_out; + + pmc_mdep->pmd_npmc += AMD_NPMCS; PMCDBG(MDP,INI,0,"%s","amd-initialize"); - return pmc_mdep; + return (pmc_mdep); + + error: + if (error) { + free(pmc_mdep, M_PMC); + pmc_mdep = NULL; + } + + return (NULL); +} + +/* + * Finalization code for AMD CPUs. + */ + +void +pmc_amd_finalize(struct pmc_mdep *md) +{ +#if defined(INVARIANTS) + int classindex, i, ncpus, pmcclass; +#endif + + pmc_tsc_finalize(md); + + KASSERT(amd_pcpu != NULL, ("[amd,%d] NULL per-cpu array pointer", + __LINE__)); + +#if defined(INVARIANTS) + switch (md->pmd_cputype) { +#if defined(__i386__) + case PMC_CPU_AMD_K7: + classindex = PMC_MDEP_CLASS_INDEX_K7; + pmcclass = PMC_CLASS_K7; + break; +#endif + default: + classindex = PMC_MDEP_CLASS_INDEX_K8; + pmcclass = PMC_CLASS_K8; + } + + KASSERT(md->pmd_classdep[classindex].pcd_class == pmcclass, + ("[amd,%d] pmc class mismatch", __LINE__)); + + ncpus = pmc_cpu_max(); + + for (i = 0; i < ncpus; i++) + KASSERT(amd_pcpu[i] == NULL, ("[amd,%d] non-null pcpu", + __LINE__)); +#endif + + free(amd_pcpu, M_PMC); + amd_pcpu = NULL; } Modified: head/sys/dev/hwpmc/hwpmc_amd.h ============================================================================== --- head/sys/dev/hwpmc/hwpmc_amd.h Sun Nov 9 17:07:52 2008 (r184801) +++ head/sys/dev/hwpmc/hwpmc_amd.h Sun Nov 9 17:37:54 2008 (r184802) @@ -44,7 +44,7 @@ #define AMD_PMC_PERFCTR_3 0xC0010007 -#define AMD_NPMCS 5 /* 1 TSC + 4 PMCs */ +#define AMD_NPMCS 4 #define AMD_PMC_COUNTERMASK 0xFF000000 #define AMD_PMC_TO_COUNTER(x) (((x) << 24) & AMD_PMC_COUNTERMASK) @@ -93,11 +93,5 @@ struct pmc_md_amd_pmc { uint32_t pm_amd_evsel; }; -/* - * Prototypes - */ - -struct pmc_mdep *pmc_amd_initialize(void); /* AMD K7/K8 PMCs */ - #endif /* _KERNEL */ #endif /* _DEV_HWPMC_AMD_H_ */ Added: head/sys/dev/hwpmc/hwpmc_intel.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/hwpmc/hwpmc_intel.c Sun Nov 9 17:37:54 2008 (r184802) @@ -0,0 +1,227 @@ +/*- + * Copyright (c) 2008 Joseph Koshy + * 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. + */ + +/* + * Common code for handling Intel CPUs. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include + +#include +#include +#include + +static int +intel_switch_in(struct pmc_cpu *pc, struct pmc_process *pp) +{ + (void) pc; + + PMCDBG(MDP,SWI,1, "pc=%p pp=%p enable-msr=%d", pc, pp, + pp->pp_flags & PMC_PP_ENABLE_MSR_ACCESS); + + /* allow the RDPMC instruction if needed */ + if (pp->pp_flags & PMC_PP_ENABLE_MSR_ACCESS) + load_cr4(rcr4() | CR4_PCE); + + PMCDBG(MDP,SWI,1, "cr4=0x%jx", (uintmax_t) rcr4()); + + return 0; +} + +static int +intel_switch_out(struct pmc_cpu *pc, struct pmc_process *pp) +{ + (void) pc; + (void) pp; /* can be NULL */ + + PMCDBG(MDP,SWO,1, "pc=%p pp=%p cr4=0x%jx", pc, pp, + (uintmax_t) rcr4()); + + /* always turn off the RDPMC instruction */ + load_cr4(rcr4() & ~CR4_PCE); + + return 0; +} + +struct pmc_mdep * +pmc_intel_initialize(void) +{ + struct pmc_mdep *pmc_mdep; + enum pmc_cputype cputype; + int error, model, nclasses, ncpus; + + KASSERT(strcmp(cpu_vendor, "GenuineIntel") == 0, + ("[intel,%d] Initializing non-intel processor", __LINE__)); + + PMCDBG(MDP,INI,0, "intel-initialize cpuid=0x%x", cpu_id); + + cputype = -1; + nclasses = 2; + + switch (cpu_id & 0xF00) { +#if defined(__i386__) + case 0x500: /* Pentium family processors */ + cputype = PMC_CPU_INTEL_P5; + break; + case 0x600: /* Pentium Pro, Celeron, Pentium II & III */ + switch ((cpu_id & 0xF0) >> 4) { /* model number field */ + case 0x1: + cputype = PMC_CPU_INTEL_P6; + break; + case 0x3: case 0x5: + cputype = PMC_CPU_INTEL_PII; + break; + case 0x6: + cputype = PMC_CPU_INTEL_CL; + break; + case 0x7: case 0x8: case 0xA: case 0xB: + cputype = PMC_CPU_INTEL_PIII; + break; + case 0x9: case 0xD: + cputype = PMC_CPU_INTEL_PM; + break; + } + break; +#endif +#if defined(__i386__) || defined(__amd64__) + case 0xF00: /* P4 */ + model = ((cpu_id & 0xF0000) >> 12) | ((cpu_id & 0xF0) >> 4); + if (model >= 0 && model <= 6) /* known models */ + cputype = PMC_CPU_INTEL_PIV; + break; + } +#endif + + if ((int) cputype == -1) { + printf("pmc: Unknown Intel CPU.\n"); + return (NULL); + } + + pmc_mdep = malloc(sizeof(struct pmc_mdep) + nclasses * + sizeof(struct pmc_classdep), M_PMC, M_WAITOK|M_ZERO); + + pmc_mdep->pmd_cputype = cputype; + pmc_mdep->pmd_nclass = nclasses; + + pmc_mdep->pmd_switch_in = intel_switch_in; + pmc_mdep->pmd_switch_out = intel_switch_out; + + ncpus = pmc_cpu_max(); + + error = pmc_tsc_initialize(pmc_mdep, ncpus); + if (error) + goto error; + + switch (cputype) { +#if defined(__i386__) || defined(__amd64__) + + /* + * Intel Pentium 4 Processors, and P4/EMT64 processors. + */ + + case PMC_CPU_INTEL_PIV: + error = pmc_p4_initialize(pmc_mdep, ncpus); + + KASSERT(md->pmd_npmc == TSC_NPMCS + P4_NPMCS, ("[intel,%d] " + "incorrect npmc count %d", __LINE__, md->pmd_npmc)); + break; +#endif + +#if defined(__i386__) + /* + * P6 Family Processors + */ + + case PMC_CPU_INTEL_P6: + case PMC_CPU_INTEL_CL: + case PMC_CPU_INTEL_PII: + case PMC_CPU_INTEL_PIII: + case PMC_CPU_INTEL_PM: + error = pmc_p6_initialize(pmc_mdep, ncpus); + + KASSERT(md->pmd_npmc == TSC_NPMCS + P6_NPMCS, ("[intel,%d] " + "incorrect npmc count %d", __LINE__, md->pmd_npmc)); + break; + + /* + * Intel Pentium PMCs. + */ + + case PMC_CPU_INTEL_P5: + error = pmc_p5_initialize(pmc_mdep, ncpus); + + KASSERT(md->pmd_npmc == TSC_NPMCS + PENTIUM_NPMCS, ("[intel,%d] " + "incorrect npmc count %d", __LINE__, md->pmd_npmc)); + break; +#endif + + default: + KASSERT(0, ("[intel,%d] Unknown CPU type", __LINE__)); + } + + + error: + if (error) { + free(pmc_mdep, M_PMC); + pmc_mdep = NULL; + } + + return (pmc_mdep); +} + +void +pmc_intel_finalize(struct pmc_mdep *md) +{ + pmc_tsc_finalize(md); + + switch (md->pmd_cputype) { +#if defined(__i386__) || defined(__amd64__) + case PMC_CPU_INTEL_PIV: + pmc_p4_finalize(md); + break; +#endif +#if defined(__i386__) + case PMC_CPU_INTEL_P6: + case PMC_CPU_INTEL_CL: + case PMC_CPU_INTEL_PII: + case PMC_CPU_INTEL_PIII: + case PMC_CPU_INTEL_PM: + pmc_p6_finalize(md); + break; + case PMC_CPU_INTEL_P5: + pmc_p5_finalize(md); + break; +#endif + default: + KASSERT(0, ("[intel,%d] unknown CPU type", __LINE__)); + } +} Modified: head/sys/dev/hwpmc/hwpmc_mod.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_mod.c Sun Nov 9 17:07:52 2008 (r184801) +++ head/sys/dev/hwpmc/hwpmc_mod.c Sun Nov 9 17:37:54 2008 (r184802) @@ -154,6 +154,11 @@ static LIST_HEAD(, pmc_owner) pmc_ss_o /* + * A map of row indices to classdep structures. + */ +static struct pmc_classdep **pmc_rowindex_to_classdep; + +/* * Prototypes */ @@ -463,7 +468,7 @@ pmc_debugflags_sysctl_handler(SYSCTL_HAN (void) arg1; (void) arg2; /* unused parameters */ n = sizeof(pmc_debugstr); - newstr = malloc(n, M_PMC, M_ZERO|M_WAITOK); + newstr = malloc(n, M_PMC, M_WAITOK|M_ZERO); (void) strlcpy(newstr, pmc_debugstr, n); error = sysctl_handle_string(oidp, newstr, n, req); @@ -483,6 +488,33 @@ pmc_debugflags_sysctl_handler(SYSCTL_HAN #endif /* + * Map a row index to a classdep structure and return the adjusted row + * index for the PMC class index. + */ +static struct pmc_classdep * +pmc_ri_to_classdep(struct pmc_mdep *md, int ri, int *adjri) +{ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Sun Nov 9 20:17:22 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1033) id CFA511065674; Sun, 9 Nov 2008 20:17:22 +0000 (UTC) Date: Sun, 9 Nov 2008 20:17:22 +0000 From: Alexey Dokuchaev To: Joseph Koshy Message-ID: <20081109201722.GA15911@FreeBSD.org> References: <200811091707.mA9H7rVL046478@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <200811091707.mA9H7rVL046478@svn.freebsd.org> User-Agent: Mutt/1.4.2.1i Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r184801 - head/sys/dev/hwpmc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Nov 2008 20:17:22 -0000 On Sun, Nov 09, 2008 at 05:07:53PM +0000, Joseph Koshy wrote: > Author: jkoshy > Date: Sun Nov 9 17:07:52 2008 > New Revision: 184801 > URL: http://svn.freebsd.org/changeset/base/184801 > > Log: > Style tweak. > > Modified: > head/sys/dev/hwpmc/hwpmc_logging.c > > /* create global pool of log buffers */ > for (n = 0; n < pmc_nlogbuffers; n++) { > - plb = malloc(1024 * pmclog_buffer_size, > - M_PMC, M_ZERO|M_WAITOK); > + plb = malloc(1024 * pmclog_buffer_size, M_PMC, > + M_WAITOK|M_ZERO); Style also suggests spaces around `|' (as does readability). ./danfe From owner-svn-src-head@FreeBSD.ORG Sun Nov 9 23:44:32 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 883841065680; Sun, 9 Nov 2008 23:44:32 +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 7F54D8FC08; Sun, 9 Nov 2008 23:44:32 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA9NiWeJ053451; Sun, 9 Nov 2008 23:44:32 GMT (envelope-from sobomax@svn.freebsd.org) Received: (from sobomax@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA9NiW6g053450; Sun, 9 Nov 2008 23:44:32 GMT (envelope-from sobomax@svn.freebsd.org) Message-Id: <200811092344.mA9NiW6g053450@svn.freebsd.org> From: Maxim Sobolev Date: Sun, 9 Nov 2008 23:44: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: r184804 - head/usr.sbin/mergemaster X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Nov 2008 23:44:32 -0000 Author: sobomax Date: Sun Nov 9 23:44:32 2008 New Revision: 184804 URL: http://svn.freebsd.org/changeset/base/184804 Log: Improve on 184781 - instead of ignoring the file when the only difference is CVS Id, replace the old one with the new one automatically. While I don't see much difference, some people think it's somehow better that way. Modified: head/usr.sbin/mergemaster/mergemaster.sh Modified: head/usr.sbin/mergemaster/mergemaster.sh ============================================================================== --- head/usr.sbin/mergemaster/mergemaster.sh Sun Nov 9 20:36:13 2008 (r184803) +++ head/usr.sbin/mergemaster/mergemaster.sh Sun Nov 9 23:44:32 2008 (r184804) @@ -956,8 +956,14 @@ for COMPFILE in `find . -type f -size +0 sed "s/[$]${CVS_ID_TAG}:.*[$]//g" "${COMPFILE}" > "${TMPFILE2}" if diff -q ${DIFF_OPTIONS} "${TMPFILE1}" "${TMPFILE2}" > \ /dev/null 2>&1; then - echo " *** Temp ${COMPFILE} and installed are the same except CVS Id, deleting" - rm "${COMPFILE}" + echo " *** Temp ${COMPFILE} and installed are the same except CVS Id, replacing" + if mm_install "${COMPFILE}"; then + echo " *** ${COMPFILE} upgraded successfully" + echo '' + rm "${COMPFILE}" + else + echo " *** Problem upgrading ${COMPFILE}, it will remain to merge by hand" + fi fi rm -f "${TMPFILE1}" "${TMPFILE2}" ;; From owner-svn-src-head@FreeBSD.ORG Mon Nov 10 05:04:56 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6966D106567C; Mon, 10 Nov 2008 05:04:56 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5A39E8FC0A; Mon, 10 Nov 2008 05:04:56 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mAA54uot059389; Mon, 10 Nov 2008 05:04:56 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mAA54ts7059386; Mon, 10 Nov 2008 05:04:55 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <200811100504.mAA54ts7059386@svn.freebsd.org> From: Tim Kientzle Date: Mon, 10 Nov 2008 05:04: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: r184807 - in head/usr.bin/tar: . test X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Nov 2008 05:04:56 -0000 Author: kientzle Date: Mon Nov 10 05:04:55 2008 New Revision: 184807 URL: http://svn.freebsd.org/changeset/base/184807 Log: Test --strip-components and fix it to actually work. Jaakko did a good job writing this test; it exercises a lot of subtle cases. The trickiest one is that a hardlink to something that didn't get extracted should not itself be extracted. In some sense, this is not the desired behavior (we'd rather restore the file), but it's the best you can do in a single-pass restore of a tar archive. The test here should be extended to exercise cpio and newc formats as well, since their hardlink models are different, which will lead to different handling of some of these edge cases. Submitted by: Jaakko Heinonen MFC after: 30 days Added: head/usr.bin/tar/test/test_strip_components.c (contents, props changed) Modified: head/usr.bin/tar/test/Makefile head/usr.bin/tar/util.c Modified: head/usr.bin/tar/test/Makefile ============================================================================== --- head/usr.bin/tar/test/Makefile Mon Nov 10 01:42:46 2008 (r184806) +++ head/usr.bin/tar/test/Makefile Mon Nov 10 05:04:55 2008 (r184807) @@ -18,6 +18,7 @@ TESTS= \ test_option_q.c \ test_patterns.c \ test_stdio.c \ + test_strip_components.c \ test_symlink_dir.c \ test_version.c Added: head/usr.bin/tar/test/test_strip_components.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/tar/test/test_strip_components.c Mon Nov 10 05:04:55 2008 (r184807) @@ -0,0 +1,77 @@ +/*- + * Copyright (c) 2003-2007 Tim Kientzle + * 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(S) ``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(S) 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 "test.h" +__FBSDID("$FreeBSD$"); + +static int +touch(const char *fn) +{ + int fd = open(fn, O_RDWR | O_CREAT | 0644); + failure("Couldn't create file '%s', fd=%d, errno=%d (%s)\n", + fn, fd, errno, strerror(errno)); + if (!assert(fd > 0)) + return (0); /* Failure. */ + close(fd); + return (1); /* Success */ +} + +DEFINE_TEST(test_strip_components) +{ + struct stat st; + + assertEqualInt(0, mkdir("d0", 0755)); + assertEqualInt(0, chdir("d0")); + assertEqualInt(0, mkdir("d1", 0755)); + assertEqualInt(0, mkdir("d1/d2", 0755)); + assertEqualInt(0, mkdir("d1/d2/d3", 0755)); + assertEqualInt(1, touch("d1/d2/f1")); + assertEqualInt(0, link("d1/d2/f1", "l1")); + assertEqualInt(0, link("d1/d2/f1", "d1/l2")); + assertEqualInt(0, symlink("d1/d2/f1", "s1")); + assertEqualInt(0, symlink("d2/f1", "d1/s2")); + assertEqualInt(0, chdir("..")); + + assertEqualInt(0, systemf("%s -cf test.tar d0", testprog)); + + assertEqualInt(0, mkdir("target", 0755)); + assertEqualInt(0, systemf("%s -x -C target --strip-components 2 " + "-f test.tar", testprog)); + + failure("d0/ is too short and should not get restored"); + assertEqualInt(-1, lstat("target/d0", &st)); + failure("d0/d1/ is too short and should not get restored"); + assertEqualInt(-1, lstat("target/d1", &st)); + failure("d0/l1 is too short and should not get restored"); + assertEqualInt(-1, lstat("target/l1", &st)); + failure("d0/d1/l2 is a hardlink to file whose name was too short"); + assertEqualInt(-1, lstat("target/l2", &st)); + assertEqualInt(0, lstat("target/s2", &st)); + failure("d0/d1/s2 is a symlink to something that won't be extracted"); + assertEqualInt(-1, stat("target/s2", &st)); + failure("d0/d1/d2 should be extracted"); + assertEqualInt(0, lstat("target/d2", &st)); + failure("d0/d1/d2/f1 is a hardlink to file whose name was too short"); + assertEqualInt(-1, lstat("target/d2/f1", &st)); +} Modified: head/usr.bin/tar/util.c ============================================================================== --- head/usr.bin/tar/util.c Mon Nov 10 01:42:46 2008 (r184806) +++ head/usr.bin/tar/util.c Mon Nov 10 05:04:55 2008 (r184807) @@ -51,6 +51,7 @@ __FBSDID("$FreeBSD$"); static void bsdtar_vwarnc(struct bsdtar *, int code, const char *fmt, va_list ap); +static const char *strip_components(const char *path, int elements); /* * Print a string, taking care with any non-printable characters. @@ -346,6 +347,31 @@ do_chdir(struct bsdtar *bsdtar) bsdtar->pending_chdir = NULL; } +const char * +strip_components(const char *path, int elements) +{ + const char *p = path; + + while (elements > 0) { + switch (*p++) { + case '/': + elements--; + path = p; + break; + case '\0': + /* Path is too short, skip it. */ + return (NULL); + } + } + + while (*path == '/') + ++path; + if (*path == '\0') + return (NULL); + + return (path); +} + /* * Handle --strip-components and any future path-rewriting options. * Returns non-zero if the pathname should not be extracted. @@ -402,24 +428,20 @@ edit_pathname(struct bsdtar *bsdtar, str #endif /* Strip leading dir names as per --strip-components option. */ - if ((r = bsdtar->strip_components) > 0) { - const char *p = name; + if (bsdtar->strip_components > 0) { + const char *linkname = archive_entry_hardlink(entry); + + name = strip_components(name, bsdtar->strip_components); + if (name == NULL) + return (1); - while (r > 0) { - switch (*p++) { - case '/': - r--; - name = p; - break; - case '\0': - /* Path is too short, skip it. */ + if (linkname != NULL) { + linkname = strip_components(linkname, + bsdtar->strip_components); + if (linkname == NULL) return (1); - } + archive_entry_copy_hardlink(entry, linkname); } - while (*name == '/') - ++name; - if (*name == '\0') - return (1); } /* Strip redundant leading '/' characters. */ From owner-svn-src-head@FreeBSD.ORG Mon Nov 10 05:24:13 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AEA36106567F; Mon, 10 Nov 2008 05:24:13 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9F3FC8FC14; Mon, 10 Nov 2008 05:24:13 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mAA5ODPs059747; Mon, 10 Nov 2008 05:24:13 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mAA5ODJL059746; Mon, 10 Nov 2008 05:24:13 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <200811100524.mAA5ODJL059746@svn.freebsd.org> From: Tim Kientzle Date: Mon, 10 Nov 2008 05:24: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: r184808 - head/usr.bin/tar/test X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Nov 2008 05:24:13 -0000 Author: kientzle Date: Mon Nov 10 05:24:13 2008 New Revision: 184808 URL: http://svn.freebsd.org/changeset/base/184808 Log: Include more detailed explanation of this case, since it's pretty subtle why it comes out the way it does. Once you realize that it depends on the archiving order, it's also important to realize that filesystem differences aren't going to break this case. (Some of the other tests have had to be extensively rewritten to make them independent of the order in which a particular filesystem returns file entries.) (This commit also serves to note the PR number that I accidentally omitted from the previous commit.) PR: bin/128562 MFC after: 30 days Modified: head/usr.bin/tar/test/test_strip_components.c Modified: head/usr.bin/tar/test/test_strip_components.c ============================================================================== --- head/usr.bin/tar/test/test_strip_components.c Mon Nov 10 05:04:55 2008 (r184807) +++ head/usr.bin/tar/test/test_strip_components.c Mon Nov 10 05:24:13 2008 (r184808) @@ -63,15 +63,44 @@ DEFINE_TEST(test_strip_components) assertEqualInt(-1, lstat("target/d0", &st)); failure("d0/d1/ is too short and should not get restored"); assertEqualInt(-1, lstat("target/d1", &st)); - failure("d0/l1 is too short and should not get restored"); - assertEqualInt(-1, lstat("target/l1", &st)); - failure("d0/d1/l2 is a hardlink to file whose name was too short"); - assertEqualInt(-1, lstat("target/l2", &st)); - assertEqualInt(0, lstat("target/s2", &st)); failure("d0/d1/s2 is a symlink to something that won't be extracted"); assertEqualInt(-1, stat("target/s2", &st)); + assertEqualInt(0, lstat("target/s2", &st)); failure("d0/d1/d2 should be extracted"); assertEqualInt(0, lstat("target/d2", &st)); + + /* + * This next is a complicated case. d0/l1, d0/d1/l2, and + * d0/d1/d2/f1 are all hardlinks to the same file; d0/l1 can't + * be extracted with --strip-components=2 and the other two + * can. Remember that tar normally stores the first file with + * a body and the other as hardlink entries to the first + * appearance. So the final result depends on the order in + * which these three names get archived. If d0/l1 is first, + * none of the three can be restored. If either of the longer + * names are first, then the two longer ones can both be + * restored. + * + * The tree-walking code used by bsdtar always visits files + * before subdirectories, so bsdtar's behavior is fortunately + * deterministic: d0/l1 will always get stored first and the + * other two will be stored as hardlinks to d0/l1. Since + * d0/l1 can't be extracted, none of these three will be + * extracted. + * + * It may be worth extending this test to force a particular + * archiving order so as to exercise both of the cases described + * above. + * + * Of course, this is all totally different for cpio and newc + * formats because the hardlink management is different. + * TODO: Rename this to test_strip_components_tar and create + * parallel tests for cpio and newc formats. + */ + failure("d0/l1 is too short and should not get restored"); + assertEqualInt(-1, lstat("target/l1", &st)); + failure("d0/d1/l2 is a hardlink to file whose name was too short"); + assertEqualInt(-1, lstat("target/l2", &st)); failure("d0/d1/d2/f1 is a hardlink to file whose name was too short"); assertEqualInt(-1, lstat("target/d2/f1", &st)); } From owner-svn-src-head@FreeBSD.ORG Mon Nov 10 06:35:31 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 68BD3106564A; Mon, 10 Nov 2008 06:35:31 +0000 (UTC) (envelope-from matteo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 56C7B8FC12; Mon, 10 Nov 2008 06:35:31 +0000 (UTC) (envelope-from matteo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mAA6ZVI2060972; Mon, 10 Nov 2008 06:35:31 GMT (envelope-from matteo@svn.freebsd.org) Received: (from matteo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mAA6ZUWV060966; Mon, 10 Nov 2008 06:35:30 GMT (envelope-from matteo@svn.freebsd.org) Message-Id: <200811100635.mAA6ZUWV060966@svn.freebsd.org> From: Matteo Riondato Date: Mon, 10 Nov 2008 06:35: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: r184809 - in head/usr.sbin/cron: cron crontab lib X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Nov 2008 06:35:31 -0000 Author: matteo Date: Mon Nov 10 06:35:30 2008 New Revision: 184809 URL: http://svn.freebsd.org/changeset/base/184809 Log: Make usr.sbin/cron/crontab and usr.sbin/cron/lib WARNS=3 clean Tested with: make universe MFC after: 3 days Modified: head/usr.sbin/cron/cron/cron.h head/usr.sbin/cron/crontab/Makefile head/usr.sbin/cron/crontab/crontab.c head/usr.sbin/cron/lib/Makefile head/usr.sbin/cron/lib/entry.c head/usr.sbin/cron/lib/misc.c Modified: head/usr.sbin/cron/cron/cron.h ============================================================================== --- head/usr.sbin/cron/cron/cron.h Mon Nov 10 05:24:13 2008 (r184808) +++ head/usr.sbin/cron/cron/cron.h Mon Nov 10 06:35:30 2008 (r184809) @@ -221,6 +221,7 @@ int job_runqueue(void), get_char(FILE *), get_string(char *, int, FILE *, char *), swap_uids(void), + swap_uids_back(void), load_env(char *, FILE *), cron_pclose(FILE *), strcmp_until(char *, char *, int), @@ -238,7 +239,7 @@ char *env_get(char *, char **), user *load_user(int, struct passwd *, char *), *find_user(cron_db *, char *); -entry *load_entry(FILE *, void (*)(), +entry *load_entry(FILE *, void (*)(char *), struct passwd *, char **); FILE *cron_popen(char *, char *, entry *); Modified: head/usr.sbin/cron/crontab/Makefile ============================================================================== --- head/usr.sbin/cron/crontab/Makefile Mon Nov 10 05:24:13 2008 (r184808) +++ head/usr.sbin/cron/crontab/Makefile Mon Nov 10 06:35:30 2008 (r184809) @@ -8,6 +8,8 @@ BINOWN= root BINMODE=4555 PRECIOUSPROG= +WARNS=3 + CFLAGS+= -I${.CURDIR}/../cron DPADD= ${LIBCRON} ${LIBMD} ${LIBUTIL} Modified: head/usr.sbin/cron/crontab/crontab.c ============================================================================== --- head/usr.sbin/cron/crontab/crontab.c Mon Nov 10 05:24:13 2008 (r184808) +++ head/usr.sbin/cron/crontab/crontab.c Mon Nov 10 06:35:30 2008 (r184809) @@ -73,8 +73,7 @@ static int replace_cmd(void); static void -usage(msg) - char *msg; +usage(char *msg) { fprintf(stderr, "crontab: usage error: %s\n", msg); fprintf(stderr, "%s\n%s\n", @@ -85,9 +84,7 @@ usage(msg) int -main(argc, argv) - int argc; - char *argv[]; +main(int argc, char *argv[]) { int exitstatus; @@ -219,7 +216,7 @@ parse_args(argc, argv) err(ERROR_EXIT, "swapping uids"); if (!(NewCrontab = fopen(Filename, "r"))) err(ERROR_EXIT, "%s", Filename); - if (swap_uids() < OK) + if (swap_uids_back() < OK) err(ERROR_EXIT, "swapping uids back"); } } @@ -414,14 +411,14 @@ edit_cmd() { /* parent */ { - void (*f[4])(); - f[0] = signal(SIGHUP, SIG_IGN); - f[1] = signal(SIGINT, SIG_IGN); - f[2] = signal(SIGTERM, SIG_IGN); + void (*sig[3])(int signal); + sig[0] = signal(SIGHUP, SIG_IGN); + sig[1] = signal(SIGINT, SIG_IGN); + sig[2] = signal(SIGTERM, SIG_IGN); xpid = wait(&waiter); - signal(SIGHUP, f[0]); - signal(SIGINT, f[1]); - signal(SIGTERM, f[2]); + signal(SIGHUP, sig[0]); + signal(SIGINT, sig[1]); + signal(SIGTERM, sig[2]); } if (xpid != pid) { warnx("wrong PID (%d != %d) from \"%s\"", xpid, pid, editor); @@ -498,7 +495,6 @@ replace_cmd() { entry *e; time_t now = time(NULL); char **envp = env_init(); - void (*f[3])(); if (envp == NULL) { warnx("cannot allocate memory"); Modified: head/usr.sbin/cron/lib/Makefile ============================================================================== --- head/usr.sbin/cron/lib/Makefile Mon Nov 10 05:24:13 2008 (r184808) +++ head/usr.sbin/cron/lib/Makefile Mon Nov 10 06:35:30 2008 (r184809) @@ -4,6 +4,8 @@ LIB= cron INTERNALLIB= SRCS= entry.c env.c misc.c +WARNS = 3 + CFLAGS+= -I${.CURDIR}/../cron CFLAGS+= -DLOGIN_CAP -DPAM Modified: head/usr.sbin/cron/lib/entry.c ============================================================================== --- head/usr.sbin/cron/lib/entry.c Mon Nov 10 05:24:13 2008 (r184808) +++ head/usr.sbin/cron/lib/entry.c Mon Nov 10 06:35:30 2008 (r184809) @@ -87,7 +87,7 @@ free_entry(e) entry * load_entry(file, error_func, pw, envp) FILE *file; - void (*error_func)(); + void (*error_func)(char *); struct passwd *pw; char **envp; { Modified: head/usr.sbin/cron/lib/misc.c ============================================================================== --- head/usr.sbin/cron/lib/misc.c Mon Nov 10 05:24:13 2008 (r184808) +++ head/usr.sbin/cron/lib/misc.c Mon Nov 10 06:35:30 2008 (r184809) @@ -48,6 +48,7 @@ static const char rcsid[] = static int LogFD = ERR; +void mkprint(register char*, register unsigned char*, register int); int @@ -324,9 +325,7 @@ skip_comments(file) * FALSE otherwise. */ static int -in_file(string, file) - char *string; - FILE *file; +in_file(char *string, FILE *file) { char line[MAX_TEMPSTR]; @@ -521,10 +520,7 @@ first_word(s, t) * heavily ascii-dependent. */ void -mkprint(dst, src, len) - register char *dst; - register unsigned char *src; - register int len; +mkprint(register char *dst, register unsigned char *src, register int len) { while (len-- > 0) { From owner-svn-src-head@FreeBSD.ORG Mon Nov 10 10:07:40 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8E88F106567F; Mon, 10 Nov 2008 10:07:40 +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 3C4108FC23; Mon, 10 Nov 2008 10:07:40 +0000 (UTC) (envelope-from des@des.no) Received: from ds4.des.no (des.no [84.49.246.2]) by smtp.des.no (Postfix) with ESMTP id 1E3726D452; Mon, 10 Nov 2008 10:07:39 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id 053C484490; Mon, 10 Nov 2008 11:07:39 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Alexey Dokuchaev References: <200811090734.mA97YBld033553@svn.freebsd.org> <20081109084817.GA23323@FreeBSD.org> Date: Mon, 10 Nov 2008 11:07:38 +0100 In-Reply-To: <20081109084817.GA23323@FreeBSD.org> (Alexey Dokuchaev's message of "Sun, 9 Nov 2008 08:48:17 +0000") Message-ID: <861vxj6gid.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, Matteo Riondato , svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r184780 - head/usr.sbin/cron/crontab X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Nov 2008 10:07:40 -0000 Alexey Dokuchaev writes: > Matteo Riondato writes: > > +void > > +static remove_tmp(int sig) > > +{ > > + if (tmp_path) { > > + unlink(tmp_path); > > + } > > + exit(ERROR_EXIT); > > +} > This looks weird: `static' should be on same line as `void' as `static > void' (so ^remove_tmp would match). It will also always exit with > ERROR_EXIT, which does not look right, does it? The correct solution would be: static void remove_tmp(int sig) { (void)sig; if (tmp_path) unlink(tmp_path); _exit(1) } This assumes that tmp_path is atomic. In theory, the only type of global variable you can access from a signal handler is sig_atomic_t, but in practice, any volatile variable will work. (yes, the unconditional _exit() is correct) For bonus points, you should re-throw the signal rather than _exit(): static void remove_tmp(int sig) { if (tmp_path) unlink(tmp_path); signal(sig, SIG_DFL); raise(sig); } BTW, the "void (*f[3])()" thing in replace_cmd() is pointless; just reset the three signals to SIG_DFL. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-head@FreeBSD.ORG Mon Nov 10 10:11:56 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1082410656A7; Mon, 10 Nov 2008 10:11:54 +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 B25858FC25; Mon, 10 Nov 2008 10:11:53 +0000 (UTC) (envelope-from des@des.no) Received: from ds4.des.no (des.no [84.49.246.2]) by smtp.des.no (Postfix) with ESMTP id C496B6D43F; Mon, 10 Nov 2008 10:11:52 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id A8ED284497; Mon, 10 Nov 2008 11:11:52 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Kostik Belousov References: <200811090644.mA96ira1032670@svn.freebsd.org> <20081109132026.GL18100@deviant.kiev.zoral.com.ua> Date: Mon, 10 Nov 2008 11:11:52 +0100 In-Reply-To: <20081109132026.GL18100@deviant.kiev.zoral.com.ua> (Kostik Belousov's message of "Sun, 9 Nov 2008 15:20:26 +0200") Message-ID: <86wsfb51qv.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, Matteo Riondato , svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r184779 - head/usr.sbin/cron/crontab X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Nov 2008 10:11:56 -0000 Kostik Belousov writes: > Matteo Riondato writes: > > - (void) sprintf(n, CRON_TAB(User)); > > + (void) snprintf(n, sizeof(n), CRON_TAB(User)); > This note is probably also about paranoia instead of exploitable bug. > I think that it is better to use %s format explicitely instead of > expecting no '%' in the CRON_TAB(User). Better still would be to replace the vile CRON_TAB() macro with a function: static inline int cron_tab(char *str, size_t len, const char *user) { return (snprintf(str, len, "%s/%s", SPOOL_DIR, user)) } DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-head@FreeBSD.ORG Mon Nov 10 19:17:07 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 42CE6106567C; Mon, 10 Nov 2008 19:17:07 +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 E73A08FC1C; Mon, 10 Nov 2008 19:17:06 +0000 (UTC) (envelope-from des@des.no) Received: from ds4.des.no (des.no [84.49.246.2]) by smtp.des.no (Postfix) with ESMTP id 73F976D449; Mon, 10 Nov 2008 19:17:05 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id 6316284497; Mon, 10 Nov 2008 20:17:05 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Matteo Riondato References: <200811100635.mAA6ZUWV060966@svn.freebsd.org> Date: Mon, 10 Nov 2008 20:17:05 +0100 In-Reply-To: <200811100635.mAA6ZUWV060966@svn.freebsd.org> (Matteo Riondato's message of "Mon, 10 Nov 2008 06:35:30 +0000 (UTC)") Message-ID: <86wsfb1jda.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (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 Subject: Re: svn commit: r184809 - in head/usr.sbin/cron: cron crontab lib X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Nov 2008 19:17:07 -0000 Matteo Riondato writes: > +WARNS=3D3 SOP is to use ?=3D instead of =3D here so you can override it on the command line. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-head@FreeBSD.ORG Mon Nov 10 20:14:17 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 194DE106568A; Mon, 10 Nov 2008 20:14:17 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id 89CB88FC14; Mon, 10 Nov 2008 20:14:16 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from localhost.corp.yahoo.com (john@localhost [IPv6:::1]) (authenticated bits=0) by server.baldwin.cx (8.14.3/8.14.3) with ESMTP id mAAKE4ag066594; Mon, 10 Nov 2008 15:14:10 -0500 (EST) (envelope-from jhb@freebsd.org) From: John Baldwin To: "Peter Wemm" Date: Mon, 10 Nov 2008 11:33:51 -0500 User-Agent: KMail/1.9.7 References: <200811041904.mA4J41dL005103@svn.freebsd.org> <200811041750.08355.jhb@freebsd.org> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200811101133.51947.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [IPv6:::1]); Mon, 10 Nov 2008 15:14:10 -0500 (EST) X-Virus-Scanned: ClamAV 0.93.1/8599/Mon Nov 10 11:43:18 2008 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.4 required=4.2 tests=AWL,BAYES_00, DATE_IN_PAST_03_06,NO_RELAYS autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Ivan Voras Subject: Re: svn commit: r184652 - in head/sys: dev/hwpmc fs/procfs kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Nov 2008 20:14:17 -0000 On Thursday 06 November 2008 10:21:37 am Peter Wemm wrote: > On Tue, Nov 4, 2008 at 2:50 PM, John Baldwin wrote: > > On Tuesday 04 November 2008 05:22:47 pm Ivan Voras wrote: > >> 2008/11/4 John Baldwin : > >> > Author: jhb > >> > Date: Tue Nov 4 19:04:01 2008 > >> > New Revision: 184652 > >> > URL: http://svn.freebsd.org/changeset/base/184652 > >> > > >> > Log: > >> > Remove unnecessary locking around vn_fullpath(). The vnode lock for the > >> > >> Does this affect realpath(3)? (whose non-scalability is often reported > >> for PHP web servers). > > > > realpath(3) calls getcwd(3) (which devolves to __getcwd(2) I think) once per > > invocation (and that already did not lock the vnode). It then calls lstat() > > for each component in the path. The lstat() calls should be using shared > > locks (at least with the recent changes to use shared lookups for UFS in > > HEAD). I imagine the bottleneck is more with lstat() than getcwd(3). > > Neither is helped by the specific changes above. > > Hmm. Would it make sense to provide a helper syscall specifically for > php to use for this? Without having looked at the php code, it sounds > like it might be helpful to have a syscall that returns the path and > an array of stat structs for each path component. Or is php only > doing this because of compatability with non-atomic getcwd() > implementations? Does php even need to do it? We could possibly move realpath(3) into the kernel. svr4 compat has svr4_resolvepath() which I think is basically a realpath(3) in the kernel that only does one pathname lookup rather than N. If that really works then it would probably be a boon. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Mon Nov 10 20:15:29 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 175801065693; Mon, 10 Nov 2008 20:15:29 +0000 (UTC) (envelope-from blue@white.lv) Received: from mx2.nttmcl.com (MX2.nttmcl.com [216.69.68.200]) by mx1.freebsd.org (Postfix) with ESMTP id E9EC68FC08; Mon, 10 Nov 2008 20:15:28 +0000 (UTC) (envelope-from blue@white.lv) Received: from localhost (localhost [127.0.0.1]) by mx2.nttmcl.com (Postfix) with ESMTP id 4AE5E4DD4F; Mon, 10 Nov 2008 11:53:17 -0800 (PST) X-Spam-Score: -3.714 X-Spam-Level: X-Spam-Status: No, score=-3.714 tagged_above=-999 required=5 tests=[ALL_TRUSTED=-1.8, AWL=0.684, BAYES_00=-2.599, DNS_FROM_SECURITYSAGE=0.001] Received: from mx2.nttmcl.com ([127.0.0.1]) by localhost (mx2.nttmcl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id WWtvTrCMsvcn; Mon, 10 Nov 2008 11:53:16 -0800 (PST) Received: from [216.69.69.190] (dhcp190.nttmcl.com [216.69.69.190]) by mx2.nttmcl.com (Postfix) with ESMTP id E22C74DD4D; Mon, 10 Nov 2008 11:53:16 -0800 (PST) Message-ID: <4918912D.2040100@white.lv> Date: Mon, 10 Nov 2008 11:53:17 -0800 From: "Eugene M. Kim" User-Agent: Thunderbird 2.0.0.17 (Windows/20080914) MIME-Version: 1.0 To: =?UTF-8?B?RGFnLUVybGluZyBTbcO4cmdyYXY=?= References: <200811100635.mAA6ZUWV060966@svn.freebsd.org> <86wsfb1jda.fsf@ds4.des.no> In-Reply-To: <86wsfb1jda.fsf@ds4.des.no> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Cc: svn-src-head@freebsd.org, Matteo Riondato , svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r184809 - in head/usr.sbin/cron: cron crontab lib X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Nov 2008 20:15:29 -0000 A (very) minor correction: Command-line variable assignments override even "="-style ones: $ cat Makefile OMG= OH MY GOD .error ${OMG} $ make "/home/ab/Makefile", line 3: OH MY GOD $ make OMG=OMIGOD "/home/ab/Makefile", line 3: OMIGOD But "="-style assignments does nullify overrides stored in src.conf or make.conf, so I believe your overall point is still quite valid. : ) Cheers, Eugene Dag-Erling Smørgrav wrote: > Matteo Riondato writes: > >> +WARNS=3 >> > > SOP is to use ?= instead of = here so you can override it on the command > line. > > DES > From owner-svn-src-head@FreeBSD.ORG Mon Nov 10 20:54:33 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5B78A10656A4; Mon, 10 Nov 2008 20:54:33 +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 458E78FC0A; Mon, 10 Nov 2008 20:54:33 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mAAKsWRW082229; Mon, 10 Nov 2008 20:54:32 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mAAKsVAQ082218; Mon, 10 Nov 2008 20:54:31 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200811102054.mAAKsVAQ082218@svn.freebsd.org> From: Andrew Thompson Date: Mon, 10 Nov 2008 20:54: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: r184824 - in head/sys/dev/usb2: controller core serial storage X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Nov 2008 20:54:33 -0000 Author: thompsa Date: Mon Nov 10 20:54:31 2008 New Revision: 184824 URL: http://svn.freebsd.org/changeset/base/184824 Log: Convert the two main locking areas into macros to make it clear on what we are grabbing and why. These are now: USB_BUS_LOCK/USB_BUS_UNLOCK USB_XFER_LOCK/USB_XFER_UNLOCK Reviewed by: alfred Modified: head/sys/dev/usb2/controller/at91dci.c head/sys/dev/usb2/controller/at91dci_atmelarm.c head/sys/dev/usb2/controller/ehci2.c head/sys/dev/usb2/controller/ehci2_pci.c head/sys/dev/usb2/controller/musb2_otg.c head/sys/dev/usb2/controller/musb2_otg_atmelarm.c head/sys/dev/usb2/controller/ohci2.c head/sys/dev/usb2/controller/ohci2_atmelarm.c head/sys/dev/usb2/controller/ohci2_pci.c head/sys/dev/usb2/controller/uhci2.c head/sys/dev/usb2/controller/uhci2_pci.c head/sys/dev/usb2/controller/usb2_bus.h head/sys/dev/usb2/controller/usb2_controller.c head/sys/dev/usb2/controller/uss820dci.c head/sys/dev/usb2/controller/uss820dci_atmelarm.c head/sys/dev/usb2/controller/uss820dci_pccard.c head/sys/dev/usb2/core/usb2_busdma.c head/sys/dev/usb2/core/usb2_core.h head/sys/dev/usb2/core/usb2_device.c head/sys/dev/usb2/core/usb2_handle_request.c head/sys/dev/usb2/core/usb2_hub.c head/sys/dev/usb2/core/usb2_request.c head/sys/dev/usb2/core/usb2_sw_transfer.c head/sys/dev/usb2/core/usb2_transfer.c head/sys/dev/usb2/core/usb2_transfer.h head/sys/dev/usb2/serial/uvscom2.c head/sys/dev/usb2/storage/ata-usb2.c Modified: head/sys/dev/usb2/controller/at91dci.c ============================================================================== --- head/sys/dev/usb2/controller/at91dci.c Mon Nov 10 18:24:11 2008 (r184823) +++ head/sys/dev/usb2/controller/at91dci.c Mon Nov 10 20:54:31 2008 (r184824) @@ -291,7 +291,7 @@ at91dci_rem_wakeup_set(struct usb2_devic DPRINTFN(5, "is_on=%u\n", is_on); - mtx_assert(&udev->bus->mtx, MA_OWNED); + USB_BUS_LOCK_ASSERT(udev->bus, MA_OWNED); sc = AT9100_DCI_BUS2SC(udev->bus); @@ -766,7 +766,7 @@ at91dci_vbus_interrupt(struct usb2_bus * DPRINTFN(5, "vbus = %u\n", is_on); - mtx_lock(&sc->sc_bus.mtx); + USB_BUS_LOCK(&sc->sc_bus); if (is_on) { if (!sc->sc_flags.status_vbus) { sc->sc_flags.status_vbus = 1; @@ -791,7 +791,7 @@ at91dci_vbus_interrupt(struct usb2_bus * } } - mtx_unlock(&sc->sc_bus.mtx); + USB_BUS_UNLOCK(&sc->sc_bus); return; } @@ -801,13 +801,13 @@ at91dci_interrupt(struct at91dci_softc * { uint32_t status; - mtx_lock(&sc->sc_bus.mtx); + USB_BUS_LOCK(&sc->sc_bus); status = AT91_UDP_READ_4(sc, AT91_UDP_ISR); status &= AT91_UDP_INT_DEFAULT; if (!status) { - mtx_unlock(&sc->sc_bus.mtx); + USB_BUS_UNLOCK(&sc->sc_bus); return; } /* acknowledge interrupts */ @@ -879,7 +879,7 @@ at91dci_interrupt(struct at91dci_softc * at91dci_interrupt_poll(sc); } - mtx_unlock(&sc->sc_bus.mtx); + USB_BUS_UNLOCK(&sc->sc_bus); return; } @@ -1065,12 +1065,12 @@ at91dci_timeout(void *arg) DPRINTF("xfer=%p\n", xfer); - mtx_assert(&sc->sc_bus.mtx, MA_OWNED); + USB_BUS_LOCK_ASSERT(&sc->sc_bus, MA_OWNED); /* transfer is transferred */ at91dci_device_done(xfer, USB_ERR_TIMEOUT); - mtx_unlock(&sc->sc_bus.mtx); + USB_BUS_UNLOCK(&sc->sc_bus); return; } @@ -1115,7 +1115,7 @@ at91dci_root_intr_done(struct usb2_xfer DPRINTFN(9, "\n"); - mtx_assert(&sc->sc_bus.mtx, MA_OWNED); + USB_BUS_LOCK_ASSERT(&sc->sc_bus, MA_OWNED); if (std->state != USB_SW_TR_PRE_DATA) { if (std->state == USB_SW_TR_PRE_CALLBACK) { @@ -1255,7 +1255,7 @@ at91dci_device_done(struct usb2_xfer *xf struct at91dci_softc *sc = xfer->usb2_sc; uint8_t ep_no; - mtx_assert(&sc->sc_bus.mtx, MA_OWNED); + USB_BUS_LOCK_ASSERT(&sc->sc_bus, MA_OWNED); DPRINTFN(2, "xfer=%p, pipe=%p, error=%d\n", xfer, xfer->pipe, error); @@ -1281,7 +1281,7 @@ at91dci_set_stall(struct usb2_device *ud uint32_t csr_val; uint8_t csr_reg; - mtx_assert(&udev->bus->mtx, MA_OWNED); + USB_BUS_LOCK_ASSERT(udev->bus, MA_OWNED); DPRINTFN(5, "pipe=%p\n", pipe); @@ -1405,7 +1405,7 @@ at91dci_clear_stall(struct usb2_device * DPRINTFN(5, "pipe=%p\n", pipe); - mtx_assert(&udev->bus->mtx, MA_OWNED); + USB_BUS_LOCK_ASSERT(udev->bus, MA_OWNED); /* check mode */ if (udev->flags.usb2_mode != USB_MODE_DEVICE) { @@ -1438,7 +1438,7 @@ at91dci_init(struct at91dci_softc *sc) sc->sc_bus.usbrev = USB_REV_1_1; sc->sc_bus.methods = &at91dci_bus_methods; - mtx_lock(&sc->sc_bus.mtx); + USB_BUS_LOCK(&sc->sc_bus); /* turn on clocks */ @@ -1446,7 +1446,7 @@ at91dci_init(struct at91dci_softc *sc) (sc->sc_clocks_on) (sc->sc_clocks_arg); } /* wait a little for things to stabilise */ - usb2_pause_mtx(&sc->sc_bus.mtx, 1); + usb2_pause_mtx(&sc->sc_bus.bus_mtx, 1); /* disable and clear all interrupts */ @@ -1483,7 +1483,7 @@ at91dci_init(struct at91dci_softc *sc) at91dci_clocks_off(sc); - mtx_unlock(&sc->sc_bus.mtx); + USB_BUS_UNLOCK(&sc->sc_bus); /* catch any lost interrupts */ @@ -1495,7 +1495,7 @@ at91dci_init(struct at91dci_softc *sc) void at91dci_uninit(struct at91dci_softc *sc) { - mtx_lock(&sc->sc_bus.mtx); + USB_BUS_LOCK(&sc->sc_bus); /* disable and clear all interrupts */ AT91_UDP_WRITE_4(sc, AT91_UDP_IDR, 0xFFFFFFFF); @@ -1510,7 +1510,7 @@ at91dci_uninit(struct at91dci_softc *sc) at91dci_pull_down(sc); at91dci_clocks_off(sc); - mtx_unlock(&sc->sc_bus.mtx); + USB_BUS_UNLOCK(&sc->sc_bus); return; } @@ -1532,10 +1532,10 @@ at91dci_do_poll(struct usb2_bus *bus) { struct at91dci_softc *sc = AT9100_DCI_BUS2SC(bus); - mtx_lock(&sc->sc_bus.mtx); + USB_BUS_LOCK(&sc->sc_bus); at91dci_interrupt_poll(sc); at91dci_root_ctrl_poll(sc); - mtx_unlock(&sc->sc_bus.mtx); + USB_BUS_UNLOCK(&sc->sc_bus); return; } @@ -1897,7 +1897,7 @@ at91dci_root_ctrl_done(struct usb2_xfer uint16_t index; uint8_t use_polling; - mtx_assert(&sc->sc_bus.mtx, MA_OWNED); + USB_BUS_LOCK_ASSERT(&sc->sc_bus, MA_OWNED); if (std->state != USB_SW_TR_SETUP) { if (std->state == USB_SW_TR_PRE_CALLBACK) { @@ -1913,7 +1913,7 @@ at91dci_root_ctrl_done(struct usb2_xfer value = UGETW(std->req.wValue); index = UGETW(std->req.wIndex); - use_polling = mtx_owned(xfer->priv_mtx) ? 1 : 0; + use_polling = mtx_owned(xfer->xfer_mtx) ? 1 : 0; /* demultiplex the control request */ Modified: head/sys/dev/usb2/controller/at91dci_atmelarm.c ============================================================================== --- head/sys/dev/usb2/controller/at91dci_atmelarm.c Mon Nov 10 18:24:11 2008 (r184823) +++ head/sys/dev/usb2/controller/at91dci_atmelarm.c Mon Nov 10 20:54:31 2008 (r184824) @@ -210,7 +210,7 @@ at91_udp_attach(device_t dev) device_set_ivars(sc->sc_dci.sc_bus.bdev, &sc->sc_dci.sc_bus); err = usb2_config_td_setup(&sc->sc_dci.sc_config_td, sc, - &sc->sc_dci.sc_bus.mtx, NULL, 0, 4); + &sc->sc_dci.sc_bus.bus_mtx, NULL, 0, 4); if (err) { device_printf(dev, "could not setup config thread!\n"); goto error; Modified: head/sys/dev/usb2/controller/ehci2.c ============================================================================== --- head/sys/dev/usb2/controller/ehci2.c Mon Nov 10 18:24:11 2008 (r184823) +++ head/sys/dev/usb2/controller/ehci2.c Mon Nov 10 20:54:31 2008 (r184824) @@ -164,7 +164,7 @@ ehci_hc_reset(ehci_softc_t *sc) EOWRITE4(sc, EHCI_USBCMD, 0); /* Halt controller */ for (n = 0; n != 100; n++) { - usb2_pause_mtx(&sc->sc_bus.mtx, 1); + usb2_pause_mtx(&sc->sc_bus.bus_mtx, 1); hcr = EOREAD4(sc, EHCI_USBSTS); if (hcr & EHCI_STS_HCH) { hcr = 0; @@ -180,7 +180,7 @@ ehci_hc_reset(ehci_softc_t *sc) EOWRITE4(sc, EHCI_USBCMD, EHCI_CMD_HCRESET); for (n = 0; n != 100; n++) { - usb2_pause_mtx(&sc->sc_bus.mtx, 1); + usb2_pause_mtx(&sc->sc_bus.bus_mtx, 1); hcr = EOREAD4(sc, EHCI_USBCMD); if (!(hcr & EHCI_CMD_HCRESET)) { hcr = 0; @@ -208,11 +208,11 @@ ehci_init(ehci_softc_t *sc) uint16_t bit; usb2_error_t err = 0; - mtx_lock(&sc->sc_bus.mtx); + USB_BUS_LOCK(&sc->sc_bus); DPRINTF("start\n"); - usb2_callout_init_mtx(&sc->sc_tmo_pcd, &sc->sc_bus.mtx, + usb2_callout_init_mtx(&sc->sc_tmo_pcd, &sc->sc_bus.bus_mtx, CALLOUT_RETURNUNLOCKED); #if USB_DEBUG @@ -465,7 +465,7 @@ ehci_init(ehci_softc_t *sc) EOWRITE4(sc, EHCI_CONFIGFLAG, EHCI_CONF_CF); for (i = 0; i < 100; i++) { - usb2_pause_mtx(&sc->sc_bus.mtx, 1); + usb2_pause_mtx(&sc->sc_bus.bus_mtx, 1); hcr = EOREAD4(sc, EHCI_USBSTS) & EHCI_STS_HCH; if (!hcr) { break; @@ -477,7 +477,7 @@ ehci_init(ehci_softc_t *sc) goto done; } done: - mtx_unlock(&sc->sc_bus.mtx); + USB_BUS_UNLOCK(&sc->sc_bus); if (!err) { /* catch any lost interrupts */ @@ -492,7 +492,7 @@ done: void ehci_detach(struct ehci_softc *sc) { - mtx_lock(&sc->sc_bus.mtx); + USB_BUS_LOCK(&sc->sc_bus); usb2_callout_stop(&sc->sc_tmo_pcd); @@ -502,9 +502,9 @@ ehci_detach(struct ehci_softc *sc) DPRINTF("reset failed!\n"); } /* XXX let stray task complete */ - usb2_pause_mtx(&sc->sc_bus.mtx, 50); + usb2_pause_mtx(&sc->sc_bus.bus_mtx, 50); - mtx_unlock(&sc->sc_bus.mtx); + USB_BUS_UNLOCK(&sc->sc_bus); usb2_callout_drain(&sc->sc_tmo_pcd); @@ -518,7 +518,7 @@ ehci_suspend(struct ehci_softc *sc) uint32_t hcr; uint8_t i; - mtx_lock(&sc->sc_bus.mtx); + USB_BUS_LOCK(&sc->sc_bus); for (i = 1; i <= sc->sc_noport; i++) { cmd = EOREAD4(sc, EHCI_PORTSC(i)); @@ -541,7 +541,7 @@ ehci_suspend(struct ehci_softc *sc) if (hcr == 0) { break; } - usb2_pause_mtx(&sc->sc_bus.mtx, 1); + usb2_pause_mtx(&sc->sc_bus.bus_mtx, 1); } if (hcr != 0) { @@ -555,14 +555,14 @@ ehci_suspend(struct ehci_softc *sc) if (hcr == EHCI_STS_HCH) { break; } - usb2_pause_mtx(&sc->sc_bus.mtx, 1); + usb2_pause_mtx(&sc->sc_bus.bus_mtx, 1); } if (hcr != EHCI_STS_HCH) { device_printf(sc->sc_bus.bdev, "config timeout\n"); } - mtx_unlock(&sc->sc_bus.mtx); + USB_BUS_UNLOCK(&sc->sc_bus); return; } @@ -574,7 +574,7 @@ ehci_resume(struct ehci_softc *sc) uint32_t hcr; uint8_t i; - mtx_lock(&sc->sc_bus.mtx); + USB_BUS_LOCK(&sc->sc_bus); /* restore things in case the bios doesn't */ EOWRITE4(sc, EHCI_CTRLDSSEGMENT, 0); @@ -599,7 +599,7 @@ ehci_resume(struct ehci_softc *sc) } if (hcr) { - usb2_pause_mtx(&sc->sc_bus.mtx, + usb2_pause_mtx(&sc->sc_bus.bus_mtx, USB_RESUME_WAIT); for (i = 1; i <= sc->sc_noport; i++) { @@ -618,15 +618,15 @@ ehci_resume(struct ehci_softc *sc) if (hcr != EHCI_STS_HCH) { break; } - usb2_pause_mtx(&sc->sc_bus.mtx, 1); + usb2_pause_mtx(&sc->sc_bus.bus_mtx, 1); } if (hcr == EHCI_STS_HCH) { device_printf(sc->sc_bus.bdev, "config timeout\n"); } - usb2_pause_mtx(&sc->sc_bus.mtx, + usb2_pause_mtx(&sc->sc_bus.bus_mtx, USB_RESUME_WAIT); - mtx_unlock(&sc->sc_bus.mtx); + USB_BUS_UNLOCK(&sc->sc_bus); /* catch any lost interrupts */ ehci_do_poll(&sc->sc_bus); @@ -639,12 +639,12 @@ ehci_shutdown(ehci_softc_t *sc) { DPRINTF("stopping the HC\n"); - mtx_lock(&sc->sc_bus.mtx); + USB_BUS_LOCK(&sc->sc_bus); if (ehci_hc_reset(sc)) { DPRINTF("reset failed!\n"); } - mtx_unlock(&sc->sc_bus.mtx); + USB_BUS_UNLOCK(&sc->sc_bus); } #if USB_DEBUG @@ -1415,7 +1415,7 @@ transferred: static void ehci_pcd_enable(ehci_softc_t *sc) { - mtx_assert(&sc->sc_bus.mtx, MA_OWNED); + USB_BUS_LOCK_ASSERT(&sc->sc_bus, MA_OWNED); sc->sc_eintrs |= EHCI_STS_PCD; EOWRITE4(sc, EHCI_USBINTR, sc->sc_eintrs); @@ -1426,7 +1426,7 @@ ehci_pcd_enable(ehci_softc_t *sc) usb2_sw_transfer(&sc->sc_root_intr, &ehci_root_intr_done); - mtx_unlock(&sc->sc_bus.mtx); + USB_BUS_UNLOCK(&sc->sc_bus); return; } @@ -1460,7 +1460,7 @@ ehci_interrupt(ehci_softc_t *sc) { uint32_t status; - mtx_lock(&sc->sc_bus.mtx); + USB_BUS_LOCK(&sc->sc_bus); DPRINTFN(16, "real interrupt\n"); @@ -1517,7 +1517,7 @@ ehci_interrupt(ehci_softc_t *sc) ehci_interrupt_poll(sc); done: - mtx_unlock(&sc->sc_bus.mtx); + USB_BUS_UNLOCK(&sc->sc_bus); return; } @@ -1532,12 +1532,12 @@ ehci_timeout(void *arg) DPRINTF("xfer=%p\n", xfer); - mtx_assert(&sc->sc_bus.mtx, MA_OWNED); + USB_BUS_LOCK_ASSERT(&sc->sc_bus, MA_OWNED); /* transfer is transferred */ ehci_device_done(xfer, USB_ERR_TIMEOUT); - mtx_unlock(&sc->sc_bus.mtx); + USB_BUS_UNLOCK(&sc->sc_bus); return; } @@ -1547,10 +1547,10 @@ ehci_do_poll(struct usb2_bus *bus) { struct ehci_softc *sc = EHCI_BUS2SC(bus); - mtx_lock(&sc->sc_bus.mtx); + USB_BUS_LOCK(&sc->sc_bus); ehci_interrupt_poll(sc); ehci_root_ctrl_poll(sc); - mtx_unlock(&sc->sc_bus.mtx); + USB_BUS_UNLOCK(&sc->sc_bus); return; } @@ -1965,7 +1965,7 @@ ehci_root_intr_done(struct usb2_xfer *xf uint16_t i; uint16_t m; - mtx_assert(&sc->sc_bus.mtx, MA_OWNED); + USB_BUS_LOCK_ASSERT(&sc->sc_bus, MA_OWNED); if (std->state != USB_SW_TR_PRE_DATA) { if (std->state == USB_SW_TR_PRE_CALLBACK) { @@ -2124,7 +2124,7 @@ ehci_device_done(struct usb2_xfer *xfer, struct usb2_pipe_methods *methods = xfer->pipe->methods; ehci_softc_t *sc = xfer->usb2_sc; - mtx_assert(&sc->sc_bus.mtx, MA_OWNED); + USB_BUS_LOCK_ASSERT(&sc->sc_bus, MA_OWNED); DPRINTFN(2, "xfer=%p, pipe=%p, error=%d\n", xfer, xfer->pipe, error); @@ -3076,7 +3076,7 @@ ehci_root_ctrl_done(struct usb2_xfer *xf uint8_t l; uint8_t use_polling; - mtx_assert(&sc->sc_bus.mtx, MA_OWNED); + USB_BUS_LOCK_ASSERT(&sc->sc_bus, MA_OWNED); if (std->state != USB_SW_TR_SETUP) { if (std->state == USB_SW_TR_PRE_CALLBACK) { @@ -3092,7 +3092,7 @@ ehci_root_ctrl_done(struct usb2_xfer *xf value = UGETW(std->req.wValue); index = UGETW(std->req.wIndex); - use_polling = mtx_owned(xfer->priv_mtx) ? 1 : 0; + use_polling = mtx_owned(xfer->xfer_mtx) ? 1 : 0; DPRINTFN(3, "type=0x%02x request=0x%02x wLen=0x%04x " "wValue=0x%04x wIndex=0x%04x\n", @@ -3373,7 +3373,7 @@ ehci_root_ctrl_done(struct usb2_xfer *xf DELAY(USB_PORT_ROOT_RESET_DELAY * 1000); } else { /* Wait for reset to complete. */ - usb2_pause_mtx(&sc->sc_bus.mtx, + usb2_pause_mtx(&sc->sc_bus.bus_mtx, USB_PORT_ROOT_RESET_DELAY); } @@ -3385,7 +3385,7 @@ ehci_root_ctrl_done(struct usb2_xfer *xf DELAY(EHCI_PORT_RESET_COMPLETE * 1000); } else { /* Wait for HC to complete reset. */ - usb2_pause_mtx(&sc->sc_bus.mtx, + usb2_pause_mtx(&sc->sc_bus.bus_mtx, EHCI_PORT_RESET_COMPLETE); } Modified: head/sys/dev/usb2/controller/ehci2_pci.c ============================================================================== --- head/sys/dev/usb2/controller/ehci2_pci.c Mon Nov 10 18:24:11 2008 (r184823) +++ head/sys/dev/usb2/controller/ehci2_pci.c Mon Nov 10 20:54:31 2008 (r184824) @@ -337,7 +337,7 @@ ehci_pci_attach(device_t self) sprintf(sc->sc_vendor, "(0x%04x)", pci_get_vendor(self)); } - err = usb2_config_td_setup(&sc->sc_config_td, sc, &sc->sc_bus.mtx, + err = usb2_config_td_setup(&sc->sc_config_td, sc, &sc->sc_bus.bus_mtx, NULL, 0, 4); if (err) { device_printf(self, "could not setup config thread!\n"); Modified: head/sys/dev/usb2/controller/musb2_otg.c ============================================================================== --- head/sys/dev/usb2/controller/musb2_otg.c Mon Nov 10 18:24:11 2008 (r184823) +++ head/sys/dev/usb2/controller/musb2_otg.c Mon Nov 10 20:54:31 2008 (r184824) @@ -221,7 +221,7 @@ musbotg_wakeup_peer(struct usb2_xfer *xf if (!(sc->sc_flags.status_suspend)) { return; } - use_polling = mtx_owned(xfer->priv_mtx) ? 1 : 0; + use_polling = mtx_owned(xfer->xfer_mtx) ? 1 : 0; temp = MUSB2_READ_1(sc, MUSB2_REG_POWER); temp |= MUSB2_MASK_RESUME; @@ -233,7 +233,7 @@ musbotg_wakeup_peer(struct usb2_xfer *xf DELAY(8000); } else { /* Wait for reset to complete. */ - usb2_pause_mtx(&sc->sc_bus.mtx, 8); + usb2_pause_mtx(&sc->sc_bus.bus_mtx, 8); } temp = MUSB2_READ_1(sc, MUSB2_REG_POWER); @@ -982,7 +982,7 @@ musbotg_vbus_interrupt(struct usb2_bus * DPRINTFN(4, "vbus = %u\n", is_on); - mtx_lock(&sc->sc_bus.mtx); + USB_BUS_LOCK(&sc->sc_bus); if (is_on) { if (!sc->sc_flags.status_vbus) { sc->sc_flags.status_vbus = 1; @@ -1007,7 +1007,7 @@ musbotg_vbus_interrupt(struct usb2_bus * } } - mtx_unlock(&sc->sc_bus.mtx); + USB_BUS_UNLOCK(&sc->sc_bus); return; } @@ -1021,7 +1021,7 @@ musbotg_interrupt(struct musbotg_softc * uint8_t temp; uint8_t to = 2; - mtx_lock(&sc->sc_bus.mtx); + USB_BUS_LOCK(&sc->sc_bus); repeat: @@ -1116,7 +1116,7 @@ repeat: if (--to) goto repeat; - mtx_unlock(&sc->sc_bus.mtx); + USB_BUS_UNLOCK(&sc->sc_bus); return; } @@ -1273,12 +1273,12 @@ musbotg_timeout(void *arg) DPRINTFN(1, "xfer=%p\n", xfer); - mtx_assert(&sc->sc_bus.mtx, MA_OWNED); + USB_BUS_LOCK_ASSERT(&sc->sc_bus, MA_OWNED); /* transfer is transferred */ musbotg_device_done(xfer, USB_ERR_TIMEOUT); - mtx_unlock(&sc->sc_bus.mtx); + USB_BUS_UNLOCK(&sc->sc_bus); return; } @@ -1356,7 +1356,7 @@ musbotg_root_intr_done(struct usb2_xfer DPRINTFN(8, "\n"); - mtx_assert(&sc->sc_bus.mtx, MA_OWNED); + USB_BUS_LOCK_ASSERT(&sc->sc_bus, MA_OWNED); if (std->state != USB_SW_TR_PRE_DATA) { if (std->state == USB_SW_TR_PRE_CALLBACK) { @@ -1516,7 +1516,7 @@ musbotg_set_stall(struct usb2_device *ud struct musbotg_softc *sc; uint8_t ep_no; - mtx_assert(&udev->bus->mtx, MA_OWNED); + USB_BUS_LOCK_ASSERT(udev->bus, MA_OWNED); DPRINTFN(4, "pipe=%p\n", pipe); @@ -1702,7 +1702,7 @@ musbotg_clear_stall(struct usb2_device * DPRINTFN(4, "pipe=%p\n", pipe); - mtx_assert(&udev->bus->mtx, MA_OWNED); + USB_BUS_LOCK_ASSERT(udev->bus, MA_OWNED); /* check mode */ if (udev->flags.usb2_mode != USB_MODE_DEVICE) { @@ -1741,7 +1741,7 @@ musbotg_init(struct musbotg_softc *sc) sc->sc_bus.usbrev = USB_REV_2_0; sc->sc_bus.methods = &musbotg_bus_methods; - mtx_lock(&sc->sc_bus.mtx); + USB_BUS_LOCK(&sc->sc_bus); /* turn on clocks */ @@ -1749,7 +1749,7 @@ musbotg_init(struct musbotg_softc *sc) (sc->sc_clocks_on) (sc->sc_clocks_arg); } /* wait a little for things to stabilise */ - usb2_pause_mtx(&sc->sc_bus.mtx, 1); + usb2_pause_mtx(&sc->sc_bus.bus_mtx, 1); /* disable all interrupts */ @@ -1762,7 +1762,7 @@ musbotg_init(struct musbotg_softc *sc) musbotg_pull_common(sc, 0); /* wait a little bit (10ms) */ - usb2_pause_mtx(&sc->sc_bus.mtx, 10); + usb2_pause_mtx(&sc->sc_bus.bus_mtx, 10); /* disable double packet buffering */ MUSB2_WRITE_2(sc, MUSB2_REG_RXDBDIS, 0xFFFF); @@ -1871,7 +1871,7 @@ musbotg_init(struct musbotg_softc *sc) musbotg_clocks_off(sc); - mtx_unlock(&sc->sc_bus.mtx); + USB_BUS_UNLOCK(&sc->sc_bus); /* catch any lost interrupts */ @@ -1883,7 +1883,7 @@ musbotg_init(struct musbotg_softc *sc) void musbotg_uninit(struct musbotg_softc *sc) { - mtx_lock(&sc->sc_bus.mtx); + USB_BUS_LOCK(&sc->sc_bus); /* disable all interrupts */ MUSB2_WRITE_1(sc, MUSB2_REG_INTUSBE, 0); @@ -1899,7 +1899,7 @@ musbotg_uninit(struct musbotg_softc *sc) musbotg_pull_down(sc); musbotg_clocks_off(sc); - mtx_unlock(&sc->sc_bus.mtx); + USB_BUS_UNLOCK(&sc->sc_bus); return; } @@ -1921,10 +1921,10 @@ musbotg_do_poll(struct usb2_bus *bus) { struct musbotg_softc *sc = MUSBOTG_BUS2SC(bus); - mtx_lock(&sc->sc_bus.mtx); + USB_BUS_LOCK(&sc->sc_bus); musbotg_interrupt_poll(sc); musbotg_root_ctrl_poll(sc); - mtx_unlock(&sc->sc_bus.mtx); + USB_BUS_UNLOCK(&sc->sc_bus); return; } @@ -2293,7 +2293,7 @@ musbotg_root_ctrl_done(struct usb2_xfer uint16_t index; uint8_t use_polling; - mtx_assert(&sc->sc_bus.mtx, MA_OWNED); + USB_BUS_LOCK_ASSERT(&sc->sc_bus, MA_OWNED); if (std->state != USB_SW_TR_SETUP) { if (std->state == USB_SW_TR_PRE_CALLBACK) { @@ -2309,7 +2309,7 @@ musbotg_root_ctrl_done(struct usb2_xfer value = UGETW(std->req.wValue); index = UGETW(std->req.wIndex); - use_polling = mtx_owned(xfer->priv_mtx) ? 1 : 0; + use_polling = mtx_owned(xfer->xfer_mtx) ? 1 : 0; /* demultiplex the control request */ Modified: head/sys/dev/usb2/controller/musb2_otg_atmelarm.c ============================================================================== --- head/sys/dev/usb2/controller/musb2_otg_atmelarm.c Mon Nov 10 18:24:11 2008 (r184823) +++ head/sys/dev/usb2/controller/musb2_otg_atmelarm.c Mon Nov 10 20:54:31 2008 (r184824) @@ -138,7 +138,7 @@ musbotg_attach(device_t dev) device_set_ivars(sc->sc_otg.sc_bus.bdev, &sc->sc_otg.sc_bus); err = usb2_config_td_setup(&sc->sc_otg.sc_config_td, sc, - &sc->sc_otg.sc_bus.mtx, NULL, 0, 4); + &sc->sc_otg.sc_bus.bus_mtx, NULL, 0, 4); if (err) { device_printf(dev, "could not setup config thread!\n"); goto error; Modified: head/sys/dev/usb2/controller/ohci2.c ============================================================================== --- head/sys/dev/usb2/controller/ohci2.c Mon Nov 10 18:24:11 2008 (r184823) +++ head/sys/dev/usb2/controller/ohci2.c Mon Nov 10 20:54:31 2008 (r184824) @@ -173,7 +173,7 @@ ohci_controller_init(ohci_softc_t *sc) DPRINTF("SMM active, request owner change\n"); OWRITE4(sc, OHCI_COMMAND_STATUS, OHCI_OCR); for (i = 0; (i < 100) && (ctl & OHCI_IR); i++) { - usb2_pause_mtx(&sc->sc_bus.mtx, 1); + usb2_pause_mtx(&sc->sc_bus.bus_mtx, 1); ctl = OREAD4(sc, OHCI_CONTROL); } if (ctl & OHCI_IR) { @@ -186,7 +186,7 @@ ohci_controller_init(ohci_softc_t *sc) DPRINTF("cold started\n"); reset: /* controller was cold started */ - usb2_pause_mtx(&sc->sc_bus.mtx, + usb2_pause_mtx(&sc->sc_bus.bus_mtx, USB_BUS_RESET_DELAY); } @@ -197,7 +197,7 @@ reset: DPRINTF("%s: resetting\n", device_get_nameunit(sc->sc_bus.bdev)); OWRITE4(sc, OHCI_CONTROL, OHCI_HCFS_RESET); - usb2_pause_mtx(&sc->sc_bus.mtx, + usb2_pause_mtx(&sc->sc_bus.bus_mtx, USB_BUS_RESET_DELAY); /* we now own the host controller and the bus has been reset */ @@ -260,7 +260,7 @@ reset: desca = OREAD4(sc, OHCI_RH_DESCRIPTOR_A); OWRITE4(sc, OHCI_RH_DESCRIPTOR_A, desca | OHCI_NOCP); OWRITE4(sc, OHCI_RH_STATUS, OHCI_LPSC); /* Enable port power */ - usb2_pause_mtx(&sc->sc_bus.mtx, + usb2_pause_mtx(&sc->sc_bus.bus_mtx, OHCI_ENABLE_POWER_DELAY); OWRITE4(sc, OHCI_RH_DESCRIPTOR_A, desca); @@ -270,7 +270,7 @@ reset: */ sc->sc_noport = 0; for (i = 0; (i < 10) && (sc->sc_noport == 0); i++) { - usb2_pause_mtx(&sc->sc_bus.mtx, + usb2_pause_mtx(&sc->sc_bus.bus_mtx, OHCI_READ_DESC_DELAY); sc->sc_noport = OHCI_GET_NDP(OREAD4(sc, OHCI_RH_DESCRIPTOR_A)); } @@ -309,7 +309,7 @@ ohci_init(ohci_softc_t *sc) uint16_t x; uint16_t y; - mtx_lock(&sc->sc_bus.mtx); + USB_BUS_LOCK(&sc->sc_bus); DPRINTF("start\n"); @@ -391,7 +391,7 @@ ohci_init(ohci_softc_t *sc) /* set up the bus struct */ sc->sc_bus.methods = &ohci_bus_methods; - usb2_callout_init_mtx(&sc->sc_tmo_rhsc, &sc->sc_bus.mtx, + usb2_callout_init_mtx(&sc->sc_tmo_rhsc, &sc->sc_bus.bus_mtx, CALLOUT_RETURNUNLOCKED); #if USB_DEBUG @@ -408,10 +408,10 @@ ohci_init(ohci_softc_t *sc) sc->sc_bus.usbrev = USB_REV_1_0; if (ohci_controller_init(sc)) { - mtx_unlock(&sc->sc_bus.mtx); + USB_BUS_UNLOCK(&sc->sc_bus); return (USB_ERR_INVAL); } else { - mtx_unlock(&sc->sc_bus.mtx); + USB_BUS_UNLOCK(&sc->sc_bus); /* catch any lost interrupts */ ohci_do_poll(&sc->sc_bus); return (USB_ERR_NORMAL_COMPLETION); @@ -424,7 +424,7 @@ ohci_init(ohci_softc_t *sc) void ohci_detach(struct ohci_softc *sc) { - mtx_lock(&sc->sc_bus.mtx); + USB_BUS_LOCK(&sc->sc_bus); usb2_callout_stop(&sc->sc_tmo_rhsc); @@ -432,9 +432,9 @@ ohci_detach(struct ohci_softc *sc) OWRITE4(sc, OHCI_CONTROL, OHCI_HCFS_RESET); /* XXX let stray task complete */ - usb2_pause_mtx(&sc->sc_bus.mtx, 50); + usb2_pause_mtx(&sc->sc_bus.bus_mtx, 50); - mtx_unlock(&sc->sc_bus.mtx); + USB_BUS_UNLOCK(&sc->sc_bus); usb2_callout_drain(&sc->sc_tmo_rhsc); @@ -449,7 +449,7 @@ ohci_suspend(ohci_softc_t *sc) { uint32_t ctl; - mtx_lock(&sc->sc_bus.mtx); + USB_BUS_LOCK(&sc->sc_bus); #if USB_DEBUG DPRINTF("\n"); @@ -470,10 +470,10 @@ ohci_suspend(ohci_softc_t *sc) ctl |= OHCI_HCFS_SUSPEND; OWRITE4(sc, OHCI_CONTROL, ctl); - usb2_pause_mtx(&sc->sc_bus.mtx, + usb2_pause_mtx(&sc->sc_bus.bus_mtx, USB_RESUME_WAIT); - mtx_unlock(&sc->sc_bus.mtx); + USB_BUS_UNLOCK(&sc->sc_bus); return; } @@ -482,7 +482,7 @@ ohci_resume(ohci_softc_t *sc) { uint32_t ctl; - mtx_lock(&sc->sc_bus.mtx); + USB_BUS_LOCK(&sc->sc_bus); #if USB_DEBUG DPRINTF("\n"); @@ -503,13 +503,13 @@ ohci_resume(ohci_softc_t *sc) ctl = OREAD4(sc, OHCI_CONTROL); ctl |= OHCI_HCFS_RESUME; OWRITE4(sc, OHCI_CONTROL, ctl); - usb2_pause_mtx(&sc->sc_bus.mtx, USB_RESUME_DELAY); + usb2_pause_mtx(&sc->sc_bus.bus_mtx, USB_RESUME_DELAY); ctl = (ctl & ~OHCI_HCFS_MASK) | OHCI_HCFS_OPERATIONAL; OWRITE4(sc, OHCI_CONTROL, ctl); - usb2_pause_mtx(&sc->sc_bus.mtx, USB_RESUME_RECOVERY); + usb2_pause_mtx(&sc->sc_bus.bus_mtx, USB_RESUME_RECOVERY); sc->sc_control = sc->sc_intre = 0; - mtx_unlock(&sc->sc_bus.mtx); + USB_BUS_UNLOCK(&sc->sc_bus); /* catch any lost interrupts */ ohci_do_poll(&sc->sc_bus); @@ -699,7 +699,7 @@ _ohci_append_qh(ohci_ed_t *sed, uint32_t { DPRINTFN(11, "%p to %p\n", sed, last); - /* (sc->sc_bus.mtx) must be locked */ + /* (sc->sc_bus.bus_mtx) must be locked */ sed->next = last->next; sed->ed_next = last->ed_next; @@ -728,7 +728,7 @@ _ohci_remove_qh(ohci_ed_t *sed, ohci_ed_ { DPRINTFN(11, "%p from %p\n", sed, last); - /* (sc->sc_bus.mtx) must be locked */ + /* (sc->sc_bus.bus_mtx) must be locked */ /* only remove if not removed from a queue */ if (sed->prev) { @@ -1099,7 +1099,7 @@ ohci_rhsc_enable(ohci_softc_t *sc) { DPRINTFN(5, "\n"); - mtx_assert(&sc->sc_bus.mtx, MA_OWNED); + USB_BUS_LOCK_ASSERT(&sc->sc_bus, MA_OWNED); sc->sc_eintrs |= OHCI_RHSC; OWRITE4(sc, OHCI_INTERRUPT_ENABLE, OHCI_RHSC); @@ -1110,7 +1110,7 @@ ohci_rhsc_enable(ohci_softc_t *sc) usb2_sw_transfer(&sc->sc_root_intr, &ohci_root_intr_done); - mtx_unlock(&sc->sc_bus.mtx); + USB_BUS_UNLOCK(&sc->sc_bus); return; } @@ -1146,7 +1146,7 @@ ohci_interrupt(ohci_softc_t *sc) uint32_t status; uint32_t done; - mtx_lock(&sc->sc_bus.mtx); + USB_BUS_LOCK(&sc->sc_bus); hcca = ohci_get_hcca(sc); @@ -1246,7 +1246,7 @@ ohci_interrupt(ohci_softc_t *sc) ohci_interrupt_poll(sc); done: - mtx_unlock(&sc->sc_bus.mtx); + USB_BUS_UNLOCK(&sc->sc_bus); return; } @@ -1261,12 +1261,12 @@ ohci_timeout(void *arg) DPRINTF("xfer=%p\n", xfer); - mtx_assert(&sc->sc_bus.mtx, MA_OWNED); + USB_BUS_LOCK_ASSERT(&sc->sc_bus, MA_OWNED); /* transfer is transferred */ ohci_device_done(xfer, USB_ERR_TIMEOUT); - mtx_unlock(&sc->sc_bus.mtx); + USB_BUS_UNLOCK(&sc->sc_bus); return; } @@ -1276,10 +1276,10 @@ ohci_do_poll(struct usb2_bus *bus) { struct ohci_softc *sc = OHCI_BUS2SC(bus); - mtx_lock(&sc->sc_bus.mtx); + USB_BUS_LOCK(&sc->sc_bus); ohci_interrupt_poll(sc); ohci_root_ctrl_poll(sc); - mtx_unlock(&sc->sc_bus.mtx); + USB_BUS_UNLOCK(&sc->sc_bus); return; } @@ -1617,7 +1617,7 @@ ohci_root_intr_done(struct usb2_xfer *xf uint16_t i; uint16_t m; - mtx_assert(&sc->sc_bus.mtx, MA_OWNED); + USB_BUS_LOCK_ASSERT(&sc->sc_bus, MA_OWNED); if (std->state != USB_SW_TR_PRE_DATA) { if (std->state == USB_SW_TR_PRE_CALLBACK) { @@ -1663,7 +1663,7 @@ ohci_device_done(struct usb2_xfer *xfer, ohci_softc_t *sc = xfer->usb2_sc; ohci_ed_t *ed; - mtx_assert(&sc->sc_bus.mtx, MA_OWNED); + USB_BUS_LOCK_ASSERT(&sc->sc_bus, MA_OWNED); DPRINTFN(2, "xfer=%p, pipe=%p, error=%d\n", @@ -2198,7 +2198,7 @@ ohci_root_ctrl_done(struct usb2_xfer *xf uint8_t l; uint8_t use_polling; - mtx_assert(&sc->sc_bus.mtx, MA_OWNED); + USB_BUS_LOCK_ASSERT(&sc->sc_bus, MA_OWNED); if (std->state != USB_SW_TR_SETUP) { if (std->state == USB_SW_TR_PRE_CALLBACK) { @@ -2214,7 +2214,7 @@ ohci_root_ctrl_done(struct usb2_xfer *xf value = UGETW(std->req.wValue); index = UGETW(std->req.wIndex); - use_polling = mtx_owned(xfer->priv_mtx) ? 1 : 0; + use_polling = mtx_owned(xfer->xfer_mtx) ? 1 : 0; DPRINTFN(3, "type=0x%02x request=0x%02x wLen=0x%04x " "wValue=0x%04x wIndex=0x%04x\n", @@ -2375,7 +2375,7 @@ ohci_root_ctrl_done(struct usb2_xfer *xf /* enable RHSC interrupt if condition is cleared. */ if ((OREAD4(sc, port) >> 16) == 0) { ohci_rhsc_enable(sc); - mtx_lock(&sc->sc_bus.mtx); + USB_BUS_LOCK(&sc->sc_bus); } break; default: @@ -2456,7 +2456,7 @@ ohci_root_ctrl_done(struct usb2_xfer *xf /* polling */ DELAY(USB_PORT_ROOT_RESET_DELAY * 1000); } else { - usb2_pause_mtx(&sc->sc_bus.mtx, + usb2_pause_mtx(&sc->sc_bus.bus_mtx, USB_PORT_ROOT_RESET_DELAY); } Modified: head/sys/dev/usb2/controller/ohci2_atmelarm.c ============================================================================== --- head/sys/dev/usb2/controller/ohci2_atmelarm.c Mon Nov 10 18:24:11 2008 (r184823) +++ head/sys/dev/usb2/controller/ohci2_atmelarm.c Mon Nov 10 20:54:31 2008 (r184824) @@ -111,7 +111,7 @@ ohci_atmelarm_attach(device_t dev) strlcpy(sc->sc_ohci.sc_vendor, "Atmel", sizeof(sc->sc_ohci.sc_vendor)); err = usb2_config_td_setup(&sc->sc_ohci.sc_config_td, sc, - &sc->sc_ohci.sc_bus.mtx, NULL, 0, 4); + &sc->sc_ohci.sc_bus.bus_mtx, NULL, 0, 4); if (err) { device_printf(dev, "could not setup config thread!\n"); goto error; Modified: head/sys/dev/usb2/controller/ohci2_pci.c ============================================================================== --- head/sys/dev/usb2/controller/ohci2_pci.c Mon Nov 10 18:24:11 2008 (r184823) +++ head/sys/dev/usb2/controller/ohci2_pci.c Mon Nov 10 20:54:31 2008 (r184824) @@ -280,7 +280,7 @@ ohci_pci_attach(device_t self) sprintf(sc->sc_vendor, "(0x%04x)", pci_get_vendor(self)); } - err = usb2_config_td_setup(&sc->sc_config_td, sc, &sc->sc_bus.mtx, + err = usb2_config_td_setup(&sc->sc_config_td, sc, &sc->sc_bus.bus_mtx, NULL, 0, 4); if (err) { device_printf(self, "could not setup config thread!\n"); Modified: head/sys/dev/usb2/controller/uhci2.c ============================================================================== --- head/sys/dev/usb2/controller/uhci2.c Mon Nov 10 18:24:11 2008 (r184823) +++ head/sys/dev/usb2/controller/uhci2.c Mon Nov 10 20:54:31 2008 (r184824) @@ -265,7 +265,7 @@ uhci_reset(uhci_softc_t *sc) struct usb2_page_search buf_res; uint16_t n; - mtx_assert(&sc->sc_bus.mtx, MA_OWNED); + USB_BUS_LOCK_ASSERT(&sc->sc_bus, MA_OWNED); DPRINTF("resetting the HC\n"); @@ -279,7 +279,7 @@ uhci_reset(uhci_softc_t *sc) /* wait */ - usb2_pause_mtx(&sc->sc_bus.mtx, + usb2_pause_mtx(&sc->sc_bus.bus_mtx, USB_BUS_RESET_DELAY); /* terminate all transfers */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Mon Nov 10 22:06:24 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4D8E7106564A; Mon, 10 Nov 2008 22:06:24 +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 38BCD8FC23; Mon, 10 Nov 2008 22:06:24 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mAAM6OGO083615; Mon, 10 Nov 2008 22:06:24 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mAAM6Otj083614; Mon, 10 Nov 2008 22:06:24 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200811102206.mAAM6Otj083614@svn.freebsd.org> From: Robert Watson Date: Mon, 10 Nov 2008 22:06: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: r184825 - head/sys/security/audit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Nov 2008 22:06:24 -0000 Author: rwatson Date: Mon Nov 10 22:06:24 2008 New Revision: 184825 URL: http://svn.freebsd.org/changeset/base/184825 Log: Wrap sx locking of the audit worker sleep lock in macros, update comments. MFC after: 2 months Sponsored by: Apple, Inc. Modified: head/sys/security/audit/audit_worker.c Modified: head/sys/security/audit/audit_worker.c ============================================================================== --- head/sys/security/audit/audit_worker.c Mon Nov 10 20:54:31 2008 (r184824) +++ head/sys/security/audit/audit_worker.c Mon Nov 10 22:06:24 2008 (r184825) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 1999-2005 Apple Inc. + * Copyright (c) 1999-2008 Apple Inc. * Copyright (c) 2006-2008 Robert N. M. Watson * All rights reserved. * @@ -78,17 +78,24 @@ static struct proc *audit_thread; /* * audit_cred and audit_vp are the stored credential and vnode to use for - * active audit trail. They are protected by audit_worker_sx, which will be - * held across all I/O and all rotation to prevent them from being replaced - * (rotated) while in use. The audit_file_rotate_wait flag is set when the - * kernel has delivered a trigger to auditd to rotate the trail, and is - * cleared when the next rotation takes place. It is also protected by - * audit_worker_sx. + * active audit trail. They are protected by the audit worker lock, which + * will be held across all I/O and all rotation to prevent them from being + * replaced (rotated) while in use. The audit_file_rotate_wait flag is set + * when the kernel has delivered a trigger to auditd to rotate the trail, and + * is cleared when the next rotation takes place. It is also protected by + * the audit worker lock. */ static int audit_file_rotate_wait; -static struct sx audit_worker_sx; static struct ucred *audit_cred; static struct vnode *audit_vp; +static struct sx audit_worker_lock; + +#define AUDIT_WORKER_LOCK_INIT() sx_init(&audit_worker_lock, \ + "audit_worker_lock"); +#define AUDIT_WORKER_LOCK_ASSERT() sx_assert(&audit_worker_lock, \ + SA_XLOCKED) +#define AUDIT_WORKER_LOCK() sx_xlock(&audit_worker_lock) +#define AUDIT_WORKER_UNLOCK() sx_xunlock(&audit_worker_lock) /* * Write an audit record to a file, performed as the last stage after both @@ -111,7 +118,7 @@ audit_record_write(struct vnode *vp, str struct vattr vattr; long temp; - sx_assert(&audit_worker_sx, SA_LOCKED); /* audit_file_rotate_wait. */ + AUDIT_WORKER_LOCK_ASSERT(); if (vp == NULL) return; @@ -191,7 +198,7 @@ audit_record_write(struct vnode *vp, str */ if ((audit_fstat.af_filesz != 0) && (audit_file_rotate_wait == 0) && (vattr.va_size >= audit_fstat.af_filesz)) { - sx_assert(&audit_worker_sx, SA_XLOCKED); + AUDIT_WORKER_LOCK_ASSERT(); audit_file_rotate_wait = 1; (void)audit_send_trigger(AUDIT_TRIGGER_ROTATE_KERNEL); @@ -300,20 +307,20 @@ audit_worker_process_record(struct kaudi au_event_t event; au_id_t auid; int error, sorf; - int trail_locked; + int locked; /* - * We hold the audit_worker_sx lock over both writes, if there are - * two, so that the two records won't be split across a rotation and - * end up in two different trail files. + * We hold the audit worker lock over both writes, if there are two, + * so that the two records won't be split across a rotation and end + * up in two different trail files. */ if (((ar->k_ar_commit & AR_COMMIT_USER) && (ar->k_ar_commit & AR_PRESELECT_USER_TRAIL)) || (ar->k_ar_commit & AR_PRESELECT_TRAIL)) { - sx_xlock(&audit_worker_sx); - trail_locked = 1; + AUDIT_WORKER_LOCK(); + locked = 1; } else - trail_locked = 0; + locked = 0; /* * First, handle the user record, if any: commit to the system trail @@ -321,7 +328,7 @@ audit_worker_process_record(struct kaudi */ if ((ar->k_ar_commit & AR_COMMIT_USER) && (ar->k_ar_commit & AR_PRESELECT_USER_TRAIL)) { - sx_assert(&audit_worker_sx, SA_XLOCKED); + AUDIT_WORKER_LOCK_ASSERT(); audit_record_write(audit_vp, audit_cred, ar->k_udata, ar->k_ulen); } @@ -360,7 +367,7 @@ audit_worker_process_record(struct kaudi } if (ar->k_ar_commit & AR_PRESELECT_TRAIL) { - sx_assert(&audit_worker_sx, SA_XLOCKED); + AUDIT_WORKER_LOCK_ASSERT(); audit_record_write(audit_vp, audit_cred, bsm->data, bsm->len); } @@ -371,8 +378,8 @@ audit_worker_process_record(struct kaudi kau_free(bsm); out: - if (trail_locked) - sx_xunlock(&audit_worker_sx); + if (locked) + AUDIT_WORKER_UNLOCK(); } /* @@ -453,14 +460,14 @@ audit_rotate_vnode(struct ucred *cred, s * Rotate the vnode/cred, and clear the rotate flag so that we will * send a rotate trigger if the new file fills. */ - sx_xlock(&audit_worker_sx); + AUDIT_WORKER_LOCK(); old_audit_cred = audit_cred; old_audit_vp = audit_vp; audit_cred = cred; audit_vp = vp; audit_file_rotate_wait = 0; audit_enabled = (audit_vp != NULL); - sx_xunlock(&audit_worker_sx); + AUDIT_WORKER_UNLOCK(); /* * If there was an old vnode/credential, close and free. @@ -479,7 +486,7 @@ audit_worker_init(void) { int error; - sx_init(&audit_worker_sx, "audit_worker_sx"); + AUDIT_WORKER_LOCK_INIT(); error = kproc_create(audit_worker, NULL, &audit_thread, RFHIGHPID, 0, "audit"); if (error) From owner-svn-src-head@FreeBSD.ORG Mon Nov 10 23:18:10 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 790931065674; Mon, 10 Nov 2008 23:18: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 6909B8FC0A; Mon, 10 Nov 2008 23:18:10 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mAANIAQb084973; Mon, 10 Nov 2008 23:18:10 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mAANIAlH084972; Mon, 10 Nov 2008 23:18:10 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200811102318.mAANIAlH084972@svn.freebsd.org> From: Andrew Thompson Date: Mon, 10 Nov 2008 23:18: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: r184827 - head/sys/dev/usb2/controller X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Nov 2008 23:18:10 -0000 Author: thompsa Date: Mon Nov 10 23:18:10 2008 New Revision: 184827 URL: http://svn.freebsd.org/changeset/base/184827 Log: Add missing USB_BUS_LOCK* change from r184824. Modified: head/sys/dev/usb2/controller/musb2_otg.c Modified: head/sys/dev/usb2/controller/musb2_otg.c ============================================================================== --- head/sys/dev/usb2/controller/musb2_otg.c Mon Nov 10 22:40:16 2008 (r184826) +++ head/sys/dev/usb2/controller/musb2_otg.c Mon Nov 10 23:18:10 2008 (r184827) @@ -1493,7 +1493,7 @@ done: static void musbotg_device_done(struct usb2_xfer *xfer, usb2_error_t error) { - mtx_assert(xfer->usb2_mtx, MA_OWNED); + USB_BUS_LOCK_ASSERT(xfer->udev->bus, MA_OWNED); DPRINTFN(2, "xfer=%p, pipe=%p, error=%d\n", xfer, xfer->pipe, error); From owner-svn-src-head@FreeBSD.ORG Mon Nov 10 23:26:52 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6DBD71065670; Mon, 10 Nov 2008 23:26:52 +0000 (UTC) (envelope-from peter@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5E6C58FC14; Mon, 10 Nov 2008 23:26:52 +0000 (UTC) (envelope-from peter@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mAANQqan085164; Mon, 10 Nov 2008 23:26:52 GMT (envelope-from peter@svn.freebsd.org) Received: (from peter@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mAANQqEJ085163; Mon, 10 Nov 2008 23:26:52 GMT (envelope-from peter@svn.freebsd.org) Message-Id: <200811102326.mAANQqEJ085163@svn.freebsd.org> From: Peter Wemm Date: Mon, 10 Nov 2008 23:26: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: r184828 - head/sys/compat/freebsd32 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Nov 2008 23:26:52 -0000 Author: peter Date: Mon Nov 10 23:26:52 2008 New Revision: 184828 URL: http://svn.freebsd.org/changeset/base/184828 Log: Fix a signal emulation bug introduced in r163018 (and present in 7.x). This prevents 32 bit signal handlers from finding out what the faulting address is. Both the secret 4th argument and siginfo->si_addr are zero. Modified: head/sys/compat/freebsd32/freebsd32_misc.c Modified: head/sys/compat/freebsd32/freebsd32_misc.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_misc.c Mon Nov 10 23:18:10 2008 (r184827) +++ head/sys/compat/freebsd32/freebsd32_misc.c Mon Nov 10 23:26:52 2008 (r184828) @@ -2442,7 +2442,7 @@ siginfo_to_siginfo32(siginfo_t *src, str dst->si_pid = src->si_pid; dst->si_uid = src->si_uid; dst->si_status = src->si_status; - dst->si_addr = dst->si_addr; + dst->si_addr = src->si_addr; dst->si_value.sigval_int = src->si_value.sival_int; dst->si_timerid = src->si_timerid; dst->si_overrun = src->si_overrun; From owner-svn-src-head@FreeBSD.ORG Mon Nov 10 23:36:20 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B49E21065690; Mon, 10 Nov 2008 23:36:20 +0000 (UTC) (envelope-from peter@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A556F8FC0A; Mon, 10 Nov 2008 23:36:20 +0000 (UTC) (envelope-from peter@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mAANaKAi085369; Mon, 10 Nov 2008 23:36:20 GMT (envelope-from peter@svn.freebsd.org) Received: (from peter@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mAANaKgZ085368; Mon, 10 Nov 2008 23:36:20 GMT (envelope-from peter@svn.freebsd.org) Message-Id: <200811102336.mAANaKgZ085368@svn.freebsd.org> From: Peter Wemm Date: Mon, 10 Nov 2008 23:36: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: r184829 - head/sys/compat/freebsd32 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Nov 2008 23:36:20 -0000 Author: peter Date: Mon Nov 10 23:36:20 2008 New Revision: 184829 URL: http://svn.freebsd.org/changeset/base/184829 Log: Sigh. Fix a pointer/int compile error. Modified: head/sys/compat/freebsd32/freebsd32_misc.c Modified: head/sys/compat/freebsd32/freebsd32_misc.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_misc.c Mon Nov 10 23:26:52 2008 (r184828) +++ head/sys/compat/freebsd32/freebsd32_misc.c Mon Nov 10 23:36:20 2008 (r184829) @@ -2442,7 +2442,7 @@ siginfo_to_siginfo32(siginfo_t *src, str dst->si_pid = src->si_pid; dst->si_uid = src->si_uid; dst->si_status = src->si_status; - dst->si_addr = src->si_addr; + dst->si_addr = (uintptr_t)src->si_addr; dst->si_value.sigval_int = src->si_value.sival_int; dst->si_timerid = src->si_timerid; dst->si_overrun = src->si_overrun; From owner-svn-src-head@FreeBSD.ORG Tue Nov 11 00:14:11 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4F59810656BB; Tue, 11 Nov 2008 00:14:11 +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 29E5E8FC1A; Tue, 11 Nov 2008 00:14:11 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mAB0EBcu086215; Tue, 11 Nov 2008 00:14:11 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mAB0EBVH086214; Tue, 11 Nov 2008 00:14:11 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <200811110014.mAB0EBVH086214@svn.freebsd.org> From: Jung-uk Kim Date: Tue, 11 Nov 2008 00:14: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: r184830 - head/sys/dev/ispfw X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Nov 2008 00:14:11 -0000 Author: jkim Date: Tue Nov 11 00:14:10 2008 New Revision: 184830 URL: http://svn.freebsd.org/changeset/base/184830 Log: Make ispfw(4) play nice with individual firmware modules. - Do not let individual KLD module unregister firmware image loaded by ispfw or vice versa. - Make 'kldunload ispfw' actually unregister all firmware images loaded by ispfw, not just 'isp_1040'. - Print which KLD module actually loaded the firmware image. - Remove unused return value from do_load_fw() and do_unload_fw() and remove duplicate sys/param.h while I am here. Modified: head/sys/dev/ispfw/ispfw.c Modified: head/sys/dev/ispfw/ispfw.c ============================================================================== --- head/sys/dev/ispfw/ispfw.c Mon Nov 10 23:36:20 2008 (r184829) +++ head/sys/dev/ispfw/ispfw.c Tue Nov 11 00:14:10 2008 (r184830) @@ -30,14 +30,16 @@ __FBSDID("$FreeBSD$"); #include +#include #include +#include #include -#include #include -#include -#include #if defined(ISP_ALL) || !defined(KLD_MODULE) +#ifdef __sparc64__ +#define ISP_1000 1 +#endif #define ISP_1040 1 #define ISP_1040_IT 1 #define ISP_1080 1 @@ -49,12 +51,19 @@ __FBSDID("$FreeBSD$"); #define ISP_2300 1 #define ISP_2322 1 #define ISP_2400 1 -#ifdef __sparc64__ -#define ISP_1000 1 #endif + +#ifndef MODULE_NAME #define MODULE_NAME "ispfw" #endif +#if defined(ISP_1000) +#ifdef __sparc64__ +#include +#else +#error "firmware not compatible with this platform" +#endif +#endif #if defined(ISP_1040) || defined(ISP_1040_IT) #include #endif @@ -79,27 +88,75 @@ __FBSDID("$FreeBSD$"); #if defined(ISP_2400) #include #endif + #if defined(ISP_1000) -#include +static int isp_1000_loaded; +#endif +#if defined(ISP_1040) +static int isp_1040_loaded; +#endif +#if defined(ISP_1040_IT) +static int isp_1040_it_loaded; +#endif +#if defined(ISP_1080) +static int isp_1080_loaded; +#endif +#if defined(ISP_1080_IT) +static int isp_1080_it_loaded; +#endif +#if defined(ISP_12160) +static int isp_12160_loaded; +#endif +#if defined(ISP_12160_IT) +static int isp_12160_it_loaded; +#endif +#if defined(ISP_2100) +static int isp_2100_loaded; +#endif +#if defined(ISP_2200) +static int isp_2200_loaded; +#endif +#if defined(ISP_2300) +static int isp_2300_loaded; +#endif +#if defined(ISP_2322) +static int isp_2322_loaded; +#endif +#if defined(ISP_2400) +static int isp_2400_loaded; #endif #define ISPFW_VERSION 1 -#define RMACRO(token) \ +#define RMACRO(token) do { \ + if (token##_loaded) \ + break; \ if (firmware_register(#token, token##_risc_code, \ - token##_risc_code [3] * sizeof token##_risc_code [3], \ + token##_risc_code[3] * sizeof(token##_risc_code[3]), \ ISPFW_VERSION, NULL) == NULL) { \ - printf("unable to register firmware '%s'\n", #token); \ - } else { \ - printf("registered firmware set <%s>\n", #token); \ - } + printf("%s: unable to register firmware <%s>\n", \ + MODULE_NAME, #token); \ + break; \ + } \ + token##_loaded++; \ + printf("%s: registered firmware <%s>\n", MODULE_NAME, #token); \ +} while (0) -#define UMACRO(token) \ - firmware_unregister(#token); \ - printf("unregistered firmware set <%s>\n", #token); +#define UMACRO(token) do { \ + if (!token##_loaded) \ + break; \ + if (firmware_unregister(#token) != 0) { \ + printf("%s: unable to unregister firmware <%s>\n", \ + MODULE_NAME, #token); \ + break; \ + } \ + token##_loaded--; \ + printf("%s: unregistered firmware <%s>\n", MODULE_NAME, #token);\ +} while (0) -static int +static void do_load_fw(void) { + #if defined(ISP_1000) RMACRO(isp_1000); #endif @@ -136,64 +193,74 @@ do_load_fw(void) #if defined(ISP_2400) RMACRO(isp_2400); #endif - return (0); } -static int +static void do_unload_fw(void) { + #if defined(ISP_1000) UMACRO(isp_1000); -#elif defined(ISP_1040) +#endif +#if defined(ISP_1040) UMACRO(isp_1040); -#elif defined(ISP_1040_IT) +#endif +#if defined(ISP_1040_IT) UMACRO(isp_1040_it); -#elif defined(ISP_1080) +#endif +#if defined(ISP_1080) UMACRO(isp_1080); -#elif defined(ISP_1080_IT) +#endif +#if defined(ISP_1080_IT) UMACRO(isp_1080_it); -#elif defined(ISP_12160) +#endif +#if defined(ISP_12160) UMACRO(isp_12160); -#elif defined(ISP_12160_IT) +#endif +#if defined(ISP_12160_IT) UMACRO(isp_12160_it); -#elif defined(ISP_2100) +#endif +#if defined(ISP_2100) UMACRO(isp_2100); -#elif defined(ISP_2200) +#endif +#if defined(ISP_2200) UMACRO(isp_2200); -#elif defined(ISP_2300) +#endif +#if defined(ISP_2300) UMACRO(isp_2300); -#elif defined(ISP_2322) +#endif +#if defined(ISP_2322) UMACRO(isp_2322); -#elif defined(ISP_2400) +#endif +#if defined(ISP_2400) UMACRO(isp_2400); #endif - return (0); } static int module_handler(module_t mod, int what, void *arg) { - int r; + switch (what) { case MOD_LOAD: - r = do_load_fw(); + do_load_fw(); break; case MOD_UNLOAD: - r = do_unload_fw(); + do_unload_fw(); break; - default: - r = EOPNOTSUPP; + case MOD_SHUTDOWN: break; + default: + return (EOPNOTSUPP); } - return (r); + return (0); } static moduledata_t ispfw_mod = { MODULE_NAME, module_handler, NULL }; -#ifndef KLD_MODULE -DECLARE_MODULE(isp, ispfw_mod, SI_SUB_DRIVERS, SI_ORDER_THIRD); -#else -#if defined(ISP_1000) +#if defined(ISP_ALL) || !defined(KLD_MODULE) +DECLARE_MODULE(ispfw, ispfw_mod, SI_SUB_DRIVERS, SI_ORDER_THIRD); +#elif defined(ISP_1000) DECLARE_MODULE(isp_1000, ispfw_mod, SI_SUB_DRIVERS, SI_ORDER_THIRD); #elif defined(ISP_1040) DECLARE_MODULE(isp_1040, ispfw_mod, SI_SUB_DRIVERS, SI_ORDER_THIRD); @@ -217,5 +284,6 @@ DECLARE_MODULE(isp_2300, ispfw_mod, SI_S DECLARE_MODULE(isp_2322, ispfw_mod, SI_SUB_DRIVERS, SI_ORDER_THIRD); #elif defined(ISP_2400) DECLARE_MODULE(isp_2400, ispfw_mod, SI_SUB_DRIVERS, SI_ORDER_THIRD); -#endif +#else +#error "firmware not specified" #endif From owner-svn-src-head@FreeBSD.ORG Tue Nov 11 00:32:56 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 396101065674; Tue, 11 Nov 2008 00:32:56 +0000 (UTC) (envelope-from scf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2B6FB8FC1A; Tue, 11 Nov 2008 00:32:56 +0000 (UTC) (envelope-from scf@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mAB0Wuv0086597; Tue, 11 Nov 2008 00:32:56 GMT (envelope-from scf@svn.freebsd.org) Received: (from scf@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mAB0WupL086596; Tue, 11 Nov 2008 00:32:56 GMT (envelope-from scf@svn.freebsd.org) Message-Id: <200811110032.mAB0WupL086596@svn.freebsd.org> From: Sean Farley Date: Tue, 11 Nov 2008 00:32: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: r184831 - head/lib/libutil X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Nov 2008 00:32:56 -0000 Author: scf Date: Tue Nov 11 00:32:55 2008 New Revision: 184831 URL: http://svn.freebsd.org/changeset/base/184831 Log: style(9) fixes. MFC after: 1 week Modified: head/lib/libutil/gr_util.c Modified: head/lib/libutil/gr_util.c ============================================================================== --- head/lib/libutil/gr_util.c Tue Nov 11 00:14:10 2008 (r184830) +++ head/lib/libutil/gr_util.c Tue Nov 11 00:32:55 2008 (r184831) @@ -28,29 +28,27 @@ __FBSDID("$FreeBSD$"); #include + #include #include +#include #include #include #include #include -#include - - static const char GroupLineFormat[] = "%s:%s:%ju:"; - /* * Compares two struct group's. */ int gr_equal(const struct group *gr1, const struct group *gr2) { - bool found; - bool equal; int gr1Ndx; int gr2Ndx; + bool equal; + bool found; /* Check that the non-member information is the same. */ equal = strcmp(gr1->gr_name, gr2->gr_name) == 0 && @@ -81,7 +79,6 @@ gr_equal(const struct group *gr1, const return (equal); } - /* * Make a group line out of a struct group. */ @@ -89,8 +86,8 @@ char * gr_make(const struct group *gr) { char *line; - int ndx; size_t lineSize; + int ndx; /* Calculate the length of the group line. */ lineSize = snprintf(NULL, 0, GroupLineFormat, gr->gr_name, @@ -114,17 +111,16 @@ gr_make(const struct group *gr) return (line); } - /* * Duplicate a struct group. */ struct group * gr_dup(const struct group *gr) { - int ndx; - int numMem; size_t len; struct group *ngr; + int ndx; + int numMem; /* Calculate size of group. */ len = sizeof(*gr) + @@ -134,7 +130,7 @@ gr_dup(const struct group *gr) if (gr->gr_mem != NULL) { for (; gr->gr_mem[numMem] != NULL; numMem++) len += strlen(gr->gr_mem[numMem]) + 1; - len += (numMem + 1) * sizeof(*(gr->gr_mem)); + len += (numMem + 1) * sizeof(*gr->gr_mem); } /* Create new group and copy old group into it. */ @@ -152,7 +148,7 @@ gr_dup(const struct group *gr) } if (gr->gr_mem != NULL) { ngr->gr_mem = (char **)((char *)ngr + len); - len += (numMem + 1) * sizeof(*(ngr->gr_mem)); + len += (numMem + 1) * sizeof(*ngr->gr_mem); for (ndx = 0; gr->gr_mem[ndx] != NULL; ndx++) { ngr->gr_mem[ndx] = (char *)ngr + len; len += sprintf(ngr->gr_mem[ndx], "%s", @@ -164,7 +160,6 @@ gr_dup(const struct group *gr) return (ngr); } - /* * Scan a line and place it into a group structure. */ @@ -180,14 +175,14 @@ __gr_scan(char *line, struct group *gr) return (false); *loc = '\0'; gr->gr_passwd = loc + 1; - if (*(gr->gr_passwd) == ':') - *(gr->gr_passwd) = '\0'; + if (*gr->gr_passwd == ':') + *gr->gr_passwd = '\0'; else { if ((loc = strchr(loc + 1, ':')) == NULL) return (false); *loc = '\0'; } - if (sscanf(loc + 1, "%u", &(gr->gr_gid)) != 1) + if (sscanf(loc + 1, "%u", &gr->gr_gid) != 1) return (false); /* Assign member information to structure. */ @@ -199,7 +194,7 @@ __gr_scan(char *line, struct group *gr) ndx = 0; do { if ((gr->gr_mem = reallocf(gr->gr_mem, - sizeof(*(gr->gr_mem)) * (ndx + 1))) == NULL) + sizeof(*gr->gr_mem) * (ndx + 1))) == NULL) return (false); gr->gr_mem[ndx] = strsep(&line, ","); } while (gr->gr_mem[ndx++] != NULL); @@ -208,16 +203,15 @@ __gr_scan(char *line, struct group *gr) return (true); } - /* * Create a struct group from a line. */ struct group * gr_scan(const char *line) { + struct group gr; char *lineCopy; struct group *newGr; - struct group gr; if ((lineCopy = strdup(line)) == NULL) return (NULL); From owner-svn-src-head@FreeBSD.ORG Tue Nov 11 01:32:13 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EA356106567C; Tue, 11 Nov 2008 01:32:13 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id C7B538FC14; Tue, 11 Nov 2008 01:32:13 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from fledge.watson.org (fledge.watson.org [65.122.17.41]) by cyrus.watson.org (Postfix) with ESMTP id 41E7A46B0C; Mon, 10 Nov 2008 20:32:13 -0500 (EST) Date: Tue, 11 Nov 2008 01:32:13 +0000 (GMT) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Ed Schouten In-Reply-To: <200811091045.mA9AjDDq037323@svn.freebsd.org> Message-ID: References: <200811091045.mA9AjDDq037323@svn.freebsd.org> User-Agent: Alpine 1.10 (BSF 962 2008-03-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r184789 - in head: lib/libc/amd64/sys lib/libc/arm/sys lib/libc/i386/sys lib/libc/ia64/sys lib/libc/mips/sys lib/libc/powerpc/sys lib/libc/sparc64/sys sys/amd64/linux32 sys/compat/freeb... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Nov 2008 01:32:14 -0000 On Sun, 9 Nov 2008, Ed Schouten wrote: > Modified: head/sys/sys/priv.h > ============================================================================== > --- head/sys/sys/priv.h Sun Nov 9 09:24:01 2008 (r184788) > +++ head/sys/sys/priv.h Sun Nov 9 10:45:13 2008 (r184789) > @@ -84,7 +84,6 @@ > #define PRIV_CLOCK_SETTIME 17 /* Can call clock_settime. */ > #define PRIV_SETTIMEOFDAY 18 /* Can call settimeofday. */ > #define PRIV_SETHOSTID 19 /* Can call sethostid. */ > -#define PRIV_SETDOMAINNAME 20 /* Can call setdomainname. */ Because kernel modules and applications may have been compiled with a specific understanding of what privilege '20' is, I think it would be a good idea to leave a placeholder name here to discourage reallocation of the same privilege number to a new privilege. For example: #define _PRIV_SETDOMAINNAME 20 /* Removed. */ This would help prevent future accidents, and we might want to add a note along those lines to the comments in priv.h. Robert N M Watson Computer Laboratory University of Cambridge From owner-svn-src-head@FreeBSD.ORG Tue Nov 11 02:13:22 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 334EE1065674; Tue, 11 Nov 2008 02:13:22 +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 24DA78FC17; Tue, 11 Nov 2008 02:13:22 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mAB2DMat088313; Tue, 11 Nov 2008 02:13:22 GMT (envelope-from sobomax@svn.freebsd.org) Received: (from sobomax@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mAB2DMFw088312; Tue, 11 Nov 2008 02:13:22 GMT (envelope-from sobomax@svn.freebsd.org) Message-Id: <200811110213.mAB2DMFw088312@svn.freebsd.org> From: Maxim Sobolev Date: Tue, 11 Nov 2008 02:13:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184832 - head/usr.sbin/mergemaster X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Nov 2008 02:13:22 -0000 Author: sobomax Date: Tue Nov 11 02:13:21 2008 New Revision: 184832 URL: http://svn.freebsd.org/changeset/base/184832 Log: No need to run rm ${COMPFILE} after mm_install() - mm_install() does it for us. Modified: head/usr.sbin/mergemaster/mergemaster.sh Modified: head/usr.sbin/mergemaster/mergemaster.sh ============================================================================== --- head/usr.sbin/mergemaster/mergemaster.sh Tue Nov 11 00:32:55 2008 (r184831) +++ head/usr.sbin/mergemaster/mergemaster.sh Tue Nov 11 02:13:21 2008 (r184832) @@ -960,7 +960,6 @@ for COMPFILE in `find . -type f -size +0 if mm_install "${COMPFILE}"; then echo " *** ${COMPFILE} upgraded successfully" echo '' - rm "${COMPFILE}" else echo " *** Problem upgrading ${COMPFILE}, it will remain to merge by hand" fi From owner-svn-src-head@FreeBSD.ORG Tue Nov 11 03:36:15 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DB22A1065673; Tue, 11 Nov 2008 03:36:15 +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 C68908FC14; Tue, 11 Nov 2008 03:36:15 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mAB3aF8g090034; Tue, 11 Nov 2008 03:36:15 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mAB3aFEN090033; Tue, 11 Nov 2008 03:36:15 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200811110336.mAB3aFEN090033@svn.freebsd.org> From: Andrew Thompson Date: Tue, 11 Nov 2008 03:36: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: r184833 - head/sys/dev/if_ndis X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Nov 2008 03:36:16 -0000 Author: thompsa Date: Tue Nov 11 03:36:15 2008 New Revision: 184833 URL: http://svn.freebsd.org/changeset/base/184833 Log: Fake the assoc id so that ndis can work on the latest net80211. PR: kern/128750 Submitted by: Paul B. Mahol Modified: head/sys/dev/if_ndis/if_ndis.c Modified: head/sys/dev/if_ndis/if_ndis.c ============================================================================== --- head/sys/dev/if_ndis/if_ndis.c Tue Nov 11 02:13:21 2008 (r184832) +++ head/sys/dev/if_ndis/if_ndis.c Tue Nov 11 03:36:15 2008 (r184833) @@ -2591,6 +2591,10 @@ ndis_get_assoc(sc, assoc) struct ndis_softc *sc; ndis_wlan_bssid_ex **assoc; { + struct ifnet *ifp = sc->ifp; + struct ieee80211com *ic = ifp->if_l2com; + struct ieee80211vap *vap; + struct ieee80211_node *ni; ndis_80211_bssid_list_ex *bl; ndis_wlan_bssid_ex *bs; ndis_80211_macaddr bssid; @@ -2606,6 +2610,9 @@ ndis_get_assoc(sc, assoc) return(ENOENT); } + vap = TAILQ_FIRST(&ic->ic_vaps); + ni = vap->iv_bss; + len = sizeof(uint32_t) + (sizeof(ndis_wlan_bssid_ex) * 16); bl = malloc(len, M_TEMP, M_NOWAIT | M_ZERO); if (bl == NULL) @@ -2636,8 +2643,10 @@ ndis_get_assoc(sc, assoc) } bcopy((char *)bs, (char *)*assoc, bs->nwbx_len); free(bl, M_TEMP); + if (ic->ic_opmode == IEEE80211_M_STA) + ni->ni_associd = 1 | 0xc000; /* fake associd */ return(0); - } + } bs = (ndis_wlan_bssid_ex *)((char *)bs + bs->nwbx_len); } From owner-svn-src-head@FreeBSD.ORG Tue Nov 11 09:40:28 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 56A581065672; Tue, 11 Nov 2008 09:40:28 +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 2AD5A8FC0C; Tue, 11 Nov 2008 09:40:28 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mAB9eS65096380; Tue, 11 Nov 2008 09:40:28 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mAB9eS23096379; Tue, 11 Nov 2008 09:40:28 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200811110940.mAB9eS23096379@svn.freebsd.org> From: Kip Macy Date: Tue, 11 Nov 2008 09:40:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184837 - head/sys/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Nov 2008 09:40:28 -0000 Author: kmacy Date: Tue Nov 11 09:40:27 2008 New Revision: 184837 URL: http://svn.freebsd.org/changeset/base/184837 Log: - Use RTFREE_LOCKED macro - Don't clone route on lookup (was causing arpresolve to fail) - u_int_32 -> uint32_t Reviewed by: qingli MFC after: 3 days Modified: head/sys/net/radix_mpath.c Modified: head/sys/net/radix_mpath.c ============================================================================== --- head/sys/net/radix_mpath.c Tue Nov 11 08:42:59 2008 (r184836) +++ head/sys/net/radix_mpath.c Tue Nov 11 09:40:27 2008 (r184837) @@ -54,7 +54,7 @@ __FBSDID("$FreeBSD$"); /* * give some jitter to hash, to avoid synchronization between routers */ -static u_int32_t hashjitter; +static uint32_t hashjitter; int rn_mpath_capable(struct radix_node_head *rnh) @@ -267,7 +267,7 @@ rtalloc_mpath_fib(struct route *ro, u_in */ if (ro->ro_rt && ro->ro_rt->rt_ifp && (ro->ro_rt->rt_flags & RTF_UP)) return; /* XXX */ - ro->ro_rt = rtalloc1_fib(&ro->ro_dst, 1, 0UL, fibnum); + ro->ro_rt = rtalloc1_fib(&ro->ro_dst, 1, RTF_CLONING, fibnum); /* if the route does not exist or it is not multipath, don't care */ if (ro->ro_rt == NULL) @@ -299,7 +299,7 @@ rtalloc_mpath_fib(struct route *ro, u_in return; } - rtfree(ro->ro_rt); + RTFREE_LOCKED(ro->ro_rt); ro->ro_rt = (struct rtentry *)rn; RT_LOCK(ro->ro_rt); RT_ADDREF(ro->ro_rt); From owner-svn-src-head@FreeBSD.ORG Tue Nov 11 12:25:08 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 78BAF1065698; Tue, 11 Nov 2008 12:25:08 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5A5868FC20; Tue, 11 Nov 2008 12:25:08 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mABCP8ne001611; Tue, 11 Nov 2008 12:25:08 GMT (envelope-from gallatin@svn.freebsd.org) Received: (from gallatin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mABCP8pN001610; Tue, 11 Nov 2008 12:25:08 GMT (envelope-from gallatin@svn.freebsd.org) Message-Id: <200811111225.mABCP8pN001610@svn.freebsd.org> From: Andrew Gallatin Date: Tue, 11 Nov 2008 12: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: r184842 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Nov 2008 12:25:08 -0000 Author: gallatin Date: Tue Nov 11 12:25:08 2008 New Revision: 184842 URL: http://svn.freebsd.org/changeset/base/184842 Log: Avoid scheduling firmware taskqs when cold. This prevents a panic which occurs when a driver attempts to load firmware at boot via firmware_get() when the firmware module has not been preloaded. firmware_get() will enqueue a task using a struct taskqueue allocated on the stack, and the machine will crash much later in the firmware taskq thread when taskqs are started and the struct taskqueue is garbage. Not objected to by: sam Modified: head/sys/kern/subr_firmware.c Modified: head/sys/kern/subr_firmware.c ============================================================================== --- head/sys/kern/subr_firmware.c Tue Nov 11 12:01:40 2008 (r184841) +++ head/sys/kern/subr_firmware.c Tue Nov 11 12:25:08 2008 (r184842) @@ -325,9 +325,13 @@ firmware_get(const char *imagename) * may do filesystem i/o which requires root & current dirs, etc. * Also we must not hold any mtx's over this call which is problematic. */ - TASK_INIT(&fwload_task, 0, loadimage, __DECONST(void *, imagename)); - taskqueue_enqueue(firmware_tq, &fwload_task); - msleep(__DECONST(void *, imagename), &firmware_mtx, 0, "fwload", 0); + if (!cold) { + TASK_INIT(&fwload_task, 0, loadimage, __DECONST(void *, + imagename)); + taskqueue_enqueue(firmware_tq, &fwload_task); + msleep(__DECONST(void *, imagename), &firmware_mtx, 0, + "fwload", 0); + } /* * After attempting to load the module, see if the image is registered. */ From owner-svn-src-head@FreeBSD.ORG Tue Nov 11 14:55:59 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D0062106567F; Tue, 11 Nov 2008 14:55:59 +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 B88248FC1A; Tue, 11 Nov 2008 14:55:59 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mABEtxPo004636; Tue, 11 Nov 2008 14:55:59 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mABEtxRH004631; Tue, 11 Nov 2008 14:55:59 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200811111455.mABEtxRH004631@svn.freebsd.org> From: Ed Schouten Date: Tue, 11 Nov 2008 14:55: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: r184849 - in head: lib/libc/sys sys/amd64/linux32 sys/i386/linux sys/kern sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Nov 2008 14:55:59 -0000 Author: ed Date: Tue Nov 11 14:55:59 2008 New Revision: 184849 URL: http://svn.freebsd.org/changeset/base/184849 Log: Several cleanups related to pipe(2). - Use `fildes[2]' instead of `*fildes' to make more clear that pipe(2) fills an array with two descriptors. - Remove EFAULT from the manual page. Because of the current calling convention, pipe(2) raises a segmentation fault when an invalid address is passed. - Introduce kern_pipe() to make it easier for binary emulations to implement pipe(2). - Make Linux binary emulation use kern_pipe(), which means we don't have to recover td_retval after calling the FreeBSD system call. Approved by: rdivacky Discussed on: arch Modified: head/lib/libc/sys/pipe.2 head/sys/amd64/linux32/linux32_machdep.c head/sys/i386/linux/linux_machdep.c head/sys/kern/sys_pipe.c head/sys/sys/syscallsubr.h Modified: head/lib/libc/sys/pipe.2 ============================================================================== --- head/lib/libc/sys/pipe.2 Tue Nov 11 14:45:27 2008 (r184848) +++ head/lib/libc/sys/pipe.2 Tue Nov 11 14:55:59 2008 (r184849) @@ -39,7 +39,7 @@ .Sh SYNOPSIS .In unistd.h .Ft int -.Fn pipe "int *fildes" +.Fn pipe "int fildes[2]" .Sh DESCRIPTION The .Fn pipe @@ -96,11 +96,6 @@ Too many descriptors are active. The system file table is full. .It Bq Er ENOMEM Not enough kernel memory to establish a pipe. -.It Bq Er EFAULT -The -.Fa fildes -buffer is in an invalid area of the process's address -space. .El .Sh SEE ALSO .Xr sh 1 , Modified: head/sys/amd64/linux32/linux32_machdep.c ============================================================================== --- head/sys/amd64/linux32/linux32_machdep.c Tue Nov 11 14:45:27 2008 (r184848) +++ head/sys/amd64/linux32/linux32_machdep.c Tue Nov 11 14:55:59 2008 (r184849) @@ -977,33 +977,20 @@ linux_iopl(struct thread *td, struct lin int linux_pipe(struct thread *td, struct linux_pipe_args *args) { - int pip[2]; int error; - register_t reg_rdx; + int fildes[2]; #ifdef DEBUG if (ldebug(pipe)) printf(ARGS(pipe, "*")); #endif - reg_rdx = td->td_retval[1]; - error = pipe(td, 0); - if (error) { - td->td_retval[1] = reg_rdx; - return (error); - } - - pip[0] = td->td_retval[0]; - pip[1] = td->td_retval[1]; - error = copyout(pip, args->pipefds, 2 * sizeof(int)); - if (error) { - td->td_retval[1] = reg_rdx; + error = kern_pipe(td, fildes); + if (error) return (error); - } - td->td_retval[1] = reg_rdx; - td->td_retval[0] = 0; - return (0); + /* XXX: Close descriptors on error. */ + return (copyout(fildes, args->pipefds, sizeof fildes)); } int Modified: head/sys/i386/linux/linux_machdep.c ============================================================================== --- head/sys/i386/linux/linux_machdep.c Tue Nov 11 14:45:27 2008 (r184848) +++ head/sys/i386/linux/linux_machdep.c Tue Nov 11 14:55:59 2008 (r184849) @@ -813,29 +813,19 @@ int linux_pipe(struct thread *td, struct linux_pipe_args *args) { int error; - int reg_edx; + int fildes[2]; #ifdef DEBUG if (ldebug(pipe)) printf(ARGS(pipe, "*")); #endif - reg_edx = td->td_retval[1]; - error = pipe(td, 0); - if (error) { - td->td_retval[1] = reg_edx; - return (error); - } - - error = copyout(td->td_retval, args->pipefds, 2*sizeof(int)); - if (error) { - td->td_retval[1] = reg_edx; + error = kern_pipe(td, fildes); + if (error) return (error); - } - td->td_retval[1] = reg_edx; - td->td_retval[0] = 0; - return (0); + /* XXX: Close descriptors on error. */ + return (copyout(fildes, args->pipefds, sizeof fildes)); } int Modified: head/sys/kern/sys_pipe.c ============================================================================== --- head/sys/kern/sys_pipe.c Tue Nov 11 14:45:27 2008 (r184848) +++ head/sys/kern/sys_pipe.c Tue Nov 11 14:55:59 2008 (r184849) @@ -108,6 +108,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -307,13 +308,8 @@ pipe_zone_fini(void *mem, int size) * The pipe system call for the DTYPE_PIPE type of pipes. If we fail, let * the zone pick up the pieces via pipeclose(). */ -/* ARGSUSED */ int -pipe(td, uap) - struct thread *td; - struct pipe_args /* { - int dummy; - } */ *uap; +kern_pipe(struct thread *td, int fildes[2]) { struct filedesc *fdp = td->td_proc->p_fd; struct file *rf, *wf; @@ -357,7 +353,7 @@ pipe(td, uap) return (error); } /* An extra reference on `rf' has been held for us by falloc(). */ - td->td_retval[0] = fd; + fildes[0] = fd; /* * Warning: once we've gotten past allocation of the fd for the @@ -368,7 +364,7 @@ pipe(td, uap) finit(rf, FREAD | FWRITE, DTYPE_PIPE, rpipe, &pipeops); error = falloc(td, &wf, &fd); if (error) { - fdclose(fdp, rf, td->td_retval[0], td); + fdclose(fdp, rf, fildes[0], td); fdrop(rf, td); /* rpipe has been closed by fdrop(). */ pipeclose(wpipe); @@ -377,12 +373,29 @@ pipe(td, uap) /* An extra reference on `wf' has been held for us by falloc(). */ finit(wf, FREAD | FWRITE, DTYPE_PIPE, wpipe, &pipeops); fdrop(wf, td); - td->td_retval[1] = fd; + fildes[1] = fd; fdrop(rf, td); return (0); } +/* ARGSUSED */ +int +pipe(struct thread *td, struct pipe_args *uap) +{ + int error; + int fildes[2]; + + error = kern_pipe(td, fildes); + if (error) + return (error); + + td->td_retval[0] = fildes[0]; + td->td_retval[1] = fildes[1]; + + return (0); +} + /* * Allocate kva for pipe circular buffer, the space is pageable * This routine will 'realloc' the size of a pipe safely, if it fails Modified: head/sys/sys/syscallsubr.h ============================================================================== --- head/sys/sys/syscallsubr.h Tue Nov 11 14:45:27 2008 (r184848) +++ head/sys/sys/syscallsubr.h Tue Nov 11 14:55:59 2008 (r184849) @@ -142,6 +142,7 @@ int kern_openat(struct thread *td, int f enum uio_seg pathseg, int flags, int mode); int kern_pathconf(struct thread *td, char *path, enum uio_seg pathseg, int name); +int kern_pipe(struct thread *td, int fildes[2]); int kern_preadv(struct thread *td, int fd, struct uio *auio, off_t offset); int kern_ptrace(struct thread *td, int req, pid_t pid, void *addr, int data); From owner-svn-src-head@FreeBSD.ORG Tue Nov 11 17:10:25 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 345B3106567C; Tue, 11 Nov 2008 17:10:25 +0000 (UTC) (envelope-from dds@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 30B1E8FC22; Tue, 11 Nov 2008 17:10:25 +0000 (UTC) (envelope-from dds@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mABHAPdF007296; Tue, 11 Nov 2008 17:10:25 GMT (envelope-from dds@svn.freebsd.org) Received: (from dds@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mABHAPla007294; Tue, 11 Nov 2008 17:10:25 GMT (envelope-from dds@svn.freebsd.org) Message-Id: <200811111710.mABHAPla007294@svn.freebsd.org> From: Diomidis Spinellis Date: Tue, 11 Nov 2008 17:10: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: r184852 - head/tools/regression/usr.bin/sed X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Nov 2008 17:10:25 -0000 Author: dds Date: Tue Nov 11 17:10:24 2008 New Revision: 184852 URL: http://svn.freebsd.org/changeset/base/184852 Log: Add a test for the "or more" part of the following POSIX specification. "A function can be preceded by one or more '!' characters, in which case the function shall be applied if the addresses do not select the pattern space." Added: head/tools/regression/usr.bin/sed/regress.not.out (contents, props changed) Modified: head/tools/regression/usr.bin/sed/regress.sh Added: head/tools/regression/usr.bin/sed/regress.not.out ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/sed/regress.not.out Tue Nov 11 17:10:24 2008 (r184852) @@ -0,0 +1 @@ +foo Modified: head/tools/regression/usr.bin/sed/regress.sh ============================================================================== --- head/tools/regression/usr.bin/sed/regress.sh Tue Nov 11 15:51:45 2008 (r184851) +++ head/tools/regression/usr.bin/sed/regress.sh Tue Nov 11 17:10:24 2008 (r184852) @@ -2,7 +2,7 @@ REGRESSION_START($1) -echo '1..24' +echo '1..25' REGRESSION_TEST(`G', `sed G < regress.in') REGRESSION_TEST(`P', `sed P < regress.in') @@ -69,5 +69,6 @@ REGRESSION_TEST(`icase3', `sed s/SED/Foo REGRESSION_TEST(`hanoi', `echo ":abcd: : :" | sed -f hanoi.sed') REGRESSION_TEST(`math', `echo "4+7*3+2^7/3" | sed -f math.sed') +REGRESSION_TEST(`not', `echo foo | sed "1!!s/foo/bar/"') REGRESSION_END() From owner-svn-src-head@FreeBSD.ORG Tue Nov 11 17:15:57 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D8960106567D; Tue, 11 Nov 2008 17:15:57 +0000 (UTC) (envelope-from dds@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D63DF8FC26; Tue, 11 Nov 2008 17:15:57 +0000 (UTC) (envelope-from dds@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mABHFvbi007469; Tue, 11 Nov 2008 17:15:57 GMT (envelope-from dds@svn.freebsd.org) Received: (from dds@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mABHFvAB007468; Tue, 11 Nov 2008 17:15:57 GMT (envelope-from dds@svn.freebsd.org) Message-Id: <200811111715.mABHFvAB007468@svn.freebsd.org> From: Diomidis Spinellis Date: Tue, 11 Nov 2008 17:15: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: r184854 - head/usr.bin/sed X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Nov 2008 17:15:58 -0000 Author: dds Date: Tue Nov 11 17:15:57 2008 New Revision: 184854 URL: http://svn.freebsd.org/changeset/base/184854 Log: Fix the code to conform to the "or more" part of the following POSIX specification and regression test regress:25. "A function can be preceded by one or more '!' characters, in which case the function shall be applied if the addresses do not select the pattern space." MFC after: 2 weeks Modified: head/usr.bin/sed/compile.c Modified: head/usr.bin/sed/compile.c ============================================================================== --- head/usr.bin/sed/compile.c Tue Nov 11 17:12:26 2008 (r184853) +++ head/usr.bin/sed/compile.c Tue Nov 11 17:15:57 2008 (r184854) @@ -224,7 +224,7 @@ nonsel: /* Now parse the command */ case NONSEL: /* ! */ p++; EATSPACE(); - cmd->nonsel = ! cmd->nonsel; + cmd->nonsel = 1; goto nonsel; case GROUP: /* { */ p++; From owner-svn-src-head@FreeBSD.ORG Tue Nov 11 21:57:04 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 411FC106567C; Tue, 11 Nov 2008 21:57:04 +0000 (UTC) (envelope-from csjp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 256688FC12; Tue, 11 Nov 2008 21:57:04 +0000 (UTC) (envelope-from csjp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mABLv4s3012390; Tue, 11 Nov 2008 21:57:04 GMT (envelope-from csjp@svn.freebsd.org) Received: (from csjp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mABLv3aA012382; Tue, 11 Nov 2008 21:57:03 GMT (envelope-from csjp@svn.freebsd.org) Message-Id: <200811112157.mABLv3aA012382@svn.freebsd.org> From: "Christian S.J. Peron" Date: Tue, 11 Nov 2008 21:57:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184856 - in head/sys: bsm security/audit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Nov 2008 21:57:04 -0000 Author: csjp Date: Tue Nov 11 21:57:03 2008 New Revision: 184856 URL: http://svn.freebsd.org/changeset/base/184856 Log: Add support for extended header BSM tokens. Currently we use the regular header tokens. The extended header tokens contain an IP or IPv6 address which makes it possible to identify which host an audit record came from when audit records are centralized. If the host information has not been specified, the system will default to the old style headers. Otherwise, audit records that are created as a result of system calls will contain host information. This implemented has been designed to be consistent with the Solaris implementation. Host information is set/retrieved using the A_GETKAUDIT and A_SETKAUDIT auditon(2) commands. These commands require that a pointer to a auditinfo_addr_t object is passed. Currently only IP and IPv6 address families are supported. The users pace bits associated with this change will follow in an openbsm import. Reviewed by: rwatson, (sson, wsalamon (older version)) MFC after: 1 month Modified: head/sys/bsm/audit_internal.h head/sys/bsm/audit_record.h head/sys/security/audit/audit.c head/sys/security/audit/audit.h head/sys/security/audit/audit_bsm.c head/sys/security/audit/audit_bsm_token.c head/sys/security/audit/audit_private.h head/sys/security/audit/audit_syscalls.c Modified: head/sys/bsm/audit_internal.h ============================================================================== --- head/sys/bsm/audit_internal.h Tue Nov 11 17:51:38 2008 (r184855) +++ head/sys/bsm/audit_internal.h Tue Nov 11 21:57:03 2008 (r184856) @@ -72,7 +72,9 @@ typedef struct au_record au_record_t; * token structures may contain pointers of whose contents we do not know the * size (e.g text tokens). */ +#define AUDIT_HEADER_EX_SIZE(a) ((a)->ai_termid.at_type+18+sizeof(u_int32_t)) #define AUDIT_HEADER_SIZE 18 +#define MAX_AUDIT_HEADER_SIZE (5*sizeof(u_int32_t)+18) #define AUDIT_TRAILER_SIZE 7 /* Modified: head/sys/bsm/audit_record.h ============================================================================== --- head/sys/bsm/audit_record.h Tue Nov 11 17:51:38 2008 (r184855) +++ head/sys/bsm/audit_record.h Tue Nov 11 21:57:03 2008 (r184856) @@ -244,10 +244,13 @@ token_t *au_to_file(char *file, struct t token_t *au_to_header32_tm(int rec_size, au_event_t e_type, au_emod_t e_mod, struct timeval tm); +token_t *au_to_header32_ex_tm(int rec_size, au_event_t e_type, au_emod_t e_mod, + struct timeval tm, struct auditinfo_addr *aia); token_t *au_to_header64_tm(int rec_size, au_event_t e_type, au_emod_t e_mod, struct timeval tm); #if !defined(KERNEL) && !defined(_KERNEL) token_t *au_to_header(int rec_size, au_event_t e_type, au_emod_t e_mod); +token_t *au_to_header_ex(int rec_size, au_event_t e_type, au_emod_t e_mod); token_t *au_to_header32(int rec_size, au_event_t e_type, au_emod_t e_mod); token_t *au_to_header64(int rec_size, au_event_t e_type, au_emod_t e_mod); #endif Modified: head/sys/security/audit/audit.c ============================================================================== --- head/sys/security/audit/audit.c Tue Nov 11 17:51:38 2008 (r184855) +++ head/sys/security/audit/audit.c Tue Nov 11 21:57:03 2008 (r184856) @@ -158,6 +158,45 @@ struct cv audit_watermark_cv; static struct cv audit_fail_cv; /* + * Kernel audit information. This will store the current audit address + * or host information that the kernel will use when it's generating + * audit records. This data is modified by the A_GET{SET}KAUDIT auditon(2) + * command. + */ +static struct auditinfo_addr audit_kinfo; +static struct rwlock audit_kinfo_lock; + +#define KINFO_LOCK_INIT() rw_init(&audit_kinfo_lock, "kernel audit info lock") +#define KINFO_RLOCK() rw_rlock(&audit_kinfo_lock) +#define KINFO_WLOCK() rw_wlock(&audit_kinfo_lock) +#define KINFO_RUNLOCK() rw_runlock(&audit_kinfo_lock) +#define KINFO_WUNLOCK() rw_wunlock(&audit_kinfo_lock) + +void +audit_set_kinfo(struct auditinfo_addr *ak) +{ + + KASSERT(ak->ai_termid.at_type == AU_IPv4 || + ak->ai_termid.at_type == AU_IPv6, + ("audit_set_kinfo: invalid address type")); + KINFO_WLOCK(); + audit_kinfo = *ak; + KINFO_WUNLOCK(); +} + +void +audit_get_kinfo(struct auditinfo_addr *ak) +{ + + KASSERT(audit_kinfo.ai_termid.at_type == AU_IPv4 || + audit_kinfo.ai_termid.at_type == AU_IPv6, + ("audit_set_kinfo: invalid address type")); + KINFO_RLOCK(); + *ak = audit_kinfo; + KINFO_RUNLOCK(); +} + +/* * Construct an audit record for the passed thread. */ static int @@ -241,7 +280,11 @@ audit_init(void) audit_qctrl.aq_bufsz = AQ_BUFSZ; audit_qctrl.aq_minfree = AU_FS_MINFREE; + audit_kinfo.ai_termid.at_type = AU_IPv4; + audit_kinfo.ai_termid.at_addr[0] = INADDR_ANY; + mtx_init(&audit_mtx, "audit_mtx", NULL, MTX_DEF); + KINFO_LOCK_INIT(); cv_init(&audit_worker_cv, "audit_worker_cv"); cv_init(&audit_watermark_cv, "audit_watermark_cv"); cv_init(&audit_fail_cv, "audit_fail_cv"); Modified: head/sys/security/audit/audit.h ============================================================================== --- head/sys/security/audit/audit.h Tue Nov 11 17:51:38 2008 (r184855) +++ head/sys/security/audit/audit.h Tue Nov 11 21:57:03 2008 (r184856) @@ -180,6 +180,8 @@ void audit_cred_proc1(struct ucred *cre void audit_proc_coredump(struct thread *td, char *path, int errcode); void audit_thread_alloc(struct thread *td); void audit_thread_free(struct thread *td); +void audit_set_kinfo(struct auditinfo_addr *); +void audit_get_kinfo(struct auditinfo_addr *); /* * Define a macro to wrap the audit_arg_* calls by checking the global Modified: head/sys/security/audit/audit_bsm.c ============================================================================== --- head/sys/security/audit/audit_bsm.c Tue Nov 11 17:51:38 2008 (r184855) +++ head/sys/security/audit/audit_bsm.c Tue Nov 11 21:57:03 2008 (r184856) @@ -113,13 +113,34 @@ kau_close(struct au_record *rec, struct size_t tot_rec_size; token_t *cur, *hdr, *trail; struct timeval tm; - - tot_rec_size = rec->len + AUDIT_HEADER_SIZE + AUDIT_TRAILER_SIZE; + size_t hdrsize; + struct auditinfo_addr ak; + struct in6_addr *ap; + + audit_get_kinfo(&ak); + hdrsize = 0; + switch (ak.ai_termid.at_type) { + case AU_IPv4: + hdrsize = (ak.ai_termid.at_addr[0] == INADDR_ANY) ? + AUDIT_HEADER_SIZE : AUDIT_HEADER_EX_SIZE(&ak); + break; + case AU_IPv6: + ap = (struct in6_addr *)&ak.ai_termid.at_addr[0]; + hdrsize = (IN6_IS_ADDR_UNSPECIFIED(ap)) ? AUDIT_HEADER_SIZE : + AUDIT_HEADER_EX_SIZE(&ak); + break; + default: + panic("kau_close: invalid address family"); + } + tot_rec_size = rec->len + hdrsize + AUDIT_TRAILER_SIZE; rec->data = malloc(tot_rec_size, M_AUDITBSM, M_WAITOK | M_ZERO); tm.tv_usec = ctime->tv_nsec / 1000; tm.tv_sec = ctime->tv_sec; - hdr = au_to_header32_tm(tot_rec_size, event, 0, tm); + if (hdrsize != AUDIT_HEADER_SIZE) + hdr = au_to_header32_ex_tm(tot_rec_size, event, 0, tm, &ak); + else + hdr = au_to_header32_tm(tot_rec_size, event, 0, tm); TAILQ_INSERT_HEAD(&rec->token_q, hdr, tokens); trail = au_to_trailer(tot_rec_size); Modified: head/sys/security/audit/audit_bsm_token.c ============================================================================== --- head/sys/security/audit/audit_bsm_token.c Tue Nov 11 17:51:38 2008 (r184855) +++ head/sys/security/audit/audit_bsm_token.c Tue Nov 11 21:57:03 2008 (r184856) @@ -1292,6 +1292,51 @@ au_to_exec_env(char **envp) /* * token ID 1 byte * record byte count 4 bytes + * version # 1 byte + * event type 2 bytes + * event modifier 2 bytes + * address type/length 4 bytes + * machine address 4 bytes/16 bytes (IPv4/IPv6 address) + * seconds of time 4 bytes/8 bytes (32/64-bits) + * milliseconds of time 4 bytes/8 bytes (32/64-bits) + */ +token_t * +au_to_header32_ex_tm(int rec_size, au_event_t e_type, au_emod_t e_mod, + struct timeval tm, struct auditinfo_addr *aia) +{ + token_t *t; + u_char *dptr = NULL; + u_int32_t timems; + struct au_tid_addr *tid; + + tid = &aia->ai_termid; + KASSERT(tid->at_type == AU_IPv4 || tid->at_type == AU_IPv6, + ("au_to_header32_ex_tm: invalid address family")); + + GET_TOKEN_AREA(t, dptr, sizeof(u_char) + sizeof(u_int32_t) + + sizeof(u_char) + 2 * sizeof(u_int16_t) + 3 * sizeof(u_int32_t) + + tid->at_type); + + ADD_U_CHAR(dptr, AUT_HEADER32_EX); + ADD_U_INT32(dptr, rec_size); + ADD_U_CHAR(dptr, AUDIT_HEADER_VERSION_OPENBSM); + ADD_U_INT16(dptr, e_type); + ADD_U_INT16(dptr, e_mod); + ADD_U_INT32(dptr, tid->at_type); + if (tid->at_type == AU_IPv6) + ADD_MEM(dptr, &tid->at_addr[0], 4 * sizeof(u_int32_t)); + else + ADD_MEM(dptr, &tid->at_addr[0], sizeof(u_int32_t)); + timems = tm.tv_usec / 1000; + /* Add the timestamp */ + ADD_U_INT32(dptr, tm.tv_sec); + ADD_U_INT32(dptr, timems); /* We need time in ms. */ + return (t); +} + +/* + * token ID 1 byte + * record byte count 4 bytes * version # 1 byte [2] * event type 2 bytes * event modifier 2 bytes Modified: head/sys/security/audit/audit_private.h ============================================================================== --- head/sys/security/audit/audit_private.h Tue Nov 11 17:51:38 2008 (r184855) +++ head/sys/security/audit/audit_private.h Tue Nov 11 21:57:03 2008 (r184856) @@ -132,6 +132,7 @@ union auditon_udata { au_qctrl_t au_qctrl; au_stat_t au_stat; au_fstat_t au_fstat; + auditinfo_addr_t au_kau_info; }; struct posix_ipc_perm { Modified: head/sys/security/audit/audit_syscalls.c ============================================================================== --- head/sys/security/audit/audit_syscalls.c Tue Nov 11 17:51:38 2008 (r184855) +++ head/sys/security/audit/audit_syscalls.c Tue Nov 11 21:57:03 2008 (r184856) @@ -395,11 +395,14 @@ auditon(struct thread *td, struct audito break; case A_GETKAUDIT: - return (ENOSYS); + audit_get_kinfo(&udata.au_kau_info); break; case A_SETKAUDIT: - return (ENOSYS); + if (udata.au_kau_info.ai_termid.at_type != AU_IPv4 && + udata.au_kau_info.ai_termid.at_type != AU_IPv6) + return (EINVAL); + audit_set_kinfo(&udata.au_kau_info); break; case A_SENDTRIGGER: From owner-svn-src-head@FreeBSD.ORG Tue Nov 11 22:59:41 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7A8C41065677; Tue, 11 Nov 2008 22:59:41 +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 6367B8FC13; Tue, 11 Nov 2008 22:59:41 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mABMxfYK013555; Tue, 11 Nov 2008 22:59:41 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mABMxf15013554; Tue, 11 Nov 2008 22:59:41 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200811112259.mABMxf15013554@svn.freebsd.org> From: Robert Watson Date: Tue, 11 Nov 2008 22:59: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: r184857 - head/sys/security/audit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Nov 2008 22:59:41 -0000 Author: rwatson Date: Tue Nov 11 22:59:40 2008 New Revision: 184857 URL: http://svn.freebsd.org/changeset/base/184857 Log: Minor style tweaks and change lock name string to use _'s and not spaces to improve parseability. Modified: head/sys/security/audit/audit.c Modified: head/sys/security/audit/audit.c ============================================================================== --- head/sys/security/audit/audit.c Tue Nov 11 21:57:03 2008 (r184856) +++ head/sys/security/audit/audit.c Tue Nov 11 22:59:40 2008 (r184857) @@ -166,7 +166,8 @@ static struct cv audit_fail_cv; static struct auditinfo_addr audit_kinfo; static struct rwlock audit_kinfo_lock; -#define KINFO_LOCK_INIT() rw_init(&audit_kinfo_lock, "kernel audit info lock") +#define KINFO_LOCK_INIT() rw_init(&audit_kinfo_lock, \ + "audit_kinfo_lock") #define KINFO_RLOCK() rw_rlock(&audit_kinfo_lock) #define KINFO_WLOCK() rw_wlock(&audit_kinfo_lock) #define KINFO_RUNLOCK() rw_runlock(&audit_kinfo_lock) @@ -179,6 +180,7 @@ audit_set_kinfo(struct auditinfo_addr *a KASSERT(ak->ai_termid.at_type == AU_IPv4 || ak->ai_termid.at_type == AU_IPv6, ("audit_set_kinfo: invalid address type")); + KINFO_WLOCK(); audit_kinfo = *ak; KINFO_WUNLOCK(); @@ -191,6 +193,7 @@ audit_get_kinfo(struct auditinfo_addr *a KASSERT(audit_kinfo.ai_termid.at_type == AU_IPv4 || audit_kinfo.ai_termid.at_type == AU_IPv6, ("audit_set_kinfo: invalid address type")); + KINFO_RLOCK(); *ak = audit_kinfo; KINFO_RUNLOCK(); From owner-svn-src-head@FreeBSD.ORG Tue Nov 11 23:08:20 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 526D61065670; Tue, 11 Nov 2008 23:08:20 +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 3C2248FC14; Tue, 11 Nov 2008 23:08:20 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mABN8Kim013749; Tue, 11 Nov 2008 23:08:20 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mABN8KMx013747; Tue, 11 Nov 2008 23:08:20 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200811112308.mABN8KMx013747@svn.freebsd.org> From: Robert Watson Date: Tue, 11 Nov 2008 23:08: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: r184858 - head/sys/security/audit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Nov 2008 23:08:20 -0000 Author: rwatson Date: Tue Nov 11 23:08:20 2008 New Revision: 184858 URL: http://svn.freebsd.org/changeset/base/184858 Log: Move audit-internal function definitions for getting and setting audit kinfo state to audit_private.h. Modified: head/sys/security/audit/audit.h head/sys/security/audit/audit_private.h Modified: head/sys/security/audit/audit.h ============================================================================== --- head/sys/security/audit/audit.h Tue Nov 11 22:59:40 2008 (r184857) +++ head/sys/security/audit/audit.h Tue Nov 11 23:08:20 2008 (r184858) @@ -180,8 +180,6 @@ void audit_cred_proc1(struct ucred *cre void audit_proc_coredump(struct thread *td, char *path, int errcode); void audit_thread_alloc(struct thread *td); void audit_thread_free(struct thread *td); -void audit_set_kinfo(struct auditinfo_addr *); -void audit_get_kinfo(struct auditinfo_addr *); /* * Define a macro to wrap the audit_arg_* calls by checking the global Modified: head/sys/security/audit/audit_private.h ============================================================================== --- head/sys/security/audit/audit_private.h Tue Nov 11 22:59:40 2008 (r184857) +++ head/sys/security/audit/audit_private.h Tue Nov 11 23:08:20 2008 (r184858) @@ -319,6 +319,12 @@ void audit_trigger_init(void); int audit_send_trigger(unsigned int trigger); /* + * Accessor functions to manage global audit state. + */ +void audit_set_kinfo(struct auditinfo_addr *); +void audit_get_kinfo(struct auditinfo_addr *); + +/* * General audit related functions. */ struct kaudit_record *currecord(void); From owner-svn-src-head@FreeBSD.ORG Wed Nov 12 04:43:55 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 752991065672; Wed, 12 Nov 2008 04:43:55 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6E1658FC0A; Wed, 12 Nov 2008 04:43:55 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mAC4htma020179; Wed, 12 Nov 2008 04:43:55 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mAC4htRu020178; Wed, 12 Nov 2008 04:43:55 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <200811120443.mAC4htRu020178@svn.freebsd.org> From: "David E. O'Brien" Date: Wed, 12 Nov 2008 04:43: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: r184860 - head X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Nov 2008 04:43:55 -0000 Author: obrien Date: Wed Nov 12 04:43:55 2008 New Revision: 184860 URL: http://svn.freebsd.org/changeset/base/184860 Log: Add the kerberos5 libs to the install32 target. (we've been building the all along, but never installing them) Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Wed Nov 12 01:22:25 2008 (r184859) +++ head/Makefile.inc1 Wed Nov 12 04:43:55 2008 (r184860) @@ -506,6 +506,9 @@ distribute32 install32: .if ${MK_CRYPT} != "no" cd ${.CURDIR}/secure/lib; ${LIB32IMAKE} ${.TARGET:S/32$//} .endif +.if ${MK_KERBEROS} != "no" + cd ${.CURDIR}/kerberos5/lib; ${LIB32IMAKE} ${.TARGET:S/32$//} +.endif cd ${.CURDIR}/libexec/rtld-elf; \ PROG=ld-elf32.so.1 ${LIB32IMAKE} ${.TARGET:S/32$//} cd ${.CURDIR}/usr.bin/ldd; PROG=ldd32 ${LIB32IMAKE} ${.TARGET:S/32$//} From owner-svn-src-head@FreeBSD.ORG Wed Nov 12 04:45:09 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B50B81065672; Wed, 12 Nov 2008 04:45:09 +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 A00708FC18; Wed, 12 Nov 2008 04:45:09 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mAC4j9Jv020264; Wed, 12 Nov 2008 04:45:09 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mAC4j9d5020259; Wed, 12 Nov 2008 04:45:09 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200811120445.mAC4j9d5020259@svn.freebsd.org> From: Kip Macy Date: Wed, 12 Nov 2008 04:45: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: r184861 - in head/sys/dev/cxgb: common ulp/tom X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Nov 2008 04:45:09 -0000 Author: kmacy Date: Wed Nov 12 04:45:09 2008 New Revision: 184861 URL: http://svn.freebsd.org/changeset/base/184861 Log: Update firmware version check make ddp a tunable Obtained from: Chelsio Inc. MFC after: 3 days Modified: head/sys/dev/cxgb/common/cxgb_ctl_defs.h head/sys/dev/cxgb/common/cxgb_t3_hw.c head/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c head/sys/dev/cxgb/ulp/tom/cxgb_tom.c head/sys/dev/cxgb/ulp/tom/cxgb_tom_sysctl.c Modified: head/sys/dev/cxgb/common/cxgb_ctl_defs.h ============================================================================== --- head/sys/dev/cxgb/common/cxgb_ctl_defs.h Wed Nov 12 04:43:55 2008 (r184860) +++ head/sys/dev/cxgb/common/cxgb_ctl_defs.h Wed Nov 12 04:45:09 2008 (r184861) @@ -85,7 +85,7 @@ struct ddp_params { struct adap_ports { unsigned int nports; /* number of ports on this adapter */ - struct net_device *lldevs[2]; + struct net_device *lldevs[MAX_NPORTS]; }; /* Modified: head/sys/dev/cxgb/common/cxgb_t3_hw.c ============================================================================== --- head/sys/dev/cxgb/common/cxgb_t3_hw.c Wed Nov 12 04:43:55 2008 (r184860) +++ head/sys/dev/cxgb/common/cxgb_t3_hw.c Wed Nov 12 04:45:09 2008 (r184861) @@ -740,7 +740,8 @@ enum { SF_ERASE_SECTOR = 0xd8, /* erase sector */ FW_FLASH_BOOT_ADDR = 0x70000, /* start address of FW in flash */ - FW_VERS_ADDR = 0x77ffc, /* flash address holding FW version */ + OLD_FW_VERS_ADDR = 0x77ffc, /* flash address holding FW version */ + FW_VERS_ADDR = 0x7fffc, /* flash address holding FW version */ FW_MIN_SIZE = 8, /* at least version and csum */ FW_MAX_SIZE = FW_VERS_ADDR - FW_FLASH_BOOT_ADDR, @@ -1027,7 +1028,12 @@ enum fw_version_type { */ int t3_get_fw_version(adapter_t *adapter, u32 *vers) { - return t3_read_flash(adapter, FW_VERS_ADDR, 1, vers, 0); + int ret = t3_read_flash(adapter, FW_VERS_ADDR, 1, vers, 0); + + if (!ret && *vers != 0xffffffff) + return 0; + else + return t3_read_flash(adapter, OLD_FW_VERS_ADDR, 1, vers, 0); } /** Modified: head/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c ============================================================================== --- head/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c Wed Nov 12 04:43:55 2008 (r184860) +++ head/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c Wed Nov 12 04:45:09 2008 (r184861) @@ -3449,9 +3449,7 @@ process_pass_accept_req(struct socket *s V_TF_DDP_OFF(1) | TP_DDP_TIMER_WORKAROUND_VAL, 1); } else - printf("not offloading\n"); - - + DPRINTF("no DDP\n"); return; reject: Modified: head/sys/dev/cxgb/ulp/tom/cxgb_tom.c ============================================================================== --- head/sys/dev/cxgb/ulp/tom/cxgb_tom.c Wed Nov 12 04:43:55 2008 (r184860) +++ head/sys/dev/cxgb/ulp/tom/cxgb_tom.c Wed Nov 12 04:45:09 2008 (r184861) @@ -46,7 +46,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include @@ -90,13 +89,6 @@ __FBSDID("$FreeBSD$"); #include -static int activated = 1; -TUNABLE_INT("hw.t3toe.activated", &activated); -SYSCTL_NODE(_hw, OID_AUTO, t3toe, CTLFLAG_RD, 0, "T3 toe driver parameters"); -SYSCTL_UINT(_hw_t3toe, OID_AUTO, activated, CTLFLAG_RDTUN, &activated, 0, - "enable TOE at init time"); - - TAILQ_HEAD(, adapter) adapter_list; static struct rwlock adapter_list_lock; @@ -938,7 +930,7 @@ do_act_establish(struct t3cdev *dev, str } else { log(LOG_ERR, "%s: received clientless CPL command 0x%x\n", - dev->name, CPL_PASS_ACCEPT_REQ); + dev->name, CPL_ACT_ESTABLISH); return CPL_RET_BUF_DONE | CPL_RET_BAD_MSG; } } @@ -1360,8 +1352,6 @@ t3_toe_attach(struct toedev *dev, const t3_init_tunables(t); mtx_init(&t->listen_lock, "tom data listeners", NULL, MTX_DEF); CTR2(KTR_TOM, "t3_toe_attach dev=%p entry=%p", dev, entry); - /* Adjust TOE activation for this module */ - t->conf.activated = activated; dev->tod_can_offload = can_offload; dev->tod_connect = t3_connect; Modified: head/sys/dev/cxgb/ulp/tom/cxgb_tom_sysctl.c ============================================================================== --- head/sys/dev/cxgb/ulp/tom/cxgb_tom_sysctl.c Wed Nov 12 04:43:55 2008 (r184860) +++ head/sys/dev/cxgb/ulp/tom/cxgb_tom_sysctl.c Wed Nov 12 04:45:09 2008 (r184861) @@ -76,6 +76,10 @@ __FBSDID("$FreeBSD$"); #include #include +/* Avoid clutter in the hw.* space, keep all toe tunables within hw.cxgb */ +SYSCTL_DECL(_hw_cxgb); +SYSCTL_NODE(_hw_cxgb, OID_AUTO, toe, CTLFLAG_RD, 0, "TOE parameters"); + static struct tom_tunables default_tunable_vals = { .max_host_sndbuf = 32 * 1024, .tx_hold_thres = 0, @@ -100,11 +104,24 @@ static struct tom_tunables default_tunab .activated = 1, }; +static int activated = 1; +TUNABLE_INT("hw.cxgb.toe.activated", &activated); +SYSCTL_UINT(_hw_cxgb_toe, OID_AUTO, activated, CTLFLAG_RDTUN, &activated, 0, + "enable TOE at init time"); + +static int ddp = 1; +TUNABLE_INT("hw.cxgb.toe.ddp", &ddp); +SYSCTL_UINT(_hw_cxgb_toe, OID_AUTO, ddp, CTLFLAG_RDTUN, &ddp, 0, "enable DDP"); + void t3_init_tunables(struct tom_data *t) { t->conf = default_tunable_vals; + /* Adjust tunables */ + t->conf.activated = activated; + t->conf.ddp = ddp; + /* Now apply device specific fixups. */ t->conf.mss = T3C_DATA(t->cdev)->tx_max_chunk; t->conf.max_wrs = T3C_DATA(t->cdev)->max_wrs; From owner-svn-src-head@FreeBSD.ORG Wed Nov 12 09:04:44 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 54387106564A; Wed, 12 Nov 2008 09:04:44 +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 470228FC16; Wed, 12 Nov 2008 09:04:44 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mAC94iYJ024906; Wed, 12 Nov 2008 09:04:44 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mAC94iGf024905; Wed, 12 Nov 2008 09:04:44 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200811120904.mAC94iGf024905@svn.freebsd.org> From: Ed Schouten Date: Wed, 12 Nov 2008 09:04: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: r184866 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Nov 2008 09:04:44 -0000 Author: ed Date: Wed Nov 12 09:04:44 2008 New Revision: 184866 URL: http://svn.freebsd.org/changeset/base/184866 Log: Don't forget to relock the TTY after uiomove() returns an error. Peter Holm just discovered this funny bug inside the TTY code: if uiomove() in ttydisc_write() returns an error, we forget to relock the TTY before jumping out of ttydisc_write(). Fix it by placing tty_unlock() and tty_lock() around uiomove(). Submitted by: pho Modified: head/sys/kern/tty_ttydisc.c Modified: head/sys/kern/tty_ttydisc.c ============================================================================== --- head/sys/kern/tty_ttydisc.c Wed Nov 12 08:29:26 2008 (r184865) +++ head/sys/kern/tty_ttydisc.c Wed Nov 12 09:04:44 2008 (r184866) @@ -460,17 +460,15 @@ ttydisc_write(struct tty *tp, struct uio MPASS(oblen == 0); /* Step 1: read data. */ - - tty_unlock(tp); - obstart = ob; nlen = MIN(uio->uio_resid, sizeof ob); + tty_unlock(tp); error = uiomove(ob, nlen, uio); + tty_lock(tp); if (error != 0) break; oblen = nlen; - tty_lock(tp); if (tty_gone(tp)) { error = ENXIO; break; From owner-svn-src-head@FreeBSD.ORG Wed Nov 12 09:36:35 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 89DB51065673; Wed, 12 Nov 2008 09:36:35 +0000 (UTC) (envelope-from dfr@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7C5D78FC2D; Wed, 12 Nov 2008 09:36:35 +0000 (UTC) (envelope-from dfr@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mAC9aZVM025553; Wed, 12 Nov 2008 09:36:35 GMT (envelope-from dfr@svn.freebsd.org) Received: (from dfr@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mAC9aZxv025552; Wed, 12 Nov 2008 09:36:35 GMT (envelope-from dfr@svn.freebsd.org) Message-Id: <200811120936.mAC9aZxv025552@svn.freebsd.org> From: Doug Rabson Date: Wed, 12 Nov 2008 09:36: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: r184868 - head/sys/nfsserver X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Nov 2008 09:36:35 -0000 Author: dfr Date: Wed Nov 12 09:36:35 2008 New Revision: 184868 URL: http://svn.freebsd.org/changeset/base/184868 Log: Allow v3 GETATTR requests even when weakly authenticated. Change the error return for for weakly authenticated requests from REJECTEDCRED to WEAKAUTH for consistency with Solaris. Modified: head/sys/nfsserver/nfs_srvsubs.c Modified: head/sys/nfsserver/nfs_srvsubs.c ============================================================================== --- head/sys/nfsserver/nfs_srvsubs.c Wed Nov 12 09:35:57 2008 (r184867) +++ head/sys/nfsserver/nfs_srvsubs.c Wed Nov 12 09:36:35 2008 (r184868) @@ -1149,7 +1149,8 @@ nfsrv_fhtovp(fhandle_t *fhp, int lockfla */ mountreq = FALSE; if (v3) { - if (nfsd->nd_procnum == NFSPROC_FSINFO) + if (nfsd->nd_procnum == NFSPROC_FSINFO + || nfsd->nd_procnum == NFSPROC_GETATTR) mountreq = TRUE; } else { if (nfsd->nd_procnum == NFSPROC_FSSTAT @@ -1157,7 +1158,7 @@ nfsrv_fhtovp(fhandle_t *fhp, int lockfla mountreq = TRUE; } if (!mountreq) { - error = NFSERR_AUTHERR | AUTH_REJECTCRED; + error = NFSERR_AUTHERR | AUTH_TOOWEAK; goto out; } } From owner-svn-src-head@FreeBSD.ORG Wed Nov 12 09:38:18 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 844BD106564A; Wed, 12 Nov 2008 09:38:18 +0000 (UTC) (envelope-from dfr@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 76DCE8FC08; Wed, 12 Nov 2008 09:38:18 +0000 (UTC) (envelope-from dfr@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mAC9cIpJ025632; Wed, 12 Nov 2008 09:38:18 GMT (envelope-from dfr@svn.freebsd.org) Received: (from dfr@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mAC9cIFb025631; Wed, 12 Nov 2008 09:38:18 GMT (envelope-from dfr@svn.freebsd.org) Message-Id: <200811120938.mAC9cIFb025631@svn.freebsd.org> From: Doug Rabson Date: Wed, 12 Nov 2008 09:38: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: r184869 - head/sys/nfsserver X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Nov 2008 09:38:18 -0000 Author: dfr Date: Wed Nov 12 09:38:18 2008 New Revision: 184869 URL: http://svn.freebsd.org/changeset/base/184869 Log: Turn (NFSERR_AUTHERR|code) status values into svcerr_auth(rqst, code) replies instead of returning a success with a bogus NFS error code. Modified: head/sys/nfsserver/nfs_srvkrpc.c Modified: head/sys/nfsserver/nfs_srvkrpc.c ============================================================================== --- head/sys/nfsserver/nfs_srvkrpc.c Wed Nov 12 09:36:35 2008 (r184868) +++ head/sys/nfsserver/nfs_srvkrpc.c Wed Nov 12 09:38:18 2008 (r184869) @@ -388,8 +388,13 @@ nfssvc_program(struct svc_req *rqst, SVC svc_freereq(rqst); return; } - if (!svc_sendreply_mbuf(rqst, mrep)) - svcerr_systemerr(rqst); + if (nd.nd_repstat & NFSERR_AUTHERR) { + svcerr_auth(rqst, nd.nd_repstat & ~NFSERR_AUTHERR); + m_freem(mrep); + } else { + if (!svc_sendreply_mbuf(rqst, mrep)) + svcerr_systemerr(rqst); + } svc_freereq(rqst); } From owner-svn-src-head@FreeBSD.ORG Wed Nov 12 09:52:06 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 92CE0106567C; Wed, 12 Nov 2008 09:52:06 +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 820958FC08; Wed, 12 Nov 2008 09:52:06 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mAC9q6Ra025918; Wed, 12 Nov 2008 09:52:06 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mAC9q6H3025912; Wed, 12 Nov 2008 09:52:06 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200811120952.mAC9q6H3025912@svn.freebsd.org> From: Pyun YongHyeon Date: Wed, 12 Nov 2008 09:52: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: r184870 - in head/sys: amd64/conf boot/forth conf dev/ale i386/conf modules modules/ale X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Nov 2008 09:52:06 -0000 Author: yongari Date: Wed Nov 12 09:52:06 2008 New Revision: 184870 URL: http://svn.freebsd.org/changeset/base/184870 Log: Add ale(4), a driver for Atheros AR8121/AR8113/AR8114 PCIe ethernet controller. The controller is also known as L1E(AR8121) and L2E(AR8113/AR8114). Unlike its predecessor Attansic L1, AR8121/AR8113/AR8114 uses completely different Rx logic such that it requires separate driver. Datasheet for AR81xx is not available to open source driver writers but it shares large part of Tx and PHY logic of L1. I still don't understand some part of register meaning and some MAC statistics counters but the driver seems to have no critical issues for performance and stability. The AR81xx requires copy operation to pass received frames to upper stack such that ale(4) consumes a lot of CPU cycles than that of other controller. A couple of silicon bugs also adds more CPU cycles to address the known hardware bug. However, if you have fast CPU you can still saturate the link. Currently ale(4) supports the following hardware features. - MSI. - TCP Segmentation offload. - Hardware VLAN tag insertion/stripping with checksum offload. - Tx TCP/UDP checksum offload and Rx IP/TCP/UDP checksum offload. - Tx/Rx interrupt moderation. - Hardware statistics counters. - Jumbo frame. - WOL. AR81xx PCIe ethernet controllers are mainly found on ASUS EeePC or P5Q series of ASUS motherboards. Special thanks to Jeremy Chadwick who sent the hardware to me. Without his donation writing a driver for AR81xx would never have been possible. Big thanks to all people who reported feedback or tested patches. HW donated by: koitsu Tested by: bsam, Joao Barros gmail DOT com > Jan Henrik Sylvester janh DOT de > Ivan Brawley < ivan <> brawley DOT id DOT au >, CURRENT ML Added: head/sys/dev/ale/ head/sys/dev/ale/if_ale.c (contents, props changed) head/sys/dev/ale/if_alereg.h (contents, props changed) head/sys/dev/ale/if_alevar.h (contents, props changed) head/sys/modules/ale/ head/sys/modules/ale/Makefile (contents, props changed) Modified: head/sys/amd64/conf/GENERIC head/sys/boot/forth/loader.conf head/sys/conf/NOTES head/sys/conf/files head/sys/i386/conf/GENERIC head/sys/modules/Makefile Modified: head/sys/amd64/conf/GENERIC ============================================================================== --- head/sys/amd64/conf/GENERIC Wed Nov 12 09:38:18 2008 (r184869) +++ head/sys/amd64/conf/GENERIC Wed Nov 12 09:52:06 2008 (r184870) @@ -202,6 +202,7 @@ device vx # 3Com 3c590, 3c595 (``Vorte device miibus # MII bus support device ae # Attansic/Atheros L2 FastEthernet device age # Attansic/Atheros L1 Gigabit Ethernet +device ale # Atheros AR8121/AR8113/AR8114 Ethernet device bce # Broadcom BCM5706/BCM5708 Gigabit Ethernet device bfe # Broadcom BCM440x 10/100 Ethernet device bge # Broadcom BCM570xx Gigabit Ethernet Modified: head/sys/boot/forth/loader.conf ============================================================================== --- head/sys/boot/forth/loader.conf Wed Nov 12 09:38:18 2008 (r184869) +++ head/sys/boot/forth/loader.conf Wed Nov 12 09:52:06 2008 (r184870) @@ -210,6 +210,7 @@ pf_load="NO" # packet filter miibus_load="NO" # miibus support, needed for some drivers if_ae_load="NO" # Attansic/Atheros L2 FastEthernet if_age_load="NO" # Attansic/Atheros L1 Gigabit Ethernet +if_ale_load="NO" # Atheros AR8121/AR8113/AR8114 Ethernet if_an_load="NO" # Aironet 4500/4800 802.11 wireless NICs if_ar_load="NO" # Digi SYNC/570i if_ath_load="NO" # Atheros IEEE 802.11 wireless NICs Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Wed Nov 12 09:38:18 2008 (r184869) +++ head/sys/conf/NOTES Wed Nov 12 09:52:06 2008 (r184870) @@ -1718,6 +1718,7 @@ device miibus # L2 PCI-Express FastEthernet controllers. # age: Support for gigabit ethernet adapters based on the Attansic/Atheros # L1 PCI express gigabit ethernet controllers. +# ale: Support for Atheros AR8121/AR8113/AR8114 PCIe ethernet controllers. # bce: Broadcom NetXtreme II (BCM5706/BCM5708) PCI/PCIe Gigabit Ethernet # adapters. # bfe: Broadcom BCM4401 Ethernet adapter. @@ -1859,6 +1860,7 @@ device xe # PCI Ethernet NICs that use the common MII bus controller code. device ae # Attansic/Atheros L2 FastEthernet device age # Attansic/Atheros L1 Gigabit Ethernet +device ale # Atheros AR8121/AR8113/AR8114 Ethernet device bce # Broadcom BCM5706/BCM5708 Gigabit Ethernet device bfe # Broadcom BCM440x 10/100 Ethernet device bge # Broadcom BCM570xx Gigabit Ethernet Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Wed Nov 12 09:38:18 2008 (r184869) +++ head/sys/conf/files Wed Nov 12 09:52:06 2008 (r184870) @@ -448,6 +448,7 @@ dev/aic7xxx/aic7xxx.c optional ahc dev/aic7xxx/aic7xxx_93cx6.c optional ahc dev/aic7xxx/aic7xxx_osm.c optional ahc dev/aic7xxx/aic7xxx_pci.c optional ahc pci +dev/ale/if_ale.c optional ale pci dev/amd/amd.c optional amd dev/amr/amr.c optional amr dev/amr/amr_cam.c optional amrp amr Added: head/sys/dev/ale/if_ale.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/ale/if_ale.c Wed Nov 12 09:52:06 2008 (r184870) @@ -0,0 +1,3075 @@ +/*- + * Copyright (c) 2008, Pyun YongHyeon + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice unmodified, this list of conditions, and the following + * disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* Driver for Atheros AR8121/AR8113/AR8114 PCIe Ethernet. */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include + +#include +#include + +#include +#include +#include + +#include +#include + +/* "device miibus" required. See GENERIC if you get errors here. */ +#include "miibus_if.h" + +/* For more information about Tx checksum offload issues see ale_encap(). */ +#define ALE_CSUM_FEATURES (CSUM_TCP | CSUM_UDP) +#ifndef IFCAP_VLAN_HWTSO +#define IFCAP_VLAN_HWTSO 0 +#endif + +MODULE_DEPEND(ale, pci, 1, 1, 1); +MODULE_DEPEND(ale, ether, 1, 1, 1); +MODULE_DEPEND(ale, miibus, 1, 1, 1); + +/* Tunables. */ +static int msi_disable = 0; +static int msix_disable = 0; +TUNABLE_INT("hw.ale.msi_disable", &msi_disable); +TUNABLE_INT("hw.ale.msix_disable", &msix_disable); + +/* + * Devices supported by this driver. + */ +static struct ale_dev { + uint16_t ale_vendorid; + uint16_t ale_deviceid; + const char *ale_name; +} ale_devs[] = { + { VENDORID_ATHEROS, DEVICEID_ATHEROS_AR81XX, + "Atheros AR8121/AR8113/AR8114 PCIe Ethernet" }, +}; + +static int ale_attach(device_t); +static int ale_check_boundary(struct ale_softc *); +static int ale_detach(device_t); +static int ale_dma_alloc(struct ale_softc *); +static void ale_dma_free(struct ale_softc *); +static void ale_dmamap_cb(void *, bus_dma_segment_t *, int, int); +static int ale_encap(struct ale_softc *, struct mbuf **); +static void ale_get_macaddr(struct ale_softc *); +static void ale_init(void *); +static void ale_init_locked(struct ale_softc *); +static void ale_init_rx_pages(struct ale_softc *); +static void ale_init_tx_ring(struct ale_softc *); +static void ale_int_task(void *, int); +static int ale_intr(void *); +static int ale_ioctl(struct ifnet *, u_long, caddr_t); +static void ale_link_task(void *, int); +static void ale_mac_config(struct ale_softc *); +static int ale_miibus_readreg(device_t, int, int); +static void ale_miibus_statchg(device_t); +static int ale_miibus_writereg(device_t, int, int, int); +static int ale_mediachange(struct ifnet *); +static void ale_mediastatus(struct ifnet *, struct ifmediareq *); +static void ale_phy_reset(struct ale_softc *); +static int ale_probe(device_t); +static void ale_reset(struct ale_softc *); +static int ale_resume(device_t); +static void ale_rx_update_page(struct ale_softc *, struct ale_rx_page **, + uint32_t, uint32_t *); +static void ale_rxcsum(struct ale_softc *, struct mbuf *, uint32_t); +static int ale_rxeof(struct ale_softc *sc, int); +static void ale_rxfilter(struct ale_softc *); +static void ale_rxvlan(struct ale_softc *); +static void ale_setlinkspeed(struct ale_softc *); +static void ale_setwol(struct ale_softc *); +static int ale_shutdown(device_t); +static void ale_start(struct ifnet *); +static void ale_stats_clear(struct ale_softc *); +static void ale_stats_update(struct ale_softc *); +static void ale_stop(struct ale_softc *); +static void ale_stop_mac(struct ale_softc *); +static int ale_suspend(device_t); +static void ale_sysctl_node(struct ale_softc *); +static void ale_tick(void *); +static void ale_tx_task(void *, int); +static void ale_txeof(struct ale_softc *); +static void ale_watchdog(struct ale_softc *); +static int sysctl_int_range(SYSCTL_HANDLER_ARGS, int, int); +static int sysctl_hw_ale_proc_limit(SYSCTL_HANDLER_ARGS); +static int sysctl_hw_ale_int_mod(SYSCTL_HANDLER_ARGS); + +static device_method_t ale_methods[] = { + /* Device interface. */ + DEVMETHOD(device_probe, ale_probe), + DEVMETHOD(device_attach, ale_attach), + DEVMETHOD(device_detach, ale_detach), + DEVMETHOD(device_shutdown, ale_shutdown), + DEVMETHOD(device_suspend, ale_suspend), + DEVMETHOD(device_resume, ale_resume), + + /* MII interface. */ + DEVMETHOD(miibus_readreg, ale_miibus_readreg), + DEVMETHOD(miibus_writereg, ale_miibus_writereg), + DEVMETHOD(miibus_statchg, ale_miibus_statchg), + + { NULL, NULL } +}; + +static driver_t ale_driver = { + "ale", + ale_methods, + sizeof(struct ale_softc) +}; + +static devclass_t ale_devclass; + +DRIVER_MODULE(ale, pci, ale_driver, ale_devclass, 0, 0); +DRIVER_MODULE(miibus, ale, miibus_driver, miibus_devclass, 0, 0); + +static struct resource_spec ale_res_spec_mem[] = { + { SYS_RES_MEMORY, PCIR_BAR(0), RF_ACTIVE }, + { -1, 0, 0 } +}; + +static struct resource_spec ale_irq_spec_legacy[] = { + { SYS_RES_IRQ, 0, RF_ACTIVE | RF_SHAREABLE }, + { -1, 0, 0 } +}; + +static struct resource_spec ale_irq_spec_msi[] = { + { SYS_RES_IRQ, 1, RF_ACTIVE }, + { -1, 0, 0 } +}; + +static struct resource_spec ale_irq_spec_msix[] = { + { SYS_RES_IRQ, 1, RF_ACTIVE }, + { -1, 0, 0 } +}; + +static int +ale_miibus_readreg(device_t dev, int phy, int reg) +{ + struct ale_softc *sc; + uint32_t v; + int i; + + sc = device_get_softc(dev); + + if (phy != sc->ale_phyaddr) + return (0); + + CSR_WRITE_4(sc, ALE_MDIO, MDIO_OP_EXECUTE | MDIO_OP_READ | + MDIO_SUP_PREAMBLE | MDIO_CLK_25_4 | MDIO_REG_ADDR(reg)); + for (i = ALE_PHY_TIMEOUT; i > 0; i--) { + DELAY(5); + v = CSR_READ_4(sc, ALE_MDIO); + if ((v & (MDIO_OP_EXECUTE | MDIO_OP_BUSY)) == 0) + break; + } + + if (i == 0) { + device_printf(sc->ale_dev, "phy read timeout : %d\n", reg); + return (0); + } + + return ((v & MDIO_DATA_MASK) >> MDIO_DATA_SHIFT); +} + +static int +ale_miibus_writereg(device_t dev, int phy, int reg, int val) +{ + struct ale_softc *sc; + uint32_t v; + int i; + + sc = device_get_softc(dev); + + if (phy != sc->ale_phyaddr) + return (0); + + CSR_WRITE_4(sc, ALE_MDIO, MDIO_OP_EXECUTE | MDIO_OP_WRITE | + (val & MDIO_DATA_MASK) << MDIO_DATA_SHIFT | + MDIO_SUP_PREAMBLE | MDIO_CLK_25_4 | MDIO_REG_ADDR(reg)); + for (i = ALE_PHY_TIMEOUT; i > 0; i--) { + DELAY(5); + v = CSR_READ_4(sc, ALE_MDIO); + if ((v & (MDIO_OP_EXECUTE | MDIO_OP_BUSY)) == 0) + break; + } + + if (i == 0) + device_printf(sc->ale_dev, "phy write timeout : %d\n", reg); + + return (0); +} + +static void +ale_miibus_statchg(device_t dev) +{ + struct ale_softc *sc; + + sc = device_get_softc(dev); + + taskqueue_enqueue(taskqueue_swi, &sc->ale_link_task); +} + +static void +ale_mediastatus(struct ifnet *ifp, struct ifmediareq *ifmr) +{ + struct ale_softc *sc; + struct mii_data *mii; + + sc = ifp->if_softc; + ALE_LOCK(sc); + mii = device_get_softc(sc->ale_miibus); + + mii_pollstat(mii); + ALE_UNLOCK(sc); + ifmr->ifm_status = mii->mii_media_status; + ifmr->ifm_active = mii->mii_media_active; +} + +static int +ale_mediachange(struct ifnet *ifp) +{ + struct ale_softc *sc; + struct mii_data *mii; + struct mii_softc *miisc; + int error; + + sc = ifp->if_softc; + ALE_LOCK(sc); + mii = device_get_softc(sc->ale_miibus); + if (mii->mii_instance != 0) { + LIST_FOREACH(miisc, &mii->mii_phys, mii_list) + mii_phy_reset(miisc); + } + error = mii_mediachg(mii); + ALE_UNLOCK(sc); + + return (error); +} + +static int +ale_probe(device_t dev) +{ + struct ale_dev *sp; + int i; + uint16_t vendor, devid; + + vendor = pci_get_vendor(dev); + devid = pci_get_device(dev); + sp = ale_devs; + for (i = 0; i < sizeof(ale_devs) / sizeof(ale_devs[0]); i++) { + if (vendor == sp->ale_vendorid && + devid == sp->ale_deviceid) { + device_set_desc(dev, sp->ale_name); + return (BUS_PROBE_DEFAULT); + } + sp++; + } + + return (ENXIO); +} + +static void +ale_get_macaddr(struct ale_softc *sc) +{ + uint32_t ea[2], reg; + int i, vpdc; + + reg = CSR_READ_4(sc, ALE_SPI_CTRL); + if ((reg & SPI_VPD_ENB) != 0) { + reg &= ~SPI_VPD_ENB; + CSR_WRITE_4(sc, ALE_SPI_CTRL, reg); + } + + if (pci_find_extcap(sc->ale_dev, PCIY_VPD, &vpdc) == 0) { + /* + * PCI VPD capability found, let TWSI reload EEPROM. + * This will set ethernet address of controller. + */ + CSR_WRITE_4(sc, ALE_TWSI_CTRL, CSR_READ_4(sc, ALE_TWSI_CTRL) | + TWSI_CTRL_SW_LD_START); + for (i = 100; i > 0; i--) { + DELAY(1000); + reg = CSR_READ_4(sc, ALE_TWSI_CTRL); + if ((reg & TWSI_CTRL_SW_LD_START) == 0) + break; + } + if (i == 0) + device_printf(sc->ale_dev, + "reloading EEPROM timeout!\n"); + } else { + if (bootverbose) + device_printf(sc->ale_dev, + "PCI VPD capability not found!\n"); + } + + ea[0] = CSR_READ_4(sc, ALE_PAR0); + ea[1] = CSR_READ_4(sc, ALE_PAR1); + sc->ale_eaddr[0] = (ea[1] >> 8) & 0xFF; + sc->ale_eaddr[1] = (ea[1] >> 0) & 0xFF; + sc->ale_eaddr[2] = (ea[0] >> 24) & 0xFF; + sc->ale_eaddr[3] = (ea[0] >> 16) & 0xFF; + sc->ale_eaddr[4] = (ea[0] >> 8) & 0xFF; + sc->ale_eaddr[5] = (ea[0] >> 0) & 0xFF; +} + +static void +ale_phy_reset(struct ale_softc *sc) +{ + + /* Reset magic from Linux. */ + CSR_WRITE_2(sc, ALE_GPHY_CTRL, + GPHY_CTRL_HIB_EN | GPHY_CTRL_HIB_PULSE | GPHY_CTRL_SEL_ANA_RESET | + GPHY_CTRL_PHY_PLL_ON); + DELAY(1000); + CSR_WRITE_2(sc, ALE_GPHY_CTRL, + GPHY_CTRL_EXT_RESET | GPHY_CTRL_HIB_EN | GPHY_CTRL_HIB_PULSE | + GPHY_CTRL_SEL_ANA_RESET | GPHY_CTRL_PHY_PLL_ON); + DELAY(1000); +} + +static int +ale_attach(device_t dev) +{ + struct ale_softc *sc; + struct ifnet *ifp; + uint16_t burst; + int error, i, msic, msixc, pmc; + uint32_t rxf_len, txf_len; + + error = 0; + sc = device_get_softc(dev); + sc->ale_dev = dev; + + mtx_init(&sc->ale_mtx, device_get_nameunit(dev), MTX_NETWORK_LOCK, + MTX_DEF); + callout_init_mtx(&sc->ale_tick_ch, &sc->ale_mtx, 0); + TASK_INIT(&sc->ale_int_task, 0, ale_int_task, sc); + TASK_INIT(&sc->ale_link_task, 0, ale_link_task, sc); + + /* Map the device. */ + pci_enable_busmaster(dev); + sc->ale_res_spec = ale_res_spec_mem; + sc->ale_irq_spec = ale_irq_spec_legacy; + error = bus_alloc_resources(dev, sc->ale_res_spec, sc->ale_res); + if (error != 0) { + device_printf(dev, "cannot allocate memory resources.\n"); + goto fail; + } + + /* Set PHY address. */ + sc->ale_phyaddr = ALE_PHY_ADDR; + + /* Reset PHY. */ + ale_phy_reset(sc); + + /* Reset the ethernet controller. */ + ale_reset(sc); + + /* Get PCI and chip id/revision. */ + sc->ale_rev = pci_get_revid(dev); + if (sc->ale_rev >= 0xF0) { + /* L2E Rev. B. AR8114 */ + sc->ale_flags |= ALE_FLAG_FASTETHER; + } else { + if ((CSR_READ_4(sc, ALE_PHY_STATUS) & PHY_STATUS_100M) != 0) { + /* L1E AR8121 */ + sc->ale_flags |= ALE_FLAG_JUMBO; + } else { + /* L2E Rev. A. AR8113 */ + sc->ale_flags |= ALE_FLAG_FASTETHER; + } + } + /* + * All known controllers seems to require 4 bytes alignment + * of Tx buffers to make Tx checksum offload with custom + * checksum generation method work. + */ + sc->ale_flags |= ALE_FLAG_TXCSUM_BUG; + /* + * All known controllers seems to have issues on Rx checksum + * offload for fragmented IP datagrams. + */ + sc->ale_flags |= ALE_FLAG_RXCSUM_BUG; + /* + * Don't use Tx CMB. It is known to cause RRS update failure + * under certain circumstances. Typical phenomenon of the + * issue would be unexpected sequence number encountered in + * Rx handler. + */ + sc->ale_flags |= ALE_FLAG_TXCMB_BUG; + sc->ale_chip_rev = CSR_READ_4(sc, ALE_MASTER_CFG) >> + MASTER_CHIP_REV_SHIFT; + if (bootverbose) { + device_printf(dev, "PCI device revision : 0x%04x\n", + sc->ale_rev); + device_printf(dev, "Chip id/revision : 0x%04x\n", + sc->ale_chip_rev); + } + txf_len = CSR_READ_4(sc, ALE_SRAM_TX_FIFO_LEN); + rxf_len = CSR_READ_4(sc, ALE_SRAM_RX_FIFO_LEN); + /* + * Uninitialized hardware returns an invalid chip id/revision + * as well as 0xFFFFFFFF for Tx/Rx fifo length. + */ + if (sc->ale_chip_rev == 0xFFFF || txf_len == 0xFFFFFFFF || + rxf_len == 0xFFFFFFF) { + device_printf(dev,"chip revision : 0x%04x, %u Tx FIFO " + "%u Rx FIFO -- not initialized?\n", sc->ale_chip_rev, + txf_len, rxf_len); + error = ENXIO; + goto fail; + } + device_printf(dev, "%u Tx FIFO, %u Rx FIFO\n", txf_len, rxf_len); + + /* Allocate IRQ resources. */ + msixc = pci_msix_count(dev); + msic = pci_msi_count(dev); + if (bootverbose) { + device_printf(dev, "MSIX count : %d\n", msixc); + device_printf(dev, "MSI count : %d\n", msic); + } + + /* Prefer MSIX over MSI. */ + if (msix_disable == 0 || msi_disable == 0) { + if (msix_disable == 0 && msixc == ALE_MSIX_MESSAGES && + pci_alloc_msix(dev, &msixc) == 0) { + if (msic == ALE_MSIX_MESSAGES) { + device_printf(dev, "Using %d MSIX messages.\n", + msixc); + sc->ale_flags |= ALE_FLAG_MSIX; + sc->ale_irq_spec = ale_irq_spec_msix; + } else + pci_release_msi(dev); + } + if (msi_disable == 0 && (sc->ale_flags & ALE_FLAG_MSIX) == 0 && + msic == ALE_MSI_MESSAGES && + pci_alloc_msi(dev, &msic) == 0) { + if (msic == ALE_MSI_MESSAGES) { + device_printf(dev, "Using %d MSI messages.\n", + msic); + sc->ale_flags |= ALE_FLAG_MSI; + sc->ale_irq_spec = ale_irq_spec_msi; + } else + pci_release_msi(dev); + } + } + + error = bus_alloc_resources(dev, sc->ale_irq_spec, sc->ale_irq); + if (error != 0) { + device_printf(dev, "cannot allocate IRQ resources.\n"); + goto fail; + } + + /* Get DMA parameters from PCIe device control register. */ + if (pci_find_extcap(dev, PCIY_EXPRESS, &i) == 0) { + sc->ale_flags |= ALE_FLAG_PCIE; + burst = pci_read_config(dev, i + 0x08, 2); + /* Max read request size. */ + sc->ale_dma_rd_burst = ((burst >> 12) & 0x07) << + DMA_CFG_RD_BURST_SHIFT; + /* Max payload size. */ + sc->ale_dma_wr_burst = ((burst >> 5) & 0x07) << + DMA_CFG_WR_BURST_SHIFT; + if (bootverbose) { + device_printf(dev, "Read request size : %d bytes.\n", + 128 << ((burst >> 12) & 0x07)); + device_printf(dev, "TLP payload size : %d bytes.\n", + 128 << ((burst >> 5) & 0x07)); + } + } else { + sc->ale_dma_rd_burst = DMA_CFG_RD_BURST_128; + sc->ale_dma_wr_burst = DMA_CFG_WR_BURST_128; + } + + /* Create device sysctl node. */ + ale_sysctl_node(sc); + + if ((error = ale_dma_alloc(sc) != 0)) + goto fail; + + /* Load station address. */ + ale_get_macaddr(sc); + + ifp = sc->ale_ifp = if_alloc(IFT_ETHER); + if (ifp == NULL) { + device_printf(dev, "cannot allocate ifnet structure.\n"); + error = ENXIO; + goto fail; + } + + ifp->if_softc = sc; + if_initname(ifp, device_get_name(dev), device_get_unit(dev)); + ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; + ifp->if_ioctl = ale_ioctl; + ifp->if_start = ale_start; + ifp->if_init = ale_init; + ifp->if_snd.ifq_drv_maxlen = ALE_TX_RING_CNT - 1; + IFQ_SET_MAXLEN(&ifp->if_snd, ifp->if_snd.ifq_drv_maxlen); + IFQ_SET_READY(&ifp->if_snd); + ifp->if_capabilities = IFCAP_RXCSUM | IFCAP_TXCSUM | IFCAP_TSO4; + ifp->if_hwassist = ALE_CSUM_FEATURES | CSUM_TSO; + if (pci_find_extcap(dev, PCIY_PMG, &pmc) == 0) { + sc->ale_flags |= ALE_FLAG_PMCAP; + ifp->if_capabilities |= IFCAP_WOL_MAGIC | IFCAP_WOL_MCAST; + } + ifp->if_capenable = ifp->if_capabilities; + + /* Set up MII bus. */ + if ((error = mii_phy_probe(dev, &sc->ale_miibus, ale_mediachange, + ale_mediastatus)) != 0) { + device_printf(dev, "no PHY found!\n"); + goto fail; + } + + ether_ifattach(ifp, sc->ale_eaddr); + + /* VLAN capability setup. */ + ifp->if_capabilities |= IFCAP_VLAN_MTU; + ifp->if_capabilities |= IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_HWCSUM; + ifp->if_capenable = ifp->if_capabilities; + + /* Tell the upper layer(s) we support long frames. */ + ifp->if_data.ifi_hdrlen = sizeof(struct ether_vlan_header); + + /* Create local taskq. */ + TASK_INIT(&sc->ale_tx_task, 1, ale_tx_task, ifp); + sc->ale_tq = taskqueue_create_fast("ale_taskq", M_WAITOK, + taskqueue_thread_enqueue, &sc->ale_tq); + if (sc->ale_tq == NULL) { + device_printf(dev, "could not create taskqueue.\n"); + ether_ifdetach(ifp); + error = ENXIO; + goto fail; + } + taskqueue_start_threads(&sc->ale_tq, 1, PI_NET, "%s taskq", + device_get_nameunit(sc->ale_dev)); + + if ((sc->ale_flags & ALE_FLAG_MSIX) != 0) + msic = ALE_MSIX_MESSAGES; + else if ((sc->ale_flags & ALE_FLAG_MSI) != 0) + msic = ALE_MSI_MESSAGES; + else + msic = 1; + for (i = 0; i < msic; i++) { + error = bus_setup_intr(dev, sc->ale_irq[i], + INTR_TYPE_NET | INTR_MPSAFE, ale_intr, NULL, sc, + &sc->ale_intrhand[i]); + if (error != 0) + break; + } + if (error != 0) { + device_printf(dev, "could not set up interrupt handler.\n"); + taskqueue_free(sc->ale_tq); + sc->ale_tq = NULL; + ether_ifdetach(ifp); + goto fail; + } + +fail: + if (error != 0) + ale_detach(dev); + + return (error); +} + +static int +ale_detach(device_t dev) +{ + struct ale_softc *sc; + struct ifnet *ifp; + int i, msic; + + sc = device_get_softc(dev); + + ifp = sc->ale_ifp; + if (device_is_attached(dev)) { + ALE_LOCK(sc); + sc->ale_flags |= ALE_FLAG_DETACH; + ale_stop(sc); + ALE_UNLOCK(sc); + callout_drain(&sc->ale_tick_ch); + taskqueue_drain(sc->ale_tq, &sc->ale_int_task); + taskqueue_drain(sc->ale_tq, &sc->ale_tx_task); + taskqueue_drain(taskqueue_swi, &sc->ale_link_task); + ether_ifdetach(ifp); + } + + if (sc->ale_tq != NULL) { + taskqueue_drain(sc->ale_tq, &sc->ale_int_task); + taskqueue_free(sc->ale_tq); + sc->ale_tq = NULL; + } + + if (sc->ale_miibus != NULL) { + device_delete_child(dev, sc->ale_miibus); + sc->ale_miibus = NULL; + } + bus_generic_detach(dev); + ale_dma_free(sc); + + if (ifp != NULL) { + if_free(ifp); + sc->ale_ifp = NULL; + } + + if ((sc->ale_flags & ALE_FLAG_MSIX) != 0) + msic = ALE_MSIX_MESSAGES; + else if ((sc->ale_flags & ALE_FLAG_MSI) != 0) + msic = ALE_MSI_MESSAGES; + else + msic = 1; + for (i = 0; i < msic; i++) { + if (sc->ale_intrhand[i] != NULL) { + bus_teardown_intr(dev, sc->ale_irq[i], + sc->ale_intrhand[i]); + sc->ale_intrhand[i] = NULL; + } + } + + bus_release_resources(dev, sc->ale_irq_spec, sc->ale_irq); + if ((sc->ale_flags & (ALE_FLAG_MSI | ALE_FLAG_MSIX)) != 0) + pci_release_msi(dev); + bus_release_resources(dev, sc->ale_res_spec, sc->ale_res); + mtx_destroy(&sc->ale_mtx); + + return (0); +} + +#define ALE_SYSCTL_STAT_ADD32(c, h, n, p, d) \ + SYSCTL_ADD_UINT(c, h, OID_AUTO, n, CTLFLAG_RD, p, 0, d) + +#if __FreeBSD_version > 800000 +#define ALE_SYSCTL_STAT_ADD64(c, h, n, p, d) \ + SYSCTL_ADD_QUAD(c, h, OID_AUTO, n, CTLFLAG_RD, p, d) +#else +#define ALE_SYSCTL_STAT_ADD64(c, h, n, p, d) \ + SYSCTL_ADD_ULONG(c, h, OID_AUTO, n, CTLFLAG_RD, p, d) +#endif + +static void +ale_sysctl_node(struct ale_softc *sc) +{ + struct sysctl_ctx_list *ctx; + struct sysctl_oid_list *child, *parent; + struct sysctl_oid *tree; + struct ale_hw_stats *stats; + int error; + + stats = &sc->ale_stats; + ctx = device_get_sysctl_ctx(sc->ale_dev); + child = SYSCTL_CHILDREN(device_get_sysctl_tree(sc->ale_dev)); + + SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "int_rx_mod", + CTLTYPE_INT | CTLFLAG_RW, &sc->ale_int_rx_mod, 0, + sysctl_hw_ale_int_mod, "I", "ale Rx interrupt moderation"); + SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "int_tx_mod", + CTLTYPE_INT | CTLFLAG_RW, &sc->ale_int_tx_mod, 0, + sysctl_hw_ale_int_mod, "I", "ale Tx interrupt moderation"); + /* Pull in device tunables. */ + sc->ale_int_rx_mod = ALE_IM_RX_TIMER_DEFAULT; + error = resource_int_value(device_get_name(sc->ale_dev), + device_get_unit(sc->ale_dev), "int_rx_mod", &sc->ale_int_rx_mod); + if (error == 0) { + if (sc->ale_int_rx_mod < ALE_IM_TIMER_MIN || + sc->ale_int_rx_mod > ALE_IM_TIMER_MAX) { + device_printf(sc->ale_dev, "int_rx_mod value out of " + "range; using default: %d\n", + ALE_IM_RX_TIMER_DEFAULT); + sc->ale_int_rx_mod = ALE_IM_RX_TIMER_DEFAULT; + } + } + sc->ale_int_tx_mod = ALE_IM_TX_TIMER_DEFAULT; + error = resource_int_value(device_get_name(sc->ale_dev), + device_get_unit(sc->ale_dev), "int_tx_mod", &sc->ale_int_tx_mod); + if (error == 0) { + if (sc->ale_int_tx_mod < ALE_IM_TIMER_MIN || + sc->ale_int_tx_mod > ALE_IM_TIMER_MAX) { + device_printf(sc->ale_dev, "int_tx_mod value out of " + "range; using default: %d\n", + ALE_IM_TX_TIMER_DEFAULT); + sc->ale_int_tx_mod = ALE_IM_TX_TIMER_DEFAULT; + } + } + SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "process_limit", + CTLTYPE_INT | CTLFLAG_RW, &sc->ale_process_limit, 0, + sysctl_hw_ale_proc_limit, "I", + "max number of Rx events to process"); + /* Pull in device tunables. */ + sc->ale_process_limit = ALE_PROC_DEFAULT; + error = resource_int_value(device_get_name(sc->ale_dev), + device_get_unit(sc->ale_dev), "process_limit", + &sc->ale_process_limit); + if (error == 0) { + if (sc->ale_process_limit < ALE_PROC_MIN || + sc->ale_process_limit > ALE_PROC_MAX) { + device_printf(sc->ale_dev, + "process_limit value out of range; " + "using default: %d\n", ALE_PROC_DEFAULT); + sc->ale_process_limit = ALE_PROC_DEFAULT; + } + } + + /* Misc statistics. */ + ALE_SYSCTL_STAT_ADD32(ctx, child, "reset_brk_seq", + &stats->reset_brk_seq, + "Controller resets due to broken Rx sequnce number"); + + tree = SYSCTL_ADD_NODE(ctx, child, OID_AUTO, "stats", CTLFLAG_RD, + NULL, "ATE statistics"); + parent = SYSCTL_CHILDREN(tree); + + /* Rx statistics. */ + tree = SYSCTL_ADD_NODE(ctx, parent, OID_AUTO, "rx", CTLFLAG_RD, + NULL, "Rx MAC statistics"); + child = SYSCTL_CHILDREN(tree); + ALE_SYSCTL_STAT_ADD32(ctx, child, "good_frames", + &stats->rx_frames, "Good frames"); + ALE_SYSCTL_STAT_ADD32(ctx, child, "good_bcast_frames", + &stats->rx_bcast_frames, "Good broadcast frames"); + ALE_SYSCTL_STAT_ADD32(ctx, child, "good_mcast_frames", + &stats->rx_mcast_frames, "Good multicast frames"); + ALE_SYSCTL_STAT_ADD32(ctx, child, "pause_frames", + &stats->rx_pause_frames, "Pause control frames"); + ALE_SYSCTL_STAT_ADD32(ctx, child, "control_frames", + &stats->rx_control_frames, "Control frames"); + ALE_SYSCTL_STAT_ADD32(ctx, child, "crc_errs", + &stats->rx_crcerrs, "CRC errors"); + ALE_SYSCTL_STAT_ADD32(ctx, child, "len_errs", + &stats->rx_lenerrs, "Frames with length mismatched"); + ALE_SYSCTL_STAT_ADD64(ctx, child, "good_octets", + &stats->rx_bytes, "Good octets"); + ALE_SYSCTL_STAT_ADD64(ctx, child, "good_bcast_octets", + &stats->rx_bcast_bytes, "Good broadcast octets"); + ALE_SYSCTL_STAT_ADD64(ctx, child, "good_mcast_octets", + &stats->rx_mcast_bytes, "Good multicast octets"); + ALE_SYSCTL_STAT_ADD32(ctx, child, "runts", + &stats->rx_runts, "Too short frames"); + ALE_SYSCTL_STAT_ADD32(ctx, child, "fragments", + &stats->rx_fragments, "Fragmented frames"); + ALE_SYSCTL_STAT_ADD32(ctx, child, "frames_64", + &stats->rx_pkts_64, "64 bytes frames"); + ALE_SYSCTL_STAT_ADD32(ctx, child, "frames_65_127", + &stats->rx_pkts_65_127, "65 to 127 bytes frames"); + ALE_SYSCTL_STAT_ADD32(ctx, child, "frames_128_255", + &stats->rx_pkts_128_255, "128 to 255 bytes frames"); + ALE_SYSCTL_STAT_ADD32(ctx, child, "frames_256_511", + &stats->rx_pkts_256_511, "256 to 511 bytes frames"); + ALE_SYSCTL_STAT_ADD32(ctx, child, "frames_512_1023", + &stats->rx_pkts_512_1023, "512 to 1023 bytes frames"); + ALE_SYSCTL_STAT_ADD32(ctx, child, "frames_1024_1518", + &stats->rx_pkts_1024_1518, "1024 to 1518 bytes frames"); + ALE_SYSCTL_STAT_ADD32(ctx, child, "frames_1519_max", + &stats->rx_pkts_1519_max, "1519 to max frames"); + ALE_SYSCTL_STAT_ADD32(ctx, child, "trunc_errs", + &stats->rx_pkts_truncated, "Truncated frames due to MTU size"); + ALE_SYSCTL_STAT_ADD32(ctx, child, "fifo_oflows", + &stats->rx_fifo_oflows, "FIFO overflows"); + ALE_SYSCTL_STAT_ADD32(ctx, child, "rrs_errs", + &stats->rx_rrs_errs, "Return status write-back errors"); + ALE_SYSCTL_STAT_ADD32(ctx, child, "align_errs", + &stats->rx_alignerrs, "Alignment errors"); + ALE_SYSCTL_STAT_ADD32(ctx, child, "filtered", + &stats->rx_pkts_filtered, + "Frames dropped due to address filtering"); + + /* Tx statistics. */ + tree = SYSCTL_ADD_NODE(ctx, parent, OID_AUTO, "tx", CTLFLAG_RD, + NULL, "Tx MAC statistics"); + child = SYSCTL_CHILDREN(tree); + ALE_SYSCTL_STAT_ADD32(ctx, child, "good_frames", + &stats->tx_frames, "Good frames"); + ALE_SYSCTL_STAT_ADD32(ctx, child, "good_bcast_frames", + &stats->tx_bcast_frames, "Good broadcast frames"); + ALE_SYSCTL_STAT_ADD32(ctx, child, "good_mcast_frames", + &stats->tx_mcast_frames, "Good multicast frames"); + ALE_SYSCTL_STAT_ADD32(ctx, child, "pause_frames", + &stats->tx_pause_frames, "Pause control frames"); + ALE_SYSCTL_STAT_ADD32(ctx, child, "control_frames", + &stats->tx_control_frames, "Control frames"); + ALE_SYSCTL_STAT_ADD32(ctx, child, "excess_defers", + &stats->tx_excess_defer, "Frames with excessive derferrals"); + ALE_SYSCTL_STAT_ADD32(ctx, child, "defers", + &stats->tx_excess_defer, "Frames with derferrals"); + ALE_SYSCTL_STAT_ADD64(ctx, child, "good_octets", + &stats->tx_bytes, "Good octets"); + ALE_SYSCTL_STAT_ADD64(ctx, child, "good_bcast_octets", + &stats->tx_bcast_bytes, "Good broadcast octets"); + ALE_SYSCTL_STAT_ADD64(ctx, child, "good_mcast_octets", + &stats->tx_mcast_bytes, "Good multicast octets"); + ALE_SYSCTL_STAT_ADD32(ctx, child, "frames_64", + &stats->tx_pkts_64, "64 bytes frames"); + ALE_SYSCTL_STAT_ADD32(ctx, child, "frames_65_127", + &stats->tx_pkts_65_127, "65 to 127 bytes frames"); + ALE_SYSCTL_STAT_ADD32(ctx, child, "frames_128_255", + &stats->tx_pkts_128_255, "128 to 255 bytes frames"); + ALE_SYSCTL_STAT_ADD32(ctx, child, "frames_256_511", + &stats->tx_pkts_256_511, "256 to 511 bytes frames"); + ALE_SYSCTL_STAT_ADD32(ctx, child, "frames_512_1023", + &stats->tx_pkts_512_1023, "512 to 1023 bytes frames"); + ALE_SYSCTL_STAT_ADD32(ctx, child, "frames_1024_1518", + &stats->tx_pkts_1024_1518, "1024 to 1518 bytes frames"); + ALE_SYSCTL_STAT_ADD32(ctx, child, "frames_1519_max", + &stats->tx_pkts_1519_max, "1519 to max frames"); + ALE_SYSCTL_STAT_ADD32(ctx, child, "single_colls", + &stats->tx_single_colls, "Single collisions"); + ALE_SYSCTL_STAT_ADD32(ctx, child, "multi_colls", + &stats->tx_multi_colls, "Multiple collisions"); + ALE_SYSCTL_STAT_ADD32(ctx, child, "late_colls", + &stats->tx_late_colls, "Late collisions"); + ALE_SYSCTL_STAT_ADD32(ctx, child, "excess_colls", + &stats->tx_excess_colls, "Excessive collisions"); + ALE_SYSCTL_STAT_ADD32(ctx, child, "abort", + &stats->tx_abort, "Aborted frames due to Excessive collisions"); + ALE_SYSCTL_STAT_ADD32(ctx, child, "underruns", + &stats->tx_underrun, "FIFO underruns"); + ALE_SYSCTL_STAT_ADD32(ctx, child, "desc_underruns", + &stats->tx_desc_underrun, "Descriptor write-back errors"); + ALE_SYSCTL_STAT_ADD32(ctx, child, "len_errs", + &stats->tx_lenerrs, "Frames with length mismatched"); + ALE_SYSCTL_STAT_ADD32(ctx, child, "trunc_errs", + &stats->tx_pkts_truncated, "Truncated frames due to MTU size"); +} + +#undef ALE_SYSCTL_STAT_ADD32 +#undef ALE_SYSCTL_STAT_ADD64 + +struct ale_dmamap_arg { + bus_addr_t ale_busaddr; +}; + +static void +ale_dmamap_cb(void *arg, bus_dma_segment_t *segs, int nsegs, int error) +{ + struct ale_dmamap_arg *ctx; + + if (error != 0) + return; + + KASSERT(nsegs == 1, ("%s: %d segments returned!", __func__, nsegs)); + + ctx = (struct ale_dmamap_arg *)arg; + ctx->ale_busaddr = segs[0].ds_addr; +} + +/* + * Tx descriptors/RXF0/CMB DMA blocks share ALE_DESC_ADDR_HI register + * which specifies high address region of DMA blocks. Therefore these + * blocks should have the same high address of given 4GB address + * space(i.e. crossing 4GB boundary is not allowed). + */ +static int +ale_check_boundary(struct ale_softc *sc) +{ + bus_addr_t rx_cmb_end[ALE_RX_PAGES], tx_cmb_end; + bus_addr_t rx_page_end[ALE_RX_PAGES], tx_ring_end; + + rx_page_end[0] = sc->ale_cdata.ale_rx_page[0].page_paddr + + sc->ale_pagesize; + rx_page_end[1] = sc->ale_cdata.ale_rx_page[1].page_paddr + + sc->ale_pagesize; + tx_ring_end = sc->ale_cdata.ale_tx_ring_paddr + ALE_TX_RING_SZ; + tx_cmb_end = sc->ale_cdata.ale_tx_cmb_paddr + ALE_TX_CMB_SZ; + rx_cmb_end[0] = sc->ale_cdata.ale_rx_page[0].cmb_paddr + ALE_RX_CMB_SZ; + rx_cmb_end[1] = sc->ale_cdata.ale_rx_page[1].cmb_paddr + ALE_RX_CMB_SZ; + + if ((ALE_ADDR_HI(tx_ring_end) != + ALE_ADDR_HI(sc->ale_cdata.ale_tx_ring_paddr)) || + (ALE_ADDR_HI(rx_page_end[0]) != + ALE_ADDR_HI(sc->ale_cdata.ale_rx_page[0].page_paddr)) || + (ALE_ADDR_HI(rx_page_end[1]) != + ALE_ADDR_HI(sc->ale_cdata.ale_rx_page[1].page_paddr)) || + (ALE_ADDR_HI(tx_cmb_end) != + ALE_ADDR_HI(sc->ale_cdata.ale_tx_cmb_paddr)) || + (ALE_ADDR_HI(rx_cmb_end[0]) != + ALE_ADDR_HI(sc->ale_cdata.ale_rx_page[0].cmb_paddr)) || + (ALE_ADDR_HI(rx_cmb_end[1]) != + ALE_ADDR_HI(sc->ale_cdata.ale_rx_page[1].cmb_paddr))) + return (EFBIG); + + if ((ALE_ADDR_HI(tx_ring_end) != ALE_ADDR_HI(rx_page_end[0])) || *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Wed Nov 12 10:01:16 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 79AD1106567A; Wed, 12 Nov 2008 10:01: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 6BEF38FC17; Wed, 12 Nov 2008 10:01:16 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mACA1GL2026165; Wed, 12 Nov 2008 10:01:16 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mACA1GE8026164; Wed, 12 Nov 2008 10:01:16 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200811121001.mACA1GE8026164@svn.freebsd.org> From: Pyun YongHyeon Date: Wed, 12 Nov 2008 10:01: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: r184871 - head/usr.sbin/sysinstall X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Nov 2008 10:01:16 -0000 Author: yongari Date: Wed Nov 12 10:01:16 2008 New Revision: 184871 URL: http://svn.freebsd.org/changeset/base/184871 Log: Add ale(4) to the list of supported network interface. Modified: head/usr.sbin/sysinstall/devices.c Modified: head/usr.sbin/sysinstall/devices.c ============================================================================== --- head/usr.sbin/sysinstall/devices.c Wed Nov 12 09:52:06 2008 (r184870) +++ head/usr.sbin/sysinstall/devices.c Wed Nov 12 10:01:16 2008 (r184871) @@ -95,6 +95,7 @@ static struct _devname { SERIAL("cuad%d", "%s on device %s (COM%d)", 16), NETWORK("ae", "Attansic/Atheros L2 FastEthernet"), NETWORK("age", "Attansic/Atheros L1 Gigabit Ethernet"), + NETWORK("ale", "Atheros AR8121/AR8113/AR8114 PCIe Ethernet"), NETWORK("an", "Aironet 4500/4800 802.11 wireless adapter"), NETWORK("ath", "Atheros IEEE 802.11 wireless adapter"), NETWORK("aue", "ADMtek USB Ethernet adapter"), From owner-svn-src-head@FreeBSD.ORG Wed Nov 12 10:20:29 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C7F98106568B; Wed, 12 Nov 2008 10:20:29 +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 B85C48FC1E; Wed, 12 Nov 2008 10:20:29 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mACAKTHR027734; Wed, 12 Nov 2008 10:20:29 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mACAKTPx027729; Wed, 12 Nov 2008 10:20:29 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200811121020.mACAKTPx027729@svn.freebsd.org> From: Pyun YongHyeon Date: Wed, 12 Nov 2008 10: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: r184872 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Nov 2008 10:20:30 -0000 Author: yongari Date: Wed Nov 12 10:20:29 2008 New Revision: 184872 URL: http://svn.freebsd.org/changeset/base/184872 Log: Add ale(4) man page and hook up ale(4) to the build. Also add Xr to appropriate man pages. Added: head/share/man/man4/ale.4 (contents, props changed) Modified: head/share/man/man4/Makefile head/share/man/man4/altq.4 head/share/man/man4/miibus.4 head/share/man/man4/vlan.4 Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Wed Nov 12 10:01:16 2008 (r184871) +++ head/share/man/man4/Makefile Wed Nov 12 10:20:29 2008 (r184872) @@ -23,6 +23,7 @@ MAN= aac.4 \ ahc.4 \ ahd.4 \ aio.4 \ + ale.4 \ altq.4 \ amd.4 \ ${_amdsmb.4} \ Added: head/share/man/man4/ale.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/ale.4 Wed Nov 12 10:20:29 2008 (r184872) @@ -0,0 +1,162 @@ +.\" Copyright (c) 2008 Pyun YongHyeon +.\" 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 12, 2008 +.Dt ALE 4 +.Os +.Sh NAME +.Nm ale +.Nd Atheros AR8121/AR8113/AR8114 Gigabit/Fast Ethernet driver +.Sh SYNOPSIS +To compile this driver into the kernel, +place the following lines in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd "device miibus" +.Cd "device ale" +.Ed +.Pp +Alternatively, to load the driver as a +module at boot time, place the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +if_ale_load="YES" +.Ed +.Sh DESCRIPTION +The +.Nm +device driver provides support for Atheros AR8121 PCI Express +Gigabit Ethernet controller and Atheros AR8113/AR8114 PCI +Express Fast Ethernet controllers. +.Pp +All LOMs supported by the +.Nm +driver have TCP/UDP/IP checksum offload for both receive and transmit, +TCP segmentation offload (TSO), hardware VLAN tag stripping/insertion +features, Wake On Lan (WOL) and an interrupt coalescing/moderation +mechanism as well as a 64-bit multicast hash filter. +.Pp +The AR8121 also supports Jumbo Frames (up to 8132 bytes), which can +be configured via the interface MTU setting. +Selecting an MTU larger than 1500 bytes with the +.Xr ifconfig 8 +utility configures the adapter to receive and transmit Jumbo Frames. +.Pp +The +.Nm +driver supports the following media types: +.Bl -tag -width ".Cm 10baseT/UTP" +.It Cm autoselect +Enable autoselection of the media type and options. +The user can manually override +the autoselected mode by adding media options to +.Xr rc.conf 5 . +.It Cm 10baseT/UTP +Set 10Mbps operation. +.It Cm 100baseTX +Set 100Mbps (Fast Ethernet) operation. +.It Cm 1000baseTX +Set 1000baseTX operation over twisted pair. +.El +.Pp +The +.Nm +driver supports the following media options: +.Bl -tag -width ".Cm full-duplex" +.It Cm full-duplex +Force full duplex operation. +.It Cm half-duplex +Force half duplex operation. +.El +.Pp +For more information on configuring this device, see +.Xr ifconfig 8 . +.Sh HARDWARE +The +.Nm +device driver provides support for the following Ethernet controllers: +.Pp +.Bl -bullet -compact +.It +Atheros AR8113 PCI Express Fast Ethernet controller +.It +Atheros AR8114 PCI Express Fast Ethernet controller +.It +Atheros AR8121 PCI Express Gigabit Ethernet controller +.El +.Sh LOADER TUNABLES +Tunables can be set at the +.Xr loader 8 +prompt before booting the kernel or stored in +.Xr loader.conf 5 . +.Bl -tag -width "xxxxxx" +.It Va hw.ale.msi_disable +This tunable disables MSI support on the Ethernet hardware. +The default value is 0. +.It Va hw.ale.msix_disable +This tunable disables MSI-X support on the Ethernet hardware. +The default value is 0. +.El +.Sh SYSCTL VARIABLES +The following variables are available as both +.Xr sysctl 8 +variables and +.Xr loader 8 +tunables: +.Bl -tag -width "xxxxxx" +.It Va dev.ale.%d.int_rx_mod +Maximum amount of time to delay receive interrupt processing in +units of 1us. +The accepted range is 0 to 130000, the default is 30(30us). +Value 0 completely disables the interrupt moderation. +.It Va dev.ale.%d.int_tx_mod +Maximum amount of time to delay transmit interrupt processing in +units of 1us. +The accepted range is 0 to 130000, the default is 1000(1ms). +Value 0 completely disables the interrupt moderation. +.It Va dev.ale.%d.process_limit +Maximum amount of Rx frames to be processed in the event loop before +rescheduling a taskqueue. +The accepted range is 32 to 255, the default value is 128 events. +The interface does not need to be brought down and up again before +a change takes effect. +.El +.Sh SEE ALSO +.Xr altq 4 , +.Xr arp 4 , +.Xr miibus 4 , +.Xr netintro 4 , +.Xr ng_ether 4 , +.Xr vlan 4 , +.Xr ifconfig 8 +.Sh HISTORY +The +.Nm +driver was written by +.An Pyun YongHyeon +.Aq yongari@FreeBSD.org . +It first appeared in +.Fx 7.1 . Modified: head/share/man/man4/altq.4 ============================================================================== --- head/share/man/man4/altq.4 Wed Nov 12 10:01:16 2008 (r184871) +++ head/share/man/man4/altq.4 Wed Nov 12 10:20:29 2008 (r184872) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 27, 2008 +.Dd November 22, 2008 .Dt ALTQ 4 .Os .Sh NAME @@ -116,6 +116,7 @@ are required to use a certain network ca .Nm . They have been applied to the following hardware drivers: .Xr age 4 , +.Xr ale 4 , .Xr an 4 , .Xr ath 4 , .Xr aue 4 , Modified: head/share/man/man4/miibus.4 ============================================================================== --- head/share/man/man4/miibus.4 Wed Nov 12 10:01:16 2008 (r184871) +++ head/share/man/man4/miibus.4 Wed Nov 12 10:20:29 2008 (r184872) @@ -8,7 +8,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 20, 2008 +.Dd November 22, 2008 .Dt MIIBUS 4 .Os .Sh NAME @@ -47,6 +47,8 @@ interface: .Bl -tag -compact -width ".Xr fxp 4" .It Xr age 4 Attansic/Atheros L1 Gigabit Ethernet +.It Xr ale 4 +Atheros AR8121/AR8113/AR8114 PCIe Ethernet .It Xr aue 4 ADMtek USB Ethernet .It Xr axe 4 @@ -125,6 +127,7 @@ and but as a result are not well behaved newbus device drivers. .Sh SEE ALSO .Xr age 4 , +.Xr ale 4 , .Xr arp 4 , .Xr aue 4 , .Xr axe 4 , Modified: head/share/man/man4/vlan.4 ============================================================================== --- head/share/man/man4/vlan.4 Wed Nov 12 10:01:16 2008 (r184871) +++ head/share/man/man4/vlan.4 Wed Nov 12 10:20:29 2008 (r184872) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 27, 2008 +.Dd November 22, 2008 .Dt VLAN 4 .Os .Sh NAME @@ -124,6 +124,7 @@ By now, the list of physical interfaces in the hardware is limited to the following devices: .Xr ae 4 , .Xr age 4 , +.Xr ale 4 , .Xr bce 4 , .Xr bge 4 , .Xr cxgb 4 , From owner-svn-src-head@FreeBSD.ORG Wed Nov 12 10:31:07 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 574BE1065678; Wed, 12 Nov 2008 10:31:07 +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 497698FC20; Wed, 12 Nov 2008 10:31:07 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mACAV70l027949; Wed, 12 Nov 2008 10:31:07 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mACAV6SO027946; Wed, 12 Nov 2008 10:31:06 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200811121031.mACAV6SO027946@svn.freebsd.org> From: Pyun YongHyeon Date: Wed, 12 Nov 2008 10:31: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: r184873 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Nov 2008 10:31:07 -0000 Author: yongari Date: Wed Nov 12 10:31:06 2008 New Revision: 184873 URL: http://svn.freebsd.org/changeset/base/184873 Log: Correct .Dd Pointed out by: maxim Modified: head/share/man/man4/altq.4 head/share/man/man4/miibus.4 head/share/man/man4/vlan.4 Modified: head/share/man/man4/altq.4 ============================================================================== --- head/share/man/man4/altq.4 Wed Nov 12 10:20:29 2008 (r184872) +++ head/share/man/man4/altq.4 Wed Nov 12 10:31:06 2008 (r184873) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 22, 2008 +.Dd November 12, 2008 .Dt ALTQ 4 .Os .Sh NAME Modified: head/share/man/man4/miibus.4 ============================================================================== --- head/share/man/man4/miibus.4 Wed Nov 12 10:20:29 2008 (r184872) +++ head/share/man/man4/miibus.4 Wed Nov 12 10:31:06 2008 (r184873) @@ -8,7 +8,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 22, 2008 +.Dd November 12, 2008 .Dt MIIBUS 4 .Os .Sh NAME Modified: head/share/man/man4/vlan.4 ============================================================================== --- head/share/man/man4/vlan.4 Wed Nov 12 10:20:29 2008 (r184872) +++ head/share/man/man4/vlan.4 Wed Nov 12 10:31:06 2008 (r184873) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 22, 2008 +.Dd November 12, 2008 .Dt VLAN 4 .Os .Sh NAME From owner-svn-src-head@FreeBSD.ORG Wed Nov 12 12:21:19 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 475C6106567C; Wed, 12 Nov 2008 12:21:19 +0000 (UTC) (envelope-from dfr@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 231248FC18; Wed, 12 Nov 2008 12:21:19 +0000 (UTC) (envelope-from dfr@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mACCLJXB030058; Wed, 12 Nov 2008 12:21:19 GMT (envelope-from dfr@svn.freebsd.org) Received: (from dfr@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mACCLJUa030057; Wed, 12 Nov 2008 12:21:19 GMT (envelope-from dfr@svn.freebsd.org) Message-Id: <200811121221.mACCLJUa030057@svn.freebsd.org> From: Doug Rabson Date: Wed, 12 Nov 2008 12:21:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184877 - head/sys/rpc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Nov 2008 12:21:19 -0000 Author: dfr Date: Wed Nov 12 12:21:18 2008 New Revision: 184877 URL: http://svn.freebsd.org/changeset/base/184877 Log: Add a missing call to mtx_destroy(). Modified: head/sys/rpc/clnt_vc.c Modified: head/sys/rpc/clnt_vc.c ============================================================================== --- head/sys/rpc/clnt_vc.c Wed Nov 12 10:54:04 2008 (r184876) +++ head/sys/rpc/clnt_vc.c Wed Nov 12 12:21:18 2008 (r184877) @@ -299,6 +299,7 @@ clnt_vc_create( err: if (cl) { if (ct) { + mtx_destroy(&ct->ct_lock); mem_free(ct, sizeof (struct ct_data)); } if (cl) From owner-svn-src-head@FreeBSD.ORG Wed Nov 12 13:11:42 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0F43B106564A; Wed, 12 Nov 2008 13:11:42 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id A943D8FC0C; Wed, 12 Nov 2008 13:11:41 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from localhost.corp.yahoo.com (john@localhost [IPv6:::1]) (authenticated bits=0) by server.baldwin.cx (8.14.3/8.14.3) with ESMTP id mACDBNK6084446; Wed, 12 Nov 2008 08:11:35 -0500 (EST) (envelope-from jhb@freebsd.org) From: John Baldwin To: Ed Schouten Date: Tue, 11 Nov 2008 11:25:33 -0500 User-Agent: KMail/1.9.7 References: <200811111455.mABEtxRH004631@svn.freebsd.org> In-Reply-To: <200811111455.mABEtxRH004631@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200811111125.33478.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [IPv6:::1]); Wed, 12 Nov 2008 08:11:35 -0500 (EST) X-Virus-Scanned: ClamAV 0.93.1/8620/Wed Nov 12 04:05:38 2008 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.0 required=4.2 tests=AWL,BAYES_00, DATE_IN_PAST_12_24,NO_RELAYS autolearn=no version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r184849 - in head: lib/libc/sys sys/amd64/linux32 sys/i386/linux sys/kern sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Nov 2008 13:11:42 -0000 On Tuesday 11 November 2008 09:55:59 am Ed Schouten wrote: > Author: ed > Date: Tue Nov 11 14:55:59 2008 > New Revision: 184849 > URL: http://svn.freebsd.org/changeset/base/184849 > > Log: > Several cleanups related to pipe(2). > > - Use `fildes[2]' instead of `*fildes' to make more clear that pipe(2) > fills an array with two descriptors. > > - Remove EFAULT from the manual page. Because of the current calling > convention, pipe(2) raises a segmentation fault when an invalid > address is passed. > > - Introduce kern_pipe() to make it easier for binary emulations to > implement pipe(2). > > - Make Linux binary emulation use kern_pipe(), which means we don't have > to recover td_retval after calling the FreeBSD system call. To close fd's safely on error you need to use fdclose(). That would mean returning the actual 'struct file *' pointers from kern_pipe() and requiring the caller to fdrop(), but that is not a big deal. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Wed Nov 12 13:32:20 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4C762106564A; Wed, 12 Nov 2008 13:32:20 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 43A408FC12; Wed, 12 Nov 2008 13:32:20 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mACDWKnT031603; Wed, 12 Nov 2008 13:32:20 GMT (envelope-from cperciva@svn.freebsd.org) Received: (from cperciva@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mACDWKa0031601; Wed, 12 Nov 2008 13:32:20 GMT (envelope-from cperciva@svn.freebsd.org) Message-Id: <200811121332.mACDWKa0031601@svn.freebsd.org> From: Colin Percival Date: Wed, 12 Nov 2008 13:32:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184881 - head/sys/dev/usb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Nov 2008 13:32:20 -0000 Author: cperciva Date: Wed Nov 12 13:32:19 2008 New Revision: 184881 URL: http://svn.freebsd.org/changeset/base/184881 Log: Add support for the Microsoft Comfort Optical Mouse 3000 (model 1043). PR: usb/128760 Submitted by: Arjan de Vet Modified: head/sys/dev/usb/usb_quirks.c head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/usb_quirks.c ============================================================================== --- head/sys/dev/usb/usb_quirks.c Wed Nov 12 12:38:48 2008 (r184880) +++ head/sys/dev/usb/usb_quirks.c Wed Nov 12 13:32:19 2008 (r184881) @@ -90,6 +90,8 @@ static const struct usbd_quirk_entry { ANY, { UQ_MS_BAD_CLASS | UQ_MS_LEADING_BYTE }}, { USB_VENDOR_MICROSOFT, USB_PRODUCT_MICROSOFT_WLINTELLIMOUSE, ANY, { UQ_MS_LEADING_BYTE }}, + { USB_VENDOR_MICROSOFT, USB_PRODUCT_MICROSOFT_COMFORT3000, + ANY, { UQ_MS_BAD_CLASS | UQ_MS_LEADING_BYTE }}, { USB_VENDOR_SONY, USB_PRODUCT_SONY_RF_RECEIVER, ANY,{ UQ_MS_BAD_CLASS }}, Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Wed Nov 12 12:38:48 2008 (r184880) +++ head/sys/dev/usb/usbdevs Wed Nov 12 13:32:19 2008 (r184881) @@ -1702,6 +1702,7 @@ product MICROSOFT MN510 0x006e MN510 Wi product MICROSOFT MN110 0x007a 10/100 USB NIC product MICROSOFT WLINTELLIMOUSE 0x008c Wireless Optical IntelliMouse product MICROSOFT WLNOTEBOOK 0x00b9 Wireless Optical Mouse (Model 1023) +product MICROSOFT COMFORT3000 0x00d1 Comfort Optical Mouse 3000 (Model 1043) product MICROSOFT WLNOTEBOOK2 0x00e1 Wireless Optical Mouse 3000 (Model 1056) product MICROSOFT WLNOTEBOOK3 0x00d2 Wireless Optical Mouse 3000 (Model 1049) product MICROSOFT WLUSBMOUSE 0x00b9 Wireless USB Mouse From owner-svn-src-head@FreeBSD.ORG Wed Nov 12 13:58:59 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D2C36106567C; Wed, 12 Nov 2008 13:58:59 +0000 (UTC) (envelope-from keramida@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CABAA8FC14; Wed, 12 Nov 2008 13:58:59 +0000 (UTC) (envelope-from keramida@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mACDwxOJ032149; Wed, 12 Nov 2008 13:58:59 GMT (envelope-from keramida@svn.freebsd.org) Received: (from keramida@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mACDwxuH032147; Wed, 12 Nov 2008 13:58:59 GMT (envelope-from keramida@svn.freebsd.org) Message-Id: <200811121358.mACDwxuH032147@svn.freebsd.org> From: Giorgos Keramidas Date: Wed, 12 Nov 2008 13:58: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: r184882 - head/sys/dev/usb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Nov 2008 13:58:59 -0000 Author: keramida (doc committer) Date: Wed Nov 12 13:58:59 2008 New Revision: 184882 URL: http://svn.freebsd.org/changeset/base/184882 Log: Add a quirk for Belkin USB Bluetooth adapters (F8T012xx1 series) The same (vendor, product) tuple is used for aue(4) adapters, but I am not sure if the quirk is correct. I'm using the USB device 'release' info to skip aue(4) detection right now, but if there's a better way to differentiate between USB-LAN and USB Bluetooth we should update the quirk. Reviewed by: imp, rink MFC after: 2 weeks Modified: head/sys/dev/usb/if_aue.c head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/if_aue.c ============================================================================== --- head/sys/dev/usb/if_aue.c Wed Nov 12 13:32:19 2008 (r184881) +++ head/sys/dev/usb/if_aue.c Wed Nov 12 13:58:59 2008 (r184882) @@ -630,6 +630,15 @@ aue_match(device_t self) if (uaa->iface != NULL) return (UMATCH_NONE); + /* + * Belkin USB Bluetooth dongles of the F8T012xx1 model series conflict + * with older Belkin USB2LAN adapters. Skip if_aue if we detect one of + * the devices that look like Bluetooth adapters. + */ + if (uaa->vendor == USB_VENDOR_BELKIN && + uaa->product == USB_PRODUCT_BELKIN_F8T012 && uaa->release == 0x0413) + return (UMATCH_NONE); + return (aue_lookup(uaa->vendor, uaa->product) != NULL ? UMATCH_VENDOR_PRODUCT : UMATCH_NONE); } Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Wed Nov 12 13:32:19 2008 (r184881) +++ head/sys/dev/usb/usbdevs Wed Nov 12 13:58:59 2008 (r184882) @@ -932,6 +932,7 @@ product BELKIN FBT003V 0x0084 FBT003v2 product BELKIN F5U103 0x0103 F5U103 Serial product BELKIN F5U109 0x0109 F5U109 Serial product BELKIN USB2SCSI 0x0115 USB to SCSI +product BELKIN F8T012 0x0121 F8T012xx1 Bluetooth USB Adapter product BELKIN USB2LAN 0x0121 USB to LAN product BELKIN F5U208 0x0208 F5U208 VideoBus II product BELKIN F5U237 0x0237 F5U237 USB 2.0 7-Port Hub From owner-svn-src-head@FreeBSD.ORG Wed Nov 12 14:16:40 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1D588106564A; Wed, 12 Nov 2008 14:16:40 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 152E68FC14; Wed, 12 Nov 2008 14:16:40 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mACEGdIJ032499; Wed, 12 Nov 2008 14:16:39 GMT (envelope-from rrs@svn.freebsd.org) Received: (from rrs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mACEGdfX032493; Wed, 12 Nov 2008 14:16:39 GMT (envelope-from rrs@svn.freebsd.org) Message-Id: <200811121416.mACEGdfX032493@svn.freebsd.org> From: Randall Stewart Date: Wed, 12 Nov 2008 14:16:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184883 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Nov 2008 14:16:40 -0000 Author: rrs Date: Wed Nov 12 14:16:39 2008 New Revision: 184883 URL: http://svn.freebsd.org/changeset/base/184883 Log: -Improvement: Add '\n' on debug output in sctp_lower_sosend(). -Improvement: panic() on INVARIANTS kernels if memory allocation fails for a tagblock in sctp_add_vtag_to_timewait(). -Bugfix: Protect code in sctp_is_in_timewait() by SCTP_INP_INFO_WLOCK/SCTP_INP_INFO_WUNLOCK. -Cleanup: Get rid of unused variable now in sctp_init_asoc(). -Bugfix: Reuse the correct vtag in sctp_add_vtag_to_timewait(). -Cleanup: Get rid of unused constant SCTP_TIME_WAIT_SHORT in sctp_constants.h. -Improvement: Use all hash buckets of the vtag hash table. -Cleanup: Get rid of then unused constant SCTP_STACK_VTAG_HASH_SIZE_A. -Bugfix: Handle SHUTDOWN;SACK packet correctly. -Bugfix: Last TSN in a gap ack block was not being "ack'd" in the internal scoreboard. Obtained from: (with help from Michael Tuexen) Modified: head/sys/netinet/sctp_constants.h head/sys/netinet/sctp_indata.c head/sys/netinet/sctp_input.c head/sys/netinet/sctp_pcb.c head/sys/netinet/sctp_pcb.h head/sys/netinet/sctputil.c Modified: head/sys/netinet/sctp_constants.h ============================================================================== --- head/sys/netinet/sctp_constants.h Wed Nov 12 13:58:59 2008 (r184882) +++ head/sys/netinet/sctp_constants.h Wed Nov 12 14:16:39 2008 (r184883) @@ -1001,8 +1001,7 @@ __FBSDID("$FreeBSD$"); * entries must be searched to see if the tag is in timed wait. If so we * reject it. */ -#define SCTP_STACK_VTAG_HASH_SIZE 31 -#define SCTP_STACK_VTAG_HASH_SIZE_A 32 +#define SCTP_STACK_VTAG_HASH_SIZE 32 /* @@ -1016,12 +1015,6 @@ __FBSDID("$FreeBSD$"); */ #define SCTP_TIME_WAIT 60 -/* This time wait is the same as the default cookie life - * since we now enter a tag in every time we send a cookie. - * We want this shorter to avoid vtag depletion. - */ -#define SCTP_TIME_WAIT_SHORT 60 - /* The system retains a cache of free chunks such to * cut down on calls the memory allocation system. There * is a per association limit of free items and a overall Modified: head/sys/netinet/sctp_indata.c ============================================================================== --- head/sys/netinet/sctp_indata.c Wed Nov 12 13:58:59 2008 (r184882) +++ head/sys/netinet/sctp_indata.c Wed Nov 12 14:16:39 2008 (r184883) @@ -2766,8 +2766,8 @@ sctp_handle_segments(struct mbuf *m, int struct sctp_sack *sack; struct sctp_gap_ack_block *frag, block; struct sctp_tmit_chunk *tp1; - int i; - unsigned int j; + int i, j; + unsigned int theTSN; int num_frs = 0; uint16_t frag_strt, frag_end, primary_flag_set; @@ -2835,7 +2835,8 @@ sctp_handle_segments(struct mbuf *m, int } last_frag_high = frag_end + last_tsn; } - for (j = frag_strt + last_tsn; (compare_with_wrap((frag_end + last_tsn), j, MAX_TSN)); j++) { + for (j = frag_strt; j <= frag_end; j++) { + theTSN = j + last_tsn; while (tp1) { if (tp1->rec.data.doing_fast_retransmit) num_frs++; @@ -2858,7 +2859,7 @@ sctp_handle_segments(struct mbuf *m, int tp1->whoTo->rtx_pseudo_cumack = tp1->rec.data.TSN_seq; tp1->whoTo->find_rtx_pseudo_cumack = 0; } - if (tp1->rec.data.TSN_seq == j) { + if (tp1->rec.data.TSN_seq == theTSN) { if (tp1->sent != SCTP_DATAGRAM_UNSENT) { /* * must be held until @@ -3030,8 +3031,8 @@ sctp_handle_segments(struct mbuf *m, int } } break; - } /* if (tp1->TSN_seq == j) */ - if (compare_with_wrap(tp1->rec.data.TSN_seq, j, + } /* if (tp1->TSN_seq == theTSN) */ + if (compare_with_wrap(tp1->rec.data.TSN_seq, theTSN, MAX_TSN)) break; Modified: head/sys/netinet/sctp_input.c ============================================================================== --- head/sys/netinet/sctp_input.c Wed Nov 12 13:58:59 2008 (r184882) +++ head/sys/netinet/sctp_input.c Wed Nov 12 14:16:39 2008 (r184883) @@ -4280,7 +4280,6 @@ process_control_chunks: if ((stcb == NULL) || (chk_length < sizeof(struct sctp_sack_chunk))) { SCTPDBG(SCTP_DEBUG_INDATA1, "Bad size on sack chunk, too small\n"); - ignore_sack: *offset = length; if (locked_tcb) { SCTP_TCB_UNLOCK(locked_tcb); @@ -4293,7 +4292,7 @@ process_control_chunks: * attention to a sack sent in to us since * we don't care anymore. */ - goto ignore_sack; + break; } sack = (struct sctp_sack_chunk *)ch; nonce_sum_flag = ch->chunk_flags & SCTP_SACK_NONCE_SUM; Modified: head/sys/netinet/sctp_pcb.c ============================================================================== --- head/sys/netinet/sctp_pcb.c Wed Nov 12 13:58:59 2008 (r184882) +++ head/sys/netinet/sctp_pcb.c Wed Nov 12 14:16:39 2008 (r184883) @@ -4196,6 +4196,7 @@ sctp_is_in_timewait(uint32_t tag) int found = 0; int i; + SCTP_INP_INFO_WLOCK(); chain = &SCTP_BASE_INFO(vtag_timewait)[(tag % SCTP_STACK_VTAG_HASH_SIZE)]; if (!SCTP_LIST_EMPTY(chain)) { LIST_FOREACH(twait_block, chain, sctp_nxt_tagblock) { @@ -4209,6 +4210,7 @@ sctp_is_in_timewait(uint32_t tag) break; } } + SCTP_INP_INFO_WUNLOCK(); return (found); } @@ -4241,8 +4243,8 @@ sctp_add_vtag_to_timewait(uint32_t tag, twait_block->vtag_block[i].v_tag = 0; if (set == 0) { /* Reuse it for my new tag */ - twait_block->vtag_block[0].tv_sec_at_expire = now.tv_sec + time; - twait_block->vtag_block[0].v_tag = tag; + twait_block->vtag_block[i].tv_sec_at_expire = now.tv_sec + time; + twait_block->vtag_block[i].v_tag = tag; set = 1; } } @@ -4261,6 +4263,9 @@ sctp_add_vtag_to_timewait(uint32_t tag, SCTP_MALLOC(twait_block, struct sctp_tagblock *, sizeof(struct sctp_tagblock), SCTP_M_TIMW); if (twait_block == NULL) { +#ifdef INVARIANTS + panic("Can not alloc tagblock"); +#endif return; } memset(twait_block, 0, sizeof(struct sctp_tagblock)); @@ -5397,7 +5402,7 @@ sctp_pcb_init() SCTP_OS_TIMER_INIT(&SCTP_BASE_INFO(addr_wq_timer.timer)); /* Init the TIMEWAIT list */ - for (i = 0; i < SCTP_STACK_VTAG_HASH_SIZE_A; i++) { + for (i = 0; i < SCTP_STACK_VTAG_HASH_SIZE; i++) { LIST_INIT(&SCTP_BASE_INFO(vtag_timewait[i])); } @@ -5467,7 +5472,7 @@ sctp_pcb_finish(void) * free the TIMEWAIT list elements malloc'd in the function * sctp_add_vtag_to_timewait()... */ - for (i = 0; i < SCTP_STACK_VTAG_HASH_SIZE_A; i++) { + for (i = 0; i < SCTP_STACK_VTAG_HASH_SIZE; i++) { chain = &SCTP_BASE_INFO(vtag_timewait)[i]; if (!SCTP_LIST_EMPTY(chain)) { prev_twait_block = NULL; Modified: head/sys/netinet/sctp_pcb.h ============================================================================== --- head/sys/netinet/sctp_pcb.h Wed Nov 12 13:58:59 2008 (r184882) +++ head/sys/netinet/sctp_pcb.h Wed Nov 12 14:16:39 2008 (r184883) @@ -228,7 +228,7 @@ struct sctp_epinfo { uint32_t ipi_free_strmoq; - struct sctpvtaghead vtag_timewait[SCTP_STACK_VTAG_HASH_SIZE_A]; + struct sctpvtaghead vtag_timewait[SCTP_STACK_VTAG_HASH_SIZE]; /* address work queue handling */ #if defined(SCTP_USE_THREAD_BASED_ITERATOR) Modified: head/sys/netinet/sctputil.c ============================================================================== --- head/sys/netinet/sctputil.c Wed Nov 12 13:58:59 2008 (r184882) +++ head/sys/netinet/sctputil.c Wed Nov 12 14:16:39 2008 (r184883) @@ -910,9 +910,6 @@ sctp_init_asoc(struct sctp_inpcb *m, str #endif asoc->sb_send_resv = 0; if (override_tag) { - struct timeval now; - - (void)SCTP_GETTIME_TIMEVAL(&now); if (sctp_is_in_timewait(override_tag)) { /* * It must be in the time-wait hash, we put it there @@ -1466,6 +1463,9 @@ sctp_timeout_handler(void *t) SCTP_INP_INCR_REF(inp); if ((inp->sctp_socket == 0) && ((tmr->type != SCTP_TIMER_TYPE_INPKILL) && + (tmr->type != SCTP_TIMER_TYPE_SEND) && + (tmr->type != SCTP_TIMER_TYPE_RECV) && + (tmr->type != SCTP_TIMER_TYPE_HEARTBEAT) && (tmr->type != SCTP_TIMER_TYPE_SHUTDOWN) && (tmr->type != SCTP_TIMER_TYPE_SHUTDOWNACK) && (tmr->type != SCTP_TIMER_TYPE_SHUTDOWNGUARD) && From owner-svn-src-head@FreeBSD.ORG Wed Nov 12 15:30:30 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5B6D81065674; Wed, 12 Nov 2008 15:30:30 +0000 (UTC) (envelope-from dfr@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5497D8FC13; Wed, 12 Nov 2008 15:30:30 +0000 (UTC) (envelope-from dfr@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mACFUUmx033936; Wed, 12 Nov 2008 15:30:30 GMT (envelope-from dfr@svn.freebsd.org) Received: (from dfr@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mACFUUBK033935; Wed, 12 Nov 2008 15:30:30 GMT (envelope-from dfr@svn.freebsd.org) Message-Id: <200811121530.mACFUUBK033935@svn.freebsd.org> From: Doug Rabson Date: Wed, 12 Nov 2008 15:30: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: r184886 - head/sys/nlm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Nov 2008 15:30:30 -0000 Author: dfr Date: Wed Nov 12 15:30:30 2008 New Revision: 184886 URL: http://svn.freebsd.org/changeset/base/184886 Log: Don't call svc_freereq() before svc_freeargs(). Modified: head/sys/nlm/nlm_prot_svc.c Modified: head/sys/nlm/nlm_prot_svc.c ============================================================================== --- head/sys/nlm/nlm_prot_svc.c Wed Nov 12 14:45:51 2008 (r184885) +++ head/sys/nlm/nlm_prot_svc.c Wed Nov 12 15:30:30 2008 (r184886) @@ -83,11 +83,11 @@ nlm_prog_0(struct svc_req *rqstp, SVCXPR if (retval > 0 && !svc_sendreply(rqstp, xdr_result, (char *)&result)) { svcerr_systemerr(rqstp); } - svc_freereq(rqstp); if (!svc_freeargs(rqstp, xdr_argument, (char *)(caddr_t) &argument)) { printf("unable to free arguments"); //exit(1); } + svc_freereq(rqstp); return; } From owner-svn-src-head@FreeBSD.ORG Wed Nov 12 15:31:06 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 140371065679; Wed, 12 Nov 2008 15:31:06 +0000 (UTC) (envelope-from dfr@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E7FDE8FC27; Wed, 12 Nov 2008 15:31:05 +0000 (UTC) (envelope-from dfr@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mACFV5Ya033985; Wed, 12 Nov 2008 15:31:05 GMT (envelope-from dfr@svn.freebsd.org) Received: (from dfr@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mACFV5ZY033984; Wed, 12 Nov 2008 15:31:05 GMT (envelope-from dfr@svn.freebsd.org) Message-Id: <200811121531.mACFV5ZY033984@svn.freebsd.org> From: Doug Rabson Date: Wed, 12 Nov 2008 15:31:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184887 - head/sys/kgssapi X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Nov 2008 15:31:06 -0000 Author: dfr Date: Wed Nov 12 15:31:05 2008 New Revision: 184887 URL: http://svn.freebsd.org/changeset/base/184887 Log: Call svc_freereq() before returning from the service proc. Modified: head/sys/kgssapi/gsstest.c Modified: head/sys/kgssapi/gsstest.c ============================================================================== --- head/sys/kgssapi/gsstest.c Wed Nov 12 15:30:30 2008 (r184886) +++ head/sys/kgssapi/gsstest.c Wed Nov 12 15:31:05 2008 (r184887) @@ -970,6 +970,7 @@ server_program_1(struct svc_req *rqstp, } out: + svc_freereq(rqstp); return; } From owner-svn-src-head@FreeBSD.ORG Wed Nov 12 15:40:15 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F26AD1065688; Wed, 12 Nov 2008 15:40:14 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from pele.citylink.co.nz (pele.citylink.co.nz [202.8.44.226]) by mx1.freebsd.org (Postfix) with ESMTP id BD6E28FC19; Wed, 12 Nov 2008 15:40:14 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from localhost (localhost [127.0.0.1]) by pele.citylink.co.nz (Postfix) with ESMTP id 0FA322BC47; Thu, 13 Nov 2008 04:40:14 +1300 (NZDT) X-Virus-Scanned: Debian amavisd-new at citylink.co.nz Received: from pele.citylink.co.nz ([127.0.0.1]) by localhost (pele.citylink.co.nz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id aSyWV1nB1-uj; Thu, 13 Nov 2008 04:40:09 +1300 (NZDT) Received: from citylink.fud.org.nz (unknown [202.8.44.45]) by pele.citylink.co.nz (Postfix) with ESMTP; Thu, 13 Nov 2008 04:40:09 +1300 (NZDT) Received: by citylink.fud.org.nz (Postfix, from userid 1001) id 85EEC1142D; Thu, 13 Nov 2008 04:40:09 +1300 (NZDT) Date: Wed, 12 Nov 2008 07:40:09 -0800 From: Andrew Thompson To: Pyun YongHyeon Message-ID: <20081112154009.GD45411@citylink.fud.org.nz> References: <200811120952.mAC9q6H3025912@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200811120952.mAC9q6H3025912@svn.freebsd.org> User-Agent: Mutt/1.5.17 (2007-11-01) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r184870 - in head/sys: amd64/conf boot/forth conf dev/ale i386/conf modules modules/ale X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Nov 2008 15:40:15 -0000 On Wed, Nov 12, 2008 at 09:52:06AM +0000, Pyun YongHyeon wrote: > Author: yongari > Date: Wed Nov 12 09:52:06 2008 > New Revision: 184870 > URL: http://svn.freebsd.org/changeset/base/184870 > > Log: > Add ale(4), a driver for Atheros AR8121/AR8113/AR8114 PCIe ethernet > controller. The controller is also known as L1E(AR8121) and > L2E(AR8113/AR8114). Unlike its predecessor Attansic L1, > AR8121/AR8113/AR8114 uses completely different Rx logic such that > it requires separate driver. Datasheet for AR81xx is not available > to open source driver writers but it shares large part of Tx and > PHY logic of L1. I still don't understand some part of register > meaning and some MAC statistics counters but the driver seems to > have no critical issues for performance and stability. > Yay! thanks for yet another great driver Pyun. From owner-svn-src-head@FreeBSD.ORG Wed Nov 12 17:33:37 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DBFD11065674; Wed, 12 Nov 2008 17:33:36 +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 D26A38FC0A; Wed, 12 Nov 2008 17:33:36 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mACHXa94036327; Wed, 12 Nov 2008 17:33:36 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mACHXaUq036326; Wed, 12 Nov 2008 17:33:36 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <200811121733.mACHXaUq036326@svn.freebsd.org> From: Nathan Whitehorn Date: Wed, 12 Nov 2008 17:33:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184890 - head/sys/dev/adb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Nov 2008 17:33:38 -0000 Author: nwhitehorn Date: Wed Nov 12 17:33:36 2008 New Revision: 184890 URL: http://svn.freebsd.org/changeset/base/184890 Log: Probe ADB miscellaneous devices (ID 7) instead of stopping at ID 6. This allows us to probe the brightness and volume control buttons on PPC Apple laptops, though there is not yet a driver to do anything useful with them. Modified: head/sys/dev/adb/adb_bus.c Modified: head/sys/dev/adb/adb_bus.c ============================================================================== --- head/sys/dev/adb/adb_bus.c Wed Nov 12 15:49:11 2008 (r184889) +++ head/sys/dev/adb/adb_bus.c Wed Nov 12 17:33:36 2008 (r184890) @@ -134,7 +134,7 @@ adb_bus_enumerate(void *xdev) /* Enumerate bus */ next_free = 8; - for (i = 1; i < 7; i++) { + for (i = 1; i <= 7; i++) { int8_t first_relocated = -1; int reply = 0; From owner-svn-src-head@FreeBSD.ORG Wed Nov 12 17:38:24 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0D5551065672; Wed, 12 Nov 2008 17:38:24 +0000 (UTC) (envelope-from jkoshy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 04A458FC08; Wed, 12 Nov 2008 17:38:24 +0000 (UTC) (envelope-from jkoshy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mACHcN1Z036454; Wed, 12 Nov 2008 17:38:23 GMT (envelope-from jkoshy@svn.freebsd.org) Received: (from jkoshy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mACHcNRH036453; Wed, 12 Nov 2008 17:38:23 GMT (envelope-from jkoshy@svn.freebsd.org) Message-Id: <200811121738.mACHcNRH036453@svn.freebsd.org> From: Joseph Koshy Date: Wed, 12 Nov 2008 17:38: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: r184891 - head/lib/libpmc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Nov 2008 17:38:24 -0000 Author: jkoshy Date: Wed Nov 12 17:38:23 2008 New Revision: 184891 URL: http://svn.freebsd.org/changeset/base/184891 Log: Use spellings that are close to vendor documentation. Modified: head/lib/libpmc/pmc.iaf.3 Modified: head/lib/libpmc/pmc.iaf.3 ============================================================================== --- head/lib/libpmc/pmc.iaf.3 Wed Nov 12 17:33:36 2008 (r184890) +++ head/lib/libpmc/pmc.iaf.3 Wed Nov 12 17:38:23 2008 (r184891) @@ -91,13 +91,13 @@ qualifiers are specified, the default is The fixed function PMCs are selectable using the following event names: .Bl -tag -width indent -.It Li FIXED.INSTR_RETIRED.ANY +.It Li INSTR_RETIRED.ANY .Pq Fixed Function Counter 0 The number of instructions retired. -.It Li FIXED.CPU_CLK_UNHALTED.CORE +.It Li CPU_CLK_UNHALTED.CORE .Pq Fixed Function Counter 1 The number of core cycles for which the core is not halted. -.It Li FIXED.CPU_CLK_UNHALTED.REF +.It Li CPU_CLK_UNHALTED.REF .Pq Fixed Function Counter 2 The number of reference cycles for which the core is not halted. .El From owner-svn-src-head@FreeBSD.ORG Wed Nov 12 17:43:37 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C409D1065678; Wed, 12 Nov 2008 17:43:37 +0000 (UTC) (envelope-from jkoshy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B8EEB8FC19; Wed, 12 Nov 2008 17:43:37 +0000 (UTC) (envelope-from jkoshy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mACHhbUt036589; Wed, 12 Nov 2008 17:43:37 GMT (envelope-from jkoshy@svn.freebsd.org) Received: (from jkoshy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mACHhbVb036586; Wed, 12 Nov 2008 17:43:37 GMT (envelope-from jkoshy@svn.freebsd.org) Message-Id: <200811121743.mACHhbVb036586@svn.freebsd.org> From: Joseph Koshy Date: Wed, 12 Nov 2008 17:43: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: r184892 - head/lib/libpmc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Nov 2008 17:43:37 -0000 Author: jkoshy Date: Wed Nov 12 17:43:37 2008 New Revision: 184892 URL: http://svn.freebsd.org/changeset/base/184892 Log: Document the alternate event names supported for "architectural" PMC events. Modified: head/lib/libpmc/pmc.atom.3 head/lib/libpmc/pmc.core.3 head/lib/libpmc/pmc.core2.3 Modified: head/lib/libpmc/pmc.atom.3 ============================================================================== --- head/lib/libpmc/pmc.atom.3 Wed Nov 12 17:38:23 2008 (r184891) +++ head/lib/libpmc/pmc.atom.3 Wed Nov 12 17:43:37 2008 (r184892) @@ -23,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 24, 2008 +.Dd November 12, 2008 .Os .Dt PMC.ATOM 3 .Sh NAME @@ -273,13 +273,17 @@ The number of branch instructions decode The number of branches executed, but not necessarily retired. .It Li BR_INST_RETIRED.ANY .Pq Event C4H , Umask 00H +.Pq Alias Qq "Branch Instruction Retired" The number of branch instructions retired. +This is an architectural performance event. .It Li BR_INST_RETIRED.ANY1 .Pq Event C4H , Umask 0FH The number of branch instructions retired that were mispredicted. .It Li BR_INST_RETIRED.MISPRED .Pq Event C5, Umask 00H +.Pq Alias Qq "Branch Misses Retired" The number of mispredicted branch instructions retired. +This is an architectural performance event. .It Li BR_INST_RETIRED.MISPRED_NOT_TAKEN .Pq Event C4H , Umask 02H The number of not taken branch instructions retired that were @@ -458,10 +462,14 @@ The number of times the L1 data cache is the same processor. .It Li CPU_CLK_UNHALTED.BUS .Pq Event 3CH , Umask 01H +.Pq Alias Qq "Unhalted Reference Cycles" The number of bus cycles when the core is not in the halt state. +This is an architectural performance event. .It Li CPU_CLK_UNHALTED.CORE_P .Pq Event 3CH , Umask 00H +.Pq Alias Qq "Unhalted Core Cycles" The number of core cycles while the core is not in a halt state. +This is an architectural performance event. .It Li CPU_CLK_UNHALTED.NO_OTHER .Pq Event 3CH , Umask 02H The number of bus cycles during which the core remains unhalted and @@ -597,7 +605,9 @@ length changing prefix. The number of cycles during which the instruction queue is full. .It Li INST_RETIRED.ANY_P .Pq Event C0H , Umask 00H +.Pq Alias Qq "Instruction Retired" The number of instructions retired. +This is an architectural performance event. .It Li INST_RETIRED.LOADS .Pq Event C0H , Umask 01H The number of instructions retired that contained a load operation. @@ -744,10 +754,13 @@ The number of L2 cache requests that wer The number of completed L2 cache requests. .It Li L2_RQSTS.SELF.DEMAND.I_STATE .Pq Event 2EH , Umask 41H +.Pq Alias Qq "LLC Misses" The number of completed L2 cache demand requests from this core that missed the L2 cache. +This is an architectural performance event. .It Li L2_RQSTS.SELF.DEMAND.MESI .Pq Event 2EH , Umask 4FH +.Pq Alias Qq "LLC References" The number of completed L2 cache demand requests from this core. .It Li L2_ST Xo .Op ,cachestate= Ns Ar state @@ -1154,16 +1167,15 @@ instructions retired. The following table shows the mapping between the PMC-independent aliases supported by .Lb libpmc -and the underlying hardware events used. -.Bl -column "branch-mispredicts" "Description" -.It Em Alias Ta Em Event -.It Li branches Ta Li BR_INST_RETIRED.ANY -.It Li branch-mispredicts Ta Li BR_INST_RETIRED.MISPRED -.It Li dc-misses Ta Li L2_ST,core=this,cachestate=mesi -.It Li ic-misses Ta Li ICACHE.MISSES -.It Li instructions Ta Li INST_RETIRED.ANY_P -.It Li interrupts Ta Li HW_INT_RCV -.It Li unhalted-cycles Ta Li CPU_CLK_UNHALTED.CORE_P +and the underlying hardware events used on these CPUs. +.Bl -column "branch-mispredicts" "cpu_clk_unhalted.core_p" "PMC Class" +.It Em Alias Ta Em Event Ta Em PMC Class +.It Li branches Ta Li BR_INST_RETIRED.ANY Ta Li PMC_CLASS_IAP +.It Li branch-mispredicts Ta Li BR_INST_RETIRED.MISPRED Ta Li PMC_CLASS_IAP +.It Li ic-misses Ta Li ICACHE.MISSES Ta Li PMC_CLASS_IAP +.It Li instructions Ta Li INST_RETIRED.ANY_P Ta Li PMC_CLASS_IAF +.It Li interrupts Ta Li HW_INT_RCV Ta Li PMC_CLASS_IAP +.It Li unhalted-cycles Ta Li CPU_CLK_UNHALTED.CORE_P Ta Li PMC_CLASS_IAF .El .Sh SEE ALSO .Xr pmc 3 , Modified: head/lib/libpmc/pmc.core.3 ============================================================================== --- head/lib/libpmc/pmc.core.3 Wed Nov 12 17:38:23 2008 (r184891) +++ head/lib/libpmc/pmc.core.3 Wed Nov 12 17:43:37 2008 (r184892) @@ -23,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 21, 2008 +.Dd November 12, 2008 .Os .Dt PMC.CORE 3 .Sh NAME @@ -234,11 +234,15 @@ The number of branch instructions execut .Pq Event E0H The number of branch instructions decoded. .It Li Br_Instr_Ret -.Pq Event C4H +.Pq Event C4H, Umask 00H +.Pq Alias Qq "Branch Instruction Retired" The number of branch instructions retired. +This is an architectural performance event. .It Li Br_MisPred_Ret -.Pq Event C5H +.Pq Event C5H, Umask 00H +.Pq Alias Qq "Branch Misses Retired" The number of mispredicted branch instructions retired. +This is an architectural performance event. .It Li Br_MisPred_Taken_Ret .Pq Event CAH The number of taken and mispredicted branches retired. @@ -475,7 +479,9 @@ The number of instruction TLB misses. The number of instructions decoded. .It Li Instr_Ret .Pq Event C0H +.Pq Alias Qq "Instruction Retired" The number of instructions retired. +This is an architectural performance event. .It Li L1_Pref_Req .Pq Event 4FH The number of L1 prefetch request due to data cache misses. @@ -546,6 +552,17 @@ The number of L2 cache writes including .It Li LD_Blocks .Pq Event 03H The number of load operations delayed due to store buffer blocks. +.It Li LLC_Misses +.Pq Event 2EH, Umask 41H +The number of cache misses for references to the last level cache, +excluding misses due to hardware prefetches. +This is an architectural performance event. +.It Li LLC_Reference +The number of references to the last level cache, +excluding those due to hardware prefetches. +This is an architectural performance event. +.Pq Event 2EH, Umask 4FH +This is an architectural performance event. .It Li MMX_Assist .Pq Event CDH The number of EMMX instructions executed. @@ -573,7 +590,9 @@ and integer multiplies. This event is available on PMC1 only. .It Li NonHlt_Ref_Cycles .Pq Event 3CH , Umask 01H +.Pq Alias Qq "Unhalted Reference Cycles" The number of non-halted bus cycles. +This is an architectural performance event. .It Li Pref_Rqsts_Dn .Pq Event F8H The number of hardware prefetch requests issued in backward streams. @@ -690,6 +709,11 @@ The duration in a thermal trip based on .It Li Unfusion .Pq Event DBH The number of unfusion events. +.It Li "Unhalted_Core_Cycles" +.Pq Event 3CH , Umask 00H +The number of core clock cycles when the clock signal on a specific +core is not halted. +This is an architectural performance event. .It Li Uops_Ret .Pq Event C2H The number of micro-ops retired. Modified: head/lib/libpmc/pmc.core2.3 ============================================================================== --- head/lib/libpmc/pmc.core2.3 Wed Nov 12 17:38:23 2008 (r184891) +++ head/lib/libpmc/pmc.core2.3 Wed Nov 12 17:43:37 2008 (r184892) @@ -23,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 24, 2008 +.Dd November 12, 2008 .Os .Dt PMC.CORE2 3 .Sh NAME @@ -271,10 +271,14 @@ The number of branch instructions decode The number of branches executed, but not necessarily retired. .It Li BR_INST_RETIRED.ANY .Pq Event C4H , Umask 00H +.Pq Alias Qq "Branch Instruction Retired" The number of branch instructions retired. +This is an architectural performance event. .It Li BR_INST_RETIRED.MISPRED -.Pq Event C5H +.Pq Event C5H, Umask 00H +.Pq Alias Qq "Branch Misses Retired" The number of mispredicted branch instructions retired. +This is an architectural performance event. .It Li BR_INST_RETIRED.MISPRED_NOT_TAKEN .Pq Event C4H , Umask 02H The number of not taken branch instructions retired that were @@ -446,10 +450,14 @@ The number of times the L1 data cache is the same processor. .It Li CPU_CLK_UNHALTED.BUS .Pq Event 3CH , Umask 01H +.Pq Alias Qq "Unhalted Reference Cycles" The number of bus cycles when the core is not in the halt state. +This is an architectural performance event. .It Li CPU_CLK_UNHALTED.CORE_P .Pq Event 3CH , Umask 00H +.Pq Alias Qq "Unhalted Core Cycles" The number of core cycles while the core is not in a halt state. +This is an architectural performance event. .It Li CPU_CLK_UNHALTED.NO_OTHER .Pq Event 3CH , Umask 02H The number of bus cycles during which the core remains unhalted and @@ -553,7 +561,9 @@ length changing prefix. The number of cycles during which the instruction queue is full. .It Li INST_RETIRED.ANY_P .Pq Event C0H , Umask 00H +.Pq Alias Qq "Instruction Retired" The number of instructions retired. +This is an architectural performance event. .It Li INST_RETIRED.LOADS .Pq Event C0H , Umask 01H The number of instructions retired that contained a load operation. @@ -705,11 +715,15 @@ The number of L2 cache requests that wer The number of completed L2 cache requests. .It Li L2_RQSTS.SELF.DEMAND.I_STATE .Pq Event 2EH , Umask 41H +.Pq Alias Qq "LLC Misses" The number of completed L2 cache demand requests from this core that missed the L2 cache. +This is an architectural performance event. .It Li L2_RQSTS.SELF.DEMAND.MESI .Pq Event 2EH , Umask 4FH +.Pq Alias Qq "LLC References" The number of completed L2 cache demand requests from this core. +This is an architectural performance event. .It Li L2_ST Xo .Op ,cachestate= Ns Ar state .Op ,core= Ns Ar core @@ -1075,15 +1089,14 @@ The following table shows the mapping be aliases supported by .Lb libpmc and the underlying hardware events used. -.Bl -column "branch-mispredicts" "Description" -.It Em Alias Ta Em Event -.It Li branches Ta Li BR_INST_RETIRED.ANY -.It Li branch-mispredicts Ta Li BR_INST_RETIRED.MISPRED -.It Li dc-misses Ta Li L2_ST,core=this,cachestate=mesi -.It Li ic-misses Ta Li L1I_MISSES -.It Li instructions Ta Li INST_RETIRED.ANY_P -.It Li interrupts Ta Li HW_INT_RCV -.It Li unhalted-cycles Ta Li CPU_CLK_UNHALTED.CORE_P +.Bl -column "branch-mispredicts" "cpu_clk_unhalted.core_p" "PMC Class" +.It Em Alias Ta Em Event Ta Em PMC Class +.It Li branches Ta Li BR_INST_RETIRED.ANY Ta Li PMC_CLASS_IAP +.It Li branch-mispredicts Ta Li BR_INST_RETIRED.MISPRED Ta Li PMC_CLASS_IAP +.It Li ic-misses Ta Li L1I_MISSES Ta Li PMC_CLASS_IAP +.It Li instructions Ta Li INST_RETIRED.ANY_P Ta Li PMC_CLASS_IAF +.It Li interrupts Ta Li HW_INT_RCV Ta Li PMC_CLASS_IAP +.It Li unhalted-cycles Ta Li CPU_CLK_UNHALTED.CORE_P Ta Li PMC_CLASS_IAF .El .Sh SEE ALSO .Xr pmc 3 , From owner-svn-src-head@FreeBSD.ORG Wed Nov 12 21:30:39 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CA14D1065672; Wed, 12 Nov 2008 21:30:39 +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 B65DE8FC12; Wed, 12 Nov 2008 21:30:39 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mACLUdk8040592; Wed, 12 Nov 2008 21:30:39 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mACLUdY6040591; Wed, 12 Nov 2008 21:30:39 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200811122130.mACLUdY6040591@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Wed, 12 Nov 2008 21:30: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: r184893 - head/sys/modules/cxgb/cxgb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Nov 2008 21:30:39 -0000 Author: bz Date: Wed Nov 12 21:30:39 2008 New Revision: 184893 URL: http://svn.freebsd.org/changeset/base/184893 Log: Add opt_inet.h which has been needed since r184714, r184715 introducing checks for #ifdef INET. Submitted by: kmacy (r184876, I splitted lines) MFC after: 54 days Modified: head/sys/modules/cxgb/cxgb/Makefile Modified: head/sys/modules/cxgb/cxgb/Makefile ============================================================================== --- head/sys/modules/cxgb/cxgb/Makefile Wed Nov 12 17:43:37 2008 (r184892) +++ head/sys/modules/cxgb/cxgb/Makefile Wed Nov 12 21:30:39 2008 (r184893) @@ -7,7 +7,8 @@ KMOD= if_cxgb SRCS= cxgb_mc5.c cxgb_vsc8211.c cxgb_ael1002.c cxgb_mv88e1xxx.c SRCS+= cxgb_xgmac.c cxgb_vsc7323.c cxgb_t3_hw.c cxgb_main.c SRCS+= cxgb_sge.c cxgb_offload.c cxgb_tn1010.c -SRCS+= device_if.h bus_if.h pci_if.h opt_zero.h opt_sched.h +SRCS+= device_if.h bus_if.h pci_if.h +SRCS+= opt_inet.h opt_zero.h opt_sched.h SRCS+= uipc_mvec.c cxgb_support.c cxgb_multiq.c CFLAGS+= -g -DDEFAULT_JUMBO -I${CXGB} From owner-svn-src-head@FreeBSD.ORG Wed Nov 12 21:32:50 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 019BC1065673; Wed, 12 Nov 2008 21:32:50 +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 E21738FC0A; Wed, 12 Nov 2008 21:32:49 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mACLWnRq040673; Wed, 12 Nov 2008 21:32:49 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mACLWnrk040672; Wed, 12 Nov 2008 21:32:49 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200811122132.mACLWnrk040672@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Wed, 12 Nov 2008 21:32: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: r184894 - head/sys/modules/em X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Nov 2008 21:32:50 -0000 Author: bz Date: Wed Nov 12 21:32:49 2008 New Revision: 184894 URL: http://svn.freebsd.org/changeset/base/184894 Log: Add opt_inet.h which has been needed since r184717 introducing checks for #ifdef INET. MFC after: 54 days Modified: head/sys/modules/em/Makefile Modified: head/sys/modules/em/Makefile ============================================================================== --- head/sys/modules/em/Makefile Wed Nov 12 21:30:39 2008 (r184893) +++ head/sys/modules/em/Makefile Wed Nov 12 21:32:49 2008 (r184894) @@ -1,7 +1,7 @@ # $FreeBSD$ .PATH: ${.CURDIR}/../../dev/e1000 KMOD = if_em -SRCS = device_if.h bus_if.h pci_if.h +SRCS = device_if.h bus_if.h pci_if.h opt_inet.h SRCS += if_em.c $(SHARED_SRCS) SHARED_SRCS = e1000_api.c e1000_phy.c e1000_nvm.c e1000_mac.c e1000_manage.c SHARED_SRCS += e1000_80003es2lan.c e1000_82542.c e1000_82541.c e1000_82543.c From owner-svn-src-head@FreeBSD.ORG Wed Nov 12 21:33:46 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F20FF1065672; Wed, 12 Nov 2008 21:33: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 DEC438FC1A; Wed, 12 Nov 2008 21:33:45 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mACLXjEu040744; Wed, 12 Nov 2008 21:33:45 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mACLXjk2040743; Wed, 12 Nov 2008 21:33:45 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200811122133.mACLXjk2040743@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Wed, 12 Nov 2008 21:33: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: r184895 - head/sys/modules/igb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Nov 2008 21:33:46 -0000 Author: bz Date: Wed Nov 12 21:33:45 2008 New Revision: 184895 URL: http://svn.freebsd.org/changeset/base/184895 Log: Add opt_inet.h which has been needed since r184718, which had introduced checks for #ifdef INET. MFC after: 54 days Modified: head/sys/modules/igb/Makefile Modified: head/sys/modules/igb/Makefile ============================================================================== --- head/sys/modules/igb/Makefile Wed Nov 12 21:32:49 2008 (r184894) +++ head/sys/modules/igb/Makefile Wed Nov 12 21:33:45 2008 (r184895) @@ -1,7 +1,7 @@ #$FreeBSD$ .PATH: ${.CURDIR}/../../dev/e1000 KMOD = if_igb -SRCS = device_if.h bus_if.h pci_if.h +SRCS = device_if.h bus_if.h pci_if.h opt_inet.h SRCS += if_igb.c $(SHARED_SRCS) SHARED_SRCS = e1000_api.c e1000_phy.c e1000_nvm.c e1000_mac.c e1000_manage.c SHARED_SRCS += e1000_80003es2lan.c e1000_82542.c e1000_82541.c e1000_82543.c From owner-svn-src-head@FreeBSD.ORG Wed Nov 12 22:14:05 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5FE1A1065672; Wed, 12 Nov 2008 22:14:05 +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 4A95A8FC0A; Wed, 12 Nov 2008 22:14:05 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mACME56J041560; Wed, 12 Nov 2008 22:14:05 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mACME5Ud041559; Wed, 12 Nov 2008 22:14:05 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200811122214.mACME5Ud041559@svn.freebsd.org> From: John Baldwin Date: Wed, 12 Nov 2008 22:14:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184896 - head/sys/dev/ppbus X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Nov 2008 22:14:05 -0000 Author: jhb Date: Wed Nov 12 22:14:05 2008 New Revision: 184896 URL: http://svn.freebsd.org/changeset/base/184896 Log: Various style and whitespace fixes. Previously parts of this file used 8 space indent, parts used 4 space indent, and other parts used a weird mixture (8 spaces for first indent, 4 spaces for the rest). Modified: head/sys/dev/ppbus/if_plip.c Modified: head/sys/dev/ppbus/if_plip.c ============================================================================== --- head/sys/dev/ppbus/if_plip.c Wed Nov 12 21:33:45 2008 (r184895) +++ head/sys/dev/ppbus/if_plip.c Wed Nov 12 22:14:05 2008 (r184896) @@ -78,7 +78,7 @@ __FBSDID("$FreeBSD$"); /* * Update for ppbus, PLIP support only - Nicolas Souchu - */ + */ #include "opt_plip.h" @@ -110,7 +110,7 @@ __FBSDID("$FreeBSD$"); #include #ifndef LPMTU /* MTU for the lp# interfaces */ -#define LPMTU 1500 +#define LPMTU 1500 #endif #ifndef LPMAXSPIN1 /* DELAY factor for the lp# interfaces */ @@ -156,14 +156,14 @@ struct lp_data { /* Tables for the lp# interface */ static u_char *txmith; -#define txmitl (txmith+(1*LPIPTBLSIZE)) -#define trecvh (txmith+(2*LPIPTBLSIZE)) -#define trecvl (txmith+(3*LPIPTBLSIZE)) +#define txmitl (txmith + (1 * LPIPTBLSIZE)) +#define trecvh (txmith + (2 * LPIPTBLSIZE)) +#define trecvl (txmith + (3 * LPIPTBLSIZE)) static u_char *ctxmith; -#define ctxmitl (ctxmith+(1*LPIPTBLSIZE)) -#define ctrecvh (ctxmith+(2*LPIPTBLSIZE)) -#define ctrecvl (ctxmith+(3*LPIPTBLSIZE)) +#define ctxmitl (ctxmith + (1 * LPIPTBLSIZE)) +#define ctrecvh (ctxmith + (2 * LPIPTBLSIZE)) +#define ctrecvl (ctxmith + (3 * LPIPTBLSIZE)) /* Functions for the lp# interface */ static int lpinittables(void); @@ -186,9 +186,7 @@ lp_identify(driver_t *driver, device_t p if (!dev) BUS_ADD_CHILD(parent, 0, "plip", -1); } -/* - * lpprobe() - */ + static int lp_probe(device_t dev) { @@ -199,7 +197,7 @@ lp_probe(device_t dev) } static int -lp_attach (device_t dev) +lp_attach(device_t dev) { struct lp_data *lp = DEVTOSOFTC(dev); struct ifnet *ifp; @@ -211,7 +209,7 @@ lp_attach (device_t dev) * Reserve the interrupt resource. If we don't have one, the * attach fails. */ - lp->res_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, + lp->res_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, RF_SHAREABLE); if (lp->res_irq == 0) { device_printf(dev, "cannot reserve interrupt, failed.\n"); @@ -245,190 +243,191 @@ lp_attach (device_t dev) * precalculate them when we initialize. */ static int -lpinittables (void) +lpinittables(void) { - int i; + int i; - if (!txmith) - txmith = malloc(4*LPIPTBLSIZE, M_DEVBUF, M_NOWAIT); + if (txmith == NULL) + txmith = malloc(4 * LPIPTBLSIZE, M_DEVBUF, M_NOWAIT); - if (!txmith) - return 1; + if (txmith == NULL) + return (1); - if (!ctxmith) + if (ctxmith == NULL) ctxmith = malloc(4*LPIPTBLSIZE, M_DEVBUF, M_NOWAIT); - if (!ctxmith) - return 1; + if (ctxmith == NULL) + return (1); + + for (i = 0; i < LPIPTBLSIZE; i++) { + ctxmith[i] = (i & 0xF0) >> 4; + ctxmitl[i] = 0x10 | (i & 0x0F); + ctrecvh[i] = (i & 0x78) << 1; + ctrecvl[i] = (i & 0x78) >> 3; + } - for (i=0; i < LPIPTBLSIZE; i++) { - ctxmith[i] = (i & 0xF0) >> 4; - ctxmitl[i] = 0x10 | (i & 0x0F); - ctrecvh[i] = (i & 0x78) << 1; - ctrecvl[i] = (i & 0x78) >> 3; - } - - for (i=0; i < LPIPTBLSIZE; i++) { - txmith[i] = ((i & 0x80) >> 3) | ((i & 0x70) >> 4) | 0x08; - txmitl[i] = ((i & 0x08) << 1) | (i & 0x07); - trecvh[i] = ((~i) & 0x80) | ((i & 0x38) << 1); - trecvl[i] = (((~i) & 0x80) >> 4) | ((i & 0x38) >> 3); - } + for (i = 0; i < LPIPTBLSIZE; i++) { + txmith[i] = ((i & 0x80) >> 3) | ((i & 0x70) >> 4) | 0x08; + txmitl[i] = ((i & 0x08) << 1) | (i & 0x07); + trecvh[i] = ((~i) & 0x80) | ((i & 0x38) << 1); + trecvl[i] = (((~i) & 0x80) >> 4) | ((i & 0x38) >> 3); + } - return 0; + return (0); } /* * Process an ioctl request. */ - static int -lpioctl (struct ifnet *ifp, u_long cmd, caddr_t data) +lpioctl(struct ifnet *ifp, u_long cmd, caddr_t data) { - struct lp_data *sc = ifp->if_softc; - device_t dev = sc->sc_dev; - device_t ppbus = device_get_parent(dev); - struct ifaddr *ifa = (struct ifaddr *)data; - struct ifreq *ifr = (struct ifreq *)data; - u_char *ptr; - void *ih; - int error; - - switch (cmd) { - - case SIOCSIFDSTADDR: - case SIOCAIFADDR: - case SIOCSIFADDR: - if (ifa->ifa_addr->sa_family != AF_INET) - return EAFNOSUPPORT; - - ifp->if_flags |= IFF_UP; - /* FALLTHROUGH */ - case SIOCSIFFLAGS: - if ((!(ifp->if_flags & IFF_UP)) && - (ifp->if_drv_flags & IFF_DRV_RUNNING)) { - - ppb_wctr(ppbus, 0x00); - ifp->if_drv_flags &= ~IFF_DRV_RUNNING; - - /* IFF_UP is not set, try to release the bus anyway */ - ppb_release_bus(ppbus, dev); - break; - } - if (((ifp->if_flags & IFF_UP)) && - (!(ifp->if_drv_flags & IFF_DRV_RUNNING))) { - - /* XXX - * Should the request be interruptible? - */ - if ((error = ppb_request_bus(ppbus, dev, PPB_WAIT|PPB_INTR))) - return (error); - - /* Now IFF_UP means that we own the bus */ - - ppb_set_mode(ppbus, PPB_COMPATIBLE); - - if (lpinittables()) { - ppb_release_bus(ppbus, dev); - return ENOBUFS; - } - - sc->sc_ifbuf = malloc(sc->sc_ifp->if_mtu + MLPIPHDRLEN, - M_DEVBUF, M_WAITOK); - if (!sc->sc_ifbuf) { - ppb_release_bus(ppbus, dev); - return ENOBUFS; - } - - /* attach our interrupt handler, later detached when the bus is released */ - if ((error = bus_setup_intr(dev, sc->res_irq, - INTR_TYPE_NET, NULL, lp_intr, dev, &ih))) { - ppb_release_bus(ppbus, dev); - return (error); - } - - ppb_wctr(ppbus, IRQENABLE); - ifp->if_drv_flags |= IFF_DRV_RUNNING; - } - break; - - case SIOCSIFMTU: - ptr = sc->sc_ifbuf; - sc->sc_ifbuf = malloc(ifr->ifr_mtu+MLPIPHDRLEN, M_DEVBUF, M_NOWAIT); - if (!sc->sc_ifbuf) { - sc->sc_ifbuf = ptr; - return ENOBUFS; - } - if (ptr) - free(ptr,M_DEVBUF); - sc->sc_ifp->if_mtu = ifr->ifr_mtu; - break; - - case SIOCGIFMTU: - ifr->ifr_mtu = sc->sc_ifp->if_mtu; - break; - - case SIOCADDMULTI: - case SIOCDELMULTI: - if (ifr == 0) { - return EAFNOSUPPORT; /* XXX */ - } - switch (ifr->ifr_addr.sa_family) { + struct lp_data *sc = ifp->if_softc; + device_t dev = sc->sc_dev; + device_t ppbus = device_get_parent(dev); + struct ifaddr *ifa = (struct ifaddr *)data; + struct ifreq *ifr = (struct ifreq *)data; + u_char *ptr; + void *ih; + int error; + + switch (cmd) { + case SIOCSIFDSTADDR: + case SIOCAIFADDR: + case SIOCSIFADDR: + if (ifa->ifa_addr->sa_family != AF_INET) + return (EAFNOSUPPORT); + + ifp->if_flags |= IFF_UP; + /* FALLTHROUGH */ + case SIOCSIFFLAGS: + if ((!(ifp->if_flags & IFF_UP)) && + (ifp->if_drv_flags & IFF_DRV_RUNNING)) { + + ppb_wctr(ppbus, 0x00); + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; + + /* IFF_UP is not set, try to release the bus anyway */ + ppb_release_bus(ppbus, dev); + break; + } + if (((ifp->if_flags & IFF_UP)) && + (!(ifp->if_drv_flags & IFF_DRV_RUNNING))) { - case AF_INET: - break; + /* XXX + * Should the request be interruptible? + */ + if ((error = ppb_request_bus(ppbus, dev, PPB_WAIT | + PPB_INTR))) + return (error); + + /* Now IFF_UP means that we own the bus */ + ppb_set_mode(ppbus, PPB_COMPATIBLE); + + if (lpinittables()) { + ppb_release_bus(ppbus, dev); + return (ENOBUFS); + } + + sc->sc_ifbuf = malloc(sc->sc_ifp->if_mtu + MLPIPHDRLEN, + M_DEVBUF, M_WAITOK); + if (sc->sc_ifbuf == NULL) { + ppb_release_bus(ppbus, dev); + return (ENOBUFS); + } + + /* + * Attach our interrupt handler. It is + * detached later when the bus is released. + */ + if ((error = bus_setup_intr(dev, sc->res_irq, + INTR_TYPE_NET, NULL, lp_intr, dev, &ih))) { + ppb_release_bus(ppbus, dev); + return (error); + } - default: - return EAFNOSUPPORT; - } - break; + ppb_wctr(ppbus, IRQENABLE); + ifp->if_drv_flags |= IFF_DRV_RUNNING; + } + break; - case SIOCGIFMEDIA: - /* - * No ifmedia support at this stage; maybe use it - * in future for eg. protocol selection. - */ - return EINVAL; + case SIOCSIFMTU: + ptr = sc->sc_ifbuf; + sc->sc_ifbuf = malloc(ifr->ifr_mtu + MLPIPHDRLEN, M_DEVBUF, + M_NOWAIT); + if (sc->sc_ifbuf == NULL) { + sc->sc_ifbuf = ptr; + return (ENOBUFS); + } + if (ptr) + free(ptr, M_DEVBUF); + sc->sc_ifp->if_mtu = ifr->ifr_mtu; + break; + + case SIOCGIFMTU: + ifr->ifr_mtu = sc->sc_ifp->if_mtu; + break; + + case SIOCADDMULTI: + case SIOCDELMULTI: + if (ifr == 0) { + return (EAFNOSUPPORT); /* XXX */ + } + switch (ifr->ifr_addr.sa_family) { + case AF_INET: + break; + default: + return (EAFNOSUPPORT); + } + break; + + case SIOCGIFMEDIA: + /* + * No ifmedia support at this stage; maybe use it + * in future for eg. protocol selection. + */ + return (EINVAL); - default: - lprintf("LP:ioctl(0x%lx)\n", cmd); - return EINVAL; - } - return 0; + default: + lprintf("LP:ioctl(0x%lx)\n", cmd); + return (EINVAL); + } + return (0); } static __inline int -clpoutbyte (u_char byte, int spin, device_t ppbus) +clpoutbyte(u_char byte, int spin, device_t ppbus) { + ppb_wdtr(ppbus, ctxmitl[byte]); while (ppb_rstr(ppbus) & CLPIP_SHAKE) if (--spin == 0) { - return 1; + return (1); } ppb_wdtr(ppbus, ctxmith[byte]); while (!(ppb_rstr(ppbus) & CLPIP_SHAKE)) if (--spin == 0) { - return 1; + return (1); } - return 0; + return (0); } static __inline int -clpinbyte (int spin, device_t ppbus) +clpinbyte(int spin, device_t ppbus) { u_char c, cl; while((ppb_rstr(ppbus) & CLPIP_SHAKE)) - if(!--spin) { - return -1; - } + if (!--spin) { + return (-1); + } cl = ppb_rstr(ppbus); ppb_wdtr(ppbus, 0x10); while(!(ppb_rstr(ppbus) & CLPIP_SHAKE)) - if(!--spin) { - return -1; - } + if (!--spin) { + return (-1); + } c = ppb_rstr(ppbus); ppb_wdtr(ppbus, 0x00); @@ -439,11 +438,12 @@ static void lptap(struct ifnet *ifp, struct mbuf *m) { u_int32_t af = AF_INET; + bpf_mtap2(ifp->if_bpf, &af, sizeof(af), m); } static void -lp_intr (void *arg) +lp_intr(void *arg) { device_t dev = (device_t)arg; device_t ppbus = device_get_parent(dev); @@ -457,96 +457,105 @@ lp_intr (void *arg) if (sc->sc_ifp->if_flags & IFF_LINK0) { - /* Ack. the request */ - ppb_wdtr(ppbus, 0x01); + /* Ack. the request */ + ppb_wdtr(ppbus, 0x01); + + /* Get the packet length */ + j = clpinbyte(LPMAXSPIN2, ppbus); + if (j == -1) + goto err; + len = j; + j = clpinbyte(LPMAXSPIN2, ppbus); + if (j == -1) + goto err; + len = len + (j << 8); + if (len > sc->sc_ifp->if_mtu + MLPIPHDRLEN) + goto err; + + bp = sc->sc_ifbuf; - /* Get the packet length */ - j = clpinbyte(LPMAXSPIN2, ppbus); - if (j == -1) - goto err; - len = j; - j = clpinbyte(LPMAXSPIN2, ppbus); - if (j == -1) - goto err; - len = len + (j << 8); - if (len > sc->sc_ifp->if_mtu + MLPIPHDRLEN) - goto err; - - bp = sc->sc_ifbuf; - - while (len--) { - j = clpinbyte(LPMAXSPIN2, ppbus); - if (j == -1) { - goto err; - } - *bp++ = j; - } - /* Get and ignore checksum */ - j = clpinbyte(LPMAXSPIN2, ppbus); - if (j == -1) { - goto err; - } - - len = bp - sc->sc_ifbuf; - if (len <= CLPIPHDRLEN) - goto err; - - sc->sc_iferrs = 0; - - len -= CLPIPHDRLEN; - sc->sc_ifp->if_ipackets++; - sc->sc_ifp->if_ibytes += len; - top = m_devget(sc->sc_ifbuf + CLPIPHDRLEN, len, 0, sc->sc_ifp, 0); - if (top) { - if (bpf_peers_present(sc->sc_ifp->if_bpf)) - lptap(sc->sc_ifp, top); - netisr_queue(NETISR_IP, top); /* mbuf is free'd on failure. */ - } - goto done; + while (len--) { + j = clpinbyte(LPMAXSPIN2, ppbus); + if (j == -1) { + goto err; + } + *bp++ = j; + } + + /* Get and ignore checksum */ + j = clpinbyte(LPMAXSPIN2, ppbus); + if (j == -1) { + goto err; + } + + len = bp - sc->sc_ifbuf; + if (len <= CLPIPHDRLEN) + goto err; + + sc->sc_iferrs = 0; + + len -= CLPIPHDRLEN; + sc->sc_ifp->if_ipackets++; + sc->sc_ifp->if_ibytes += len; + top = m_devget(sc->sc_ifbuf + CLPIPHDRLEN, len, 0, sc->sc_ifp, + 0); + if (top) { + if (bpf_peers_present(sc->sc_ifp->if_bpf)) + lptap(sc->sc_ifp, top); + + /* mbuf is free'd on failure. */ + netisr_queue(NETISR_IP, top); + } + goto done; } while ((ppb_rstr(ppbus) & LPIP_SHAKE)) { - len = sc->sc_ifp->if_mtu + LPIPHDRLEN; - bp = sc->sc_ifbuf; - while (len--) { - - cl = ppb_rstr(ppbus); - ppb_wdtr(ppbus, 8); - - j = LPMAXSPIN2; - while((ppb_rstr(ppbus) & LPIP_SHAKE)) - if(!--j) goto err; - - c = ppb_rstr(ppbus); - ppb_wdtr(ppbus, 0); + len = sc->sc_ifp->if_mtu + LPIPHDRLEN; + bp = sc->sc_ifbuf; + while (len--) { - *bp++= trecvh[cl] | trecvl[c]; + cl = ppb_rstr(ppbus); + ppb_wdtr(ppbus, 8); - j = LPMAXSPIN2; - while (!((cl=ppb_rstr(ppbus)) & LPIP_SHAKE)) { - if (cl != c && - (((cl = ppb_rstr(ppbus)) ^ 0xb8) & 0xf8) == - (c & 0xf8)) - goto end; - if (!--j) goto err; + j = LPMAXSPIN2; + while((ppb_rstr(ppbus) & LPIP_SHAKE)) + if (!--j) + goto err; + + c = ppb_rstr(ppbus); + ppb_wdtr(ppbus, 0); + + *bp++= trecvh[cl] | trecvl[c]; + + j = LPMAXSPIN2; + while (!((cl = ppb_rstr(ppbus)) & LPIP_SHAKE)) { + if (cl != c && + (((cl = ppb_rstr(ppbus)) ^ 0xb8) & 0xf8) == + (c & 0xf8)) + goto end; + if (!--j) + goto err; + } } - } end: - len = bp - sc->sc_ifbuf; - if (len <= LPIPHDRLEN) - goto err; - - sc->sc_iferrs = 0; - - len -= LPIPHDRLEN; - sc->sc_ifp->if_ipackets++; - sc->sc_ifp->if_ibytes += len; - top = m_devget(sc->sc_ifbuf + LPIPHDRLEN, len, 0, sc->sc_ifp, 0); - if (top) { - if (bpf_peers_present(sc->sc_ifp->if_bpf)) - lptap(sc->sc_ifp, top); - netisr_queue(NETISR_IP, top); /* mbuf is free'd on failure. */ - } + len = bp - sc->sc_ifbuf; + if (len <= LPIPHDRLEN) + goto err; + + sc->sc_iferrs = 0; + + len -= LPIPHDRLEN; + sc->sc_ifp->if_ipackets++; + sc->sc_ifp->if_ibytes += len; + top = m_devget(sc->sc_ifbuf + LPIPHDRLEN, len, 0, sc->sc_ifp, + 0); + if (top) { + if (bpf_peers_present(sc->sc_ifp->if_bpf)) + lptap(sc->sc_ifp, top); + + /* mbuf is free'd on failure. */ + netisr_queue(NETISR_IP, top); + } } goto done; @@ -561,182 +570,181 @@ lp_intr (void *arg) * so stop wasting our time */ if (sc->sc_iferrs > LPMAXERRS) { - if_printf(sc->sc_ifp, "Too many errors, Going off-line.\n"); - ppb_wctr(ppbus, 0x00); - sc->sc_ifp->if_drv_flags &= ~IFF_DRV_RUNNING; - sc->sc_iferrs=0; + if_printf(sc->sc_ifp, "Too many errors, Going off-line.\n"); + ppb_wctr(ppbus, 0x00); + sc->sc_ifp->if_drv_flags &= ~IFF_DRV_RUNNING; + sc->sc_iferrs = 0; } done: splx(s); - return; } static __inline int lpoutbyte (u_char byte, int spin, device_t ppbus) { - ppb_wdtr(ppbus, txmith[byte]); - while (!(ppb_rstr(ppbus) & LPIP_SHAKE)) - if (--spin == 0) - return 1; - ppb_wdtr(ppbus, txmitl[byte]); - while (ppb_rstr(ppbus) & LPIP_SHAKE) - if (--spin == 0) - return 1; - return 0; + + ppb_wdtr(ppbus, txmith[byte]); + while (!(ppb_rstr(ppbus) & LPIP_SHAKE)) + if (--spin == 0) + return (1); + ppb_wdtr(ppbus, txmitl[byte]); + while (ppb_rstr(ppbus) & LPIP_SHAKE) + if (--spin == 0) + return (1); + return (0); } static int -lpoutput (struct ifnet *ifp, struct mbuf *m, - struct sockaddr *dst, struct rtentry *rt) +lpoutput(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst, + struct rtentry *rt) { - struct lp_data *sc = ifp->if_softc; - device_t dev = sc->sc_dev; - device_t ppbus = device_get_parent(dev); - int s, err; - struct mbuf *mm; - u_char *cp = "\0\0"; - u_char chksum = 0; - int count = 0; - int i, len, spin; + struct lp_data *sc = ifp->if_softc; + device_t dev = sc->sc_dev; + device_t ppbus = device_get_parent(dev); + int s, err; + struct mbuf *mm; + u_char *cp = "\0\0"; + u_char chksum = 0; + int count = 0; + int i, len, spin; + + /* We need a sensible value if we abort */ + cp++; + ifp->if_drv_flags |= IFF_DRV_RUNNING; + + err = 1; /* assume we're aborting because of an error */ - /* We need a sensible value if we abort */ - cp++; - ifp->if_drv_flags |= IFF_DRV_RUNNING; + s = splhigh(); - err = 1; /* assume we're aborting because of an error */ + /* Suspend (on laptops) or receive-errors might have taken us offline */ + ppb_wctr(ppbus, IRQENABLE); - s = splhigh(); + if (ifp->if_flags & IFF_LINK0) { + if (!(ppb_rstr(ppbus) & CLPIP_SHAKE)) { + lprintf("&"); + lp_intr(dev); + } - /* Suspend (on laptops) or receive-errors might have taken us offline */ - ppb_wctr(ppbus, IRQENABLE); + /* Alert other end to pending packet */ + spin = LPMAXSPIN1; + ppb_wdtr(ppbus, 0x08); + while ((ppb_rstr(ppbus) & 0x08) == 0) + if (--spin == 0) { + goto nend; + } - if (ifp->if_flags & IFF_LINK0) { + /* Calculate length of packet, then send that */ - if (!(ppb_rstr(ppbus) & CLPIP_SHAKE)) { - lprintf("&"); - lp_intr(dev); - } + count += 14; /* Ethernet header len */ - /* Alert other end to pending packet */ - spin = LPMAXSPIN1; - ppb_wdtr(ppbus, 0x08); - while ((ppb_rstr(ppbus) & 0x08) == 0) - if (--spin == 0) { + mm = m; + for (mm = m; mm; mm = mm->m_next) { + count += mm->m_len; + } + if (clpoutbyte(count & 0xFF, LPMAXSPIN1, ppbus)) + goto nend; + if (clpoutbyte((count >> 8) & 0xFF, LPMAXSPIN1, ppbus)) goto nend; + + /* Send dummy ethernet header */ + for (i = 0; i < 12; i++) { + if (clpoutbyte(i, LPMAXSPIN1, ppbus)) + goto nend; + chksum += i; } - /* Calculate length of packet, then send that */ + if (clpoutbyte(0x08, LPMAXSPIN1, ppbus)) + goto nend; + if (clpoutbyte(0x00, LPMAXSPIN1, ppbus)) + goto nend; + chksum += 0x08 + 0x00; /* Add into checksum */ - count += 14; /* Ethernet header len */ + mm = m; + do { + cp = mtod(mm, u_char *); + len = mm->m_len; + while (len--) { + chksum += *cp; + if (clpoutbyte(*cp++, LPMAXSPIN2, ppbus)) + goto nend; + } + } while ((mm = mm->m_next)); - mm = m; - for (mm = m; mm; mm = mm->m_next) { - count += mm->m_len; - } - if (clpoutbyte(count & 0xFF, LPMAXSPIN1, ppbus)) - goto nend; - if (clpoutbyte((count >> 8) & 0xFF, LPMAXSPIN1, ppbus)) - goto nend; - - /* Send dummy ethernet header */ - for (i = 0; i < 12; i++) { - if (clpoutbyte(i, LPMAXSPIN1, ppbus)) + /* Send checksum */ + if (clpoutbyte(chksum, LPMAXSPIN2, ppbus)) goto nend; - chksum += i; + + /* Go quiescent */ + ppb_wdtr(ppbus, 0); + + err = 0; /* No errors */ + + nend: + if (err) { /* if we didn't timeout... */ + ifp->if_oerrors++; + lprintf("X"); + } else { + ifp->if_opackets++; + ifp->if_obytes += m->m_pkthdr.len; + if (bpf_peers_present(ifp->if_bpf)) + lptap(ifp, m); + } + + m_freem(m); + + if (!(ppb_rstr(ppbus) & CLPIP_SHAKE)) { + lprintf("^"); + lp_intr(dev); + } + (void) splx(s); + return (0); + } + + if (ppb_rstr(ppbus) & LPIP_SHAKE) { + lprintf("&"); + lp_intr(dev); } - if (clpoutbyte(0x08, LPMAXSPIN1, ppbus)) - goto nend; - if (clpoutbyte(0x00, LPMAXSPIN1, ppbus)) - goto nend; - chksum += 0x08 + 0x00; /* Add into checksum */ + if (lpoutbyte(0x08, LPMAXSPIN1, ppbus)) + goto end; + if (lpoutbyte(0x00, LPMAXSPIN2, ppbus)) + goto end; mm = m; do { cp = mtod(mm, u_char *); len = mm->m_len; - while (len--) { - chksum += *cp; - if (clpoutbyte(*cp++, LPMAXSPIN2, ppbus)) - goto nend; - } + while (len--) + if (lpoutbyte(*cp++, LPMAXSPIN2, ppbus)) + goto end; } while ((mm = mm->m_next)); - /* Send checksum */ - if (clpoutbyte(chksum, LPMAXSPIN2, ppbus)) - goto nend; - - /* Go quiescent */ - ppb_wdtr(ppbus, 0); + err = 0; /* no errors were encountered */ - err = 0; /* No errors */ +end: + --cp; + ppb_wdtr(ppbus, txmitl[*cp] ^ 0x17); - nend: - if (err) { /* if we didn't timeout... */ + if (err) { /* if we didn't timeout... */ ifp->if_oerrors++; lprintf("X"); } else { ifp->if_opackets++; ifp->if_obytes += m->m_pkthdr.len; if (bpf_peers_present(ifp->if_bpf)) - lptap(ifp, m); + lptap(ifp, m); } m_freem(m); - if (!(ppb_rstr(ppbus) & CLPIP_SHAKE)) { + if (ppb_rstr(ppbus) & LPIP_SHAKE) { lprintf("^"); lp_intr(dev); } - (void) splx(s); - return 0; - } - - if (ppb_rstr(ppbus) & LPIP_SHAKE) { - lprintf("&"); - lp_intr(dev); - } - - if (lpoutbyte(0x08, LPMAXSPIN1, ppbus)) - goto end; - if (lpoutbyte(0x00, LPMAXSPIN2, ppbus)) - goto end; - - mm = m; - do { - cp = mtod(mm,u_char *); - len = mm->m_len; - while (len--) - if (lpoutbyte(*cp++, LPMAXSPIN2, ppbus)) - goto end; - } while ((mm = mm->m_next)); - - err = 0; /* no errors were encountered */ - - end: - --cp; - ppb_wdtr(ppbus, txmitl[*cp] ^ 0x17); - - if (err) { /* if we didn't timeout... */ - ifp->if_oerrors++; - lprintf("X"); - } else { - ifp->if_opackets++; - ifp->if_obytes += m->m_pkthdr.len; - if (bpf_peers_present(ifp->if_bpf)) - lptap(ifp, m); - } - - m_freem(m); - - if (ppb_rstr(ppbus) & LPIP_SHAKE) { - lprintf("^"); - lp_intr(dev); - } - (void) splx(s); - return 0; + (void) splx(s); + return (0); } static device_method_t lp_methods[] = { @@ -749,9 +757,9 @@ static device_method_t lp_methods[] = { }; static driver_t lp_driver = { - "plip", - lp_methods, - sizeof(struct lp_data), + "plip", + lp_methods, + sizeof(struct lp_data), }; DRIVER_MODULE(plip, ppbus, lp_driver, lp_devclass, 0, 0); From owner-svn-src-head@FreeBSD.ORG Wed Nov 12 22:44:51 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4ABF11065673; Wed, 12 Nov 2008 22:44:51 +0000 (UTC) (envelope-from ambrisko@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 352828FC12; Wed, 12 Nov 2008 22:44:51 +0000 (UTC) (envelope-from ambrisko@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mACMipf2042204; Wed, 12 Nov 2008 22:44:51 GMT (envelope-from ambrisko@svn.freebsd.org) Received: (from ambrisko@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mACMioux042199; Wed, 12 Nov 2008 22:44:50 GMT (envelope-from ambrisko@svn.freebsd.org) Message-Id: <200811122244.mACMioux042199@svn.freebsd.org> From: Doug Ambrisko Date: Wed, 12 Nov 2008 22:44: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: r184897 - head/sys/dev/mfi X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Nov 2008 22:44:51 -0000 Author: ambrisko Date: Wed Nov 12 22:44:50 2008 New Revision: 184897 URL: http://svn.freebsd.org/changeset/base/184897 Log: - Fix from jhb for failing I/O request when bus_dmamap_load fails. - Fix to ioctl path in which the length could be 0 which means no data in/out from LSI. - Fix to ioctl path in which the data in the sense data space of the ioctl packet is a really a pointer to some location in user-space. From LSI re-worked a bit by me. - Add HW support for next gen cards from LSI. Thanks to LSI for their support! Submitted by: jhb, LSI MFC after: 3 days Modified: head/sys/dev/mfi/mfi.c head/sys/dev/mfi/mfi_ioctl.h head/sys/dev/mfi/mfi_pci.c head/sys/dev/mfi/mfireg.h head/sys/dev/mfi/mfivar.h Modified: head/sys/dev/mfi/mfi.c ============================================================================== --- head/sys/dev/mfi/mfi.c Wed Nov 12 22:14:05 2008 (r184896) +++ head/sys/dev/mfi/mfi.c Wed Nov 12 22:44:50 2008 (r184897) @@ -163,7 +163,11 @@ static void mfi_enable_intr_ppc(struct mfi_softc *sc) { MFI_WRITE4(sc, MFI_ODCR0, 0xFFFFFFFF); - MFI_WRITE4(sc, MFI_OMSK, ~MFI_1078_EIM); + if (sc->mfi_flags & MFI_FLAGS_1078) { + MFI_WRITE4(sc, MFI_OMSK, ~MFI_1078_EIM); + } else if (sc->mfi_flags & MFI_FLAGS_GEN2) { + MFI_WRITE4(sc, MFI_OMSK, ~MFI_GEN2_EIM); + } } static int32_t @@ -171,14 +175,14 @@ mfi_read_fw_status_xscale(struct mfi_sof { return MFI_READ4(sc, MFI_OMSG0); } - + static int32_t mfi_read_fw_status_ppc(struct mfi_softc *sc) { return MFI_READ4(sc, MFI_OSP0); } -static int +static int mfi_check_clear_intr_xscale(struct mfi_softc *sc) { int32_t status; @@ -191,26 +195,33 @@ mfi_check_clear_intr_xscale(struct mfi_s return 0; } -static int +static int mfi_check_clear_intr_ppc(struct mfi_softc *sc) { int32_t status; status = MFI_READ4(sc, MFI_OSTS); - if (!status) - return 1; + if (sc->mfi_flags & MFI_FLAGS_1078) { + if (!(status & MFI_1078_RM)) { + return 1; + } + } else if (sc->mfi_flags & MFI_FLAGS_GEN2) { + if (!(status & MFI_GEN2_RM)) { + return 1; + } + } MFI_WRITE4(sc, MFI_ODCR0, status); return 0; } -static void +static void mfi_issue_cmd_xscale(struct mfi_softc *sc,uint32_t bus_add,uint32_t frame_cnt) { MFI_WRITE4(sc, MFI_IQP,(bus_add >>3)|frame_cnt); } - -static void + +static void mfi_issue_cmd_ppc(struct mfi_softc *sc,uint32_t bus_add,uint32_t frame_cnt) { MFI_WRITE4(sc, MFI_IQP, (bus_add |frame_cnt <<1)|1 ); @@ -1399,6 +1410,8 @@ mfi_bio_complete(struct mfi_command *cm) device_printf(sc->mfi_dev, "I/O error, status= %d " "scsi_status= %d\n", hdr->cmd_status, hdr->scsi_status); mfi_print_sense(cm->cm_sc, cm->cm_sense); + } else if (cm->cm_error != 0) { + bio->bio_flags |= BIO_ERROR; } mfi_release_command(cm); @@ -1815,6 +1828,9 @@ mfi_check_command_post(struct mfi_softc case MFI_DCMD_CFG_ADD: mfi_ldprobe(sc); break; + case MFI_DCMD_CFG_FOREIGN_IMPORT: + mfi_ldprobe(sc); + break; } } @@ -1904,7 +1920,7 @@ mfi_ioctl(struct cdev *dev, u_long cmd, struct mfi_ioc_aen *aen; struct mfi_command *cm = NULL; uint32_t context; - uint8_t *sense_ptr; + union mfi_sense_ptr sense_ptr; uint8_t *data = NULL, *temp; int i; struct mfi_ioc_passthru *iop = (struct mfi_ioc_passthru *)arg; @@ -1986,8 +2002,9 @@ mfi_ioctl(struct cdev *dev, u_long cmd, context = cm->cm_frame->header.context; bcopy(ioc->mfi_frame.raw, cm->cm_frame, - 2 * MFI_DCMD_FRAME_SIZE); /* this isn't quite right */ - cm->cm_total_frame_size = (sizeof(union mfi_sgl) * ioc->mfi_sge_count) + ioc->mfi_sgl_off; + 2 * MFI_DCMD_FRAME_SIZE); /* this isn't quite right */ + cm->cm_total_frame_size = (sizeof(union mfi_sgl) + * ioc->mfi_sge_count) + ioc->mfi_sgl_off; if (ioc->mfi_sge_count) { cm->cm_sg = (union mfi_sgl *)&cm->cm_frame->bytes[ioc->mfi_sgl_off]; @@ -2001,7 +2018,8 @@ mfi_ioctl(struct cdev *dev, u_long cmd, if (cm->cm_flags == 0) cm->cm_flags |= MFI_CMD_DATAIN | MFI_CMD_DATAOUT; cm->cm_len = cm->cm_frame->header.data_len; - if (cm->cm_flags & (MFI_CMD_DATAIN | MFI_CMD_DATAOUT)) { + if (cm->cm_len && + (cm->cm_flags & (MFI_CMD_DATAIN | MFI_CMD_DATAOUT))) { cm->cm_data = data = malloc(cm->cm_len, M_MFIBUF, M_WAITOK | M_ZERO); if (cm->cm_data == NULL) { @@ -2102,10 +2120,12 @@ mfi_ioctl(struct cdev *dev, u_long cmd, } if (ioc->mfi_sense_len) { - /* copy out sense */ - sense_ptr = &((struct mfi_ioc_packet*)arg) - ->mfi_frame.raw[0]; - error = copyout(cm->cm_sense, sense_ptr, + /* get user-space sense ptr then copy out sense */ + bcopy(&((struct mfi_ioc_packet*)arg) + ->mfi_frame.raw[ioc->mfi_sense_off], + &sense_ptr.sense_ptr_data[0], + sizeof(sense_ptr.sense_ptr_data)); + error = copyout(cm->cm_sense, sense_ptr.user_space, ioc->mfi_sense_len); if (error != 0) { device_printf(sc->mfi_dev, @@ -2207,7 +2227,7 @@ mfi_linux_ioctl_int(struct cdev *dev, u_ struct mfi_linux_ioc_aen l_aen; struct mfi_command *cm = NULL; struct mfi_aen *mfi_aen_entry; - uint8_t *sense_ptr; + union mfi_sense_ptr sense_ptr; uint32_t context; uint8_t *data = NULL, *temp; int i; @@ -2241,7 +2261,8 @@ mfi_linux_ioctl_int(struct cdev *dev, u_ bcopy(l_ioc.lioc_frame.raw, cm->cm_frame, 2 * MFI_DCMD_FRAME_SIZE); /* this isn't quite right */ - cm->cm_total_frame_size = (sizeof(union mfi_sgl) * l_ioc.lioc_sge_count) + l_ioc.lioc_sgl_off; + cm->cm_total_frame_size = (sizeof(union mfi_sgl) + * l_ioc.lioc_sge_count) + l_ioc.lioc_sgl_off; if (l_ioc.lioc_sge_count) cm->cm_sg = (union mfi_sgl *)&cm->cm_frame->bytes[l_ioc.lioc_sgl_off]; @@ -2251,7 +2272,8 @@ mfi_linux_ioctl_int(struct cdev *dev, u_ if (cm->cm_frame->header.flags & MFI_FRAME_DATAOUT) cm->cm_flags |= MFI_CMD_DATAOUT; cm->cm_len = cm->cm_frame->header.data_len; - if (cm->cm_flags & (MFI_CMD_DATAIN | MFI_CMD_DATAOUT)) { + if (cm->cm_len && + (cm->cm_flags & (MFI_CMD_DATAIN | MFI_CMD_DATAOUT))) { cm->cm_data = data = malloc(cm->cm_len, M_MFIBUF, M_WAITOK | M_ZERO); if (cm->cm_data == NULL) { @@ -2316,10 +2338,12 @@ mfi_linux_ioctl_int(struct cdev *dev, u_ } if (l_ioc.lioc_sense_len) { - /* copy out sense */ - sense_ptr = &((struct mfi_linux_ioc_packet*)arg) - ->lioc_frame.raw[0]; - error = copyout(cm->cm_sense, sense_ptr, + /* get user-space sense ptr then copy out sense */ + bcopy(&((struct mfi_linux_ioc_packet*)arg) + ->lioc_frame.raw[l_ioc.lioc_sense_off], + &sense_ptr.sense_ptr_data[0], + sizeof(sense_ptr.sense_ptr_data)); + error = copyout(cm->cm_sense, sense_ptr.user_space, l_ioc.lioc_sense_len); if (error != 0) { device_printf(sc->mfi_dev, Modified: head/sys/dev/mfi/mfi_ioctl.h ============================================================================== --- head/sys/dev/mfi/mfi_ioctl.h Wed Nov 12 22:14:05 2008 (r184896) +++ head/sys/dev/mfi/mfi_ioctl.h Wed Nov 12 22:44:50 2008 (r184897) @@ -50,6 +50,16 @@ union mfi_statrequest { struct mfi_qstat ms_qstat; }; +#define MAX_SPACE_FOR_SENSE_PTR 32 +union mfi_sense_ptr { + uint8_t sense_ptr_data[MAX_SPACE_FOR_SENSE_PTR]; + void *user_space; + struct { + uint32_t low; + uint32_t high; + } addr; +} __packed; + #define MAX_IOCTL_SGE 16 struct mfi_ioc_packet { Modified: head/sys/dev/mfi/mfi_pci.c ============================================================================== --- head/sys/dev/mfi/mfi_pci.c Wed Nov 12 22:14:05 2008 (r184896) +++ head/sys/dev/mfi/mfi_pci.c Wed Nov 12 22:44:50 2008 (r184897) @@ -118,7 +118,14 @@ struct mfi_ident { {0x1000, 0x0413, 0xffff, 0xffff, MFI_FLAGS_1064R, "LSI MegaSAS 1064R"}, /* Verde ZCR */ {0x1028, 0x0015, 0xffff, 0xffff, MFI_FLAGS_1064R, "Dell PERC 5/i"}, {0x1000, 0x0060, 0x1028, 0xffff, MFI_FLAGS_1078, "Dell PERC 6"}, - {0x1000, 0x0060, 0xffff, 0xffff, MFI_FLAGS_1078, "LSI MegaSAS 1078"}, + {0x1000, 0x0060, 0xffff, 0xffff, MFI_FLAGS_1078, "LSI MegaSAS 1078"}, + {0x1000, 0x0079, 0x1028, 0x1f15, MFI_FLAGS_GEN2, "Dell PERC 607E Adapter"}, + {0x1000, 0x0079, 0x1028, 0x1f16, MFI_FLAGS_GEN2, "Dell PERC 607I Adapter"}, + {0x1000, 0x0079, 0x1028, 0x1f17, MFI_FLAGS_GEN2, "Dell PERC 607I Integrated"}, + {0x1000, 0x0079, 0x1028, 0x1f18, MFI_FLAGS_GEN2, "Dell PERC 607I Modular"}, + {0x1000, 0x0078, 0xffff, 0xffff, MFI_FLAGS_GEN2, "LSI MegaSAS Gen2"}, + {0x1000, 0x0079, 0xffff, 0xffff, MFI_FLAGS_GEN2, "LSI MegaSAS Gen2"}, + {0x1000, 0x007c, 0xffff, 0xffff, MFI_FLAGS_1078, "LSI MegaSAS 1078"}, {0, 0, 0, 0, 0, NULL} }; @@ -163,6 +170,8 @@ mfi_pci_attach(device_t dev) sc = device_get_softc(dev); bzero(sc, sizeof(*sc)); sc->mfi_dev = dev; + m = mfi_find_ident(dev); + sc->mfi_flags = m->flags; /* Verify that the adapter can be set up in PCI space */ command = pci_read_config(dev, PCIR_COMMAND, 2); @@ -179,7 +188,14 @@ mfi_pci_attach(device_t dev) } /* Allocate PCI registers */ - sc->mfi_regs_rid = PCIR_BAR(0); + if ((sc->mfi_flags & MFI_FLAGS_1064R) || + (sc->mfi_flags & MFI_FLAGS_1078)) { + /* 1068/1078: Memory mapped BAR is at offset 0x10 */ + sc->mfi_regs_rid = PCIR_BAR(0); + } else if (sc->mfi_flags & MFI_FLAGS_GEN2) { + /* GEN2: Memory mapped BAR is at offset 0x14 */ + sc->mfi_regs_rid = PCIR_BAR(1); + } if ((sc->mfi_regs_resource = bus_alloc_resource_any(sc->mfi_dev, SYS_RES_MEMORY, &sc->mfi_regs_rid, RF_ACTIVE)) == NULL) { device_printf(dev, "Cannot allocate PCI registers\n"); @@ -206,9 +222,6 @@ mfi_pci_attach(device_t dev) goto out; } - m = mfi_find_ident(dev); - sc->mfi_flags = m->flags; - error = mfi_attach(sc); out: if (error) { Modified: head/sys/dev/mfi/mfireg.h ============================================================================== --- head/sys/dev/mfi/mfireg.h Wed Nov 12 22:14:05 2008 (r184896) +++ head/sys/dev/mfi/mfireg.h Wed Nov 12 22:44:50 2008 (r184897) @@ -89,10 +89,16 @@ __FBSDID("$FreeBSD$"); #define MFI_ODCR0 0xa0 /* outbound doorbell clear register0 */ #define MFI_OSP0 0xb0 /* outbound scratch pad0 */ #define MFI_1078_EIM 0x80000004 /* 1078 enable intrrupt mask */ -#define MFI_RMI 0x2 /* reply message interrupt */ +#define MFI_RMI 0x2 /* reply message interrupt */ #define MFI_1078_RM 0x80000000 /* reply 1078 message interrupt */ #define MFI_ODC 0x4 /* outbound doorbell change interrupt */ +/* + * GEN2 specific changes + */ +#define MFI_GEN2_EIM 0x00000005 /* GEN2 enable interrupt mask */ +#define MFI_GEN2_RM 0x00000001 /* reply GEN2 message interrupt */ + /* Bits for MFI_OSTS */ #define MFI_OSTS_INTR_VALID 0x00000002 @@ -153,6 +159,7 @@ typedef enum { MFI_DCMD_CFG_READ = 0x04010000, MFI_DCMD_CFG_ADD = 0x04020000, MFI_DCMD_CFG_CLEAR = 0x04030000, + MFI_DCMD_CFG_FOREIGN_IMPORT = 0x04060400, MFI_DCMD_CLUSTER = 0x08000000, MFI_DCMD_CLUSTER_RESET_ALL = 0x08010100, MFI_DCMD_CLUSTER_RESET_LD = 0x08010200 Modified: head/sys/dev/mfi/mfivar.h ============================================================================== --- head/sys/dev/mfi/mfivar.h Wed Nov 12 22:14:05 2008 (r184896) +++ head/sys/dev/mfi/mfivar.h Wed Nov 12 22:44:50 2008 (r184897) @@ -133,6 +133,7 @@ struct mfi_softc { #define MFI_FLAGS_STOP (1<<3) #define MFI_FLAGS_1064R (1<<4) #define MFI_FLAGS_1078 (1<<5) +#define MFI_FLAGS_GEN2 (1<<6) struct mfi_hwcomms *mfi_comms; TAILQ_HEAD(,mfi_command) mfi_free; From owner-svn-src-head@FreeBSD.ORG Wed Nov 12 23:53:57 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1E0231065670; Wed, 12 Nov 2008 23:53:57 +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 E4F248FC0C; Wed, 12 Nov 2008 23:53:56 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mACNrurC043625; Wed, 12 Nov 2008 23:53:56 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mACNrubn043624; Wed, 12 Nov 2008 23:53:56 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200811122353.mACNrubn043624@svn.freebsd.org> From: Robert Watson Date: Wed, 12 Nov 2008 23:53: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: r184901 - head/contrib/openbsm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Nov 2008 23:53:57 -0000 Author: rwatson Date: Wed Nov 12 23:53:56 2008 New Revision: 184901 URL: http://svn.freebsd.org/changeset/base/184901 Log: Bootstrap merge history for OpenBSM. Modified: head/contrib/openbsm/ (props changed) From owner-svn-src-head@FreeBSD.ORG Thu Nov 13 00:21:02 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 61CB7106567B; Thu, 13 Nov 2008 00:21:02 +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 4D4AA8FC12; Thu, 13 Nov 2008 00:21:02 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mAD0L2dp044322; Thu, 13 Nov 2008 00:21:02 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mAD0L2ud044320; Thu, 13 Nov 2008 00:21:02 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200811130021.mAD0L2ud044320@svn.freebsd.org> From: Robert Watson Date: Thu, 13 Nov 2008 00:21:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184904 - head/sys/security/audit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Nov 2008 00:21:02 -0000 Author: rwatson Date: Thu Nov 13 00:21:01 2008 New Revision: 184904 URL: http://svn.freebsd.org/changeset/base/184904 Log: The audit queue limit variables are size_t, so use size_t for the audit queue length variables as well, avoiding storing the limit in a larger type than the length. Submitted by: sson Sponsored by: Apple Inc. MFC after: 1 week Modified: head/sys/security/audit/audit.c head/sys/security/audit/audit_private.h Modified: head/sys/security/audit/audit.c ============================================================================== --- head/sys/security/audit/audit.c Thu Nov 13 00:05:37 2008 (r184903) +++ head/sys/security/audit/audit.c Thu Nov 13 00:21:01 2008 (r184904) @@ -129,8 +129,8 @@ struct mtx audit_mtx; * outstanding in the system. */ struct kaudit_queue audit_q; -int audit_q_len; -int audit_pre_q_len; +size_t audit_q_len; +size_t audit_pre_q_len; /* * Audit queue control settings (minimum free, low/high water marks, etc.) Modified: head/sys/security/audit/audit_private.h ============================================================================== --- head/sys/security/audit/audit_private.h Thu Nov 13 00:05:37 2008 (r184903) +++ head/sys/security/audit/audit_private.h Thu Nov 13 00:21:01 2008 (r184904) @@ -275,8 +275,8 @@ extern struct mtx audit_mtx; extern struct cv audit_watermark_cv; extern struct cv audit_worker_cv; extern struct kaudit_queue audit_q; -extern int audit_q_len; -extern int audit_pre_q_len; +extern size_t audit_q_len; +extern size_t audit_pre_q_len; extern int audit_in_failure; /* From owner-svn-src-head@FreeBSD.ORG Thu Nov 13 01:47:09 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4D3D91065673; Thu, 13 Nov 2008 01:47:09 +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 38A238FC0C; Thu, 13 Nov 2008 01:47:09 +0000 (UTC) (envelope-from kensmith@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mAD1l9Jw045891; Thu, 13 Nov 2008 01:47:09 GMT (envelope-from kensmith@svn.freebsd.org) Received: (from kensmith@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mAD1l9DY045890; Thu, 13 Nov 2008 01:47:09 GMT (envelope-from kensmith@svn.freebsd.org) Message-Id: <200811130147.mAD1l9DY045890@svn.freebsd.org> From: Ken Smith Date: Thu, 13 Nov 2008 01:47: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: r184905 - head/release X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Nov 2008 01:47:09 -0000 Author: kensmith Date: Thu Nov 13 01:47:08 2008 New Revision: 184905 URL: http://svn.freebsd.org/changeset/base/184905 Log: This is being committed from a sparc64 (US-III, thanks Marius!) that was installed from a DVD so apparently it works... :-) Enable building DVDs for sparc64. Modified: head/release/Makefile Modified: head/release/Makefile ============================================================================== --- head/release/Makefile Thu Nov 13 00:21:01 2008 (r184904) +++ head/release/Makefile Thu Nov 13 01:47:08 2008 (r184905) @@ -211,6 +211,7 @@ MFSINODE= 8000 MFSLABEL= minimum3 .elif ${TARGET_ARCH} == "sparc64" DISKLABEL= sunlabel +MAKE_DVD= MFSSIZE= 4096 MFSINODE= 8192 MFSLABEL= auto From owner-svn-src-head@FreeBSD.ORG Thu Nov 13 04:11:02 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3B3B5106567E; Thu, 13 Nov 2008 04:11:02 +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 2460F8FC0A; Thu, 13 Nov 2008 04:11:02 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mAD4B11d048780; Thu, 13 Nov 2008 04:11:01 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mAD4B1xM048779; Thu, 13 Nov 2008 04:11:01 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200811130411.mAD4B1xM048779@svn.freebsd.org> From: Pyun YongHyeon Date: Thu, 13 Nov 2008 04:11: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: r184908 - head/sys/dev/vge X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Nov 2008 04:11:02 -0000 Author: yongari Date: Thu Nov 13 04:11:01 2008 New Revision: 184908 URL: http://svn.freebsd.org/changeset/base/184908 Log: Fix Rx/Tx checksum offload ioctl handling. Now checksum offload can be controlled by ifconfig(8). Note, VLAN hardware tagging controls still lacks required handler but it requires more driver cleanups so I didn't touch that part. PR: kern/128766 Modified: head/sys/dev/vge/if_vge.c Modified: head/sys/dev/vge/if_vge.c ============================================================================== --- head/sys/dev/vge/if_vge.c Thu Nov 13 02:35:29 2008 (r184907) +++ head/sys/dev/vge/if_vge.c Thu Nov 13 04:11:01 2008 (r184908) @@ -2226,15 +2226,17 @@ vge_ioctl(ifp, command, data) } } #endif /* DEVICE_POLLING */ - if (mask & IFCAP_HWCSUM) { - ifp->if_capenable |= ifr->ifr_reqcap & (IFCAP_HWCSUM); - if (ifp->if_capenable & IFCAP_TXCSUM) - ifp->if_hwassist = VGE_CSUM_FEATURES; + if ((mask & IFCAP_TXCSUM) != 0 && + (ifp->if_capabilities & IFCAP_TXCSUM) != 0) { + ifp->if_capenable ^= IFCAP_TXCSUM; + if ((ifp->if_capenable & IFCAP_TXCSUM) != 0) + ifp->if_hwassist |= VGE_CSUM_FEATURES; else - ifp->if_hwassist = 0; - if (ifp->if_drv_flags & IFF_DRV_RUNNING) - vge_init(sc); + ifp->if_hwassist &= ~VGE_CSUM_FEATURES; } + if ((mask & IFCAP_RXCSUM) != 0 && + (ifp->if_capabilities & IFCAP_RXCSUM) != 0) + ifp->if_capenable ^= IFCAP_RXCSUM; } break; default: From owner-svn-src-head@FreeBSD.ORG Thu Nov 13 07:26:30 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6F2501065673; Thu, 13 Nov 2008 07:26:30 +0000 (UTC) (envelope-from versus@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 58DD68FC1B; Thu, 13 Nov 2008 07:26:30 +0000 (UTC) (envelope-from versus@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mAD7QUKO052319; Thu, 13 Nov 2008 07:26:30 GMT (envelope-from versus@svn.freebsd.org) Received: (from versus@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mAD7QU0F052318; Thu, 13 Nov 2008 07:26:30 GMT (envelope-from versus@svn.freebsd.org) Message-Id: <200811130726.mAD7QU0F052318@svn.freebsd.org> From: Konrad Jankowski Date: Thu, 13 Nov 2008 07:26: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: r184913 - head/share/misc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Nov 2008 07:26:30 -0000 Author: versus Date: Thu Nov 13 07:26:30 2008 New Revision: 184913 URL: http://svn.freebsd.org/changeset/base/184913 Log: Add myself to the src committers list, with Diomidis as the mentor. Approved by: dds (mentor) Modified: head/share/misc/committers-src.dot Modified: head/share/misc/committers-src.dot ============================================================================== --- head/share/misc/committers-src.dot Thu Nov 13 06:06:18 2008 (r184912) +++ head/share/misc/committers-src.dot Thu Nov 13 07:26:30 2008 (r184913) @@ -174,6 +174,7 @@ trasz [label="Edward Tomasz Napierala\nt trhodes [label="Tom Rhodes\ntrhodes@FreeBSD.org\n2002/05/28"] ume [label="Hajimu UMEMOTO\nume@FreeBSD.org\n2000/02/26"] vanhu [label="Yvan Vanhullebus\nvanhu@FreeBSD.org\n2008/07/21"] +versus [label="Konrad Jankowski\nversus@FreeBSD.org\n2008/10/27"] weongyo [label="Weongyo Jeong\nweongyo@FreeBSD.org\n2007/12/21"] wes [label="Wes Peters\nwes@FreeBSD.org\n1998/11/25"] wilko [label="Wilko Bulte\nwilko@FreeBSD.org\n2000/01/13"] @@ -233,6 +234,8 @@ des -> mike des -> olli des -> ru +dds -> versus + dwmalone -> fanf dwmalone -> peadar From owner-svn-src-head@FreeBSD.ORG Thu Nov 13 09:53:53 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D3165106567E; Thu, 13 Nov 2008 09:53:53 +0000 (UTC) (envelope-from jkoshy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C0B588FC08; Thu, 13 Nov 2008 09:53:53 +0000 (UTC) (envelope-from jkoshy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mAD9rruL054924; Thu, 13 Nov 2008 09:53:53 GMT (envelope-from jkoshy@svn.freebsd.org) Received: (from jkoshy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mAD9rrIt054923; Thu, 13 Nov 2008 09:53:53 GMT (envelope-from jkoshy@svn.freebsd.org) Message-Id: <200811130953.mAD9rrIt054923@svn.freebsd.org> From: Joseph Koshy Date: Thu, 13 Nov 2008 09:53: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: r184914 - head/lib/libpmc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Nov 2008 09:53:54 -0000 Author: jkoshy Date: Thu Nov 13 09:53:53 2008 New Revision: 184914 URL: http://svn.freebsd.org/changeset/base/184914 Log: Remove duplicates, fix errors and document UMASK values. Modified: head/lib/libpmc/pmc.atom.3 Modified: head/lib/libpmc/pmc.atom.3 ============================================================================== --- head/lib/libpmc/pmc.atom.3 Thu Nov 13 07:26:30 2008 (r184913) +++ head/lib/libpmc/pmc.atom.3 Thu Nov 13 09:53:53 2008 (r184914) @@ -231,45 +231,45 @@ Core2 programmable PMCs support the foll .Pq Event E6H , Umask 01H The number of times the front end is resteered. .It Li BOGUS_BR -.Pq Event E4H +.Pq Event E4H , Umask 00H The number of byte sequences mistakenly detected as taken branch instructions. .It Li BR_BAC_MISSP_EXEC -.Pq Event 8AH +.Pq Event 8AH , Umask 00H The number of branch instructions that were mispredicted when decoded. .It Li BR_CALL_MISSP_EXEC -.Pq Event 93H +.Pq Event 93H , Umask 00H The number of mispredicted .Li CALL instructions that were executed. .It Li BR_CALL_EXEC -.Pq Event 92H +.Pq Event 92H , Umask 00H The number of .Li CALL instructions executed. .It Li BR_CND_EXEC -.Pq Event 8BH +.Pq Event 8BH , Umask 00H The number of conditional branches executed, but not necessarily retired. .It Li BR_CND_MISSP_EXEC -.Pq Event 8CH +.Pq Event 8CH , Umask 00H The number of mispredicted conditional branches executed. .It Li BR_IND_CALL_EXEC -.Pq Event 94H +.Pq Event 94H , Umask 00H The number of indirect .Li CALL instructions executed. .It Li BR_IND_EXEC -.Pq Event 8DH +.Pq Event 8DH , Umask 00H The number of indirect branch instructions executed. .It Li BR_IND_MISSP_EXEC -.Pq Event 8EH +.Pq Event 8EH , Umask 00H The number of mispredicted indirect branch instructions executed. .It Li BR_INST_DECODED .Pq Event E0H , Umask 01H The number of branch instructions decoded. .It Li BR_INST_EXEC -.Pq Event 88H +.Pq Event 88H , Umask 00H The number of branches executed, but not necessarily retired. .It Li BR_INST_RETIRED.ANY .Pq Event C4H , Umask 00H @@ -280,7 +280,7 @@ This is an architectural performance eve .Pq Event C4H , Umask 0FH The number of branch instructions retired that were mispredicted. .It Li BR_INST_RETIRED.MISPRED -.Pq Event C5, Umask 00H +.Pq Event C5H , Umask 00H .Pq Alias Qq "Branch Misses Retired" The number of mispredicted branch instructions retired. This is an architectural performance event. @@ -303,28 +303,28 @@ predicted. .Pq Event C4H , Umask 0CH The number of taken branch instructions retired. .It Li BR_MISSP_EXEC -.Pq Event 89H +.Pq Event 89H , Umask 00H The number of mispredicted branch instructions that were executed. .It Li BR_RET_MISSP_EXEC -.Pq Event 90H +.Pq Event 90H , Umask 00H The number of mispredicted .Li RET instructions executed. .It Li BR_RET_BAC_MISSP_EXEC -.Pq Event 91H +.Pq Event 91H , Umask 00H The number of .Li RET instructions executed that were mispredicted at decode time. .It Li BR_RET_EXEC -.Pq Event 8FH +.Pq Event 8FH , Umask 00H The number of .Li RET instructions executed. .It Li BR_TKN_BUBBLE_1 -.Pq Event 97H +.Pq Event 97H , Umask 00H The number of branch predicted taken with bubble 1. .It Li BR_TKN_BUBBLE_2 -.Pq Event 98H +.Pq Event 98H , Umask 00H The number of branch predicted taken with bubble 2. .It Li BUSQ_EMPTY Op ,core= Ns Ar core .Pq Event 7DH @@ -485,7 +485,7 @@ The number of cycles during which interr The number of cycles during which there were pending interrupts while interrupts were disabled. .It Li CYCLES_L1I_MEM_STALLED -.Pq Event 86H +.Pq Event 86H , Umask 00H The number of cycles for which an instruction fetch stalls. .It Li DATA_TLB_MISSES.DTLB_MISS .Pq Event 08H , Umask 07H @@ -534,7 +534,7 @@ The number of Data TLB misses due to loa .Pq Event 08H , Umask 08H The number of Data TLB misses due to store operations. .It Li EIST_TRANS -.Pq Event 3AH +.Pq Event 3AH , Umask 00H The number of Enhanced Intel SpeedStep Technology transitions. .It Li ESP.ADDITIONS .Pq Event ABH , Umask 02H @@ -561,13 +561,9 @@ The number of snoop responses to bus tra .Pq Event 11H , Umask 01H The number of floating point operations executed that needed a microcode assist. -.It Li FP_ASSIST -.Pq Event 11H , Umask 01H -The number of floating point operations executed that needed -a microcode assist. .It Li FP_ASSIST.AR -.Pq Event 11H , Umask 01H -.\" XXX to be confirmed +.Pq Event 11H , Umask 81H +.\" XXX to be confirmed that this is an at-retirement event The number of floating point operations retired that needed a microcode assist. .It Li FP_COMP_OPS_EXE @@ -583,7 +579,7 @@ instructions. The number of transitions from floating point instructions to MMX instructions. .It Li HW_INT_RCV -.Pq Event C8H +.Pq Event C8H , Umask 00H The number of hardware interrupts recieved. .It Li ICACHE.ACCESSES .Pq Event 80H , Umask 03H @@ -592,16 +588,16 @@ The number of instruction fetches. .Pq Event 80H , Umask 02H The number of instruction fetches that miss the instruction cache. .It Li IDLE_DURING_DIV -.Pq Event 18H +.Pq Event 18H , Umask 00H The number of cycles the divider is busy and no other execution unit or load operation was in progress. This event is available only on PMC0. .It Li ILD_STALL -.Pq Event 87H +.Pq Event 87H , Umask 00H The number of cycles the instruction length decoder stalled due to a length changing prefix. .It Li INST_QUEUE.FULL -.Pq Event 83H +.Pq Event 83H , Umask 02H The number of cycles during which the instruction queue is full. .It Li INST_RETIRED.ANY_P .Pq Event C0H , Umask 00H @@ -612,11 +608,11 @@ This is an architectural performance eve .Pq Event C0H , Umask 01H The number of instructions retired that contained a load operation. .It Li INST_RETIRED.OTHER -.Pq Event C0H +.Pq Event C0H , Umask 04H The number of instructions retired that did not contain a load or a store operation. .It Li INST_RETIRED.STORES -.Pq Event C0H +.Pq Event C0H , Umask 02H The number of instructions retired that contained a store operation. .It Li ITLB.FLUSH .Pq Event 82H , Umask 04H @@ -633,7 +629,7 @@ miss the ITLB. .Pq Event 82H , Umask 02H The number of instruction fetches from small pages that miss the ITLB. .It Li ITLB_MISS_RETIRED -.Pq Event C9H +.Pq Event C9H , Umask 00H The number of retired instructions that missed the ITLB when they were fetched. .It Li L1D_ALL_REF @@ -647,7 +643,7 @@ The number of data reads and writes to c .Pq Event 42H The number of locked reads from cacheable memory. .It Li L1D_CACHE_LOCK_DURATION -.Pq Event 42H +.Pq Event 42H , Umask 10H The number of cycles during which any cache line is locked by any locking instruction. .It Li L1D_CACHE.LD @@ -657,20 +653,20 @@ The number of data reads from cacheable .Pq Event 41H , Umask 22H The number of data writes to cacheable memory. .It Li L1D_M_EVICT -.Pq Event 47H +.Pq Event 47H , Umask 00H The number of modified cache lines evicted from L1 data cache. .It Li L1D_M_REPL -.Pq Event 46H +.Pq Event 46H , Umask 00H The number of modified lines allocated in L1 data cache. .It Li L1D_PEND_MISS -.Pq Event 48H +.Pq Event 48H , Umask 00H The total number of outstanding L1 data cache misses at any clock. -.It Li L1D_PREFETCH. -.Pq Event 4EH +.It Li L1D_PREFETCH.REQUESTS +.Pq Event 4EH , Umask 10H The number of times L1 data cache requested to prefetch a data cache line. .It Li L1D_REPL -.Pq Event 45H +.Pq Event 45H , Umask 0FH The number of lines brought into L1 data cache. .It Li L1D_SPLIT.LOADS .Pq Event 49H , Umask 01H @@ -679,10 +675,10 @@ The number of load operations that span .Pq Event 49H , Umask 02H The number of store operations that span two cache lines. .It Li L1I_MISSES -.Pq Event 81H +.Pq Event 81H , Umask 00H The number of instruction fetch unit misses. .It Li L1I_READS -.Pq Event 80H +.Pq Event 80H , Umask 00H The number of instruction fetches. .It Li L2_ADS Op ,core= Ns core .Pq Event 21H @@ -788,7 +784,7 @@ whose data value is not known. .Pq Event 03H , Umask 10H The numer of load operations that were blocked until retirement. .It Li LOAD_HIT_PRE -.Pq Event 4CH +.Pq Event 4CH , Umask 00H The number of load operations that conflicted with an prefetch to the same cache line. .It Li MACHINE_CLEARS.SMC @@ -812,8 +808,8 @@ occurs. .Pq Event 09H , Umask 02H The number of load operations that were successfully disambiguated. .It Li MEM_LOAD_RETIRED.DTLB_MISS -.Pq Event CBH , Umask 10H -The number of retired loads that missed the DTLB. +.Pq Event CBH , Umask 04H +The number of retired load operations that missed the DTLB. .It Li MEM_LOAD_RETIRED.L2_MISS .Pq Event CBH , Umask 02H The number of retired load operations that miss L2 cache. @@ -824,9 +820,6 @@ The number of retired load operations th .Pq Event CBH , Umask 08H The number of load operations that missed L2 cache and that caused a bus request. -.It Li MEM_LOAD_RETIRED.DTLB_MISS -.Pq Event CBH , Umask 04H -The number of load operations that missed the DTLB. .It Li MUL .Pq Event 12H , Umask 00H The number of multiply operations executed. @@ -846,11 +839,11 @@ The number of page walks executed due to The number of cycles spent in a page walk caused by an ITLB or DTLB miss. .It Li PREF_RQSTS_DN -.Pq Event F8H +.Pq Event F8H , Umask 00H The number of downward prefetches issued from the Data Prefetch Logic unit to L2 cache. .It Li PREF_RQSTS_UP -.Pq Event F0H +.Pq Event F0H , Umask 00H The number of upward prefetches issued from the Data Prefetch Logic unit to L2 cache. .It Li PREFETCH.PREFETCHNTA @@ -944,7 +937,7 @@ The number of cycles micro-ops were disp .Pq Event 04H , Umask 01H The number of cycles while the store buffer is draining. .It Li SEGMENT_REG_LOADS.ANY -.Pq Event 06H +.Pq Event 06H , Umask 00H The number of segment register loads. .It Li SEG_REG_RENAMES.ANY .Pq Event D5H , Umask 0FH @@ -994,7 +987,7 @@ The number of stalls due to lack of rena .Li %gs register. .It Li SIMD_ASSIST -.Pq Event CDH +.Pq Event CDH , Umask 00H The number SIMD assists invoked. .It Li SIMD_COMP_INST_RETIRED.PACKED_DOUBLE .Pq Event CAH , Umask 04H @@ -1013,7 +1006,7 @@ retired. Then number of computational SSE2 scalar single precision instructions retired. .It Li SIMD_INSTR_RETIRED -.Pq Event CEH +.Pq Event CEH , Umask 00H The number of retired SIMD instructions that use MMX registers. .It Li SIMD_INST_RETIRED.ANY .Pq Event C7H , Umask 1FH @@ -1034,7 +1027,7 @@ The number of SSE scalar single precisio .Pq Event C7H , Umask 10H The number of SSE2 vector instructions retired. .It Li SIMD_SAT_INSTR_RETIRED -.Pq Event CFH +.Pq Event CFH , Umask 00H The number of saturated arithmetic SIMD instructions retired. .It Li SIMD_SAT_UOP_EXEC.AR .Pq Event B1H , Umask 80H @@ -1126,7 +1119,7 @@ an internal or external snoop. .Pq Event 02, Umask 81H The number of times stored data was forwarded directly to a load. .It Li THERMAL_TRIP -.Pq Event 3BH +.Pq Event 3BH , Umask C0H The number of thermal trips. .It Li UOPS_RETIRED.LD_IND_BR .Pq Event C2H , Umask 01H From owner-svn-src-head@FreeBSD.ORG Thu Nov 13 10:21:56 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8878E106567C; Thu, 13 Nov 2008 10:21:56 +0000 (UTC) (envelope-from jkoshy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 76C6A8FC14; Thu, 13 Nov 2008 10:21:56 +0000 (UTC) (envelope-from jkoshy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mADALut1055614; Thu, 13 Nov 2008 10:21:56 GMT (envelope-from jkoshy@svn.freebsd.org) Received: (from jkoshy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mADALusT055613; Thu, 13 Nov 2008 10:21:56 GMT (envelope-from jkoshy@svn.freebsd.org) Message-Id: <200811131021.mADALusT055613@svn.freebsd.org> From: Joseph Koshy Date: Thu, 13 Nov 2008 10:21: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: r184916 - head/lib/libpmc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Nov 2008 10:21:56 -0000 Author: jkoshy Date: Thu Nov 13 10:21:56 2008 New Revision: 184916 URL: http://svn.freebsd.org/changeset/base/184916 Log: Fix typos, document UMASK values. Modified: head/lib/libpmc/pmc.core2.3 Modified: head/lib/libpmc/pmc.core2.3 ============================================================================== --- head/lib/libpmc/pmc.core2.3 Thu Nov 13 10:14:30 2008 (r184915) +++ head/lib/libpmc/pmc.core2.3 Thu Nov 13 10:21:56 2008 (r184916) @@ -226,48 +226,48 @@ The default is to measure both snoops. Core2 programmable PMCs support the following events: .Bl -tag -width indent .It Li BACLEARS -.Pq Event E6H +.Pq Event E6H , Umask 00H The number of times the front end is resteered. .It Li BOGUS_BR -.Pq Event E4H +.Pq Event E4H , Umask 00H The number of byte sequences mistakenly detected as taken branch instructions. .It Li BR_BAC_MISSP_EXEC -.Pq Event 8AH +.Pq Event 8AH , Umask 00H The number of branch instructions that were mispredicted when decoded. .It Li BR_CALL_MISSP_EXEC -.Pq Event 93H +.Pq Event 93H , Umask 00H The number of mispredicted .Li CALL instructions that were executed. .It Li BR_CALL_EXEC -.Pq Event 92H +.Pq Event 92H , Umask 00H The number of .Li CALL instructions executed. .It Li BR_CND_EXEC -.Pq Event 8BH +.Pq Event 8BH , Umask 00H The number of conditional branches executed, but not necessarily retired. .It Li BR_CND_MISSP_EXEC -.Pq Event 8CH +.Pq Event 8CH , Umask 00H The number of mispredicted conditional branches executed. .It Li BR_IND_CALL_EXEC -.Pq Event 94H +.Pq Event 94H , Umask 00H The number of indirect .Li CALL instructions executed. .It Li BR_IND_EXEC -.Pq Event 8DH +.Pq Event 8DH , Umask 00H The number of indirect branch instructions executed. .It Li BR_IND_MISSP_EXEC -.Pq Event 8EH +.Pq Event 8EH , Umask 00H The number of mispredicted indirect branch instructions executed. .It Li BR_INST_DECODED -.Pq Event E0H +.Pq Event E0H , Umask 00H The number of branch instructions decoded. .It Li BR_INST_EXEC -.Pq Event 88H +.Pq Event 88H , Umask 00H The number of branches executed, but not necessarily retired. .It Li BR_INST_RETIRED.ANY .Pq Event C4H , Umask 00H @@ -298,28 +298,28 @@ predicted. .Pq Event C4H , Umask 0CH The number of taken branch instructions retired. .It Li BR_MISSP_EXEC -.Pq Event 89H +.Pq Event 89H , Umask 00H The number of mispredicted branch instructions that were executed. .It Li BR_RET_MISSP_EXEC -.Pq Event 90H +.Pq Event 90H , Umask 00H The number of mispredicted .Li RET instructions executed. .It Li BR_RET_BAC_MISSP_EXEC -.Pq Event 91H +.Pq Event 91H , Umask 00H The number of .Li RET instructions executed that were mispredicted at decode time. .It Li BR_RET_EXEC -.Pq Event 8FH +.Pq Event 8FH , Umask 00H The number of .Li RET instructions executed. .It Li BR_TKN_BUBBLE_1 -.Pq Event 97H +.Pq Event 97H , Umask 00H The number of branch predicted taken with bubble 1. .It Li BR_TKN_BUBBLE_2 -.Pq Event 98H +.Pq Event 98H , Umask 00H The number of branch predicted taken with bubble 2. .It Li BUSQ_EMPTY Op ,core= Ns Ar core .Pq Event 7DH @@ -463,7 +463,7 @@ This is an architectural performance eve The number of bus cycles during which the core remains unhalted and the other core is halted. .It Li CYCLES_DIV_BUSY -.Pq Event 14H +.Pq Event 14H , Umask 00H The number of cycles the divider is busy. This event is only available on PMC0. .It Li CYCLES_INT_MASKED @@ -474,7 +474,7 @@ The number of cycles during which interr The number of cycles during which there were pending interrupts while interrupts were disabled. .It Li CYCLES_L1I_MEM_STALLED -.Pq Event 86H +.Pq Event 86H , Umask 00H The number of cycles for which an instruction fetch stalls. .It Li DELAYED_BYPASS.FP .Pq Event 19H , Umask 00H @@ -488,7 +488,7 @@ The number of delayed bypass penalty cyc The number of times SIMD operations use data immediately after data, was generated by a non-SIMD execution unit. .It Li DIV -.Pq Event 13H +.Pq Event 13H , Umask 00H The number of divide operations executed. This event is only available on PMC1. .It Li DTLB_MISSES.ANY @@ -505,7 +505,7 @@ The number of Data TLB misses due to loa .Pq Event 08H , Umask 08H The number of Data TLB misses due to store operations. .It Li EIST_TRANS -.Pq Event 3AH +.Pq Event 3AH , Umask 00H The number of Enhanced Intel SpeedStep Technology transitions. .It Li ESP.ADDITIONS .Pq Event ABH , Umask 02H @@ -529,11 +529,11 @@ instruction. .Pq Event 77H The number of snoop responses to bus transactions. .It Li FP_ASSIST -.Pq Event 11H +.Pq Event 11H , Umask 00H The number of floating point operations executed that needed a microcode assist. .It Li FP_COMP_OPS_EXE -.Pq Event 10H +.Pq Event 10H , Umask 00H The number of floating point computational micro-ops executed. The event is available only on PMC0. .It Li FP_MMX_TRANS_TO_FP @@ -545,19 +545,19 @@ instructions. The number of transitions from floating point instructions to MMX instructions. .It Li HW_INT_RCV -.Pq Event C8H +.Pq Event C8H , Umask 00H The number of hardware interrupts recieved. .It Li IDLE_DURING_DIV -.Pq Event 18H +.Pq Event 18H , Umask 00H The number of cycles the divider is busy and no other execution unit or load operation was in progress. This event is available only on PMC0. .It Li ILD_STALL -.Pq Event 87H +.Pq Event 87H , Umask 00H The number of cycles the instruction length decoder stalled due to a length changing prefix. .It Li INST_QUEUE.FULL -.Pq Event 83H +.Pq Event 83H , Umask 02H The number of cycles during which the instruction queue is full. .It Li INST_RETIRED.ANY_P .Pq Event C0H , Umask 00H @@ -568,14 +568,15 @@ This is an architectural performance eve .Pq Event C0H , Umask 01H The number of instructions retired that contained a load operation. .It Li INST_RETIRED.OTHER -.Pq Event C0H +.Pq Event C0H , Umask 04H The number of instructions retired that did not contain a load or a store operation. .It Li INST_RETIRED.STORES -.Pq Event C0H +.Pq Event C0H , Umask 02H The number of instructions retired that contained a store operation. .It Li INST_RETIRED.VM_H -.Pq Event C0H , Tn Core2Extreme +.Pq Event C0H , Umask 08H +.Pq Tn Core2Extreme The number of instructions retired while in VMX root operation. .It Li ITLB.FLUSH .Pq Event 82H , Umask 40H @@ -592,7 +593,7 @@ miss the ITLB. .Pq Event 82H , Umask 02H The number of instruction fetches from small pages that miss the ITLB. .It Li ITLB_MISS_RETIRED -.Pq Event C9H +.Pq Event C9H , Umask 00H The number of retired instructions that missed the ITLB when they were fetched. .It Li L1D_ALL_REF @@ -606,7 +607,7 @@ The number of data reads and writes to c .Pq Event 42H The number of locked reads from cacheable memory. .It Li L1D_CACHE_LOCK_DURATION -.Pq Event 42H +.Pq Event 42H , Umask 10H The number of cycles during which any cache line is locked by any locking instruction. .It Li L1D_CACHE_LD Op ,cachestate= Ns Ar state @@ -618,20 +619,20 @@ reads. The number of data writes to cacheable memory excluding locked writes. .It Li L1D_M_EVICT -.Pq Event 47H +.Pq Event 47H , Umask 00H The number of modified cache lines evicted from L1 data cache. .It Li L1D_M_REPL -.Pq Event 46H +.Pq Event 46H , Umask 00H The number of modified lines allocated in L1 data cache. .It Li L1D_PEND_MISS -.Pq Event 48H +.Pq Event 48H , Umask 00H The total number of outstanding L1 data cache misses at any clock. -.It Li L1D_PREFETCH. -.Pq Event 4EH +.It Li L1D_PREFETCH.REQUESTS +.Pq Event 4EH , Umask 10H The number of times L1 data cache requested to prefetch a data cache line. .It Li L1D_REPL -.Pq Event 45H +.Pq Event 45H , Umask 0FH The number of lines brought into L1 data cache. .It Li L1D_SPLIT.LOADS .Pq Event 49H , Umask 01H @@ -640,10 +641,10 @@ The number of load operations that span .Pq Event 49H , Umask 02H The number of store operations that span two cache lines. .It Li L1I_MISSES -.Pq Event 81H +.Pq Event 81H , Umask 00H The number of instruction fetch unit misses. .It Li L1I_READS -.Pq Event 80H +.Pq Event 80H , Umask 00H The number of instruction fetches. .It Li L2_ADS Op ,core= Ns core .Pq Event 21H @@ -750,7 +751,7 @@ whose data value is not known. .Pq Event 03H , Umask 10H The numer of load operations that were blocked until retirement. .It Li LOAD_HIT_PRE -.Pq Event 4CH +.Pq Event 4CH , Umask 00H The number of load operations that conflicted with an prefetch to the same cache line. .It Li MACHINE_NUKES.SMC @@ -793,7 +794,7 @@ bus request. .Pq Event CBH , Umask 04H The number of load operations that missed L2 cache. .It Li MUL -.Pq Event 12H +.Pq Event 12H , Umask 00H The number of multiply operations executed. This event is only available on PMC1. .It Li PAGE_WALKS.COUNT @@ -804,11 +805,11 @@ The number of page walks executed due to The number of cycles spent in a page walk caused by an ITLB or DTLB miss. .It Li PREF_RQSTS_DN -.Pq Event F8H +.Pq Event F8H , Umask 00H The number of downward prefetches issued from the Data Prefetch Logic unit to L2 cache. .It Li PREF_RQSTS_UP -.Pq Event F0H +.Pq Event F0H , Umask 00H The number of upward prefetches issued from the Data Prefetch Logic unit to L2 cache. .It Li RAT_STALLS.ANY @@ -882,14 +883,14 @@ The number of cycles micro-ops were disp The number of cycles micro-ops were dispatched for execution on port 4. .It Li RS_UOPS_DISPATCHED.PORT5 -.Pq Event A1H , Umask 20 +.Pq Event A1H , Umask 20H The number of cycles micro-ops were dispatched for execution on port 5. .It Li SB_DRAIN_CYCLES .Pq Event 04H , Umask 01H The number of cycles while the store buffer is draining. .It Li SEGMENT_REG_LOADS -.Pq Event 06H +.Pq Event 06H , Umask 00H The number of segment register loads. .It Li SEG_REG_RENAMES.ANY .Pq Event D5H , Umask 0FH @@ -939,7 +940,7 @@ The number of stalls due to lack of rena .Li %gs register. .It Li SIMD_ASSIST -.Pq Event CDH +.Pq Event CDH , Umask 00H The number SIMD assists invoked. .It Li SIMD_COMP_INST_RETIRED.PACKED_DOUBLE .Pq Event CAH , Umask 04H @@ -958,7 +959,7 @@ retired. Then number of computational SSE2 scalar single precision instructions retired. .It Li SIMD_INSTR_RETIRED -.Pq Event CEH +.Pq Event CEH , Umask 00H The number of retired SIMD instructions that use MMX registers. .It Li SIMD_INST_RETIRED.ANY .Pq Event C7H , Umask 1FH @@ -979,13 +980,13 @@ The number of SSE scalar single precisio .Pq Event C7H , Umask 10H The number of SSE2 vector instructions retired. .It Li SIMD_SAT_INSTR_RETIRED -.Pq Event CFH +.Pq Event CFH , Umask 00H The number of saturated arithmetic SIMD instructions retired. .It Li SIMD_SAT_UOP_EXEC -.Pq Event B1H +.Pq Event B1H , Umask 00H The number of SIMD saturated arithmetic micro-ops executed. .It Li SIMD_UOPS_EXEC -.Pq Event B0H +.Pq Event B0H , Umask 00H The number of SIMD micro-ops executed. .It Li SIMD_UOP_TYPE_EXEC.ARITHMETIC .Pq Event B3H , Umask 20H @@ -1053,7 +1054,7 @@ globally observed. The number of cycles while a store was blocked due to a conflict with an internal or external snoop. .It Li THERMAL_TRIP -.Pq Event 3BH +.Pq Event 3BH , Umask C0H The number of thermal trips. .It Li UOPS_RETIRED.LD_IND_BR .Pq Event C2H , Umask 01H From owner-svn-src-head@FreeBSD.ORG Thu Nov 13 10:40:13 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F0441106567D; Thu, 13 Nov 2008 10:40:13 +0000 (UTC) (envelope-from jkoshy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DF3268FC0C; Thu, 13 Nov 2008 10:40:13 +0000 (UTC) (envelope-from jkoshy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mADAeDq7055979; Thu, 13 Nov 2008 10:40:13 GMT (envelope-from jkoshy@svn.freebsd.org) Received: (from jkoshy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mADAeDv6055978; Thu, 13 Nov 2008 10:40:13 GMT (envelope-from jkoshy@svn.freebsd.org) Message-Id: <200811131040.mADAeDv6055978@svn.freebsd.org> From: Joseph Koshy Date: Thu, 13 Nov 2008 10:40: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: r184917 - head/lib/libpmc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Nov 2008 10:40:14 -0000 Author: jkoshy Date: Thu Nov 13 10:40:13 2008 New Revision: 184917 URL: http://svn.freebsd.org/changeset/base/184917 Log: Document UMASK values, fix errors. Modified: head/lib/libpmc/pmc.core.3 Modified: head/lib/libpmc/pmc.core.3 ============================================================================== --- head/lib/libpmc/pmc.core.3 Thu Nov 13 10:21:56 2008 (r184916) +++ head/lib/libpmc/pmc.core.3 Thu Nov 13 10:40:13 2008 (r184917) @@ -187,51 +187,51 @@ ignored. Core PMCs support the following events: .Bl -tag -width indent .It Li BAClears -.Pq Event E6H +.Pq Event E6H , Umask 00H The number of BAClear conditions asserted. .It Li BTB_Misses -.Pq Event E2H +.Pq Event E2H , Umask 00H The number of branches for which the branch table buffer did not produce a prediction. .It Li Br_BAC_Missp_Exec -.Pq Event 8AH +.Pq Event 8AH , Umask 00H The number of branch instructions executed that were mispredicted at the front end. .It Li Br_Bogus -.Pq Event E4H +.Pq Event E4H , Umask 00H The number of bogus branches. .It Li Br_Call_Exec -.Pq Event 92H +.Pq Event 92H , Umask 00H The number of .Li CALL instructions executed. .It Li Br_Call_Missp_Exec -.Pq Event 93H +.Pq Event 93H , Umask 00H The number of .Li CALL instructions executed that were mispredicted. .It Li Br_Cnd_Exec -.Pq Event 8BH +.Pq Event 8BH , Umask 00H The number of conditional branch instructions executed. .It Li Br_Cnd_Missp_Exec -.Pq Event 8CH +.Pq Event 8CH , Umask 00H The number of conditional branch instructions executed that were mispredicted. .It Li Br_Ind_Call_Exec -.Pq Event 94H +.Pq Event 94H , Umask 00H The number of indirect .Li CALL instructions executed. .It Li Br_Ind_Exec -.Pq Event 8DH +.Pq Event 8DH , Umask 00H The number of indirect branches executed. .It Li Br_Ind_Missp_Exec -.Pq Event 8EH +.Pq Event 8EH , Umask 00H The number of indirect branch instructions executed that were mispredicted. .It Li Br_Inst_Exec -.Pq Event 88H +.Pq Event 88H , Umask 00H The number of branch instructions executed including speculative branches. .It Li Br_Instr_Decoded -.Pq Event E0H +.Pq Event E0H , Umask 00H The number of branch instructions decoded. .It Li Br_Instr_Ret .Pq Event C4H, Umask 00H @@ -244,33 +244,33 @@ This is an architectural performance eve The number of mispredicted branch instructions retired. This is an architectural performance event. .It Li Br_MisPred_Taken_Ret -.Pq Event CAH +.Pq Event CAH , Umask 00H The number of taken and mispredicted branches retired. .It Li Br_Missp_Exec -.Pq Event 89H +.Pq Event 89H , Umask 00H The number of branch instructions executed and mispredicted at execution including branches that were not predicted. .It Li Br_Ret_BAC_Missp_Exec -.Pq Event 91H +.Pq Event 91H , Umask 00H The number of return branch instructions that were mispredicted at the front end. .It Li Br_Ret_Exec -.Pq Event 8FH +.Pq Event 8FH , Umask 00H The number of return branch instructions executed. .It Li Br_Ret_Missp_Exec -.Pq Event 90H +.Pq Event 90H , Umask 00H The number of return branch instructions executed that were mispredicted. .It Li Br_Taken_Ret -.Pq Event C9H +.Pq Event C9H , Umask 00H The number of taken branches retired. .It Li Bus_BNR_Clocks -.Pq Event 61H +.Pq Event 61H , Umask 00H The number of external bus cycles while BNR (bus not ready) was asserted. .It Li Bus_DRDY_Clocks Op ,agent= Ns Ar agent -.Pq Event 62H +.Pq Event 62H , Umask 00H The number of external bus cycles while DRDY was asserted. .It Li Bus_Data_Rcv -.Pq Event 64H +.Pq Event 64H , Umask 40H .\" XXX Using the description in Core2 PMC documentation. The number of cycles during which the processor is busy receiving data. .It Li Bus_Locks_Clocks Op ,core= Ns Ar core @@ -287,7 +287,7 @@ The number of cycles when there is no tr The weighted cycles of cacheable bus data read requests from the data cache unit or hardware prefetcher. .It Li Bus_Snoop_Stall -.Pq Event 7EH +.Pq Event 7EH , Umask 00H The number bus cycles while a bus snoop is stalled. .It Li Bus_Snoops Xo .Op ,agent= Ns Ar agent @@ -354,14 +354,14 @@ The number of completed read-for-ownersh The number of completed writeback transactions from the data cache unit, excluding L2 writebacks. .It Li Cycles_Div_Busy -.Pq Event 14H +.Pq Event 14H , Umask 00H The number of cycles the divider is busy. The event is only only available for on PMC0. .It Li Cycles_Int_Masked -.Pq Event C6H +.Pq Event C6H , Umask 00H The number of cycles while interrupts were disabled. .It Li Cycles_Int_Pending_Masked -.Pq Event C7H +.Pq Event C7H , Umask 00H The number of cycles while interrupts were disabled and interrupts were pending. .It Li DCU_Snoop_To_Share Op ,core= Ns core @@ -379,22 +379,22 @@ The number of cacheable L1 data read ope .Pq Event 41H The number cacheable L1 data write operations. .It Li DCache_M_Evict -.Pq Event 47H +.Pq Event 47H , Umask 00H The number of M state data cache lines that were evicted. .It Li DCache_M_Repl -.Pq Event 46H +.Pq Event 46H , Umask 00H The number of M state data cache lines that were allocated. .It Li DCache_Pend_Miss -.Pq Event 48H +.Pq Event 48H , Umask 00H The weighted cycles an L1 miss was outstanding. .It Li DCache_Repl -.Pq Event 45H +.Pq Event 45H , Umask 0FH The number of data cache line replacements. .It Li Data_Mem_Cache_Ref -.Pq Event 44H +.Pq Event 44H , Umask 02H The number of cacheable read and write operations to L1 data cache. .It Li Data_Mem_Ref -.Pq Event 43H +.Pq Event 43H , Umask 01H The number of L1 data reads and writes, both cacheable and uncacheable. .It Li Dbus_Busy Op ,core= Ns Ar core @@ -405,15 +405,15 @@ The number of core cycles during which t The nunber of cycles during which the data bus was busy transferring data to a core. .It Li Div -.Pq Event 13H +.Pq Event 13H , Umask 00H The number of divide operations including speculative operations for integer and floating point divides. This event can only be counted on PMC1. .It Li Dtlb_Miss -.Pq Event 49H +.Pq Event 49H , Umask 00H The number of data references that missed the TLB. .It Li ESP_Uops -.Pq Event D7H +.Pq Event D7H , Umask 00H The number of ESP folding instructions decoded. .It Li EST_Trans Op ,trans= Ns Ar transition .Pq Event 3AH @@ -430,16 +430,16 @@ can be one of the following values: The default is .Dq Li any . .It Li FP_Assist -.Pq Event 11H +.Pq Event 11H , Umask 00H The number of floating point operations that required microcode assists. The event is only available on PMC1. .It Li FP_Comp_Instr_Ret -.Pq Event C1H +.Pq Event C1H , Umask 00H The number of X87 floating point compute instructions retired. The event is only available on PMC0. .It Li FP_Comps_Op_Exe -.Pq Event 10H +.Pq Event 10H , Umask 00H The number of floating point computational instructions executed. .It Li FP_MMX_Trans .Pq Event CCH , Umask 01H @@ -454,36 +454,36 @@ The number of fused store uops retired. .Pq Event DAH , Umask 00H The number of fused uops retired. .It Li HW_Int_Rx -.Pq Event C8H +.Pq Event C8H , Umask 00H The number of hardware interrupts received. .It Li ICache_Misses -.Pq Event 81H +.Pq Event 81H , Umask 00H The number of instruction fetch misses in the instruction cache and streaming buffers. .It Li ICache_Reads -.Pq Event 80H +.Pq Event 80H , Umask 00H The number of instruction fetches from the the instruction cache and streaming buffers counting both cacheable and uncacheable fetches. .It Li IFU_Mem_Stall -.Pq Event 86H +.Pq Event 86H , Umask 00H The number of cycles the instruction fetch unit was stalled while waiting for data from memory. .It Li ILD_Stall -.Pq Event 87H +.Pq Event 87H , Umask 00H The number of instruction length decoder stalls. .It Li ITLB_Misses -.Pq Event 85H +.Pq Event 85H , Umask 00H The number of instruction TLB misses. .It Li Instr_Decoded -.Pq Event D0H +.Pq Event D0H , Umask 00H The number of instructions decoded. .It Li Instr_Ret -.Pq Event C0H +.Pq Event C0H , Umask 00H .Pq Alias Qq "Instruction Retired" The number of instructions retired. This is an architectural performance event. .It Li L1_Pref_Req -.Pq Event 4FH +.Pq Event 4FH , Umask 00H The number of L1 prefetch request due to data cache misses. .It Li L2_ADS Op ,core= Ns core .Pq Event 21H @@ -550,7 +550,7 @@ The number of L2 cache requests. .Pq Event 2AH The number of L2 cache writes including speculative writes. .It Li LD_Blocks -.Pq Event 03H +.Pq Event 03H , Umask 00H The number of load operations delayed due to store buffer blocks. .It Li LLC_Misses .Pq Event 2EH, Umask 41H @@ -564,27 +564,27 @@ This is an architectural performance eve .Pq Event 2EH, Umask 4FH This is an architectural performance event. .It Li MMX_Assist -.Pq Event CDH +.Pq Event CDH , Umask 00H The number of EMMX instructions executed. .It Li MMX_FP_Trans .Pq Event CCH , Umask 00H The number of transitions from MMX to X87. .It Li MMX_Instr_Exec -.Pq Event B0H +.Pq Event B0H , Umask 00H The number of MMX instructions executed excluding .Li MOVQ and .Li MOVD stores. .It Li MMX_Instr_Ret -.Pq Event CEH +.Pq Event CEH , Umask 00H The number of MMX instructions retired. .It Li Misalign_Mem_Ref -.Pq Event 05H +.Pq Event 05H , Umask 00H The number of misaligned data memory references, counting loads and stores. .It Li Mul -.Pq Event 12H +.Pq Event 12H , Umask 00H The number of multiply operations include speculative floating point and integer multiplies. This event is available on PMC1 only. @@ -594,16 +594,16 @@ This event is available on PMC1 only. The number of non-halted bus cycles. This is an architectural performance event. .It Li Pref_Rqsts_Dn -.Pq Event F8H +.Pq Event F8H , Umask 00H The number of hardware prefetch requests issued in backward streams. .It Li Pref_Rqsts_Up -.Pq Event F0H +.Pq Event F0H , Umask 00H The number of hardware prefetch requests issued in forward streams. .It Li Resource_Stall -.Pq Event A2H +.Pq Event A2H , Umask 00H The number of cycles where there is a resource related stall. .It Li SD_Drains -.Pq Event 04H +.Pq Event 04H , Umask 00H The number of cycles while draining store buffers. .It Li SIMD_FP_DP_P_Ret .Pq Event D8H , Umask 02H @@ -652,7 +652,7 @@ The number of SIMD integer packed multip .Pq Event B3H , Umask 02H The number of SIMD integer packed shift instructions executed. .It Li SIMD_Int_Sat_Exec -.Pq Event B1H +.Pq Event B1H , Umask 00H The number of SIMD integer saturating instructions executed. .It Li SIMD_Int_Upck_Exec .Pq Event B3H , Umask 08H @@ -697,7 +697,7 @@ The number of .Li PREFETCHT2 instructions retired. .It Li Seg_Reg_Loads -.Pq Event 06H +.Pq Event 06H , Umask 00H The number of segment register loads. .It Li Serial_Execution_Cycles .Pq Event 3CH , Umask 02H @@ -707,15 +707,15 @@ was halted. .Pq Event 3BH , Umask C0H The duration in a thermal trip based on the current core clock. .It Li Unfusion -.Pq Event DBH +.Pq Event DBH , Umask 00H The number of unfusion events. -.It Li "Unhalted_Core_Cycles" +.It Li Unhalted_Core_Cycles .Pq Event 3CH , Umask 00H The number of core clock cycles when the clock signal on a specific core is not halted. This is an architectural performance event. .It Li Uops_Ret -.Pq Event C2H +.Pq Event C2H , Umask 00H The number of micro-ops retired. .El .Ss Event Name Aliases From owner-svn-src-head@FreeBSD.ORG Thu Nov 13 11:35:18 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7E95A1065674; Thu, 13 Nov 2008 11:35:18 +0000 (UTC) (envelope-from dfr@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6F55D8FC1D; Thu, 13 Nov 2008 11:35:18 +0000 (UTC) (envelope-from dfr@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mADBZIQ9058023; Thu, 13 Nov 2008 11:35:18 GMT (envelope-from dfr@svn.freebsd.org) Received: (from dfr@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mADBZIbU058019; Thu, 13 Nov 2008 11:35:18 GMT (envelope-from dfr@svn.freebsd.org) Message-Id: <200811131135.mADBZIbU058019@svn.freebsd.org> From: Doug Rabson Date: Thu, 13 Nov 2008 11:35: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: r184920 - in head/sys: conf nfsclient nfsserver X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Nov 2008 11:35:18 -0000 Author: dfr Date: Thu Nov 13 11:35:18 2008 New Revision: 184920 URL: http://svn.freebsd.org/changeset/base/184920 Log: Temporarily switch NFS back to the old RPC code while I try to diagnose and fix the problems a few people have noticed with the new code. People who want to continue testing the new code or who need RPCSEC_GSS support should use the new option NFS_NEWRPC to select it. Modified: head/sys/conf/files head/sys/conf/options head/sys/nfsclient/nfs.h head/sys/nfsserver/nfs.h Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Thu Nov 13 11:07:17 2008 (r184919) +++ head/sys/conf/files Thu Nov 13 11:35:18 2008 (r184920) @@ -2296,7 +2296,7 @@ nfsclient/krpc_subr.c optional bootp nf nfsclient/nfs_bio.c optional nfsclient nfsclient/nfs_diskless.c optional nfsclient nfs_root nfsclient/nfs_node.c optional nfsclient -nfsclient/nfs_socket.c optional nfsclient nfs_legacyrpc +nfsclient/nfs_socket.c optional nfsclient nfsclient/nfs_krpc.c optional nfsclient nfsclient/nfs_subs.c optional nfsclient nfsclient/nfs_nfsiod.c optional nfsclient @@ -2306,10 +2306,10 @@ nfsclient/nfs_lock.c optional nfsclient nfsserver/nfs_fha.c optional nfsserver nfsserver/nfs_serv.c optional nfsserver nfsserver/nfs_srvkrpc.c optional nfsserver -nfsserver/nfs_srvsock.c optional nfsserver nfs_legacyrpc -nfsserver/nfs_srvcache.c optional nfsserver nfs_legacyrpc +nfsserver/nfs_srvsock.c optional nfsserver +nfsserver/nfs_srvcache.c optional nfsserver nfsserver/nfs_srvsubs.c optional nfsserver -nfsserver/nfs_syscalls.c optional nfsserver nfs_legacyrpc +nfsserver/nfs_syscalls.c optional nfsserver nlm/nlm_advlock.c optional nfslockd nfsclient nlm/nlm_prot_clnt.c optional nfslockd nlm/nlm_prot_impl.c optional nfslockd Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Thu Nov 13 11:07:17 2008 (r184919) +++ head/sys/conf/options Thu Nov 13 11:35:18 2008 (r184920) @@ -230,6 +230,7 @@ NFS4CLIENT opt_nfs.h # legacy RPC implementation instead of the newer KRPC system (which # supports modern features such as RPCSEC_GSS NFS_LEGACYRPC opt_nfs.h +NFS_NEWRPC opt_nfs.h # filesystems and libiconv bridge CD9660_ICONV opt_dontuse.h Modified: head/sys/nfsclient/nfs.h ============================================================================== --- head/sys/nfsclient/nfs.h Thu Nov 13 11:07:17 2008 (r184919) +++ head/sys/nfsclient/nfs.h Thu Nov 13 11:35:18 2008 (r184920) @@ -40,6 +40,10 @@ #include "opt_nfs.h" #endif +#if !defined(NFS_NEWRPC) && !defined(NFS_LEGACYRPC) +#define NFS_LEGACYRPC +#endif + #include /* Modified: head/sys/nfsserver/nfs.h ============================================================================== --- head/sys/nfsserver/nfs.h Thu Nov 13 11:07:17 2008 (r184919) +++ head/sys/nfsserver/nfs.h Thu Nov 13 11:35:18 2008 (r184920) @@ -40,6 +40,10 @@ #include "opt_nfs.h" #endif +#if !defined(NFS_NEWRPC) && !defined(NFS_LEGACYRPC) +#define NFS_LEGACYRPC +#endif + /* * Tunable constants for nfs */ From owner-svn-src-head@FreeBSD.ORG Thu Nov 13 14:36:52 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 950A2106567E; Thu, 13 Nov 2008 14:36:52 +0000 (UTC) (envelope-from dfr@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 85FEE8FC0C; Thu, 13 Nov 2008 14:36:52 +0000 (UTC) (envelope-from dfr@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mADEaqa5061129; Thu, 13 Nov 2008 14:36:52 GMT (envelope-from dfr@svn.freebsd.org) Received: (from dfr@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mADEaqTR061127; Thu, 13 Nov 2008 14:36:52 GMT (envelope-from dfr@svn.freebsd.org) Message-Id: <200811131436.mADEaqTR061127@svn.freebsd.org> From: Doug Rabson Date: Thu, 13 Nov 2008 14:36: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: r184921 - in head/sys: nfsserver xdr X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Nov 2008 14:36:52 -0000 Author: dfr Date: Thu Nov 13 14:36:52 2008 New Revision: 184921 URL: http://svn.freebsd.org/changeset/base/184921 Log: Use the remote address for access control, not the local address. This fixes the nfsd problems that some people have with the new code. Add support for the vfs.nfsrv.nfs_privport sysctl which denies access unless the client is using a port number less than 1024. Not really sure if this is particularly useful since it doesn't add any real security. Modified: head/sys/nfsserver/nfs_srvkrpc.c head/sys/xdr/xdr_mbuf.c Modified: head/sys/nfsserver/nfs_srvkrpc.c ============================================================================== --- head/sys/nfsserver/nfs_srvkrpc.c Thu Nov 13 11:35:18 2008 (r184920) +++ head/sys/nfsserver/nfs_srvkrpc.c Thu Nov 13 14:36:52 2008 (r184921) @@ -348,19 +348,61 @@ nfssvc_program(struct svc_req *rqst, SVC nfs_realign(&mreq); /* - * Note: we want rq_addr, not svc_getrpccaller - + * Note: we want rq_addr, not svc_getrpccaller for nd_nam2 - * NFS_SRVMAXDATA uses a NULL value for nd_nam2 to detect TCP * mounts. */ memset(&nd, 0, sizeof(nd)); nd.nd_md = nd.nd_mrep = mreq; nd.nd_dpos = mtod(mreq, caddr_t); - nd.nd_nam = (struct sockaddr *) &xprt->xp_ltaddr; + nd.nd_nam = svc_getrpccaller(rqst); nd.nd_nam2 = rqst->rq_addr; nd.nd_procnum = procnum; nd.nd_cr = NULL; nd.nd_flag = flag; + if (nfs_privport) { + /* Check if source port is privileged */ + u_short port; + struct sockaddr *nam = nd.nd_nam; + struct sockaddr_in *sin; + + sin = (struct sockaddr_in *)nam; + /* + * INET/INET6 - same code: + * sin_port and sin6_port are at same offset + */ + port = ntohs(sin->sin_port); + if (port >= IPPORT_RESERVED && + nd.nd_procnum != NFSPROC_NULL) { +#ifdef INET6 + char b6[INET6_ADDRSTRLEN]; +#if defined(KLD_MODULE) + /* Do not use ip6_sprintf: the nfs module should work without INET6. */ +#define ip6_sprintf(buf, a) \ + (sprintf((buf), "%x:%x:%x:%x:%x:%x:%x:%x", \ + (a)->s6_addr16[0], (a)->s6_addr16[1], \ + (a)->s6_addr16[2], (a)->s6_addr16[3], \ + (a)->s6_addr16[4], (a)->s6_addr16[5], \ + (a)->s6_addr16[6], (a)->s6_addr16[7]), \ + (buf)) +#endif +#endif + printf("NFS request from unprivileged port (%s:%d)\n", +#ifdef INET6 + sin->sin_family == AF_INET6 ? + ip6_sprintf(b6, &satosin6(sin)->sin6_addr) : +#if defined(KLD_MODULE) +#undef ip6_sprintf +#endif +#endif + inet_ntoa(sin->sin_addr), port); + svcerr_weakauth(rqst); + svc_freereq(rqst); + return; + } + } + if (proc != nfsrv_null) { if (!svc_getcred(rqst, &nd.nd_cr, &nd.nd_credflavor)) { svcerr_weakauth(rqst); Modified: head/sys/xdr/xdr_mbuf.c ============================================================================== --- head/sys/xdr/xdr_mbuf.c Thu Nov 13 11:35:18 2008 (r184920) +++ head/sys/xdr/xdr_mbuf.c Thu Nov 13 14:36:52 2008 (r184921) @@ -65,6 +65,7 @@ void xdrmbuf_create(XDR *xdrs, struct mbuf *m, enum xdr_op op) { + KASSERT(m != NULL, ("xdrmbuf_create with NULL mbuf chain")); xdrs->x_op = op; xdrs->x_ops = &xdrmbuf_ops; xdrs->x_base = (char *) m; From owner-svn-src-head@FreeBSD.ORG Thu Nov 13 15:06:35 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 63049106564A; Thu, 13 Nov 2008 15:06:35 +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 557988FC1B; Thu, 13 Nov 2008 15:06:35 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mADF6ZmT061921; Thu, 13 Nov 2008 15:06:35 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mADF6Z3j061920; Thu, 13 Nov 2008 15:06:35 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <200811131506.mADF6Z3j061920@svn.freebsd.org> From: Ed Maste Date: Thu, 13 Nov 2008 15:06: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: r184925 - head/bin/ps X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Nov 2008 15:06:35 -0000 Author: emaste Date: Thu Nov 13 15:06:34 2008 New Revision: 184925 URL: http://svn.freebsd.org/changeset/base/184925 Log: Fix whitespace. Modified: head/bin/ps/print.c Modified: head/bin/ps/print.c ============================================================================== --- head/bin/ps/print.c Thu Nov 13 15:00:40 2008 (r184924) +++ head/bin/ps/print.c Thu Nov 13 15:06:34 2008 (r184925) @@ -196,9 +196,8 @@ tdnam(KINFO *k, VARENT *ve) v = ve->var; if (showthreads && k->ki_p->ki_numthreads > 1) (void)printf("%-*s", v->width, k->ki_p->ki_ocomm); - else - (void)printf("%-*s", v->width, " " ); - + else + (void)printf("%-*s", v->width, " "); } void From owner-svn-src-head@FreeBSD.ORG Thu Nov 13 16:32:21 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1E75B106567B; Thu, 13 Nov 2008 16:32:21 +0000 (UTC) (envelope-from jkoshy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 13FA78FC08; Thu, 13 Nov 2008 16:32:21 +0000 (UTC) (envelope-from jkoshy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mADGWL3s063833; Thu, 13 Nov 2008 16:32:21 GMT (envelope-from jkoshy@svn.freebsd.org) Received: (from jkoshy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mADGWKOB063830; Thu, 13 Nov 2008 16:32:20 GMT (envelope-from jkoshy@svn.freebsd.org) Message-Id: <200811131632.mADGWKOB063830@svn.freebsd.org> From: Joseph Koshy Date: Thu, 13 Nov 2008 16:32:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184932 - head/lib/libpmc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Nov 2008 16:32:21 -0000 Author: jkoshy Date: Thu Nov 13 16:32:20 2008 New Revision: 184932 URL: http://svn.freebsd.org/changeset/base/184932 Log: Tweak -mdoc usage. Modified: head/lib/libpmc/pmc.atom.3 head/lib/libpmc/pmc.core.3 head/lib/libpmc/pmc.core2.3 Modified: head/lib/libpmc/pmc.atom.3 ============================================================================== --- head/lib/libpmc/pmc.atom.3 Thu Nov 13 16:17:50 2008 (r184931) +++ head/lib/libpmc/pmc.atom.3 Thu Nov 13 16:32:20 2008 (r184932) @@ -930,7 +930,7 @@ The number of cycles micro-ops were disp The number of cycles micro-ops were dispatched for execution on port 4. .It Li RS_UOPS_DISPATCHED.PORT5 -.Pq Event A1H , Umask 20 +.Pq Event A1H , Umask 20H The number of cycles micro-ops were dispatched for execution on port 5. .It Li SB_DRAIN_CYCLES @@ -1116,7 +1116,7 @@ globally observed. The number of cycles while a store was blocked due to a conflict with an internal or external snoop. .It Li STORE_FORWARDS.GOOD -.Pq Event 02, Umask 81H +.Pq Event 02H , Umask 81H The number of times stored data was forwarded directly to a load. .It Li THERMAL_TRIP .Pq Event 3BH , Umask C0H Modified: head/lib/libpmc/pmc.core.3 ============================================================================== --- head/lib/libpmc/pmc.core.3 Thu Nov 13 16:17:50 2008 (r184931) +++ head/lib/libpmc/pmc.core.3 Thu Nov 13 16:32:20 2008 (r184932) @@ -234,12 +234,12 @@ The number of branch instructions execut .Pq Event E0H , Umask 00H The number of branch instructions decoded. .It Li Br_Instr_Ret -.Pq Event C4H, Umask 00H +.Pq Event C4H , Umask 00H .Pq Alias Qq "Branch Instruction Retired" The number of branch instructions retired. This is an architectural performance event. .It Li Br_MisPred_Ret -.Pq Event C5H, Umask 00H +.Pq Event C5H , Umask 00H .Pq Alias Qq "Branch Misses Retired" The number of mispredicted branch instructions retired. This is an architectural performance event. @@ -553,7 +553,7 @@ The number of L2 cache writes including .Pq Event 03H , Umask 00H The number of load operations delayed due to store buffer blocks. .It Li LLC_Misses -.Pq Event 2EH, Umask 41H +.Pq Event 2EH , Umask 41H The number of cache misses for references to the last level cache, excluding misses due to hardware prefetches. This is an architectural performance event. @@ -561,7 +561,7 @@ This is an architectural performance eve The number of references to the last level cache, excluding those due to hardware prefetches. This is an architectural performance event. -.Pq Event 2EH, Umask 4FH +.Pq Event 2EH , Umask 4FH This is an architectural performance event. .It Li MMX_Assist .Pq Event CDH , Umask 00H Modified: head/lib/libpmc/pmc.core2.3 ============================================================================== --- head/lib/libpmc/pmc.core2.3 Thu Nov 13 16:17:50 2008 (r184931) +++ head/lib/libpmc/pmc.core2.3 Thu Nov 13 16:32:20 2008 (r184932) @@ -275,7 +275,7 @@ The number of branches executed, but not The number of branch instructions retired. This is an architectural performance event. .It Li BR_INST_RETIRED.MISPRED -.Pq Event C5H, Umask 00H +.Pq Event C5H , Umask 00H .Pq Alias Qq "Branch Misses Retired" The number of mispredicted branch instructions retired. This is an architectural performance event. From owner-svn-src-head@FreeBSD.ORG Thu Nov 13 17:13:16 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7780810656B1; Thu, 13 Nov 2008 17:13:16 +0000 (UTC) (envelope-from ambrisko@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6E48E8FC1D; Thu, 13 Nov 2008 17:13:16 +0000 (UTC) (envelope-from ambrisko@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mADHDGUF064544; Thu, 13 Nov 2008 17:13:16 GMT (envelope-from ambrisko@svn.freebsd.org) Received: (from ambrisko@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mADHDGIG064543; Thu, 13 Nov 2008 17:13:16 GMT (envelope-from ambrisko@svn.freebsd.org) Message-Id: <200811131713.mADHDGIG064543@svn.freebsd.org> From: Doug Ambrisko Date: Thu, 13 Nov 2008 17:13: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: r184933 - head/sys/dev/mfi X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Nov 2008 17:13:16 -0000 Author: ambrisko Date: Thu Nov 13 17:13:16 2008 New Revision: 184933 URL: http://svn.freebsd.org/changeset/base/184933 Log: One more piece to add to make sense data work for a user app. from LSI. Submitted by: LSI MFC after: 3 days Modified: head/sys/dev/mfi/mfi.c Modified: head/sys/dev/mfi/mfi.c ============================================================================== --- head/sys/dev/mfi/mfi.c Thu Nov 13 16:32:20 2008 (r184932) +++ head/sys/dev/mfi/mfi.c Thu Nov 13 17:13:16 2008 (r184933) @@ -2069,6 +2069,11 @@ mfi_ioctl(struct cdev *dev, u_long cmd, if (cm->cm_frame->header.cmd == MFI_CMD_DCMD) locked = mfi_config_lock(sc, cm->cm_frame->dcmd.opcode); + if (cm->cm_frame->header.cmd == MFI_CMD_PD_SCSI_IO) { + cm->cm_frame->pass.sense_addr_lo = cm->cm_sense_busaddr; + cm->cm_frame->pass.sense_addr_hi = 0; + } + mtx_lock(&sc->mfi_io_lock); error = mfi_check_command_pre(sc, cm); if (error) { @@ -2305,6 +2310,11 @@ mfi_linux_ioctl_int(struct cdev *dev, u_ if (cm->cm_frame->header.cmd == MFI_CMD_DCMD) locked = mfi_config_lock(sc, cm->cm_frame->dcmd.opcode); + if (cm->cm_frame->header.cmd == MFI_CMD_PD_SCSI_IO) { + cm->cm_frame->pass.sense_addr_lo = cm->cm_sense_busaddr; + cm->cm_frame->pass.sense_addr_hi = 0; + } + mtx_lock(&sc->mfi_io_lock); error = mfi_check_command_pre(sc, cm); if (error) { From owner-svn-src-head@FreeBSD.ORG Thu Nov 13 17:40:22 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 13E9E1065676; Thu, 13 Nov 2008 17:40:22 +0000 (UTC) (envelope-from ambrisko@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0C0BF8FC0A; Thu, 13 Nov 2008 17:40:22 +0000 (UTC) (envelope-from ambrisko@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mADHeMcK065040; Thu, 13 Nov 2008 17:40:22 GMT (envelope-from ambrisko@svn.freebsd.org) Received: (from ambrisko@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mADHeMDr065039; Thu, 13 Nov 2008 17:40:22 GMT (envelope-from ambrisko@svn.freebsd.org) Message-Id: <200811131740.mADHeMDr065039@svn.freebsd.org> From: Doug Ambrisko Date: Thu, 13 Nov 2008 17:40: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: r184934 - head/sys/ufs/ffs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Nov 2008 17:40:22 -0000 Author: ambrisko Date: Thu Nov 13 17:40:21 2008 New Revision: 184934 URL: http://svn.freebsd.org/changeset/base/184934 Log: For now on every 10 cyclinder groups flush the buffer cache to free up space. If the buffer cache fills up then the disk systems can grind to a halt. Better tuning can be figured out later. Tested by: Tim, others and work Reviewed by: Kostik Belousov PR: 128832 Modified: head/sys/ufs/ffs/ffs_snapshot.c Modified: head/sys/ufs/ffs/ffs_snapshot.c ============================================================================== --- head/sys/ufs/ffs/ffs_snapshot.c Thu Nov 13 17:13:16 2008 (r184933) +++ head/sys/ufs/ffs/ffs_snapshot.c Thu Nov 13 17:40:21 2008 (r184934) @@ -351,6 +351,8 @@ restart: if (error) goto out; bawrite(nbp); + if (cg % 10 == 0) + ffs_syncvnode(vp, MNT_WAIT); } /* * Copy all the cylinder group maps. Although the @@ -372,6 +374,8 @@ restart: goto out; error = cgaccount(cg, vp, nbp, 1); bawrite(nbp); + if (cg % 10 == 0) + ffs_syncvnode(vp, MNT_WAIT); if (error) goto out; } From owner-svn-src-head@FreeBSD.ORG Thu Nov 13 17:47:45 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E6BA01065678; Thu, 13 Nov 2008 17:47:45 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.terabit.net.ua (mail.terabit.net.ua [195.137.202.147]) by mx1.freebsd.org (Postfix) with ESMTP id 8FE858FC0A; Thu, 13 Nov 2008 17:47:45 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from skuns.zoral.com.ua ([91.193.166.194] helo=mail.zoral.com.ua) by mail.terabit.net.ua with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63 (FreeBSD)) (envelope-from ) id 1L0gIB-000Jsa-Td; Thu, 13 Nov 2008 19:47:44 +0200 Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id mADHlepU017887 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 13 Nov 2008 19:47:41 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.3/8.14.3) with ESMTP id mADHlemq050534; Thu, 13 Nov 2008 19:47:40 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.3/8.14.3/Submit) id mADHleah050533; Thu, 13 Nov 2008 19:47:40 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 13 Nov 2008 19:47:40 +0200 From: Kostik Belousov To: Doug Ambrisko Message-ID: <20081113174740.GV47073@deviant.kiev.zoral.com.ua> References: <200811131740.mADHeMDr065039@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="gn1ylXQ+YRNuZICZ" Content-Disposition: inline In-Reply-To: <200811131740.mADHeMDr065039@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: ClamAV version 0.93.3, clamav-milter version 0.93.3 on skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua X-Virus-Scanned: mail.terabit.net.ua 1L0gIB-000Jsa-Td d702931950b8422a59510640c5f8fea5 X-Terabit: YES Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r184934 - head/sys/ufs/ffs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Nov 2008 17:47:46 -0000 --gn1ylXQ+YRNuZICZ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Nov 13, 2008 at 05:40:21PM +0000, Doug Ambrisko wrote: > Author: ambrisko > Date: Thu Nov 13 17:40:21 2008 > New Revision: 184934 > URL: http://svn.freebsd.org/changeset/base/184934 >=20 > Log: > For now on every 10 cyclinder groups flush the buffer cache to free > up space. If the buffer cache fills up then the disk systems can > grind to a halt. Better tuning can be figured out later. > =20 > Tested by: Tim, others and work > Reviewed by: Kostik Belousov > PR: 128832 >=20 > Modified: > head/sys/ufs/ffs/ffs_snapshot.c >=20 > Modified: head/sys/ufs/ffs/ffs_snapshot.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/ufs/ffs/ffs_snapshot.c Thu Nov 13 17:13:16 2008 (r184933) > +++ head/sys/ufs/ffs/ffs_snapshot.c Thu Nov 13 17:40:21 2008 (r184934) > @@ -351,6 +351,8 @@ restart: > if (error) > goto out; > bawrite(nbp); > + if (cg % 10 =3D=3D 0) > + ffs_syncvnode(vp, MNT_WAIT); > } > /* > * Copy all the cylinder group maps. Although the > @@ -372,6 +374,8 @@ restart: > goto out; > error =3D cgaccount(cg, vp, nbp, 1); > bawrite(nbp); > + if (cg % 10 =3D=3D 0) > + ffs_syncvnode(vp, MNT_WAIT); > if (error) > goto out; > } Thank you ! Please, MFC it for 7.1. --gn1ylXQ+YRNuZICZ Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iEUEARECAAYFAkkcaDwACgkQC3+MBN1Mb4jRogCdHwD5VwFVd3hUd/sBp7izsbLU A6wAmLBdCZZgZQMDyXajf0CewBKxbqM= =2KHl -----END PGP SIGNATURE----- --gn1ylXQ+YRNuZICZ-- From owner-svn-src-head@FreeBSD.ORG Thu Nov 13 18:39:41 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EB4E0106564A; Thu, 13 Nov 2008 18:39:41 +0000 (UTC) (envelope-from ambrisko@ambrisko.com) Received: from mail.ambrisko.com (mail.ambrisko.com [64.174.51.43]) by mx1.freebsd.org (Postfix) with ESMTP id BEE7B8FC14; Thu, 13 Nov 2008 18:39:41 +0000 (UTC) (envelope-from ambrisko@ambrisko.com) X-Ambrisko-Me: Yes Received: from server2.ambrisko.com (HELO www.ambrisko.com) ([192.168.1.2]) by ironport.ambrisko.com with ESMTP; 13 Nov 2008 10:11:30 -0800 Received: from ambrisko.com (localhost [127.0.0.1]) by www.ambrisko.com (8.14.1/8.14.1) with ESMTP id mADIBJlD099326; Thu, 13 Nov 2008 10:11:19 -0800 (PST) (envelope-from ambrisko@ambrisko.com) Received: (from ambrisko@localhost) by ambrisko.com (8.14.1/8.14.1/Submit) id mADIBJOj099325; Thu, 13 Nov 2008 10:11:19 -0800 (PST) (envelope-from ambrisko) From: Doug Ambrisko Message-Id: <200811131811.mADIBJOj099325@ambrisko.com> In-Reply-To: <20081113174740.GV47073@deviant.kiev.zoral.com.ua> To: Kostik Belousov Date: Thu, 13 Nov 2008 10:11:19 -0800 (PST) X-Mailer: ELM [version 2.4ME+ PL94b (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII Cc: svn-src-head@FreeBSD.org, Doug Ambrisko , svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r184934 - head/sys/ufs/ffs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Nov 2008 18:39:42 -0000 Kostik Belousov writes: | On Thu, Nov 13, 2008 at 05:40:21PM +0000, Doug Ambrisko wrote: | > Author: ambrisko | > Date: Thu Nov 13 17:40:21 2008 | > New Revision: 184934 | > URL: http://svn.freebsd.org/changeset/base/184934 | > | > Log: | > For now on every 10 cyclinder groups flush the buffer cache to free | > up space. If the buffer cache fills up then the disk systems can | > grind to a halt. Better tuning can be figured out later. | > | > Tested by: Tim, others and work | > Reviewed by: Kostik Belousov | > PR: 128832 | > | > Modified: | > head/sys/ufs/ffs/ffs_snapshot.c | > | > Modified: head/sys/ufs/ffs/ffs_snapshot.c | > ============================================================================== | > --- head/sys/ufs/ffs/ffs_snapshot.c Thu Nov 13 17:13:16 2008 (r184933) | > +++ head/sys/ufs/ffs/ffs_snapshot.c Thu Nov 13 17:40:21 2008 (r184934) | > @@ -351,6 +351,8 @@ restart: | > if (error) | > goto out; | > bawrite(nbp); | > + if (cg % 10 == 0) | > + ffs_syncvnode(vp, MNT_WAIT); | > } | > /* | > * Copy all the cylinder group maps. Although the | > @@ -372,6 +374,8 @@ restart: | > goto out; | > error = cgaccount(cg, vp, nbp, 1); | > bawrite(nbp); | > + if (cg % 10 == 0) | > + ffs_syncvnode(vp, MNT_WAIT); | > if (error) | > goto out; | > } | Thank you ! | | Please, MFC it for 7.1. I'll wait for some of the dust to settle first. Also I want to test a 7.1 machine here without any of my patches, then start adding some back it. I should be able to get that mostly done today unless I get hit with other work stuff. From my perspective I have a couple of low risk patches that should go in but look more radical. Doug A. From owner-svn-src-head@FreeBSD.ORG Thu Nov 13 19:05:28 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9EC33106567D; Thu, 13 Nov 2008 19:05:28 +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 2AE458FC18; Thu, 13 Nov 2008 19:05:28 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mADJ5SIw066544; Thu, 13 Nov 2008 19:05:28 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mADJ5SJJ066541; Thu, 13 Nov 2008 19:05:28 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200811131905.mADJ5SJJ066541@svn.freebsd.org> From: Ed Schouten Date: Thu, 13 Nov 2008 19:05: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: r184935 - in head: contrib/telnet/telnetd libexec/telnetd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Nov 2008 19:05:28 -0000 Author: ed Date: Thu Nov 13 19:05:27 2008 New Revision: 184935 URL: http://svn.freebsd.org/changeset/base/184935 Log: Convert telnetd(8) to use posix_openpt(2). Some time ago I got some reports MPSAFE TTY broke telnetd(8). Even though it turned out to be a different problem within the TTY code, I spotted a small issue with telnetd(8). Instead of allocating PTY's using openpty(3) or posix_openpt(2), it used its own PTY allocation routine. This means that telnetd(8) still uses /dev/ptyXX-style devices. I've also increased the size of line[]. Even though 16 should be enough, we already use 13 bytes ("/dev/pts/999", including '\0'). 32 bytes gives us a little more freedom. Also enable -DSTREAMSPTY. Otherwise telnetd(8) strips the PTY's pathname to the latest slash instead of just removing "/dev/" (e.g. /dev/pts/0 -> 0, instead of pts/0). Reviewed by: rink Modified: head/contrib/telnet/telnetd/ext.h head/contrib/telnet/telnetd/sys_term.c head/libexec/telnetd/Makefile Modified: head/contrib/telnet/telnetd/ext.h ============================================================================== --- head/contrib/telnet/telnetd/ext.h Thu Nov 13 17:40:21 2008 (r184934) +++ head/contrib/telnet/telnetd/ext.h Thu Nov 13 19:05:27 2008 (r184935) @@ -77,7 +77,7 @@ extern char *neturg; /* one past last b extern int pcc, ncc; extern int pty, net; -extern char line[16]; +extern char line[32]; extern int SYNCHing; /* we are in TELNET SYNCH mode */ extern void Modified: head/contrib/telnet/telnetd/sys_term.c ============================================================================== --- head/contrib/telnet/telnetd/sys_term.c Thu Nov 13 17:40:21 2008 (r184934) +++ head/contrib/telnet/telnetd/sys_term.c Thu Nov 13 19:05:27 2008 (r184935) @@ -392,46 +392,31 @@ spcset(int func, cc_t *valp, cc_t **valp * * Returns the file descriptor of the opened pty. */ -char alpha[] = "0123456789abcdefghijklmnopqrstuv"; -char line[16]; +char line[32]; int getpty(int *ptynum __unused) { int p; - const char *cp; - char *p1, *p2; - int i; - - (void) strcpy(line, _PATH_DEV); - (void) strcat(line, "ptyXX"); - p1 = &line[8]; - p2 = &line[9]; + const char *pn; - for (cp = "pqrsPQRS"; *cp; cp++) { - struct stat stb; + p = posix_openpt(O_RDWR|O_NOCTTY); + if (p < 0) + return (-1); + + if (grantpt(p) == -1) + return (-1); + + if (unlockpt(p) == -1) + return (-1); + + pn = ptsname(p); + if (pn == NULL) + return (-1); + + strcpy(line, pn); - *p1 = *cp; - *p2 = '0'; - /* - * This stat() check is just to keep us from - * looping through all 256 combinations if there - * aren't that many ptys available. - */ - if (stat(line, &stb) < 0) - break; - for (i = 0; i < 32; i++) { - *p2 = alpha[i]; - p = open(line, 2); - if (p > 0) { - line[5] = 't'; - chown(line, 0, 0); - chmod(line, 0600); - return(p); - } - } - } - return(-1); + return (p); } #ifdef LINEMODE Modified: head/libexec/telnetd/Makefile ============================================================================== --- head/libexec/telnetd/Makefile Thu Nov 13 17:40:21 2008 (r184934) +++ head/libexec/telnetd/Makefile Thu Nov 13 19:05:27 2008 (r184935) @@ -17,7 +17,8 @@ SRCS= global.c slc.c state.c sys_term.c WARNS?= 2 WFORMAT?= 0 -CFLAGS+= -DLINEMODE -DUSE_TERMIO -DDIAGNOSTICS -DOLD_ENVIRON -DENV_HACK +CFLAGS+= -DLINEMODE -DUSE_TERMIO -DDIAGNOSTICS -DOLD_ENVIRON \ + -DENV_HACK -DSTREAMSPTY .if ${MK_INET6_SUPPORT} != "no" CFLAGS+= -DINET6 From owner-svn-src-head@FreeBSD.ORG Thu Nov 13 19:49:17 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2316F1065674; Thu, 13 Nov 2008 19:49: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 170358FC0A; Thu, 13 Nov 2008 19:49:17 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mADJnH9H067328; Thu, 13 Nov 2008 19:49:17 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mADJnH9B067327; Thu, 13 Nov 2008 19:49:17 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200811131949.mADJnH9B067327@svn.freebsd.org> From: Alexander Motin Date: Thu, 13 Nov 2008 19:49: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: r184936 - head/usr.sbin/pciconf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Nov 2008 19:49:17 -0000 Author: mav Date: Thu Nov 13 19:49:16 2008 New Revision: 184936 URL: http://svn.freebsd.org/changeset/base/184936 Log: Add ADMA, SATA and SAS mass storage subclasses. Modified: head/usr.sbin/pciconf/pciconf.c Modified: head/usr.sbin/pciconf/pciconf.c ============================================================================== --- head/usr.sbin/pciconf/pciconf.c Thu Nov 13 19:05:27 2008 (r184935) +++ head/usr.sbin/pciconf/pciconf.c Thu Nov 13 19:49:16 2008 (r184936) @@ -272,6 +272,9 @@ static struct {PCIC_STORAGE, PCIS_STORAGE_FLOPPY, "floppy disk"}, {PCIC_STORAGE, PCIS_STORAGE_IPI, "IPI"}, {PCIC_STORAGE, PCIS_STORAGE_RAID, "RAID"}, + {PCIC_STORAGE, PCIS_STORAGE_ATA_ADMA, "ATA (ADMA)"}, + {PCIC_STORAGE, PCIS_STORAGE_SATA, "SATA"}, + {PCIC_STORAGE, PCIS_STORAGE_SAS, "SAS"}, {PCIC_NETWORK, -1, "network"}, {PCIC_NETWORK, PCIS_NETWORK_ETHERNET, "ethernet"}, {PCIC_NETWORK, PCIS_NETWORK_TOKENRING, "token ring"}, From owner-svn-src-head@FreeBSD.ORG Thu Nov 13 19:57:33 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A05CE1065678; Thu, 13 Nov 2008 19:57: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 9375B8FC21; Thu, 13 Nov 2008 19:57:33 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mADJvXPg067510; Thu, 13 Nov 2008 19:57:33 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mADJvXDT067509; Thu, 13 Nov 2008 19:57:33 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200811131957.mADJvXDT067509@svn.freebsd.org> From: Alexander Motin Date: Thu, 13 Nov 2008 19:57:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184937 - head/sys/dev/pci X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Nov 2008 19:57:33 -0000 Author: mav Date: Thu Nov 13 19:57:33 2008 New Revision: 184937 URL: http://svn.freebsd.org/changeset/base/184937 Log: Add ADMA, SATA and SAS mass storage subclasses reporting. Modified: head/sys/dev/pci/pci.c Modified: head/sys/dev/pci/pci.c ============================================================================== --- head/sys/dev/pci/pci.c Thu Nov 13 19:49:16 2008 (r184936) +++ head/sys/dev/pci/pci.c Thu Nov 13 19:57:33 2008 (r184937) @@ -2949,6 +2949,9 @@ static struct {PCIC_STORAGE, PCIS_STORAGE_FLOPPY, "floppy disk"}, {PCIC_STORAGE, PCIS_STORAGE_IPI, "IPI"}, {PCIC_STORAGE, PCIS_STORAGE_RAID, "RAID"}, + {PCIC_STORAGE, PCIS_STORAGE_ATA_ADMA, "ATA (ADMA)"}, + {PCIC_STORAGE, PCIS_STORAGE_SATA, "SATA"}, + {PCIC_STORAGE, PCIS_STORAGE_SAS, "SAS"}, {PCIC_NETWORK, -1, "network"}, {PCIC_NETWORK, PCIS_NETWORK_ETHERNET, "ethernet"}, {PCIC_NETWORK, PCIS_NETWORK_TOKENRING, "token ring"}, From owner-svn-src-head@FreeBSD.ORG Thu Nov 13 20:11:48 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0A47D106568C for ; Thu, 13 Nov 2008 20:11:48 +0000 (UTC) (envelope-from max@love2party.net) Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.171]) by mx1.freebsd.org (Postfix) with ESMTP id 8E2938FC0A for ; Thu, 13 Nov 2008 20:11:47 +0000 (UTC) (envelope-from max@love2party.net) Received: from vampire.homelinux.org (dslb-088-066-052-032.pools.arcor-ip.net [88.66.52.32]) by mrelayeu.kundenserver.de (node=mrelayeu7) with ESMTP (Nemesis) id 0ML2xA-1L0iXa0taB-0003rR; Thu, 13 Nov 2008 21:11:46 +0100 Received: (qmail 6073 invoked from network); 13 Nov 2008 20:11:45 -0000 Received: from fbsd8.laiers.local (192.168.4.151) by laiers.local with SMTP; 13 Nov 2008 20:11:45 -0000 From: Max Laier Organization: FreeBSD To: Ed Schouten Date: Thu, 13 Nov 2008 21:11:44 +0100 User-Agent: KMail/1.10.1 (FreeBSD/8.0-CURRENT; KDE/4.1.1; i386; ; ) References: <200811131905.mADJ5SJJ066541@svn.freebsd.org> In-Reply-To: <200811131905.mADJ5SJJ066541@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200811132111.45492.max@love2party.net> X-Provags-ID: V01U2FsdGVkX18zsTNUnUduyPx018Wmp5GodWqNbQl2tZdvqaz PZVSholkX5ErE8B55rsq70GSXsd41Nh6t4Xc/TQiKdDREVx0hh 5nAt/YwKuERqLGEmV+N2w== Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r184935 - in head: contrib/telnet/telnetd libexec/telnetd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Nov 2008 20:11:48 -0000 On Thursday 13 November 2008 20:05:28 Ed Schouten wrote: > I've also increased the size of line[]. Even though 16 should be enough, > we already use 13 bytes ("/dev/pts/999", including '\0'). 32 bytes gives > us a little more freedom. > + strcpy(line, pn); Why not use str{l,n}cpy then ... even if it's big enough now. -- /"\ 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-head@FreeBSD.ORG Thu Nov 13 20:40:38 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5DBE31065670; Thu, 13 Nov 2008 20:40:38 +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 4C37E8FC17; Thu, 13 Nov 2008 20:40:38 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mADKecKb068336; Thu, 13 Nov 2008 20:40:38 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mADKecHe068335; Thu, 13 Nov 2008 20:40:38 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200811132040.mADKecHe068335@svn.freebsd.org> From: Ed Schouten Date: Thu, 13 Nov 2008 20:40: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: r184938 - head/contrib/telnet/telnetd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Nov 2008 20:40:38 -0000 Author: ed Date: Thu Nov 13 20:40:38 2008 New Revision: 184938 URL: http://svn.freebsd.org/changeset/base/184938 Log: Use strlcpy() instead of strcpy(). Requested by: mlaier Modified: head/contrib/telnet/telnetd/sys_term.c Modified: head/contrib/telnet/telnetd/sys_term.c ============================================================================== --- head/contrib/telnet/telnetd/sys_term.c Thu Nov 13 19:57:33 2008 (r184937) +++ head/contrib/telnet/telnetd/sys_term.c Thu Nov 13 20:40:38 2008 (r184938) @@ -414,7 +414,8 @@ getpty(int *ptynum __unused) if (pn == NULL) return (-1); - strcpy(line, pn); + if (strlcpy(line, pn, sizeof line) >= sizeof line) + return (-1); return (p); } From owner-svn-src-head@FreeBSD.ORG Thu Nov 13 20:41:20 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 230AA1065674; Thu, 13 Nov 2008 20:41:20 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: from palm.hoeg.nl (mx0.hoeg.nl [IPv6:2001:7b8:613:100::211]) by mx1.freebsd.org (Postfix) with ESMTP id B49E38FC0A; Thu, 13 Nov 2008 20:41:19 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: by palm.hoeg.nl (Postfix, from userid 1000) id EB30E1D2A4; Thu, 13 Nov 2008 21:41:18 +0100 (CET) Date: Thu, 13 Nov 2008 21:41:18 +0100 From: Ed Schouten To: Max Laier Message-ID: <20081113204118.GM81783@hoeg.nl> References: <200811131905.mADJ5SJJ066541@svn.freebsd.org> <200811132111.45492.max@love2party.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="DH4/xewco2zMcht6" Content-Disposition: inline In-Reply-To: <200811132111.45492.max@love2party.net> User-Agent: Mutt/1.5.18 (2008-05-17) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r184935 - in head: contrib/telnet/telnetd libexec/telnetd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Nov 2008 20:41:20 -0000 --DH4/xewco2zMcht6 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable * Max Laier wrote: > On Thursday 13 November 2008 20:05:28 Ed Schouten wrote: > > I've also increased the size of line[]. Even though 16 should be enou= gh, > > we already use 13 bytes ("/dev/pts/999", including '\0'). 32 bytes gi= ves > > us a little more freedom. >=20 > > + strcpy(line, pn); >=20 > Why not use str{l,n}cpy then ... even if it's big enough now. Good idea. I've just replaced this strcpy() call with strlcpy(). If strlcpy() fails (returning `sizeof line' or greater), we just bail out. --=20 Ed Schouten WWW: http://80386.nl/ --DH4/xewco2zMcht6 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iEYEARECAAYFAkkckO4ACgkQ52SDGA2eCwWmnQCdE2wtRd7KhD084OOEIMsxnmG3 8V4An2MmnqWOk3P+IxDu5xOKQcq14pge =FUXj -----END PGP SIGNATURE----- --DH4/xewco2zMcht6-- From owner-svn-src-head@FreeBSD.ORG Thu Nov 13 21:34:35 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 64419106567E; Thu, 13 Nov 2008 21:34:35 +0000 (UTC) (envelope-from n_hibma@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4DE8A8FC13; Thu, 13 Nov 2008 21:34:35 +0000 (UTC) (envelope-from n_hibma@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mADLYZWR069526; Thu, 13 Nov 2008 21:34:35 GMT (envelope-from n_hibma@svn.freebsd.org) Received: (from n_hibma@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mADLYZls069521; Thu, 13 Nov 2008 21:34:35 GMT (envelope-from n_hibma@svn.freebsd.org) Message-Id: <200811132134.mADLYZls069521@svn.freebsd.org> From: Nick Hibma Date: Thu, 13 Nov 2008 21:34: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: r184941 - head/sys/dev/usb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Nov 2008 21:34:35 -0000 Author: n_hibma Date: Thu Nov 13 21:34:34 2008 New Revision: 184941 URL: http://svn.freebsd.org/changeset/base/184941 Log: Add a reset device command to ugen.c. This is needed to make some devices work that require a firmware upload and a USB reset afterwards. Modified: head/sys/dev/usb/ugen.c head/sys/dev/usb/usb.h head/sys/dev/usb/usb_subr.c head/sys/dev/usb/usbdi.c head/sys/dev/usb/usbdi.h Modified: head/sys/dev/usb/ugen.c ============================================================================== --- head/sys/dev/usb/ugen.c Thu Nov 13 21:11:34 2008 (r184940) +++ head/sys/dev/usb/ugen.c Thu Nov 13 21:34:34 2008 (r184941) @@ -1059,8 +1059,8 @@ ugen_isoc_rintr(usbd_xfer_handle xfer, u sce->cur += count; if(sce->cur >= sce->limit) sce->cur = sce->ibuf + (sce->limit - sce->cur); - DPRINTFN(5, ("ugen_isoc_rintr: throwing away %d bytes\n", - count)); + DPRINTF(("ugen_isoc_rintr: throwing away %d bytes\n", + count)); } isize = UGETW(sce->edesc->wMaxPacketSize); @@ -1427,7 +1427,6 @@ ugen_do_ioctl(struct ugen_softc *sc, int struct iovec iov; struct uio uio; void *ptr = 0; - usbd_status err; int error = 0; if (!(flag & FWRITE)) @@ -1485,6 +1484,11 @@ ugen_do_ioctl(struct ugen_softc *sc, int usbd_fill_deviceinfo(sc->sc_udev, (struct usb_device_info *)addr, 1); break; + case USB_RESET_DEVICE: + err = usbd_reset_device(sc->sc_udev); + if (err) + return EIO; + break; default: return (EINVAL); } Modified: head/sys/dev/usb/usb.h ============================================================================== --- head/sys/dev/usb/usb.h Thu Nov 13 21:11:34 2008 (r184940) +++ head/sys/dev/usb/usb.h Thu Nov 13 21:34:34 2008 (r184941) @@ -699,6 +699,7 @@ struct usb_event { #define USB_GET_DEVICEINFO _IOR ('U', 112, struct usb_device_info) #define USB_SET_SHORT_XFER _IOW ('U', 113, int) #define USB_SET_TIMEOUT _IOW ('U', 114, int) +#define USB_RESET_DEVICE _IO ('U', 115) /* Modem device */ #define USB_GET_CM_OVER_DATA _IOR ('U', 130, int) Modified: head/sys/dev/usb/usb_subr.c ============================================================================== --- head/sys/dev/usb/usb_subr.c Thu Nov 13 21:11:34 2008 (r184940) +++ head/sys/dev/usb/usb_subr.c Thu Nov 13 21:34:34 2008 (r184941) @@ -322,16 +322,10 @@ usbd_delay_ms(usbd_device_handle dev, u_ usbd_status usbd_reset_port(usbd_device_handle dev, int port, usb_port_status_t *ps) { - usb_device_request_t req; usbd_status err; int n; - req.bmRequestType = UT_WRITE_CLASS_OTHER; - req.bRequest = UR_SET_FEATURE; - USETW(req.wValue, UHF_PORT_RESET); - USETW(req.wIndex, port); - USETW(req.wLength, 0); - err = usbd_do_request(dev, &req, 0); + err = usbd_set_port_feature(dev, port, UHF_PORT_RESET); DPRINTFN(1,("usbd_reset_port: port %d reset done, error=%s\n", port, usbd_errstr(err))); if (err) Modified: head/sys/dev/usb/usbdi.c ============================================================================== --- head/sys/dev/usb/usbdi.c Thu Nov 13 21:11:34 2008 (r184940) +++ head/sys/dev/usb/usbdi.c Thu Nov 13 21:34:34 2008 (r184941) @@ -1235,6 +1235,15 @@ usbd_set_polling(usbd_device_handle dev, dev->bus->methods->soft_intr(dev->bus); } +usbd_status +usbd_reset_device(usbd_device_handle dev) +{ + usbd_device_handle parent = dev->myhub; + struct usbd_port *up = dev->powersrc; + + return usbd_reset_port(parent, up->portno, &up->status); +} + usb_endpoint_descriptor_t * usbd_get_endpoint_descriptor(usbd_interface_handle iface, u_int8_t address) Modified: head/sys/dev/usb/usbdi.h ============================================================================== --- head/sys/dev/usb/usbdi.h Thu Nov 13 21:11:34 2008 (r184940) +++ head/sys/dev/usb/usbdi.h Thu Nov 13 21:34:34 2008 (r184941) @@ -160,6 +160,7 @@ usb_endpoint_descriptor_t *usbd_find_ede void usbd_dopoll(usbd_interface_handle); void usbd_set_polling(usbd_device_handle, int); +usbd_status usbd_reset_device(usbd_device_handle); const char *usbd_errstr(usbd_status); From owner-svn-src-head@FreeBSD.ORG Thu Nov 13 21:46:19 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DC81F1065670; Thu, 13 Nov 2008 21:46:19 +0000 (UTC) (envelope-from n_hibma@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C501B8FC08; Thu, 13 Nov 2008 21:46:19 +0000 (UTC) (envelope-from n_hibma@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mADLkJgH069931; Thu, 13 Nov 2008 21:46:19 GMT (envelope-from n_hibma@svn.freebsd.org) Received: (from n_hibma@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mADLkJUF069928; Thu, 13 Nov 2008 21:46:19 GMT (envelope-from n_hibma@svn.freebsd.org) Message-Id: <200811132146.mADLkJUF069928@svn.freebsd.org> From: Nick Hibma Date: Thu, 13 Nov 2008 21:46: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: r184942 - in head/sys: dev/usb kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Nov 2008 21:46:20 -0000 Author: n_hibma Date: Thu Nov 13 21:46:19 2008 New Revision: 184942 URL: http://svn.freebsd.org/changeset/base/184942 Log: Silence detach messages if the device has marked itself quiet (u3g). MFC after: 3 weeks Modified: head/sys/dev/usb/usb_subr.c head/sys/kern/subr_bus.c Modified: head/sys/dev/usb/usb_subr.c ============================================================================== --- head/sys/dev/usb/usb_subr.c Thu Nov 13 21:34:34 2008 (r184941) +++ head/sys/dev/usb/usb_subr.c Thu Nov 13 21:46:19 2008 (r184942) @@ -679,11 +679,11 @@ usbd_set_config_index(usbd_device_handle DPRINTF(("power exceeded %d %d\n", power,dev->powersrc->power)); /* XXX print nicer message. */ if (msg) - printf("%s: device addr %d (config %d) exceeds power " - "budget, %d mA > %d mA\n", - device_get_nameunit(dev->bus->bdev), dev->address, - cdp->bConfigurationValue, - power, dev->powersrc->power); + device_printf(dev->bus->bdev, + "device addr %d (config %d) exceeds " + "power budget, %d mA > %d mA\n", + dev->address, cdp->bConfigurationValue, + power, dev->powersrc->power); err = USBD_NO_POWER; goto bad; } @@ -1017,8 +1017,7 @@ usbd_new_device(device_t parent, usbd_bu bus, port, depth, speed)); addr = usbd_getnewaddr(bus); if (addr < 0) { - printf("%s: No free USB addresses, new device ignored.\n", - device_get_nameunit(bus->bdev)); + device_printf(bus->bdev, "No free USB addresses\n"); return (USBD_NO_ADDR); } @@ -1364,11 +1363,14 @@ usb_disconnect_port(struct usbd_port *up if (dev->subdevs != NULL) { DPRINTFN(3,("usb_disconnect_port: disconnect subdevs\n")); for (i = 0; dev->subdevs[i]; i++) { - printf("%s: at %s", device_get_nameunit(dev->subdevs[i]), - hubname); - if (up->portno != 0) - printf(" port %d", up->portno); - printf(" (addr %d) disconnected\n", dev->address); + if (!device_is_quiet(dev->subdevs[i])) { + device_printf(dev->subdevs[i], + "at %s", hubname); + if (up->portno != 0) + printf(" port %d", up->portno); + printf(" (addr %d) disconnected\n", dev->address); + } + struct usb_attach_arg *uaap = device_get_ivars(dev->subdevs[i]); device_detach(dev->subdevs[i]); Modified: head/sys/kern/subr_bus.c ============================================================================== --- head/sys/kern/subr_bus.c Thu Nov 13 21:34:34 2008 (r184941) +++ head/sys/kern/subr_bus.c Thu Nov 13 21:46:19 2008 (r184942) @@ -2476,7 +2476,8 @@ device_detach(device_t dev) if ((error = DEVICE_DETACH(dev)) != 0) return (error); devremoved(dev); - device_printf(dev, "detached\n"); + if (!device_is_quiet(dev)) + device_printf(dev, "detached\n"); if (dev->parent) BUS_CHILD_DETACHED(dev->parent, dev); From owner-svn-src-head@FreeBSD.ORG Thu Nov 13 21:49:07 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D9EE9106564A; Thu, 13 Nov 2008 21:49:07 +0000 (UTC) (envelope-from n_hibma@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C2A998FC1B; Thu, 13 Nov 2008 21:49:07 +0000 (UTC) (envelope-from n_hibma@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mADLn7Mw070195; Thu, 13 Nov 2008 21:49:07 GMT (envelope-from n_hibma@svn.freebsd.org) Received: (from n_hibma@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mADLn7ox070194; Thu, 13 Nov 2008 21:49:07 GMT (envelope-from n_hibma@svn.freebsd.org) Message-Id: <200811132149.mADLn7ox070194@svn.freebsd.org> From: Nick Hibma Date: Thu, 13 Nov 2008 21:49: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: r184943 - head/sys/dev/usb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Nov 2008 21:49:08 -0000 Author: n_hibma Date: Thu Nov 13 21:49:07 2008 New Revision: 184943 URL: http://svn.freebsd.org/changeset/base/184943 Log: Hide the attach message. This needs to be done in the probe as well, as the softc is reset a few times during probing. Print 'changing to modem mode' messages if booting verbose to show the reason for the time delay. Note: Some devices (Huawei for one) take 20 seconds to appear on the USB bus). Modified: head/sys/dev/usb/u3g.c Modified: head/sys/dev/usb/u3g.c ============================================================================== --- head/sys/dev/usb/u3g.c Thu Nov 13 21:46:19 2008 (r184942) +++ head/sys/dev/usb/u3g.c Thu Nov 13 21:49:07 2008 (r184943) @@ -566,8 +566,15 @@ u3gstub_match(device_t self) * storage device the device has not yet changed appearance. */ id = usbd_get_interface_descriptor(uaa->iface); - if (id && id->bInterfaceNumber == 0 && id->bInterfaceClass == UICLASS_MASS) + if (id && id->bInterfaceNumber == 0 + && id->bInterfaceClass == UICLASS_MASS) { +#ifndef U3G_DEBUG + if (!bootverbose) + device_quiet(self); +#endif + return UMATCH_VENDOR_PRODUCT; + } } return UMATCH_NONE; @@ -580,8 +587,9 @@ u3gstub_attach(device_t self) struct usb_attach_arg *uaa = device_get_ivars(self); const struct u3g_dev_type_s *u3g_dev_type; int i; + #ifndef U3G_DEBUG - if (!bootverbose) // hide the stub attachment + if (!bootverbose) device_quiet(self); #endif @@ -593,18 +601,27 @@ u3gstub_attach(device_t self) u3g_dev_type = u3g_lookup(uaa->vendor, uaa->product); if (u3g_dev_type->flags&U3GFL_HUAWEI_INIT) { - DPRINTF("changing Huawei modem to modem mode\n"); + if (bootverbose) + device_printf(sc->sc_dev, + "changing Huawei modem to modem mode\n"); if (!u3gstub_huawei_init(sc, uaa)) return ENXIO; } else if (u3g_dev_type->flags&U3GFL_SCSI_EJECT) { - DPRINTF("sending CD eject command to change to modem mode\n"); + if (bootverbose) + device_printf(sc->sc_dev, "sending CD eject command to " + "change to modem mode\n"); if (!u3gstub_scsi_eject(sc, uaa)) return ENXIO; } else if (u3g_dev_type->flags&U3GFL_SIERRA_INIT) { - DPRINTF("changing Sierra modem to modem mode\n"); + if (bootverbose) + device_printf(sc->sc_dev, + "changing Sierra modem to modem mode\n"); if (!u3gstub_sierra_init(sc, uaa)) return ENXIO; } else if (u3g_dev_type->flags&U3GFL_STUB_WAIT) { + if (bootverbose) + device_printf(sc->sc_dev, "waiting for modem to change " + "to modem mode\n"); /* nop */ } @@ -637,7 +654,7 @@ static device_method_t u3gstub_methods[] }; static driver_t u3gstub_driver = { - "u3gstub", + "u3g", u3gstub_methods, sizeof (struct u3gstub_softc) }; From owner-svn-src-head@FreeBSD.ORG Fri Nov 14 01:24:53 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3FAB41065670; Fri, 14 Nov 2008 01:24:53 +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 24D6C8FC08; Fri, 14 Nov 2008 01:24:53 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mAE1Oqrt074762; Fri, 14 Nov 2008 01:24:52 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mAE1OqJD074759; Fri, 14 Nov 2008 01:24:52 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200811140124.mAE1OqJD074759@svn.freebsd.org> From: Robert Watson Date: Fri, 14 Nov 2008 01:24: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: r184948 - head/sys/security/audit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Nov 2008 01:24:53 -0000 Author: rwatson Date: Fri Nov 14 01:24:52 2008 New Revision: 184948 URL: http://svn.freebsd.org/changeset/base/184948 Log: When repeatedly accessing a thread credential, cache the credential pointer in a local thread. While this is unlikely to significantly improve performance given modern compiler behavior, it makes the code more readable and reduces diffs to the Mac OS X version of the same code (which stores things in creds in the same way, but where the cred for a thread is reached quite differently). Discussed with: sson MFC after: 1 month Sponsored by: Apple Inc. Obtained from: TrustedBSD Project Modified: head/sys/security/audit/audit.c head/sys/security/audit/audit_arg.c head/sys/security/audit/audit_syscalls.c Modified: head/sys/security/audit/audit.c ============================================================================== --- head/sys/security/audit/audit.c Fri Nov 14 00:20:24 2008 (r184947) +++ head/sys/security/audit/audit.c Fri Nov 14 01:24:52 2008 (r184948) @@ -207,6 +207,7 @@ audit_record_ctor(void *mem, int size, v { struct kaudit_record *ar; struct thread *td; + struct ucred *cred; KASSERT(sizeof(*ar) == size, ("audit_record_ctor: wrong size")); @@ -219,15 +220,16 @@ audit_record_ctor(void *mem, int size, v /* * Export the subject credential. */ - cru2x(td->td_ucred, &ar->k_ar.ar_subj_cred); - ar->k_ar.ar_subj_ruid = td->td_ucred->cr_ruid; - ar->k_ar.ar_subj_rgid = td->td_ucred->cr_rgid; - ar->k_ar.ar_subj_egid = td->td_ucred->cr_groups[0]; - ar->k_ar.ar_subj_auid = td->td_ucred->cr_audit.ai_auid; - ar->k_ar.ar_subj_asid = td->td_ucred->cr_audit.ai_asid; + cred = td->td_ucred; + cru2x(cred, &ar->k_ar.ar_subj_cred); + ar->k_ar.ar_subj_ruid = cred->cr_ruid; + ar->k_ar.ar_subj_rgid = cred->cr_rgid; + ar->k_ar.ar_subj_egid = cred->cr_groups[0]; + ar->k_ar.ar_subj_auid = cred->cr_audit.ai_auid; + ar->k_ar.ar_subj_asid = cred->cr_audit.ai_asid; ar->k_ar.ar_subj_pid = td->td_proc->p_pid; - ar->k_ar.ar_subj_amask = td->td_ucred->cr_audit.ai_mask; - ar->k_ar.ar_subj_term_addr = td->td_ucred->cr_audit.ai_termid; + ar->k_ar.ar_subj_amask = cred->cr_audit.ai_mask; + ar->k_ar.ar_subj_term_addr = cred->cr_audit.ai_termid; return (0); } @@ -631,6 +633,7 @@ audit_proc_coredump(struct thread *td, c { struct kaudit_record *ar; struct au_mask *aumask; + struct ucred *cred; au_class_t class; int ret, sorf; char **pathp; @@ -641,11 +644,12 @@ audit_proc_coredump(struct thread *td, c /* * Make sure we are using the correct preselection mask. */ - auid = td->td_ucred->cr_audit.ai_auid; + cred = td->td_ucred; + auid = cred->cr_audit.ai_auid; if (auid == AU_DEFAUDITID) aumask = &audit_nae_mask; else - aumask = &td->td_ucred->cr_audit.ai_mask; + aumask = &cred->cr_audit.ai_mask; /* * It's possible for coredump(9) generation to fail. Make sure that * we handle this case correctly for preselection. @@ -658,6 +662,7 @@ audit_proc_coredump(struct thread *td, c if (au_preselect(AUE_CORE, class, aumask, sorf) == 0 && audit_pipe_preselect(auid, AUE_CORE, class, sorf, 0) == 0) return; + /* * If we are interested in seeing this audit record, allocate it. * Where possible coredump records should contain a pathname and arg32 Modified: head/sys/security/audit/audit_arg.c ============================================================================== --- head/sys/security/audit/audit_arg.c Fri Nov 14 00:20:24 2008 (r184947) +++ head/sys/security/audit/audit_arg.c Fri Nov 14 01:24:52 2008 (r184948) @@ -356,6 +356,7 @@ void audit_arg_process(struct proc *p) { struct kaudit_record *ar; + struct ucred *cred; KASSERT(p != NULL, ("audit_arg_process: p == NULL")); @@ -365,13 +366,14 @@ audit_arg_process(struct proc *p) if (ar == NULL) return; - ar->k_ar.ar_arg_auid = p->p_ucred->cr_audit.ai_auid; - ar->k_ar.ar_arg_euid = p->p_ucred->cr_uid; - ar->k_ar.ar_arg_egid = p->p_ucred->cr_groups[0]; - ar->k_ar.ar_arg_ruid = p->p_ucred->cr_ruid; - ar->k_ar.ar_arg_rgid = p->p_ucred->cr_rgid; - ar->k_ar.ar_arg_asid = p->p_ucred->cr_audit.ai_asid; - ar->k_ar.ar_arg_termid_addr = p->p_ucred->cr_audit.ai_termid; + cred = p->p_ucred; + ar->k_ar.ar_arg_auid = cred->cr_audit.ai_auid; + ar->k_ar.ar_arg_euid = cred->cr_uid; + ar->k_ar.ar_arg_egid = cred->cr_groups[0]; + ar->k_ar.ar_arg_ruid = cred->cr_ruid; + ar->k_ar.ar_arg_rgid = cred->cr_rgid; + ar->k_ar.ar_arg_asid = cred->cr_audit.ai_asid; + ar->k_ar.ar_arg_termid_addr = cred->cr_audit.ai_termid; ar->k_ar.ar_arg_pid = p->p_pid; ARG_SET_VALID(ar, ARG_AUID | ARG_EUID | ARG_EGID | ARG_RUID | ARG_RGID | ARG_ASID | ARG_TERMID_ADDR | ARG_PID | ARG_PROCESS); Modified: head/sys/security/audit/audit_syscalls.c ============================================================================== --- head/sys/security/audit/audit_syscalls.c Fri Nov 14 00:20:24 2008 (r184947) +++ head/sys/security/audit/audit_syscalls.c Fri Nov 14 01:24:52 2008 (r184948) @@ -157,7 +157,7 @@ free_out: int auditon(struct thread *td, struct auditon_args *uap) { - struct ucred *newcred, *oldcred; + struct ucred *cred, *newcred, *oldcred; int error; union auditon_udata udata; struct proc *tp; @@ -321,22 +321,21 @@ auditon(struct thread *td, struct audito PROC_UNLOCK(tp); return (error); } - if (tp->p_ucred->cr_audit.ai_termid.at_type == AU_IPv6) { + cred = tp->p_ucred; + if (cred->cr_audit.ai_termid.at_type == AU_IPv6) { PROC_UNLOCK(tp); return (EINVAL); } - udata.au_aupinfo.ap_auid = - tp->p_ucred->cr_audit.ai_auid; + udata.au_aupinfo.ap_auid = cred->cr_audit.ai_auid; udata.au_aupinfo.ap_mask.am_success = - tp->p_ucred->cr_audit.ai_mask.am_success; + cred->cr_audit.ai_mask.am_success; udata.au_aupinfo.ap_mask.am_failure = - tp->p_ucred->cr_audit.ai_mask.am_failure; + cred->cr_audit.ai_mask.am_failure; udata.au_aupinfo.ap_termid.machine = - tp->p_ucred->cr_audit.ai_termid.at_addr[0]; + cred->cr_audit.ai_termid.at_addr[0]; udata.au_aupinfo.ap_termid.port = - (dev_t)tp->p_ucred->cr_audit.ai_termid.at_port; - udata.au_aupinfo.ap_asid = - tp->p_ucred->cr_audit.ai_asid; + (dev_t)cred->cr_audit.ai_termid.at_port; + udata.au_aupinfo.ap_asid = cred->cr_audit.ai_asid; PROC_UNLOCK(tp); break; @@ -381,16 +380,14 @@ auditon(struct thread *td, struct audito return (ESRCH); if ((tp = pfind(udata.au_aupinfo_addr.ap_pid)) == NULL) return (ESRCH); - udata.au_aupinfo_addr.ap_auid = - tp->p_ucred->cr_audit.ai_auid; + cred = tp->p_ucred; + udata.au_aupinfo_addr.ap_auid = cred->cr_audit.ai_auid; udata.au_aupinfo_addr.ap_mask.am_success = - tp->p_ucred->cr_audit.ai_mask.am_success; + cred->cr_audit.ai_mask.am_success; udata.au_aupinfo_addr.ap_mask.am_failure = - tp->p_ucred->cr_audit.ai_mask.am_failure; - udata.au_aupinfo_addr.ap_termid = - tp->p_ucred->cr_audit.ai_termid; - udata.au_aupinfo_addr.ap_asid = - tp->p_ucred->cr_audit.ai_asid; + cred->cr_audit.ai_mask.am_failure; + udata.au_aupinfo_addr.ap_termid = cred->cr_audit.ai_termid; + udata.au_aupinfo_addr.ap_asid = cred->cr_audit.ai_asid; PROC_UNLOCK(tp); break; @@ -503,21 +500,23 @@ int getaudit(struct thread *td, struct getaudit_args *uap) { struct auditinfo ai; + struct ucred *cred; int error; - if (jailed(td->td_ucred)) + cred = td->td_ucred; + if (jailed(cred)) return (ENOSYS); error = priv_check(td, PRIV_AUDIT_GETAUDIT); if (error) return (error); - if (td->td_ucred->cr_audit.ai_termid.at_type == AU_IPv6) + if (cred->cr_audit.ai_termid.at_type == AU_IPv6) return (ERANGE); bzero(&ai, sizeof(ai)); - ai.ai_auid = td->td_ucred->cr_audit.ai_auid; - ai.ai_mask = td->td_ucred->cr_audit.ai_mask; - ai.ai_asid = td->td_ucred->cr_audit.ai_asid; - ai.ai_termid.machine = td->td_ucred->cr_audit.ai_termid.at_addr[0]; - ai.ai_termid.port = td->td_ucred->cr_audit.ai_termid.at_port; + ai.ai_auid = cred->cr_audit.ai_auid; + ai.ai_mask = cred->cr_audit.ai_mask; + ai.ai_asid = cred->cr_audit.ai_asid; + ai.ai_termid.machine = cred->cr_audit.ai_termid.at_addr[0]; + ai.ai_termid.port = cred->cr_audit.ai_termid.at_port; return (copyout(&ai, uap->auditinfo, sizeof(ai))); } From owner-svn-src-head@FreeBSD.ORG Fri Nov 14 01:53:11 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 353701065677; Fri, 14 Nov 2008 01:53:11 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1BF048FC0C; Fri, 14 Nov 2008 01:53:11 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mAE1rA7v075293; Fri, 14 Nov 2008 01:53:10 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mAE1rAT8075292; Fri, 14 Nov 2008 01:53:10 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <200811140153.mAE1rAT8075292@svn.freebsd.org> From: "David E. O'Brien" Date: Fri, 14 Nov 2008 01:53: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: r184949 - head/sys/dev/ipmi X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Nov 2008 01:53:11 -0000 Author: obrien Date: Fri Nov 14 01:53:10 2008 New Revision: 184949 URL: http://svn.freebsd.org/changeset/base/184949 Log: Fix typo where the code was missing the "IPMICTL_RECEIVE_MSG_32" condition test. Modified: head/sys/dev/ipmi/ipmi.c Modified: head/sys/dev/ipmi/ipmi.c ============================================================================== --- head/sys/dev/ipmi/ipmi.c Fri Nov 14 01:24:52 2008 (r184948) +++ head/sys/dev/ipmi/ipmi.c Fri Nov 14 01:53:10 2008 (r184949) @@ -402,7 +402,7 @@ ipmi_ioctl(struct cdev *cdev, u_long cmd if (recv->msg.data_len < len && (cmd == IPMICTL_RECEIVE_MSG #ifdef IPMICTL_RECEIVE_MSG_32 - || cmd == IPMICTL_RECEIVE_MSG + || cmd == IPMICTL_RECEIVE_MSG_32 #endif )) { IPMI_UNLOCK(sc); From owner-svn-src-head@FreeBSD.ORG Fri Nov 14 01:56:11 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C2728106564A; Fri, 14 Nov 2008 01:56:11 +0000 (UTC) (envelope-from ps@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A93598FC0C; Fri, 14 Nov 2008 01:56:11 +0000 (UTC) (envelope-from ps@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mAE1uBWD075394; Fri, 14 Nov 2008 01:56:11 GMT (envelope-from ps@svn.freebsd.org) Received: (from ps@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mAE1uB0S075392; Fri, 14 Nov 2008 01:56:11 GMT (envelope-from ps@svn.freebsd.org) Message-Id: <200811140156.mAE1uB0S075392@svn.freebsd.org> From: Paul Saab Date: Fri, 14 Nov 2008 01:56: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: r184950 - in head/sys/modules/cxgb: iw_cxgb toecore X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Nov 2008 01:56:11 -0000 Author: ps Date: Fri Nov 14 01:56:11 2008 New Revision: 184950 URL: http://svn.freebsd.org/changeset/base/184950 Log: Fix world Approved by: kmacy Modified: head/sys/modules/cxgb/iw_cxgb/Makefile head/sys/modules/cxgb/toecore/Makefile Modified: head/sys/modules/cxgb/iw_cxgb/Makefile ============================================================================== --- head/sys/modules/cxgb/iw_cxgb/Makefile Fri Nov 14 01:53:10 2008 (r184949) +++ head/sys/modules/cxgb/iw_cxgb/Makefile Fri Nov 14 01:56:11 2008 (r184950) @@ -7,7 +7,7 @@ KMOD= iw_cxgb SRCS= iw_cxgb.c iw_cxgb_cm.c iw_cxgb_hal.c SRCS+= iw_cxgb_provider.c iw_cxgb_qp.c iw_cxgb_resource.c SRCS+= iw_cxgb_ev.c iw_cxgb_mem.c iw_cxgb_dbg.c iw_cxgb_cq.c -SRCS+= bus_if.h device_if.h opt_sched.h pci_if.h pcib_if.h opt_ktr.h +SRCS+= bus_if.h device_if.h opt_sched.h pci_if.h pcib_if.h opt_ktr.h opt_inet.h CFLAGS+= -g -I${CXGB} #CFLAGS+= -DDEBUG Modified: head/sys/modules/cxgb/toecore/Makefile ============================================================================== --- head/sys/modules/cxgb/toecore/Makefile Fri Nov 14 01:53:10 2008 (r184949) +++ head/sys/modules/cxgb/toecore/Makefile Fri Nov 14 01:56:11 2008 (r184950) @@ -5,7 +5,7 @@ CXGB = ${.CURDIR}/../../../dev/cxgb KMOD= toecore SRCS= toedev.c -SRCS+= device_if.h bus_if.h pci_if.h opt_sched.h +SRCS+= device_if.h bus_if.h pci_if.h opt_sched.h opt_inet.h CFLAGS+= -g -I${CXGB} .include From owner-svn-src-head@FreeBSD.ORG Fri Nov 14 07:05:52 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 89FF71065678; Fri, 14 Nov 2008 07:05: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 6B8D58FC19; Fri, 14 Nov 2008 07:05:52 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mAE75qgq081248; Fri, 14 Nov 2008 07:05:52 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mAE75qOu081247; Fri, 14 Nov 2008 07:05:52 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200811140705.mAE75qOu081247@svn.freebsd.org> From: Kip Macy Date: Fri, 14 Nov 2008 07:05: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: r184957 - head/sys/i386/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Nov 2008 07:05:52 -0000 Author: kmacy Date: Fri Nov 14 07:05:51 2008 New Revision: 184957 URL: http://svn.freebsd.org/changeset/base/184957 Log: repair config file from spamming Modified: head/sys/i386/conf/XEN Modified: head/sys/i386/conf/XEN ============================================================================== --- head/sys/i386/conf/XEN Fri Nov 14 06:40:43 2008 (r184956) +++ head/sys/i386/conf/XEN Fri Nov 14 07:05:51 2008 (r184957) @@ -65,6 +65,12 @@ options MCLSHIFT=12 options SMP # Symmetric MultiProcessor Kernel device apic # I/O APIC + +device atkbdc # AT keyboard controller +device atkbd # AT keyboard +device psm # PS/2 mouse +device pci + device kbdmux # keyboard multiplexer # Pseudo devices. From owner-svn-src-head@FreeBSD.ORG Fri Nov 14 07:06:28 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 502AB1065670; Fri, 14 Nov 2008 07:06:28 +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 313738FC2B; Fri, 14 Nov 2008 07:06:28 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mAE76Sfv081295; Fri, 14 Nov 2008 07:06:28 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mAE76S4H081294; Fri, 14 Nov 2008 07:06:28 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200811140706.mAE76S4H081294@svn.freebsd.org> From: Kip Macy Date: Fri, 14 Nov 2008 07:06:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184958 - head/sys/xen/xenbus X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Nov 2008 07:06:28 -0000 Author: kmacy Date: Fri Nov 14 07:06:27 2008 New Revision: 184958 URL: http://svn.freebsd.org/changeset/base/184958 Log: merge fix for boot-time hang on centos' xen Modified: head/sys/xen/xenbus/xenbus_xs.c Modified: head/sys/xen/xenbus/xenbus_xs.c ============================================================================== --- head/sys/xen/xenbus/xenbus_xs.c Fri Nov 14 07:05:51 2008 (r184957) +++ head/sys/xen/xenbus/xenbus_xs.c Fri Nov 14 07:06:27 2008 (r184958) @@ -107,7 +107,7 @@ struct xs_handle { struct sx request_mutex; /* Protect transactions against save/restore. */ - struct rw_semaphore suspend_mutex; + struct sx suspend_mutex; }; static struct xs_handle xs_state; @@ -231,7 +231,7 @@ void *xenbus_dev_request_and_reply(struc int err; if (req_msg.type == XS_TRANSACTION_START) - down_read(&xs_state.suspend_mutex); + sx_slock(&xs_state.suspend_mutex); sx_xlock(&xs_state.request_mutex); @@ -248,11 +248,13 @@ void *xenbus_dev_request_and_reply(struc if ((msg->type == XS_TRANSACTION_END) || ((req_msg.type == XS_TRANSACTION_START) && (msg->type == XS_ERROR))) - up_read(&xs_state.suspend_mutex); + sx_sunlock(&xs_state.suspend_mutex); return ret; } +static int xenwatch_inline; + /* Send message to xs, get kmalloc'ed reply. ERR_PTR() on error. */ static void *xs_talkv(struct xenbus_transaction t, enum xsd_sockmsg_type type, @@ -305,17 +307,24 @@ static void *xs_talkv(struct xenbus_tran return ERR_PTR(-err); } - if (xenwatch_running == 0) { - while (!TAILQ_EMPTY(&watch_events)) { + if ((xenwatch_running == 0) && (xenwatch_inline == 0)) { + xenwatch_inline = 1; + while (!TAILQ_EMPTY(&watch_events) + && xenwatch_running == 0) { + struct xs_stored_msg *wmsg = TAILQ_FIRST(&watch_events); list_del(&watch_events, wmsg); - wmsg->u.watch.handle->callback( + printf("handling %p ...", wmsg->u.watch.handle->callback); + + wmsg->u.watch.handle->callback( wmsg->u.watch.handle, (const char **)wmsg->u.watch.vec, wmsg->u.watch.vec_size); - kfree(wmsg->u.watch.vec); + printf("... %p done\n", wmsg->u.watch.handle->callback); + kfree(wmsg->u.watch.vec); kfree(wmsg); } + xenwatch_inline = 0; } BUG_ON(msg.type != type); @@ -521,11 +530,10 @@ int xenbus_transaction_start(struct xenb { char *id_str; - down_read(&xs_state.suspend_mutex); - + sx_slock(&xs_state.suspend_mutex); id_str = xs_single(XBT_NIL, XS_TRANSACTION_START, "", NULL); if (IS_ERR(id_str)) { - up_read(&xs_state.suspend_mutex); + sx_sunlock(&xs_state.suspend_mutex); return PTR_ERR(id_str); } @@ -551,8 +559,8 @@ int xenbus_transaction_end(struct xenbus printf("xenbus_transaction_end "); err = xs_error(xs_single(t, XS_TRANSACTION_END, abortstr, NULL)); - - up_read(&xs_state.suspend_mutex); + + sx_sunlock(&xs_state.suspend_mutex); return err; } @@ -691,7 +699,7 @@ int register_xenbus_watch(struct xenbus_ sprintf(token, "%lX", (long)watch); - down_read(&xs_state.suspend_mutex); + sx_slock(&xs_state.suspend_mutex); mtx_lock(&watches_lock); BUG_ON(find_watch(token) != NULL); @@ -699,7 +707,7 @@ int register_xenbus_watch(struct xenbus_ mtx_unlock(&watches_lock); err = xs_watch(watch->node, token); - + /* Ignore errors due to multiple registration. */ if ((err != 0) && (err != -EEXIST)) { mtx_lock(&watches_lock); @@ -707,7 +715,7 @@ int register_xenbus_watch(struct xenbus_ mtx_unlock(&watches_lock); } - up_read(&xs_state.suspend_mutex); + sx_sunlock(&xs_state.suspend_mutex); return err; } @@ -720,8 +728,8 @@ void unregister_xenbus_watch(struct xenb int err; sprintf(token, "%lX", (long)watch); - - down_read(&xs_state.suspend_mutex); + + sx_slock(&xs_state.suspend_mutex); mtx_lock(&watches_lock); BUG_ON(!find_watch(token)); @@ -733,7 +741,7 @@ void unregister_xenbus_watch(struct xenb log(LOG_WARNING, "XENBUS Failed to release watch %s: %i\n", watch->node, err); - up_read(&xs_state.suspend_mutex); + sx_sunlock(&xs_state.suspend_mutex); /* Cancel pending watch events. */ mtx_lock(&watch_events_lock); @@ -755,8 +763,8 @@ void unregister_xenbus_watch(struct xenb EXPORT_SYMBOL(unregister_xenbus_watch); void xs_suspend(void) -{ - down_write(&xs_state.suspend_mutex); +{ + sx_xlock(&xs_state.suspend_mutex); sx_xlock(&xs_state.request_mutex); } @@ -773,15 +781,22 @@ void xs_resume(void) xs_watch(watch->node, token); } - up_write(&xs_state.suspend_mutex); + sx_xunlock(&xs_state.suspend_mutex); } static void xenwatch_thread(void *unused) { struct xs_stored_msg *msg; - DELAY(10000); xenwatch_running = 1; + + DELAY(100000); + while (xenwatch_inline) { + printf("xenwatch inline still running\n"); + DELAY(100000); + } + + for (;;) { while (list_empty(&watch_events)) @@ -797,7 +812,6 @@ static void xenwatch_thread(void *unused mtx_unlock(&watch_events_lock); if (msg != NULL) { - printf("handling watch\n"); msg->u.watch.handle->callback( msg->u.watch.handle, (const char **)msg->u.watch.vec, @@ -906,7 +920,7 @@ int xs_init(void) mtx_init(&xs_state.reply_lock, "state reply", NULL, MTX_DEF); sx_init(&xs_state.request_mutex, "xenstore request"); - sema_init(&xs_state.suspend_mutex, 1, "xenstore suspend"); + sx_init(&xs_state.suspend_mutex, "xenstore suspend"); #if 0 From owner-svn-src-head@FreeBSD.ORG Fri Nov 14 08:35:55 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F2AFD106567E; Fri, 14 Nov 2008 08:35:54 +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 863478FC0A; Fri, 14 Nov 2008 08:35:54 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mAE8ZsoV082960; Fri, 14 Nov 2008 08:35:54 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mAE8Zses082959; Fri, 14 Nov 2008 08:35:54 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200811140835.mAE8Zses082959@svn.freebsd.org> From: Ed Schouten Date: Fri, 14 Nov 2008 08: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: r184962 - head/sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Nov 2008 08:35:55 -0000 Author: ed Date: Fri Nov 14 08:35:54 2008 New Revision: 184962 URL: http://svn.freebsd.org/changeset/base/184962 Log: Per request, keep privilege number 20 reserved. In my commit that moved uname(), setdomainname() and getdomainname() to COMPAT_FREEBSD4, I also removed PRIV_SETDOMAINNAME, because it was already protected by userland_sysctl(). We'd better keep the number 20 reserved, to prevent it from being used again. Requested by: rwatson Modified: head/sys/sys/priv.h Modified: head/sys/sys/priv.h ============================================================================== --- head/sys/sys/priv.h Fri Nov 14 08:27:23 2008 (r184961) +++ head/sys/sys/priv.h Fri Nov 14 08:35:54 2008 (r184962) @@ -84,6 +84,7 @@ #define PRIV_CLOCK_SETTIME 17 /* Can call clock_settime. */ #define PRIV_SETTIMEOFDAY 18 /* Can call settimeofday. */ #define PRIV_SETHOSTID 19 /* Can call sethostid. */ +#define _PRIV_SETDOMAINNAME 20 /* Removed. */ /* * Audit subsystem privileges. From owner-svn-src-head@FreeBSD.ORG Fri Nov 14 09:41:38 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0E23F1065679; Fri, 14 Nov 2008 09:41:38 +0000 (UTC) (envelope-from byshenknet@byshenk.net) Received: from core.byshenk.net (core.byshenk.net [62.58.73.230]) by mx1.freebsd.org (Postfix) with ESMTP id A66338FC13; Fri, 14 Nov 2008 09:41:37 +0000 (UTC) (envelope-from byshenknet@byshenk.net) Received: from core.byshenk.net (localhost.aoes.com [127.0.0.1]) by core.byshenk.net (8.14.3/8.14.3) with ESMTP id mAE9LRoS015815; Fri, 14 Nov 2008 10:21:28 +0100 (CET) (envelope-from byshenknet@core.byshenk.net) Received: (from byshenknet@localhost) by core.byshenk.net (8.14.3/8.14.3/Submit) id mAE9LRQD015814; Fri, 14 Nov 2008 10:21:27 +0100 (CET) (envelope-from byshenknet) Date: Fri, 14 Nov 2008 10:21:27 +0100 From: Greg Byshenk To: Doug Ambrisko Message-ID: <20081114092127.GO907@core.byshenk.net> References: <20081113174740.GV47073@deviant.kiev.zoral.com.ua> <200811131811.mADIBJOj099325@ambrisko.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200811131811.mADIBJOj099325@ambrisko.com> User-Agent: Mutt/1.4.2.3i X-Spam-Status: No, score=-1.4 required=5.0 tests=ALL_TRUSTED autolearn=failed version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on core.byshenk.net Cc: Kostik Belousov , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r184934 - head/sys/ufs/ffs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Nov 2008 09:41:38 -0000 On Thu, Nov 13, 2008 at 10:11:19AM -0800, Doug Ambrisko wrote: > Kostik Belousov writes: > | On Thu, Nov 13, 2008 at 05:40:21PM +0000, Doug Ambrisko wrote: > | > Author: ambrisko > | > Date: Thu Nov 13 17:40:21 2008 > | > New Revision: 184934 > | > URL: http://svn.freebsd.org/changeset/base/184934 > | > > | > Log: > | > For now on every 10 cyclinder groups flush the buffer cache to free > | > up space. If the buffer cache fills up then the disk systems can > | > grind to a halt. Better tuning can be figured out later. > | > > | > Tested by: Tim, others and work > | > Reviewed by: Kostik Belousov > | > PR: 128832 > | > > | > Modified: > | > head/sys/ufs/ffs/ffs_snapshot.c > | > > | > Modified: head/sys/ufs/ffs/ffs_snapshot.c > | > ============================================================================== > | > --- head/sys/ufs/ffs/ffs_snapshot.c Thu Nov 13 17:13:16 2008 (r184933) > | > +++ head/sys/ufs/ffs/ffs_snapshot.c Thu Nov 13 17:40:21 2008 (r184934) > | > @@ -351,6 +351,8 @@ restart: > | > if (error) > | > goto out; > | > bawrite(nbp); > | > + if (cg % 10 == 0) > | > + ffs_syncvnode(vp, MNT_WAIT); > | > } > | > /* > | > * Copy all the cylinder group maps. Although the > | > @@ -372,6 +374,8 @@ restart: > | > goto out; > | > error = cgaccount(cg, vp, nbp, 1); > | > bawrite(nbp); > | > + if (cg % 10 == 0) > | > + ffs_syncvnode(vp, MNT_WAIT); > | > if (error) > | > goto out; > | > } > | Thank you ! > | > | Please, MFC it for 7.1. > I'll wait for some of the dust to settle first. > Also I want to test a 7.1 machine here without any of my patches, then > start adding some back it. I should be able to get that mostly done > today unless I get hit with other work stuff. From my perspective > I have a couple of low risk patches that should go in but look more > radical. FWIW, I've just tested the patch on my system described previously 7.1-PRERELEASE amd64, and my snapshots now work, where they did not without the patch (see below). Of course, a snapshot takes a very long time to complete, but I think that is to be expected with filesystems that large. Unless there is some problem I am unaware of, let me add my vote to the MFC column. -greg /dev/da1p1 96850470 7934486 81167948 9% /export/mail /dev/da1p2 1937058312 974663846 807429802 55% /export/home /dev/da1p3 1937058312 81633990 1700459658 5% /export/misc /dev/da1p4 2598991534 274277272 2116794940 11% /export/spare [...] /dev/md9 96850470 7877014 81225420 9% /export/snapshots/mail /dev/md8 1937058312 973516342 808577306 55% /export/snapshots/home /dev/md10 1937058312 80486486 1701607162 5% /export/snapshots/misc /dev/md11 2598991534 272737736 2118334476 11% /export/snapshots/spare # ls -l /export/*/.snapshots/* -r--r----- 1 root operator 2048000085176 Nov 14 09:44 /export/home/.snapshots/20081113 -r--r----- 1 root operator 102400004296 Nov 14 08:59 /export/mail/.snapshots/20081113 -r--r----- 1 root operator 2048000085176 Nov 14 09:30 /export/misc/.snapshots/20081113 -r--r----- 1 root operator 2747837267536 Nov 14 10:10 /export/spare/.snapshots/20081113 -- greg byshenk - gbyshenk@byshenk.net - Leiden, NL From owner-svn-src-head@FreeBSD.ORG Fri Nov 14 09:58:16 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E7B89106564A; Fri, 14 Nov 2008 09:58:16 +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 D7D8F8FC13; Fri, 14 Nov 2008 09:58:16 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mAE9wGxn086902; Fri, 14 Nov 2008 09:58:16 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mAE9wGcx086897; Fri, 14 Nov 2008 09:58:16 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <200811140958.mAE9wGcx086897@svn.freebsd.org> From: Edward Tomasz Napierala Date: Fri, 14 Nov 2008 09:58: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: r184965 - in head/sys/gnu/fs/xfs: . FreeBSD X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Nov 2008 09:58:17 -0000 Author: trasz Date: Fri Nov 14 09:58:16 2008 New Revision: 184965 URL: http://svn.freebsd.org/changeset/base/184965 Log: Adapt to accmode_t changes. Approved by: rwatson (mentor), kan Modified: head/sys/gnu/fs/xfs/FreeBSD/xfs_vnode.h head/sys/gnu/fs/xfs/xfs_dfrag.c head/sys/gnu/fs/xfs/xfs_inode.c head/sys/gnu/fs/xfs/xfs_inode.h head/sys/gnu/fs/xfs/xfs_vnodeops.c Modified: head/sys/gnu/fs/xfs/FreeBSD/xfs_vnode.h ============================================================================== --- head/sys/gnu/fs/xfs/FreeBSD/xfs_vnode.h Fri Nov 14 08:43:01 2008 (r184964) +++ head/sys/gnu/fs/xfs/FreeBSD/xfs_vnode.h Fri Nov 14 09:58:16 2008 (r184965) @@ -292,8 +292,8 @@ typedef struct xfs_vnodeops { rv = _VOP_(vop_getattr, vp)((vp)->v_fbhv, vap, f, cr) #define XVOP_SETATTR(vp, vap, f, cr, rv) \ rv = _VOP_(vop_setattr, vp)((vp)->v_fbhv, vap, f, cr) -#define XVOP_ACCESS(vp, mode, cr, rv) \ - rv = _VOP_(vop_access, vp)((vp)->v_fbhv, mode, cr) +#define XVOP_ACCESS(vp, accmode, cr, rv) \ + rv = _VOP_(vop_access, vp)((vp)->v_fbhv, accmode, cr) #define XVOP_LOOKUP(vp,d,vpp,f,rdir,cr,rv) \ rv = _VOP_(vop_lookup, vp)((vp)->v_fbhv,d,vpp,f,rdir,cr) #define XVOP_CREATE(dvp,d,vap,vpp,cr,rv) \ Modified: head/sys/gnu/fs/xfs/xfs_dfrag.c ============================================================================== --- head/sys/gnu/fs/xfs/xfs_dfrag.c Fri Nov 14 08:43:01 2008 (r184964) +++ head/sys/gnu/fs/xfs/xfs_dfrag.c Fri Nov 14 09:58:16 2008 (r184965) @@ -181,11 +181,11 @@ xfs_swap_extents( locked = 1; /* Check permissions */ - error = xfs_iaccess(ip, S_IWUSR, NULL); + error = xfs_iaccess(ip, VWRITE, NULL); if (error) goto error0; - error = xfs_iaccess(tip, S_IWUSR, NULL); + error = xfs_iaccess(tip, VWRITE, NULL); if (error) goto error0; Modified: head/sys/gnu/fs/xfs/xfs_inode.c ============================================================================== --- head/sys/gnu/fs/xfs/xfs_inode.c Fri Nov 14 08:43:01 2008 (r184964) +++ head/sys/gnu/fs/xfs/xfs_inode.c Fri Nov 14 09:58:16 2008 (r184965) @@ -3610,7 +3610,7 @@ xfs_iflush_all( int xfs_iaccess( xfs_inode_t *ip, - mode_t mode, + accmode_t accmode, cred_t *cr) { xfs_vnode_t *vp; @@ -3624,10 +3624,10 @@ xfs_iaccess( /* * Verify that the MAC policy allows the requested access. */ - if ((error = _MAC_XFS_IACCESS(ip, mode, cr))) + if ((error = _MAC_XFS_IACCESS(ip, accmode, cr))) return XFS_ERROR(error); - if (mode & S_IWUSR) { + if (accmode & VWRITE) { xfs_mount_t *mp = ip->i_mount; if ((XVFSTOMNT(XFS_MTOVFS(mp))->mnt_flag & MNT_RDONLY) && @@ -3644,13 +3644,13 @@ xfs_iaccess( * If there's an Access Control List it's used instead of * the mode bits. */ - if ((error = _ACL_XFS_IACCESS(ip, mode, cr)) != -1) + if ((error = _ACL_XFS_IACCESS(ip, accmode, cr)) != -1) return error ? XFS_ERROR(error) : 0; /* FreeBSD local change here */ error = vaccess(vp->v_vnode->v_type, imode, ip->i_d.di_uid, ip->i_d.di_gid, - mode, cr, NULL); + accmode, cr, NULL); return (error); } Modified: head/sys/gnu/fs/xfs/xfs_inode.h ============================================================================== --- head/sys/gnu/fs/xfs/xfs_inode.h Fri Nov 14 08:43:01 2008 (r184964) +++ head/sys/gnu/fs/xfs/xfs_inode.h Fri Nov 14 09:58:16 2008 (r184965) @@ -455,7 +455,7 @@ void xfs_iunpin(xfs_inode_t *); int xfs_iextents_copy(xfs_inode_t *, xfs_bmbt_rec_t *, int); int xfs_iflush(xfs_inode_t *, uint); void xfs_iflush_all(struct xfs_mount *); -int xfs_iaccess(xfs_inode_t *, mode_t, cred_t *); +int xfs_iaccess(xfs_inode_t *, accmode_t, cred_t *); uint xfs_iroundup(uint); void xfs_ichgtime(xfs_inode_t *, int); xfs_fsize_t xfs_file_last_byte(xfs_inode_t *); Modified: head/sys/gnu/fs/xfs/xfs_vnodeops.c ============================================================================== --- head/sys/gnu/fs/xfs/xfs_vnodeops.c Fri Nov 14 08:43:01 2008 (r184964) +++ head/sys/gnu/fs/xfs/xfs_vnodeops.c Fri Nov 14 09:58:16 2008 (r184965) @@ -922,7 +922,7 @@ xfs_setattr( STATIC int xfs_access( bhv_desc_t *bdp, - int mode, + accmode_t accmode, cred_t *credp) { xfs_inode_t *ip; @@ -933,7 +933,7 @@ xfs_access( ip = XFS_BHVTOI(bdp); xfs_ilock(ip, XFS_ILOCK_SHARED); - error = xfs_iaccess(ip, mode, credp); + error = xfs_iaccess(ip, accmode, credp); xfs_iunlock(ip, XFS_ILOCK_SHARED); return error; } @@ -4538,7 +4538,7 @@ xfs_change_file_space( xfs_ilock(ip, XFS_ILOCK_SHARED); - if ((error = xfs_iaccess(ip, S_IWUSR, credp))) { + if ((error = xfs_iaccess(ip, VWRITE, credp))) { xfs_iunlock(ip, XFS_ILOCK_SHARED); return error; } From owner-svn-src-head@FreeBSD.ORG Fri Nov 14 11:27:53 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E1112106567F; Fri, 14 Nov 2008 11:27:53 +0000 (UTC) (envelope-from dfr@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D72118FC13; Fri, 14 Nov 2008 11:27:53 +0000 (UTC) (envelope-from dfr@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mAEBRrFV091181; Fri, 14 Nov 2008 11:27:53 GMT (envelope-from dfr@svn.freebsd.org) Received: (from dfr@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mAEBRrpB091178; Fri, 14 Nov 2008 11:27:53 GMT (envelope-from dfr@svn.freebsd.org) Message-Id: <200811141127.mAEBRrpB091178@svn.freebsd.org> From: Doug Rabson Date: Fri, 14 Nov 2008 11:27: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: r184969 - in head/sys: conf nfsclient nfsserver X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Nov 2008 11:27:54 -0000 Author: dfr Date: Fri Nov 14 11:27:53 2008 New Revision: 184969 URL: http://svn.freebsd.org/changeset/base/184969 Log: Switch the default rpc implementation for NFS back to the new code. I believe I have fixed the reported problems - if you still have trouble with it, please contact me with as much detail as possible so that I can track down any other issues as quickly as possible. Modified: head/sys/conf/options head/sys/nfsclient/nfs.h head/sys/nfsserver/nfs.h Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Fri Nov 14 11:23:02 2008 (r184968) +++ head/sys/conf/options Fri Nov 14 11:27:53 2008 (r184969) @@ -230,7 +230,6 @@ NFS4CLIENT opt_nfs.h # legacy RPC implementation instead of the newer KRPC system (which # supports modern features such as RPCSEC_GSS NFS_LEGACYRPC opt_nfs.h -NFS_NEWRPC opt_nfs.h # filesystems and libiconv bridge CD9660_ICONV opt_dontuse.h Modified: head/sys/nfsclient/nfs.h ============================================================================== --- head/sys/nfsclient/nfs.h Fri Nov 14 11:23:02 2008 (r184968) +++ head/sys/nfsclient/nfs.h Fri Nov 14 11:27:53 2008 (r184969) @@ -40,10 +40,6 @@ #include "opt_nfs.h" #endif -#if !defined(NFS_NEWRPC) && !defined(NFS_LEGACYRPC) -#define NFS_LEGACYRPC -#endif - #include /* Modified: head/sys/nfsserver/nfs.h ============================================================================== --- head/sys/nfsserver/nfs.h Fri Nov 14 11:23:02 2008 (r184968) +++ head/sys/nfsserver/nfs.h Fri Nov 14 11:27:53 2008 (r184969) @@ -40,10 +40,6 @@ #include "opt_nfs.h" #endif -#if !defined(NFS_NEWRPC) && !defined(NFS_LEGACYRPC) -#define NFS_LEGACYRPC -#endif - /* * Tunable constants for nfs */ From owner-svn-src-head@FreeBSD.ORG Fri Nov 14 16:39:53 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 818961065688; Fri, 14 Nov 2008 16:39:53 +0000 (UTC) (envelope-from keramida@freebsd.org) Received: from igloo.linux.gr (igloo.linux.gr [62.1.205.36]) by mx1.freebsd.org (Postfix) with ESMTP id D090B8FC19; Fri, 14 Nov 2008 16:39:52 +0000 (UTC) (envelope-from keramida@freebsd.org) Received: from kobe.laptop (adsl134-121.kln.forthnet.gr [77.49.253.121]) (authenticated bits=128) by igloo.linux.gr (8.14.3/8.14.3/Debian-5) with ESMTP id mAEGdguG029956 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 14 Nov 2008 18:39:48 +0200 Received: from kobe.laptop (kobe.laptop [127.0.0.1]) by kobe.laptop (8.14.3/8.14.3) with ESMTP id mAEGdgeZ002413; Fri, 14 Nov 2008 18:39:42 +0200 (EET) (envelope-from keramida@freebsd.org) Received: (from keramida@localhost) by kobe.laptop (8.14.3/8.14.3/Submit) id mAEGdf8G002412; Fri, 14 Nov 2008 18:39:41 +0200 (EET) (envelope-from keramida@freebsd.org) From: Giorgos Keramidas To: Joseph Koshy In-Reply-To: <200811091737.mA9HbssM047036@svn.freebsd.org> (Joseph Koshy's message of "Sun, 9 Nov 2008 17:37:54 +0000 (UTC)") Date: Fri, 14 Nov 2008 11:51:10 +0200 Message-ID: <87skpuab5d.fsf@kobe.laptop> References: <200811091737.mA9HbssM047036@svn.freebsd.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-MailScanner-ID: mAEGdguG029956 X-Hellug-MailScanner: Found to be clean X-Hellug-MailScanner-SpamCheck: not spam, SpamAssassin (not cached, score=-4.056, required 5, ALL_TRUSTED -1.80, AWL -0.16, BAYES_00 -2.60, DATE_IN_PAST_06_12 0.50) X-Hellug-MailScanner-From: keramida@freebsd.org X-Spam-Status: No Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r184802 - in head/sys: amd64/include conf dev/hwpmc i386/include modules/hwpmc sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Nov 2008 16:39:53 -0000 On Sun, 9 Nov 2008 17:37:54 +0000 (UTC), Joseph Koshy wrote: > Author: jkoshy > Date: Sun Nov 9 17:37:54 2008 > New Revision: 184802 > URL: http://svn.freebsd.org/changeset/base/184802 > > Log: > - Separate PMC class dependent code from other kinds of machine > dependencies. A 'struct pmc_classdep' structure describes operations > on PMCs; 'struct pmc_mdep' contains one or more 'struct pmc_classdep' > structures depending on the CPU in question. > > Inside PMC class dependent code, row indices are relative to the > PMCs supported by the PMC class; MI code in "hwpmc_mod.c" translates > global row indices before invoking class dependent operations. > > - Augment the OP_GETCPUINFO request with the number of PMCs present > in a PMC class. > > - Move code common to Intel CPUs to file "hwpmc_intel.c". > > - Move TSC handling to file "hwpmc_tsc.c". Hi Joseph, This seems to cause panics here. The laptop I am using now has an Intel Core2 Duo CPU: : CPU: Intel(R) Core(TM)2 Duo CPU T8100 @ 2.10GHz (2094.76-MHz 686-class CPU) : Origin = "GenuineIntel" Id = 0x10676 Stepping = 6 : Features=0xbfebfbff : Features2=0x8e3bd : AMD Features=0x20100000 : AMD Features2=0x1 : Cores per package: 2 and after this change I get insta-panics when hwpmc is initialized (either as a module or as part of the main kernel), at one of the KASSERT() calls. Attached is the tail of a kgdb session. It seems that the `md' global is set to a NULL pointer when hwpmc_intel.c tries to dereference it: : Script started on Fri Nov 14 11:32:00 2008 : root@kobe:/var/crash# kgdb /boot/kernel/kernel vmcore.8 : GNU gdb 6.1.1 [FreeBSD] : Copyright 2004 Free Software Foundation, Inc. : GDB is free software, covered by the GNU General Public License, and you are : welcome to change it and/or distribute copies of it under certain conditions. : Type "show copying" to see the conditions. : There is absolutely no warranty for GDB. Type "show warranty" for details. : This GDB was configured as "i386-marcel-freebsd"... : : Unread portion of the kernel message buffer: : Copyright (c) 1992-2008 The FreeBSD Project. : Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994 : The Regents of the University of California. All rights reserved. : FreeBSD is a registered trademark of The FreeBSD Foundation. : FreeBSD 8.0-CURRENT #0: Fri Nov 14 01:31:52 EET 2008 : build@kobe:/usr/obj/usr/src/sys/KOBE : WARNING: WITNESS option enabled, expect reduced performance. : Timecounter "i8254" frequency 1193182 Hz quality 0 : CPU: Intel(R) Core(TM)2 Duo CPU T8100 @ 2.10GHz (2094.76-MHz 686-class CPU) : Origin = "GenuineIntel" Id = 0x10676 Stepping = 6 : Features=0xbfebfbff : Features2=0x8e3bd : AMD Features=0x20100000 : AMD Features2=0x1 : Cores per package: 2 : real memory = 3211591680 (3062 MB) : avail memory = 3139604480 (2994 MB) : ACPI APIC Table: : FreeBSD/SMP: Multiprocessor System Detected: 2 CPUs : cpu0 (BSP): APIC ID: 0 : cpu1 (AP): APIC ID: 1 : ioapic0: Changing APIC ID to 1 : ioapic0 irqs 0-23 on motherboard : kbd1 at kbdmux0 : ath_hal: 0.10.5.10 (AR5210, AR5211, AR5212, AR5416, RF5111, RF5112, RF2413, RF5413, RF2133, RF2425, RF2417) : acpi0: on motherboard : acpi0: [ITHREAD] : acpi0: Power Button (fixed) : acpi_hpet0: iomem 0xfed00000-0xfed003ff on acpi0 : Timecounter "HPET" frequency 14318180 Hz quality 900 : Timecounter "ACPI-fast" frequency 3579545 Hz quality 1000 : acpi_timer0: <24-bit timer at 3.579545MHz> port 0x1008-0x100b on acpi0 : acpi_ec0: port 0x62,0x66 on acpi0 : battery0: on acpi0 : acpi_button0: on acpi0 : acpi_button1: on acpi0 : acpi_acad0: on acpi0 : acpi_lid0: on acpi0 : pcib0: port 0xcf8-0xcff on acpi0 : pci0: on pcib0 : vgapci0: port 0x1800-0x1807 mem 0xf0c00000-0xf0cfffff,0xd0000000-0xdfffffff irq 16 at device 2.0 on pci0 : agp0: on vgapci0 : agp0: detected 7676k stolen memory : agp0: aperture size is 256M : vgapci1: mem 0xf0d00000-0xf0dfffff at device 2.1 on pci0 : uhci0: port 0x1820-0x183f irq 16 at device 26.0 on pci0 : uhci0: [GIANT-LOCKED] : uhci0: [ITHREAD] : usb0: on uhci0 : usb0: USB revision 1.0 : uhub0: on usb0 : uhub0: 2 ports with 2 removable, self powered : uhci1: port 0x1840-0x185f irq 21 at device 26.1 on pci0 : uhci1: [GIANT-LOCKED] : uhci1: [ITHREAD] : usb1: on uhci1 : usb1: USB revision 1.0 : uhub1: on usb1 : uhub1: 2 ports with 2 removable, self powered : ehci0: mem 0xf1204000-0xf12043ff irq 18 at device 26.7 on pci0 : ehci0: [GIANT-LOCKED] : ehci0: [ITHREAD] : usb2: EHCI version 1.0 : usb2: companion controllers, 2 ports each: usb0 usb1 : usb2: on ehci0 : usb2: USB revision 2.0 : uhub2: on usb2 : uhub2: 4 ports with 4 removable, self powered : hdac0: mem 0xf1200000-0xf1203fff irq 22 at device 27.0 on pci0 : hdac0: HDA Driver Revision: 20081030_0115 : hdac0: [ITHREAD] : pcib1: irq 17 at device 28.0 on pci0 : pci2: on pcib1 : iwn0: mem 0xf0e00000-0xf0e01fff irq 16 at device 0.0 on pci2 : iwn0: Reg Domain: MoW2, address 00:1f:3b:19:d5:41 : iwn0: [ITHREAD] : iwn0: 11a rates: 6Mbps 9Mbps 12Mbps 18Mbps 24Mbps 36Mbps 48Mbps 54Mbps : iwn0: 11b rates: 1Mbps 2Mbps 5.5Mbps 11Mbps : iwn0: 11g rates: 1Mbps 2Mbps 5.5Mbps 11Mbps 6Mbps 9Mbps 12Mbps 18Mbps 24Mbps 36Mbps 48Mbps 54Mbps : iwn0: 11na MCS: 15Mbps 30Mbps 45Mbps 60Mbps 90Mbps 120Mbps 135Mbps 150Mbps 30Mbps 60Mbps 90Mbps 120Mbps 180Mbps 240Mbps 270Mbps 300Mbps : iwn0: 11ng MCS: 15Mbps 30Mbps 45Mbps 60Mbps 90Mbps 120Mbps 135Mbps 150Mbps 30Mbps 60Mbps 90Mbps 120Mbps 180Mbps 240Mbps 270Mbps 300Mbps : pcib2: irq 16 at device 28.1 on pci0 : pci4: on pcib2 : pcib3: irq 18 at device 28.2 on pci0 : pci6: on pcib3 : pcib4: irq 19 at device 28.3 on pci0 : pci8: on pcib4 : re0: port 0x4000-0x40ff mem 0xf0a00000-0xf0a00fff irq 19 at device 0.0 on pci8 : re0: turning off MSI enable bit. : re0: Chip rev. 0x38000000 : re0: MAC rev. 0x00000000 : miibus0: on re0 : rgephy0: PHY 1 on miibus0 : rgephy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseT, 1000baseT-FDX, auto : re0: Ethernet address: 00:90:f5:6e:05:32 : re0: [FILTER] : pcib5: irq 17 at device 28.4 on pci0 : pci10: on pcib5 : pcib6: irq 16 at device 28.5 on pci0 : pci11: on pcib6 : uhci2: port 0x1860-0x187f irq 23 at device 29.0 on pci0 : uhci2: [GIANT-LOCKED] : uhci2: [ITHREAD] : usb3: on uhci2 : usb3: USB revision 1.0 : uhub3: on usb3 : uhub3: 2 ports with 2 removable, self powered : uhci3: port 0x1880-0x189f irq 19 at device 29.1 on pci0 : uhci3: [GIANT-LOCKED] : uhci3: [ITHREAD] : usb4: on uhci3 : usb4: USB revision 1.0 : uhub4: on usb4 : uhub4: 2 ports with 2 removable, self powered : uhci4: port 0x18a0-0x18bf irq 18 at device 29.2 on pci0 : uhci4: [GIANT-LOCKED] : uhci4: [ITHREAD] : usb5: on uhci4 : usb5: USB revision 1.0 : uhub5: on usb5 : uhub5: 2 ports with 2 removable, self powered : ehci1: mem 0xf1204400-0xf12047ff irq 23 at device 29.7 on pci0 : ehci1: [GIANT-LOCKED] : ehci1: [ITHREAD] : usb6: EHCI version 1.0 : usb6: companion controllers, 2 ports each: usb3 usb4 usb5 : usb6: on ehci1 : usb6: USB revision 2.0 : uhub6: on usb6 : uhub6: 6 ports with 6 removable, self powered : pcib7: at device 30.0 on pci0 : pci12: on pcib7 : pci12: at device 7.0 (no driver attached) : pci12: at device 7.1 (no driver attached) : pci12: at device 7.3 (no driver attached) : fwohci0: port 0x5000-0x507f mem 0xf0f00800-0xf0f00fff irq 19 at device 9.0 on pci12 : fwohci0: [FILTER] : fwohci0: OHCI version 1.10 (ROM=1) : fwohci0: No. of Isochronous channels is 4. : fwohci0: EUI64 00:00:00:00:00:00:43:35 : fwohci0: Phy 1394a available S400, 2 ports. : fwohci0: Link S400, max_rec 2048 bytes. : firewire0: on fwohci0 : dcons_crom0: on firewire0 : dcons_crom0: bus_addr 0x10a8000 : fwe0: on firewire0 : if_fwe0: Fake Ethernet address: 02:00:00:00:43:35 : fwe0: Ethernet address: 02:00:00:00:43:35 : fwip0: on firewire0 : fwip0: Firewire address: 00:00:00:00:00:00:43:35 @ 0xfffe00000000, S400, maxrec 2048 : sbp0: on firewire0 : fwohci0: Initiate bus reset : fwohci0: BUS reset : fwohci0: node_id=0xc000ffc0, gen=1, CYCLEMASTER mode : isab0: at device 31.0 on pci0 : isa0: on isab0 : atapci0: port 0x1f0-0x1f7,0x3f6,0x170-0x177,0x376,0x18e0-0x18ef,0x18d0-0x18df at device 31.2 on pci0 : ata0: on atapci0 : ata0: [ITHREAD] : ata1: on atapci0 : ata1: [ITHREAD] : pci0: at device 31.3 (no driver attached) : acpi_tz0: on acpi0 : atrtc0: port 0x70-0x77 irq 8 on acpi0 : atkbdc0: port 0x60,0x64 irq 1 on acpi0 : atkbd0: irq 1 on atkbdc0 : kbd0 at atkbd0 : atkbd0: [GIANT-LOCKED] : atkbd0: [ITHREAD] : psm0: irq 12 on atkbdc0 : psm0: [GIANT-LOCKED] : psm0: [ITHREAD] : psm0: model Generic PS/2 mouse, device ID 0 : cpu0: on acpi0 : coretemp0: on cpu0 : est0: on cpu0 : p4tcc0: on cpu0 : cpu1: on acpi0 : coretemp1: on cpu1 : est1: on cpu1 : p4tcc1: on cpu1 : pmtimer0 on isa0 : orm0: at iomem 0xcf000-0xcffff,0xe0000-0xe17ff pnpid ORM0000 on isa0 : sc0: at flags 0x100 on isa0 : sc0: VGA <16 virtual consoles, flags=0x300> : vga0: at port 0x3c0-0x3df iomem 0xa0000-0xbffff on isa0 : ums0: on uhub3 : ums0: 3 buttons and Z dir. : Timecounters tick every 1.000 msec : firewire0: 1 nodes, maxhop <= 0, cable IRM = 0 (me) : firewire0: bus manager 0 (me) : ad0: 238475MB at ata0-master SATA150 : acd0: DVDR at ata1-master UDMA33 : hdac0: HDA Codec #0: Realtek ALC883 : hdac0: HDA Codec #1: Unknown Codec : pcm0: at cad 0 nid 1 on hdac0 : pcm1: at cad 0 nid 1 on hdac0 : GEOM_LABEL: Label for provider ad0s1a is ufs/GKEROOT. : GEOM_LABEL: Label for provider ad0s1e is ufs/GKERHOME. : acd0: FAILURE - INQUIRY ILLEGAL REQUEST asc=0x24 ascq=0x00 : acd0: FAILURE - INQUIRY ILLEGAL REQUEST asc=0x24 ascq=0x00 : cd0 at ata1 bus 0 target 0 lun 0 : cd0: Removable CD-ROM SCSI-0 device : cd0: 33.000MB/s transfers : cd0: Attempt to query device size failed: NOT READY, Medium not present - tray closed : SMP: AP CPU #1 Launched! : WARNING: WITNESS option enabled, expect reduced performance. : Trying to mount root from ufs:/dev/ad0s1a : lock order reversal: : 1st 0xc6161044 user map (user map) @ /usr/src/sys/vm/vm_map.c:3115 : 2nd 0xc64f8ad0 ufs (ufs) @ /usr/src/sys/kern/vfs_subr.c:2047 : KDB: stack backtrace: : db_trace_self_wrapper(c093f2b3,c5faf91c,c06652f5,4,c093aaf9,...) at db_trace_self_wrapper+0x26 : kdb_backtrace(4,c093aaf9,c6109728,c610eb40,c5faf978,...) at kdb_backtrace+0x29 : _witness_debugger(c0941f78,c64f8ad0,c0935ee5,c610eb40,c0948d36,...) at _witness_debugger+0x25 : witness_checkorder(c64f8ad0,1,c0948d36,7ff,0,...) at witness_checkorder+0x82b : __lockmgr_args(c64f8ad0,200501,c64f8aec,0,0,...) at __lockmgr_args+0x228 : ffs_lock(c5fafa80,c0961c49,c09355f1,200501,c64f8a78,...) at ffs_lock+0x82 : VOP_LOCK1_APV(c09b62c0,c5fafa80,c09d0080,c64f8a78,200501,...) at VOP_LOCK1_APV+0xa5 : _vn_lock(c64f8a78,200501,c0948d36,7ff,4,...) at _vn_lock+0x5e : vget(c64f8a78,200501,c615dd20,4b4,0,...) at vget+0xcb : vnode_pager_lock(c1477d14,0,c095f20b,127,c5fafc18,...) at vnode_pager_lock+0x1d9 : vm_fault(c6161000,80db000,2,8,80db680,...) at vm_fault+0x1e9 : trap_pfault(5,0,c096c79d,2e7,c615bd0c,...) at trap_pfault+0x119 : trap(c5fafd38) at trap+0x28e : calltrap() at calltrap+0x6 : --- trap 0xc, eip = 0x80480e5, esp = 0xbfbfeef0, ebp = 0xbfbfef10 --- : <118>Enter full pathname of shell or RETURN for : <118>/bin/sh : <118>: : <118># : <118># : <118>swapon: adding /dev/ad0s1b as swap device : <118># : GEOM_LABEL: Label ufs/GKEROOT removed. : <118>/dev/ad0s1a: FILE SYSTEM CLEAN; SKIPPING CHECKS : <118>/dev/ad0s1a: clean, 11717549 free (127621 frags, 1448741 blocks, 0.8% fragmentation) : GEOM_LABEL: Label for provider ad0s1a is ufs/GKEROOT. : GEOM_LABEL: Label ufs/GKERHOME removed. : <118>/dev/ad0s1e: FILE SYSTEM CLEAN; SKIPPING CHECKS : <118>/dev/ad0s1e: clean, 16632049 free (528465 frags, 2012948 blocks, 1.2% fragmentation) : GEOM_LABEL: Label for provider ad0s1e is ufs/GKERHOME. : <118># : <118>k : <118>l : <118>d : <118>l : <118>o : <118>a : <118>d : <118> : <118>h : <118>w : <118>p : <118>m : <118>c : <118> : : : Fatal trap 12: page fault while in kernel mode : cpuid = 1; apic id = 01 : fault virtual address = 0x4 : fault code = supervisor read, page not present : instruction pointer = 0x20:0xc67e7765 : stack pointer = 0x28:0xe8cbe994 : frame pointer = 0x28:0xe8cbe9ac : code segment = base 0x0, limit 0xfffff, type 0x1b : = DPL 0, pres 1, def32 1, gran 1 : processor eflags = interrupt enabled, resume, IOPL = 0 : current process = 63 (kldload) : Physical memory: 3050 MB : Dumping 86 MB: 71 55 39 23 7 : : Reading symbols from /boot/kernel/geom_journal.ko...Reading symbols from /boot/kernel/geom_journal.ko.symbols...done. : done. : Loaded symbols for /boot/kernel/geom_journal.ko : Reading symbols from /boot/kernel/snd_hda.ko...Reading symbols from /boot/kernel/snd_hda.ko.symbols...done. : done. : Loaded symbols for /boot/kernel/snd_hda.ko : Reading symbols from /boot/kernel/sound.ko...Reading symbols from /boot/kernel/sound.ko.symbols...done. : done. : Loaded symbols for /boot/kernel/sound.ko : Reading symbols from /boot/kernel/if_iwn.ko...Reading symbols from /boot/kernel/if_iwn.ko.symbols...done. : done. : Loaded symbols for /boot/kernel/if_iwn.ko : Reading symbols from /boot/kernel/hwpmc.ko...Reading symbols from /boot/kernel/hwpmc.ko.symbols...done. : done. : Loaded symbols for /boot/kernel/hwpmc.ko : #0 doadump () at pcpu.h:246 : 246 pcpu.h: No such file or directory. : in pcpu.h : (kgdb) bt : #0 doadump () at pcpu.h:246 : #1 0xc04c8ad9 in db_fncall (dummy1=1, dummy2=0, dummy3=0, dummy4=0xe8cbe728 "") at /usr/src/sys/ddb/db_command.c:548 : #2 0xc04c8ed1 in db_command (last_cmdp=0xc09d2ddc, cmd_table=0x0, dopager=1) at /usr/src/sys/ddb/db_command.c:445 : #3 0xc04c9035 in db_command_loop () at /usr/src/sys/ddb/db_command.c:498 : #4 0xc04caf3c in db_trap (type=12, code=0) at /usr/src/sys/ddb/db_main.c:229 : #5 0xc0652a51 in kdb_trap (type=12, code=0, tf=0xe8cbe954) at /usr/src/sys/kern/subr_kdb.c:534 : #6 0xc08d117f in trap_fatal (frame=0xe8cbe954, eva=4) at /usr/src/sys/i386/i386/trap.c:920 : #7 0xc08d13cb in trap_pfault (frame=0xe8cbe954, usermode=0, eva=4) at /usr/src/sys/i386/i386/trap.c:842 : #8 0xc08d1e15 in trap (frame=0xe8cbe954) at /usr/src/sys/i386/i386/trap.c:522 : #9 0xc08b598b in calltrap () at /usr/src/sys/i386/i386/exception.s:165 : #10 0xc67e7765 in pmc_intel_initialize () at /usr/src/sys/modules/hwpmc/../../dev/hwpmc/hwpmc_intel.c:171 : #11 0xc67ead82 in pmc_md_initialize () at /usr/src/sys/modules/hwpmc/../../dev/hwpmc/hwpmc_x86.c:258 : #12 0xc67e228c in load (module=0xc6648800, cmd=0, arg=0x0) at /usr/src/sys/modules/hwpmc/../../dev/hwpmc/hwpmc_mod.c:4416 : #13 0xc062ce72 in syscall_module_handler (mod=0xc6648800, what=0, arg=0xc67ef280) at /usr/src/sys/kern/kern_syscalls.c:112 : #14 0xc0615347 in module_register_init (arg=0xc67ef230) at /usr/src/sys/kern/kern_module.c:124 : #15 0xc060cdb5 in linker_load_module (kldname=Variable "kldname" is not available. : ) at /usr/src/sys/kern/kern_linker.c:232 : #16 0xc060d26c in kern_kldload (td=0xc668d8c0, file=0xc666f800 "hwpmc", fileid=0xe8cbec70) at /usr/src/sys/kern/kern_linker.c:974 : #17 0xc060d3a4 in kldload (td=0xc668d8c0, uap=0xe8cbecf8) at /usr/src/sys/kern/kern_linker.c:1001 : #18 0xc08d16c3 in syscall (frame=0xe8cbed38) at /usr/src/sys/i386/i386/trap.c:1076 : #19 0xc08b59f0 in Xint0x80_syscall () at /usr/src/sys/i386/i386/exception.s:261 : #20 0x00000033 in ?? () : Previous frame inner to this frame (corrupt stack?) : (kgdb) up 10 : #10 0xc67e7765 in pmc_intel_initialize () at /usr/src/sys/modules/hwpmc/../../dev/hwpmc/hwpmc_intel.c:171 : 171 KASSERT(md->pmd_npmc == TSC_NPMCS + P6_NPMCS, ("[intel,%d] " : (kgdb) list : 166 case PMC_CPU_INTEL_PII: : 167 case PMC_CPU_INTEL_PIII: : 168 case PMC_CPU_INTEL_PM: : 169 error = pmc_p6_initialize(pmc_mdep, ncpus); : 170 : 171 KASSERT(md->pmd_npmc == TSC_NPMCS + P6_NPMCS, ("[intel,%d] " : 172 "incorrect npmc count %d", __LINE__, md->pmd_npmc)); : 173 break; : 174 : 175 /* : Cannot access memory at address 0x0 : (kgdb) p md : $1 = (struct pmc_mdep *) 0x0 From owner-svn-src-head@FreeBSD.ORG Fri Nov 14 18:35:10 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5A09D1065673; Fri, 14 Nov 2008 18:35:10 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mail.cksoft.de (mail.cksoft.de [62.111.66.27]) by mx1.freebsd.org (Postfix) with ESMTP id DF4398FC18; Fri, 14 Nov 2008 18:35:09 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from localhost (amavis.str.cksoft.de [192.168.74.71]) by mail.cksoft.de (Postfix) with ESMTP id 56C4941C707; Fri, 14 Nov 2008 19:35:08 +0100 (CET) X-Virus-Scanned: amavisd-new at cksoft.de Received: from mail.cksoft.de ([62.111.66.27]) by localhost (amavis.str.cksoft.de [192.168.74.71]) (amavisd-new, port 10024) with ESMTP id cMy9vwq5dm5f; Fri, 14 Nov 2008 19:35:05 +0100 (CET) Received: by mail.cksoft.de (Postfix, from userid 66) id C8E9041C6DB; Fri, 14 Nov 2008 19:35:05 +0100 (CET) Received: from maildrop.int.zabbadoz.net (maildrop.int.zabbadoz.net [10.111.66.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.int.zabbadoz.net (Postfix) with ESMTP id 1924A444888; Fri, 14 Nov 2008 18:31:10 +0000 (UTC) Date: Fri, 14 Nov 2008 18:31:10 +0000 (UTC) From: "Bjoern A. Zeeb" X-X-Sender: bz@maildrop.int.zabbadoz.net To: Paul Saab In-Reply-To: <200811140156.mAE1uB0S075392@svn.freebsd.org> Message-ID: <20081114182000.Y43380@maildrop.int.zabbadoz.net> References: <200811140156.mAE1uB0S075392@svn.freebsd.org> X-OpenPGP-Key: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Kip Macy Subject: Re: svn commit: r184950 - in head/sys/modules/cxgb: iw_cxgb toecore X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Nov 2008 18:35:10 -0000 On Fri, 14 Nov 2008, Paul Saab wrote: > Author: ps > Date: Fri Nov 14 01:56:11 2008 > New Revision: 184950 > URL: http://svn.freebsd.org/changeset/base/184950 > > Log: > Fix world This commit message isn't really helpful. I guess what was broken was building those two modules individually by hand? I can only guess here:( I guess it's all realted to my #ifdef INET or rather to the conditional include of opt_inet.h in cxgb_osdep.h. I just had a hard time to figure out why those two modules would actually need it and from what I can see it's possibly because they include cxgb_include.h which indirectly includes a good list of headers and cxgb_osdep.h is one of them. Now the define for LRO_SUPPORTED is not needed anythere there, so a better fix would be to handle that case different? By all means I cannot figure out how the including of headers in cxgb was meant to work but that's probably a result of staying close to vendor code and in some areas and doing only minimalistic changes for FreeBSD? On a side note I just realized that there is: ./ulp/tom/cxgb_tcp.h:#ifdef INET6 but obviously is dead code because we nowhere depend on/include opt_inet6.h which in turn does not matter as there is no cxgb_tcp6_usrreqs anywhere from what I can see. > Approved by: kmacy > > Modified: > head/sys/modules/cxgb/iw_cxgb/Makefile > head/sys/modules/cxgb/toecore/Makefile > > Modified: head/sys/modules/cxgb/iw_cxgb/Makefile > ============================================================================== > --- head/sys/modules/cxgb/iw_cxgb/Makefile Fri Nov 14 01:53:10 2008 (r184949) > +++ head/sys/modules/cxgb/iw_cxgb/Makefile Fri Nov 14 01:56:11 2008 (r184950) > @@ -7,7 +7,7 @@ KMOD= iw_cxgb > SRCS= iw_cxgb.c iw_cxgb_cm.c iw_cxgb_hal.c > SRCS+= iw_cxgb_provider.c iw_cxgb_qp.c iw_cxgb_resource.c > SRCS+= iw_cxgb_ev.c iw_cxgb_mem.c iw_cxgb_dbg.c iw_cxgb_cq.c > -SRCS+= bus_if.h device_if.h opt_sched.h pci_if.h pcib_if.h opt_ktr.h > +SRCS+= bus_if.h device_if.h opt_sched.h pci_if.h pcib_if.h opt_ktr.h opt_inet.h > CFLAGS+= -g -I${CXGB} > #CFLAGS+= -DDEBUG > > > Modified: head/sys/modules/cxgb/toecore/Makefile > ============================================================================== > --- head/sys/modules/cxgb/toecore/Makefile Fri Nov 14 01:53:10 2008 (r184949) > +++ head/sys/modules/cxgb/toecore/Makefile Fri Nov 14 01:56:11 2008 (r184950) > @@ -5,7 +5,7 @@ CXGB = ${.CURDIR}/../../../dev/cxgb > > KMOD= toecore > SRCS= toedev.c > -SRCS+= device_if.h bus_if.h pci_if.h opt_sched.h > +SRCS+= device_if.h bus_if.h pci_if.h opt_sched.h opt_inet.h > CFLAGS+= -g -I${CXGB} > > .include > -- Bjoern A. Zeeb Stop bit received. Insert coin for new game. From owner-svn-src-head@FreeBSD.ORG Fri Nov 14 21:05:46 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2F7671065686; Fri, 14 Nov 2008 21:05:46 +0000 (UTC) (envelope-from ambrisko@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 213D68FC1B; Fri, 14 Nov 2008 21:05:46 +0000 (UTC) (envelope-from ambrisko@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mAEL5jv9001887; Fri, 14 Nov 2008 21:05:45 GMT (envelope-from ambrisko@svn.freebsd.org) Received: (from ambrisko@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mAEL5jsL001886; Fri, 14 Nov 2008 21:05:45 GMT (envelope-from ambrisko@svn.freebsd.org) Message-Id: <200811142105.mAEL5jsL001886@svn.freebsd.org> From: Doug Ambrisko Date: Fri, 14 Nov 2008 21:05: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: r184974 - head/sys/dev/mfi X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Nov 2008 21:05:46 -0000 Author: ambrisko Date: Fri Nov 14 21:05:45 2008 New Revision: 184974 URL: http://svn.freebsd.org/changeset/base/184974 Log: When running a 32bit app. on amd64, ensure the bits above 32bit are zero for the copyout. Confirmed by LSI. Modified: head/sys/dev/mfi/mfi.c Modified: head/sys/dev/mfi/mfi.c ============================================================================== --- head/sys/dev/mfi/mfi.c Fri Nov 14 18:09:19 2008 (r184973) +++ head/sys/dev/mfi/mfi.c Fri Nov 14 21:05:45 2008 (r184974) @@ -2130,6 +2130,14 @@ mfi_ioctl(struct cdev *dev, u_long cmd, ->mfi_frame.raw[ioc->mfi_sense_off], &sense_ptr.sense_ptr_data[0], sizeof(sense_ptr.sense_ptr_data)); +#ifdef __amd64__ + if (cmd != MFI_CMD) { + /* + * not 64bit native so zero out any address + * over 32bit */ + sense_ptr.high = 0; + } +#endif error = copyout(cm->cm_sense, sense_ptr.user_space, ioc->mfi_sense_len); if (error != 0) { @@ -2353,6 +2361,13 @@ mfi_linux_ioctl_int(struct cdev *dev, u_ ->lioc_frame.raw[l_ioc.lioc_sense_off], &sense_ptr.sense_ptr_data[0], sizeof(sense_ptr.sense_ptr_data)); +#ifdef __amd64__ + /* + * only 32bit Linux support so zero out any + * address over 32bit + */ + sense_ptr.high = 0; +#endif error = copyout(cm->cm_sense, sense_ptr.user_space, l_ioc.lioc_sense_len); if (error != 0) { From owner-svn-src-head@FreeBSD.ORG Fri Nov 14 23:32:32 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6CDC41065677; Fri, 14 Nov 2008 23:32:32 +0000 (UTC) (envelope-from ambrisko@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 50FDE8FC13; Fri, 14 Nov 2008 23:32:32 +0000 (UTC) (envelope-from ambrisko@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mAENWVMp004467; Fri, 14 Nov 2008 23:32:31 GMT (envelope-from ambrisko@svn.freebsd.org) Received: (from ambrisko@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mAENWVB0004466; Fri, 14 Nov 2008 23:32:31 GMT (envelope-from ambrisko@svn.freebsd.org) Message-Id: <200811142332.mAENWVB0004466@svn.freebsd.org> From: Doug Ambrisko Date: Fri, 14 Nov 2008 23:32: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: r184975 - head/sys/dev/mfi X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Nov 2008 23:32:32 -0000 Author: ambrisko Date: Fri Nov 14 23:32:31 2008 New Revision: 184975 URL: http://svn.freebsd.org/changeset/base/184975 Log: Fix compile. I was in the wrong tree when I tested it :-( Pointed out by: Andrzej Modified: head/sys/dev/mfi/mfi.c Modified: head/sys/dev/mfi/mfi.c ============================================================================== --- head/sys/dev/mfi/mfi.c Fri Nov 14 21:05:45 2008 (r184974) +++ head/sys/dev/mfi/mfi.c Fri Nov 14 23:32:31 2008 (r184975) @@ -2135,7 +2135,7 @@ mfi_ioctl(struct cdev *dev, u_long cmd, /* * not 64bit native so zero out any address * over 32bit */ - sense_ptr.high = 0; + sense_ptr.addr.high = 0; } #endif error = copyout(cm->cm_sense, sense_ptr.user_space, @@ -2366,7 +2366,7 @@ mfi_linux_ioctl_int(struct cdev *dev, u_ * only 32bit Linux support so zero out any * address over 32bit */ - sense_ptr.high = 0; + sense_ptr.addr.high = 0; #endif error = copyout(cm->cm_sense, sense_ptr.user_space, l_ioc.lioc_sense_len); From owner-svn-src-head@FreeBSD.ORG Sat Nov 15 01:43:34 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7F123106564A; Sat, 15 Nov 2008 01:43:34 +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 5D1CC8FC24; Sat, 15 Nov 2008 01:43:34 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mAF1hYr4006886; Sat, 15 Nov 2008 01:43:34 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mAF1hYPh006885; Sat, 15 Nov 2008 01:43:34 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <200811150143.mAF1hYPh006885@svn.freebsd.org> From: Jung-uk Kim Date: Sat, 15 Nov 2008 01:43: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: r184976 - head/sys/dev/fdc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Nov 2008 01:43:34 -0000 Author: jkim Date: Sat Nov 15 01:43:34 2008 New Revision: 184976 URL: http://svn.freebsd.org/changeset/base/184976 Log: - Revive fdc(4) per-device flag 0x10, which was removed in r1.284[1]. - If the flag is set and auto-select fails, assume disk is not present. - Set disk empty flag only when the floppy controller reset is needed. It fixes regression introduced in r1.311, which prevented it from ignoring errors. Now fdformat(1) and dd(1) with conv=noerror option can continue when read/write errors occur as they should. - Do not retry disk probing as it is extremely slow and pointless. - Move the disk probing code into a separate function. - Do not reset disk empty flag if write-protect check fails somehow. PR: kern/116538[1] Modified: head/sys/dev/fdc/fdc.c Modified: head/sys/dev/fdc/fdc.c ============================================================================== --- head/sys/dev/fdc/fdc.c Fri Nov 14 23:32:31 2008 (r184975) +++ head/sys/dev/fdc/fdc.c Sat Nov 15 01:43:34 2008 (r184976) @@ -97,6 +97,8 @@ __FBSDID("$FreeBSD$"); * fd_drivetype; on i386 machines, if * given as 0, use RTC type for fd0 * and fd1 */ +#define FD_NO_CHLINE 0x10 /* drive does not support changeline + * aka. unit attention */ #define FD_NO_PROBE 0x20 /* don't probe drive (seek test), just * assume it is there */ @@ -263,6 +265,7 @@ struct fd_data { static driver_intr_t fdc_intr; static driver_filter_t fdc_intr_fast; static void fdc_reset(struct fdc_data *); +static int fd_probe_disk(struct fd_data *, int *); SYSCTL_NODE(_debug, OID_AUTO, fdc, CTLFLAG_RW, 0, "fdc driver"); @@ -768,9 +771,11 @@ fdc_worker(struct fdc_data *fdc) (fdc->retry >= retries || (fd->options & FDOPT_NORETRY))) { if ((debugflags & 4)) printf("Too many retries (EIO)\n"); - mtx_lock(&fdc->fdc_mtx); - fd->flags |= FD_EMPTY; - mtx_unlock(&fdc->fdc_mtx); + if (fdc->flags & FDC_NEEDS_RESET) { + mtx_lock(&fdc->fdc_mtx); + fd->flags |= FD_EMPTY; + mtx_unlock(&fdc->fdc_mtx); + } return (fdc_biodone(fdc, EIO)); } @@ -836,65 +841,12 @@ fdc_worker(struct fdc_data *fdc) fdctl_wr(fdc, fd->ft->trans); if (bp->bio_cmd & BIO_PROBE) { - - if (!(fdin_rd(fdc) & FDI_DCHG) && !(fd->flags & FD_EMPTY)) + if ((!(device_get_flags(fd->dev) & FD_NO_CHLINE) && + !(fdin_rd(fdc) & FDI_DCHG) && + !(fd->flags & FD_EMPTY)) || + fd_probe_disk(fd, &need_recal) == 0) return (fdc_biodone(fdc, 0)); - - /* - * Try to find out if we have a disk in the drive - * - * First recal, then seek to cyl#1, this clears the - * old condition on the disk change line so we can - * examine it for current status - */ - if (debugflags & 0x40) - printf("New disk in probe\n"); - mtx_lock(&fdc->fdc_mtx); - fd->flags |= FD_NEWDISK; - mtx_unlock(&fdc->fdc_mtx); - retry_line = __LINE__; - if (fdc_cmd(fdc, 2, NE7CMD_RECAL, fd->fdsu, 0)) - return (1); - tsleep(fdc, PRIBIO, "fdrecal", hz); - retry_line = __LINE__; - if (fdc_sense_int(fdc, &st0, &cyl) == FD_NOT_VALID) - return (1); /* XXX */ - retry_line = __LINE__; - if ((st0 & 0xc0) || cyl != 0) - return (1); - - /* Seek to track 1 */ - retry_line = __LINE__; - if (fdc_cmd(fdc, 3, NE7CMD_SEEK, fd->fdsu, 1, 0)) - return (1); - tsleep(fdc, PRIBIO, "fdseek", hz); - retry_line = __LINE__; - if (fdc_sense_int(fdc, &st0, &cyl) == FD_NOT_VALID) - return (1); /* XXX */ - need_recal |= (1 << fd->fdsu); - if (fdin_rd(fdc) & FDI_DCHG) { - if (debugflags & 0x40) - printf("Empty in probe\n"); - mtx_lock(&fdc->fdc_mtx); - fd->flags |= FD_EMPTY; - mtx_unlock(&fdc->fdc_mtx); - } else { - if (debugflags & 0x40) - printf("Got disk in probe\n"); - mtx_lock(&fdc->fdc_mtx); - fd->flags &= ~FD_EMPTY; - mtx_unlock(&fdc->fdc_mtx); - retry_line = __LINE__; - if(fdc_sense_drive(fdc, &st3) != 0) - return (1); - mtx_lock(&fdc->fdc_mtx); - if(st3 & NE7_ST3_WP) - fd->flags |= FD_WP; - else - fd->flags &= ~FD_WP; - mtx_unlock(&fdc->fdc_mtx); - } - return (fdc_biodone(fdc, 0)); + return (1); } /* @@ -1238,6 +1190,71 @@ fd_enqueue(struct fd_data *fd, struct bi mtx_unlock(&fdc->fdc_mtx); } +/* + * Try to find out if we have a disk in the drive. + */ +static int +fd_probe_disk(struct fd_data *fd, int *recal) +{ + struct fdc_data *fdc; + int st0, st3, cyl; + int oopts, ret; + + fdc = fd->fdc; + oopts = fd->options; + fd->options |= FDOPT_NOERRLOG | FDOPT_NORETRY; + ret = 1; + + /* + * First recal, then seek to cyl#1, this clears the old condition on + * the disk change line so we can examine it for current status. + */ + if (debugflags & 0x40) + printf("New disk in probe\n"); + mtx_lock(&fdc->fdc_mtx); + fd->flags |= FD_NEWDISK; + mtx_unlock(&fdc->fdc_mtx); + if (fdc_cmd(fdc, 2, NE7CMD_RECAL, fd->fdsu, 0)) + goto done; + tsleep(fdc, PRIBIO, "fdrecal", hz); + if (fdc_sense_int(fdc, &st0, &cyl) == FD_NOT_VALID) + goto done; /* XXX */ + if ((st0 & 0xc0) || cyl != 0) + goto done; + + /* Seek to track 1 */ + if (fdc_cmd(fdc, 3, NE7CMD_SEEK, fd->fdsu, 1, 0)) + goto done; + tsleep(fdc, PRIBIO, "fdseek", hz); + if (fdc_sense_int(fdc, &st0, &cyl) == FD_NOT_VALID) + goto done; /* XXX */ + *recal |= (1 << fd->fdsu); + if (fdin_rd(fdc) & FDI_DCHG) { + if (debugflags & 0x40) + printf("Empty in probe\n"); + mtx_lock(&fdc->fdc_mtx); + fd->flags |= FD_EMPTY; + mtx_unlock(&fdc->fdc_mtx); + } else { + if (fdc_sense_drive(fdc, &st3) != 0) + goto done; + if (debugflags & 0x40) + printf("Got disk in probe\n"); + mtx_lock(&fdc->fdc_mtx); + fd->flags &= ~FD_EMPTY; + if (st3 & NE7_ST3_WP) + fd->flags |= FD_WP; + else + fd->flags &= ~FD_WP; + mtx_unlock(&fdc->fdc_mtx); + } + ret = 0; + +done: + fd->options = oopts; + return (ret); +} + static int fdmisccmd(struct fd_data *fd, u_int cmd, void *data) { @@ -1350,7 +1367,7 @@ fdautoselect(struct fd_data *fd) if (debugflags & 0x40) device_printf(fd->dev, "autoselection failed\n"); fdsettype(fd, fd_native_types[fd->type]); - return (0); + return (-1); } else { if (debugflags & 0x40) { device_printf(fd->dev, @@ -1411,7 +1428,13 @@ fd_access(struct g_provider *pp, int r, if (fd->flags & FD_EMPTY) return (ENXIO); if (fd->flags & FD_NEWDISK) { - fdautoselect(fd); + if (fdautoselect(fd) != 0 && + (device_get_flags(fd->dev) & FD_NO_CHLINE)) { + mtx_lock(&fdc->fdc_mtx); + fd->flags |= FD_EMPTY; + mtx_unlock(&fdc->fdc_mtx); + return (ENXIO); + } mtx_lock(&fdc->fdc_mtx); fd->flags &= ~FD_NEWDISK; mtx_unlock(&fdc->fdc_mtx); From owner-svn-src-head@FreeBSD.ORG Sat Nov 15 04:43:54 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 772081065670; Sat, 15 Nov 2008 04:43:54 +0000 (UTC) (envelope-from gshapiro@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 619518FC18; Sat, 15 Nov 2008 04:43:54 +0000 (UTC) (envelope-from gshapiro@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mAF4hsJ4010649; Sat, 15 Nov 2008 04:43:54 GMT (envelope-from gshapiro@svn.freebsd.org) Received: (from gshapiro@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mAF4hsMG010648; Sat, 15 Nov 2008 04:43:54 GMT (envelope-from gshapiro@svn.freebsd.org) Message-Id: <200811150443.mAF4hsMG010648@svn.freebsd.org> From: Gregory Neil Shapiro Date: Sat, 15 Nov 2008 04:43: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: r184980 - in head/contrib/sendmail: . src X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Nov 2008 04:43:54 -0000 Author: gshapiro Date: Sat Nov 15 04:43:54 2008 New Revision: 184980 URL: http://svn.freebsd.org/changeset/base/184980 Log: Merge from vendor dist: Bring in a change already in the sendmail repository that will allow sendmail to be built with the c99 compiler. Submitted by: rdivacky Modified: head/contrib/sendmail/ (props changed) head/contrib/sendmail/src/sendmail.h Modified: head/contrib/sendmail/src/sendmail.h ============================================================================== --- head/contrib/sendmail/src/sendmail.h Sat Nov 15 04:38:10 2008 (r184979) +++ head/contrib/sendmail/src/sendmail.h Sat Nov 15 04:43:54 2008 (r184980) @@ -2642,7 +2642,7 @@ extern void unsetenv __P((char *)); /* update file system information: +/- some blocks */ #if SM_CONF_SHM -extern void upd_qs __P((ENVELOPE *, bool, bool, char *)); +extern void upd_qs __P((ENVELOPE *, int, int, char *)); # define updfs(e, count, space, where) upd_qs(e, count, space, where) #else /* SM_CONF_SHM */ # define updfs(e, count, space, where) From owner-svn-src-head@FreeBSD.ORG Sat Nov 15 05:22:06 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A65F41065670; Sat, 15 Nov 2008 05:22:06 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8FB808FC0A; Sat, 15 Nov 2008 05:22:06 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mAF5M66L011344; Sat, 15 Nov 2008 05:22:06 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mAF5M6CB011341; Sat, 15 Nov 2008 05:22:06 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200811150522.mAF5M6CB011341@svn.freebsd.org> From: Warner Losh Date: Sat, 15 Nov 2008 05:22: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: r184981 - head/sys/dev/cardbus X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Nov 2008 05:22:06 -0000 Author: imp Date: Sat Nov 15 05:22:06 2008 New Revision: 184981 URL: http://svn.freebsd.org/changeset/base/184981 Log: First step in cleaning up CIS parsing and /dev/cardbus*.cis: remove redundant malloc/free. Add comments about how this should really be done. Fix an overly verbose comment about under 1MB mapping: go ahead and set the bits, but we ignore them. Modified: head/sys/dev/cardbus/cardbus_cis.c head/sys/dev/cardbus/cardbus_device.c head/sys/dev/cardbus/cardbusvar.h Modified: head/sys/dev/cardbus/cardbus_cis.c ============================================================================== --- head/sys/dev/cardbus/cardbus_cis.c Sat Nov 15 04:43:54 2008 (r184980) +++ head/sys/dev/cardbus/cardbus_cis.c Sat Nov 15 05:22:06 2008 (r184981) @@ -318,29 +318,27 @@ decode_tuple_bar(device_t cbdev, device_ if (type == SYS_RES_MEMORY) { if (reg & TPL_BAR_REG_PREFETCHABLE) dinfo->mprefetchable |= (1 << PCI_RID2BAR(bar)); -#if 0 /* - * XXX: It appears from a careful reading of the spec - * that we're not supposed to honor this when the bridge - * is not on the main system bus. PCI spec doesn't appear - * to allow for memory ranges not listed in the bridge's - * decode range to be decoded. The PC Card spec seems to - * indicate that this should only be done on x86 based - * machines, which seems to imply that on non-x86 machines - * the adddresses can be anywhere. This further implies that - * since the hardware can do it on non-x86 machines, it should - * be able to do it on x86 machines. Therefore, we can and - * should ignore this hint. Furthermore, the PC Card spec - * recommends always allocating memory above 1MB, contradicting - * the other part of the PC Card spec. + * The PC Card spec says we're only supposed to honor this + * hint when the cardbus bridge is a child of pci0 (the main + * bus). The PC Card spec seems to indicate that this should + * only be done on x86 based machines, which suggests that on + * non-x86 machines the adddresses can be anywhere. Since the + * hardware can do it on non-x86 machines, it should be able + * to do it on x86 machines too. Therefore, we can and should + * ignore this hint. Furthermore, the PC Card spec recommends + * always allocating memory above 1MB, contradicting the other + * part of the PC Card spec, it seems. We make note of it, + * but otherwise don't use this information. * - * NetBSD ignores this bit, but it also ignores the - * prefetchable bit too, so that's not an indication of - * correctness. + * Some Realtek cards have this set in their CIS, but fail + * to actually work when mapped this way, and experience + * has shown ignoring this big to be a wise choice. + * + * XXX We should cite chapter and verse for standard refs. */ if (reg & TPL_BAR_REG_BELOW1MB) dinfo->mbelow1mb |= (1 << PCI_RID2BAR(bar)); -#endif } return (0); Modified: head/sys/dev/cardbus/cardbus_device.c ============================================================================== --- head/sys/dev/cardbus/cardbus_device.c Sat Nov 15 04:43:54 2008 (r184980) +++ head/sys/dev/cardbus/cardbus_device.c Sat Nov 15 05:22:06 2008 (r184981) @@ -96,13 +96,17 @@ cardbus_build_cis(device_t cbdev, device * CISTPL_END is a special case, it has no length field. */ if (id == CISTPL_END) { - if (cis->len + 1 > sizeof(cis->buffer)) + if (cis->len + 1 > sizeof(cis->buffer)) { + cis->len = 0; return (ENOSPC); + } cis->buffer[cis->len++] = id; return (0); } - if (cis->len + 2 + len > sizeof(cis->buffer)) + if (cis->len + 2 + len > sizeof(cis->buffer)) { + cis->len = 0; return (ENOSPC); + } cis->buffer[cis->len++] = id; cis->buffer[cis->len++] = len; for (i = 0; i < len; i++) @@ -110,6 +114,18 @@ cardbus_build_cis(device_t cbdev, device return (0); } +static int +cardbus_device_buffer_cis(device_t parent, device_t child) +{ + struct cardbus_softc *sc; + struct tuple_callbacks cb[] = { + {CISTPL_GENERIC, "GENERIC", cardbus_build_cis} + }; + + sc = device_get_softc(parent); + return (cardbus_parse_cis(parent, child, cb, &sc->sc_cis)); +} + static int cardbus_open(struct cdev *dev, int oflags, int devtype, struct thread *td) { @@ -117,9 +133,6 @@ cardbus_open(struct cdev *dev, int oflag device_t *kids; int cnt, err; struct cardbus_softc *sc; - struct tuple_callbacks cb[] = { - {CISTPL_GENERIC, "GENERIC", cardbus_build_cis} - }; sc = dev->si_drv1; if (sc->sc_cis_open) @@ -128,21 +141,17 @@ cardbus_open(struct cdev *dev, int oflag err = device_get_children(parent, &kids, &cnt); if (err) return err; + sc->sc_cis.len = 0; if (cnt == 0) { free(kids, M_TEMP); sc->sc_cis_open++; - sc->sc_cis = NULL; return (0); } child = kids[0]; free(kids, M_TEMP); - sc->sc_cis = malloc(sizeof(*sc->sc_cis), M_TEMP, M_ZERO | M_WAITOK); - err = cardbus_parse_cis(parent, child, cb, sc->sc_cis); - if (err) { - free(sc->sc_cis, M_TEMP); - sc->sc_cis = NULL; + err = cardbus_device_buffer_cis(parent, child); + if (err) return (err); - } sc->sc_cis_open++; return (0); } @@ -153,8 +162,6 @@ cardbus_close(struct cdev *dev, int ffla struct cardbus_softc *sc; sc = dev->si_drv1; - free(sc->sc_cis, M_TEMP); - sc->sc_cis = NULL; sc->sc_cis_open = 0; return (0); } @@ -173,8 +180,8 @@ cardbus_read(struct cdev *dev, struct ui sc = dev->si_drv1; /* EOF */ - if (sc->sc_cis == NULL || uio->uio_offset > sc->sc_cis->len) + if (uio->uio_offset >= sc->sc_cis.len) return (0); - return (uiomove(sc->sc_cis->buffer + uio->uio_offset, - MIN(uio->uio_resid, sc->sc_cis->len - uio->uio_offset), uio)); + return (uiomove(sc->sc_cis.buffer + uio->uio_offset, + MIN(uio->uio_resid, sc->sc_cis.len - uio->uio_offset), uio)); } Modified: head/sys/dev/cardbus/cardbusvar.h ============================================================================== --- head/sys/dev/cardbus/cardbusvar.h Sat Nov 15 04:43:54 2008 (r184980) +++ head/sys/dev/cardbus/cardbusvar.h Sat Nov 15 05:22:06 2008 (r184981) @@ -34,7 +34,6 @@ struct cardbus_devinfo struct pci_devinfo pci; uint8_t mprefetchable; /* bit mask of prefetchable BARs */ uint8_t mbelow1mb; /* bit mask of BARs which require below 1Mb */ - uint8_t ibelow1mb; /* bit mask of BARs which require below 1Mb */ uint16_t mfrid; /* manufacturer id */ uint16_t prodid; /* product id */ u_int funcid; /* function id */ @@ -54,10 +53,10 @@ struct cis_buffer struct cardbus_softc { - /* XXX need mutex XXX */ device_t sc_dev; + /* The following fields should in be in struct cardbus_devinfo */ struct cdev *sc_cisdev; - struct cis_buffer *sc_cis; + struct cis_buffer sc_cis; int sc_cis_open; }; From owner-svn-src-head@FreeBSD.ORG Sat Nov 15 06:36:08 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 087271065688; Sat, 15 Nov 2008 06:36:08 +0000 (UTC) (envelope-from keramida@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E54218FC1A; Sat, 15 Nov 2008 06:36:07 +0000 (UTC) (envelope-from keramida@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mAF6a7Z6012753; Sat, 15 Nov 2008 06:36:07 GMT (envelope-from keramida@svn.freebsd.org) Received: (from keramida@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mAF6a7sk012752; Sat, 15 Nov 2008 06:36:07 GMT (envelope-from keramida@svn.freebsd.org) Message-Id: <200811150636.mAF6a7sk012752@svn.freebsd.org> From: Giorgos Keramidas Date: Sat, 15 Nov 2008 06: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: r184984 - head/usr.sbin/zic X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Nov 2008 06:36:08 -0000 Author: keramida (doc committer) Date: Sat Nov 15 06:36:07 2008 New Revision: 184984 URL: http://svn.freebsd.org/changeset/base/184984 Log: Add missing quotes to .Dl arguments. This is harmless for the mandoc output, but it makes syntax highlighting of the .Dl argument string a bit prettier in Emacs. Modified: head/usr.sbin/zic/zic.8 Modified: head/usr.sbin/zic/zic.8 ============================================================================== --- head/usr.sbin/zic/zic.8 Sat Nov 15 06:02:42 2008 (r184983) +++ head/usr.sbin/zic/zic.8 Sat Nov 15 06:36:07 2008 (r184984) @@ -120,9 +120,9 @@ Non-blank lines are expected to be of on rule lines, zone lines, and link lines. .Pp A rule line has the form: -.Dl "Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +.Dl "Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S" For example: -.Dl "Rule US 1967 1973 \- Apr lastSun 2:00 1:00 D +.Dl "Rule US 1967 1973 \- Apr lastSun 2:00 1:00 D" .Pp The fields that make up a rule line are: .Bl -tag -width "LETTER/S" -offset indent @@ -260,9 +260,9 @@ the variable part is null. .El .Pp A zone line has the form: -.Dl "Zone NAME GMTOFF RULES/SAVE FORMAT [UNTIL] +.Dl "Zone NAME GMTOFF RULES/SAVE FORMAT [UNTIL]" For example: -.Dl "Zone Australia/Adelaide 9:30 Aus CST 1971 Oct 31 2:00 +.Dl "Zone Australia/Adelaide 9:30 Aus CST 1971 Oct 31 2:00" The fields that make up a zone line are: .Bl -tag -width indent .It NAME From owner-svn-src-head@FreeBSD.ORG Sat Nov 15 06:41:58 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5D7681065690; Sat, 15 Nov 2008 06:41:58 +0000 (UTC) (envelope-from keramida@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4650A8FC14; Sat, 15 Nov 2008 06:41:58 +0000 (UTC) (envelope-from keramida@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mAF6fwnL012889; Sat, 15 Nov 2008 06:41:58 GMT (envelope-from keramida@svn.freebsd.org) Received: (from keramida@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mAF6fwOF012888; Sat, 15 Nov 2008 06:41:58 GMT (envelope-from keramida@svn.freebsd.org) Message-Id: <200811150641.mAF6fwOF012888@svn.freebsd.org> From: Giorgos Keramidas Date: Sat, 15 Nov 2008 06:41: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: r184985 - head/usr.sbin/zic X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Nov 2008 06:41:58 -0000 Author: keramida (doc committer) Date: Sat Nov 15 06:41:57 2008 New Revision: 184985 URL: http://svn.freebsd.org/changeset/base/184985 Log: Finish a few more .Dl "quoted" arguments missed in revision 184984 Modified: head/usr.sbin/zic/zic.8 Modified: head/usr.sbin/zic/zic.8 ============================================================================== --- head/usr.sbin/zic/zic.8 Sat Nov 15 06:36:07 2008 (r184984) +++ head/usr.sbin/zic/zic.8 Sat Nov 15 06:41:57 2008 (r184985) @@ -319,9 +319,9 @@ continuation. .El .Pp A link line has the form -.Dl "Link LINK-FROM LINK-TO +.Dl "Link LINK-FROM LINK-TO" For example: -.Dl "Link Europe/Istanbul Asia/Istanbul +.Dl "Link Europe/Istanbul Asia/Istanbul" The .Em LINK-FROM field should appear as the @@ -335,9 +335,9 @@ Except for continuation lines, lines may appear in any order in the input. .Pp Lines in the file that describes leap seconds have the following form: -.Dl "Leap YEAR MONTH DAY HH:MM:SS CORR R/S +.Dl "Leap YEAR MONTH DAY HH:MM:SS CORR R/S" For example: -.Dl "Leap 1974 Dec 31 23:59:60 + S +.Dl "Leap 1974 Dec 31 23:59:60 + S" The .Em YEAR , .Em MONTH , From owner-svn-src-head@FreeBSD.ORG Sat Nov 15 09:23:49 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A71FE1065691; Sat, 15 Nov 2008 09:23:49 +0000 (UTC) (envelope-from rafan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 90C9B8FC13; Sat, 15 Nov 2008 09:23:49 +0000 (UTC) (envelope-from rafan@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mAF9NnBY015853; Sat, 15 Nov 2008 09:23:49 GMT (envelope-from rafan@svn.freebsd.org) Received: (from rafan@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mAF9NnsG015847; Sat, 15 Nov 2008 09:23:49 GMT (envelope-from rafan@svn.freebsd.org) Message-Id: <200811150923.mAF9NnsG015847@svn.freebsd.org> From: Rong-En Fan Date: Sat, 15 Nov 2008 09:23: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: r184989 - in head: contrib/ncurses contrib/ncurses/doc/html contrib/ncurses/form contrib/ncurses/include contrib/ncurses/man contrib/ncurses/menu contrib/ncurses/misc contrib/ncurses/nc... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Nov 2008 09:23:49 -0000 Author: rafan Date: Sat Nov 15 09:23:48 2008 New Revision: 184989 URL: http://svn.freebsd.org/changeset/base/184989 Log: - Update ncurses to 5.7-20081102 (5.7 release) and build glue - This also removes $FreeBSD$ from two now unmodifed source files ncurses/tinfo/lib_raw.c and ncurses/tinfo/lib_baudrate.c MFC after: 2 months (after 7.1 and 6.4 are released) Added: head/contrib/ncurses/man/curs_memleaks.3x - copied unchanged from r184988, vendor/ncurses/dist/man/curs_memleaks.3x head/contrib/ncurses/misc/ncurses.supp - copied unchanged from r184988, vendor/ncurses/dist/misc/ncurses.supp Modified: head/contrib/ncurses/ (props changed) head/contrib/ncurses/ANNOUNCE head/contrib/ncurses/FREEBSD-upgrade head/contrib/ncurses/INSTALL head/contrib/ncurses/MANIFEST head/contrib/ncurses/NEWS head/contrib/ncurses/TO-DO head/contrib/ncurses/aclocal.m4 head/contrib/ncurses/announce.html.in head/contrib/ncurses/config.guess head/contrib/ncurses/config.sub head/contrib/ncurses/configure head/contrib/ncurses/configure.in head/contrib/ncurses/dist.mk head/contrib/ncurses/doc/html/announce.html head/contrib/ncurses/form/form.priv.h head/contrib/ncurses/form/frm_def.c head/contrib/ncurses/form/frm_driver.c head/contrib/ncurses/form/frm_req_name.c head/contrib/ncurses/include/MKterm.h.awk.in head/contrib/ncurses/include/capdefaults.c head/contrib/ncurses/include/curses.h.in head/contrib/ncurses/include/curses.tail head/contrib/ncurses/include/nc_alloc.h head/contrib/ncurses/include/nc_panel.h head/contrib/ncurses/include/ncurses_defs head/contrib/ncurses/include/term_entry.h head/contrib/ncurses/man/curs_getcchar.3x head/contrib/ncurses/man/curs_terminfo.3x head/contrib/ncurses/man/curs_util.3x head/contrib/ncurses/man/form.3x head/contrib/ncurses/man/form_driver.3x head/contrib/ncurses/man/form_field_buffer.3x head/contrib/ncurses/man/man_db.renames head/contrib/ncurses/man/menu_attributes.3x head/contrib/ncurses/man/menu_driver.3x head/contrib/ncurses/man/menu_pattern.3x head/contrib/ncurses/man/ncurses.3x head/contrib/ncurses/menu/m_driver.c head/contrib/ncurses/menu/m_req_name.c head/contrib/ncurses/misc/ncu-indent head/contrib/ncurses/misc/terminfo.src head/contrib/ncurses/ncurses/Makefile.in head/contrib/ncurses/ncurses/base/MKkeyname.awk head/contrib/ncurses/ncurses/base/MKlib_gen.sh head/contrib/ncurses/ncurses/base/MKunctrl.awk head/contrib/ncurses/ncurses/base/lib_addch.c head/contrib/ncurses/ncurses/base/lib_delwin.c head/contrib/ncurses/ncurses/base/lib_freeall.c head/contrib/ncurses/ncurses/base/lib_getch.c head/contrib/ncurses/ncurses/base/lib_getstr.c head/contrib/ncurses/ncurses/base/lib_initscr.c head/contrib/ncurses/ncurses/base/lib_mouse.c head/contrib/ncurses/ncurses/base/lib_newterm.c head/contrib/ncurses/ncurses/base/lib_newwin.c head/contrib/ncurses/ncurses/base/lib_overlay.c head/contrib/ncurses/ncurses/base/lib_restart.c head/contrib/ncurses/ncurses/base/lib_screen.c head/contrib/ncurses/ncurses/base/lib_set_term.c head/contrib/ncurses/ncurses/base/lib_slk.c head/contrib/ncurses/ncurses/base/lib_slkrefr.c head/contrib/ncurses/ncurses/base/lib_ungetch.c head/contrib/ncurses/ncurses/base/lib_window.c head/contrib/ncurses/ncurses/base/resizeterm.c head/contrib/ncurses/ncurses/base/tries.c head/contrib/ncurses/ncurses/base/use_window.c head/contrib/ncurses/ncurses/base/wresize.c head/contrib/ncurses/ncurses/curses.priv.h head/contrib/ncurses/ncurses/fifo_defs.h head/contrib/ncurses/ncurses/llib-lncurses head/contrib/ncurses/ncurses/llib-lncursest head/contrib/ncurses/ncurses/llib-lncursesw head/contrib/ncurses/ncurses/tinfo/MKcodes.awk head/contrib/ncurses/ncurses/tinfo/MKnames.awk head/contrib/ncurses/ncurses/tinfo/alloc_entry.c head/contrib/ncurses/ncurses/tinfo/alloc_ttype.c head/contrib/ncurses/ncurses/tinfo/captoinfo.c head/contrib/ncurses/ncurses/tinfo/comp_expand.c head/contrib/ncurses/ncurses/tinfo/comp_hash.c head/contrib/ncurses/ncurses/tinfo/comp_parse.c head/contrib/ncurses/ncurses/tinfo/comp_scan.c head/contrib/ncurses/ncurses/tinfo/entries.c head/contrib/ncurses/ncurses/tinfo/home_terminfo.c head/contrib/ncurses/ncurses/tinfo/init_keytry.c head/contrib/ncurses/ncurses/tinfo/lib_acs.c head/contrib/ncurses/ncurses/tinfo/lib_baudrate.c head/contrib/ncurses/ncurses/tinfo/lib_cur_term.c head/contrib/ncurses/ncurses/tinfo/lib_data.c head/contrib/ncurses/ncurses/tinfo/lib_options.c head/contrib/ncurses/ncurses/tinfo/lib_raw.c head/contrib/ncurses/ncurses/tinfo/lib_setup.c head/contrib/ncurses/ncurses/tinfo/lib_termcap.c head/contrib/ncurses/ncurses/tinfo/lib_tgoto.c head/contrib/ncurses/ncurses/tinfo/lib_tparm.c head/contrib/ncurses/ncurses/tinfo/lib_tputs.c head/contrib/ncurses/ncurses/tinfo/lib_ttyflags.c head/contrib/ncurses/ncurses/tinfo/make_keys.c head/contrib/ncurses/ncurses/tinfo/name_match.c head/contrib/ncurses/ncurses/tinfo/parse_entry.c head/contrib/ncurses/ncurses/tinfo/read_entry.c head/contrib/ncurses/ncurses/tinfo/use_screen.c head/contrib/ncurses/ncurses/tinfo/write_entry.c head/contrib/ncurses/ncurses/trace/lib_trace.c head/contrib/ncurses/ncurses/trace/lib_traceatr.c head/contrib/ncurses/ncurses/trace/lib_tracebits.c head/contrib/ncurses/ncurses/trace/lib_tracechr.c head/contrib/ncurses/ncurses/trace/lib_tracedmp.c head/contrib/ncurses/ncurses/trace/lib_tracemse.c head/contrib/ncurses/ncurses/trace/trace_buf.c head/contrib/ncurses/ncurses/trace/trace_tries.c head/contrib/ncurses/ncurses/trace/varargs.c head/contrib/ncurses/ncurses/trace/visbuf.c head/contrib/ncurses/ncurses/tty/hardscroll.c head/contrib/ncurses/ncurses/tty/lib_mvcur.c head/contrib/ncurses/ncurses/tty/lib_twait.c head/contrib/ncurses/ncurses/tty/tty_update.c head/contrib/ncurses/ncurses/widechar/charable.c head/contrib/ncurses/ncurses/widechar/lib_get_wch.c head/contrib/ncurses/ncurses/widechar/lib_get_wstr.c head/contrib/ncurses/ncurses/widechar/lib_key_name.c head/contrib/ncurses/ncurses/widechar/lib_unget_wch.c head/contrib/ncurses/panel/p_new.c head/contrib/ncurses/panel/panel.priv.h head/contrib/ncurses/progs/MKtermsort.sh head/contrib/ncurses/progs/Makefile.in head/contrib/ncurses/progs/dump_entry.c head/contrib/ncurses/progs/dump_entry.h head/contrib/ncurses/progs/infocmp.c head/contrib/ncurses/progs/progs.priv.h head/contrib/ncurses/progs/tic.c head/contrib/ncurses/progs/toe.c head/contrib/ncurses/progs/tput.c head/contrib/ncurses/progs/tset.c head/lib/ncurses/ncurses/Makefile head/lib/ncurses/ncurses/ncurses_cfg.h Modified: head/contrib/ncurses/ANNOUNCE ============================================================================== --- head/contrib/ncurses/ANNOUNCE Sat Nov 15 08:51:32 2008 (r184988) +++ head/contrib/ncurses/ANNOUNCE Sat Nov 15 09:23:48 2008 (r184989) @@ -1,4 +1,4 @@ - Announcing ncurses 5.6 + Announcing ncurses 5.7 The ncurses (new curses) library is a free software emulation of curses in System V Release 4.0, and more. It uses terminfo format, @@ -27,205 +27,217 @@ Release Notes This release is designed to be upward compatible from ncurses 5.0 - through 5.5; very few applications will require recompilation, + through 5.6; very few applications will require recompilation, depending on the platform. These are the highlights from the - change-log since ncurses 5.5 release. + change-log since ncurses 5.6 release. Interface changes: * generate linkable stubs for some macros: - getbegx, getbegy, getcurx, getcury, getmaxx, getmaxy, getparx, - getpary, getpary, - and (for libncursesw) - wgetbkgrnd + getattrs New features and improvements: * library - + support hashed databases for the terminal descriptions. This - uses the Berkeley database, has been tested for several - versions on different platforms. - + add use_legacy_coding() function to support lynx's - font-switching feature. - + add extension nofilter(), to cancel a prior filter() call. - + add/install a package config script, e.g., ncurses5-config or - ncursesw5-config, according to configuration options. - + provide ifdef for NCURSES_NOMACROS which suppresses most - macro definitions from curses.h, i.e., where a macro is - defined to override a function to improve performance. - + make ifdef's consistent in curses.h for the extended colors - so the header file can be used for the normal curses library. - The header file installed for extended colors is a variation - of the wide-character configuration. - + improve tgetstr() by making the return value point into the - user's buffer, if provided. - + add ifdef's allowing ncurses to be built with tparm() using - either varargs (the existing status), or using a - fixed-parameter list (to match X/Open). - + widen the test for xterm kmous a little to allow for other - strings than "\E[M", e.g., for xterm-sco functionality in - xterm. - + modify wgetnstr() to return KEY_RESIZE if a sigwinch occurs. - + move prototypes for wide-character trace functions from - curses.tail to curses.wide to avoid accidental reference to - those if _XOPEN_SOURCE_EXTENDED is defined without ensuring - that is included. - + change the way shared libraries (other than libtool) are - installed. Rather than copying the build-tree's libraries, - link the shared objects into the install directory. This - makes the --with-rpath option work except with $(DESTDIR). - + several improvements for rendering in hpterm. These are only - available if the library is configured using - --enable-xmc-glitch. - + Add NCURSES_NO_HARD_TABS and NCURSES_NO_MAGIC_COOKIE - environment variables to allow runtime suppression of the - related hard-tabs and xmc-glitch features. + + new flavor of the ncurses library provides rudimentary + support for POSIX threads. Several functions are reentrant, + but most require either a window-level or screen-level mutex. + (This is API-compatible, but not ABI-compatible with the + normal library). + + add NCURSES_OPAQUE symbol to curses.h, will use to make + structs opaque in selected configurations. + + add NCURSES_EXT_FUNCS and NCURSES_EXT_COLORS symbols to + curses.h to make it simpler to tell if the extended functions + and/or colors are declared. + + add wresize() to C++ binding + + eliminate fixed-buffer vsprintf() calls in C++ binding. + + add several functions to C++ binding which wrap C functions + that pass a WINDOW* parameter. + + adapt mouse-handling code from menu library in form-library + + improve tracing for form library, showing created forms, + fields, etc. + + make $NCURSES_NO_PADDING feature work for termcap interface . + + add check to trace-file open, if the given name is a + directory, add ".log" to the name and try again. + + several new manpages: curs_legacy.3x, curs_memleaks.3x, + curs_opaque.3x and curs_threads.3x * programs: - + add new test programs: chgat.c, demo_altkeys.c, echochar.c, - foldkeys.c, movewindow.c, redraw.c, (noting that existing - test programs also were modified to test additional - features). - + modify tack to test extended capability function-key strings. - + modify toe to access termcap data, e.g., via cgetent() - functions, or as a text file if those are not available. - + improve infocmp/tic -f option formatting. - + add toe -a option, to show all databases. This uses new - private interfaces in the ncurses library for iterating - through the list of databases. - + modify MKfallback.sh to use tic -x when constructing fallback - tables to allow extended capabilities to be retrieved from a - fallback entry. + + modified three test-programs to demonstrate the threading + support in this version: ditto, rain, worm. + + several new test-programs: demo_panels, dots_mvcur, + inch_wide, inchs, key_name, key_names, savescreen, + savescreen.sh test_arrays, test_get_wstr, test_getstr, + test_instr, test_inwstr and test_opaque. + + add adacurses-config to the Ada95 install. + + modify tic -f option to format spaces as \s to prevent them + from being lost when that is read back in unformatted + strings. + + The tack program is now distributed separately from ncurses. * terminal database - + add terminfo entries for xfce terminal (xfce) and multi gnome - terminal (mgt) - + add nsterm-16color entry - + updated mlterm terminfo entry - + add kon, kon2 and jfbterm terminfo entry - + remove invis capability from klone+sgr, mainly used by linux - entry, since it does not really do this - + add ka2, kb1, kb3, kc2 to vt220-keypad as an extension - + add shifted up/down arrow codes to xterm-new as kind/kri - strings - + add hpterm-color terminfo entry - + add 256color variants of terminfo entries for programs which - are reported to implement this feature - + correct order of use-clauses in rxvt-basic entry which made - codes for f1-f4 vt100-style rather than vt220-style. + + added entries: + o Eterm-256color, Eterm-88color and rxvt-88color + o aterm + o konsole-256color + o mrxvt + o screen.mlterm + o screen.rxvt + o teraterm4.59 is now the primary primary teraterm entry, + renamed original to teraterm2.3 + o 9term terminal + o Newbury Data entries + + updated/improved entries: + o gnome to version 2.22.3 + o h19, z100 + o konsole to version 1.6.6 + o mlterm, mlterm+pcfkeys + o xterm, and building-blocks for function-keys to [3]xterm + patch #230. Major bug fixes: - * correct a typo in configure --with-bool option for the case where - --without-cxx is used. - * move assignment from environment variable ESCDELAY from initscr() - down to newterm() so the environment variable affects timeouts for - terminals opened with newterm() as well. - * modify werase to clear multicolumn characters that extend into a - derived window. - * modify wchgat() to mark updated cells as changed so a refresh will - repaint those cells. - * correct logic in wadd_wch() and wecho_wch(), which did not guard - against passing the multi-column attribute into a call on - waddch(), e.g., using data returned by win_wch() - * fix redrawing of windows other than stdscr using wredrawln() by - touching the corresponding rows in curscr. - * reduce memory leaks in repeated calls to tgetent() by remembering - the last TERMINAL* value allocated to hold the corresponding data - and freeing that if the tgetent() result buffer is the same as the - previous call. - * modify read_termtype() so the term_names data is always allocated - as part of the str_table, a better fix for a memory leak. - * fix wins_nwstr(), which did not handle single-column non-8bit - codes. - * modify wbkgrnd() to avoid clearing the A_CHARTEXT attribute bits - since those record the state of multicolumn characters. - * improve SIGWINCH handling by postponing its effect during - newterm(), etc., when allocating screens. - * remove 970913 feature for copying subwindows as they are moved in - mvwin(). - * add checks in waddchnstr() and wadd_wchnstr() to stop copying when - a null character is found. - * add some checks to ensure current position is within scrolling - region before scrolling on a new line. - * add a workaround to ACS mapping to allow applications such as - test/blue.c to use the "PC ROM" characters by masking them with - A_ALTCHARSET. This worked up til 5.5, but was lost in the revision - of legacy coding. + * add logic to tic for cancelling strings in user-defined + capabilities (this is needed for current konsole terminfo entry). + * modify mk-1st.awk so the generated makefile rules for linking or + installing shared libraries do not first remove the library, in + case it is in use, e.g., libncurses.so by /bin/sh. + * correct check for notimeout() in wgetch(). + * fix a sign-extension bug in infocmp's repair_acsc() function. + * change winnstr() to stop at the end of the line. + * make Ada95 demo_panels() example work. + * fix for adding a non-spacing character at the beginning of a line. + * fill in extended-color pair to make colors work for + wide-characters using extended-colors. + * improve refresh of window on top of multi-column characters, + taking into account split characters on left/right window + boundaries. + * modify win_wchnstr() to ensure that only a base cell is returned + for each multi-column character. + * improve waddch() and winsch() handling of EILSEQ from mbrtowc() by + using unctrl() to display illegal bytes rather than trying to + append further bytes to make up a valid sequence. + * restore curs_set() state after endwin()/refresh() + * modify keyname() to use "^X" form only if meta() has been called, + or if keyname() is called without initializing curses, e.g., via + initscr() or newterm(). + * modify unctrl() to check codes in 128-255 range versus isprint(). + If they are not printable, and locale was set, use a "M-" or "~" + sequence. + * improve resizeterm() by moving ripped-off lines, and repainting + the soft-keys. + * modify form library to accept control characters such as newline + in set_field_buffer(), which is compatible with Solaris. + * use NCURSES_MOUSE_MASK() in definition of BUTTON_RELEASE(), etc., + to make those work properly with the --enable-ext-mouse + configuration + * correct some functions in Ada95 binding which were using return + value from C where none was returned. + * reviewed/fixed issues reported by Coverity and Klocwork tools. Portability: * configure script: + new options: - --with-hashed-db - Use Berkeley hashed database for storing terminfo - data rather than storing each compiled entry in a - separate binary file within a directory tree. + --disable-big-strings + control whether static string tables are generated + as single large strings (to improve startup + performance), or as array of individual strings. + + --disable-relink + control whether shared libraries are relinked + (during install) when rpath is enabled. + + --disable-tic-depends + make explicit whether tic library depends on + ncurses/ncursesw library. + + --enable-mixed-case + override the configure script's check if the + filesystem supports mixed-case filenames. This + allows one to control how the terminal database + maps to the filesystem. For filesystems that do not + support mixed-case, the library uses generate + 2-character (hexadecimal) codes for the lower-level + of the filesystem terminfo database + + --enable-reentrant + builds a different flavor of the ncurses library + (ncursest) which improves reentrant use of the + library by reducing global and static variables + (see the "--with-pthread" option for the threaded + support). + + --enable-weak-symbols + use weak-symbols for linking to the POSIX thread + library, and use the same soname for the ncurses + shared library as the normal library (caveat: the + ABI is for the threaded library, which makes global + data accessed via functions). + + --with-pthread + build with the POSIX thread library (tested with + AIX, Linux, FreeBSD, OpenBSD, HPUX, IRIX64, + Solaris, Tru64). + + --with-ticlib + build/install the tic-support functions in a + separate library - --without-dlsym - Do not use dlsym() to load GPM dynamically. + + improved options: - --with-valgrind - Simplify building for testing with valgrind. + --enable-ext-colors + requires the wide-character configuration. - --enable-wgetch-events - Compile with experimental wgetch-events code. + --with-chtype + ignore option value "unsigned" is always added to + the type in curses.h; do the same for + --with-mmask-t. - --enable-signed-char - Store booleans in "signed char" rather than "char". + --with-dmalloc + build-fix for redefinition of strndup. - + improved options: + --with-hashed-db + accepts a parameter which is the install-prefix of + a given Berkeley Database. - --disable-largefile - make the option work both ways. + --with-hashed-db + the $LIBS environment variable overrides the search + for the db library. - --with-gpm - The option now accepts a parameter, i.e., the name - of the dynamic GPM library to load via dlopen() - - --disable-symlinks - The option now allows one to disable symlink() in - tic even when link() does not work. + --without-hashed-db + assumed when "--disable-database" is used. * other configure/build issues: - + remove special case for Darwin in CF_XOPEN_SOURCE configure - macro. - + add configure check to ensure that SIGWINCH is defined on - platforms such as OS X which exclude that when _XOPEN_SOURCE, - etc., are defined - + use ld's -search_paths_first option on Darwin to work around - odd search rules on that platform. - + improve ifdef's for _POSIX_VDISABLE in tset to work with Mac - OS X. - + modify configure script to ensure that if the C compiler is - used rather than the loader in making shared libraries, the - $(CFLAGS) variable is also used. - + use ${CC} rather than ${LD} in shared library rules for - IRIX64, Solaris to help ensure that initialization sections - are provided for extra linkage requirements, e.g., of C++ - applications. - + improve some shared-library configure scripting for Linux, - FreeBSD and NetBSD to make --with-shlib-version work. - + split up dependency of names.c and codes.c in - ncurses/Makefile to work with parallel make. - + modify MKlib_gen.sh to change preprocessor-expanded _Bool - back to bool. - + modify progs/Makefile.in to make tput init work properly with - cygwin, i.e., do not pass a .exe in the reference string used - in check_aliases. + + build-fixes for LynxOS + + modify shared-library rules to allow FreeBSD 3.x to use + rpath. + + build-fix for FreeBSD "contemporary" TTY interface. + + build-fixes for AIX with libtool. + + build-fixes for Darwin and libtool. + + modify BeOS-specific ifdef's to build on Haiku. + + corrected gcc options for building shared libraries on + Solaris and IRIX64. + + change shared-library configuration for OpenBSD, make rpath + work. + + build-fixes for using libutf8, e.g., on OpenBSD 3.7 + + add "-e" option in ncurses/Makefile.in when generating + source-files to force earlier exit if the build environment + fails unexpectedly. + + add support for shared libraries for QNX. + + change delimiter in MKlib_gen.sh from '%' to '@', to avoid + substitution by IBM xlc to '#' as part of its extensions to + digraphs. * library: - + ignore wide-acs line-drawing characters that wcwidth() claims - are not one-column. This is a workaround for Solaris' broken - locale support. - + reduce name-pollution in term.h by removing #define's for - HAVE_xxx symbols. - + fix #ifdef in c++/internal.h for QNX 6.1 + + rewrite wrapper for wcrtomb(), making it work on Solaris. + This is used in the form library to determine the length of + the buffer needed by field_buffer. + + add/use configure script macro CF_SIG_ATOMIC_T, use the + corresponding type for data manipulated by signal handlers. + + set locale in misc/ncurses-config.in since it uses a range + + disable GPM mouse support when $TERM does not happen to + contain "linux", since Gpm_Open() no longer limits its + assertion to terminals that it might handle, e.g., within + "screen" in xterm. + + reset mouse file-descriptor when unloading GPM library. * test programs: - + modify test/configure script to allow building test programs - with PDCurses/X11. - + modified test programs to allow some to work with NetBSD - curses. Several do not because NetBSD curses implements a - subset of X/Open curses, and also lacks much of SVr4 - additions. But it is enough for comparison. - + improved test/configure to build test/ncurses on HPUX 11 - using the vendor curses. - + change configure script to produce test/Makefile from data - file. + + update test programs to build/work with various UNIX curses + for comparisons. Features of Ncurses @@ -271,6 +283,8 @@ the use of function keys, e.g., disabling the ncurses KEY_MOUSE, or by defining more than one control sequence to map to a given key code. + * Support for 256-color terminals, such as modern xterm, when + configured using the --enable-ext-colors option. * Support for 16-color terminals, such as aixterm and modern xterm. * Better cursor-movement optimization. The package now features a cursor-local-movement computation more efficient than either BSD's @@ -342,49 +356,45 @@ cdk Curses Development Kit - [3]http://invisible-island.net/cdk/ - [4]http://www.vexus.ca/products/CDK/ + [4]http://invisible-island.net/cdk/ + [5]http://www.vexus.ca/products/CDK/ ded directory-editor - [5]http://invisible-island.net/ded/ + [6]http://invisible-island.net/ded/ dialog the underlying application used in Slackware's setup, and the basis for similar applications on GNU/Linux. - [6]http://invisible-island.net/dialog/ + [7]http://invisible-island.net/dialog/ lynx the character-screen WWW browser - [7]http://lynx.isc.org/release/ + [8]http://lynx.isc.org/release/ Midnight Commander file manager - [8]http://www.ibiblio.org/mc/ + [9]http://www.ibiblio.org/mc/ mutt mail utility - [9]http://www.mutt.org/ + [10]http://www.mutt.org/ ncftp file-transfer utility - [10]http://www.ncftp.com/ + [11]http://www.ncftp.com/ nvi New vi versions 1.50 are able to use ncurses versions 1.9.7 and later. - [11]http://www.bostic.com/vi/ + [12]http://www.bostic.com/vi/ pinfo Lynx-like info browser. - [12]http://dione.ids.pl/~pborys/software/pinfo/ + [13]https://alioth.debian.org/projects/pinfo/ tin - newsreader, supporting color, MIME [13]http://www.tin.org/ - - vh-1.6 - Volks-Hypertext browser for the Jargon File - [14]http://www.debian.org/Packages/unstable/text/vh.html + newsreader, supporting color, MIME [14]http://www.tin.org/ as well as some that use ncurses for the terminfo support alone: @@ -402,7 +412,7 @@ Who's Who and What's What Zeyd Ben-Halim started it from a previous package pcurses, written by - Pavel Curtis. Eric S. Raymond continued development. Juergen Pfeifer + Pavel Curtis. Eric S. Raymond continued development. Jürgen Pfeifer wrote most of the form and menu libraries. Ongoing work is being done by [17]Thomas Dickey. Thomas Dickey acts as the maintainer for the Free Software Foundation, which holds the copyright on ncurses. @@ -442,18 +452,18 @@ References 1. ftp://ftp.gnu.org/gnu/ncurses/ 2. ftp://invisible-island.net/ncurses/ - 3. http://invisible-island.net/cdk/ - 4. http://www.vexus.ca/products/CDK/ - 5. http://invisible-island.net/ded/ - 6. http://invisible-island.net/dialog/ - 7. http://lynx.isc.org/release/ - 8. http://www.ibiblio.org/mc/ - 9. http://www.mutt.org/ - 10. http://www.ncftp.com/ - 11. http://www.bostic.com/vi/ - 12. http://dione.ids.pl/~pborys/software/pinfo/ - 13. http://www.tin.org/ - 14. http://www.debian.org/Packages/unstable/text/vh.html + 3. http://invisible-island.net/xterm/xterm.log.html#xterm_230 + 4. http://invisible-island.net/cdk/ + 5. http://www.vexus.ca/products/CDK/ + 6. http://invisible-island.net/ded/ + 7. http://invisible-island.net/dialog/ + 8. http://lynx.isc.org/release/ + 9. http://www.ibiblio.org/mc/ + 10. http://www.mutt.org/ + 11. http://www.ncftp.com/ + 12. http://www.bostic.com/vi/ + 13. https://alioth.debian.org/projects/pinfo/ + 14. http://www.tin.org/ 15. http://alioth.debian.org/projects/minicom/ 16. http://invisible-island.net/vile/ 17. mailto:dickey@invisible-island.net Modified: head/contrib/ncurses/FREEBSD-upgrade ============================================================================== --- head/contrib/ncurses/FREEBSD-upgrade Sat Nov 15 08:51:32 2008 (r184988) +++ head/contrib/ncurses/FREEBSD-upgrade Sat Nov 15 09:23:48 2008 (r184989) @@ -6,9 +6,14 @@ ncurses The beta version can be found at ftp://invisible-island.net/ncurses/ or ftp://dickey.his.com/ncurses/ +The instructions for importing new release and merge to HEAD can be found +at FreeBSD wiki: + + http://wiki.freebsd.org/SubversionPrimer/VendorImports + For the import files and directories were pruned by: - tar -X FREEBSD-Xlist -zxf ncurses-5.6.tar.gz + tar -X FREEBSD-Xlist -zxf ncurses-5.7.tar.gz check if there are any new bits that we don't want. Modified: head/contrib/ncurses/INSTALL ============================================================================== --- head/contrib/ncurses/INSTALL Sat Nov 15 08:51:32 2008 (r184988) +++ head/contrib/ncurses/INSTALL Sat Nov 15 09:23:48 2008 (r184989) @@ -1,5 +1,5 @@ ------------------------------------------------------------------------------- --- Copyright (c) 1998-2005,2006 Free Software Foundation, Inc. -- +-- Copyright (c) 1998-2006,2008 Free Software Foundation, Inc. -- -- -- -- Permission is hereby granted, free of charge, to any person obtaining a -- -- copy of this software and associated documentation files (the -- @@ -25,7 +25,7 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------- --- $Id: INSTALL,v 1.124 2008/03/29 18:07:32 tom Exp $ +-- $Id: INSTALL,v 1.135 2008/11/02 21:13:51 tom Exp $ --------------------------------------------------------------------- How to install Ncurses/Terminfo on your system --------------------------------------------------------------------- @@ -393,6 +393,18 @@ SUMMARY OF CONFIGURE OPTIONS: Compile without scroll-hints code. This option is ignored when hashmap scrolling is configured, which is the default. + --disable-tic-depends + When building shared libraries, normally the tic library is linked to + depend upon the ncurses library (and in turn, on the term-library if + the --with-termlib option was given). The tic- and term-libraries + ABI does not depend on the --enable-widec option. Some packagers have + used this to reduce the number of library files which are packaged + by using only one copy of those libraries. To make this work properly, + the tic library must be built without an explicit dependency on the + ncurses (or ncursesw) library. Use this configure option to do that. + For example + configure --with-ticlib --with-shared --disable-tic-depends + --disable-tparm-varargs Portable programs should call tparm() using the fixed-length parameter list documented in X/Open. ncurses provides varargs support for this @@ -572,6 +584,13 @@ SUMMARY OF CONFIGURE OPTIONS: --enable-warnings Turn on GCC compiler warnings. There should be only a few. + --enable-weak-symbols + If the --with-pthread option is set, check if the compiler supports + weak-symbols. If it does, then name the thread-capable library without + the "t" (libncurses rather than libncursest), and provide for + dynamically loading the pthreads entrypoints at runtime. This allows + one to reduce the number of library files for ncurses. + --enable-wgetch-events Compile with experimental wgetch-events code. See ncurses/README.IZ @@ -598,6 +617,9 @@ SUMMARY OF CONFIGURE OPTIONS: Normally this is the same as the release version; some ports have special requirements for compatibility. + This option does not affect linking with libtool, which uses the + release major/minor numbers. + --with-ada-compiler=CMD Specify the Ada95 compiler command (default "gnatmake") @@ -625,20 +647,32 @@ SUMMARY OF CONFIGURE OPTIONS: to do this if the target compiler has unusual flags which confuse the host compiler. + You can also set the environment variable $BUILD_CFLAGS rather than + use this option. + --with-build-cppflags=XXX If cross-compiling, specify the host C preprocessor-flags. You might need to do this if the target compiler has unusual flags which confuse the host compiler. + You can also set the environment variable $BUILD_CPPFLAGS rather than + use this option. + --with-build-ldflags=XXX If cross-compiling, specify the host linker-flags. You might need to do this if the target linker has unusual flags which confuse the host compiler. + You can also set the environment variable $BUILD_LDFLAGS rather than + use this option. + --with-build-libs=XXX If cross-compiling, the host libraries. You might need to do this if the target environment requires unusual libraries. + You can also set the environment variable $BUILD_LIBS rather than + use this option. + --with-caps=XXX Specify an alternate terminfo capabilities file, which makes the configure script look for "include/Caps.XXX". A few systems, e.g., @@ -795,6 +829,14 @@ SUMMARY OF CONFIGURE OPTIONS: may be unsigned. Use this option if you need to preserve compatibility with 64-bit executables. + --with-normal + Generate normal (i.e., static) libraries (default). + + Note: on Linux, the configure script will attempt to use the GPM + library via the dlsym() function call. Use --without-dlsym to disable + this feature, or --without-gpm, depending on whether you wish to use + GPM. + --with-ospeed=TYPE Override type of ospeed variable, which is part of the termcap compatibility interface. In termcap, this is a 'short', which works @@ -808,14 +850,6 @@ SUMMARY OF CONFIGURE OPTIONS: those using termcap, do not use the higher speeds. Your application (or system, in general) may or may not. - --with-normal - Generate normal (i.e., static) libraries (default). - - Note: on Linux, the configure script will attempt to use the GPM - library via the dlsym() function call. Use --without-dlsym to disable - this feature, or --without-gpm, depending on whether you wish to use - GPM. - --with-profile Generate profile-libraries These are named by adding "_p" to the root, e.g., libncurses_p.a @@ -898,6 +932,12 @@ SUMMARY OF CONFIGURE OPTIONS: library. As in termlib, there is no ABI difference between the "wide" libticw.so and libtic.so + NOTE: Overriding the name of the tic library may be useful if you are + also using the --with-termlib option to rename libtinfo. If you are + not doing that, renaming the tic library can result in conflicting + library dependencies for tic and other programs built with the tic + library. + --with-trace Configure the trace() function as part of the all models of the ncurses library. Normally it is part of the debug (libncurses_g) library only. @@ -961,6 +1001,94 @@ COMPATIBILITY WITH OLDER VERSIONS OF NCU you may encounter when building a system with different versions of ncurses: + 5.7 (November 2, 2008) + Interface changes: + + + generate linkable stubs for some macros: + getattrs + + + Add new library configuration for tic-library (the non-curses portion + of the ncurses library used for the tic program as well as some + others such as tack. There is no API change, but makefiles would be + changed to use the tic-library built separately. + + tack, distributed separately from ncurses, uses some of the internal + _nc_XXX functions, which are declared in the tic.h header file. + + The reason for providing this separate library is that none of the + functions in it are suitable for threaded applications. + + + Add new library configuration (ncursest, ncurseswt) which provides + rudimentary support for POSIX threads. This introduces opaque + access functions to the WINDOW structure and adds a parameter to + several internal functions. + + + move most internal variables (except tic-library) into data blocks + _nc_globals and _nc_prescreen to simplify analysis. Those were + globally accessible, but since they were not part of the documented + API, there is no ABI change. + + + changed static tables of strings to be indices into long strings, to + improve startup performance. This changes parameter lists for some + of the internal functions. + + Added extensions: + + + add NCURSES_OPAQUE definition in curses.h to control whether internal + details of the WINDOW structure are visible to an application. This + is always defined when the threaded library is built, and is optional + otherwise. New functions for this: is_cleared, is_idcok, is_idlok, + is_immedok, is_keypad, is_leaveok, is_nodelay, is_notimeout, + is_scrollok, is_syncok, wgetparent and wgetscrreg. + + + the threaded library (ncursest) also disallows direct updating of + global curses-level variables, providing functions (via macros) for + obtaining their value. A few of those variables can be modified by + the application, using new functions: set_escdelay, set_tabsize + + + added functions use_window() and use_screen() which wrap a mutex + (if threading is configured) around a call to a user-supplied + function. + + Added internal functions: + _nc_get_alias_table + _nc_get_screensize + _nc_keyname + _nc_screen_of + _nc_set_no_padding + _nc_tracechar + _nc_tracemouse + _nc_unctrl + _nc_ungetch + + These are used for leak-testing, and are stubs for + ABI compatibility when ncurses is not configured for that + using the --disable-leaks configure script option: + + _nc_free_and_exit + _nc_leaks_tinfo + + Removed internal functions: + none + + Modified internal functions: + _nc_fifo_dump + _nc_find_entry + _nc_handle_sigwinch + _nc_init_keytry + _nc_keypad + _nc_locale_breaks_acs + _nc_timed_wait + _nc_update_screensize + + Use new typedef TRIES to replace "struct tries": + + _nc_add_to_try + _nc_expand_try + _nc_remove_key + _nc_remove_string + _nc_trace_tries + 5.6 (December 17, 2006) Interface changes: Modified: head/contrib/ncurses/MANIFEST ============================================================================== --- head/contrib/ncurses/MANIFEST Sat Nov 15 08:51:32 2008 (r184988) +++ head/contrib/ncurses/MANIFEST Sat Nov 15 09:23:48 2008 (r184989) @@ -349,8 +349,10 @@ ./doc/html/man/curs_instr.3x.html ./doc/html/man/curs_inwstr.3x.html ./doc/html/man/curs_kernel.3x.html +./doc/html/man/curs_legacy.3x.html ./doc/html/man/curs_mouse.3x.html ./doc/html/man/curs_move.3x.html +./doc/html/man/curs_opaque.3x.html ./doc/html/man/curs_outopts.3x.html ./doc/html/man/curs_overlay.3x.html ./doc/html/man/curs_pad.3x.html @@ -364,6 +366,7 @@ ./doc/html/man/curs_termattrs.3x.html ./doc/html/man/curs_termcap.3x.html ./doc/html/man/curs_terminfo.3x.html +./doc/html/man/curs_threads.3x.html ./doc/html/man/curs_touch.3x.html ./doc/html/man/curs_trace.3x.html ./doc/html/man/curs_util.3x.html @@ -555,6 +558,7 @@ ./man/curs_inwstr.3x ./man/curs_kernel.3x ./man/curs_legacy.3x +./man/curs_memleaks.3x ./man/curs_mouse.3x ./man/curs_move.3x ./man/curs_opaque.3x @@ -700,6 +704,7 @@ ./misc/ncurses-config.in ./misc/ncurses.def ./misc/ncurses.ref +./misc/ncurses.supp ./misc/panel.def ./misc/panel.ref ./misc/run_tic.in Modified: head/contrib/ncurses/NEWS ============================================================================== --- head/contrib/ncurses/NEWS Sat Nov 15 08:51:32 2008 (r184988) +++ head/contrib/ncurses/NEWS Sat Nov 15 09:23:48 2008 (r184989) @@ -25,7 +25,7 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------- --- $Id: NEWS,v 1.1233 2008/05/03 23:14:39 tom Exp $ +-- $Id: NEWS,v 1.1320 2008/11/02 00:56:22 tom Exp $ ------------------------------------------------------------------------------- This is a log of changes that ncurses has gone through since Zeyd started @@ -45,6 +45,238 @@ See the AUTHORS file for the correspondi Changes through 1.9.9e did not credit all contributions; it is not possible to add this information. +20081102 5.7 release for upload to ftp.gnu.org + +20081025 + + add a manpage to discuss memory leaks. + + add support for shared libraries for QNX (other than libtool, which + does not work well on that platform). + + build-fix for QNX C++ binding. + +20081018 + + build-fixes for OS/2 EMX. + + modify form library to accept control characters such as newline + in set_field_buffer(), which is compatible with Solaris (report by + Nit Khair). + + modify configure script to assume --without-hashed-db when + --disable-database is used. + + add "-e" option in ncurses/Makefile.in when generating source-files + to force earlier exit if the build environment fails unexpectedly + (prompted by patch by Adrian Bunk). + + change configure script to use CF_UTF8_LIB, improved variant of + CF_LIBUTF8. + +20081012 + + add teraterm4.59 terminfo entry, use that as primary teraterm entry, rename + original to teraterm2.3 -TD + + update "gnome" terminfo to 2.22.3 -TD + + update "konsole" terminfo to 1.6.6, needs today's fix for tic -TD + + add "aterm" terminfo -TD + + add "linux2.6.26" terminfo -TD + + add logic to tic for cancelling strings in user-defined capabilities, + overlooked til now. + +20081011 + + update html documentation. + + add -m and -s options to test/keynames.c and test/key_names.c to test + the meta() function with keyname() or key_name(), respectively. + + correct return value of key_name() on error; it is null. + + document some unresolved issues for rpath and pthreads in TO-DO. + + fix a missing prototype for ioctl() on OpenBSD in tset.c + + add configure option --disable-tic-depends to make explicit whether + tic library depends on ncurses/ncursesw library, amends change from + 20080823 (prompted by Debian #501421). + +20081004 + + some build-fixes for configure --disable-ext-funcs (incomplete, but + works for C/C++ parts). + + improve configure-check for awks unable to handle large strings, e.g. + AIX 5.1 whose awk silently gives up on large printf's. + +20080927 + + fix build for --with-dmalloc by workaround for redefinition of + strndup between string.h and dmalloc.h + + fix build for --disable-sigwinch + + add environment variable NCURSES_GPM_TERMS to allow override to use + GPM on terminals other than "linux", etc. + + disable GPM mouse support when $TERM does not happen to contain + "linux", since Gpm_Open() no longer limits its assertion to terminals + that it might handle, e.g., within "screen" in xterm. + + reset mouse file-descriptor when unloading GPM library (report by + Miroslav Lichvar). + + fix build for --disable-leaks --enable-widec --with-termlib + > patch by Juergen Pfeifer: + + use improved initialization for soft-label keys in Ada95 sample code. + + discard internal symbol _nc_slk_format (unused since 20080112). + + move call of slk_paint_info() from _nc_slk_initialize() to + slk_intern_refresh(), improving initialization. + +20080925 + + fix bug in mouse code for GPM from 20080920 changes (reported in + Debian #500103, also Miroslav Lichvar). + +20080920 + + fix shared-library rules for cygwin with tic- and tinfo-libraries. + + fix a memory leak when failure to connect to GPM. + + correct check for notimeout() in wgetch() (report on linux.redhat + newsgroup by FurtiveBertie). + + add an example warning-suppression file for valgrind, + misc/ncurses.supp (based on example from Reuben Thomas) + +20080913 + + change shared-library configuration for OpenBSD, make rpath work. + + build-fixes for using libutf8, e.g., on OpenBSD 3.7 + +20080907 + + corrected fix for --enable-weak-symbols (report by Frederic L W + Meunier). + +20080906 + + corrected gcc options for building shared libraries on IRIX64. + + add configure check for awk programs unable to handle big-strings, + use that to improve the default for --enable-big-strings option. + + makefile-fixes for --enable-weak-symbols (report by Frederic L W + Meunier). + + update test/configure script. + + adapt ifdef's from library to make test/view.c build when mbrtowc() + is unavailable, e.g., with HPUX 10.20. + + add configure check for wcsrtombs, mbsrtowcs, which are used in + test/ncurses.c, and use wcstombs, mbstowcs instead if available, + fixing build of ncursew for HPUX 11.00 + +20080830 + + fixes to make Ada95 demo_panels() example work. + + modify Ada95 'rain' test program to accept keyboard commands like the + C-version. + + modify BeOS-specific ifdef's to build on Haiku (patch by Scott + Mccreary). + + add configure-check to see if the std namespace is legal for cerr + and endl, to fix a build issue with Tru64. + + consistently use NCURSES_BOOL in lib_gen.c + + filter #line's from lib_gen.c + + change delimiter in MKlib_gen.sh from '%' to '@', to avoid + substitution by IBM xlc to '#' as part of its extensions to digraphs. + + update config.guess, config.sub from + http://savannah.gnu.org/projects/config + (caveat - its maintainer removed support for older Linux systems). + +20080823 + + modify configure check for pthread library to work with OSF/1 5.1, + which uses #define's to associate its header and library. + + use pthread_mutexattr_init() for initializing pthread_mutexattr_t, + makes threaded code work on HPUX 11.23 + + fix a bug in demo_menus in freeing menus (cf: 20080804). + + modify configure script for the case where tic library is used (and + possibly renamed) to remove its dependency upon ncurses/ncursew + library (patch by Dr Werner Fink). + + correct manpage for menu_fore() which gave wrong default for + the attribute used to display a selected entry (report by Mike Gran). + + add Eterm-256color, Eterm-88color and rxvt-88color (prompted by + Debian #495815) -TD + +20080816 + + add configure option --enable-weak-symbols to turn on new feature. + + add configure-check for availability of weak symbols. + + modify linkage with pthread library to use weak symbols so that + applications not linked to that library will not use the mutexes, + etc. This relies on gcc, and may be platform-specific (patch by Dr + Werner Fink). + + add note to INSTALL to document limitation of renaming of tic library + using the --with-ticlib configure option (report by Dr Werner Fink). + + document (in manpage) why tputs does not detect I/O errors (prompted + by comments by Samuel Thibault). + + fix remaining warnings from Klocwork report. + +20080804 + + modify _nc_panelhook() data to account for a permanent memory leak. + + fix memory leaks in test/demo_menus + + fix most warnings from Klocwork tool (report by Larry Zhou). + + modify configure script CF_XOPEN_SOURCE macro to add case for + "dragonfly" from xterm #236 changes. + + modify configure script --with-hashed-db to let $LIBS override the + search for the db library (prompted by report by Samson Pierre). + +20080726 + + build-fixes for gcc 4.3.1 (changes to gnat "warnings", and C inlining + thresholds). + +20080713 + + build-fix (reports by Christian Ebert, Funda Wang). + +20080712 + + compiler-warning fixes for Solaris. + +20080705 + + use NCURSES_MOUSE_MASK() in definition of BUTTON_RELEASE(), etc., to + make those work properly with the "--enable-ext-mouse" configuration + (cf: 20050205). + + improve documentation of build-cc options in INSTALL. + + work-around a bug in gcc 4.2.4 on AIX, which does not pass the + -static/-dynamic flags properly to linker, causing test/bs to + not link. + +20080628 + + correct some ifdef's needed for the broken-linker configuration. + + make debugging library's $BAUDRATE feature work for termcap + interface. + + make $NCURSES_NO_PADDING feature work for termcap interface (prompted + by comment on FreeBSD mailing list). + + add screen.mlterm terminfo entry -TD + + improve mlterm and mlterm+pcfkeys terminfo entries -TD + +20080621 + + regenerated html documentation. + + expand manpage description of parameters for form_driver() and + menu_driver() (prompted by discussion with Adam Spragg). + + add null-pointer checks for cur_term in baudrate() and + def_shell_mode(), def_prog_mode() + + fix some memory leaks in delscreen() and wide acs. + +20080614 + + modify test/ditto.c to illustrate multi-threaded use_screen(). + + change CC_SHARED_OPTS from -KPIC to -xcode=pic32 for Solaris. *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Sat Nov 15 09:30:10 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 772161065674; Sat, 15 Nov 2008 09:30:10 +0000 (UTC) (envelope-from rafan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 650D18FC0C; Sat, 15 Nov 2008 09:30:10 +0000 (UTC) (envelope-from rafan@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mAF9UAEw016005; Sat, 15 Nov 2008 09:30:10 GMT (envelope-from rafan@svn.freebsd.org) Received: (from rafan@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mAF9UA1q016004; Sat, 15 Nov 2008 09:30:10 GMT (envelope-from rafan@svn.freebsd.org) Message-Id: <200811150930.mAF9UA1q016004@svn.freebsd.org> From: Rong-En Fan Date: Sat, 15 Nov 2008 09:30: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: r184990 - head/contrib/ncurses X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Nov 2008 09:30:10 -0000 Author: rafan Date: Sat Nov 15 09:30:09 2008 New Revision: 184990 URL: http://svn.freebsd.org/changeset/base/184990 Log: - Update instructions for Subversion import - Remove FREEBSD-vendor as edwin@ is working on a automatically contrib software status page generation Deleted: head/contrib/ncurses/FREEBSD-vendor Modified: head/contrib/ncurses/FREEBSD-upgrade Modified: head/contrib/ncurses/FREEBSD-upgrade ============================================================================== --- head/contrib/ncurses/FREEBSD-upgrade Sat Nov 15 09:23:48 2008 (r184989) +++ head/contrib/ncurses/FREEBSD-upgrade Sat Nov 15 09:30:09 2008 (r184990) @@ -6,33 +6,21 @@ ncurses The beta version can be found at ftp://invisible-island.net/ncurses/ or ftp://dickey.his.com/ncurses/ -The instructions for importing new release and merge to HEAD can be found -at FreeBSD wiki: - - http://wiki.freebsd.org/SubversionPrimer/VendorImports - For the import files and directories were pruned by: tar -X FREEBSD-Xlist -zxf ncurses-5.7.tar.gz check if there are any new bits that we don't want. -then imported by: - - cvs import -m 'Import ncurses 5.6-20061217 onto the vendor branch' \ - src/contrib/ncurses NCURSES v5_6_20061217 - -The date in the tag can be obtained from contrib/ncurses/dist.mk. -If the version is a snapshot, +The instructions for importing new release and merging to HEAD can be found +at FreeBSD wiki: - cvs import -m 'Import ncurses 5.6-20080503 snapshot onto the vendor branch' \ - src/contrib/ncurses NCURSES v5_6_20080503 + http://wiki.freebsd.org/SubversionPrimer/VendorImports -Remove files that are removed in this release in vendor branch (NCURSES) -instead of HEAD. +The version tag can be obtained from contrib/ncurses/dist.mk. -To make local changes to ncurses, simply patch and commit to the main -branch (aka HEAD). Never make local changes on the vendor (NCURSES) branch. +To make local changes to ncurses, simply patch and commit to the trunk +branch (aka HEAD). Never make local changes on the vendor branch. All local changes should be submitted to Thomas Dickey for inclusion in the next vendor release. The author is very willing to help us. @@ -44,19 +32,20 @@ ncurses, go to /usr/ports/devel/ncurses Update ncurses_cfg.h and necessary Makefile glues from ${WRKSRC}/build.nowidec. Directory for wide character support is ${WRKSRC}/build.widec -You may have to update ncurses-specific glue in termcap.c. +You may have to update ncurses-specific glue in termcap.c (check if +ncurses/tinfo/read_termcap.c has been changed since last import). Current local changes: ncurses/tinfo/comp_scan.c - rev 1.2: native termcap tweaking + r50620: native termcap tweaking (cvs r1.2) ncurses/tinfo/lib_termcap.c - rev 1.2: native termcap tweaking - rev 1.4: remove GCC_UNUSED for rev 1.2 + r50620: native termcap tweaking (cvs r1.2) + r50850: remove GCC_UNUSED for r50620 (cvs r1.4) ncurses/tinfo/read_termcap.c This is not used. We have our own src/lib/ncurses/termcap.c rafan@FreeBSD.org -9-Jan-2007 +15-Nov-2008 From owner-svn-src-head@FreeBSD.ORG Sat Nov 15 09:39:01 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0FD7C1065689; Sat, 15 Nov 2008 09:39: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 F209D8FC1C; Sat, 15 Nov 2008 09:39:00 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mAF9d0vc016190; Sat, 15 Nov 2008 09:39:00 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mAF9d0jF016189; Sat, 15 Nov 2008 09:39:00 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200811150939.mAF9d0jF016189@svn.freebsd.org> From: Alexander Motin Date: Sat, 15 Nov 2008 09:39:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184991 - head/sys/dev/sound/pci/hda X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Nov 2008 09:39:01 -0000 Author: mav Date: Sat Nov 15 09:39:00 2008 New Revision: 184991 URL: http://svn.freebsd.org/changeset/base/184991 Log: Correct association 0 handling. as=0 means unused pin, so disable it explicitly, this is mostly cosmetics. 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 Sat Nov 15 09:30:09 2008 (r184990) +++ head/sys/dev/sound/pci/hda/hdac.c Sat Nov 15 09:39:00 2008 (r184991) @@ -83,7 +83,7 @@ #include "mixer_if.h" -#define HDA_DRV_TEST_REV "20081030_0115" +#define HDA_DRV_TEST_REV "20081115_0116" SND_DECLARE_FILE("$FreeBSD$"); @@ -4255,9 +4255,9 @@ hdac_audio_as_parse(struct hdac_devinfo struct hdac_widget *w; int i, j, cnt, max, type, dir, assoc, seq, first, hpredir; - /* XXX This is redundant */ + /* Count present associations */ max = 0; - for (j = 0; j < 16; j++) { + for (j = 1; j < 16; j++) { for (i = devinfo->startnode; i < devinfo->endnode; i++) { w = hdac_widget_get(devinfo, i); if (w == NULL || w->enable == 0) @@ -5123,17 +5123,27 @@ hdac_audio_disable_useless(struct hdac_d w = hdac_widget_get(devinfo, i); if (w == NULL || w->enable == 0) continue; - if (w->type == HDA_PARAM_AUDIO_WIDGET_CAP_TYPE_PIN_COMPLEX && - (w->wclass.pin.config & - HDA_CONFIG_DEFAULTCONF_CONNECTIVITY_MASK) == - HDA_CONFIG_DEFAULTCONF_CONNECTIVITY_NONE) { - w->enable = 0; - HDA_BOOTHVERBOSE( - device_printf(devinfo->codec->sc->dev, - " Disabling pin nid %d due" - " to None connectivity.\n", - w->nid); - ); + if (w->type == HDA_PARAM_AUDIO_WIDGET_CAP_TYPE_PIN_COMPLEX) { + if ((w->wclass.pin.config & + HDA_CONFIG_DEFAULTCONF_CONNECTIVITY_MASK) == + HDA_CONFIG_DEFAULTCONF_CONNECTIVITY_NONE) { + w->enable = 0; + HDA_BOOTHVERBOSE( + device_printf(devinfo->codec->sc->dev, + " Disabling pin nid %d due" + " to None connectivity.\n", + w->nid); + ); + } else if ((w->wclass.pin.config & + HDA_CONFIG_DEFAULTCONF_ASSOCIATION_MASK) == 0) { + w->enable = 0; + HDA_BOOTHVERBOSE( + device_printf(devinfo->codec->sc->dev, + " Disabling unassociated" + " pin nid %d.\n", + w->nid); + ); + } } } do { From owner-svn-src-head@FreeBSD.ORG Sat Nov 15 10:56:37 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 14F981065679; Sat, 15 Nov 2008 10:56:37 +0000 (UTC) (envelope-from jkoshy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 02CD78FC18; Sat, 15 Nov 2008 10:56:37 +0000 (UTC) (envelope-from jkoshy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mAFAuavF017617; Sat, 15 Nov 2008 10:56:36 GMT (envelope-from jkoshy@svn.freebsd.org) Received: (from jkoshy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mAFAuas7017616; Sat, 15 Nov 2008 10:56:36 GMT (envelope-from jkoshy@svn.freebsd.org) Message-Id: <200811151056.mAFAuas7017616@svn.freebsd.org> From: Joseph Koshy Date: Sat, 15 Nov 2008 10:56:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184992 - head/sys/dev/hwpmc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Nov 2008 10:56:37 -0000 Author: jkoshy Date: Sat Nov 15 10:56:36 2008 New Revision: 184992 URL: http://svn.freebsd.org/changeset/base/184992 Log: Correct an indexing error (a change missed out in #184802). Modified: head/sys/dev/hwpmc/hwpmc_amd.c Modified: head/sys/dev/hwpmc/hwpmc_amd.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_amd.c Sat Nov 15 09:39:00 2008 (r184991) +++ head/sys/dev/hwpmc/hwpmc_amd.c Sat Nov 15 10:56:36 2008 (r184992) @@ -958,7 +958,7 @@ pmc_amd_initialize(void) for (i = 0; i < AMD_NPMCS; i++) { (void) snprintf(amd_pmcdesc[i].pm_descr.pd_name, sizeof(amd_pmcdesc[i].pm_descr.pd_name), "%s-%d", - name, i-1); + name, i); amd_pmcdesc[i].pm_descr.pd_class = class; } From owner-svn-src-head@FreeBSD.ORG Sat Nov 15 11:07:54 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EBA791065673; Sat, 15 Nov 2008 11:07:54 +0000 (UTC) (envelope-from jkoshy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D9B098FC18; Sat, 15 Nov 2008 11:07:54 +0000 (UTC) (envelope-from jkoshy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mAFB7seg019170; Sat, 15 Nov 2008 11:07:54 GMT (envelope-from jkoshy@svn.freebsd.org) Received: (from jkoshy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mAFB7sJB019169; Sat, 15 Nov 2008 11:07:54 GMT (envelope-from jkoshy@svn.freebsd.org) Message-Id: <200811151107.mAFB7sJB019169@svn.freebsd.org> From: Joseph Koshy Date: Sat, 15 Nov 2008 11:07: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: r184993 - head/sys/dev/hwpmc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Nov 2008 11:07:55 -0000 Author: jkoshy Date: Sat Nov 15 11:07:54 2008 New Revision: 184993 URL: http://svn.freebsd.org/changeset/base/184993 Log: Fix assertions. Reported by: keramida Modified: head/sys/dev/hwpmc/hwpmc_intel.c Modified: head/sys/dev/hwpmc/hwpmc_intel.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_intel.c Sat Nov 15 10:56:36 2008 (r184992) +++ head/sys/dev/hwpmc/hwpmc_intel.c Sat Nov 15 11:07:54 2008 (r184993) @@ -151,8 +151,9 @@ pmc_intel_initialize(void) case PMC_CPU_INTEL_PIV: error = pmc_p4_initialize(pmc_mdep, ncpus); - KASSERT(md->pmd_npmc == TSC_NPMCS + P4_NPMCS, ("[intel,%d] " - "incorrect npmc count %d", __LINE__, md->pmd_npmc)); + KASSERT(pmc_mdep->pmd_npmc == TSC_NPMCS + P4_NPMCS, + ("[intel,%d] incorrect npmc count %d", __LINE__, + pmc_mdep->pmd_npmc)); break; #endif @@ -168,8 +169,9 @@ pmc_intel_initialize(void) case PMC_CPU_INTEL_PM: error = pmc_p6_initialize(pmc_mdep, ncpus); - KASSERT(md->pmd_npmc == TSC_NPMCS + P6_NPMCS, ("[intel,%d] " - "incorrect npmc count %d", __LINE__, md->pmd_npmc)); + KASSERT(pmc_mdep->pmd_npmc == TSC_NPMCS + P6_NPMCS, + ("[intel,%d] incorrect npmc count %d", __LINE__, + pmc_mdep->pmd_npmc)); break; /* @@ -179,8 +181,9 @@ pmc_intel_initialize(void) case PMC_CPU_INTEL_P5: error = pmc_p5_initialize(pmc_mdep, ncpus); - KASSERT(md->pmd_npmc == TSC_NPMCS + PENTIUM_NPMCS, ("[intel,%d] " - "incorrect npmc count %d", __LINE__, md->pmd_npmc)); + KASSERT(pmc_mdep->pmd_npmc == TSC_NPMCS + PENTIUM_NPMCS, + ("[intel,%d] incorrect npmc count %d", __LINE__, + md->pmd_npmc)); break; #endif From owner-svn-src-head@FreeBSD.ORG Sat Nov 15 11:11:32 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AE68B106567A; Sat, 15 Nov 2008 11:11:32 +0000 (UTC) (envelope-from jkoshy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9CEA78FC1A; Sat, 15 Nov 2008 11:11:32 +0000 (UTC) (envelope-from jkoshy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mAFBBWTY019277; Sat, 15 Nov 2008 11:11:32 GMT (envelope-from jkoshy@svn.freebsd.org) Received: (from jkoshy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mAFBBWnf019276; Sat, 15 Nov 2008 11:11:32 GMT (envelope-from jkoshy@svn.freebsd.org) Message-Id: <200811151111.mAFBBWnf019276@svn.freebsd.org> From: Joseph Koshy Date: Sat, 15 Nov 2008 11:11: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: r184994 - head/sys/dev/hwpmc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Nov 2008 11:11:32 -0000 Author: jkoshy Date: Sat Nov 15 11:11:32 2008 New Revision: 184994 URL: http://svn.freebsd.org/changeset/base/184994 Log: Correct an oversight: call the MD finalize hook at module unload time. Modified: head/sys/dev/hwpmc/hwpmc_mod.c Modified: head/sys/dev/hwpmc/hwpmc_mod.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_mod.c Sat Nov 15 11:07:54 2008 (r184993) +++ head/sys/dev/hwpmc/hwpmc_mod.c Sat Nov 15 11:11:32 2008 (r184994) @@ -4656,6 +4656,9 @@ pmc_cleanup(void) if (md->pmd_pcpu_fini) md->pmd_pcpu_fini(cpu); } + + pmc_md_finalize(md); + free(md, M_PMC); md = NULL; pmc_restore_cpu_binding(&pb); From owner-svn-src-head@FreeBSD.ORG Sat Nov 15 11:34:30 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D1EBD106564A; Sat, 15 Nov 2008 11:34:30 +0000 (UTC) (envelope-from jkoshy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C00818FC0C; Sat, 15 Nov 2008 11:34:30 +0000 (UTC) (envelope-from jkoshy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mAFBYUws019712; Sat, 15 Nov 2008 11:34:30 GMT (envelope-from jkoshy@svn.freebsd.org) Received: (from jkoshy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mAFBYUvY019711; Sat, 15 Nov 2008 11:34:30 GMT (envelope-from jkoshy@svn.freebsd.org) Message-Id: <200811151134.mAFBYUvY019711@svn.freebsd.org> From: Joseph Koshy Date: Sat, 15 Nov 2008 11:34: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: r184995 - head/lib/libpmc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Nov 2008 11:34:30 -0000 Author: jkoshy Date: Sat Nov 15 11:34:30 2008 New Revision: 184995 URL: http://svn.freebsd.org/changeset/base/184995 Log: - Document the class name prefix for these PMCs. - Document the "anythread" qualifier, available on Atom CPUs. - Add examples. Modified: head/lib/libpmc/pmc.iaf.3 Modified: head/lib/libpmc/pmc.iaf.3 ============================================================================== --- head/lib/libpmc/pmc.iaf.3 Sat Nov 15 11:11:32 2008 (r184994) +++ head/lib/libpmc/pmc.iaf.3 Sat Nov 15 11:34:30 2008 (r184995) @@ -23,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 3, 2008 +.Dd November 14, 2008 .Os .Dt PMC.IAF 3 .Sh NAME @@ -72,6 +72,9 @@ Fixed-function PMCs support the followin .It PMC_CAP_USER Ta Yes .It PMC_CAP_WRITE Ta Yes .El +.Ss Class Name Prefix +These pmcs are named using a class name prefix of +.Dq Li iaf- . .Ss Event Qualifiers (Fixed Function PMCs) These PMCs support the following modifiers: .Bl -tag -width indent @@ -80,6 +83,11 @@ Configure the PMC to count events occurr .It Li usr Configure the PMC to count events occurring at ring levels 1, 2 or 3. +.It Li anythread +.Pq Tn Atom CPUs +Configure the PMC to count events on all logical processors sharing a +processor core. +The default is to count events on the current logical processor. .El .Pp If neither of the @@ -101,6 +109,19 @@ The number of core cycles for which the .Pq Fixed Function Counter 2 The number of reference cycles for which the core is not halted. .El +.Sh EXAMPLES +To measure the number of core cycles for which the core was not halted +use the event specifier +.Qq iaf-cpu-clk-unhalted.core . +.Pp +To measure the number of user instructions retired use the event specifier +.Qq iaf-instr-retired.any,usr . +.Pp +To measure the number of user instructions retired on all logical processors +in an +.Tn Atom +CPU, use the event specifier +.Qq iaf-instr-retired.any,usr,anythread . .Sh SEE ALSO .Xr pmc 3 , .Xr pmc.atom 3 , From owner-svn-src-head@FreeBSD.ORG Sat Nov 15 12:08:46 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ACBF71065674 for ; Sat, 15 Nov 2008 12:08:46 +0000 (UTC) (envelope-from jkoshy.freebsd@gmail.com) Received: from ti-out-0910.google.com (ti-out-0910.google.com [209.85.142.187]) by mx1.freebsd.org (Postfix) with ESMTP id 421E48FC18 for ; Sat, 15 Nov 2008 12:08:46 +0000 (UTC) (envelope-from jkoshy.freebsd@gmail.com) Received: by ti-out-0910.google.com with SMTP id a1so1029612tib.3 for ; Sat, 15 Nov 2008 04:08:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:to:cc:subject :in-reply-to:references:user-agent:mime-version:content-type:from :date:sender; bh=MujI2P5w5iMvMM55LYcCcESk4JDP3Y2WODn5dQDVfUM=; b=gvQBkVZeTPdoLP2s20PrxRLcK09mPr/Qz4pI1E6LioFF1gSK8SdCyUPVxDf/XXc1Cc c7qfFfGAA00dhz12GVxY8/yDHVb1BIgBl+V30ZX+Utu5JESYd41mqKj+taGq/bC51gFy 0rHeQnZwA3824kzkqBao5rUeCENMTQ9cSh+Mw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:to:cc:subject:in-reply-to:references:user-agent :mime-version:content-type:from:date:sender; b=GEYNciHWPiGfNI+LW0PKmXqstQtU/KUIHSsx0r00tIl4iNv+VHXsEZnfFcQR+iZwG6 /rbrSa6qENK49OuAGrNI7rTFB+8L3wyFIzQ4uemmsSEStF4wvVAedbpP4rwaVB+lzHYH gX3DzU1bFirSvna4G00CZQ4zPQnyz0rAMZn0g= Received: by 10.110.49.2 with SMTP id w2mr2420121tiw.4.1226749109389; Sat, 15 Nov 2008 03:38:29 -0800 (PST) Received: from moria.unixconsulting.co.in ([117.97.126.101]) by mx.google.com with ESMTPS id 2sm3607407tif.0.2008.11.15.03.38.19 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sat, 15 Nov 2008 03:38:27 -0800 (PST) Message-ID: <86ljvkudnc.wl%koshy@unixconsulting.co.in> To: Giorgos Keramidas In-Reply-To: <87skpuab5d.fsf@kobe.laptop> References: <200811091737.mA9HbssM047036@svn.freebsd.org> <87skpuab5d.fsf@kobe.laptop> User-Agent: Wanderlust/2.14.0 (Africa) SEMI/1.14.6 (Maruoka) FLIM/1.14.8 (=?ISO-8859-4?Q?Shij=F2?=) APEL/10.7 Emacs/22.1 (x86_64-pc-freebsd) MULE/5.0 (SAKAKI) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII From: Joseph Koshy Date: Sat, 15 Nov 2008 17:04:53 -0000 Sender: Joseph Koshy Cc: svn-src-head@freebsd.org, Joseph Koshy , svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r184802 - in head/sys: amd64/include conf dev/hwpmc i386/include modules/hwpmc sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Nov 2008 12:08:46 -0000 > Hi Joseph, > > This seems to cause panics here. Should be fixed in change #184993. Thanks for bug report. Koshy From owner-svn-src-head@FreeBSD.ORG Sat Nov 15 12:21:19 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A6A801065677; Sat, 15 Nov 2008 12:21:19 +0000 (UTC) (envelope-from keramida@freebsd.org) Received: from igloo.linux.gr (igloo.linux.gr [62.1.205.36]) by mx1.freebsd.org (Postfix) with ESMTP id 199B08FC08; Sat, 15 Nov 2008 12:21:18 +0000 (UTC) (envelope-from keramida@freebsd.org) Received: from kobe.laptop (adsl122-175.kln.forthnet.gr [77.49.241.175]) (authenticated bits=128) by igloo.linux.gr (8.14.3/8.14.3/Debian-5) with ESMTP id mAFCL6RK006792 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Sat, 15 Nov 2008 14:21:12 +0200 Received: from kobe.laptop (kobe.laptop [127.0.0.1]) by kobe.laptop (8.14.3/8.14.3) with ESMTP id mAFCL65m049064; Sat, 15 Nov 2008 14:21:06 +0200 (EET) (envelope-from keramida@freebsd.org) Received: (from keramida@localhost) by kobe.laptop (8.14.3/8.14.3/Submit) id mAFCL6G0049020; Sat, 15 Nov 2008 14:21:06 +0200 (EET) (envelope-from keramida@freebsd.org) From: Giorgos Keramidas To: Joseph Koshy References: <200811091737.mA9HbssM047036@svn.freebsd.org> <87skpuab5d.fsf@kobe.laptop> <86ljvkudnc.wl%koshy@unixconsulting.co.in> Date: Sat, 15 Nov 2008 14:21:06 +0200 In-Reply-To: <86ljvkudnc.wl%koshy@unixconsulting.co.in> (Joseph Koshy's message of "Sat, 15 Nov 2008 17:04:53 -0000") Message-ID: <87bpwhqix9.fsf@kobe.laptop> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-MailScanner-ID: mAFCL6RK006792 X-Hellug-MailScanner: Found to be clean X-Hellug-MailScanner-SpamCheck: not spam, SpamAssassin (not cached, score=-4.304, required 5, autolearn=not spam, ALL_TRUSTED -1.80, AWL 0.10, BAYES_00 -2.60) X-Hellug-MailScanner-From: keramida@freebsd.org X-Spam-Status: No Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r184802 - in head/sys: amd64/include conf dev/hwpmc i386/include modules/hwpmc sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Nov 2008 12:21:19 -0000 On Sat, 15 Nov 2008 17:04:53 -0000, Joseph Koshy wrote: >> Hi Joseph, >> >> This seems to cause panics here. > > Should be fixed in change #184993. Thanks for bug report. Building a new snapshot now. Thanks for fixing this :) From owner-svn-src-head@FreeBSD.ORG Sat Nov 15 22:23:07 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7A07B1065675; Sat, 15 Nov 2008 22:23:07 +0000 (UTC) (envelope-from peter@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 696808FC1E; Sat, 15 Nov 2008 22:23:07 +0000 (UTC) (envelope-from peter@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mAFMN7uD036344; Sat, 15 Nov 2008 22:23:07 GMT (envelope-from peter@svn.freebsd.org) Received: (from peter@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mAFMN7lX036341; Sat, 15 Nov 2008 22:23:07 GMT (envelope-from peter@svn.freebsd.org) Message-Id: <200811152223.mAFMN7lX036341@svn.freebsd.org> From: Peter Wemm Date: Sat, 15 Nov 2008 22:23:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184996 - head/lib/libc/i386/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Nov 2008 22:23:07 -0000 Author: peter Date: Sat Nov 15 22:23:07 2008 New Revision: 184996 URL: http://svn.freebsd.org/changeset/base/184996 Log: On i386, the primary function that SYSCALL() generates is with the __sys_ prefix. Make END() match. This didn't cause a compile error, but the function size is attached to the .weak symbol, not the real one. Modified: head/lib/libc/i386/sys/pipe.S head/lib/libc/i386/sys/reboot.S head/lib/libc/i386/sys/setlogin.S Modified: head/lib/libc/i386/sys/pipe.S ============================================================================== --- head/lib/libc/i386/sys/pipe.S Sat Nov 15 11:34:30 2008 (r184995) +++ head/lib/libc/i386/sys/pipe.S Sat Nov 15 22:23:07 2008 (r184996) @@ -44,4 +44,4 @@ SYSCALL(pipe) movl %edx,4(%ecx) movl $0,%eax ret -END(pipe) +END(__sys_pipe) Modified: head/lib/libc/i386/sys/reboot.S ============================================================================== --- head/lib/libc/i386/sys/reboot.S Sat Nov 15 11:34:30 2008 (r184995) +++ head/lib/libc/i386/sys/reboot.S Sat Nov 15 22:23:07 2008 (r184996) @@ -40,4 +40,4 @@ __FBSDID("$FreeBSD$"); SYSCALL(reboot) iret -END(reboot) +END(__sys_reboot) Modified: head/lib/libc/i386/sys/setlogin.S ============================================================================== --- head/lib/libc/i386/sys/setlogin.S Sat Nov 15 11:34:30 2008 (r184995) +++ head/lib/libc/i386/sys/setlogin.S Sat Nov 15 22:23:07 2008 (r184996) @@ -52,4 +52,4 @@ SYSCALL(setlogin) movl $0,CNAME(_logname_valid) #endif ret /* setlogin(name) */ -END(setlogin) +END(__sys_setlogin)