From owner-svn-src-stable-9@FreeBSD.ORG Sun Nov 11 04:07:10 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8253DDDE; Sun, 11 Nov 2012 04:07:10 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 683678FC12; Sun, 11 Nov 2012 04:07:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAB47AdP087156; Sun, 11 Nov 2012 04:07:10 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAB47AV9087155; Sun, 11 Nov 2012 04:07:10 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201211110407.qAB47AV9087155@svn.freebsd.org> From: Eitan Adler Date: Sun, 11 Nov 2012 04:07:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242884 - stable/9/sys/dev/uart X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Nov 2012 04:07:10 -0000 Author: eadler Date: Sun Nov 11 04:07:09 2012 New Revision: 242884 URL: http://svnweb.freebsd.org/changeset/base/242884 Log: MFC r242583: Add support for a few more devices: PNP0510 and FUJ02E5 for a "Wacom Tablet at FuS Lifebook T" PNP0502 and PNP0511 for some other generic devices. PR: kern/173357 Approved by: cperciva (implicit) Modified: stable/9/sys/dev/uart/uart_bus_acpi.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/uart/uart_bus_acpi.c ============================================================================== --- stable/9/sys/dev/uart/uart_bus_acpi.c Sun Nov 11 04:07:09 2012 (r242883) +++ stable/9/sys/dev/uart/uart_bus_acpi.c Sun Nov 11 04:07:09 2012 (r242884) @@ -59,7 +59,11 @@ static driver_t uart_acpi_driver = { static struct isa_pnp_id acpi_ns8250_ids[] = { {0x0005d041, "Standard PC COM port"}, /* PNP0500 */ {0x0105d041, "16550A-compatible COM port"}, /* PNP0501 */ + {0x0205d041, "Multiport serial device (non-intelligent 16550)"}, /* PNP0502 */ + {0x1005d041, "Generic IRDA-compatible device"}, /* PNP0510 */ + {0x1105d041, "Generic IRDA-compatible device"}, /* PNP0511 */ {0x04f0235c, "Wacom Tablet PC Screen"}, /* WACF004 */ + {0xe502aa1a, "Wacom Tablet at FuS Lifebook T"}, /* FUJ02E5 */ {0} }; From owner-svn-src-stable-9@FreeBSD.ORG Sun Nov 11 12:06:13 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3C36D723; Sun, 11 Nov 2012 12:06:13 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 216D28FC12; Sun, 11 Nov 2012 12:06:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qABC6Dj2080308; Sun, 11 Nov 2012 12:06:13 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qABC6DnT080305; Sun, 11 Nov 2012 12:06:13 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201211111206.qABC6DnT080305@svn.freebsd.org> From: Ed Schouten Date: Sun, 11 Nov 2012 12:06:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242891 - stable/9/usr.sbin/ac X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Nov 2012 12:06:13 -0000 Author: ed Date: Sun Nov 11 12:06:12 2012 New Revision: 242891 URL: http://svnweb.freebsd.org/changeset/base/242891 Log: MFC r233522, r239855, r239910, r239938, r239954 and r239961. - Relicense to 2-clause BSD license. - Use queue(3) -- not some homegrown implementation of linked lists. - Rename structures to _entry, as they are entries in the linked list -- not the lists themselves. - Don't store entire copies of struct utmpx in utmpx_entry, but only the members we're interested in. Large fields such as hostnames are not needed during the execution of the program. - Give structure members useful names, instead of `name'. - While there, use struct timevals instead of time_t's internally. This is not strictly useful, but while we're at it... - Mark stuff static. - Add missing const keywords. - Remove unneeded prototypes. - Remove workaround for sparc64-specific utmp problems. These don't apply to utmpx. - Don't discard entries when timestamps are not monotone. This shouldn't ever happen with utmpx, but discarding them is a bit too harsh. - Remove debug code. We nowadays have `getent utmpx', which can be used to analyze logfiles in depth. - Use proper uppercasing/periods in comments. - Print output of `ac -p' sorted alphabetically, instead of first occurrence. - Properly check against pts/* instead of tty[PQRSpqrs]* to determine whether a TTY is a pseudo-terminal. Modified: stable/9/usr.sbin/ac/Makefile stable/9/usr.sbin/ac/ac.8 stable/9/usr.sbin/ac/ac.c Directory Properties: stable/9/usr.sbin/ac/ (props changed) Modified: stable/9/usr.sbin/ac/Makefile ============================================================================== --- stable/9/usr.sbin/ac/Makefile Sun Nov 11 10:45:21 2012 (r242890) +++ stable/9/usr.sbin/ac/Makefile Sun Nov 11 12:06:12 2012 (r242891) @@ -3,11 +3,6 @@ PROG= ac MAN= ac.8 -# Temporary, while tracking down problem wrt 64-bit time_t's on sparc64 -.if ${MACHINE_CPUARCH} == "sparc64" -CFLAGS+=-DDEBUG -.endif - # If "CONSOLE_TTY" is not defined, this program is compatible with the # traditional implementation (using SunOS 4.x as the sample traditional # implementation). This is the default. Modified: stable/9/usr.sbin/ac/ac.8 ============================================================================== --- stable/9/usr.sbin/ac/ac.8 Sun Nov 11 10:45:21 2012 (r242890) +++ stable/9/usr.sbin/ac/ac.8 Sun Nov 11 12:06:12 2012 (r242891) @@ -11,11 +11,6 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by Christopher G. Demetriou. -.\" 3. The name of the author may not be used to endorse or promote products -.\" derived from this software without specific prior written permission .\" .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR .\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES @@ -112,7 +107,7 @@ No login or connect time accounting is p does not exist. .Pp For example, -.Bd -literal -offset +.Bd -literal -offset indent ac -p -t "ttyd*" > modems ac -p -t "!ttyd*" > other .Ed Modified: stable/9/usr.sbin/ac/ac.c ============================================================================== --- stable/9/usr.sbin/ac/ac.c Sun Nov 11 10:45:21 2012 (r242890) +++ stable/9/usr.sbin/ac/ac.c Sun Nov 11 12:06:12 2012 (r242891) @@ -1,23 +1,37 @@ -/* - * Copyright (c) 1994 Christopher G. Demetriou. - * @(#)Copyright (c) 1994, Simon J. Gerraty. +/*- + * Copyright (c) 1994 Christopher G. Demetriou + * Copyright (c) 1994 Simon J. Gerraty + * Copyright (c) 2012 Ed Schouten + * 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 is free software. It comes with NO WARRANTY. - * Permission to use, modify and distribute this source code - * is granted subject to the following conditions. - * 1/ that the above copyright notice and this notice - * are preserved in all copies and that due credit be given - * to the author. - * 2/ that any changes to this code are clearly commented - * as such so that the author does not get blamed for bugs - * other than his own. + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. */ #include __FBSDID("$FreeBSD$"); -#include +#include #include + #include #include #include @@ -32,43 +46,47 @@ __FBSDID("$FreeBSD$"); /* * this is for our list of currently logged in sessions */ -struct utmp_list { - struct utmp_list *next; - struct utmpx usr; +struct utmpx_entry { + SLIST_ENTRY(utmpx_entry) next; + char user[sizeof(((struct utmpx *)0)->ut_user)]; + char id[sizeof(((struct utmpx *)0)->ut_id)]; +#ifdef CONSOLE_TTY + char line[sizeof(((struct utmpx *)0)->ut_line)]; +#endif + struct timeval time; }; /* * this is for our list of users that are accumulating time. */ -struct user_list { - struct user_list *next; - char name[sizeof(((struct utmpx *)0)->ut_user)]; - time_t secs; +struct user_entry { + SLIST_ENTRY(user_entry) next; + char user[sizeof(((struct utmpx *)0)->ut_user)]; + struct timeval time; }; /* * this is for chosing whether to ignore a login */ -struct tty_list { - struct tty_list *next; - char name[sizeof(((struct utmpx *)0)->ut_host) + 2]; - size_t len; - int ret; +struct tty_entry { + SLIST_ENTRY(tty_entry) next; + char line[sizeof(((struct utmpx *)0)->ut_line) + 2]; + size_t len; + int ret; }; /* * globals - yes yuk */ #ifdef CONSOLE_TTY -static char *Console = CONSOLE_TTY; +static const char *Console = CONSOLE_TTY; #endif -static time_t Total = 0; -static time_t FirstTime = 0; +static struct timeval Total = { 0, 0 }; +static struct timeval FirstTime = { 0, 0 }; static int Flags = 0; -static struct user_list *Users = NULL; -static struct tty_list *Ttys = NULL; - -#define NEW(type) (type *)malloc(sizeof (type)) +static SLIST_HEAD(, utmpx_entry) CurUtmpx = SLIST_HEAD_INITIALIZER(CurUtmpx); +static SLIST_HEAD(, user_entry) Users = SLIST_HEAD_INITIALIZER(Users); +static SLIST_HEAD(, tty_entry) Ttys = SLIST_HEAD_INITIALIZER(Ttys); #define AC_W 1 /* not _PATH_WTMP */ #define AC_D 2 /* daily totals (ignore -p) */ @@ -76,182 +94,112 @@ static struct tty_list *Ttys = NULL; #define AC_U 8 /* specified users only */ #define AC_T 16 /* specified ttys only */ -#ifdef DEBUG -static int Debug = 0; -#endif +static void ac(const char *); +static void usage(void); -int main(int, char **); -int ac(const char *); -struct tty_list *add_tty(char *); -#ifdef DEBUG -const char *debug_pfx(const struct utmpx *, const struct utmpx *); -#endif -int do_tty(char *); -struct utmp_list *log_in(struct utmp_list *, struct utmpx *); -struct utmp_list *log_out(struct utmp_list *, struct utmpx *); -int on_console(struct utmp_list *); -void show(const char *, time_t); -void show_today(struct user_list *, struct utmp_list *, - time_t); -void show_users(struct user_list *); -struct user_list *update_user(struct user_list *, char *, time_t); -void usage(void); - -struct tty_list * -add_tty(char *name) +static void +add_tty(const char *line) { - struct tty_list *tp; + struct tty_entry *tp; char *rcp; Flags |= AC_T; - if ((tp = NEW(struct tty_list)) == NULL) + if ((tp = malloc(sizeof(*tp))) == NULL) errx(1, "malloc failed"); tp->len = 0; /* full match */ tp->ret = 1; /* do if match */ - if (*name == '!') { /* don't do if match */ + if (*line == '!') { /* don't do if match */ tp->ret = 0; - name++; + line++; } - strlcpy(tp->name, name, sizeof (tp->name)); - if ((rcp = strchr(tp->name, '*')) != NULL) { /* wild card */ + strlcpy(tp->line, line, sizeof(tp->line)); + /* Wildcard. */ + if ((rcp = strchr(tp->line, '*')) != NULL) { *rcp = '\0'; - tp->len = strlen(tp->name); /* match len bytes only */ + /* Match len bytes only. */ + tp->len = strlen(tp->line); } - tp->next = Ttys; - Ttys = tp; - return Ttys; + SLIST_INSERT_HEAD(&Ttys, tp, next); } /* * should we process the named tty? */ -int -do_tty(char *name) +static int +do_tty(const char *line) { - struct tty_list *tp; + struct tty_entry *tp; int def_ret = 0; - for (tp = Ttys; tp != NULL; tp = tp->next) { + SLIST_FOREACH(tp, &Ttys, next) { if (tp->ret == 0) /* specific don't */ def_ret = 1; /* default do */ if (tp->len != 0) { - if (strncmp(name, tp->name, tp->len) == 0) + if (strncmp(line, tp->line, tp->len) == 0) return tp->ret; } else { - if (strncmp(name, tp->name, sizeof (tp->name)) == 0) + if (strncmp(line, tp->line, sizeof(tp->line)) == 0) return tp->ret; } } - return def_ret; + return (def_ret); } #ifdef CONSOLE_TTY /* * is someone logged in on Console? */ -int -on_console(struct utmp_list *head) +static int +on_console(void) { - struct utmp_list *up; + struct utmpx_entry *up; - for (up = head; up; up = up->next) { - if (strcmp(up->usr.ut_line, Console) == 0) - return 1; - } - return 0; + SLIST_FOREACH(up, &CurUtmpx, next) + if (strcmp(up->line, Console) == 0) + return (1); + return (0); } #endif /* - * update user's login time + * Update user's login time. + * If no entry for this user is found, a new entry is inserted into the + * list alphabetically. */ -struct user_list * -update_user(struct user_list *head, char *name, time_t secs) +static void +update_user(const char *user, struct timeval secs) { - struct user_list *up; + struct user_entry *up, *aup; + int c; - for (up = head; up != NULL; up = up->next) { - if (strcmp(up->name, name) == 0) { - up->secs += secs; - Total += secs; - return head; - } + aup = NULL; + SLIST_FOREACH(up, &Users, next) { + c = strcmp(up->user, user); + if (c == 0) { + timeradd(&up->time, &secs, &up->time); + timeradd(&Total, &secs, &Total); + return; + } else if (c > 0) + break; + aup = up; } /* * not found so add new user unless specified users only */ if (Flags & AC_U) - return head; + return; - if ((up = NEW(struct user_list)) == NULL) + if ((up = malloc(sizeof(*up))) == NULL) errx(1, "malloc failed"); - up->next = head; - strlcpy(up->name, name, sizeof (up->name)); - up->secs = secs; - Total += secs; - return up; -} - -#ifdef DEBUG -/* - * Create a string which is the standard prefix for a debug line. It - * includes a timestamp (perhaps with year), device-name, and user-name. - */ -const char * -debug_pfx(const struct utmpx *event_up, const struct utmpx *userinf_up) -{ - static char str_result[40 + sizeof(userinf_up->ut_line) + - sizeof(userinf_up->ut_user)]; - static char thisyear[5]; - size_t maxcopy; - time_t ut_timecopy; - - if (thisyear[0] == '\0') { - /* Figure out what "this year" is. */ - time(&ut_timecopy); - strlcpy(str_result, ctime(&ut_timecopy), sizeof(str_result)); - strlcpy(thisyear, &str_result[20], sizeof(thisyear)); - } - - if (event_up->ut_tv.tv_sec == 0) - strlcpy(str_result, "*ZeroTime* --:--:-- ", sizeof(str_result)); - else { - ut_timecopy = event_up->ut_tv.tv_sec; - strlcpy(str_result, ctime(&ut_timecopy), sizeof(str_result)); - /* - * Include the year, if it is not the same year as "now". - */ - if (strncmp(&str_result[20], thisyear, 4) == 0) - str_result[20] = '\0'; - else { - str_result[24] = ' '; /* Replace a '\n' */ - str_result[25] = '\0'; - } - } - - if (userinf_up->ut_line[0] == '\0') - strlcat(str_result, "NoDev", sizeof(str_result)); - else { - maxcopy = strlen(str_result) + sizeof(userinf_up->ut_line); - if (maxcopy > sizeof(str_result)) - maxcopy = sizeof(str_result); - strlcat(str_result, userinf_up->ut_line, maxcopy); - } - strlcat(str_result, ": ", sizeof(str_result)); - - if (userinf_up->ut_user[0] == '\0') - strlcat(str_result, "LogOff", sizeof(str_result)); - else { - maxcopy = strlen(str_result) + sizeof(userinf_up->ut_user); - if (maxcopy > sizeof(str_result)) - maxcopy = sizeof(str_result); - strlcat(str_result, userinf_up->ut_user, maxcopy); - } - - return (str_result); + if (aup == NULL) + SLIST_INSERT_HEAD(&Users, up, next); + else + SLIST_INSERT_AFTER(aup, up, next); + strlcpy(up->user, user, sizeof(up->user)); + up->time = secs; + timeradd(&Total, &secs, &Total); } -#endif int main(int argc, char *argv[]) @@ -261,13 +209,8 @@ main(int argc, char *argv[]) (void) setlocale(LC_TIME, ""); - while ((c = getopt(argc, argv, "Dc:dpt:w:")) != -1) { + while ((c = getopt(argc, argv, "c:dpt:w:")) != -1) { switch (c) { -#ifdef DEBUG - case 'D': - Debug++; - break; -#endif case 'c': #ifdef CONSOLE_TTY Console = optarg; @@ -299,7 +242,7 @@ main(int argc, char *argv[]) * initialize user list */ for (; optind < argc; optind++) { - Users = update_user(Users, argv[optind], (time_t)0); + update_user(argv[optind], (struct timeval){ 0, 0 }); } Flags |= AC_U; /* freeze user list */ } @@ -307,113 +250,103 @@ main(int argc, char *argv[]) Flags &= ~AC_P; ac(wtmpf); - return 0; + return (0); } /* * print login time in decimal hours */ -void -show(const char *name, time_t secs) +static void +show(const char *user, struct timeval secs) { (void)printf("\t%-*s %8.2f\n", - (int)sizeof(((struct utmpx *)0)->ut_user), name, - ((double)secs / 3600)); + (int)sizeof(((struct user_entry *)0)->user), user, + (double)secs.tv_sec / 3600); } -void -show_users(struct user_list *list) +static void +show_users(void) { - struct user_list *lp; + struct user_entry *lp; - for (lp = list; lp; lp = lp->next) - show(lp->name, lp->secs); + SLIST_FOREACH(lp, &Users, next) + show(lp->user, lp->time); } /* * print total login time for 24hr period in decimal hours */ -void -show_today(struct user_list *users, struct utmp_list *logins, time_t secs) +static void +show_today(struct timeval today) { - struct user_list *up; - struct utmp_list *lp; + struct user_entry *up; + struct utmpx_entry *lp; char date[64]; - time_t yesterday = secs - 1; + struct timeval diff, total = { 0, 0 }, usec = { 0, 1 }, yesterday; static int d_first = -1; if (d_first < 0) d_first = (*nl_langinfo(D_MD_ORDER) == 'd'); - (void)strftime(date, sizeof (date), + timersub(&today, &usec, &yesterday); + (void)strftime(date, sizeof(date), d_first ? "%e %b total" : "%b %e total", - localtime(&yesterday)); - - /* restore the missing second */ - yesterday++; + localtime(&yesterday.tv_sec)); - for (lp = logins; lp != NULL; lp = lp->next) { - secs = yesterday - lp->usr.ut_tv.tv_sec; - Users = update_user(Users, lp->usr.ut_user, secs); - lp->usr.ut_tv.tv_sec = yesterday; /* as if they just logged in */ + SLIST_FOREACH(lp, &CurUtmpx, next) { + timersub(&today, &lp->time, &diff); + update_user(lp->user, diff); + /* As if they just logged in. */ + lp->time = today; } - secs = 0; - for (up = users; up != NULL; up = up->next) { - secs += up->secs; - up->secs = 0; /* for next day */ + SLIST_FOREACH(up, &Users, next) { + timeradd(&total, &up->time, &total); + /* For next day. */ + timerclear(&up->time); } - if (secs) - (void)printf("%s %11.2f\n", date, ((double)secs / 3600)); + if (timerisset(&total)) + (void)printf("%s %11.2f\n", date, (double)total.tv_sec / 3600); } /* - * log a user out and update their times. - * if ut_line is "~", we log all users out as the system has - * been shut down. + * Log a user out and update their times. + * If ut_type is BOOT_TIME or SHUTDOWN_TIME, we log all users out as the + * system has been shut down. */ -struct utmp_list * -log_out(struct utmp_list *head, struct utmpx *up) +static void +log_out(const struct utmpx *up) { - struct utmp_list *lp, *lp2, *tlp; - time_t secs; + struct utmpx_entry *lp, *lp2, *tlp; + struct timeval secs; - for (lp = head, lp2 = NULL; lp != NULL; ) + for (lp = SLIST_FIRST(&CurUtmpx), lp2 = NULL; lp != NULL;) if (up->ut_type == BOOT_TIME || up->ut_type == SHUTDOWN_TIME || (up->ut_type == DEAD_PROCESS && - memcmp(lp->usr.ut_id, up->ut_id, sizeof up->ut_id) == 0)) { - secs = up->ut_tv.tv_sec - lp->usr.ut_tv.tv_sec; - Users = update_user(Users, lp->usr.ut_user, secs); -#ifdef DEBUG - if (Debug) - printf("%s logged out (%2d:%02d:%02d)\n", - debug_pfx(up, &lp->usr), (int)(secs / 3600), - (int)((secs % 3600) / 60), - (int)(secs % 60)); -#endif + memcmp(lp->id, up->ut_id, sizeof(up->ut_id)) == 0)) { + timersub(&up->ut_tv, &lp->time, &secs); + update_user(lp->user, secs); /* * now lose it */ tlp = lp; - lp = lp->next; - if (tlp == head) - head = lp; - else if (lp2 != NULL) - lp2->next = lp; + lp = SLIST_NEXT(lp, next); + if (lp2 == NULL) + SLIST_REMOVE_HEAD(&CurUtmpx, next); + else + SLIST_REMOVE_AFTER(lp2, next); free(tlp); } else { lp2 = lp; - lp = lp->next; + lp = SLIST_NEXT(lp, next); } - return head; } - /* * if do_tty says ok, login a user */ -struct utmp_list * -log_in(struct utmp_list *head, struct utmpx *up) +static void +log_in(struct utmpx *up) { - struct utmp_list *lp; + struct utmpx_entry *lp; /* * this could be a login. if we're not dealing with @@ -432,198 +365,150 @@ log_in(struct utmp_list *head, struct ut * SunOS 4.0.2 does not treat ":0.0" as special but we * do. */ - if (on_console(head)) - return head; + if (on_console()) + return; /* * ok, no recorded login, so they were here when wtmp * started! Adjust ut_time! */ - up->ut_time = FirstTime; + up->ut_tv = FirstTime; /* * this allows us to pick the right logout */ - strlcpy(up->ut_line, Console, sizeof (up->ut_line)); + strlcpy(up->ut_line, Console, sizeof(up->ut_line)); } #endif /* * If we are doing specified ttys only, we ignore * anything else. */ - if (Flags & AC_T) - if (!do_tty(up->ut_line)) - return head; + if (Flags & AC_T && !do_tty(up->ut_line)) + return; /* * go ahead and log them in */ - if ((lp = NEW(struct utmp_list)) == NULL) + if ((lp = malloc(sizeof(*lp))) == NULL) errx(1, "malloc failed"); - lp->next = head; - head = lp; - memmove(&lp->usr, up, sizeof *up); -#ifdef DEBUG - if (Debug) { - printf("%s logged in", debug_pfx(&lp->usr, up)); - if (*up->ut_host) - printf(" (%-.*s)", (int)sizeof(up->ut_host), - up->ut_host); - putchar('\n'); - } + SLIST_INSERT_HEAD(&CurUtmpx, lp, next); + strlcpy(lp->user, up->ut_user, sizeof(lp->user)); + memcpy(lp->id, up->ut_id, sizeof(lp->id)); +#ifdef CONSOLE_TTY + memcpy(lp->line, up->ut_line, sizeof(lp->line)); #endif - return head; + lp->time = up->ut_tv; } -int +static void ac(const char *file) { - struct utmp_list *lp, *head = NULL; + struct utmpx_entry *lp; struct utmpx *usr, usht; struct tm *ltm; - time_t prev_secs, secs, ut_timecopy; - int day, rfound, tchanged, tskipped; + struct timeval prev_secs, ut_timecopy, secs, clock_shift, now; + int day, rfound; day = -1; - prev_secs = 1; /* Minimum acceptable date == 1970 */ - rfound = tchanged = tskipped = 0; - secs = 0; + timerclear(&prev_secs); /* Minimum acceptable date == 1970. */ + timerclear(&secs); + timerclear(&clock_shift); + rfound = 0; if (setutxdb(UTXDB_LOG, file) != 0) err(1, "%s", file); while ((usr = getutxent()) != NULL) { rfound++; - ut_timecopy = usr->ut_tv.tv_sec; - /* - * With sparc64 using 64-bit time_t's, there is some system - * routine which sets ut_time==0 (the high-order word of a - * 64-bit time) instead of a 32-bit time value. For those - * wtmp files, it is "more-accurate" to substitute the most- - * recent time found, instead of throwing away the entire - * record. While it is still just a guess, it is a better - * guess than throwing away a log-off record and therefore - * counting a session as if it continued to the end of the - * month, or the next system-reboot. - */ - if (ut_timecopy == 0 && prev_secs > 1) { -#ifdef DEBUG - if (Debug) - printf("%s - date changed to: %s", - debug_pfx(usr, usr), ctime(&prev_secs)); -#endif - tchanged++; - usr->ut_tv.tv_sec = ut_timecopy = prev_secs; - } - /* - * Skip records where the time goes backwards. - */ - if (ut_timecopy < prev_secs) { -#ifdef DEBUG - if (Debug) - printf("%s - bad date, record skipped\n", - debug_pfx(usr, usr)); -#endif - tskipped++; - continue; /* Skip this invalid record. */ - } + ut_timecopy = usr->ut_tv; + /* Don't let the time run backwards. */ + if (timercmp(&ut_timecopy, &prev_secs, <)) + ut_timecopy = prev_secs; prev_secs = ut_timecopy; - if (!FirstTime) + if (!timerisset(&FirstTime)) FirstTime = ut_timecopy; if (Flags & AC_D) { - ltm = localtime(&ut_timecopy); + ltm = localtime(&ut_timecopy.tv_sec); if (day >= 0 && day != ltm->tm_yday) { day = ltm->tm_yday; /* * print yesterday's total */ secs = ut_timecopy; - secs -= ltm->tm_sec; - secs -= 60 * ltm->tm_min; - secs -= 3600 * ltm->tm_hour; - show_today(Users, head, secs); + secs.tv_sec -= ltm->tm_sec; + secs.tv_sec -= 60 * ltm->tm_min; + secs.tv_sec -= 3600 * ltm->tm_hour; + secs.tv_usec = 0; + show_today(secs); } else day = ltm->tm_yday; } switch(usr->ut_type) { case OLD_TIME: - secs = ut_timecopy; + clock_shift = ut_timecopy; break; case NEW_TIME: - secs -= ut_timecopy; + timersub(&clock_shift, &ut_timecopy, &clock_shift); /* * adjust time for those logged in */ - for (lp = head; lp != NULL; lp = lp->next) - lp->usr.ut_tv.tv_sec -= secs; + SLIST_FOREACH(lp, &CurUtmpx, next) + timersub(&lp->time, &clock_shift, &lp->time); break; case BOOT_TIME: case SHUTDOWN_TIME: - head = log_out(head, usr); + log_out(usr); FirstTime = ut_timecopy; /* shouldn't be needed */ break; case USER_PROCESS: /* - * if they came in on tty[p-sP-S]*, then it is only - * a login session if the ut_host field is non-empty + * If they came in on pts/..., then it is only + * a login session if the ut_host field is non-empty. */ - if (strncmp(usr->ut_line, "tty", 3) != 0 || - strchr("pqrsPQRS", usr->ut_line[3]) == NULL || + if (strncmp(usr->ut_line, "pts/", 4) != 0 || *usr->ut_host != '\0') - head = log_in(head, usr); -#ifdef DEBUG - else if (Debug > 1) - /* Things such as 'screen' sessions. */ - printf("%s - record ignored\n", - debug_pfx(usr, usr)); -#endif + log_in(usr); break; case DEAD_PROCESS: - head = log_out(head, usr); + log_out(usr); break; } } endutxent(); - if (!(Flags & AC_W)) - usht.ut_tv.tv_sec = time(NULL); + (void)gettimeofday(&now, NULL); + if (Flags & AC_W) + usht.ut_tv = ut_timecopy; else - usht.ut_tv.tv_sec = ut_timecopy; + usht.ut_tv = now; usht.ut_type = SHUTDOWN_TIME; if (Flags & AC_D) { - ltm = localtime(&ut_timecopy); + ltm = localtime(&ut_timecopy.tv_sec); if (day >= 0 && day != ltm->tm_yday) { /* * print yesterday's total */ secs = ut_timecopy; - secs -= ltm->tm_sec; - secs -= 60 * ltm->tm_min; - secs -= 3600 * ltm->tm_hour; - show_today(Users, head, secs); + secs.tv_sec -= ltm->tm_sec; + secs.tv_sec -= 60 * ltm->tm_min; + secs.tv_sec -= 3600 * ltm->tm_hour; + secs.tv_usec = 0; + show_today(secs); } } /* * anyone still logged in gets time up to now */ - head = log_out(head, &usht); + log_out(&usht); if (Flags & AC_D) - show_today(Users, head, time((time_t *)0)); + show_today(now); else { if (Flags & AC_P) - show_users(Users); + show_users(); show("total", Total); } - - if (tskipped > 0) - printf("(Skipped %d of %d records due to invalid time values)\n", - tskipped, rfound); - if (tchanged > 0) - printf("(Changed %d of %d records to have a more likely time value)\n", - tchanged, rfound); - - return 0; } -void +static void usage(void) { (void)fprintf(stderr, From owner-svn-src-stable-9@FreeBSD.ORG Sun Nov 11 12:12:44 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DE6C2CF5; Sun, 11 Nov 2012 12:12:44 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C48DB8FC08; Sun, 11 Nov 2012 12:12:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qABCCi1M081557; Sun, 11 Nov 2012 12:12:44 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qABCCiHA081554; Sun, 11 Nov 2012 12:12:44 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201211111212.qABCCiHA081554@svn.freebsd.org> From: Ed Schouten Date: Sun, 11 Nov 2012 12:12:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242892 - in stable/9/sys: kern sys X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Nov 2012 12:12:44 -0000 Author: ed Date: Sun Nov 11 12:12:44 2012 New Revision: 242892 URL: http://svnweb.freebsd.org/changeset/base/242892 Log: MFC r241161: Fix faulty error code handling in read(2) on TTYs. When performing a non-blocking read(2), on a TTY while no data is available, we should return EAGAIN. But if there's a modem disconnect, we should return 0. Right now we only return 0 when doing a blocking read, which is wrong. MFC r242078: Correct SIGTTIN handling. In the old TTY layer, SIGTTIN was correctly handled like this: while (data should be read) { send SIGTTIN if not foreground process group read data } In the new TTY layer, however, this behaviour was changed, based on a false interpretation of the standard: send SIGTTIN if not foreground process group while (data should be read) { read data } Correct this by pushing tty_wait_background() into the ttydisc_read_*() functions. Reported by: koitsu PR: kern/173010 Modified: stable/9/sys/kern/tty.c stable/9/sys/kern/tty_ttydisc.c stable/9/sys/sys/tty.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/tty.c ============================================================================== --- stable/9/sys/kern/tty.c Sun Nov 11 12:06:12 2012 (r242891) +++ stable/9/sys/kern/tty.c Sun Nov 11 12:12:44 2012 (r242892) @@ -361,7 +361,7 @@ tty_is_ctty(struct tty *tp, struct proc return (p->p_session == tp->t_session && p->p_flag & P_CONTROLT); } -static int +int tty_wait_background(struct tty *tp, struct thread *td, int sig) { struct proc *p = td->td_proc; @@ -433,13 +433,6 @@ ttydev_read(struct cdev *dev, struct uio error = ttydev_enter(tp); if (error) goto done; - - error = tty_wait_background(tp, curthread, SIGTTIN); - if (error) { - tty_unlock(tp); - goto done; - } - error = ttydisc_read(tp, uio, ioflag); tty_unlock(tp); Modified: stable/9/sys/kern/tty_ttydisc.c ============================================================================== --- stable/9/sys/kern/tty_ttydisc.c Sun Nov 11 12:06:12 2012 (r242891) +++ stable/9/sys/kern/tty_ttydisc.c Sun Nov 11 12:12:44 2012 (r242892) @@ -126,6 +126,10 @@ ttydisc_read_canonical(struct tty *tp, s breakc[n] = '\0'; do { + error = tty_wait_background(tp, curthread, SIGTTIN); + if (error) + return (error); + /* * Quite a tricky case: unlike the old TTY * implementation, this implementation copies data back @@ -149,10 +153,10 @@ ttydisc_read_canonical(struct tty *tp, s /* No more data. */ if (clen == 0) { - if (ioflag & IO_NDELAY) - return (EWOULDBLOCK); - else if (tp->t_flags & TF_ZOMBIE) + if (tp->t_flags & TF_ZOMBIE) return (0); + else if (ioflag & IO_NDELAY) + return (EWOULDBLOCK); error = tty_wait(tp, &tp->t_inwait); if (error) @@ -192,6 +196,10 @@ ttydisc_read_raw_no_timer(struct tty *tp */ for (;;) { + error = tty_wait_background(tp, curthread, SIGTTIN); + if (error) + return (error); + error = ttyinq_read_uio(&tp->t_inq, tp, uio, uio->uio_resid, 0); if (error) @@ -200,10 +208,10 @@ ttydisc_read_raw_no_timer(struct tty *tp return (0); /* We have to wait for more. */ - if (ioflag & IO_NDELAY) - return (EWOULDBLOCK); - else if (tp->t_flags & TF_ZOMBIE) + if (tp->t_flags & TF_ZOMBIE) return (0); + else if (ioflag & IO_NDELAY) + return (EWOULDBLOCK); error = tty_wait(tp, &tp->t_inwait); if (error) @@ -229,6 +237,10 @@ ttydisc_read_raw_read_timer(struct tty * timevaladd(&end, &now); for (;;) { + error = tty_wait_background(tp, curthread, SIGTTIN); + if (error) + return (error); + error = ttyinq_read_uio(&tp->t_inq, tp, uio, uio->uio_resid, 0); if (error) @@ -248,10 +260,10 @@ ttydisc_read_raw_read_timer(struct tty * * We have to wait for more. If the timer expires, we * should return a 0-byte read. */ - if (ioflag & IO_NDELAY) - return (EWOULDBLOCK); - else if (tp->t_flags & TF_ZOMBIE) + if (tp->t_flags & TF_ZOMBIE) return (0); + else if (ioflag & IO_NDELAY) + return (EWOULDBLOCK); error = tty_timedwait(tp, &tp->t_inwait, hz); if (error) @@ -278,6 +290,10 @@ ttydisc_read_raw_interbyte_timer(struct */ for (;;) { + error = tty_wait_background(tp, curthread, SIGTTIN); + if (error) + return (error); + error = ttyinq_read_uio(&tp->t_inq, tp, uio, uio->uio_resid, 0); if (error) @@ -293,10 +309,10 @@ ttydisc_read_raw_interbyte_timer(struct break; /* We have to wait for more. */ - if (ioflag & IO_NDELAY) - return (EWOULDBLOCK); - else if (tp->t_flags & TF_ZOMBIE) + if (tp->t_flags & TF_ZOMBIE) return (0); + else if (ioflag & IO_NDELAY) + return (EWOULDBLOCK); error = tty_wait(tp, &tp->t_inwait); if (error) Modified: stable/9/sys/sys/tty.h ============================================================================== --- stable/9/sys/sys/tty.h Sun Nov 11 12:06:12 2012 (r242891) +++ stable/9/sys/sys/tty.h Sun Nov 11 12:12:44 2012 (r242892) @@ -180,6 +180,7 @@ void tty_signal_sessleader(struct tty *t void tty_signal_pgrp(struct tty *tp, int signal); /* Waking up readers/writers. */ int tty_wait(struct tty *tp, struct cv *cv); +int tty_wait_background(struct tty *tp, struct thread *td, int sig); int tty_timedwait(struct tty *tp, struct cv *cv, int timo); void tty_wakeup(struct tty *tp, int flags); From owner-svn-src-stable-9@FreeBSD.ORG Sun Nov 11 12:21:52 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7A5A9F49; Sun, 11 Nov 2012 12:21:52 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 581AD8FC08; Sun, 11 Nov 2012 12:21:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qABCLqZU083149; Sun, 11 Nov 2012 12:21:52 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qABCLqD9083144; Sun, 11 Nov 2012 12:21:52 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201211111221.qABCLqD9083144@svn.freebsd.org> From: Ed Schouten Date: Sun, 11 Nov 2012 12:21:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242893 - in stable/9: share/man/man3 sys/sys X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Nov 2012 12:21:52 -0000 Author: ed Date: Sun Nov 11 12:21:51 2012 New Revision: 242893 URL: http://svnweb.freebsd.org/changeset/base/242893 Log: MFC r240422, r240426 and r240450: Implement LIST_PREV(). Regular LISTs have been implemented in such a way that the prev-pointer does not point to the previous element, but to the next-pointer stored in the previous element. This is done to simplify LIST_REMOVE(). This macro can be implemented without knowing the address of the list head. Unfortunately this makes it harder to implement LIST_PREV(), which is why this macro was never here. Still, it is possible to implement this macro. If the prev-pointer points to the list head, we return NULL. Otherwise we simply subtract the offset of the prev-pointer within the structure. It's not as efficient as traversing forward of course, but in practice it shouldn't be that bad. In almost all use cases, people will want to compare the value returned by LIST_PREV() against NULL, so an optimizing compiler will not emit code that does more branching than TAILQs. While there, add __containerof(). Compared to __member2struct(), this macro has the following advantages: - It ensures that the type of the pointer is compatible with the member field of the structure (or a void pointer). - It works properly in combination with volatile and const, though unfortunately it drops these qualifiers from the returned value. mdf@ proposed to add the container_of() macro, just like Linux has. Eventually I decided against this, as is included all over the place. It seems container_of() on Linux is specific to the kernel, not userspace. I'd rather not pollute userspace with this. I also thought about adding __container_of(), but this would have two advantages. Xorg seems to already have a __container_of(), which is not compatible with this version. Also, the underscore in the middle conflicts with our existing macros (__offsetof, __rangeof, etc). Modified: stable/9/share/man/man3/Makefile stable/9/share/man/man3/queue.3 stable/9/sys/sys/cdefs.h stable/9/sys/sys/param.h stable/9/sys/sys/queue.h Directory Properties: stable/9/share/man/man3/ (props changed) stable/9/sys/ (props changed) Modified: stable/9/share/man/man3/Makefile ============================================================================== --- stable/9/share/man/man3/Makefile Sun Nov 11 12:12:44 2012 (r242892) +++ stable/9/share/man/man3/Makefile Sun Nov 11 12:21:51 2012 (r242893) @@ -52,6 +52,7 @@ MLINKS+= queue.3 LIST_EMPTY.3 \ queue.3 LIST_INSERT_BEFORE.3 \ queue.3 LIST_INSERT_HEAD.3 \ queue.3 LIST_NEXT.3 \ + queue.3 LIST_PREV.3 \ queue.3 LIST_REMOVE.3 \ queue.3 LIST_SWAP.3 \ queue.3 SLIST_EMPTY.3 \ Modified: stable/9/share/man/man3/queue.3 ============================================================================== --- stable/9/share/man/man3/queue.3 Sun Nov 11 12:12:44 2012 (r242892) +++ stable/9/share/man/man3/queue.3 Sun Nov 11 12:21:51 2012 (r242893) @@ -32,7 +32,7 @@ .\" @(#)queue.3 8.2 (Berkeley) 1/24/94 .\" $FreeBSD$ .\" -.Dd May 13, 2011 +.Dd Sep 12, 2012 .Dt QUEUE 3 .Os .Sh NAME @@ -81,6 +81,7 @@ .Nm LIST_INSERT_BEFORE , .Nm LIST_INSERT_HEAD , .Nm LIST_NEXT , +.Nm LIST_PREV , .Nm LIST_REMOVE , .Nm LIST_SWAP , .Nm TAILQ_CONCAT , @@ -155,6 +156,7 @@ lists and tail queues .Fn LIST_INSERT_BEFORE "TYPE *listelm" "TYPE *elm" "LIST_ENTRY NAME" .Fn LIST_INSERT_HEAD "LIST_HEAD *head" "TYPE *elm" "LIST_ENTRY NAME" .Fn LIST_NEXT "TYPE *elm" "LIST_ENTRY NAME" +.Fn LIST_PREV "TYPE *elm" "LIST_HEAD *head" "TYPE" "LIST_ENTRY NAME" .Fn LIST_REMOVE "TYPE *elm" "LIST_ENTRY NAME" .Fn LIST_SWAP "LIST_HEAD *head1" "LIST_HEAD *head2" "TYPE" "LIST_ENTRY NAME" .\" @@ -248,8 +250,18 @@ Code size and execution time of operatio twice that of the singly-linked data-structures. .El .Pp -Linked lists are the simplest of the doubly linked data structures and support -only the above functionality over singly-linked lists. +Linked lists are the simplest of the doubly linked data structures. +They add the following functionality over the above: +.Bl -enum -compact -offset indent +.It +They may be traversed backwards. +.El +However: +.Bl -enum -compact -offset indent +.It +To traverse backwards, an entry to begin the traversal and the list in +which it is contained must be specified. +.El .Pp Tail queues add the following functionality: .Bl -enum -compact -offset indent @@ -763,6 +775,14 @@ The macro returns the next element in the list, or NULL if this is the last. .Pp The macro +.Nm LIST_PREV +returns the previous element in the list, or NULL if this is the first. +List +.Fa head +must contain element +.Fa elm . +.Pp +The macro .Nm LIST_REMOVE removes the element .Fa elm Modified: stable/9/sys/sys/cdefs.h ============================================================================== --- stable/9/sys/sys/cdefs.h Sun Nov 11 12:12:44 2012 (r242892) +++ stable/9/sys/sys/cdefs.h Sun Nov 11 12:21:51 2012 (r242893) @@ -404,6 +404,22 @@ (__offsetof(type, end) - __offsetof(type, start)) /* + * Given the pointer x to the member m of the struct s, return + * a pointer to the containing structure. When using GCC, we first + * assign pointer x to a local variable, to check that its type is + * compatible with member m. + */ +#if __GNUC_PREREQ__(3, 1) +#define __containerof(x, s, m) ({ \ + const volatile __typeof(((s *)0)->m) *__x = (x); \ + __DEQUALIFY(s *, (const volatile char *)__x - __offsetof(s, m));\ +}) +#else +#define __containerof(x, s, m) \ + __DEQUALIFY(s *, (const volatile char *)(x) - __offsetof(s, m)) +#endif + +/* * Compiler-dependent macros to declare that functions take printf-like * or scanf-like arguments. They are null except for versions of gcc * that are known to support the features properly (old versions of gcc-2 Modified: stable/9/sys/sys/param.h ============================================================================== --- stable/9/sys/sys/param.h Sun Nov 11 12:12:44 2012 (r242892) +++ stable/9/sys/sys/param.h Sun Nov 11 12:21:51 2012 (r242893) @@ -331,8 +331,7 @@ __END_DECLS ((db) << (PAGE_SHIFT - DEV_BSHIFT)) /* - * Given the pointer x to the member m of the struct s, return - * a pointer to the containing structure. + * Old spelling of __containerof(). */ #define member2struct(s, m, x) \ ((struct s *)(void *)((char *)(x) - offsetof(struct s, m))) Modified: stable/9/sys/sys/queue.h ============================================================================== --- stable/9/sys/sys/queue.h Sun Nov 11 12:12:44 2012 (r242892) +++ stable/9/sys/sys/queue.h Sun Nov 11 12:21:51 2012 (r242893) @@ -65,7 +65,7 @@ * so that an arbitrary element can be removed without a need to * traverse the list. New elements can be added to the list before * or after an existing element or at the head of the list. A list - * may only be traversed in the forward direction. + * may be traversed in either direction. * * A tail queue is headed by a pair of pointers, one to the head of the * list and the other to the tail of the list. The elements are doubly @@ -85,7 +85,7 @@ * _EMPTY + + + + * _FIRST + + + + * _NEXT + + + + - * _PREV - - - + + * _PREV - + - + * _LAST - - + + * _FOREACH + + + + * _FOREACH_SAFE + + + + @@ -287,10 +287,8 @@ struct { \ } while (0) #define STAILQ_LAST(head, type, field) \ - (STAILQ_EMPTY((head)) ? \ - NULL : \ - ((struct type *)(void *) \ - ((char *)((head)->stqh_last) - __offsetof(struct type, field)))) + (STAILQ_EMPTY((head)) ? NULL : \ + __containerof((head)->stqh_last, struct type, field.stqe_next)) #define STAILQ_NEXT(elm, field) ((elm)->field.stqe_next) @@ -425,6 +423,10 @@ struct { \ #define LIST_NEXT(elm, field) ((elm)->field.le_next) +#define LIST_PREV(elm, head, type, field) \ + ((elm)->field.le_prev == &LIST_FIRST((head)) ? NULL : \ + __containerof((elm)->field.le_prev, struct type, field.le_next)) + #define LIST_REMOVE(elm, field) do { \ QMD_SAVELINK(oldnext, (elm)->field.le_next); \ QMD_SAVELINK(oldprev, (elm)->field.le_prev); \ From owner-svn-src-stable-9@FreeBSD.ORG Sun Nov 11 23:29:45 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DB96F447; Sun, 11 Nov 2012 23:29:45 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id BE64A8FC08; Sun, 11 Nov 2012 23:29:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qABNTjcs016531; Sun, 11 Nov 2012 23:29:45 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qABNTjqs016530; Sun, 11 Nov 2012 23:29:45 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201211112329.qABNTjqs016530@svn.freebsd.org> From: Devin Teske Date: Sun, 11 Nov 2012 23:29:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242902 - stable/9/usr.sbin/sysinstall X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Nov 2012 23:29:45 -0000 Author: dteske Date: Sun Nov 11 23:29:45 2012 New Revision: 242902 URL: http://svnweb.freebsd.org/changeset/base/242902 Log: Fix a regression introduced by SVN r211417 that saw the breakage of a feature documented in usr.sbin/sysinstall/help/shortcuts.hlp (reproduced below): If /usr/sbin/sysinstall is linked to another filename, say `/usr/local/bin/configPackages', then the basename will be used as an implicit command name. Reviewed by: adrian (co-mentor) Approved by: adrian (co-mentor) Modified: stable/9/usr.sbin/sysinstall/main.c Modified: stable/9/usr.sbin/sysinstall/main.c ============================================================================== --- stable/9/usr.sbin/sysinstall/main.c Sun Nov 11 23:25:47 2012 (r242901) +++ stable/9/usr.sbin/sysinstall/main.c Sun Nov 11 23:29:45 2012 (r242902) @@ -165,14 +165,21 @@ main(int argc, char **argv) /* First, see if we have any arguments to process (and argv[0] counts if it's not "sysinstall") */ if (!RunningAsInit) { - for (i = optionArgs+1; i < argc; i++) { + int start_arg; + + if (!strstr(argv[0], "sysinstall")) + start_arg = 0; + else + start_arg = optionArgs + 1; + + for (i = start_arg; i < argc; i++) { if (DITEM_STATUS(dispatchCommand(argv[i])) != DITEM_SUCCESS) systemShutdown(1); } /* If we were given commands to process on the command line, just exit * now */ - if (argc > optionArgs+1) + if (argc > start_arg) systemShutdown(0); } else From owner-svn-src-stable-9@FreeBSD.ORG Mon Nov 12 07:30:24 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8E2C7ECD; Mon, 12 Nov 2012 07:30:24 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 6F2468FC0C; Mon, 12 Nov 2012 07:30:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAC7UOrA076107; Mon, 12 Nov 2012 07:30:24 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAC7UOH3076106; Mon, 12 Nov 2012 07:30:24 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201211120730.qAC7UOH3076106@svn.freebsd.org> From: Dimitry Andric Date: Mon, 12 Nov 2012 07:30:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242907 - stable/9/sys/boot/i386/boot2 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Nov 2012 07:30:24 -0000 Author: dim Date: Mon Nov 12 07:30:24 2012 New Revision: 242907 URL: http://svnweb.freebsd.org/changeset/base/242907 Log: MFC r242804: Shrink boot2 by 8 bytes, by eliminating some unneeded instructions in sio.S. This is not particularly needed for head right now, but it is intended to merge to stable/9, to fix boot2 build with clang there. Reviewed by: avg Modified: stable/9/sys/boot/i386/boot2/sio.S Directory Properties: stable/9/sys/ (props changed) stable/9/sys/boot/ (props changed) Modified: stable/9/sys/boot/i386/boot2/sio.S ============================================================================== --- stable/9/sys/boot/i386/boot2/sio.S Mon Nov 12 07:25:51 2012 (r242906) +++ stable/9/sys/boot/i386/boot2/sio.S Mon Nov 12 07:30:24 2012 (r242907) @@ -40,13 +40,11 @@ sio_init: pushl %eax movb $0x3,%al # Set RTS, outb %al,(%dx) # DTR incl %edx # Line status reg - call sio_flush - ret + # Fallthrough /* int sio_flush(void) */ -sio_flush: xorl %eax,%eax # Return value - xorl %ecx,%ecx # Timeout +sio_flush: xorl %ecx,%ecx # Timeout movb $0x80,%ch # counter sio_flush.1: call sio_ischar # Check for character jz sio_flush.2 # Till none From owner-svn-src-stable-9@FreeBSD.ORG Mon Nov 12 07:34:07 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E956FC5; Mon, 12 Nov 2012 07:34:06 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C63E98FC0C; Mon, 12 Nov 2012 07:34:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAC7Y6FS076624; Mon, 12 Nov 2012 07:34:06 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAC7Y5x2076582; Mon, 12 Nov 2012 07:34:05 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201211120734.qAC7Y5x2076582@svn.freebsd.org> From: Dimitry Andric Date: Mon, 12 Nov 2012 07:34:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242908 - in stable/9/sys: dev/ale dev/ata dev/ata/chipsets dev/ath/ath_hal/ar5212 dev/bge dev/cas dev/dc dev/flash dev/fxp dev/gem dev/lge dev/mii dev/nge dev/pci dev/re dev/sis dev/st... X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Nov 2012 07:34:07 -0000 Author: dim Date: Mon Nov 12 07:34:05 2012 New Revision: 242908 URL: http://svnweb.freebsd.org/changeset/base/242908 Log: MFC r242625: Remove duplicate const specifiers in many drivers (I hope I got all of them, please let me know if not). Most of these are of the form: static const struct bzzt_type { [...list of members...] } const bzzt_devs[] = { [...list of initializers...] }; The second const is unnecessary, as arrays cannot be modified anyway, and if the elements are const, the whole thing is const automatically (e.g. it is placed in .rodata). I have verified this does not change the binary output of a full kernel build (except for build timestamps embedded in the object files). Reviewed by: yongari, marius Modified: stable/9/sys/dev/ale/if_ale.c stable/9/sys/dev/ata/ata-card.c stable/9/sys/dev/ata/chipsets/ata-acard.c stable/9/sys/dev/ata/chipsets/ata-acerlabs.c stable/9/sys/dev/ata/chipsets/ata-adaptec.c stable/9/sys/dev/ata/chipsets/ata-amd.c stable/9/sys/dev/ata/chipsets/ata-ati.c stable/9/sys/dev/ata/chipsets/ata-highpoint.c stable/9/sys/dev/ata/chipsets/ata-intel.c stable/9/sys/dev/ata/chipsets/ata-ite.c stable/9/sys/dev/ata/chipsets/ata-jmicron.c stable/9/sys/dev/ata/chipsets/ata-marvell.c stable/9/sys/dev/ata/chipsets/ata-nvidia.c stable/9/sys/dev/ata/chipsets/ata-promise.c stable/9/sys/dev/ata/chipsets/ata-serverworks.c stable/9/sys/dev/ata/chipsets/ata-siliconimage.c stable/9/sys/dev/ata/chipsets/ata-sis.c stable/9/sys/dev/ata/chipsets/ata-via.c stable/9/sys/dev/ath/ath_hal/ar5212/ar5212.h stable/9/sys/dev/bge/if_bge.c stable/9/sys/dev/cas/if_cas.c stable/9/sys/dev/dc/if_dc.c stable/9/sys/dev/flash/at45d.c stable/9/sys/dev/fxp/if_fxp.c stable/9/sys/dev/gem/if_gem_pci.c stable/9/sys/dev/lge/if_lge.c stable/9/sys/dev/mii/mii.c stable/9/sys/dev/nge/if_nge.c stable/9/sys/dev/pci/pci.c stable/9/sys/dev/re/if_re.c stable/9/sys/dev/sis/if_sis.c stable/9/sys/dev/ste/if_ste.c stable/9/sys/dev/stge/if_stge.c stable/9/sys/dev/ti/if_ti.c stable/9/sys/dev/tl/if_tl.c stable/9/sys/dev/vr/if_vr.c stable/9/sys/dev/wb/if_wb.c stable/9/sys/dev/xl/if_xl.c stable/9/sys/pci/if_rl.c stable/9/sys/sparc64/pci/fire.c stable/9/sys/sparc64/pci/psycho.c stable/9/sys/sparc64/pci/schizo.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/ale/if_ale.c ============================================================================== --- stable/9/sys/dev/ale/if_ale.c Mon Nov 12 07:30:24 2012 (r242907) +++ stable/9/sys/dev/ale/if_ale.c Mon Nov 12 07:34:05 2012 (r242908) @@ -95,7 +95,7 @@ static const struct ale_dev { uint16_t ale_vendorid; uint16_t ale_deviceid; const char *ale_name; -} const ale_devs[] = { +} ale_devs[] = { { VENDORID_ATHEROS, DEVICEID_ATHEROS_AR81XX, "Atheros AR8121/AR8113/AR8114 PCIe Ethernet" }, }; Modified: stable/9/sys/dev/ata/ata-card.c ============================================================================== --- stable/9/sys/dev/ata/ata-card.c Mon Nov 12 07:30:24 2012 (r242907) +++ stable/9/sys/dev/ata/ata-card.c Mon Nov 12 07:34:05 2012 (r242908) @@ -49,7 +49,7 @@ __FBSDID("$FreeBSD$"); #include "pccarddevs.h" -static const struct pccard_product const ata_pccard_products[] = { +static const struct pccard_product ata_pccard_products[] = { PCMCIA_CARD(FREECOM, PCCARDIDE), PCMCIA_CARD(EXP, EXPMULTIMEDIA), PCMCIA_CARD(IODATA3, CBIDE2), Modified: stable/9/sys/dev/ata/chipsets/ata-acard.c ============================================================================== --- stable/9/sys/dev/ata/chipsets/ata-acard.c Mon Nov 12 07:30:24 2012 (r242907) +++ stable/9/sys/dev/ata/chipsets/ata-acard.c Mon Nov 12 07:34:05 2012 (r242908) @@ -81,7 +81,7 @@ static int ata_acard_probe(device_t dev) { struct ata_pci_controller *ctlr = device_get_softc(dev); - static const struct ata_chip_id const ids[] = + static const struct ata_chip_id ids[] = {{ ATA_ATP850R, 0, ATP_OLD, 0x00, ATA_UDMA2, "ATP850" }, { ATA_ATP860A, 0, 0, 0x00, ATA_UDMA4, "ATP860A" }, { ATA_ATP860R, 0, 0, 0x00, ATA_UDMA4, "ATP860R" }, Modified: stable/9/sys/dev/ata/chipsets/ata-acerlabs.c ============================================================================== --- stable/9/sys/dev/ata/chipsets/ata-acerlabs.c Mon Nov 12 07:30:24 2012 (r242907) +++ stable/9/sys/dev/ata/chipsets/ata-acerlabs.c Mon Nov 12 07:34:05 2012 (r242908) @@ -75,7 +75,7 @@ static int ata_ali_probe(device_t dev) { struct ata_pci_controller *ctlr = device_get_softc(dev); - static const struct ata_chip_id const ids[] = + static const struct ata_chip_id ids[] = {{ ATA_ALI_5289, 0x00, 2, ALI_SATA, ATA_SA150, "M5289" }, { ATA_ALI_5288, 0x00, 4, ALI_SATA, ATA_SA300, "M5288" }, { ATA_ALI_5287, 0x00, 4, ALI_SATA, ATA_SA150, "M5287" }, Modified: stable/9/sys/dev/ata/chipsets/ata-adaptec.c ============================================================================== --- stable/9/sys/dev/ata/chipsets/ata-adaptec.c Mon Nov 12 07:30:24 2012 (r242907) +++ stable/9/sys/dev/ata/chipsets/ata-adaptec.c Mon Nov 12 07:34:05 2012 (r242908) @@ -62,7 +62,7 @@ static int ata_adaptec_probe(device_t dev) { struct ata_pci_controller *ctlr = device_get_softc(dev); - static const struct ata_chip_id const ids[] = + static const struct ata_chip_id ids[] = {{ ATA_ADAPTEC_1420, 0, 4, MV_60XX, ATA_SA300, "1420SA" }, { ATA_ADAPTEC_1430, 0, 4, MV_7042, ATA_SA300, "1430SA" }, { 0, 0, 0, 0, 0, 0}}; Modified: stable/9/sys/dev/ata/chipsets/ata-amd.c ============================================================================== --- stable/9/sys/dev/ata/chipsets/ata-amd.c Mon Nov 12 07:30:24 2012 (r242907) +++ stable/9/sys/dev/ata/chipsets/ata-amd.c Mon Nov 12 07:34:05 2012 (r242908) @@ -67,7 +67,7 @@ static int ata_amd_probe(device_t dev) { struct ata_pci_controller *ctlr = device_get_softc(dev); - static const struct ata_chip_id const ids[] = + static const struct ata_chip_id ids[] = {{ ATA_AMD756, 0x00, 0x00, 0, ATA_UDMA4, "756" }, { ATA_AMD766, 0x00, AMD_CABLE|AMD_BUG, 0, ATA_UDMA5, "766" }, { ATA_AMD768, 0x00, AMD_CABLE, 0, ATA_UDMA5, "768" }, Modified: stable/9/sys/dev/ata/chipsets/ata-ati.c ============================================================================== --- stable/9/sys/dev/ata/chipsets/ata-ati.c Mon Nov 12 07:30:24 2012 (r242907) +++ stable/9/sys/dev/ata/chipsets/ata-ati.c Mon Nov 12 07:34:05 2012 (r242908) @@ -75,7 +75,7 @@ static int ata_ati_probe(device_t dev) { struct ata_pci_controller *ctlr = device_get_softc(dev); - static const struct ata_chip_id const ids[] = + static const struct ata_chip_id ids[] = {{ ATA_ATI_IXP200, 0x00, ATI_PATA, 0, ATA_UDMA5, "IXP200" }, { ATA_ATI_IXP300, 0x00, ATI_PATA, 0, ATA_UDMA6, "IXP300" }, { ATA_ATI_IXP300_S1, 0x00, ATI_SATA, SII_BUG, ATA_SA150, "IXP300" }, Modified: stable/9/sys/dev/ata/chipsets/ata-highpoint.c ============================================================================== --- stable/9/sys/dev/ata/chipsets/ata-highpoint.c Mon Nov 12 07:30:24 2012 (r242907) +++ stable/9/sys/dev/ata/chipsets/ata-highpoint.c Mon Nov 12 07:34:05 2012 (r242908) @@ -73,7 +73,7 @@ ata_highpoint_probe(device_t dev) { struct ata_pci_controller *ctlr = device_get_softc(dev); const struct ata_chip_id *idx; - static const struct ata_chip_id const ids[] = + static const struct ata_chip_id ids[] = {{ ATA_HPT374, 0x07, HPT_374, 0, ATA_UDMA6, "HPT374" }, { ATA_HPT372, 0x02, HPT_372, 0, ATA_UDMA6, "HPT372N" }, { ATA_HPT372, 0x01, HPT_372, 0, ATA_UDMA6, "HPT372" }, Modified: stable/9/sys/dev/ata/chipsets/ata-intel.c ============================================================================== --- stable/9/sys/dev/ata/chipsets/ata-intel.c Mon Nov 12 07:30:24 2012 (r242907) +++ stable/9/sys/dev/ata/chipsets/ata-intel.c Mon Nov 12 07:34:05 2012 (r242908) @@ -105,7 +105,7 @@ static int ata_intel_probe(device_t dev) { struct ata_pci_controller *ctlr = device_get_softc(dev); - static const struct ata_chip_id const ids[] = + static const struct ata_chip_id ids[] = {{ ATA_I82371FB, 0, 0, 2, ATA_WDMA2, "PIIX" }, { ATA_I82371SB, 0, 0, 2, ATA_WDMA2, "PIIX3" }, { ATA_I82371AB, 0, 0, 2, ATA_UDMA2, "PIIX4" }, Modified: stable/9/sys/dev/ata/chipsets/ata-ite.c ============================================================================== --- stable/9/sys/dev/ata/chipsets/ata-ite.c Mon Nov 12 07:30:24 2012 (r242907) +++ stable/9/sys/dev/ata/chipsets/ata-ite.c Mon Nov 12 07:34:05 2012 (r242908) @@ -64,7 +64,7 @@ static int ata_ite_probe(device_t dev) { struct ata_pci_controller *ctlr = device_get_softc(dev); - static const struct ata_chip_id const ids[] = + static const struct ata_chip_id ids[] = {{ ATA_IT8213F, 0x00, 0x00, 0x00, ATA_UDMA6, "IT8213F" }, { ATA_IT8212F, 0x00, 0x00, 0x00, ATA_UDMA6, "IT8212F" }, { ATA_IT8211F, 0x00, 0x00, 0x00, ATA_UDMA6, "IT8211F" }, Modified: stable/9/sys/dev/ata/chipsets/ata-jmicron.c ============================================================================== --- stable/9/sys/dev/ata/chipsets/ata-jmicron.c Mon Nov 12 07:30:24 2012 (r242907) +++ stable/9/sys/dev/ata/chipsets/ata-jmicron.c Mon Nov 12 07:34:05 2012 (r242908) @@ -64,7 +64,7 @@ ata_jmicron_probe(device_t dev) { struct ata_pci_controller *ctlr = device_get_softc(dev); const struct ata_chip_id *idx; - static const struct ata_chip_id const ids[] = + static const struct ata_chip_id ids[] = {{ ATA_JMB360, 0, 1, 0, ATA_SA300, "JMB360" }, { ATA_JMB361, 0, 1, 1, ATA_UDMA6, "JMB361" }, { ATA_JMB362, 0, 2, 0, ATA_SA300, "JMB362" }, Modified: stable/9/sys/dev/ata/chipsets/ata-marvell.c ============================================================================== --- stable/9/sys/dev/ata/chipsets/ata-marvell.c Mon Nov 12 07:30:24 2012 (r242907) +++ stable/9/sys/dev/ata/chipsets/ata-marvell.c Mon Nov 12 07:34:05 2012 (r242908) @@ -99,7 +99,7 @@ static int ata_marvell_probe(device_t dev) { struct ata_pci_controller *ctlr = device_get_softc(dev); - static const struct ata_chip_id const ids[] = + static const struct ata_chip_id ids[] = {{ ATA_M88SX5040, 0, 4, MV_50XX, ATA_SA150, "88SX5040" }, { ATA_M88SX5041, 0, 4, MV_50XX, ATA_SA150, "88SX5041" }, { ATA_M88SX5080, 0, 8, MV_50XX, ATA_SA150, "88SX5080" }, Modified: stable/9/sys/dev/ata/chipsets/ata-nvidia.c ============================================================================== --- stable/9/sys/dev/ata/chipsets/ata-nvidia.c Mon Nov 12 07:30:24 2012 (r242907) +++ stable/9/sys/dev/ata/chipsets/ata-nvidia.c Mon Nov 12 07:34:05 2012 (r242908) @@ -75,7 +75,7 @@ static int ata_nvidia_probe(device_t dev) { struct ata_pci_controller *ctlr = device_get_softc(dev); - static const struct ata_chip_id const ids[] = + static const struct ata_chip_id ids[] = {{ ATA_NFORCE1, 0, 0, 0, ATA_UDMA5, "nForce" }, { ATA_NFORCE2, 0, 0, 0, ATA_UDMA6, "nForce2" }, { ATA_NFORCE2_PRO, 0, 0, 0, ATA_UDMA6, "nForce2 Pro" }, Modified: stable/9/sys/dev/ata/chipsets/ata-promise.c ============================================================================== --- stable/9/sys/dev/ata/chipsets/ata-promise.c Mon Nov 12 07:30:24 2012 (r242907) +++ stable/9/sys/dev/ata/chipsets/ata-promise.c Mon Nov 12 07:34:05 2012 (r242908) @@ -130,7 +130,7 @@ ata_promise_probe(device_t dev) { struct ata_pci_controller *ctlr = device_get_softc(dev); const struct ata_chip_id *idx; - static const struct ata_chip_id const ids[] = + static const struct ata_chip_id ids[] = {{ ATA_PDC20246, 0, PR_OLD, 0x00, ATA_UDMA2, "PDC20246" }, { ATA_PDC20262, 0, PR_NEW, 0x00, ATA_UDMA4, "PDC20262" }, { ATA_PDC20263, 0, PR_NEW, 0x00, ATA_UDMA4, "PDC20263" }, Modified: stable/9/sys/dev/ata/chipsets/ata-serverworks.c ============================================================================== --- stable/9/sys/dev/ata/chipsets/ata-serverworks.c Mon Nov 12 07:30:24 2012 (r242907) +++ stable/9/sys/dev/ata/chipsets/ata-serverworks.c Mon Nov 12 07:34:05 2012 (r242908) @@ -75,7 +75,7 @@ static int ata_serverworks_probe(device_t dev) { struct ata_pci_controller *ctlr = device_get_softc(dev); - static const struct ata_chip_id const ids[] = + static const struct ata_chip_id ids[] = {{ ATA_ROSB4, 0x00, SWKS_33, 0, ATA_WDMA2, "ROSB4" }, { ATA_CSB5, 0x92, SWKS_100, 0, ATA_UDMA5, "CSB5" }, { ATA_CSB5, 0x00, SWKS_66, 0, ATA_UDMA4, "CSB5" }, Modified: stable/9/sys/dev/ata/chipsets/ata-siliconimage.c ============================================================================== --- stable/9/sys/dev/ata/chipsets/ata-siliconimage.c Mon Nov 12 07:30:24 2012 (r242907) +++ stable/9/sys/dev/ata/chipsets/ata-siliconimage.c Mon Nov 12 07:34:05 2012 (r242908) @@ -87,7 +87,7 @@ static int ata_sii_probe(device_t dev) { struct ata_pci_controller *ctlr = device_get_softc(dev); - static const struct ata_chip_id const ids[] = + static const struct ata_chip_id ids[] = {{ ATA_SII3114, 0x00, SII_MEMIO, SII_4CH, ATA_SA150, "3114" }, { ATA_SII3512, 0x02, SII_MEMIO, 0, ATA_SA150, "3512" }, { ATA_SII3112, 0x02, SII_MEMIO, 0, ATA_SA150, "3112" }, Modified: stable/9/sys/dev/ata/chipsets/ata-sis.c ============================================================================== --- stable/9/sys/dev/ata/chipsets/ata-sis.c Mon Nov 12 07:30:24 2012 (r242907) +++ stable/9/sys/dev/ata/chipsets/ata-sis.c Mon Nov 12 07:34:05 2012 (r242908) @@ -74,7 +74,7 @@ ata_sis_probe(device_t dev) { struct ata_pci_controller *ctlr = device_get_softc(dev); const struct ata_chip_id *idx; - static const struct ata_chip_id const ids[] = + static const struct ata_chip_id ids[] = {{ ATA_SIS182, 0x00, SIS_SATA, 0, ATA_SA150, "182" }, /* south */ { ATA_SIS181, 0x00, SIS_SATA, 0, ATA_SA150, "181" }, /* south */ { ATA_SIS180, 0x00, SIS_SATA, 0, ATA_SA150, "180" }, /* south */ Modified: stable/9/sys/dev/ata/chipsets/ata-via.c ============================================================================== --- stable/9/sys/dev/ata/chipsets/ata-via.c Mon Nov 12 07:30:24 2012 (r242907) +++ stable/9/sys/dev/ata/chipsets/ata-via.c Mon Nov 12 07:34:05 2012 (r242908) @@ -89,7 +89,7 @@ static int ata_via_probe(device_t dev) { struct ata_pci_controller *ctlr = device_get_softc(dev); - static const struct ata_chip_id const ids[] = + static const struct ata_chip_id ids[] = {{ ATA_VIA82C586, 0x02, VIA33, 0x00, ATA_UDMA2, "82C586B" }, { ATA_VIA82C586, 0x00, VIA33, 0x00, ATA_WDMA2, "82C586" }, { ATA_VIA82C596, 0x12, VIA66, VIACLK, ATA_UDMA4, "82C596B" }, @@ -113,7 +113,7 @@ ata_via_probe(device_t dev) { ATA_VIAVX855, 0x00, VIA133, 0x00, ATA_UDMA6, "VX855" }, { ATA_VIAVX900, 0x00, VIA133, VIASATA, ATA_SA300, "VX900" }, { 0, 0, 0, 0, 0, 0 }}; - static const struct ata_chip_id const new_ids[] = + static const struct ata_chip_id new_ids[] = {{ ATA_VIA6410, 0x00, 0, 0x00, ATA_UDMA6, "6410" }, { ATA_VIA6420, 0x00, 7, 0x00, ATA_SA150, "6420" }, { ATA_VIA6421, 0x00, 6, VIABAR, ATA_SA150, "6421" }, Modified: stable/9/sys/dev/ath/ath_hal/ar5212/ar5212.h ============================================================================== --- stable/9/sys/dev/ath/ath_hal/ar5212/ar5212.h Mon Nov 12 07:30:24 2012 (r242907) +++ stable/9/sys/dev/ath/ath_hal/ar5212/ar5212.h Mon Nov 12 07:34:05 2012 (r242908) @@ -143,7 +143,7 @@ typedef struct RfHalFuncs { int16_t *minPower, int16_t *maxPower, const struct ieee80211_channel *, uint16_t *rfXpdGain); HAL_BOOL (*getChannelMaxMinPower)(struct ath_hal *ah, - const const struct ieee80211_channel *, + const struct ieee80211_channel *, int16_t *maxPow, int16_t *minPow); int16_t (*getNfAdjust)(struct ath_hal *, const HAL_CHANNEL_INTERNAL*); } RF_HAL_FUNCS; Modified: stable/9/sys/dev/bge/if_bge.c ============================================================================== --- stable/9/sys/dev/bge/if_bge.c Mon Nov 12 07:30:24 2012 (r242907) +++ stable/9/sys/dev/bge/if_bge.c Mon Nov 12 07:34:05 2012 (r242908) @@ -139,7 +139,7 @@ MODULE_DEPEND(bge, miibus, 1, 1, 1); static const struct bge_type { uint16_t bge_vid; uint16_t bge_did; -} const bge_devs[] = { +} bge_devs[] = { { ALTEON_VENDORID, ALTEON_DEVICEID_BCM5700 }, { ALTEON_VENDORID, ALTEON_DEVICEID_BCM5701 }, @@ -239,7 +239,7 @@ static const struct bge_type { static const struct bge_vendor { uint16_t v_id; const char *v_name; -} const bge_vendors[] = { +} bge_vendors[] = { { ALTEON_VENDORID, "Alteon" }, { ALTIMA_VENDORID, "Altima" }, { APPLE_VENDORID, "Apple" }, @@ -254,7 +254,7 @@ static const struct bge_vendor { static const struct bge_revision { uint32_t br_chipid; const char *br_name; -} const bge_revisions[] = { +} bge_revisions[] = { { BGE_CHIPID_BCM5700_A0, "BCM5700 A0" }, { BGE_CHIPID_BCM5700_A1, "BCM5700 A1" }, { BGE_CHIPID_BCM5700_B0, "BCM5700 B0" }, @@ -328,7 +328,7 @@ static const struct bge_revision { * Some defaults for major revisions, so that newer steppings * that we don't know about have a shot at working. */ -static const struct bge_revision const bge_majorrevs[] = { +static const struct bge_revision bge_majorrevs[] = { { BGE_ASICREV_BCM5700, "unknown BCM5700" }, { BGE_ASICREV_BCM5701, "unknown BCM5701" }, { BGE_ASICREV_BCM5703, "unknown BCM5703" }, @@ -2786,7 +2786,7 @@ bge_mbox_reorder(struct bge_softc *sc) const uint16_t vendor; const uint16_t device; const char *desc; - } const mbox_reorder_lists[] = { + } mbox_reorder_lists[] = { { 0x1022, 0x7450, "AMD-8131 PCI-X Bridge" }, }; devclass_t pci, pcib; Modified: stable/9/sys/dev/cas/if_cas.c ============================================================================== --- stable/9/sys/dev/cas/if_cas.c Mon Nov 12 07:30:24 2012 (r242907) +++ stable/9/sys/dev/cas/if_cas.c Mon Nov 12 07:34:05 2012 (r242908) @@ -2623,7 +2623,7 @@ static const struct cas_pci_dev { uint8_t cpd_revid; int cpd_variant; const char *cpd_desc; -} const cas_pci_devlist[] = { +} cas_pci_devlist[] = { { 0x0035100b, 0x0, CAS_SATURN, "NS DP83065 Saturn Gigabit Ethernet" }, { 0xabba108e, 0x10, CAS_CASPLUS, "Sun Cassini+ Gigabit Ethernet" }, { 0xabba108e, 0x0, CAS_CAS, "Sun Cassini Gigabit Ethernet" }, Modified: stable/9/sys/dev/dc/if_dc.c ============================================================================== --- stable/9/sys/dev/dc/if_dc.c Mon Nov 12 07:30:24 2012 (r242907) +++ stable/9/sys/dev/dc/if_dc.c Mon Nov 12 07:34:05 2012 (r242908) @@ -150,7 +150,7 @@ MODULE_DEPEND(dc, miibus, 1, 1, 1); /* * Various supported device vendors/types and their names. */ -static const struct dc_type const dc_devs[] = { +static const struct dc_type dc_devs[] = { { DC_DEVID(DC_VENDORID_DEC, DC_DEVICEID_21143), 0, "Intel 21143 10/100BaseTX" }, { DC_DEVID(DC_VENDORID_DAVICOM, DC_DEVICEID_DM9009), 0, Modified: stable/9/sys/dev/flash/at45d.c ============================================================================== --- stable/9/sys/dev/flash/at45d.c Mon Nov 12 07:30:24 2012 (r242907) +++ stable/9/sys/dev/flash/at45d.c Mon Nov 12 07:34:05 2012 (r242908) @@ -106,7 +106,7 @@ static int at45d_wait_ready(device_t dev * 2^N byte pages. If support for the latter is enabled, the sector offset * has to be reduced by one. */ -static const struct at45d_flash_ident const at45d_flash_devices[] = { +static const struct at45d_flash_ident at45d_flash_devices[] = { { "AT45DB011B", 0x1f2200, 512, 9, 264, 256 }, { "AT45DB021B", 0x1f2300, 1024, 9, 264, 256 }, { "AT45DB041x", 0x1f2400, 2028, 9, 264, 256 }, Modified: stable/9/sys/dev/fxp/if_fxp.c ============================================================================== --- stable/9/sys/dev/fxp/if_fxp.c Mon Nov 12 07:30:24 2012 (r242907) +++ stable/9/sys/dev/fxp/if_fxp.c Mon Nov 12 07:34:05 2012 (r242908) @@ -111,7 +111,7 @@ static int tx_threshold = 64; * * See struct fxp_cb_config for the bit definitions. */ -static const u_char const fxp_cb_config_template[] = { +static const u_char fxp_cb_config_template[] = { 0x0, 0x0, /* cb_status */ 0x0, 0x0, /* cb_command */ 0x0, 0x0, 0x0, 0x0, /* link_addr */ @@ -155,7 +155,7 @@ static const u_char const fxp_cb_config_ * particular variants, but we don't currently differentiate between * them. */ -static const struct fxp_ident const fxp_ident_table[] = { +static const struct fxp_ident fxp_ident_table[] = { { 0x1029, -1, 0, "Intel 82559 PCI/CardBus Pro/100" }, { 0x1030, -1, 0, "Intel 82559 Pro/100 Ethernet" }, { 0x1031, -1, 3, "Intel 82801CAM (ICH3) Pro/100 VE Ethernet" }, @@ -3053,7 +3053,7 @@ static const struct ucode { int length; u_short int_delay_offset; u_short bundle_max_offset; -} const ucode_table[] = { +} ucode_table[] = { { FXP_REV_82558_A4, UCODE(fxp_ucode_d101a), D101_CPUSAVER_DWORD, 0 }, { FXP_REV_82558_B0, UCODE(fxp_ucode_d101b0), D101_CPUSAVER_DWORD, 0 }, { FXP_REV_82559_A0, UCODE(fxp_ucode_d101ma), Modified: stable/9/sys/dev/gem/if_gem_pci.c ============================================================================== --- stable/9/sys/dev/gem/if_gem_pci.c Mon Nov 12 07:30:24 2012 (r242907) +++ stable/9/sys/dev/gem/if_gem_pci.c Mon Nov 12 07:34:05 2012 (r242908) @@ -104,7 +104,7 @@ static const struct gem_pci_dev { uint32_t gpd_devid; int gpd_variant; const char *gpd_desc; -} const gem_pci_devlist[] = { +} gem_pci_devlist[] = { { 0x1101108e, GEM_SUN_ERI, "Sun ERI 10/100 Ethernet" }, { 0x2bad108e, GEM_SUN_GEM, "Sun GEM Gigabit Ethernet" }, { 0x0021106b, GEM_APPLE_GMAC, "Apple UniNorth GMAC Ethernet" }, Modified: stable/9/sys/dev/lge/if_lge.c ============================================================================== --- stable/9/sys/dev/lge/if_lge.c Mon Nov 12 07:30:24 2012 (r242907) +++ stable/9/sys/dev/lge/if_lge.c Mon Nov 12 07:34:05 2012 (r242908) @@ -110,7 +110,7 @@ __FBSDID("$FreeBSD$"); /* * Various supported device vendors/types and their names. */ -static const struct lge_type const lge_devs[] = { +static const struct lge_type lge_devs[] = { { LGE_VENDORID, LGE_DEVICEID, "Level 1 Gigabit Ethernet" }, { 0, 0, NULL } }; Modified: stable/9/sys/dev/mii/mii.c ============================================================================== --- stable/9/sys/dev/mii/mii.c Mon Nov 12 07:30:24 2012 (r242907) +++ stable/9/sys/dev/mii/mii.c Mon Nov 12 07:34:05 2012 (r242908) @@ -626,7 +626,7 @@ mii_down(struct mii_data *mii) static unsigned char mii_bitreverse(unsigned char x) { - static unsigned const char const nibbletab[16] = { + static unsigned const char nibbletab[16] = { 0, 8, 4, 12, 2, 10, 6, 14, 1, 9, 5, 13, 3, 11, 7, 15 }; Modified: stable/9/sys/dev/nge/if_nge.c ============================================================================== --- stable/9/sys/dev/nge/if_nge.c Mon Nov 12 07:30:24 2012 (r242907) +++ stable/9/sys/dev/nge/if_nge.c Mon Nov 12 07:34:05 2012 (r242908) @@ -139,7 +139,7 @@ MODULE_DEPEND(nge, miibus, 1, 1, 1); /* * Various supported device vendors/types and their names. */ -static const struct nge_type const nge_devs[] = { +static const struct nge_type nge_devs[] = { { NGE_VENDORID, NGE_DEVICEID, "National Semiconductor Gigabit Ethernet" }, { 0, 0, NULL } Modified: stable/9/sys/dev/pci/pci.c ============================================================================== --- stable/9/sys/dev/pci/pci.c Mon Nov 12 07:30:24 2012 (r242907) +++ stable/9/sys/dev/pci/pci.c Mon Nov 12 07:34:05 2012 (r242908) @@ -210,7 +210,7 @@ struct pci_quirk { int arg2; }; -static const struct pci_quirk const pci_quirks[] = { +static const struct pci_quirk pci_quirks[] = { /* The Intel 82371AB and 82443MX has a map register at offset 0x90. */ { 0x71138086, PCI_QUIRK_MAP_REG, 0x90, 0 }, { 0x719b8086, PCI_QUIRK_MAP_REG, 0x90, 0 }, Modified: stable/9/sys/dev/re/if_re.c ============================================================================== --- stable/9/sys/dev/re/if_re.c Mon Nov 12 07:30:24 2012 (r242907) +++ stable/9/sys/dev/re/if_re.c Mon Nov 12 07:34:05 2012 (r242908) @@ -171,7 +171,7 @@ TUNABLE_INT("hw.re.prefer_iomap", &prefe /* * Various supported device vendors/types and their names. */ -static const struct rl_type const re_devs[] = { +static const struct rl_type re_devs[] = { { DLINK_VENDORID, DLINK_DEVICEID_528T, 0, "D-Link DGE-528(T) Gigabit Ethernet Adapter" }, { DLINK_VENDORID, DLINK_DEVICEID_530T_REVC, 0, @@ -194,7 +194,7 @@ static const struct rl_type const re_dev "US Robotics 997902 (RTL8169S) Gigabit Ethernet" } }; -static const struct rl_hwrev const re_hwrevs[] = { +static const struct rl_hwrev re_hwrevs[] = { { RL_HWREV_8139, RL_8139, "", RL_MTU }, { RL_HWREV_8139A, RL_8139, "A", RL_MTU }, { RL_HWREV_8139AG, RL_8139, "A-G", RL_MTU }, Modified: stable/9/sys/dev/sis/if_sis.c ============================================================================== --- stable/9/sys/dev/sis/if_sis.c Mon Nov 12 07:30:24 2012 (r242907) +++ stable/9/sys/dev/sis/if_sis.c Mon Nov 12 07:34:05 2012 (r242908) @@ -126,7 +126,7 @@ MODULE_DEPEND(sis, miibus, 1, 1, 1); /* * Various supported device vendors/types and their names. */ -static const struct sis_type const sis_devs[] = { +static const struct sis_type sis_devs[] = { { SIS_VENDORID, SIS_DEVICEID_900, "SiS 900 10/100BaseTX" }, { SIS_VENDORID, SIS_DEVICEID_7016, "SiS 7016 10/100BaseTX" }, { NS_VENDORID, NS_DEVICEID_DP83815, "NatSemi DP8381[56] 10/100BaseTX" }, Modified: stable/9/sys/dev/ste/if_ste.c ============================================================================== --- stable/9/sys/dev/ste/if_ste.c Mon Nov 12 07:30:24 2012 (r242907) +++ stable/9/sys/dev/ste/if_ste.c Mon Nov 12 07:34:05 2012 (r242908) @@ -85,7 +85,7 @@ MODULE_DEPEND(ste, miibus, 1, 1, 1); /* * Various supported device vendors/types and their names. */ -static const struct ste_type const ste_devs[] = { +static const struct ste_type ste_devs[] = { { ST_VENDORID, ST_DEVICEID_ST201_1, "Sundance ST201 10/100BaseTX" }, { ST_VENDORID, ST_DEVICEID_ST201_2, "Sundance ST201 10/100BaseTX" }, { DL_VENDORID, DL_DEVICEID_DL10050, "D-Link DL10050 10/100BaseTX" }, Modified: stable/9/sys/dev/stge/if_stge.c ============================================================================== --- stable/9/sys/dev/stge/if_stge.c Mon Nov 12 07:30:24 2012 (r242907) +++ stable/9/sys/dev/stge/if_stge.c Mon Nov 12 07:34:05 2012 (r242908) @@ -91,7 +91,7 @@ static const struct stge_product { uint16_t stge_vendorid; uint16_t stge_deviceid; const char *stge_name; -} const stge_products[] = { +} stge_products[] = { { VENDOR_SUNDANCETI, DEVICEID_SUNDANCETI_ST1023, "Sundance ST-1023 Gigabit Ethernet" }, Modified: stable/9/sys/dev/ti/if_ti.c ============================================================================== --- stable/9/sys/dev/ti/if_ti.c Mon Nov 12 07:30:24 2012 (r242907) +++ stable/9/sys/dev/ti/if_ti.c Mon Nov 12 07:34:05 2012 (r242908) @@ -145,7 +145,7 @@ typedef enum { * Various supported device vendors/types and their names. */ -static const struct ti_type const ti_devs[] = { +static const struct ti_type ti_devs[] = { { ALT_VENDORID, ALT_DEVICEID_ACENIC, "Alteon AceNIC 1000baseSX Gigabit Ethernet" }, { ALT_VENDORID, ALT_DEVICEID_ACENIC_COPPER, Modified: stable/9/sys/dev/tl/if_tl.c ============================================================================== --- stable/9/sys/dev/tl/if_tl.c Mon Nov 12 07:30:24 2012 (r242907) +++ stable/9/sys/dev/tl/if_tl.c Mon Nov 12 07:34:05 2012 (r242908) @@ -229,7 +229,7 @@ MODULE_DEPEND(tl, miibus, 1, 1, 1); * Various supported device vendors/types and their names. */ -static const struct tl_type const tl_devs[] = { +static const struct tl_type tl_devs[] = { { TI_VENDORID, TI_DEVICEID_THUNDERLAN, "Texas Instruments ThunderLAN" }, { COMPAQ_VENDORID, COMPAQ_DEVICEID_NETEL_10, Modified: stable/9/sys/dev/vr/if_vr.c ============================================================================== --- stable/9/sys/dev/vr/if_vr.c Mon Nov 12 07:30:24 2012 (r242907) +++ stable/9/sys/dev/vr/if_vr.c Mon Nov 12 07:34:05 2012 (r242908) @@ -119,7 +119,7 @@ static const struct vr_type { u_int16_t vr_did; int vr_quirks; const char *vr_name; -} const vr_devs[] = { +} vr_devs[] = { { VIA_VENDORID, VIA_DEVICEID_RHINE, VR_Q_NEEDALIGN, "VIA VT3043 Rhine I 10/100BaseTX" }, @@ -199,7 +199,7 @@ static const struct vr_tx_threshold_tabl int tx_cfg; int bcr_cfg; int value; -} const vr_tx_threshold_tables[] = { +} vr_tx_threshold_tables[] = { { VR_TXTHRESH_64BYTES, VR_BCR1_TXTHRESH64BYTES, 64 }, { VR_TXTHRESH_128BYTES, VR_BCR1_TXTHRESH128BYTES, 128 }, { VR_TXTHRESH_256BYTES, VR_BCR1_TXTHRESH256BYTES, 256 }, Modified: stable/9/sys/dev/wb/if_wb.c ============================================================================== --- stable/9/sys/dev/wb/if_wb.c Mon Nov 12 07:30:24 2012 (r242907) +++ stable/9/sys/dev/wb/if_wb.c Mon Nov 12 07:34:05 2012 (r242908) @@ -130,7 +130,7 @@ MODULE_DEPEND(wb, miibus, 1, 1, 1); /* * Various supported device vendors/types and their names. */ -static const struct wb_type const wb_devs[] = { +static const struct wb_type wb_devs[] = { { WB_VENDORID, WB_DEVICEID_840F, "Winbond W89C840F 10/100BaseTX" }, { CP_VENDORID, CP_DEVICEID_RL100, Modified: stable/9/sys/dev/xl/if_xl.c ============================================================================== --- stable/9/sys/dev/xl/if_xl.c Mon Nov 12 07:30:24 2012 (r242907) +++ stable/9/sys/dev/xl/if_xl.c Mon Nov 12 07:34:05 2012 (r242908) @@ -161,7 +161,7 @@ MODULE_DEPEND(xl, miibus, 1, 1, 1); /* * Various supported device vendors/types and their names. */ -static const struct xl_type const xl_devs[] = { +static const struct xl_type xl_devs[] = { { TC_VENDORID, TC_DEVICEID_BOOMERANG_10BT, "3Com 3c900-TPO Etherlink XL" }, { TC_VENDORID, TC_DEVICEID_BOOMERANG_10BT_COMBO, Modified: stable/9/sys/pci/if_rl.c ============================================================================== --- stable/9/sys/pci/if_rl.c Mon Nov 12 07:30:24 2012 (r242907) +++ stable/9/sys/pci/if_rl.c Mon Nov 12 07:34:05 2012 (r242908) @@ -131,7 +131,7 @@ MODULE_DEPEND(rl, miibus, 1, 1, 1); /* * Various supported device vendors/types and their names. */ -static const struct rl_type const rl_devs[] = { +static const struct rl_type rl_devs[] = { { RT_VENDORID, RT_DEVICEID_8129, RL_8129, "RealTek 8129 10/100BaseTX" }, { RT_VENDORID, RT_DEVICEID_8139, RL_8139, Modified: stable/9/sys/sparc64/pci/fire.c ============================================================================== --- stable/9/sys/sparc64/pci/fire.c Mon Nov 12 07:30:24 2012 (r242907) +++ stable/9/sys/sparc64/pci/fire.c Mon Nov 12 07:34:05 2012 (r242908) @@ -249,7 +249,7 @@ struct fire_desc { const char *fd_name; }; -static const struct fire_desc const fire_compats[] = { +static const struct fire_desc fire_compats[] = { { "pciex108e,80f0", FIRE_MODE_FIRE, "Fire" }, #if 0 { "pciex108e,80f8", FIRE_MODE_OBERON, "Oberon" }, Modified: stable/9/sys/sparc64/pci/psycho.c ============================================================================== --- stable/9/sys/sparc64/pci/psycho.c Mon Nov 12 07:30:24 2012 (r242907) +++ stable/9/sys/sparc64/pci/psycho.c Mon Nov 12 07:34:05 2012 (r242908) @@ -222,14 +222,14 @@ struct psycho_desc { const char *pd_name; }; -static const struct psycho_desc const psycho_compats[] = { +static const struct psycho_desc psycho_compats[] = { { "pci108e,8000", PSYCHO_MODE_PSYCHO, "Psycho compatible" }, { "pci108e,a000", PSYCHO_MODE_SABRE, "Sabre compatible" }, { "pci108e,a001", PSYCHO_MODE_SABRE, "Hummingbird compatible" }, { NULL, 0, NULL } }; -static const struct psycho_desc const psycho_models[] = { +static const struct psycho_desc psycho_models[] = { { "SUNW,psycho", PSYCHO_MODE_PSYCHO, "Psycho" }, { "SUNW,sabre", PSYCHO_MODE_SABRE, "Sabre" }, { NULL, 0, NULL } Modified: stable/9/sys/sparc64/pci/schizo.c ============================================================================== --- stable/9/sys/sparc64/pci/schizo.c Mon Nov 12 07:30:24 2012 (r242907) +++ stable/9/sys/sparc64/pci/schizo.c Mon Nov 12 07:34:05 2012 (r242908) @@ -229,7 +229,7 @@ struct schizo_desc { const char *sd_name; }; -static const struct schizo_desc const schizo_compats[] = { +static const struct schizo_desc schizo_compats[] = { { "pci108e,8001", SCHIZO_MODE_SCZ, "Schizo" }, #if 0 { "pci108e,8002", SCHIZO_MODE_XMS, "XMITS" }, From owner-svn-src-stable-9@FreeBSD.ORG Mon Nov 12 14:04:58 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5DD40783; Mon, 12 Nov 2012 14:04:58 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 415418FC0C; Mon, 12 Nov 2012 14:04:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qACE4w1m028748; Mon, 12 Nov 2012 14:04:58 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qACE4wxM028747; Mon, 12 Nov 2012 14:04:58 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201211121404.qACE4wxM028747@svn.freebsd.org> From: Baptiste Daroussin Date: Mon, 12 Nov 2012 14:04:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242914 - stable/9/sys/dev/acpi_support X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Nov 2012 14:04:58 -0000 Author: bapt Date: Mon Nov 12 14:04:57 2012 New Revision: 242914 URL: http://svnweb.freebsd.org/changeset/base/242914 Log: add support for newer Lenovo ThinkPads to acpi_ibm PR: kern/164538 Submitted by: Pierre Imai Modified: stable/9/sys/dev/acpi_support/acpi_ibm.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/acpi_support/acpi_ibm.c ============================================================================== --- stable/9/sys/dev/acpi_support/acpi_ibm.c Mon Nov 12 12:31:27 2012 (r242913) +++ stable/9/sys/dev/acpi_support/acpi_ibm.c Mon Nov 12 14:04:57 2012 (r242914) @@ -317,7 +317,7 @@ static devclass_t acpi_ibm_devclass; DRIVER_MODULE(acpi_ibm, acpi, acpi_ibm_driver, acpi_ibm_devclass, 0, 0); MODULE_DEPEND(acpi_ibm, acpi, 1, 1, 1); -static char *ibm_ids[] = {"IBM0068", NULL}; +static char *ibm_ids[] = {"IBM0068", "LEN0068", NULL}; static void ibm_led(void *softc, int onoff) From owner-svn-src-stable-9@FreeBSD.ORG Mon Nov 12 14:13:49 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D1029AF9; Mon, 12 Nov 2012 14:13:49 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B3E438FC12; Mon, 12 Nov 2012 14:13:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qACEDntM030796; Mon, 12 Nov 2012 14:13:49 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qACEDnID030795; Mon, 12 Nov 2012 14:13:49 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201211121413.qACEDnID030795@svn.freebsd.org> From: Baptiste Daroussin Date: Mon, 12 Nov 2012 14:13:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242916 - stable/9/usr.sbin/pw X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Nov 2012 14:13:49 -0000 Author: bapt Date: Mon Nov 12 14:13:49 2012 New Revision: 242916 URL: http://svnweb.freebsd.org/changeset/base/242916 Log: Remove useless atoi(3), previous strspn(3) makes sure that a_name->val is a number. This also allow pw user show to work as expected. PR: bin/172112 Submitted by: Ilya A. Arkhipov Modified: stable/9/usr.sbin/pw/pw_user.c Directory Properties: stable/9/usr.sbin/pw/ (props changed) Modified: stable/9/usr.sbin/pw/pw_user.c ============================================================================== --- stable/9/usr.sbin/pw/pw_user.c Mon Nov 12 14:05:40 2012 (r242915) +++ stable/9/usr.sbin/pw/pw_user.c Mon Nov 12 14:13:49 2012 (r242916) @@ -315,7 +315,7 @@ pw_user(struct userconf * cnf, int mode, */ if (mode != M_ADD && pwd == NULL && strspn(a_name->val, "0123456789") == strlen(a_name->val) - && atoi(a_name->val) > 0) { /* Assume uid */ + && *a_name->val) { (a_uid = a_name)->ch = 'u'; a_name = NULL; } From owner-svn-src-stable-9@FreeBSD.ORG Mon Nov 12 14:34:47 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5DEC5696; Mon, 12 Nov 2012 14:34:47 +0000 (UTC) (envelope-from mjacob@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2794E8FC0C; Mon, 12 Nov 2012 14:34:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qACEYlpC034732; Mon, 12 Nov 2012 14:34:47 GMT (envelope-from mjacob@svn.freebsd.org) Received: (from mjacob@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qACEYkAb034730; Mon, 12 Nov 2012 14:34:46 GMT (envelope-from mjacob@svn.freebsd.org) Message-Id: <201211121434.qACEYkAb034730@svn.freebsd.org> From: Matt Jacob Date: Mon, 12 Nov 2012 14:34:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242920 - stable/9/sys/dev/isp X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Nov 2012 14:34:47 -0000 Author: mjacob Date: Mon Nov 12 14:34:46 2012 New Revision: 242920 URL: http://svnweb.freebsd.org/changeset/base/242920 Log: MFC 242479,242480: Force segments to 1 for mapping control spaces. Modified: stable/9/sys/dev/isp/isp_pci.c stable/9/sys/dev/isp/isp_sbus.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/dev/isp/ (props changed) Modified: stable/9/sys/dev/isp/isp_pci.c ============================================================================== --- stable/9/sys/dev/isp/isp_pci.c Mon Nov 12 14:19:05 2012 (r242919) +++ stable/9/sys/dev/isp/isp_pci.c Mon Nov 12 14:34:46 2012 (r242920) @@ -1524,7 +1524,7 @@ isp_pci_mbxdma(ispsoftc_t *isp) { caddr_t base; uint32_t len, nsegs; - int i, error, ns, cmap = 0; + int i, error, cmap = 0; bus_size_t slim; /* segment size */ bus_addr_t llim; /* low limit of unavailable dma */ bus_addr_t hlim; /* high limit of unavailable dma */ @@ -1633,13 +1633,12 @@ isp_pci_mbxdma(ispsoftc_t *isp) if (isp->isp_type >= ISP_HA_FC_2300) { len += (N_XCMDS * XCMD_SIZE); } - ns = (len / PAGE_SIZE) + 1; /* * Create a tag for the control spaces. We don't always need this * to be 32 bits, but we do this for simplicity and speed's sake. */ - if (isp_dma_tag_create(isp->isp_osinfo.dmat, QENTRY_LEN, slim, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, len, ns, slim, 0, &isp->isp_osinfo.cdmat)) { + if (isp_dma_tag_create(isp->isp_osinfo.dmat, QENTRY_LEN, slim, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, len, 1, slim, 0, &isp->isp_osinfo.cdmat)) { isp_prt(isp, ISP_LOGERR, "cannot create a dma tag for control spaces"); free(isp->isp_osinfo.pcmd_pool, M_DEVBUF); free(isp->isp_xflist, M_DEVBUF); Modified: stable/9/sys/dev/isp/isp_sbus.c ============================================================================== --- stable/9/sys/dev/isp/isp_sbus.c Mon Nov 12 14:19:05 2012 (r242919) +++ stable/9/sys/dev/isp/isp_sbus.c Mon Nov 12 14:34:46 2012 (r242920) @@ -460,7 +460,7 @@ isp_sbus_mbxdma(ispsoftc_t *isp) { caddr_t base; uint32_t len; - int i, error, ns; + int i, error; struct imush im; /* @@ -511,10 +511,9 @@ isp_sbus_mbxdma(ispsoftc_t *isp) len = ISP_QUEUE_SIZE(RQUEST_QUEUE_LEN(isp)); len += ISP_QUEUE_SIZE(RESULT_QUEUE_LEN(isp)); - ns = (len / PAGE_SIZE) + 1; if (isp_dma_tag_create(isp->isp_osinfo.dmat, QENTRY_LEN, BUS_SPACE_MAXADDR_24BIT+1, BUS_SPACE_MAXADDR_32BIT, - BUS_SPACE_MAXADDR_32BIT, NULL, NULL, len, ns, + BUS_SPACE_MAXADDR_32BIT, NULL, NULL, len, 1, BUS_SPACE_MAXADDR_24BIT, 0, &isp->isp_osinfo.cdmat)) { isp_prt(isp, ISP_LOGERR, "cannot create a dma tag for control spaces"); From owner-svn-src-stable-9@FreeBSD.ORG Mon Nov 12 15:17:25 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A902B36A; Mon, 12 Nov 2012 15:17:25 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 895A48FC20; Mon, 12 Nov 2012 15:17:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qACFHPhb042526; Mon, 12 Nov 2012 15:17:25 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qACFHPS1042525; Mon, 12 Nov 2012 15:17:25 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201211121517.qACFHPS1042525@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 12 Nov 2012 15:17:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242921 - stable/9/sys/kern X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Nov 2012 15:17:25 -0000 Author: kib Date: Mon Nov 12 15:17:25 2012 New Revision: 242921 URL: http://svnweb.freebsd.org/changeset/base/242921 Log: MFC r242617: A clarification to the behaviour of the active vnode list management regarding the vnode page cleaning. Modified: stable/9/sys/kern/vfs_subr.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/vfs_subr.c ============================================================================== --- stable/9/sys/kern/vfs_subr.c Mon Nov 12 14:34:46 2012 (r242920) +++ stable/9/sys/kern/vfs_subr.c Mon Nov 12 15:17:25 2012 (r242921) @@ -2547,6 +2547,9 @@ vinactive(struct vnode *vp, struct threa * Before moving off the active list, we must be sure that any * modified pages are on the vnode's dirty list since these will * no longer be checked once the vnode is on the inactive list. + * Because the vnode vm object keeps a hold reference on the vnode + * if there is at least one resident non-cached page, the vnode + * cannot leave the active list without the page cleanup done. */ obj = vp->v_object; if (obj != NULL && (obj->flags & OBJ_MIGHTBEDIRTY) != 0) { From owner-svn-src-stable-9@FreeBSD.ORG Mon Nov 12 20:50:16 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 58CB993; Mon, 12 Nov 2012 20:50:16 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 223118FC12; Mon, 12 Nov 2012 20:50:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qACKoGEj002816; Mon, 12 Nov 2012 20:50:16 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qACKoFLA002814; Mon, 12 Nov 2012 20:50:15 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <201211122050.qACKoFLA002814@svn.freebsd.org> From: Edwin Groothuis Date: Mon, 12 Nov 2012 20:50:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242932 - stable/9/contrib/tzdata X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Nov 2012 20:50:16 -0000 Author: edwin Date: Mon Nov 12 20:50:15 2012 New Revision: 242932 URL: http://svnweb.freebsd.org/changeset/base/242932 Log: Merge of current of 242925, tzdata2012i - Cuba is changing back to Standard Time on 4 November 2012. Modified: stable/9/contrib/tzdata/asia stable/9/contrib/tzdata/northamerica Directory Properties: stable/9/contrib/tzdata/ (props changed) Modified: stable/9/contrib/tzdata/asia ============================================================================== --- stable/9/contrib/tzdata/asia Mon Nov 12 20:50:11 2012 (r242931) +++ stable/9/contrib/tzdata/asia Mon Nov 12 20:50:15 2012 (r242932) @@ -1204,7 +1204,7 @@ Rule Zion 2012 only - Sep 23 2:00 0 S # past, approved sending the proposed June 2011 changes to the Time # Decree Law back to the Knesset for second and third (final) votes # before the upcoming elections on Jan. 22, 2013. Hence, although the -# changes are not yet law, they are expected to be so before Februray 2013. +# changes are not yet law, they are expected to be so before February 2013. # # As of 2013, DST starts at 02:00 on the Friday before the last Sunday in March. # DST ends at 02:00 on the first Sunday after October 1, unless it occurs on the Modified: stable/9/contrib/tzdata/northamerica ============================================================================== --- stable/9/contrib/tzdata/northamerica Mon Nov 12 20:50:11 2012 (r242931) +++ stable/9/contrib/tzdata/northamerica Mon Nov 12 20:50:15 2012 (r242932) @@ -2797,6 +2797,13 @@ Zone America/Costa_Rica -5:36:20 - LMT 1 # http://www.timeanddate.com/news/time/cuba-starts-dst-2012.html # +# From Steffen Thorsen (2012-11-03): +# Radio Reloj and many other sources report that Cuba is changing back +# to standard time on 2012-11-04: +# http://www.radioreloj.cu/index.php/noticias-radio-reloj/36-nacionales/9961-regira-horario-normal-en-cuba-desde-el-domingo-cuatro-de-noviembre +# From Paul Eggert (2012-11-03): +# For now, assume the future rule is first Sunday in November. + # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule Cuba 1928 only - Jun 10 0:00 1:00 D Rule Cuba 1928 only - Oct 10 0:00 0 S @@ -2834,7 +2841,7 @@ Rule Cuba 2009 2010 - Mar Sun>=8 0:00s 1 Rule Cuba 2011 only - Mar Sun>=15 0:00s 1:00 D Rule Cuba 2011 only - Nov 13 0:00s 0 S Rule Cuba 2012 only - Apr 1 0:00s 1:00 D -Rule Cuba 2012 max - Oct lastSun 0:00s 0 S +Rule Cuba 2012 max - Nov Sun>=1 0:00s 0 S Rule Cuba 2013 max - Mar Sun>=8 0:00s 1:00 D # Zone NAME GMTOFF RULES FORMAT [UNTIL] From owner-svn-src-stable-9@FreeBSD.ORG Tue Nov 13 19:17:22 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0B12373D; Tue, 13 Nov 2012 19:17:22 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E0D278FC08; Tue, 13 Nov 2012 19:17:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qADJHLHM004373; Tue, 13 Nov 2012 19:17:21 GMT (envelope-from mjg@svn.freebsd.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qADJHLvQ004371; Tue, 13 Nov 2012 19:17:21 GMT (envelope-from mjg@svn.freebsd.org) Message-Id: <201211131917.qADJHLvQ004371@svn.freebsd.org> From: Mateusz Guzik Date: Tue, 13 Nov 2012 19:17:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242990 - stable/9/libexec/atrun X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Nov 2012 19:17:22 -0000 Author: mjg Date: Tue Nov 13 19:17:21 2012 New Revision: 242990 URL: http://svnweb.freebsd.org/changeset/base/242990 Log: MFC r242372: atrun(8): scale default load average limit with the number of CPUs Previously atrun refused to run jobs if load average was not below fixed limit of 1.5. PR: 173175 Approved by: trasz (mentor) Modified: stable/9/libexec/atrun/atrun.c stable/9/libexec/atrun/atrun.man Directory Properties: stable/9/libexec/atrun/ (props changed) Modified: stable/9/libexec/atrun/atrun.c ============================================================================== --- stable/9/libexec/atrun/atrun.c Tue Nov 13 19:03:13 2012 (r242989) +++ stable/9/libexec/atrun/atrun.c Tue Nov 13 19:17:21 2012 (r242990) @@ -33,6 +33,9 @@ static const char rcsid[] = #include #include #include +#ifdef __FreeBSD__ +#include +#endif #include #include #include @@ -454,7 +457,12 @@ main(int argc, char *argv[]) gid_t batch_gid; int c; int run_batch; +#ifdef __FreeBSD__ + size_t ncpu, ncpusz; + double load_avg = -1; +#else double load_avg = LOADAVG_MX; +#endif /* We don't need root privileges all the time; running under uid and gid daemon * is fine. @@ -472,8 +480,10 @@ main(int argc, char *argv[]) case 'l': if (sscanf(optarg, "%lf", &load_avg) != 1) perr("garbled option -l"); +#ifndef __FreeBSD__ if (load_avg <= 0.) load_avg = LOADAVG_MX; +#endif break; case 'd': @@ -489,6 +499,15 @@ main(int argc, char *argv[]) if (chdir(ATJOB_DIR) != 0) perr("cannot change to %s", ATJOB_DIR); +#ifdef __FreeBSD__ + if (load_avg <= 0.) { + ncpusz = sizeof(size_t); + if (sysctlbyname("hw.ncpu", &ncpu, &ncpusz, NULL, 0) < 0) + ncpu = 1; + load_avg = LOADAVG_MX * ncpu; + } +#endif + /* Main loop. Open spool directory for reading and look over all the * files in there. If the filename indicates that the job should be run * and the x bit is set, fork off a child which sets its user and group Modified: stable/9/libexec/atrun/atrun.man ============================================================================== --- stable/9/libexec/atrun/atrun.man Tue Nov 13 19:03:13 2012 (r242989) +++ stable/9/libexec/atrun/atrun.man Tue Nov 13 19:17:21 2012 (r242990) @@ -1,5 +1,5 @@ .\" $FreeBSD$ -.Dd June 17, 2007 +.Dd October 30, 2012 .Dt ATRUN 8 .Os .Sh NAME @@ -45,7 +45,7 @@ e.g., locked out or expired. .Bl -tag -width indent .It Fl l Ar load_avg Specify a limiting load factor, over which batch jobs should -not be run, instead of the compiled in default of 1.5. +not be run, instead of the default of 1.5 * number of active CPUs. .It Fl d Debug; print error messages to standard error instead of using .Xr syslog 3 . From owner-svn-src-stable-9@FreeBSD.ORG Wed Nov 14 00:34:11 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 95C0621A; Wed, 14 Nov 2012 00:34:11 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 7AC448FC08; Wed, 14 Nov 2012 00:34:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAE0YBdI054916; Wed, 14 Nov 2012 00:34:11 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAE0YB9N054915; Wed, 14 Nov 2012 00:34:11 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201211140034.qAE0YB9N054915@svn.freebsd.org> From: Eitan Adler Date: Wed, 14 Nov 2012 00:34:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243011 - stable/9/sys/dev/puc X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Nov 2012 00:34:11 -0000 Author: eadler Date: Wed Nov 14 00:34:11 2012 New Revision: 243011 URL: http://svnweb.freebsd.org/changeset/base/243011 Log: MFC r242814: Add support for Advantech PCI-1602 RS-485/RS-422 serial card PR: kern/169726 Approved by: cperciva (implicit) Modified: stable/9/sys/dev/puc/pucdata.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/dev/puc/ (props changed) Modified: stable/9/sys/dev/puc/pucdata.c ============================================================================== --- stable/9/sys/dev/puc/pucdata.c Wed Nov 14 00:34:10 2012 (r243010) +++ stable/9/sys/dev/puc/pucdata.c Wed Nov 14 00:34:11 2012 (r243011) @@ -630,6 +630,12 @@ const struct puc_cfg puc_pci_devices[] = PUC_PORT_8S, 0x10, 0, -1, }, + { 0x13fe, 0x1600, 0x1602, 0x0002, + "Advantech PCI-1602", + DEFAULT_RCLK * 8, + PUC_PORT_2S, 0x10, 0, 8, + }, + { 0x1407, 0x0100, 0xffff, 0, "Lava Computers Dual Serial", DEFAULT_RCLK, From owner-svn-src-stable-9@FreeBSD.ORG Wed Nov 14 10:06:50 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C90A7B4C; Wed, 14 Nov 2012 10:06:50 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id AE80F8FC12; Wed, 14 Nov 2012 10:06:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAEA6on1049356; Wed, 14 Nov 2012 10:06:50 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAEA6o88049350; Wed, 14 Nov 2012 10:06:50 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <201211141006.qAEA6o88049350@svn.freebsd.org> From: Edwin Groothuis Date: Wed, 14 Nov 2012 10:06:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243020 - stable/9/contrib/tzdata X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Nov 2012 10:06:50 -0000 Author: edwin Date: Wed Nov 14 10:06:50 2012 New Revision: 243020 URL: http://svnweb.freebsd.org/changeset/base/243020 Log: Merge of current of 243003, tzdata2012j - Libya went to Standard Time on 10 November 2012 Modified: stable/9/contrib/tzdata/africa stable/9/contrib/tzdata/asia stable/9/contrib/tzdata/australasia stable/9/contrib/tzdata/europe stable/9/contrib/tzdata/northamerica stable/9/contrib/tzdata/southamerica Directory Properties: stable/9/contrib/tzdata/ (props changed) Modified: stable/9/contrib/tzdata/africa ============================================================================== --- stable/9/contrib/tzdata/africa Wed Nov 14 08:05:21 2012 (r243019) +++ stable/9/contrib/tzdata/africa Wed Nov 14 10:06:50 2012 (r243020) @@ -4,7 +4,7 @@ # This data is by no means authoritative; if you think you know better, # go ahead and edit the file (and please send any changes to -# tz@elsie.nci.nih.gov for general use in the future). +# tz@iana.org for general use in the future). # From Paul Eggert (2006-03-22): # @@ -424,6 +424,20 @@ Zone Africa/Monrovia -0:43:08 - LMT 1882 # Libya +# From Even Scharning (2012-11-10): +# Libya set their time one hour back at 02:00 on Saturday November 10. +# http://www.libyaherald.com/2012/11/04/clocks-to-go-back-an-hour-on-saturday/ +# Here is an official source [in Arabic]: http://ls.ly/fb6Yc +# +# Steffen Thorsen forwarded a translation (2012-11-10) in +# http://mm.icann.org/pipermail/tz/2012-November/018451.html +# +# From Tim Parenti (2012-11-11): +# Treat the 2012-11-10 change as a zone change from UTC+2 to UTC+1. +# The DST rules planned for 2013 and onward roughly mirror those of Europe +# (either two days before them or five days after them, so as to fall on +# lastFri instead of lastSun). + # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule Libya 1951 only - Oct 14 2:00 1:00 S Rule Libya 1952 only - Jan 1 0:00 0 - @@ -438,17 +452,21 @@ Rule Libya 1986 only - Apr 4 0:00 1:00 Rule Libya 1986 only - Oct 3 0:00 0 - Rule Libya 1987 1989 - Apr 1 0:00 1:00 S Rule Libya 1987 1989 - Oct 1 0:00 0 - +Rule Libya 1997 only - Apr 4 0:00 1:00 S +Rule Libya 1997 only - Oct 4 0:00 0 - +Rule Libya 2013 max - Mar lastFri 1:00 1:00 S +Rule Libya 2013 max - Oct lastFri 2:00 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Africa/Tripoli 0:52:44 - LMT 1920 1:00 Libya CE%sT 1959 2:00 - EET 1982 1:00 Libya CE%sT 1990 May 4 -# The following entries are from Shanks & Pottenger; +# The 1996 and 1997 entries are from Shanks & Pottenger; # the IATA SSIM data contain some obvious errors. 2:00 - EET 1996 Sep 30 - 1:00 - CET 1997 Apr 4 - 1:00 1:00 CEST 1997 Oct 4 - 2:00 - EET + 1:00 Libya CE%sT 1997 Oct 4 + 2:00 - EET 2012 Nov 10 2:00 + 1:00 Libya CE%sT # Madagascar # Zone NAME GMTOFF RULES FORMAT [UNTIL] Modified: stable/9/contrib/tzdata/asia ============================================================================== --- stable/9/contrib/tzdata/asia Wed Nov 14 08:05:21 2012 (r243019) +++ stable/9/contrib/tzdata/asia Wed Nov 14 10:06:50 2012 (r243020) @@ -4,7 +4,7 @@ # This data is by no means authoritative; if you think you know better, # go ahead and edit the file (and please send any changes to -# tz@elsie.nci.nih.gov for general use in the future). +# tz@iana.org for general use in the future). # From Paul Eggert (2006-03-22): # @@ -1199,7 +1199,6 @@ Rule Zion 2012 only - Mar Fri>=26 2:00 1 Rule Zion 2012 only - Sep 23 2:00 0 S # From Ephraim Silverberg (2012-10-18): - # Yesterday, the Interior Ministry Committee, after more than a year # past, approved sending the proposed June 2011 changes to the Time # Decree Law back to the Knesset for second and third (final) votes @@ -1212,6 +1211,10 @@ Rule Zion 2012 only - Sep 23 2:00 0 S # later (i.e. at 02:00 the first Monday after October 2). # [Rosh Hashana holidays are factored in until 2100.] +# From Ephraim Silverberg (2012-11-05): +# The Knesset passed today (in second and final readings) the amendment to the +# Time Decree Law making the changes ... law. + # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule Zion 2013 max - Mar Fri>=23 2:00 1:00 D Rule Zion 2013 2026 - Oct Sun>=2 2:00 0 S @@ -2049,8 +2052,7 @@ Zone Asia/Karachi 4:28:12 - LMT 1907 # occurred before our cutoff date of 1970. # However, as we get more information, we may need to add entries # for parts of the West Bank as they transitioned from Israel's rules -# to Palestine's rules. If you have more info about this, please -# send it to tz@elsie.nci.nih.gov for incorporation into future editions. +# to Palestine's rules. # From IINS News Service - Israel - 1998-03-23 10:38:07 Israel time, # forwarded by Ephraim Silverberg: Modified: stable/9/contrib/tzdata/australasia ============================================================================== --- stable/9/contrib/tzdata/australasia Wed Nov 14 08:05:21 2012 (r243019) +++ stable/9/contrib/tzdata/australasia Wed Nov 14 10:06:50 2012 (r243020) @@ -780,7 +780,7 @@ Zone Pacific/Wallis 12:15:20 - LMT 1901 # This data is by no means authoritative; if you think you know better, # go ahead and edit the file (and please send any changes to -# tz@elsie.nci.nih.gov for general use in the future). +# tz@iana.org for general use in the future). # From Paul Eggert (2006-03-22): # A good source for time zone historical data outside the U.S. is Modified: stable/9/contrib/tzdata/europe ============================================================================== --- stable/9/contrib/tzdata/europe Wed Nov 14 08:05:21 2012 (r243019) +++ stable/9/contrib/tzdata/europe Wed Nov 14 10:06:50 2012 (r243020) @@ -4,7 +4,7 @@ # This data is by no means authoritative; if you think you know better, # go ahead and edit the file (and please send any changes to -# tz@elsie.nci.nih.gov for general use in the future). +# tz@iana.org for general use in the future). # From Paul Eggert (2006-03-22): # A good source for time zone historical data outside the U.S. is Modified: stable/9/contrib/tzdata/northamerica ============================================================================== --- stable/9/contrib/tzdata/northamerica Wed Nov 14 08:05:21 2012 (r243019) +++ stable/9/contrib/tzdata/northamerica Wed Nov 14 10:06:50 2012 (r243020) @@ -6,7 +6,7 @@ # This data is by no means authoritative; if you think you know better, # go ahead and edit the file (and please send any changes to -# tz@elsie.nci.nih.gov for general use in the future). +# tz@iana.org for general use in the future). # From Paul Eggert (1999-03-22): # A reliable and entertaining source about time zones is Modified: stable/9/contrib/tzdata/southamerica ============================================================================== --- stable/9/contrib/tzdata/southamerica Wed Nov 14 08:05:21 2012 (r243019) +++ stable/9/contrib/tzdata/southamerica Wed Nov 14 10:06:50 2012 (r243020) @@ -4,7 +4,7 @@ # This data is by no means authoritative; if you think you know better, # go ahead and edit the file (and please send any changes to -# tz@elsie.nci.nih.gov for general use in the future). +# tz@iana.org for general use in the future). # From Paul Eggert (2006-03-22): # A good source for time zone historical data outside the U.S. is From owner-svn-src-stable-9@FreeBSD.ORG Wed Nov 14 20:27:17 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D1698649; Wed, 14 Nov 2012 20:27:17 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B4CF28FC13; Wed, 14 Nov 2012 20:27:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAEKRHVY045930; Wed, 14 Nov 2012 20:27:17 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAEKRHgu045923; Wed, 14 Nov 2012 20:27:17 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201211142027.qAEKRHgu045923@svn.freebsd.org> From: Dimitry Andric Date: Wed, 14 Nov 2012 20:27:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243041 - in stable/9: . share/mk sys/conf X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Nov 2012 20:27:17 -0000 Author: dim Date: Wed Nov 14 20:27:17 2012 New Revision: 243041 URL: http://svnweb.freebsd.org/changeset/base/243041 Log: MFC r240468 (by brooks): Introduce a new make variable COMPILER_TYPE that specifies what type of compiler is being used (currently clang or gcc). COMPILER_TYPE is set in the new bsd.compiler.mk file based on the value of the CC variable or, should it prove informative, by running ${CC} --version and examining the output. To avoid negative performance impacts in the default case and correct value for COMPILER_TYPE type is determined and passed in the environment of submake instances while building world. Replace adhoc attempts at determining the compiler type by examining CC or MK_CLANG_IS_CC with checks of COMPILER_TYPE. This eliminates bootstrapping complications when first setting WITH_CLANG_IS_CC. Sponsored by: DARPA, AFRL Reviewed by: Yamaya Takashi , imp, linimon (with some modifications post review) MFC r242633 (by brooks): Allow CC to be gcc46 or similar by matching gcc*. Don't test the value of the :M matches, either the string matches or does not. MFC r242658: Fix typo in bsd.compiler.mk. Added: stable/9/share/mk/bsd.compiler.mk - copied, changed from r240468, head/share/mk/bsd.compiler.mk Modified: stable/9/Makefile.inc1 (contents, props changed) stable/9/share/mk/Makefile stable/9/share/mk/bsd.sys.mk (contents, props changed) stable/9/sys/conf/kern.mk stable/9/sys/conf/kern.pre.mk stable/9/sys/conf/kmod.mk Directory Properties: stable/9/share/ (props changed) stable/9/share/mk/ (props changed) stable/9/sys/ (props changed) stable/9/sys/conf/ (props changed) Modified: stable/9/Makefile.inc1 ============================================================================== --- stable/9/Makefile.inc1 Wed Nov 14 20:01:40 2012 (r243040) +++ stable/9/Makefile.inc1 Wed Nov 14 20:27:17 2012 (r243041) @@ -42,6 +42,7 @@ TARGET_ARCH=${TARGET} .include .include +.include # We must do share/info early so that installation of info `dir' # entries works correctly. Do it first since it is less likely to @@ -230,7 +231,8 @@ BMAKEENV= INSTALL="sh ${.CURDIR}/tools/i PATH=${BPATH}:${PATH} \ WORLDTMP=${WORLDTMP} \ VERSION="${VERSION}" \ - MAKEFLAGS="-m ${.CURDIR}/tools/build/mk ${.MAKEFLAGS}" + MAKEFLAGS="-m ${.CURDIR}/tools/build/mk ${.MAKEFLAGS}" \ + COMPILER_TYPE=${COMPILER_TYPE} BMAKE= MAKEOBJDIRPREFIX=${WORLDTMP} \ ${BMAKEENV} ${MAKE} -f Makefile.inc1 \ DESTDIR= \ @@ -265,6 +267,16 @@ WMAKEENV= ${CROSSENV} \ .if ${MK_CDDL} == "no" WMAKEENV+= NO_CTF=1 .endif +.if ${CC:T:Mgcc} == "gcc" +WMAKE_COMPILER_TYPE= gcc +.elif ${CC:T:Mclang} == "clang" +WMAKE_COMPILER_TYPE= clang +.elif ${MK_CLANG_IS_CC} == "no" +WMAKE_COMPILER_TYPE= gcc +.else +WMAKE_COMPILER_TYPE= clang +.endif +WMAKEENV+= COMPILER_TYPE=${WMAKE_COMPILER_TYPE} WMAKE= ${WMAKEENV} ${MAKE} -f Makefile.inc1 DESTDIR=${WORLDTMP} .if ${TARGET_ARCH} == "amd64" || ${TARGET_ARCH} == "powerpc64" @@ -308,7 +320,8 @@ LIB32WMAKEENV+= MAKEOBJDIRPREFIX=${OBJTR CC="${CC} ${LIB32FLAGS}" \ CXX="${CXX} ${LIB32FLAGS}" \ LIBDIR=/usr/lib32 \ - SHLIBDIR=/usr/lib32 + SHLIBDIR=/usr/lib32 \ + COMPILER_TYPE=${WMAKE_COMPILER_TYPE} LIB32WMAKE= ${LIB32WMAKEENV} ${MAKE} -DNO_CPU_CFLAGS -DCOMPAT_32BIT \ -DWITHOUT_BIND -DWITHOUT_MAN -DWITHOUT_INFO \ Modified: stable/9/share/mk/Makefile ============================================================================== --- stable/9/share/mk/Makefile Wed Nov 14 20:01:40 2012 (r243040) +++ stable/9/share/mk/Makefile Wed Nov 14 20:27:17 2012 (r243041) @@ -3,7 +3,8 @@ FILES= bsd.README FILES+= bsd.arch.inc.mk -FILES+= bsd.compat.mk bsd.cpu.mk bsd.dep.mk bsd.doc.mk bsd.dtrace.mk +FILES+= bsd.compat.mk bsd.compiler.mk bsd.cpu.mk +FILES+= bsd.dep.mk bsd.doc.mk bsd.dtrace.mk FILES+= bsd.endian.mk FILES+= bsd.files.mk bsd.crunchgen.mk bsd.incs.mk bsd.info.mk bsd.init.mk FILES+= bsd.kmod.mk Copied and modified: stable/9/share/mk/bsd.compiler.mk (from r240468, head/share/mk/bsd.compiler.mk) ============================================================================== --- head/share/mk/bsd.compiler.mk Thu Sep 13 16:00:46 2012 (r240468, copy source) +++ stable/9/share/mk/bsd.compiler.mk Wed Nov 14 20:27:17 2012 (r243041) @@ -1,20 +1,20 @@ # $FreeBSD$ .if !defined(COMPILER_TYPE) -. if ${CC:T:Mgcc} == "gcc" +. if ${CC:T:Mgcc*} COMPILER_TYPE:= gcc -. elif ${CC:T:Mclang} == "clang" +. elif ${CC:T:Mclang} COMPILER_TYPE:= clang . else _COMPILER_VERSION!= ${CC} --version -. if ${_COMPILER_VERSION:Mgcc} == "gcc" +. if ${_COMPILER_VERSION:Mgcc} COMPILER_TYPE:= gcc -. elif ${_COMPILER_VERSION:M\(GCC\)} == "(GCC)" +. elif ${_COMPILER_VERSION:M\(GCC\)} COMPILER_TYPE:= gcc -. elif ${_COMPILER_VERSION:Mclang} == "clang" +. elif ${_COMPILER_VERSION:Mclang} COMPILER_TYPE:= clang . else -.error Unable to determing compiler type for ${CC} +.error Unable to determine compiler type for ${CC} . endif . undef _COMPILER_VERSION . endif Modified: stable/9/share/mk/bsd.sys.mk ============================================================================== --- stable/9/share/mk/bsd.sys.mk Wed Nov 14 20:01:40 2012 (r243040) +++ stable/9/share/mk/bsd.sys.mk Wed Nov 14 20:27:17 2012 (r243041) @@ -8,6 +8,8 @@ # for GCC: http://gcc.gnu.org/onlinedocs/gcc-4.2.1/gcc/Warning-Options.html +.include + # the default is gnu99 for now CSTD?= gnu99 @@ -28,8 +30,8 @@ CFLAGS+= -std=${CSTD} .if defined(WARNS) .if ${WARNS} >= 1 CWARNFLAGS+= -Wsystem-headers -.if !defined(NO_WERROR) && ((${MK_CLANG_IS_CC} == "no" && \ - ${CC:T:Mclang} != "clang") || !defined(NO_WERROR.clang)) +.if !defined(NO_WERROR) && (${COMPILER_TYPE} != "clang" \ + || !defined(NO_WERROR.clang)) CWARNFLAGS+= -Werror .endif # !NO_WERROR && (!CLANG || !NO_WERROR.clang) .endif # WARNS >= 1 @@ -43,8 +45,8 @@ CWARNFLAGS+= -W -Wno-unused-parameter -W .if ${WARNS} >= 4 CWARNFLAGS+= -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow\ -Wunused-parameter -.if !defined(NO_WCAST_ALIGN) && ((${MK_CLANG_IS_CC} == "no" && \ - ${CC:T:Mclang} != "clang") || !defined(NO_WCAST_ALIGN.clang)) +.if !defined(NO_WCAST_ALIGN) && (${COMPILER_TYPE} != "clang" \ + || !defined(NO_WCAST_ALIGN.clang)) CWARNFLAGS+= -Wcast-align .endif # !NO_WCAST_ALIGN && (!CLANG || !NO_WCAST_ALIGN.clang) .endif # WARNS >= 4 @@ -61,8 +63,7 @@ CWARNFLAGS+= -Wno-uninitialized CWARNFLAGS+= -Wno-pointer-sign # Clang has more warnings enabled by default, and when using -Wall, so if WARNS # is set to low values, these have to be disabled explicitly. -.if (${MK_CLANG_IS_CC} != "no" || ${CC:T:Mclang} == "clang") && \ - !defined(EARLY_BUILD) +.if ${COMPILER_TYPE} == "clang" && !defined(EARLY_BUILD) .if ${WARNS} <= 6 CWARNFLAGS+= -Wno-empty-body -Wno-string-plus-int .endif # WARNS <= 6 @@ -89,20 +90,18 @@ WFORMAT= 1 .if ${WFORMAT} > 0 #CWARNFLAGS+= -Wformat-nonliteral -Wformat-security -Wno-format-extra-args CWARNFLAGS+= -Wformat=2 -Wno-format-extra-args -.if (${MK_CLANG_IS_CC} != "no" || ${CC:T:Mclang} == "clang") && \ - !defined(EARLY_BUILD) +.if ${COMPILER_TYPE} == "clang" && !defined(EARLY_BUILD) .if ${WARNS} <= 3 CWARNFLAGS+= -Wno-format-nonliteral .endif # WARNS <= 3 .endif # CLANG -.if !defined(NO_WERROR) && ((${MK_CLANG_IS_CC} == "no" && \ - ${CC:T:Mclang} != "clang") || !defined(NO_WERROR.clang)) +.if !defined(NO_WERROR) && (${COMPILER_TYPE} != "clang" \ + || !defined(NO_WERROR.clang)) CWARNFLAGS+= -Werror .endif # !NO_WERROR && (!CLANG || !NO_WERROR.clang) .endif # WFORMAT > 0 .endif # WFORMAT -.if defined(NO_WFORMAT) || ((${MK_CLANG_IS_CC} != "no" || \ - ${CC:T:Mclang} == "clang") && defined(NO_WFORMAT.clang)) +.if defined(NO_WFORMAT) || (${COMPILER_TYPE} == "clang" && defined(NO_WFORMAT.clang)) CWARNFLAGS+= -Wno-format .endif # NO_WFORMAT || (CLANG && NO_WFORMAT.clang) .endif # !NO_WARNS @@ -111,8 +110,7 @@ CWARNFLAGS+= -Wno-format CWARNFLAGS+= -Wno-unknown-pragmas .endif # IGNORE_PRAGMA -.if (${MK_CLANG_IS_CC} != "no" || ${CC:T:Mclang} == "clang") && \ - !defined(EARLY_BUILD) +.if ${COMPILER_TYPE} == "clang" && !defined(EARLY_BUILD) CLANG_NO_IAS= -no-integrated-as CLANG_OPT_SMALL= -mstack-alignment=8 -mllvm -inline-threshold=3\ -mllvm -enable-load-pre=false -mllvm -simplifycfg-dup-ret Modified: stable/9/sys/conf/kern.mk ============================================================================== --- stable/9/sys/conf/kern.mk Wed Nov 14 20:01:40 2012 (r243040) +++ stable/9/sys/conf/kern.mk Wed Nov 14 20:27:17 2012 (r243041) @@ -15,7 +15,7 @@ CWARNFLAGS?= -Wall -Wredundant-decls -Wn # Disable a few warnings for clang, since there are several places in the # kernel where fixing them is more trouble than it is worth, or where there is # a false positive. -.if ${MK_CLANG_IS_CC} != "no" || ${CC:T:Mclang} == "clang" +.if ${COMPILER_TYPE} == "clang" NO_WCONSTANT_CONVERSION= -Wno-constant-conversion NO_WARRAY_BOUNDS= -Wno-array-bounds NO_WSHIFT_COUNT_NEGATIVE= -Wno-shift-count-negative @@ -51,7 +51,7 @@ CWARNEXTRA?= -Wno-error-tautological-com # Setting -mno-sse implies -mno-sse2, -mno-sse3, -mno-ssse3, -mno-sse41 and -mno-sse42 # .if ${MACHINE_CPUARCH} == "i386" -.if ${MK_CLANG_IS_CC} == "no" && ${CC:T:Mclang} != "clang" +.if ${COMPILER_TYPE} != "clang" CFLAGS+= -mno-align-long-strings -mpreferred-stack-boundary=2 .else CFLAGS+= -mno-aes -mno-avx @@ -99,7 +99,7 @@ INLINE_LIMIT?= 15000 # (-mfpmath= is not supported) # .if ${MACHINE_CPUARCH} == "amd64" -.if ${MK_CLANG_IS_CC} != "no" || ${CC:T:Mclang} == "clang" +.if ${COMPILER_TYPE} == "clang" CFLAGS+= -mno-aes -mno-avx .endif CFLAGS+= -mcmodel=kernel -mno-red-zone -mno-mmx -mno-sse -msoft-float \ Modified: stable/9/sys/conf/kern.pre.mk ============================================================================== --- stable/9/sys/conf/kern.pre.mk Wed Nov 14 20:01:40 2012 (r243040) +++ stable/9/sys/conf/kern.pre.mk Wed Nov 14 20:27:17 2012 (r243041) @@ -4,6 +4,7 @@ # of the definitions that need to be before %BEFORE_DEPEND. .include +.include # backwards compat option for older systems. MACHINE_CPUARCH?=${MACHINE_ARCH:C/mipse[lb]/mips/:C/armeb/arm/:C/powerpc64/powerpc/} @@ -35,7 +36,7 @@ _MINUS_O= -O2 .endif .endif .if ${MACHINE_CPUARCH} == "amd64" -.if ${MK_CLANG_IS_CC} == "no" && ${CC:T:Mclang} != "clang" +.if ${COMPILER_TYPE} != "clang" COPTFLAGS?=-O2 -frename-registers -pipe .else COPTFLAGS?=-O2 -pipe @@ -85,7 +86,7 @@ INCLUDES+= -I$S/dev/cxgb -I$S/dev/cxgbe CFLAGS= ${COPTFLAGS} ${C_DIALECT} ${DEBUG} ${CWARNFLAGS} CFLAGS+= ${INCLUDES} -D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h -.if ${MK_CLANG_IS_CC} == "no" && ${CC:T:Mclang} != "clang" +.if ${COMPILER_TYPE} != "clang" CFLAGS+= -fno-common -finline-limit=${INLINE_LIMIT} .if ${MACHINE_CPUARCH} != "mips" CFLAGS+= --param inline-unit-growth=100 @@ -102,7 +103,7 @@ WERROR?= -Werror # XXX LOCORE means "don't declare C stuff" not "for locore.s". ASM_CFLAGS= -x assembler-with-cpp -DLOCORE ${CFLAGS} -.if ${MK_CLANG_IS_CC} != "no" || ${CC:T:Mclang} == "clang" +.if ${COMPILER_TYPE} == "clang" CLANG_NO_IAS= -no-integrated-as .endif Modified: stable/9/sys/conf/kmod.mk ============================================================================== --- stable/9/sys/conf/kmod.mk Wed Nov 14 20:01:40 2012 (r243040) +++ stable/9/sys/conf/kmod.mk Wed Nov 14 20:27:17 2012 (r243041) @@ -73,6 +73,7 @@ OBJCOPY?= objcopy .endif .include +.include .SUFFIXES: .out .o .c .cc .cxx .C .y .l .s .S @@ -108,7 +109,7 @@ CFLAGS+= -I. -I@ # for example. CFLAGS+= -I@/contrib/altq -.if ${MK_CLANG_IS_CC} == "no" && ${CC:T:Mclang} != "clang" +.if ${COMPILER_TYPE} != "clang" CFLAGS+= -finline-limit=${INLINE_LIMIT} CFLAGS+= --param inline-unit-growth=100 CFLAGS+= --param large-function-growth=1000 From owner-svn-src-stable-9@FreeBSD.ORG Wed Nov 14 20:32:43 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E68D3852; Wed, 14 Nov 2012 20:32:43 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C840A8FC08; Wed, 14 Nov 2012 20:32:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAEKWhhl046846; Wed, 14 Nov 2012 20:32:43 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAEKWhLq046845; Wed, 14 Nov 2012 20:32:43 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201211142032.qAEKWhLq046845@svn.freebsd.org> From: Dimitry Andric Date: Wed, 14 Nov 2012 20:32:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243042 - stable/9/sys/conf X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Nov 2012 20:32:44 -0000 Author: dim Date: Wed Nov 14 20:32:43 2012 New Revision: 243042 URL: http://svnweb.freebsd.org/changeset/base/243042 Log: MFC r242715: For kernel builds with PROFLEVEL >= 1, such as LINT, don't attempt to use the -falign-functions option if the compiler is clang, as the flag is not supported. MFC r242717: For kernel builds with PROFLEVEL >= 2, such as LINT, don't attempt to use the -mprofiler-epilogue option if the compiler is clang, as the flag is not supported. While here, fix up the value indentations. Modified: stable/9/sys/conf/kern.pre.mk Directory Properties: stable/9/sys/ (props changed) stable/9/sys/conf/ (props changed) Modified: stable/9/sys/conf/kern.pre.mk ============================================================================== --- stable/9/sys/conf/kern.pre.mk Wed Nov 14 20:27:17 2012 (r243041) +++ stable/9/sys/conf/kern.pre.mk Wed Nov 14 20:32:43 2012 (r243042) @@ -108,12 +108,18 @@ CLANG_NO_IAS= -no-integrated-as .endif .if defined(PROFLEVEL) && ${PROFLEVEL} >= 1 -CFLAGS+= -DGPROF -falign-functions=16 +CFLAGS+= -DGPROF +.if ${COMPILER_TYPE} != "clang" +CFLAGS+= -falign-functions=16 +.endif .if ${PROFLEVEL} >= 2 CFLAGS+= -DGPROF4 -DGUPROF -PROF= -pg -mprofiler-epilogue +PROF= -pg +.if ${COMPILER_TYPE} != "clang" +PROF+= -mprofiler-epilogue +.endif .else -PROF= -pg +PROF= -pg .endif .endif DEFINED_PROF= ${PROF} From owner-svn-src-stable-9@FreeBSD.ORG Thu Nov 15 05:33:15 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1305D56A; Thu, 15 Nov 2012 05:33:15 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E24CC8FC08; Thu, 15 Nov 2012 05:33:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAF5XEnK026165; Thu, 15 Nov 2012 05:33:14 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAF5XEFS026164; Thu, 15 Nov 2012 05:33:14 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201211150533.qAF5XEFS026164@svn.freebsd.org> From: Alexander Motin Date: Thu, 15 Nov 2012 05:33:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243056 - stable/9/sys/geom/raid X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Nov 2012 05:33:15 -0000 Author: mav Date: Thu Nov 15 05:33:14 2012 New Revision: 243056 URL: http://svnweb.freebsd.org/changeset/base/243056 Log: MFC r242314: Make GEOM RAID more aggressive in marking volumes as clean on shutdown and move that action from shutdown_pre_sync to shutdown_post_sync stage to avoid extra flapping. ZFS tends to not close devices on shutdown, that doesn't allow GEOM RAID to shutdown gracefully. To handle that, mark volume as clean just when shutdown time comes and there are no active writes. Modified: stable/9/sys/geom/raid/g_raid.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/geom/raid/g_raid.c ============================================================================== --- stable/9/sys/geom/raid/g_raid.c Thu Nov 15 04:51:37 2012 (r243055) +++ stable/9/sys/geom/raid/g_raid.c Thu Nov 15 05:33:14 2012 (r243056) @@ -108,8 +108,9 @@ LIST_HEAD(, g_raid_tr_class) g_raid_tr_c LIST_HEAD(, g_raid_volume) g_raid_volumes = LIST_HEAD_INITIALIZER(g_raid_volumes); -static eventhandler_tag g_raid_pre_sync = NULL; +static eventhandler_tag g_raid_post_sync = NULL; static int g_raid_started = 0; +static int g_raid_shutdown = 0; static int g_raid_destroy_geom(struct gctl_req *req, struct g_class *mp, struct g_geom *gp); @@ -881,7 +882,7 @@ g_raid_orphan(struct g_consumer *cp) G_RAID_EVENT_DISK); } -static int +static void g_raid_clean(struct g_raid_volume *vol, int acw) { struct g_raid_softc *sc; @@ -892,22 +893,21 @@ g_raid_clean(struct g_raid_volume *vol, sx_assert(&sc->sc_lock, SX_XLOCKED); // if ((sc->sc_flags & G_RAID_DEVICE_FLAG_NOFAILSYNC) != 0) -// return (0); +// return; if (!vol->v_dirty) - return (0); + return; if (vol->v_writes > 0) - return (0); + return; if (acw > 0 || (acw == -1 && vol->v_provider != NULL && vol->v_provider->acw > 0)) { timeout = g_raid_clean_time - (time_uptime - vol->v_last_write); - if (timeout > 0) - return (timeout); + if (!g_raid_shutdown && timeout > 0) + return; } vol->v_dirty = 0; G_RAID_DEBUG1(1, sc, "Volume %s marked as clean.", vol->v_name); g_raid_write_metadata(sc, vol, NULL, NULL); - return (0); } static void @@ -1520,8 +1520,7 @@ process: g_raid_disk_done_request(bp); } else if (rv == EWOULDBLOCK) { TAILQ_FOREACH(vol, &sc->sc_volumes, v_next) { - if (vol->v_writes == 0 && vol->v_dirty) - g_raid_clean(vol, -1); + g_raid_clean(vol, -1); if (bioq_first(&vol->v_inflight) == NULL && vol->v_tr) { t.tv_sec = g_raid_idle_threshold / 1000000; @@ -1783,7 +1782,7 @@ g_raid_access(struct g_provider *pp, int error = ENXIO; goto out; } - if (dcw == 0 && vol->v_dirty) + if (dcw == 0) g_raid_clean(vol, dcw); vol->v_provider_open += acr + acw + ace; /* Handle delayed node destruction. */ @@ -2379,21 +2378,25 @@ g_raid_dumpconf(struct sbuf *sb, const c } static void -g_raid_shutdown_pre_sync(void *arg, int howto) +g_raid_shutdown_post_sync(void *arg, int howto) { struct g_class *mp; struct g_geom *gp, *gp2; struct g_raid_softc *sc; + struct g_raid_volume *vol; int error; mp = arg; DROP_GIANT(); g_topology_lock(); + g_raid_shutdown = 1; LIST_FOREACH_SAFE(gp, &mp->geom, geom, gp2) { if ((sc = gp->softc) == NULL) continue; g_topology_unlock(); sx_xlock(&sc->sc_lock); + TAILQ_FOREACH(vol, &sc->sc_volumes, v_next) + g_raid_clean(vol, -1); g_cancel_event(sc); error = g_raid_destroy(sc, G_RAID_DESTROY_DELAYED); if (error != 0) @@ -2408,9 +2411,9 @@ static void g_raid_init(struct g_class *mp) { - g_raid_pre_sync = EVENTHANDLER_REGISTER(shutdown_pre_sync, - g_raid_shutdown_pre_sync, mp, SHUTDOWN_PRI_FIRST); - if (g_raid_pre_sync == NULL) + g_raid_post_sync = EVENTHANDLER_REGISTER(shutdown_post_sync, + g_raid_shutdown_post_sync, mp, SHUTDOWN_PRI_FIRST); + if (g_raid_post_sync == NULL) G_RAID_DEBUG(0, "Warning! Cannot register shutdown event."); g_raid_started = 1; } @@ -2419,8 +2422,8 @@ static void g_raid_fini(struct g_class *mp) { - if (g_raid_pre_sync != NULL) - EVENTHANDLER_DEREGISTER(shutdown_pre_sync, g_raid_pre_sync); + if (g_raid_post_sync != NULL) + EVENTHANDLER_DEREGISTER(shutdown_post_sync, g_raid_post_sync); g_raid_started = 0; } From owner-svn-src-stable-9@FreeBSD.ORG Thu Nov 15 05:44:44 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D78D0884; Thu, 15 Nov 2012 05:44:44 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B930C8FC13; Thu, 15 Nov 2012 05:44:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAF5ii0Z027568; Thu, 15 Nov 2012 05:44:44 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAF5iiYX027563; Thu, 15 Nov 2012 05:44:44 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201211150544.qAF5iiYX027563@svn.freebsd.org> From: Alexander Motin Date: Thu, 15 Nov 2012 05:44:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243058 - stable/9/lib/libusbhid X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Nov 2012 05:44:44 -0000 Author: mav Date: Thu Nov 15 05:44:44 2012 New Revision: 243058 URL: http://svnweb.freebsd.org/changeset/base/243058 Log: MFC r240762: Restore handling of the third argument (id) of hid_start_parse(), same as it is done in NetBSD/OpenBSD, and as it was here before r205728. I personally think this API or its implementation is incorrect, as it is not correct to filter collections based on report ID, as they are orthogonal in general case, but I see no harm from supporting this feature. PR: usb/171810 Modified: stable/9/lib/libusbhid/descr.c stable/9/lib/libusbhid/parse.c stable/9/lib/libusbhid/usbhid.3 Directory Properties: stable/9/lib/libusbhid/ (props changed) Modified: stable/9/lib/libusbhid/descr.c ============================================================================== --- stable/9/lib/libusbhid/descr.c Thu Nov 15 05:34:14 2012 (r243057) +++ stable/9/lib/libusbhid/descr.c Thu Nov 15 05:44:44 2012 (r243058) @@ -68,7 +68,7 @@ hid_get_report_id(int fd) if ((rep = hid_get_report_desc(fd)) == NULL) goto use_ioctl; kindset = 1 << hid_input | 1 << hid_output | 1 << hid_feature; - for (d = hid_start_parse(rep, kindset, 0); hid_get_item(d, &h); ) { + for (d = hid_start_parse(rep, kindset, -1); hid_get_item(d, &h); ) { /* Return the first report ID we met. */ if (h.report_ID != 0) { temp = h.report_ID; Modified: stable/9/lib/libusbhid/parse.c ============================================================================== --- stable/9/lib/libusbhid/parse.c Thu Nov 15 05:34:14 2012 (r243057) +++ stable/9/lib/libusbhid/parse.c Thu Nov 15 05:44:44 2012 (r243058) @@ -70,6 +70,7 @@ struct hid_data { uint8_t iusage; /* current "usages_min/max" index */ uint8_t ousage; /* current "usages_min/max" offset */ uint8_t susage; /* usage set flags */ + int32_t reportid; /* requested report ID */ }; /*------------------------------------------------------------------------* @@ -149,7 +150,7 @@ hid_switch_rid(struct hid_data *s, struc * hid_start_parse *------------------------------------------------------------------------*/ hid_data_t -hid_start_parse(report_desc_t d, int kindset, int id __unused) +hid_start_parse(report_desc_t d, int kindset, int id) { struct hid_data *s; @@ -158,6 +159,7 @@ hid_start_parse(report_desc_t d, int kin s->start = s->p = d->data; s->end = d->data + d->size; s->kindset = kindset; + s->reportid = id; return (s); } @@ -207,8 +209,8 @@ hid_get_byte(struct hid_data *s, const u /*------------------------------------------------------------------------* * hid_get_item *------------------------------------------------------------------------*/ -int -hid_get_item(hid_data_t s, hid_item_t *h) +static int +hid_get_item_raw(hid_data_t s, hid_item_t *h) { hid_item_t *c; unsigned int bTag, bType, bSize; @@ -509,6 +511,19 @@ hid_get_item(hid_data_t s, hid_item_t *h } int +hid_get_item(hid_data_t s, hid_item_t *h) +{ + int r; + + for (;;) { + r = hid_get_item_raw(s, h); + if (r <= 0 || s->reportid == -1 || h->report_ID == s->reportid) + break; + } + return (r); +} + +int hid_report_size(report_desc_t r, enum hid_kind k, int id) { struct hid_data *d; @@ -523,7 +538,7 @@ hid_report_size(report_desc_t r, enum hi memset(&h, 0, sizeof h); for (d = hid_start_parse(r, 1 << k, id); hid_get_item(d, &h); ) { - if ((h.report_ID == id || id < 0) && h.kind == k) { + if (h.kind == k) { /* compute minimum */ if (lpos > h.pos) lpos = h.pos; Modified: stable/9/lib/libusbhid/usbhid.3 ============================================================================== --- stable/9/lib/libusbhid/usbhid.3 Thu Nov 15 05:34:14 2012 (r243057) +++ stable/9/lib/libusbhid/usbhid.3 Thu Nov 15 05:44:44 2012 (r243058) @@ -144,16 +144,15 @@ fails it will return .Ss Descriptor Parsing Functions To parse the report descriptor the .Fn hid_start_parse -function should be called with a report descriptor and a set that -describes which items that are interesting. +function should be called with a report descriptor, a set that +describes which items that are interesting, and the desired report +ID (or -1 to obtain items of all report IDs). The set is obtained by OR-ing together values .Fa "(1 << k)" where .Fa k is an item of type .Vt hid_kind_t . -The report ID (if present) is given by -.Fa id . The function returns .Dv NULL if the initialization fails, otherwise an opaque value to be used From owner-svn-src-stable-9@FreeBSD.ORG Thu Nov 15 05:54:18 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C9F23D45; Thu, 15 Nov 2012 05:54:18 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A43818FC08; Thu, 15 Nov 2012 05:54:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAF5sIkI029187; Thu, 15 Nov 2012 05:54:18 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAF5sIVi029181; Thu, 15 Nov 2012 05:54:18 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201211150554.qAF5sIVi029181@svn.freebsd.org> From: Alexander Motin Date: Thu, 15 Nov 2012 05:54:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243060 - stable/9/sys/dev/sound/pci/hda X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Nov 2012 05:54:18 -0000 Author: mav Date: Thu Nov 15 05:54:18 2012 New Revision: 243060 URL: http://svnweb.freebsd.org/changeset/base/243060 Log: MFC r242352: Print card and subsystem IDs in verbose logs to help to identify system. Hide some less iseful messages under debug. Modified: stable/9/sys/dev/sound/pci/hda/hdaa.c stable/9/sys/dev/sound/pci/hda/hdaa.h stable/9/sys/dev/sound/pci/hda/hdaa_patches.c stable/9/sys/dev/sound/pci/hda/hdac.c stable/9/sys/dev/sound/pci/hda/hdac.h stable/9/sys/dev/sound/pci/hda/hdacc.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/sound/pci/hda/hdaa.c ============================================================================== --- stable/9/sys/dev/sound/pci/hda/hdaa.c Thu Nov 15 05:46:02 2012 (r243059) +++ stable/9/sys/dev/sound/pci/hda/hdaa.c Thu Nov 15 05:54:18 2012 (r243060) @@ -6243,6 +6243,10 @@ hdaa_attach(device_t dev) devinfo->endnode = devinfo->startnode + devinfo->nodecnt; HDA_BOOTVERBOSE( + device_printf(dev, "Subsystem ID: 0x%08x\n", + hda_get_subsystem_id(dev)); + ); + HDA_BOOTHVERBOSE( device_printf(dev, "Audio Function Group at nid=%d: %d subnodes %d-%d\n", nid, devinfo->nodecnt, Modified: stable/9/sys/dev/sound/pci/hda/hdaa.h ============================================================================== --- stable/9/sys/dev/sound/pci/hda/hdaa.h Thu Nov 15 05:46:02 2012 (r243059) +++ stable/9/sys/dev/sound/pci/hda/hdaa.h Thu Nov 15 05:54:18 2012 (r243060) @@ -260,7 +260,7 @@ struct hdaa_chan { (((uint32_t)hda_get_vendor_id(devinfo->dev) << 16) + \ hda_get_device_id(devinfo->dev)) -#define hdaa_subvendor_id(devinfo) \ +#define hdaa_card_id(devinfo) \ (((uint32_t)hda_get_subdevice_id(devinfo->dev) << 16) + \ hda_get_subvendor_id(devinfo->dev)) Modified: stable/9/sys/dev/sound/pci/hda/hdaa_patches.c ============================================================================== --- stable/9/sys/dev/sound/pci/hda/hdaa_patches.c Thu Nov 15 05:46:02 2012 (r243059) +++ stable/9/sys/dev/sound/pci/hda/hdaa_patches.c Thu Nov 15 05:54:18 2012 (r243060) @@ -139,7 +139,7 @@ hdac_pin_patch(struct hdaa_widget *w) config = orig = w->wclass.pin.config; id = hdaa_codec_id(w->devinfo); - subid = hdaa_subvendor_id(w->devinfo); + subid = hdaa_card_id(w->devinfo); /* XXX: Old patches require complete review. * Now they may create more problem then solve due to @@ -392,7 +392,7 @@ hdaa_patch(struct hdaa_devinfo *devinfo) int i; id = hdaa_codec_id(devinfo); - subid = hdaa_subvendor_id(devinfo); + subid = hdaa_card_id(devinfo); /* * Quirks @@ -594,7 +594,7 @@ hdaa_patch_direct(struct hdaa_devinfo *d uint32_t id, subid, val; id = hdaa_codec_id(devinfo); - subid = hdaa_subvendor_id(devinfo); + subid = hdaa_card_id(devinfo); switch (id) { case HDA_CODEC_VT1708S_0: Modified: stable/9/sys/dev/sound/pci/hda/hdac.c ============================================================================== --- stable/9/sys/dev/sound/pci/hda/hdac.c Thu Nov 15 05:46:02 2012 (r243059) +++ stable/9/sys/dev/sound/pci/hda/hdac.c Thu Nov 15 05:54:18 2012 (r243060) @@ -1074,6 +1074,8 @@ hdac_attach(device_t dev) sc = device_get_softc(dev); HDA_BOOTVERBOSE( + device_printf(dev, "PCI card vendor: 0x%04x, device: 0x%04x\n", + pci_get_subvendor(dev), pci_get_subdevice(dev)); device_printf(dev, "HDA Driver Revision: %s\n", HDA_DRV_TEST_REV); ); Modified: stable/9/sys/dev/sound/pci/hda/hdac.h ============================================================================== --- stable/9/sys/dev/sound/pci/hda/hdac.h Thu Nov 15 05:46:02 2012 (r243059) +++ stable/9/sys/dev/sound/pci/hda/hdac.h Thu Nov 15 05:54:18 2012 (r243060) @@ -666,6 +666,7 @@ HDA_ACCESSOR(revision_id, REVISION_ID, u HDA_ACCESSOR(stepping_id, STEPPING_ID, uint8_t); HDA_ACCESSOR(subvendor_id, SUBVENDOR_ID, uint16_t); HDA_ACCESSOR(subdevice_id, SUBDEVICE_ID, uint16_t); +HDA_ACCESSOR(subsystem_id, SUBSYSTEM_ID, uint32_t); HDA_ACCESSOR(node_type, NODE_TYPE, uint8_t); HDA_ACCESSOR(dma_nocache, DMA_NOCACHE, uint8_t); Modified: stable/9/sys/dev/sound/pci/hda/hdacc.c ============================================================================== --- stable/9/sys/dev/sound/pci/hda/hdacc.c Thu Nov 15 05:46:02 2012 (r243059) +++ stable/9/sys/dev/sound/pci/hda/hdacc.c Thu Nov 15 05:54:18 2012 (r243060) @@ -422,7 +422,7 @@ hdacc_attach(device_t dev) startnode = HDA_PARAM_SUB_NODE_COUNT_START(subnode); endnode = startnode + codec->fgcnt; - HDA_BOOTVERBOSE( + HDA_BOOTHVERBOSE( device_printf(dev, "Root Node at nid=0: %d subnodes %d-%d\n", HDA_PARAM_SUB_NODE_COUNT_TOTAL(subnode), @@ -506,6 +506,10 @@ hdacc_probe_nomatch(device_t dev, device fg->type == HDA_PARAM_FCT_GRP_TYPE_NODE_TYPE_AUDIO ? "Audio" : (fg->type == HDA_PARAM_FCT_GRP_TYPE_NODE_TYPE_MODEM ? "Modem" : "Unknown"), fg->nid, device_get_nameunit(dev)); + HDA_BOOTVERBOSE( + device_printf(dev, "Subsystem ID: 0x%08x\n", + hda_get_subsystem_id(dev)); + ); HDA_BOOTHVERBOSE( device_printf(dev, "Power down FG nid=%d to the D3 state...\n", fg->nid); From owner-svn-src-stable-9@FreeBSD.ORG Thu Nov 15 05:57:20 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 98CDA95; Thu, 15 Nov 2012 05:57:20 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 7D7198FC13; Thu, 15 Nov 2012 05:57:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAF5vKeF029596; Thu, 15 Nov 2012 05:57:20 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAF5vKPq029595; Thu, 15 Nov 2012 05:57:20 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201211150557.qAF5vKPq029595@svn.freebsd.org> From: Alexander Motin Date: Thu, 15 Nov 2012 05:57:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243062 - stable/9/sys/dev/sound/pci/hda X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Nov 2012 05:57:20 -0000 Author: mav Date: Thu Nov 15 05:57:20 2012 New Revision: 243062 URL: http://svnweb.freebsd.org/changeset/base/243062 Log: MFC r242357: Set all pins initial connection status to unknown (2) and then update it with the real value in regular way if sensing is supported. This fixes minor inconsistency when playback redirection appeared in undefined state on boot if headphones were not connected. Modified: stable/9/sys/dev/sound/pci/hda/hdaa.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/sound/pci/hda/hdaa.c ============================================================================== --- stable/9/sys/dev/sound/pci/hda/hdaa.c Thu Nov 15 05:55:30 2012 (r243061) +++ stable/9/sys/dev/sound/pci/hda/hdaa.c Thu Nov 15 05:57:20 2012 (r243062) @@ -400,7 +400,7 @@ hdaa_presence_handler(struct hdaa_widget struct hdaa_devinfo *devinfo = w->devinfo; struct hdaa_audio_as *as; uint32_t res; - int connected; + int connected, old; if (w->enable == 0 || w->type != HDA_PARAM_AUDIO_WIDGET_CAP_TYPE_PIN_COMPLEX) @@ -414,19 +414,22 @@ hdaa_presence_handler(struct hdaa_widget connected = (res & HDA_CMD_GET_PIN_SENSE_PRESENCE_DETECT) != 0; if (devinfo->quirks & HDAA_QUIRK_SENSEINV) connected = !connected; - if (connected == w->wclass.pin.connected) + old = w->wclass.pin.connected; + if (connected == old) return; w->wclass.pin.connected = connected; HDA_BOOTVERBOSE( - device_printf(devinfo->dev, - "Pin sense: nid=%d sence=0x%08x (%sconnected)\n", - w->nid, res, !w->wclass.pin.connected ? "dis" : ""); + if (connected || old != 2) { + device_printf(devinfo->dev, + "Pin sense: nid=%d sence=0x%08x (%sconnected)\n", + w->nid, res, !connected ? "dis" : ""); + } ); as = &devinfo->as[w->bindas]; if (as->hpredir >= 0 && as->pins[15] == w->nid) hdaa_hpredir_handler(w); - if (as->dir == HDAA_CTL_IN) + if (as->dir == HDAA_CTL_IN && old != 2) hdaa_autorecsrc_handler(as, w); } @@ -1151,6 +1154,7 @@ hdaa_widget_parse(struct hdaa_widget *w) HDA_CMD_GET_PARAMETER(0, w->nid, HDA_PARAM_PIN_CAP)); w->wclass.pin.ctrl = hda_command(dev, HDA_CMD_GET_PIN_WIDGET_CTRL(0, nid)); + w->wclass.pin.connected = 2; if (HDA_PARAM_PIN_CAP_EAPD_CAP(w->wclass.pin.cap)) { w->param.eapdbtl = hda_command(dev, HDA_CMD_GET_EAPD_BTL_ENABLE(0, nid)); @@ -1238,10 +1242,6 @@ hdaa_widget_postprocess(struct hdaa_widg } strlcat(w->name, HDA_CONNS[conn], sizeof(w->name)); strlcat(w->name, ")", sizeof(w->name)); - - if (HDA_PARAM_PIN_CAP_PRESENCE_DETECT_CAP(w->wclass.pin.cap) == 0 || - (HDA_CONFIG_DEFAULTCONF_MISC(w->wclass.pin.config) & 1) != 0) - w->wclass.pin.connected = 2; } } From owner-svn-src-stable-9@FreeBSD.ORG Thu Nov 15 06:03:15 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 92D77408; Thu, 15 Nov 2012 06:03:15 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5D1C78FC08; Thu, 15 Nov 2012 06:03:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAF63FFX030442; Thu, 15 Nov 2012 06:03:15 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAF63Fxq030441; Thu, 15 Nov 2012 06:03:15 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201211150603.qAF63Fxq030441@svn.freebsd.org> From: Alexander Motin Date: Thu, 15 Nov 2012 06:03:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243064 - stable/9/sys/dev/sound/pci/hda X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Nov 2012 06:03:15 -0000 Author: mav Date: Thu Nov 15 06:03:14 2012 New Revision: 243064 URL: http://svnweb.freebsd.org/changeset/base/243064 Log: MFC r242417: ASUS EeePC 1001px has strange variant of ALC269 CODEC, that mutes speaker if unused in that configuration mixer at NID 15 is muted. Probably CODEC incorrectly reports its internal connections. Hide that muter from the driver to avoid muting and make built-in speaker work. There are several different CODECs sharing this ID and I have not enough information about them and the bug to implement more universal solution. Modified: stable/9/sys/dev/sound/pci/hda/hdaa_patches.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/sound/pci/hda/hdaa_patches.c ============================================================================== --- stable/9/sys/dev/sound/pci/hda/hdaa_patches.c Thu Nov 15 05:58:37 2012 (r243063) +++ stable/9/sys/dev/sound/pci/hda/hdaa_patches.c Thu Nov 15 06:03:14 2012 (r243064) @@ -541,6 +541,21 @@ hdaa_patch(struct hdaa_devinfo *devinfo) if (w != NULL) w->connsenable[0] = 0; break; + case HDA_CODEC_ALC269: + /* + * ASUS EeePC 1001px has strange variant of ALC269 CODEC, + * that mutes speaker if unused mixer at NID 15 is muted. + * Probably CODEC incorrectly reports internal connections. + * Hide that muter from the driver. There are several CODECs + * sharing this ID and I have not enough information about + * them to implement more universal solution. + */ + if (subid == 0x84371043) { + w = hdaa_widget_get(devinfo, 15); + if (w != NULL) + w->param.inamp_cap = 0; + } + break; case HDA_CODEC_CX20582: case HDA_CODEC_CX20583: case HDA_CODEC_CX20584: From owner-svn-src-stable-9@FreeBSD.ORG Thu Nov 15 07:36:39 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0EA16C63; Thu, 15 Nov 2012 07:36:39 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E3E5F8FC13; Thu, 15 Nov 2012 07:36:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAF7ac2B044338; Thu, 15 Nov 2012 07:36:38 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAF7ac3a044337; Thu, 15 Nov 2012 07:36:38 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201211150736.qAF7ac3a044337@svn.freebsd.org> From: Dimitry Andric Date: Thu, 15 Nov 2012 07:36:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243067 - stable/9/sys/i386/xen X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Nov 2012 07:36:39 -0000 Author: dim Date: Thu Nov 15 07:36:38 2012 New Revision: 243067 URL: http://svnweb.freebsd.org/changeset/base/243067 Log: MFC r242931: Fix a minor warning in sys/i386/xen/clock.c. Modified: stable/9/sys/i386/xen/clock.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/i386/xen/clock.c ============================================================================== --- stable/9/sys/i386/xen/clock.c Thu Nov 15 06:58:18 2012 (r243066) +++ stable/9/sys/i386/xen/clock.c Thu Nov 15 07:36:38 2012 (r243067) @@ -516,7 +516,7 @@ startrtclock() __cpu_khz = 1000000ULL << 32; info = &HYPERVISOR_shared_info->vcpu_info[0].time; - do_div(__cpu_khz, info->tsc_to_system_mul); + (void)do_div(__cpu_khz, info->tsc_to_system_mul); if ( info->tsc_shift < 0 ) cpu_khz = __cpu_khz << -info->tsc_shift; else From owner-svn-src-stable-9@FreeBSD.ORG Thu Nov 15 07:48:44 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D48FD221; Thu, 15 Nov 2012 07:48:44 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B9BE58FC13; Thu, 15 Nov 2012 07:48:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAF7mioA045796; Thu, 15 Nov 2012 07:48:44 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAF7miGp045795; Thu, 15 Nov 2012 07:48:44 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201211150748.qAF7miGp045795@svn.freebsd.org> From: Dimitry Andric Date: Thu, 15 Nov 2012 07:48:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243068 - stable/9/sys/dev/xen/netback X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Nov 2012 07:48:44 -0000 Author: dim Date: Thu Nov 15 07:48:44 2012 New Revision: 243068 URL: http://svnweb.freebsd.org/changeset/base/243068 Log: MFC r242889 (by rdivacky): Change the XNB_ASSERT from a statement expression to do-while(0) as its result is never used. MFC r242934: Redo r242889, now using the method from projects/amd64_xen_pv r240747. Reminded by: kib Modified: stable/9/sys/dev/xen/netback/netback_unit_tests.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/xen/netback/netback_unit_tests.c ============================================================================== --- stable/9/sys/dev/xen/netback/netback_unit_tests.c Thu Nov 15 07:36:38 2012 (r243067) +++ stable/9/sys/dev/xen/netback/netback_unit_tests.c Thu Nov 15 07:48:44 2012 (r243068) @@ -58,8 +58,8 @@ __FBSDID("$FreeBSD$"); #define TOSTRING(x) STRINGIFY(x) /** - * Writes an error message to buffer if cond is false, and returns true - * iff the assertion failed. Note the implied parameters buffer and + * Writes an error message to buffer if cond is false + * Note the implied parameters buffer and * buflen */ #define XNB_ASSERT(cond) ({ \ @@ -71,7 +71,7 @@ __FBSDID("$FreeBSD$"); strlcat(_buffer, ":" TOSTRING(__LINE__) \ " Assertion Error: " #cond "\n", _buflen); \ } \ - ! passed; }) + }) /** From owner-svn-src-stable-9@FreeBSD.ORG Thu Nov 15 15:48:41 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id F0C222E0; Thu, 15 Nov 2012 15:48:40 +0000 (UTC) (envelope-from n_hibma@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D38008FC08; Thu, 15 Nov 2012 15:48:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAFFmem9010636; Thu, 15 Nov 2012 15:48:40 GMT (envelope-from n_hibma@svn.freebsd.org) Received: (from n_hibma@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAFFme2Z010635; Thu, 15 Nov 2012 15:48:40 GMT (envelope-from n_hibma@svn.freebsd.org) Message-Id: <201211151548.qAFFme2Z010635@svn.freebsd.org> From: Nick Hibma Date: Thu, 15 Nov 2012 15:48:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243086 - stable/9/etc X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Nov 2012 15:48:41 -0000 Author: n_hibma Date: Thu Nov 15 15:48:40 2012 New Revision: 243086 URL: http://svnweb.freebsd.org/changeset/base/243086 Log: MFC r242784: Not only load pccard_ether settings, also load network settings. This is only a problem when a /etc/rc.conf.d/network file is being used. PR: conf/160373 Submitted by: n_hibma Modified: stable/9/etc/pccard_ether Directory Properties: stable/9/etc/ (props changed) Modified: stable/9/etc/pccard_ether ============================================================================== --- stable/9/etc/pccard_ether Thu Nov 15 15:21:58 2012 (r243085) +++ stable/9/etc/pccard_ether Thu Nov 15 15:48:40 2012 (r243086) @@ -123,4 +123,5 @@ else fi load_rc_config pccard_ether +load_rc_config network run_rc_command $args From owner-svn-src-stable-9@FreeBSD.ORG Thu Nov 15 18:05:31 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 129BC981; Thu, 15 Nov 2012 18:05:31 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D76B88FC15; Thu, 15 Nov 2012 18:05:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAFI5UCp032535; Thu, 15 Nov 2012 18:05:30 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAFI5UmV032534; Thu, 15 Nov 2012 18:05:30 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201211151805.qAFI5UmV032534@svn.freebsd.org> From: Baptiste Daroussin Date: Thu, 15 Nov 2012 18:05:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243092 - stable/9/sys/kern X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Nov 2012 18:05:31 -0000 Author: bapt Date: Thu Nov 15 18:05:30 2012 New Revision: 243092 URL: http://svnweb.freebsd.org/changeset/base/243092 Log: MFC r243022: small style fix Modified: stable/9/sys/kern/kern_prot.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/kern_prot.c ============================================================================== --- stable/9/sys/kern/kern_prot.c Thu Nov 15 16:54:14 2012 (r243091) +++ stable/9/sys/kern/kern_prot.c Thu Nov 15 18:05:30 2012 (r243092) @@ -2085,7 +2085,7 @@ sys_getlogin(struct thread *td, struct g SESS_UNLOCK(p->p_session); PROC_UNLOCK(p); error = copyout(login, uap->namebuf, uap->namelen); - return(error); + return (error); } /* From owner-svn-src-stable-9@FreeBSD.ORG Thu Nov 15 19:27:12 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 31C2766A; Thu, 15 Nov 2012 19:27:12 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 15E978FC13; Thu, 15 Nov 2012 19:27:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAFJRBp9043834; Thu, 15 Nov 2012 19:27:11 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAFJRBYL043833; Thu, 15 Nov 2012 19:27:11 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201211151927.qAFJRBYL043833@svn.freebsd.org> From: Navdeep Parhar Date: Thu, 15 Nov 2012 19:27:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243097 - stable/9/usr.bin/ktrdump X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Nov 2012 19:27:12 -0000 Author: np Date: Thu Nov 15 19:27:11 2012 New Revision: 243097 URL: http://svnweb.freebsd.org/changeset/base/243097 Log: MFC r242378: Catch up with r238925. ktr_entries may not be a power of 2. Modified: stable/9/usr.bin/ktrdump/ktrdump.c Directory Properties: stable/9/usr.bin/ktrdump/ (props changed) Modified: stable/9/usr.bin/ktrdump/ktrdump.c ============================================================================== --- stable/9/usr.bin/ktrdump/ktrdump.c Thu Nov 15 19:23:39 2012 (r243096) +++ stable/9/usr.bin/ktrdump/ktrdump.c Thu Nov 15 19:27:11 2012 (r243097) @@ -218,7 +218,7 @@ main(int ac, char **av) * Now tear through the trace buffer. */ if (!iflag) - i = (index - 1) & (entries - 1); + i = (index - 1) % entries; tlast = -1; for (;;) { if (buf[i].ktr_desc == NULL) @@ -286,7 +286,7 @@ next: if ((c = *p++) == '\0') if (!iflag) { if (i == index) break; - i = (i - 1) & (entries - 1); + i = (i - 1) % entries; } else { if (++i == entries) break; From owner-svn-src-stable-9@FreeBSD.ORG Thu Nov 15 19:45:05 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7622CB91; Thu, 15 Nov 2012 19:45:05 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 405BD8FC08; Thu, 15 Nov 2012 19:45:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAFJj5cr045862; Thu, 15 Nov 2012 19:45:05 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAFJj5NE045860; Thu, 15 Nov 2012 19:45:05 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201211151945.qAFJj5NE045860@svn.freebsd.org> From: Navdeep Parhar Date: Thu, 15 Nov 2012 19:45:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243098 - stable/9/sys/dev/cxgbe/tom X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Nov 2012 19:45:05 -0000 Author: np Date: Thu Nov 15 19:45:04 2012 New Revision: 243098 URL: http://svnweb.freebsd.org/changeset/base/243098 Log: MFC r242666, r242671. r242666: Remove the tid from the software table (and bump down the in-use counter) when the syncache doesn't want the driver to reply to an incoming SYN. This fixes a harmless bug where tids_in_use would go out of sync with the hardware counter. r242671: Make sure the inp hasn't been dropped before trying to access its socket and tcpcb. Modified: stable/9/sys/dev/cxgbe/tom/t4_cpl_io.c stable/9/sys/dev/cxgbe/tom/t4_listen.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/cxgbe/tom/t4_cpl_io.c ============================================================================== --- stable/9/sys/dev/cxgbe/tom/t4_cpl_io.c Thu Nov 15 19:27:11 2012 (r243097) +++ stable/9/sys/dev/cxgbe/tom/t4_cpl_io.c Thu Nov 15 19:45:04 2012 (r243098) @@ -982,7 +982,6 @@ do_abort_req(struct sge_iq *iq, const st struct sge_wrq *ofld_txq = toep->ofld_txq; struct inpcb *inp; struct tcpcb *tp; - struct socket *so; #ifdef INVARIANTS unsigned int opcode = G_CPL_OPCODE(be32toh(OPCODE_TID(cpl))); #endif @@ -1008,7 +1007,6 @@ do_abort_req(struct sge_iq *iq, const st INP_WLOCK(inp); tp = intotcpcb(inp); - so = inp->inp_socket; CTR6(KTR_CXGBE, "%s: tid %d (%s), toep_flags 0x%x, inp_flags 0x%x, status %d", @@ -1026,10 +1024,16 @@ do_abort_req(struct sge_iq *iq, const st } toep->flags |= TPF_ABORT_SHUTDOWN; - so_error_set(so, abort_status_to_errno(tp, cpl->status)); - tp = tcp_close(tp); - if (tp == NULL) - INP_WLOCK(inp); /* re-acquire */ + if ((inp->inp_flags & (INP_DROPPED | INP_TIMEWAIT)) == 0) { + struct socket *so = inp->inp_socket; + + if (so != NULL) + so_error_set(so, abort_status_to_errno(tp, + cpl->status)); + tp = tcp_close(tp); + if (tp == NULL) + INP_WLOCK(inp); /* re-acquire */ + } final_cpl_received(toep); done: Modified: stable/9/sys/dev/cxgbe/tom/t4_listen.c ============================================================================== --- stable/9/sys/dev/cxgbe/tom/t4_listen.c Thu Nov 15 19:27:11 2012 (r243097) +++ stable/9/sys/dev/cxgbe/tom/t4_listen.c Thu Nov 15 19:45:04 2012 (r243098) @@ -1202,6 +1202,7 @@ do_pass_accept_req(struct sge_iq *iq, co if (m) m->m_pkthdr.rcvif = ifp; + remove_tid(sc, synqe->tid); release_synqe(synqe); /* about to exit function */ free(wr, M_CXGBE); REJECT_PASS_ACCEPT(); From owner-svn-src-stable-9@FreeBSD.ORG Fri Nov 16 02:26:23 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CBA43CA5; Fri, 16 Nov 2012 02:26:23 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id AE3468FC08; Fri, 16 Nov 2012 02:26:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAG2QNTo099651; Fri, 16 Nov 2012 02:26:23 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAG2QNPC099647; Fri, 16 Nov 2012 02:26:23 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201211160226.qAG2QNPC099647@svn.freebsd.org> From: Alexander Motin Date: Fri, 16 Nov 2012 02:26:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243118 - in stable/9: share/man/man4 sys/dev/ata X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Nov 2012 02:26:24 -0000 Author: mav Date: Fri Nov 16 02:26:23 2012 New Revision: 243118 URL: http://svnweb.freebsd.org/changeset/base/243118 Log: MFC r241144, r241160: Implement SATA revision (speed) control for legacy SATA controller for both boot (via loader tunables) and run-time (via `camcontrol negotiate`). Tested to work at least on NVIDIA MCP55 chipset. Modified: stable/9/share/man/man4/ata.4 stable/9/sys/dev/ata/ata-all.c stable/9/sys/dev/ata/ata-all.h stable/9/sys/dev/ata/ata-sata.c Directory Properties: stable/9/share/man/man4/ (props changed) stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/share/man/man4/ata.4 ============================================================================== --- stable/9/share/man/man4/ata.4 Fri Nov 16 01:43:23 2012 (r243117) +++ stable/9/share/man/man4/ata.4 Fri Nov 16 02:26:23 2012 (r243118) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 18, 2012 +.Dd October 3, 2012 .Dt ATA 4 .Os .Sh NAME @@ -99,7 +99,7 @@ set to 0 to disable the 80pin cable chec set to 1 to allow Message Signalled Interrupts (MSI) to be used by the specified PCI ATA controller, if supported. .It Va hint.ata.X.devX.mode -limits the initial ATA mode for the specified device on specified the channel. +limits the initial ATA mode for the specified device on the specified channel. .It Va hint.ata.X.mode limits the initial ATA mode for every device on the specified channel. .It Va hint.ata.X.pm_level @@ -118,6 +118,12 @@ The host initiates a PARTIAL PM state tr host initiates SLUMBER PM state transition every time port becomes idle. .El Modes 2 and 3 are only supported for AHCI. +.It Va hint.ata. Ns Ar X Ns Va .dev Ns Ar X Ns Va .sata_rev +limits the initial SATA revision (speed) for the specified device +on the specified channel. +Values 1, 2 and 3 are respectively 1.5, 3 and 6Gbps. +.It Va hint.ata. Ns Ar X Ns Va .sata_rev +Same, but for every device on the specified channel. .El .Sh DESCRIPTION The Modified: stable/9/sys/dev/ata/ata-all.c ============================================================================== --- stable/9/sys/dev/ata/ata-all.c Fri Nov 16 01:43:23 2012 (r243117) +++ stable/9/sys/dev/ata/ata-all.c Fri Nov 16 02:26:23 2012 (r243118) @@ -172,6 +172,15 @@ ata_attach(device_t dev) TASK_INIT(&ch->conntask, 0, ata_conn_event, dev); #ifdef ATA_CAM for (i = 0; i < 16; i++) { + ch->user[i].revision = 0; + snprintf(buf, sizeof(buf), "dev%d.sata_rev", i); + if (resource_int_value(device_get_name(dev), + device_get_unit(dev), buf, &mode) != 0 && + resource_int_value(device_get_name(dev), + device_get_unit(dev), "sata_rev", &mode) != 0) + mode = -1; + if (mode >= 0) + ch->user[i].revision = mode; ch->user[i].mode = 0; snprintf(buf, sizeof(buf), "dev%d.mode", i); if (resource_string_value(device_get_name(dev), Modified: stable/9/sys/dev/ata/ata-all.h ============================================================================== --- stable/9/sys/dev/ata/ata-all.h Fri Nov 16 01:43:23 2012 (r243117) +++ stable/9/sys/dev/ata/ata-all.h Fri Nov 16 02:26:23 2012 (r243118) @@ -142,6 +142,7 @@ #define ATA_SC_SPD_NO_SPEED 0x00000000 #define ATA_SC_SPD_SPEED_GEN1 0x00000010 #define ATA_SC_SPD_SPEED_GEN2 0x00000020 +#define ATA_SC_SPD_SPEED_GEN3 0x00000040 #define ATA_SC_IPM_MASK 0x00000f00 #define ATA_SC_IPM_NONE 0x00000000 Modified: stable/9/sys/dev/ata/ata-sata.c ============================================================================== --- stable/9/sys/dev/ata/ata-sata.c Fri Nov 16 01:43:23 2012 (r243117) +++ stable/9/sys/dev/ata/ata-sata.c Fri Nov 16 02:26:23 2012 (r243118) @@ -152,8 +152,16 @@ int ata_sata_phy_reset(device_t dev, int port, int quick) { struct ata_channel *ch = device_get_softc(dev); - int loop, retry; - uint32_t val; + int loop, retry, sata_rev; + uint32_t val, val1; + +#ifdef ATA_CAM + sata_rev = ch->user[port < 0 ? 0 : port].revision; + if (sata_rev > 0) + quick = 0; +#else + sata_rev = 0; +#endif if (quick) { if (ata_sata_scr_read(ch, port, ATA_SCONTROL, &val)) @@ -173,9 +181,18 @@ ata_sata_phy_reset(device_t dev, int por device_printf(dev, "p%d: hard reset ...\n", port); } } + if (sata_rev == 1) + val1 = ATA_SC_SPD_SPEED_GEN1; + else if (sata_rev == 2) + val1 = ATA_SC_SPD_SPEED_GEN2; + else if (sata_rev == 3) + val1 = ATA_SC_SPD_SPEED_GEN3; + else + val1 = 0; for (retry = 0; retry < 10; retry++) { for (loop = 0; loop < 10; loop++) { - if (ata_sata_scr_write(ch, port, ATA_SCONTROL, ATA_SC_DET_RESET)) + if (ata_sata_scr_write(ch, port, ATA_SCONTROL, ATA_SC_DET_RESET | + val1 | ATA_SC_IPM_DIS_PARTIAL | ATA_SC_IPM_DIS_SLUMBER)) goto fail; ata_udelay(100); if (ata_sata_scr_read(ch, port, ATA_SCONTROL, &val)) @@ -186,7 +203,7 @@ ata_sata_phy_reset(device_t dev, int por ata_udelay(5000); for (loop = 0; loop < 10; loop++) { if (ata_sata_scr_write(ch, port, ATA_SCONTROL, - ATA_SC_DET_IDLE | ((ch->pm_level > 0) ? 0 : + ATA_SC_DET_IDLE | val1 | ((ch->pm_level > 0) ? 0 : ATA_SC_IPM_DIS_PARTIAL | ATA_SC_IPM_DIS_SLUMBER))) goto fail; ata_udelay(100); From owner-svn-src-stable-9@FreeBSD.ORG Fri Nov 16 03:04:30 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id AE9C3F42; Fri, 16 Nov 2012 03:04:30 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 93FD08FC08; Fri, 16 Nov 2012 03:04:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAG34UPq005388; Fri, 16 Nov 2012 03:04:30 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAG34Ub1005383; Fri, 16 Nov 2012 03:04:30 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201211160304.qAG34Ub1005383@svn.freebsd.org> From: Alexander Motin Date: Fri, 16 Nov 2012 03:04:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243125 - in stable/9/sys/dev/ata: . chipsets X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Nov 2012 03:04:30 -0000 Author: mav Date: Fri Nov 16 03:04:30 2012 New Revision: 243125 URL: http://svnweb.freebsd.org/changeset/base/243125 Log: MFC r242156: Implement CAM_ATAIO_NEEDRESULT (fetching full set of result registers) for ata(4) driver in ATA_CAM mode. That slighty improves error reporting and also should fix `smartctl -l scterc /dev/adaX` operation. Modified: stable/9/sys/dev/ata/ata-all.c stable/9/sys/dev/ata/ata-all.h stable/9/sys/dev/ata/ata-lowlevel.c stable/9/sys/dev/ata/chipsets/ata-ahci.c stable/9/sys/dev/ata/chipsets/ata-siliconimage.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/ata/ata-all.c ============================================================================== --- stable/9/sys/dev/ata/ata-all.c Fri Nov 16 03:02:07 2012 (r243124) +++ stable/9/sys/dev/ata/ata-all.c Fri Nov 16 03:04:30 2012 (r243125) @@ -1492,6 +1492,8 @@ ata_cam_begin_transaction(device_t dev, request->u.ata.lba |= ((uint64_t)ccb->ataio.cmd.lba_high << 16) | ((uint64_t)ccb->ataio.cmd.lba_mid << 8) | (uint64_t)ccb->ataio.cmd.lba_low; + if (ccb->ataio.cmd.flags & CAM_ATAIO_NEEDRESULT) + request->flags |= ATA_R_NEEDRESULT; if ((ccb->ccb_h.flags & CAM_DIR_MASK) != CAM_DIR_NONE && ccb->ataio.cmd.flags & CAM_ATAIO_DMA) request->flags |= ATA_R_DMA; Modified: stable/9/sys/dev/ata/ata-all.h ============================================================================== --- stable/9/sys/dev/ata/ata-all.h Fri Nov 16 03:02:07 2012 (r243124) +++ stable/9/sys/dev/ata/ata-all.h Fri Nov 16 03:04:30 2012 (r243125) @@ -397,6 +397,7 @@ struct ata_request { #define ATA_R_REQUEUE 0x00000400 #define ATA_R_THREAD 0x00000800 #define ATA_R_DIRECT 0x00001000 +#define ATA_R_NEEDRESULT 0x00002000 #define ATA_R_ATAPI16 0x00010000 #define ATA_R_ATAPI_INTR 0x00020000 Modified: stable/9/sys/dev/ata/ata-lowlevel.c ============================================================================== --- stable/9/sys/dev/ata/ata-lowlevel.c Fri Nov 16 03:02:07 2012 (r243124) +++ stable/9/sys/dev/ata/ata-lowlevel.c Fri Nov 16 03:04:30 2012 (r243125) @@ -116,6 +116,7 @@ ata_begin_transaction(struct ata_request } while (request->status & ATA_S_BUSY && timeout--); if (request->status & ATA_S_ERROR) request->error = ATA_IDX_INB(ch, ATA_ERROR); + ch->hw.tf_read(request); goto begin_finished; } @@ -253,8 +254,9 @@ ata_end_transaction(struct ata_request * if (request->flags & ATA_R_TIMEOUT) goto end_finished; - /* on control commands read back registers to the request struct */ - if (request->flags & ATA_R_CONTROL) { + /* Read back registers to the request struct. */ + if ((request->status & ATA_S_ERROR) || + (request->flags & (ATA_R_CONTROL | ATA_R_NEEDRESULT))) { ch->hw.tf_read(request); } @@ -332,6 +334,12 @@ ata_end_transaction(struct ata_request * else if (!(request->flags & ATA_R_TIMEOUT)) request->donecount = request->bytecount; + /* Read back registers to the request struct. */ + if ((request->status & ATA_S_ERROR) || + (request->flags & (ATA_R_CONTROL | ATA_R_NEEDRESULT))) { + ch->hw.tf_read(request); + } + /* release SG list etc */ ch->dma.unload(request); Modified: stable/9/sys/dev/ata/chipsets/ata-ahci.c ============================================================================== --- stable/9/sys/dev/ata/chipsets/ata-ahci.c Fri Nov 16 03:02:07 2012 (r243124) +++ stable/9/sys/dev/ata/chipsets/ata-ahci.c Fri Nov 16 03:04:30 2012 (r243125) @@ -555,8 +555,10 @@ ata_ahci_end_transaction(struct ata_requ if (request->status & ATA_S_ERROR) request->error = tf_data >> 8; - /* on control commands read back registers to the request struct */ - if (request->flags & ATA_R_CONTROL) { + /* Read back registers to the request struct. */ + if ((request->flags & ATA_R_ATAPI) == 0 && + ((request->status & ATA_S_ERROR) || + (request->flags & (ATA_R_CONTROL | ATA_R_NEEDRESULT)))) { u_int8_t *fis = ch->dma.work + ATA_AHCI_FB_OFFSET + 0x40; request->u.ata.count = fis[12] | ((u_int16_t)fis[13] << 8); Modified: stable/9/sys/dev/ata/chipsets/ata-siliconimage.c ============================================================================== --- stable/9/sys/dev/ata/chipsets/ata-siliconimage.c Fri Nov 16 03:02:07 2012 (r243124) +++ stable/9/sys/dev/ata/chipsets/ata-siliconimage.c Fri Nov 16 03:04:30 2012 (r243125) @@ -658,8 +658,10 @@ ata_siiprb_end_transaction(struct ata_re } } - /* on control commands read back registers to the request struct */ - if (request->flags & ATA_R_CONTROL) { + /* Read back registers to the request struct. */ + if ((request->flags & ATA_R_ATAPI) == 0 && + ((request->status & ATA_S_ERROR) || + (request->flags & (ATA_R_CONTROL | ATA_R_NEEDRESULT)))) { request->u.ata.count = prb->fis[12] | ((u_int16_t)prb->fis[13] << 8); request->u.ata.lba = prb->fis[4] | ((u_int64_t)prb->fis[5] << 8) | ((u_int64_t)prb->fis[6] << 16); From owner-svn-src-stable-9@FreeBSD.ORG Fri Nov 16 03:07:28 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2056E2CB; Fri, 16 Nov 2012 03:07:28 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id DEE7B8FC08; Fri, 16 Nov 2012 03:07:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAG37RZu005952; Fri, 16 Nov 2012 03:07:27 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAG37RaT005951; Fri, 16 Nov 2012 03:07:27 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201211160307.qAG37RaT005951@svn.freebsd.org> From: Alexander Motin Date: Fri, 16 Nov 2012 03:07:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243127 - stable/9/sys/dev/ata X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Nov 2012 03:07:28 -0000 Author: mav Date: Fri Nov 16 03:07:27 2012 New Revision: 243127 URL: http://svnweb.freebsd.org/changeset/base/243127 Log: MFC r242422: Only four specific ATA PIO commands transfer several sectors per DRQ block (interrupt). All other ATA PIO commands transfer one sector or 512 bytes at one time. Hardcode these exceptions in ata(4) with ATA_CAM option. This fixes timeout of READ LOG EXT command used by `smartctl -x /dev/adaX`. Modified: stable/9/sys/dev/ata/ata-all.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/ata/ata-all.c ============================================================================== --- stable/9/sys/dev/ata/ata-all.c Fri Nov 16 03:05:27 2012 (r243126) +++ stable/9/sys/dev/ata/ata-all.c Fri Nov 16 03:07:27 2012 (r243127) @@ -1501,6 +1501,14 @@ ata_cam_begin_transaction(device_t dev, request->flags |= ATA_R_READ; if ((ccb->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_OUT) request->flags |= ATA_R_WRITE; + if (ccb->ataio.cmd.command == ATA_READ_MUL || + ccb->ataio.cmd.command == ATA_READ_MUL48 || + ccb->ataio.cmd.command == ATA_WRITE_MUL || + ccb->ataio.cmd.command == ATA_WRITE_MUL48) { + request->transfersize = min(request->bytecount, + ch->curr[ccb->ccb_h.target_id].bytecount); + } else + request->transfersize = min(request->bytecount, 512); } else { request->data = ccb->csio.data_ptr; request->bytecount = ccb->csio.dxfer_len; @@ -1517,9 +1525,9 @@ ata_cam_begin_transaction(device_t dev, request->flags |= ATA_R_READ; if ((ccb->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_OUT) request->flags |= ATA_R_WRITE; + request->transfersize = min(request->bytecount, + ch->curr[ccb->ccb_h.target_id].bytecount); } - request->transfersize = min(request->bytecount, - ch->curr[ccb->ccb_h.target_id].bytecount); request->retries = 0; request->timeout = (ccb->ccb_h.timeout + 999) / 1000; callout_init_mtx(&request->callout, &ch->state_mtx, CALLOUT_RETURNUNLOCKED); From owner-svn-src-stable-9@FreeBSD.ORG Fri Nov 16 07:07:01 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 67F5FAB9; Fri, 16 Nov 2012 07:07:01 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4C4D68FC08; Fri, 16 Nov 2012 07:07:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAG7710w037522; Fri, 16 Nov 2012 07:07:01 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAG771v6037518; Fri, 16 Nov 2012 07:07:01 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201211160707.qAG771v6037518@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 16 Nov 2012 07:07:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243139 - in stable/9/sys/amd64: amd64 include X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Nov 2012 07:07:01 -0000 Author: kib Date: Fri Nov 16 07:07:00 2012 New Revision: 243139 URL: http://svnweb.freebsd.org/changeset/base/243139 Log: MFC r242432: Provide the reading and display of the Standard Extended Features, introduced with the IvyBridge CPUs. Provide the definitions for new bits in CR3 and CR4 registers. Modified: stable/9/sys/amd64/amd64/identcpu.c stable/9/sys/amd64/amd64/initcpu.c stable/9/sys/amd64/include/md_var.h stable/9/sys/amd64/include/specialreg.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/amd64/amd64/identcpu.c ============================================================================== --- stable/9/sys/amd64/amd64/identcpu.c Fri Nov 16 07:05:57 2012 (r243138) +++ stable/9/sys/amd64/amd64/identcpu.c Fri Nov 16 07:07:00 2012 (r243139) @@ -384,6 +384,18 @@ printcpuinfo(void) ); } + if (cpu_stdext_feature != 0) { + printf("\n Standard Extended Features=0x%b", + cpu_stdext_feature, + "\020" + "\001GSFSBASE" + "\002TSCADJ" + "\010SMEP" + "\012ENHMOVSB" + "\013INVPCID" + ); + } + if (via_feature_rng != 0 || via_feature_xcrypt != 0) print_via_padlock_info(); @@ -501,6 +513,11 @@ identify_cpu(void) } } + if (cpu_high >= 7) { + cpuid_count(7, 0, regs); + cpu_stdext_feature = regs[1]; + } + if (cpu_vendor_id == CPU_VENDOR_INTEL || cpu_vendor_id == CPU_VENDOR_AMD || cpu_vendor_id == CPU_VENDOR_CENTAUR) { Modified: stable/9/sys/amd64/amd64/initcpu.c ============================================================================== --- stable/9/sys/amd64/amd64/initcpu.c Fri Nov 16 07:05:57 2012 (r243138) +++ stable/9/sys/amd64/amd64/initcpu.c Fri Nov 16 07:07:00 2012 (r243139) @@ -72,6 +72,7 @@ u_int cpu_vendor_id; /* CPU vendor ID * u_int cpu_fxsr; /* SSE enabled */ u_int cpu_mxcsr_mask; /* Valid bits in mxcsr */ u_int cpu_clflush_line_size = 32; +u_int cpu_stdext_feature; u_int cpu_max_ext_state_size; SYSCTL_UINT(_hw, OID_AUTO, via_feature_rng, CTLFLAG_RD, Modified: stable/9/sys/amd64/include/md_var.h ============================================================================== --- stable/9/sys/amd64/include/md_var.h Fri Nov 16 07:05:57 2012 (r243138) +++ stable/9/sys/amd64/include/md_var.h Fri Nov 16 07:07:00 2012 (r243139) @@ -48,6 +48,7 @@ extern u_int amd_pminfo; extern u_int via_feature_rng; extern u_int via_feature_xcrypt; extern u_int cpu_clflush_line_size; +extern u_int cpu_stdext_feature; extern u_int cpu_fxsr; extern u_int cpu_high; extern u_int cpu_id; Modified: stable/9/sys/amd64/include/specialreg.h ============================================================================== --- stable/9/sys/amd64/include/specialreg.h Fri Nov 16 07:05:57 2012 (r243138) +++ stable/9/sys/amd64/include/specialreg.h Fri Nov 16 07:07:00 2012 (r243139) @@ -52,6 +52,8 @@ #define CR0_NW 0x20000000 /* Not Write-through */ #define CR0_CD 0x40000000 /* Cache Disable */ +#define CR3_PCID_SAVE 0x8000000000000000 + /* * Bits in PPro special registers */ @@ -66,7 +68,10 @@ #define CR4_PCE 0x00000100 /* Performance monitoring counter enable */ #define CR4_FXSR 0x00000200 /* Fast FPU save/restore used by OS */ #define CR4_XMM 0x00000400 /* enable SIMD/MMX2 to use except 16 */ +#define CR4_FSGSBASE 0x00010000 /* Enable FS/GS BASE accessing instructions */ +#define CR4_PCIDE 0x00020000 /* Enable Context ID */ #define CR4_XSAVE 0x00040000 /* XSETBV/XGETBV */ +#define CR4_SMEP 0x00100000 /* Supervisor-Mode Execution Prevention */ /* * Bits in AMD64 special registers. EFER is 64 bits wide. @@ -261,6 +266,12 @@ #define AMDID_COREID_SIZE 0x0000f000 #define AMDID_COREID_SIZE_SHIFT 12 +#define CPUID_STDEXT_FSGSBASE 0x00000001 +#define CPUID_STDEXT_TSC_ADJUST 0x00000002 +#define CPUID_STDEXT_SMEP 0x00000080 +#define CPUID_STDEXT_ENH_MOVSB 0x00000200 +#define CPUID_STDEXT_INVPCID 0x00000400 + /* * CPUID manufacturers identifiers */ From owner-svn-src-stable-9@FreeBSD.ORG Sat Nov 17 22:40:18 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id EC6A9C39; Sat, 17 Nov 2012 22:40:18 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D026B8FC12; Sat, 17 Nov 2012 22:40:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAHMeI6D098513; Sat, 17 Nov 2012 22:40:18 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAHMeIDT098510; Sat, 17 Nov 2012 22:40:18 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201211172240.qAHMeIDT098510@svn.freebsd.org> From: Dimitry Andric Date: Sat, 17 Nov 2012 22:40:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243190 - in stable/9: . sys/boot/pc98/boot2 sys/boot/pc98/cdboot X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Nov 2012 22:40:19 -0000 Author: dim Date: Sat Nov 17 22:40:18 2012 New Revision: 243190 URL: http://svnweb.freebsd.org/changeset/base/243190 Log: MFC r242706: Put in a band-aid to get the pc98 bootstraps building, now clang is the default compiler. This has two parts: - Make sys/boot/pc98/boot2 always build with gcc for now, until we can figure out a way to shrink it enough when building with clang. - Since sys/boot/p98/cdboot uses .code16 directives, which are not yet supported by clang's integrated assembler, use -no-integrated-as, similar to sys/boot/i386/cdboot. Reviewed by: nyan MFC r242874: Work around pc98 tinderbox failures in sys/boot/pc98, by making sure a cross gcc gets built during the cross-tools stage. Modified: stable/9/Makefile.inc1 (contents, props changed) stable/9/sys/boot/pc98/boot2/Makefile stable/9/sys/boot/pc98/cdboot/Makefile Directory Properties: stable/9/sys/ (props changed) stable/9/sys/boot/ (props changed) Modified: stable/9/Makefile.inc1 ============================================================================== --- stable/9/Makefile.inc1 Sat Nov 17 21:55:49 2012 (r243189) +++ stable/9/Makefile.inc1 Sat Nov 17 22:40:18 2012 (r243190) @@ -1123,7 +1123,7 @@ _aicasm= sys/modules/aic7xxx/aicasm _share= share/syscons/scrnmaps .endif -.if ${MK_GCC} != "no" && ${MK_CLANG_IS_CC} == "no" +.if ${MK_GCC} != "no" && (${MK_CLANG_IS_CC} == "no" || ${TARGET} == "pc98") _gcc_tools= gnu/usr.bin/cc/cc_tools .endif @@ -1190,7 +1190,7 @@ _clang= usr.bin/clang _clang_libs= lib/clang .endif -.if ${MK_GCC} != "no" && ${MK_CLANG_IS_CC} == "no" +.if ${MK_GCC} != "no" && (${MK_CLANG_IS_CC} == "no" || ${TARGET} == "pc98") _cc= gnu/usr.bin/cc .endif Modified: stable/9/sys/boot/pc98/boot2/Makefile ============================================================================== --- stable/9/sys/boot/pc98/boot2/Makefile Sat Nov 17 21:55:49 2012 (r243189) +++ stable/9/sys/boot/pc98/boot2/Makefile Sat Nov 17 22:40:18 2012 (r243190) @@ -3,7 +3,7 @@ .include # XXX: clang can compile the boot code just fine, but boot2 gets too big -CC:=${CC:C/^(.*\/)?clang$/gcc/1} +CC:= gcc FILES= boot boot1 boot2 Modified: stable/9/sys/boot/pc98/cdboot/Makefile ============================================================================== --- stable/9/sys/boot/pc98/cdboot/Makefile Sat Nov 17 21:55:49 2012 (r243189) +++ stable/9/sys/boot/pc98/cdboot/Makefile Sat Nov 17 22:40:18 2012 (r243190) @@ -13,3 +13,7 @@ ORG= 0x0000 LDFLAGS=-e start -Ttext ${ORG} -Wl,-N,-S,--oformat,binary .include + +# XXX: clang integrated-as doesn't grok .codeNN directives yet +CFLAGS.cdboot.S= ${CLANG_NO_IAS} +CFLAGS+= ${CFLAGS.${.IMPSRC:T}} From owner-svn-src-stable-9@FreeBSD.ORG Sat Nov 17 22:50:51 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 53AF26A; Sat, 17 Nov 2012 22:50:51 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 382558FC15; Sat, 17 Nov 2012 22:50:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAHMopp3000122; Sat, 17 Nov 2012 22:50:51 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAHMoppF000120; Sat, 17 Nov 2012 22:50:51 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201211172250.qAHMoppF000120@svn.freebsd.org> From: Dimitry Andric Date: Sat, 17 Nov 2012 22:50:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243191 - stable/9/contrib/llvm/lib/Target/X86 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Nov 2012 22:50:51 -0000 Author: dim Date: Sat Nov 17 22:50:50 2012 New Revision: 243191 URL: http://svnweb.freebsd.org/changeset/base/243191 Log: MFC r242835: Reduce LLVM's default stack alignment for i386 from 16 to 4 bytes, as the FreeBSD ABI requires. This is essentially a revert of upstream llvm commit r126226, and it will be reverted by upstream too. Modified: stable/9/contrib/llvm/lib/Target/X86/X86Subtarget.cpp Directory Properties: stable/9/contrib/llvm/ (props changed) Modified: stable/9/contrib/llvm/lib/Target/X86/X86Subtarget.cpp ============================================================================== --- stable/9/contrib/llvm/lib/Target/X86/X86Subtarget.cpp Sat Nov 17 22:40:18 2012 (r243190) +++ stable/9/contrib/llvm/lib/Target/X86/X86Subtarget.cpp Sat Nov 17 22:50:50 2012 (r243191) @@ -411,12 +411,12 @@ X86Subtarget::X86Subtarget(const std::st assert((!In64BitMode || HasX86_64) && "64-bit code requested on a subtarget that doesn't support it!"); - // Stack alignment is 16 bytes on Darwin, FreeBSD, Linux and Solaris (both - // 32 and 64 bit) and for all 64-bit targets. + // Stack alignment is 16 bytes on Darwin, Linux and Solaris (both 32 and 64 + // bit) and for all 64-bit targets. if (StackAlignOverride) stackAlignment = StackAlignOverride; - else if (isTargetDarwin() || isTargetFreeBSD() || isTargetLinux() || - isTargetSolaris() || In64BitMode) + else if (isTargetDarwin() || isTargetLinux() || isTargetSolaris() || + In64BitMode) stackAlignment = 16; } From owner-svn-src-stable-9@FreeBSD.ORG Sat Nov 17 22:58:33 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B4AF9257; Sat, 17 Nov 2012 22:58:33 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 98CB38FC08; Sat, 17 Nov 2012 22:58:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAHMwXmB001287; Sat, 17 Nov 2012 22:58:33 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAHMwXXu001286; Sat, 17 Nov 2012 22:58:33 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201211172258.qAHMwXXu001286@svn.freebsd.org> From: Dimitry Andric Date: Sat, 17 Nov 2012 22:58:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243192 - stable/9/sys/dev/nve X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Nov 2012 22:58:33 -0000 Author: dim Date: Sat Nov 17 22:58:33 2012 New Revision: 243192 URL: http://svnweb.freebsd.org/changeset/base/243192 Log: MFC r242873: Fix all the inconsistent nve_os* function declarations and definitions in nve(4). The OS_API structure defined in os.h expects NV_API_CALL attributes, effectively regparm(0), on its function pointers, but all the functions were declared and defined without this attribute. Modified: stable/9/sys/dev/nve/if_nve.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/nve/if_nve.c ============================================================================== --- stable/9/sys/dev/nve/if_nve.c Sat Nov 17 22:50:50 2012 (r243191) +++ stable/9/sys/dev/nve/if_nve.c Sat Nov 17 22:58:33 2012 (r243192) @@ -152,30 +152,30 @@ static int nve_miibus_writereg(devi static void nve_dmamap_cb(void *, bus_dma_segment_t *, int, int); static void nve_dmamap_tx_cb(void *, bus_dma_segment_t *, int, bus_size_t, int); -static NV_SINT32 nve_osalloc(PNV_VOID, PMEMORY_BLOCK); -static NV_SINT32 nve_osfree(PNV_VOID, PMEMORY_BLOCK); -static NV_SINT32 nve_osallocex(PNV_VOID, PMEMORY_BLOCKEX); -static NV_SINT32 nve_osfreeex(PNV_VOID, PMEMORY_BLOCKEX); -static NV_SINT32 nve_osclear(PNV_VOID, PNV_VOID, NV_SINT32); -static NV_SINT32 nve_osdelay(PNV_VOID, NV_UINT32); -static NV_SINT32 nve_osallocrxbuf(PNV_VOID, PMEMORY_BLOCK, PNV_VOID *); -static NV_SINT32 nve_osfreerxbuf(PNV_VOID, PMEMORY_BLOCK, PNV_VOID); -static NV_SINT32 nve_ospackettx(PNV_VOID, PNV_VOID, NV_UINT32); -static NV_SINT32 nve_ospacketrx(PNV_VOID, PNV_VOID, NV_UINT32, NV_UINT8 *, NV_UINT8); -static NV_SINT32 nve_oslinkchg(PNV_VOID, NV_SINT32); -static NV_SINT32 nve_osalloctimer(PNV_VOID, PNV_VOID *); -static NV_SINT32 nve_osfreetimer(PNV_VOID, PNV_VOID); -static NV_SINT32 nve_osinittimer(PNV_VOID, PNV_VOID, PTIMER_FUNC, PNV_VOID); -static NV_SINT32 nve_ossettimer(PNV_VOID, PNV_VOID, NV_UINT32); -static NV_SINT32 nve_oscanceltimer(PNV_VOID, PNV_VOID); - -static NV_SINT32 nve_ospreprocpkt(PNV_VOID, PNV_VOID, PNV_VOID *, NV_UINT8 *, NV_UINT8); -static PNV_VOID nve_ospreprocpktnopq(PNV_VOID, PNV_VOID); -static NV_SINT32 nve_osindicatepkt(PNV_VOID, PNV_VOID *, NV_UINT32); -static NV_SINT32 nve_oslockalloc(PNV_VOID, NV_SINT32, PNV_VOID *); -static NV_SINT32 nve_oslockacquire(PNV_VOID, NV_SINT32, PNV_VOID); -static NV_SINT32 nve_oslockrelease(PNV_VOID, NV_SINT32, PNV_VOID); -static PNV_VOID nve_osreturnbufvirt(PNV_VOID, PNV_VOID); +static NV_API_CALL NV_SINT32 nve_osalloc(PNV_VOID, PMEMORY_BLOCK); +static NV_API_CALL NV_SINT32 nve_osfree(PNV_VOID, PMEMORY_BLOCK); +static NV_API_CALL NV_SINT32 nve_osallocex(PNV_VOID, PMEMORY_BLOCKEX); +static NV_API_CALL NV_SINT32 nve_osfreeex(PNV_VOID, PMEMORY_BLOCKEX); +static NV_API_CALL NV_SINT32 nve_osclear(PNV_VOID, PNV_VOID, NV_SINT32); +static NV_API_CALL NV_SINT32 nve_osdelay(PNV_VOID, NV_UINT32); +static NV_API_CALL NV_SINT32 nve_osallocrxbuf(PNV_VOID, PMEMORY_BLOCK, PNV_VOID *); +static NV_API_CALL NV_SINT32 nve_osfreerxbuf(PNV_VOID, PMEMORY_BLOCK, PNV_VOID); +static NV_API_CALL NV_SINT32 nve_ospackettx(PNV_VOID, PNV_VOID, NV_UINT32); +static NV_API_CALL NV_SINT32 nve_ospacketrx(PNV_VOID, PNV_VOID, NV_UINT32, NV_UINT8 *, NV_UINT8); +static NV_API_CALL NV_SINT32 nve_oslinkchg(PNV_VOID, NV_SINT32); +static NV_API_CALL NV_SINT32 nve_osalloctimer(PNV_VOID, PNV_VOID *); +static NV_API_CALL NV_SINT32 nve_osfreetimer(PNV_VOID, PNV_VOID); +static NV_API_CALL NV_SINT32 nve_osinittimer(PNV_VOID, PNV_VOID, PTIMER_FUNC, PNV_VOID); +static NV_API_CALL NV_SINT32 nve_ossettimer(PNV_VOID, PNV_VOID, NV_UINT32); +static NV_API_CALL NV_SINT32 nve_oscanceltimer(PNV_VOID, PNV_VOID); + +static NV_API_CALL NV_SINT32 nve_ospreprocpkt(PNV_VOID, PNV_VOID, PNV_VOID *, NV_UINT8 *, NV_UINT8); +static NV_API_CALL PNV_VOID nve_ospreprocpktnopq(PNV_VOID, PNV_VOID); +static NV_API_CALL NV_SINT32 nve_osindicatepkt(PNV_VOID, PNV_VOID *, NV_UINT32); +static NV_API_CALL NV_SINT32 nve_oslockalloc(PNV_VOID, NV_SINT32, PNV_VOID *); +static NV_API_CALL NV_SINT32 nve_oslockacquire(PNV_VOID, NV_SINT32, PNV_VOID); +static NV_API_CALL NV_SINT32 nve_oslockrelease(PNV_VOID, NV_SINT32, PNV_VOID); +static NV_API_CALL PNV_VOID nve_osreturnbufvirt(PNV_VOID, PNV_VOID); static device_method_t nve_methods[] = { /* Device interface */ @@ -1343,7 +1343,7 @@ nve_watchdog(struct nve_softc *sc) /* --- Start of NVOSAPI interface --- */ /* Allocate DMA enabled general use memory for API */ -static NV_SINT32 +static NV_API_CALL NV_SINT32 nve_osalloc(PNV_VOID ctx, PMEMORY_BLOCK mem) { struct nve_softc *sc; @@ -1371,7 +1371,7 @@ nve_osalloc(PNV_VOID ctx, PMEMORY_BLOCK } /* Free allocated memory */ -static NV_SINT32 +static NV_API_CALL NV_SINT32 nve_osfree(PNV_VOID ctx, PMEMORY_BLOCK mem) { DEBUGOUT(NVE_DEBUG_API, "nve: nve_osfree - 0x%x - %d\n", @@ -1382,7 +1382,7 @@ nve_osfree(PNV_VOID ctx, PMEMORY_BLOCK m } /* Copied directly from nvnet.c */ -static NV_SINT32 +static NV_API_CALL NV_SINT32 nve_osallocex(PNV_VOID ctx, PMEMORY_BLOCKEX mem_block_ex) { MEMORY_BLOCK mem_block; @@ -1428,7 +1428,7 @@ nve_osallocex(PNV_VOID ctx, PMEMORY_BLOC } /* Copied directly from nvnet.c */ -static NV_SINT32 +static NV_API_CALL NV_SINT32 nve_osfreeex(PNV_VOID ctx, PMEMORY_BLOCKEX mem_block_ex) { MEMORY_BLOCK mem_block; @@ -1443,7 +1443,7 @@ nve_osfreeex(PNV_VOID ctx, PMEMORY_BLOCK } /* Clear memory region */ -static NV_SINT32 +static NV_API_CALL NV_SINT32 nve_osclear(PNV_VOID ctx, PNV_VOID mem, NV_SINT32 length) { DEBUGOUT(NVE_DEBUG_API, "nve: nve_osclear\n"); @@ -1452,7 +1452,7 @@ nve_osclear(PNV_VOID ctx, PNV_VOID mem, } /* Sleep for a tick */ -static NV_SINT32 +static NV_API_CALL NV_SINT32 nve_osdelay(PNV_VOID ctx, NV_UINT32 usec) { DELAY(usec); @@ -1460,7 +1460,7 @@ nve_osdelay(PNV_VOID ctx, NV_UINT32 usec } /* Allocate memory for rx buffer */ -static NV_SINT32 +static NV_API_CALL NV_SINT32 nve_osallocrxbuf(PNV_VOID ctx, PMEMORY_BLOCK mem, PNV_VOID *id) { struct nve_softc *sc = ctx; @@ -1516,7 +1516,7 @@ fail: } /* Free the rx buffer */ -static NV_SINT32 +static NV_API_CALL NV_SINT32 nve_osfreerxbuf(PNV_VOID ctx, PMEMORY_BLOCK mem, PNV_VOID id) { struct nve_softc *sc = ctx; @@ -1540,7 +1540,7 @@ nve_osfreerxbuf(PNV_VOID ctx, PMEMORY_BL } /* This gets called by the Nvidia API after our TX packet has been sent */ -static NV_SINT32 +static NV_API_CALL NV_SINT32 nve_ospackettx(PNV_VOID ctx, PNV_VOID id, NV_UINT32 success) { struct nve_softc *sc = ctx; @@ -1579,7 +1579,7 @@ fail: /* This gets called by the Nvidia API when a new packet has been received */ /* XXX What is newbuf used for? XXX */ -static NV_SINT32 +static NV_API_CALL NV_SINT32 nve_ospacketrx(PNV_VOID ctx, PNV_VOID data, NV_UINT32 success, NV_UINT8 *newbuf, NV_UINT8 priority) { @@ -1637,7 +1637,7 @@ nve_ospacketrx(PNV_VOID ctx, PNV_VOID da } /* This gets called by NVIDIA API when the PHY link state changes */ -static NV_SINT32 +static NV_API_CALL NV_SINT32 nve_oslinkchg(PNV_VOID ctx, NV_SINT32 enabled) { @@ -1647,7 +1647,7 @@ nve_oslinkchg(PNV_VOID ctx, NV_SINT32 en } /* Setup a watchdog timer */ -static NV_SINT32 +static NV_API_CALL NV_SINT32 nve_osalloctimer(PNV_VOID ctx, PNV_VOID *timer) { struct nve_softc *sc = (struct nve_softc *)ctx; @@ -1661,7 +1661,7 @@ nve_osalloctimer(PNV_VOID ctx, PNV_VOID } /* Free the timer */ -static NV_SINT32 +static NV_API_CALL NV_SINT32 nve_osfreetimer(PNV_VOID ctx, PNV_VOID timer) { @@ -1673,7 +1673,7 @@ nve_osfreetimer(PNV_VOID ctx, PNV_VOID t } /* Setup timer parameters */ -static NV_SINT32 +static NV_API_CALL NV_SINT32 nve_osinittimer(PNV_VOID ctx, PNV_VOID timer, PTIMER_FUNC func, PNV_VOID parameters) { struct nve_softc *sc = (struct nve_softc *)ctx; @@ -1687,7 +1687,7 @@ nve_osinittimer(PNV_VOID ctx, PNV_VOID t } /* Set the timer to go off */ -static NV_SINT32 +static NV_API_CALL NV_SINT32 nve_ossettimer(PNV_VOID ctx, PNV_VOID timer, NV_UINT32 delay) { struct nve_softc *sc = ctx; @@ -1701,7 +1701,7 @@ nve_ossettimer(PNV_VOID ctx, PNV_VOID ti } /* Cancel the timer */ -static NV_SINT32 +static NV_API_CALL NV_SINT32 nve_oscanceltimer(PNV_VOID ctx, PNV_VOID timer) { @@ -1712,7 +1712,7 @@ nve_oscanceltimer(PNV_VOID ctx, PNV_VOID return (1); } -static NV_SINT32 +static NV_API_CALL NV_SINT32 nve_ospreprocpkt(PNV_VOID ctx, PNV_VOID readdata, PNV_VOID *id, NV_UINT8 *newbuffer, NV_UINT8 priority) { @@ -1723,7 +1723,7 @@ nve_ospreprocpkt(PNV_VOID ctx, PNV_VOID return (1); } -static PNV_VOID +static NV_API_CALL PNV_VOID nve_ospreprocpktnopq(PNV_VOID ctx, PNV_VOID readdata) { @@ -1733,7 +1733,7 @@ nve_ospreprocpktnopq(PNV_VOID ctx, PNV_V return (NULL); } -static NV_SINT32 +static NV_API_CALL NV_SINT32 nve_osindicatepkt(PNV_VOID ctx, PNV_VOID *id, NV_UINT32 pktno) { @@ -1744,7 +1744,7 @@ nve_osindicatepkt(PNV_VOID ctx, PNV_VOID } /* Allocate mutex context (already done in nve_attach) */ -static NV_SINT32 +static NV_API_CALL NV_SINT32 nve_oslockalloc(PNV_VOID ctx, NV_SINT32 type, PNV_VOID *pLock) { struct nve_softc *sc = (struct nve_softc *)ctx; @@ -1757,7 +1757,7 @@ nve_oslockalloc(PNV_VOID ctx, NV_SINT32 } /* Obtain a spin lock */ -static NV_SINT32 +static NV_API_CALL NV_SINT32 nve_oslockacquire(PNV_VOID ctx, NV_SINT32 type, PNV_VOID lock) { @@ -1767,7 +1767,7 @@ nve_oslockacquire(PNV_VOID ctx, NV_SINT3 } /* Release lock */ -static NV_SINT32 +static NV_API_CALL NV_SINT32 nve_oslockrelease(PNV_VOID ctx, NV_SINT32 type, PNV_VOID lock) { @@ -1777,7 +1777,7 @@ nve_oslockrelease(PNV_VOID ctx, NV_SINT3 } /* I have no idea what this is for */ -static PNV_VOID +static NV_API_CALL PNV_VOID nve_osreturnbufvirt(PNV_VOID ctx, PNV_VOID readdata) { From owner-svn-src-stable-9@FreeBSD.ORG Sat Nov 17 23:05:19 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5A4344E0; Sat, 17 Nov 2012 23:05:19 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 06B318FC08; Sat, 17 Nov 2012 23:05:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAHN5Ist002674; Sat, 17 Nov 2012 23:05:18 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAHN5IZn002672; Sat, 17 Nov 2012 23:05:18 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201211172305.qAHN5IZn002672@svn.freebsd.org> From: Dimitry Andric Date: Sat, 17 Nov 2012 23:05:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243193 - in stable/9/lib: libc/gen msun/src X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Nov 2012 23:05:19 -0000 Author: dim Date: Sat Nov 17 23:05:18 2012 New Revision: 243193 URL: http://svnweb.freebsd.org/changeset/base/243193 Log: MFC r242879: Only define isnan, isnanf, __isnan and __isnanf in libc.so, not in libc.a and libc_p.a. In addition, define isnan in libm.a and libm_p.a, but not in libm.so. This makes it possible to statically link executables using both isnan and isnanf with libc and libm. Tested by: kargl MFC r242894: Add an explanatory comment to lib/libc/gen/isnan.c about the fix to make static linking with libc and libm work. Requested by: jilles Modified: stable/9/lib/libc/gen/isnan.c stable/9/lib/msun/src/s_isnan.c Directory Properties: stable/9/lib/libc/ (props changed) stable/9/lib/msun/ (props changed) Modified: stable/9/lib/libc/gen/isnan.c ============================================================================== --- stable/9/lib/libc/gen/isnan.c Sat Nov 17 22:58:33 2012 (r243192) +++ stable/9/lib/libc/gen/isnan.c Sat Nov 17 23:05:18 2012 (r243193) @@ -33,8 +33,14 @@ /* * XXX These routines belong in libm, but they must remain in libc for * binary compat until we can bump libm's major version number. + * + * Note this only applies to the dynamic versions of libm and libc, so + * for the static and profiled versions we stub out the definitions. + * Otherwise you cannot link statically to libm and libc at the same + * time, when calling both functions. */ +#ifdef PIC __weak_reference(__isnan, isnan); __weak_reference(__isnanf, isnanf); @@ -55,3 +61,4 @@ __isnanf(float f) u.f = f; return (u.bits.exp == 255 && u.bits.man != 0); } +#endif /* PIC */ Modified: stable/9/lib/msun/src/s_isnan.c ============================================================================== --- stable/9/lib/msun/src/s_isnan.c Sat Nov 17 22:58:33 2012 (r243192) +++ stable/9/lib/msun/src/s_isnan.c Sat Nov 17 23:05:18 2012 (r243193) @@ -30,8 +30,9 @@ #include "fpmath.h" -/* Provided by libc */ -#if 0 +/* Provided by libc.so */ +#ifndef PIC +#undef isnan int isnan(double d) { @@ -40,7 +41,7 @@ isnan(double d) u.d = d; return (u.bits.exp == 2047 && (u.bits.manl != 0 || u.bits.manh != 0)); } -#endif +#endif /* !PIC */ int __isnanf(float f) From owner-svn-src-stable-9@FreeBSD.ORG Sat Nov 17 23:11:05 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 20D29AB7; Sat, 17 Nov 2012 23:11:05 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 062528FC0C; Sat, 17 Nov 2012 23:11:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAHNB4TV003919; Sat, 17 Nov 2012 23:11:04 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAHNB4Bc003918; Sat, 17 Nov 2012 23:11:04 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201211172311.qAHNB4Bc003918@svn.freebsd.org> From: Dimitry Andric Date: Sat, 17 Nov 2012 23:11:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243195 - stable/9/crypto/heimdal/lib/sl X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Nov 2012 23:11:05 -0000 Author: dim Date: Sat Nov 17 23:11:04 2012 New Revision: 243195 URL: http://svnweb.freebsd.org/changeset/base/243195 Log: MFC r243034: In crypto/heimdal/lib/sl/slc-lex.l, don't define YY_NO_INPUT, since %option nounput is already specified. Modified: stable/9/crypto/heimdal/lib/sl/slc-lex.l Directory Properties: stable/9/crypto/heimdal/ (props changed) Modified: stable/9/crypto/heimdal/lib/sl/slc-lex.l ============================================================================== --- stable/9/crypto/heimdal/lib/sl/slc-lex.l Sat Nov 17 23:06:00 2012 (r243194) +++ stable/9/crypto/heimdal/lib/sl/slc-lex.l Sat Nov 17 23:11:04 2012 (r243195) @@ -47,8 +47,6 @@ unsigned lineno = 1; static void handle_comment(void); static char * handle_string(void); -#define YY_NO_UNPUT - #undef ECHO %} From owner-svn-src-stable-9@FreeBSD.ORG Sat Nov 17 23:14:32 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 21E3FCCD; Sat, 17 Nov 2012 23:14:32 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 02D308FC17; Sat, 17 Nov 2012 23:14:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAHNEVmb004450; Sat, 17 Nov 2012 23:14:31 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAHNEVH1004449; Sat, 17 Nov 2012 23:14:31 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201211172314.qAHNEVH1004449@svn.freebsd.org> From: Dimitry Andric Date: Sat, 17 Nov 2012 23:14:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243196 - stable/9/usr.bin/mkcsmapper X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Nov 2012 23:14:32 -0000 Author: dim Date: Sat Nov 17 23:14:31 2012 New Revision: 243196 URL: http://svnweb.freebsd.org/changeset/base/243196 Log: MFC r243035: For mkcsmapper, conditionalize gcc-specific compile flags. Modified: stable/9/usr.bin/mkcsmapper/Makefile.inc Directory Properties: stable/9/usr.bin/mkcsmapper/ (props changed) Modified: stable/9/usr.bin/mkcsmapper/Makefile.inc ============================================================================== --- stable/9/usr.bin/mkcsmapper/Makefile.inc Sat Nov 17 23:11:04 2012 (r243195) +++ stable/9/usr.bin/mkcsmapper/Makefile.inc Sat Nov 17 23:14:31 2012 (r243196) @@ -1,7 +1,11 @@ # $FreeBSD$ +.include + SRCS+= lex.l yacc.y CFLAGS+= -I${.CURDIR} -I${.CURDIR}/../mkcsmapper \ -I${.CURDIR}/../../lib/libc/iconv \ - -I${.CURDIR}/../../lib/libiconv_modules/mapper_std \ - --param max-inline-insns-single=64 + -I${.CURDIR}/../../lib/libiconv_modules/mapper_std +.if ${COMPILER_TYPE} == "gcc" +CFLAGS+= --param max-inline-insns-single=64 +.endif From owner-svn-src-stable-9@FreeBSD.ORG Sat Nov 17 23:31:17 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 43CAD19F; Sat, 17 Nov 2012 23:31:17 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 290D78FC12; Sat, 17 Nov 2012 23:31:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAHNVHPx006952; Sat, 17 Nov 2012 23:31:17 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAHNVHS8006951; Sat, 17 Nov 2012 23:31:17 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201211172331.qAHNVHS8006951@svn.freebsd.org> From: Dimitry Andric Date: Sat, 17 Nov 2012 23:31:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243197 - stable/9/games/fortune/fortune X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Nov 2012 23:31:17 -0000 Author: dim Date: Sat Nov 17 23:31:16 2012 New Revision: 243197 URL: http://svnweb.freebsd.org/changeset/base/243197 Log: MFC r243036: In games/fortune/fortune/fortune.c, make 'Debug' the correct type (it is *not* a boolean). Modified: stable/9/games/fortune/fortune/fortune.c Directory Properties: stable/9/games/fortune/fortune/ (props changed) Modified: stable/9/games/fortune/fortune/fortune.c ============================================================================== --- stable/9/games/fortune/fortune/fortune.c Sat Nov 17 23:14:31 2012 (r243196) +++ stable/9/games/fortune/fortune/fortune.c Sat Nov 17 23:31:16 2012 (r243197) @@ -109,7 +109,7 @@ bool Equal_probs = FALSE; /* scatter un- bool Match = FALSE; /* dump fortunes matching a pattern */ static bool WriteToDisk = false; /* use files on disk to save state */ #ifdef DEBUG -bool Debug = FALSE; /* print debug messages */ +int Debug = FALSE; /* print debug messages */ #endif char *Fortbuf = NULL; /* fortune buffer for -m */ From owner-svn-src-stable-9@FreeBSD.ORG Sat Nov 17 23:34:10 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 89022512; Sat, 17 Nov 2012 23:34:10 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 6D18F8FC12; Sat, 17 Nov 2012 23:34:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAHNYAOO007427; Sat, 17 Nov 2012 23:34:10 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAHNYA3c007425; Sat, 17 Nov 2012 23:34:10 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201211172334.qAHNYA3c007425@svn.freebsd.org> From: Dimitry Andric Date: Sat, 17 Nov 2012 23:34:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243198 - stable/9/sys/dev/aic7xxx/aicasm X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Nov 2012 23:34:10 -0000 Author: dim Date: Sat Nov 17 23:34:10 2012 New Revision: 243198 URL: http://svnweb.freebsd.org/changeset/base/243198 Log: MFC r243037: Fix a bug in aicasm_gram.y, noted by a newer clang 3.2 snapshot: it compared an enum scope_type against a yacc-generated define, so the condition would always be false. Modified: stable/9/sys/dev/aic7xxx/aicasm/aicasm_gram.y Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/aic7xxx/aicasm/aicasm_gram.y ============================================================================== --- stable/9/sys/dev/aic7xxx/aicasm/aicasm_gram.y Sat Nov 17 23:31:16 2012 (r243197) +++ stable/9/sys/dev/aic7xxx/aicasm/aicasm_gram.y Sat Nov 17 23:34:10 2012 (r243198) @@ -1076,7 +1076,7 @@ conditional: last_scope = TAILQ_LAST(&scope_context->inner_scope, scope_tailq); if (last_scope == NULL - || last_scope->type == T_ELSE) { + || last_scope->type == SCOPE_ELSE) { stop("'else if' without leading 'if'", EX_DATAERR); /* NOTREACHED */