From owner-svn-src-stable@FreeBSD.ORG Sun Jul 24 01:36:02 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 17DF3106566C; Sun, 24 Jul 2011 01:36:02 +0000 (UTC) (envelope-from brian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F22968FC08; Sun, 24 Jul 2011 01:36:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6O1a1mH085013; Sun, 24 Jul 2011 01:36:01 GMT (envelope-from brian@svn.freebsd.org) Received: (from brian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6O1a1uc085004; Sun, 24 Jul 2011 01:36:01 GMT (envelope-from brian@svn.freebsd.org) Message-Id: <201107240136.p6O1a1uc085004@svn.freebsd.org> From: Brian Somers Date: Sun, 24 Jul 2011 01:36:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224285 - stable/8/usr.sbin/ppp X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Jul 2011 01:36:02 -0000 Author: brian Date: Sun Jul 24 01:36:01 2011 New Revision: 224285 URL: http://svn.freebsd.org/changeset/base/224285 Log: MFC r218397: Add "iface name" and "iface description" commands. PR: 151400 Submitted by: Aragon Gouveia - aragon at phat dot za dot net Modified: stable/8/usr.sbin/ppp/bundle.c stable/8/usr.sbin/ppp/command.c stable/8/usr.sbin/ppp/iface.c stable/8/usr.sbin/ppp/iface.h stable/8/usr.sbin/ppp/log.c stable/8/usr.sbin/ppp/log.h stable/8/usr.sbin/ppp/main.c stable/8/usr.sbin/ppp/ppp.8.m4 Directory Properties: stable/8/usr.sbin/ppp/ (props changed) Modified: stable/8/usr.sbin/ppp/bundle.c ============================================================================== --- stable/8/usr.sbin/ppp/bundle.c Sat Jul 23 22:55:32 2011 (r224284) +++ stable/8/usr.sbin/ppp/bundle.c Sun Jul 24 01:36:01 2011 (r224285) @@ -758,7 +758,7 @@ bundle_Create(const char *prefix, int ty return NULL; } - log_SetTun(bundle.unit); + log_SetTun(bundle.unit, NULL); ifname = strrchr(bundle.dev.Name, '/'); if (ifname == NULL) @@ -849,7 +849,7 @@ bundle_Create(const char *prefix, int ty bundle.links = datalink_Create("deflink", &bundle, type); if (bundle.links == NULL) { log_Printf(LogALERT, "Cannot create data link: %s\n", strerror(errno)); - iface_Destroy(bundle.iface); + iface_Free(bundle.iface); bundle.iface = NULL; close(bundle.dev.fd); return NULL; Modified: stable/8/usr.sbin/ppp/command.c ============================================================================== --- stable/8/usr.sbin/ppp/command.c Sat Jul 23 22:55:32 2011 (r224284) +++ stable/8/usr.sbin/ppp/command.c Sun Jul 24 01:36:01 2011 (r224285) @@ -184,6 +184,7 @@ static int DeleteCommand(struct cmdargs static int NegotiateCommand(struct cmdargs const *); static int ClearCommand(struct cmdargs const *); static int RunListCommand(struct cmdargs const *); +static int IfaceNameCommand(struct cmdargs const *arg); static int IfaceAddCommand(struct cmdargs const *); static int IfaceDeleteCommand(struct cmdargs const *); static int IfaceClearCommand(struct cmdargs const *); @@ -823,6 +824,10 @@ static struct cmdtab const IfaceCommands "Delete iface address", "iface delete addr", (void *)1}, {NULL, "delete!", IfaceDeleteCommand, LOCAL_AUTH, "Delete iface address", "iface delete addr", (void *)1}, + {"name", NULL, IfaceNameCommand, LOCAL_AUTH, + "Set iface name", "iface name name", NULL}, + {"description", NULL, iface_Descr, LOCAL_AUTH, + "Set iface description", "iface description text", NULL}, {"show", NULL, iface_Show, LOCAL_AUTH, "Show iface address(es)", "iface show", NULL}, {"help", "?", HelpCommand, LOCAL_AUTH | LOCAL_NO_AUTH, @@ -3176,6 +3181,21 @@ RunListCommand(struct cmdargs const *arg } static int +IfaceNameCommand(struct cmdargs const *arg) +{ + int n = arg->argn; + + if (arg->argc != n + 1) + return -1; + + if (!iface_Name(arg->bundle->iface, arg->argv[n])) + return 1; + + log_SetTun(arg->bundle->unit, arg->bundle->iface->name); + return 0; +} + +static int IfaceAddCommand(struct cmdargs const *arg) { struct ncpaddr peer, addr; Modified: stable/8/usr.sbin/ppp/iface.c ============================================================================== --- stable/8/usr.sbin/ppp/iface.c Sat Jul 23 22:55:32 2011 (r224284) +++ stable/8/usr.sbin/ppp/iface.c Sun Jul 24 01:36:01 2011 (r224285) @@ -151,6 +151,7 @@ iface_Create(const char *name) return NULL; } iface->name = strdup(name); + iface->descr = NULL; iface->index = ifm->ifm_index; iface->flags = ifm->ifm_flags; iface->mtu = 0; @@ -369,6 +370,103 @@ iface_addr_Add(const char *name, struct return res != -1; } +int +iface_Name(struct iface *iface, const char *name) +{ + struct ifreq ifr; + int s; + char *newname; + + if ((newname = strdup(name)) == NULL) { + log_Printf(LogWARN, "iface name: strdup failed: %s\n", strerror(errno)); + return 0; + } + + if ((s = ID0socket(PF_INET, SOCK_DGRAM, 0)) == -1) { + log_Printf(LogERROR, "iface name: socket(): %s\n", strerror(errno)); + free(newname); + return 0; + } + + strlcpy(ifr.ifr_name, iface->name, sizeof(ifr.ifr_name)); + ifr.ifr_data = newname; + if (ID0ioctl(s, SIOCSIFNAME, (caddr_t)&ifr) < 0) { + log_Printf(LogWARN, "iface name: ioctl(SIOCSIFNAME, %s -> %s): %s\n", + name, newname, strerror(errno)); + free(newname); + return 0; + } + + free(iface->name); + iface->name = newname; + + return 1; +} + +int +iface_Descr(struct cmdargs const *arg) +{ + struct ifreq ifr; + struct iface *iface; + size_t sz, len; + int s, n, ifdescr_maxlen; + char *descr; + + sz = sizeof(int); + if (sysctlbyname("net.ifdescr_maxlen", &ifdescr_maxlen, &sz, NULL, 0) < 0) { + log_Printf(LogERROR, "iface descr: sysctl failed: %s\n", strerror(errno)); + return 1; + } + + if (ifdescr_maxlen < 1) { + log_Printf(LogERROR, "iface descr: sysctl net.ifdescr_maxlen < 1\n"); + return 1; + } + + sz = sizeof(char) * ifdescr_maxlen; + if ((descr = malloc(sz)) == NULL) { + log_Printf(LogERROR, "iface descr: malloc failed: %s\n", strerror(errno)); + return 1; + } + + *descr = '\0'; + n = arg->argn; + while (n < arg->argc) { + if (n > arg->argn && (len = strlcat(descr, " ", sz)) >= sz) + break; + if ((len = strlcat(descr, arg->argv[n], sz)) >= sz) + break; + ++n; + } + if (len >= sz) { + log_Printf(LogERROR, "iface descr: description exceeds maximum (%d)\n", + ifdescr_maxlen-1); + free(descr); + return 1; + } + + if ((s = ID0socket(PF_INET, SOCK_DGRAM, 0)) == -1) { + log_Printf(LogERROR, "iface descr: socket(): %s\n", strerror(errno)); + free(descr); + return 1; + } + + iface = arg->bundle->iface; + strlcpy(ifr.ifr_name, iface->name, sizeof(ifr.ifr_name)); + ifr.ifr_buffer.length = strlen(descr) + 1; + ifr.ifr_buffer.buffer = descr; + if (ID0ioctl(s, SIOCSIFDESCR, (caddr_t)&ifr) < 0) { + log_Printf(LogWARN, "iface descr: ioctl(SIOCSIFDESCR, %s): %s\n", + descr, strerror(errno)); + free(descr); + return 1; + } + + free(iface->descr); + iface->descr = descr; + + return 0; +} void iface_Clear(struct iface *iface, struct ncp *ncp, int family, int how) @@ -608,18 +706,30 @@ iface_ClearFlags(const char *ifname, int } void -iface_Destroy(struct iface *iface) +iface_Free(struct iface *iface) { - /* - * iface_Clear(iface, IFACE_CLEAR_ALL) must be called manually - * if that's what the user wants. It's better to leave the interface - * allocated so that existing connections can continue to work. - */ - - if (iface != NULL) { free(iface->name); + free(iface->descr); free(iface->addr); free(iface); +} + +void +iface_Destroy(struct iface *iface) +{ + struct ifreq ifr; + int s; + + if (iface != NULL) { + if ((s = ID0socket(PF_INET, SOCK_DGRAM, 0)) == -1) { + log_Printf(LogERROR, "iface_Destroy: socket(): %s\n", strerror(errno)); + } else { + strlcpy(ifr.ifr_name, iface->name, sizeof(ifr.ifr_name)); + if (ID0ioctl(s, SIOCIFDESTROY, (caddr_t)&ifr) < 0) + log_Printf(LogWARN, "iface_Destroy: ioctl(SIOCIFDESTROY, %s): %s\n", + iface->name, strerror(errno)); + } + iface_Free(iface); } } @@ -661,7 +771,7 @@ iface_Show(struct cmdargs const *arg) current = iface_Create(iface->name); flags = iface->flags = current->flags; - iface_Destroy(current); + iface_Free(current); prompt_Printf(arg->prompt, "%s (idx %d) <", iface->name, iface->index); for (f = 0; f < sizeof if_flags / sizeof if_flags[0]; f++) Modified: stable/8/usr.sbin/ppp/iface.h ============================================================================== --- stable/8/usr.sbin/ppp/iface.h Sat Jul 23 22:55:32 2011 (r224284) +++ stable/8/usr.sbin/ppp/iface.h Sun Jul 24 01:36:01 2011 (r224285) @@ -36,6 +36,7 @@ struct iface_addr { struct iface { char *name; /* Interface name (malloc'd) */ + char *descr; /* Interface description (malloc'd) */ int index; /* Interface index */ int flags; /* Interface flags (IFF_*) */ unsigned long mtu; /* struct tuninfo MTU */ @@ -55,11 +56,14 @@ struct iface { extern struct iface *iface_Create(const char *name); extern void iface_Clear(struct iface *, struct ncp *, int, int); +extern int iface_Name(struct iface *, const char *); +extern int iface_Descr(struct cmdargs const *); extern int iface_Add(struct iface *, struct ncp *, const struct ncprange *, const struct ncpaddr *, int); extern int iface_Delete(struct iface *, struct ncp *, const struct ncpaddr *); extern int iface_Show(struct cmdargs const *); extern int iface_SetFlags(const char *, int); extern int iface_ClearFlags(const char *, int); +extern void iface_Free(struct iface *); extern void iface_Destroy(struct iface *); extern void iface_ParseHdr(struct ifa_msghdr *, struct sockaddr *[RTAX_MAX]); Modified: stable/8/usr.sbin/ppp/log.c ============================================================================== --- stable/8/usr.sbin/ppp/log.c Sat Jul 23 22:55:32 2011 (r224284) +++ stable/8/usr.sbin/ppp/log.c Sun Jul 24 01:36:01 2011 (r224285) @@ -75,6 +75,7 @@ static const char *const LogNames[] = { static u_long LogMask = MSK(LogPHASE); static u_long LogMaskLocal = MSK(LogERROR) | MSK(LogALERT) | MSK(LogWARN); static int LogTunno = -1; +static const char *LogIfaceName; static struct prompt *promptlist; /* Where to log local stuff */ struct prompt *log_PromptContext; int log_PromptListChanged; @@ -296,9 +297,10 @@ log_Open(const char *Name) } void -log_SetTun(int tunno) +log_SetTun(int tunno, const char *ifaceName) { LogTunno = tunno; + LogIfaceName = ifaceName; } void @@ -306,6 +308,7 @@ log_Close() { closelog(); LogTunno = -1; + LogIfaceName = NULL; } void @@ -319,10 +322,14 @@ log_Printf(int lev, const char *fmt,...) va_start(ap, fmt); if (promptlist && (log_IsKept(lev) & LOG_KEPT_LOCAL)) { - if ((log_IsKept(LogTUN) & LOG_KEPT_LOCAL) && LogTunno != -1) - snprintf(nfmt, sizeof nfmt, "%s%d: %s: %s", TUN_NAME, + if ((log_IsKept(LogTUN) & LOG_KEPT_LOCAL) && LogTunno != -1) { + if (LogIfaceName) + snprintf(nfmt, sizeof nfmt, "%s%d(%s): %s: %s", TUN_NAME, + LogTunno, LogIfaceName, log_Name(lev), fmt); + else + snprintf(nfmt, sizeof nfmt, "%s%d: %s: %s", TUN_NAME, LogTunno, log_Name(lev), fmt); - else + } else snprintf(nfmt, sizeof nfmt, "%s: %s", log_Name(lev), fmt); if (log_PromptContext && lev == LogWARN) @@ -337,10 +344,14 @@ log_Printf(int lev, const char *fmt,...) va_start(ap, fmt); if ((log_IsKept(lev) & LOG_KEPT_SYSLOG) && (lev != LogWARN || !log_PromptContext)) { - if ((log_IsKept(LogTUN) & LOG_KEPT_SYSLOG) && LogTunno != -1) - snprintf(nfmt, sizeof nfmt, "%s%d: %s: %s", TUN_NAME, + if ((log_IsKept(LogTUN) & LOG_KEPT_SYSLOG) && LogTunno != -1) { + if (LogIfaceName) + snprintf(nfmt, sizeof nfmt, "%s%d(%s): %s: %s", TUN_NAME, + LogTunno, LogIfaceName, log_Name(lev), fmt); + else + snprintf(nfmt, sizeof nfmt, "%s%d: %s: %s", TUN_NAME, LogTunno, log_Name(lev), fmt); - else + } else snprintf(nfmt, sizeof nfmt, "%s: %s", log_Name(lev), fmt); vsyslog(syslogLevel(lev), nfmt, ap); } Modified: stable/8/usr.sbin/ppp/log.h ============================================================================== --- stable/8/usr.sbin/ppp/log.h Sat Jul 23 22:55:32 2011 (r224284) +++ stable/8/usr.sbin/ppp/log.h Sun Jul 24 01:36:01 2011 (r224285) @@ -76,7 +76,7 @@ extern void log_DiscardAllLocal(u_long * extern int log_IsKept(int); extern int log_IsKeptLocal(int, u_long); extern void log_Open(const char *); -extern void log_SetTun(int); +extern void log_SetTun(int, const char *); extern void log_Close(void); #ifdef __GNUC__ extern void log_Printf(int, const char *,...) Modified: stable/8/usr.sbin/ppp/main.c ============================================================================== --- stable/8/usr.sbin/ppp/main.c Sat Jul 23 22:55:32 2011 (r224284) +++ stable/8/usr.sbin/ppp/main.c Sun Jul 24 01:36:01 2011 (r224285) @@ -386,11 +386,6 @@ main(int argc, char **argv) /* NOTE: We may now have changed argv[1] via a ``set proctitle'' */ - if (prompt) { - prompt->bundle = bundle; /* couldn't do it earlier */ - if (!sw.quiet) - prompt_Printf(prompt, "Using interface: %s\n", bundle->iface->name); - } SignalBundle = bundle; bundle->NatEnabled = sw.nat; if (sw.nat) @@ -430,6 +425,12 @@ main(int argc, char **argv) AbortProgram(EX_START); } + if (prompt) { + prompt->bundle = bundle; /* couldn't do it earlier */ + if (!sw.quiet) + prompt_Printf(prompt, "Using interface: %s\n", bundle->iface->name); + } + if (sw.mode != PHYS_INTERACTIVE) { if (sw.mode != PHYS_DIRECT) { if (!sw.fg) { Modified: stable/8/usr.sbin/ppp/ppp.8.m4 ============================================================================== --- stable/8/usr.sbin/ppp/ppp.8.m4 Sat Jul 23 22:55:32 2011 (r224284) +++ stable/8/usr.sbin/ppp/ppp.8.m4 Sun Jul 24 01:36:01 2011 (r224285) @@ -3924,6 +3924,13 @@ If the .Dq !\& is used, no error is given if the address is not currently assigned to the interface (and no deletion takes place). +.It iface name Ar name +Renames the interface to +.Ar name . +.It iface description Ar description +Sets the interface description to +.Ar description . +Useful if you have many interfaces on your system. .It iface show Shows the current state and current addresses for the interface. It is much the same as running From owner-svn-src-stable@FreeBSD.ORG Sun Jul 24 09:43:45 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 25FFB1065672; Sun, 24 Jul 2011 09:43:45 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 145CD8FC1A; Sun, 24 Jul 2011 09:43:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6O9hii0099584; Sun, 24 Jul 2011 09:43:44 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6O9hitl099581; Sun, 24 Jul 2011 09:43:44 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201107240943.p6O9hitl099581@svn.freebsd.org> From: Hans Petter Selasky Date: Sun, 24 Jul 2011 09:43:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224287 - in stable/8/sys/dev/usb: . serial X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Jul 2011 09:43:45 -0000 Author: hselasky Date: Sun Jul 24 09:43:44 2011 New Revision: 224287 URL: http://svn.freebsd.org/changeset/base/224287 Log: MFC r224239: Add new USB ID to u3g driver. Modified: stable/8/sys/dev/usb/serial/u3g.c stable/8/sys/dev/usb/usbdevs Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/usb/serial/u3g.c ============================================================================== --- stable/8/sys/dev/usb/serial/u3g.c Sun Jul 24 03:34:38 2011 (r224286) +++ stable/8/sys/dev/usb/serial/u3g.c Sun Jul 24 09:43:44 2011 (r224287) @@ -293,6 +293,7 @@ static const STRUCT_USB_HOST_ID u3g_devs U3G_DEV(LONGCHEER, WM66, U3GINIT_HUAWEI), U3G_DEV(LONGCHEER, DISK, U3GINIT_TCT), U3G_DEV(LONGCHEER, W14, 0), + U3G_DEV(LONGCHEER, XSSTICK, 0), U3G_DEV(MERLIN, V620, 0), U3G_DEV(NEOTEL, PRIME, 0), U3G_DEV(NOVATEL, E725, 0), Modified: stable/8/sys/dev/usb/usbdevs ============================================================================== --- stable/8/sys/dev/usb/usbdevs Sun Jul 24 03:34:38 2011 (r224286) +++ stable/8/sys/dev/usb/usbdevs Sun Jul 24 09:43:44 2011 (r224287) @@ -2106,6 +2106,7 @@ product LOGITEC RT2870_3 0x0164 RT2870 /* Longcheer Holdings, Ltd. products */ product LONGCHEER WM66 0x6061 Longcheer WM66 HSDPA product LONGCHEER W14 0x9603 Mobilcom W14 +product LONGCHEER XSSTICK 0x9605 4G Systems XSStick P14 product LONGCHEER DISK 0xf000 Driver disk From owner-svn-src-stable@FreeBSD.ORG Sun Jul 24 11:56:39 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7C4981065672; Sun, 24 Jul 2011 11:56:39 +0000 (UTC) (envelope-from sanpei@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 515468FC19; Sun, 24 Jul 2011 11:56:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6OBudVJ004750; Sun, 24 Jul 2011 11:56:39 GMT (envelope-from sanpei@svn.freebsd.org) Received: (from sanpei@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6OBudqc004749; Sun, 24 Jul 2011 11:56:39 GMT (envelope-from sanpei@svn.freebsd.org) Message-Id: <201107241156.p6OBudqc004749@svn.freebsd.org> From: MIHIRA Sanpei Yoshiro Date: Sun, 24 Jul 2011 11:56:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224288 - in stable/8/sys: amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Jul 2011 11:56:39 -0000 Author: sanpei Date: Sun Jul 24 11:56:39 2011 New Revision: 224288 URL: http://svn.freebsd.org/changeset/base/224288 Log: Fix svn:mergeinfo for merge of r216057 Approved by: imp(menter) Modified: Directory Properties: stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) From owner-svn-src-stable@FreeBSD.ORG Sun Jul 24 12:31:21 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 051F6106564A; Sun, 24 Jul 2011 12:31:21 +0000 (UTC) (envelope-from sanpei@sanpei.org) Received: from mail2.asahi-net.or.jp (mail2.asahi-net.or.jp [202.224.39.198]) by mx1.freebsd.org (Postfix) with ESMTP id C58378FC0C; Sun, 24 Jul 2011 12:31:20 +0000 (UTC) Received: from cherry2.sanpei.org (j069113.ppp.asahi-net.or.jp [61.213.69.113]) by mail2.asahi-net.or.jp (Postfix) with ESMTP id 51B9BED99D; Sun, 24 Jul 2011 21:13:49 +0900 (JST) Received: from localhost (localhost [127.0.0.1]) by cherry2.sanpei.org (8.14.4/8.14.3) with ESMTP id p6OCDm0w015897; Sun, 24 Jul 2011 21:13:48 +0900 (JST) (envelope-from sanpei@sanpei.org) Date: Sun, 24 Jul 2011 21:13:48 +0900 (JST) Message-Id: <20110724.211348.1305564732068179438.sanpei@sanpei.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org From: MIHIRA Sanpei Yoshiro X-Mailer: Mew version 6.3 on Emacs 23.2 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.3 (cherry2.sanpei.org [127.0.0.1]); Sun, 24 Jul 2011 21:13:49 +0900 (JST) Cc: Subject: svn commit: r224146 - in stable/8: share/man/man4 sys X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Jul 2011 12:31:21 -0000 Oops, hrs-san already commited this mergeinfo. sorry. >Log: > Fix svn:mergeinfo for merge of r216057 > > Approved by: imp(menter) > >Modified: >Directory Properties: > stable/8/sys/amd64/include/xen/ (props changed) > stable/8/sys/cddl/contrib/opensolaris/ (props changed) > stable/8/sys/contrib/dev/acpica/ (props changed) > stable/8/sys/contrib/pf/ (props changed) --- MIHIRA, Sanpei Yoshiro Tokyo, Japan. From owner-svn-src-stable@FreeBSD.ORG Sun Jul 24 17:24:26 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 89912106564A; Sun, 24 Jul 2011 17:24:26 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7861B8FC08; Sun, 24 Jul 2011 17:24:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6OHOQd2017464; Sun, 24 Jul 2011 17:24:26 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6OHOQTa017462; Sun, 24 Jul 2011 17:24:26 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201107241724.p6OHOQTa017462@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 24 Jul 2011 17:24:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224289 - stable/8/usr.bin/printf X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Jul 2011 17:24:26 -0000 Author: jilles Date: Sun Jul 24 17:24:26 2011 New Revision: 224289 URL: http://svn.freebsd.org/changeset/base/224289 Log: MFC r212374,r221026: printf(1): Document need for "--" before format strings starting with "-". Also move the remark that hexadecimal escapes are not provided to the new CAVEATS section. PR: 158846 Modified: stable/8/usr.bin/printf/printf.1 Directory Properties: stable/8/usr.bin/printf/ (props changed) Modified: stable/8/usr.bin/printf/printf.1 ============================================================================== --- stable/8/usr.bin/printf/printf.1 Sun Jul 24 11:56:39 2011 (r224288) +++ stable/8/usr.bin/printf/printf.1 Sun Jul 24 17:24:26 2011 (r224289) @@ -332,6 +332,16 @@ command appeared in It is modeled after the standard library function, .Xr printf 3 . +.Sh CAVEATS +.Tn ANSI +hexadecimal character constants were deliberately not provided. +.Pp +Trying to print a dash ("-") as the first character causes +.Nm +to interpret the dash as a program argument. +.Nm -- +must be used before +.Ar format . .Sh BUGS Since the floating point numbers are translated from .Tn ASCII @@ -343,9 +353,6 @@ The .Cm L modifier may produce additional precision, depending on the hardware platform.) .Pp -.Tn ANSI -hexadecimal character constants were deliberately not provided. -.Pp The escape sequence \e000 is the string terminator. When present in the argument for the .Cm b From owner-svn-src-stable@FreeBSD.ORG Sun Jul 24 17:52:36 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 20020106568A; Sun, 24 Jul 2011 17:52:36 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C91DF8FC1C; Sun, 24 Jul 2011 17:52:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6OHqZZW018392; Sun, 24 Jul 2011 17:52:35 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6OHqZBj018390; Sun, 24 Jul 2011 17:52:35 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201107241752.p6OHqZBj018390@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 24 Jul 2011 17:52:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224291 - stable/8/usr.bin/printf X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Jul 2011 17:52:36 -0000 Author: jilles Date: Sun Jul 24 17:52:35 2011 New Revision: 224291 URL: http://svn.freebsd.org/changeset/base/224291 Log: MFC r221013: printf(1): Mention effect of '#' modifier on other conversions. Modified: stable/8/usr.bin/printf/printf.1 Directory Properties: stable/8/usr.bin/printf/ (props changed) Modified: stable/8/usr.bin/printf/printf.1 ============================================================================== --- stable/8/usr.bin/printf/printf.1 Sun Jul 24 17:43:09 2011 (r224290) +++ stable/8/usr.bin/printf/printf.1 Sun Jul 24 17:52:35 2011 (r224291) @@ -35,7 +35,7 @@ .\" @(#)printf.1 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd September 5, 2010 +.Dd April 25, 2011 .Dt PRINTF 1 .Os .Sh NAME @@ -129,9 +129,9 @@ in the following order: A `#' character specifying that the value should be printed in an ``alternate form''. For -.Cm c , d , +.Cm b , c , d , s and -.Cm s , +.Cm u formats, this option has no effect. For the .Cm o @@ -145,9 +145,9 @@ format, a non-zero result has the string .Pq Li 0X prepended to it. For -.Cm e , E , f , g , +.Cm a , A , e , E , f , F , g and -.Cm G , +.Cm G formats, the result will always contain a decimal point, even if no digits follow the point (normally, a decimal point only appears in the results of those formats if a digit follows the decimal point). From owner-svn-src-stable@FreeBSD.ORG Sun Jul 24 18:03:03 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 00B941065673; Sun, 24 Jul 2011 18:03:03 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DA62A8FC13; Sun, 24 Jul 2011 18:03:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6OI32qA018758; Sun, 24 Jul 2011 18:03:02 GMT (envelope-from sobomax@svn.freebsd.org) Received: (from sobomax@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6OI32ST018756; Sun, 24 Jul 2011 18:03:02 GMT (envelope-from sobomax@svn.freebsd.org) Message-Id: <201107241803.p6OI32ST018756@svn.freebsd.org> From: Maxim Sobolev Date: Sun, 24 Jul 2011 18:03:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224292 - stable/8/sbin/natd X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Jul 2011 18:03:03 -0000 Author: sobomax Date: Sun Jul 24 18:03:02 2011 New Revision: 224292 URL: http://svn.freebsd.org/changeset/base/224292 Log: MFC: 220736, 220806, 220808 If we can retrieve interface address sleep for one second and try again. This can happen during start-up, when natd starts before dhclient has a chance to receive IP address from the upstream provider. Do this only in background, dynamic mode. Reminded by: brian Modified: stable/8/sbin/natd/natd.c Directory Properties: stable/8/sbin/natd/ (props changed) Modified: stable/8/sbin/natd/natd.c ============================================================================== --- stable/8/sbin/natd/natd.c Sun Jul 24 17:52:35 2011 (r224291) +++ stable/8/sbin/natd/natd.c Sun Jul 24 18:03:02 2011 (r224292) @@ -111,7 +111,7 @@ static void Usage (void); static char* FormatPacket (struct ip*); static void PrintPacket (struct ip*); static void SyslogPacket (struct ip*, int priority, const char *label); -static void SetAliasAddressFromIfName (const char *ifName); +static int SetAliasAddressFromIfName (const char *ifName); static void InitiateShutdown (int); static void Shutdown (int); static void RefreshAddr (int); @@ -156,6 +156,7 @@ int main (int argc, char** argv) struct sockaddr_in addr; fd_set readMask; int fdMax; + int rval; /* * Initialize packet aliasing software. * Done already here to be able to alter option bits @@ -301,8 +302,17 @@ int main (int argc, char** argv) mip->assignAliasAddr = 1; } - else - SetAliasAddressFromIfName (mip->ifName); + else { + do { + rval = SetAliasAddressFromIfName (mip->ifName); + if (background == 0 || dynamicMode == 0) + break; + if (rval == EAGAIN) + sleep(1); + } while (rval == EAGAIN); + if (rval != 0) + exit(1); + } } } @@ -531,7 +541,8 @@ static void DoGlobal (int fd) #if 0 if (mip->assignAliasAddr) { - SetAliasAddressFromIfName (mip->ifName); + if (SetAliasAddressFromIfName (mip->ifName) != 0) + exit(1); mip->assignAliasAddr = 0; } #endif @@ -634,10 +645,18 @@ static void DoAliasing (int fd, int dire socklen_t addrSize; struct ip* ip; char msgBuf[80]; + int rval; if (mip->assignAliasAddr) { - - SetAliasAddressFromIfName (mip->ifName); + do { + rval = SetAliasAddressFromIfName (mip->ifName); + if (background == 0 || dynamicMode == 0) + break; + if (rval == EAGAIN) + sleep(1); + } while (rval == EAGAIN); + if (rval != 0) + exit(1); mip->assignAliasAddr = 0; } /* @@ -867,7 +886,7 @@ static char* FormatPacket (struct ip* ip return buf; } -static void +static int SetAliasAddressFromIfName(const char *ifn) { size_t needed; @@ -951,14 +970,19 @@ SetAliasAddressFromIfName(const char *if } } } - if (sin == NULL) - errx(1, "%s: cannot get interface address", ifn); + if (sin == NULL) { + warnx("%s: cannot get interface address", ifn); + free(buf); + return EAGAIN; + } LibAliasSetAddress(mla, sin->sin_addr); syslog(LOG_INFO, "Aliasing to %s, mtu %d bytes", inet_ntoa(sin->sin_addr), mip->ifMTU); free(buf); + + return 0; } void Quit (const char* msg) From owner-svn-src-stable@FreeBSD.ORG Sun Jul 24 19:13:55 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1F3A91065670; Sun, 24 Jul 2011 19:13:55 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0E87D8FC13; Sun, 24 Jul 2011 19:13:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6OJDsK2021010; Sun, 24 Jul 2011 19:13:54 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6OJDse4021008; Sun, 24 Jul 2011 19:13:54 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201107241913.p6OJDse4021008@svn.freebsd.org> From: Ed Schouten Date: Sun, 24 Jul 2011 19:13:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224295 - stable/8/usr.sbin/config X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Jul 2011 19:13:55 -0000 Author: ed Date: Sun Jul 24 19:13:54 2011 New Revision: 224295 URL: http://svn.freebsd.org/changeset/base/224295 Log: MFC r223744: Improve portability of config(8). - Use strlen(dp->d_name) instead of the unportable dp->d_namlen. Rename i to len to make it slightly more descriptive and prevent negative indexing of the array. - Replace index() by strchr(). This supposedly fixes compilation on GNU systems. Submitted by: Robert Millan (original patch) Modified: stable/8/usr.sbin/config/main.c Directory Properties: stable/8/usr.sbin/config/ (props changed) stable/8/usr.sbin/config/SMM.doc/ (props changed) Modified: stable/8/usr.sbin/config/main.c ============================================================================== --- stable/8/usr.sbin/config/main.c Sun Jul 24 18:27:09 2011 (r224294) +++ stable/8/usr.sbin/config/main.c Sun Jul 24 19:13:54 2011 (r224295) @@ -604,7 +604,7 @@ cleanheaders(char *p) struct dirent *dp; struct file_list *fl; struct hdr_list *hl; - int i; + size_t len; remember("y.tab.h"); remember("setdefs.h"); @@ -618,12 +618,13 @@ cleanheaders(char *p) if ((dirp = opendir(p)) == NULL) err(EX_OSERR, "opendir %s", p); while ((dp = readdir(dirp)) != NULL) { - i = dp->d_namlen - 2; + len = strlen(dp->d_name); /* Skip non-headers */ - if (dp->d_name[i] != '.' || dp->d_name[i + 1] != 'h') + if (len < 2 || dp->d_name[len - 2] != '.' || + dp->d_name[len - 1] != 'h') continue; /* Skip special stuff, eg: bus_if.h, but check opt_*.h */ - if (index(dp->d_name, '_') && + if (strchr(dp->d_name, '_') && strncmp(dp->d_name, "opt_", 4) != 0) continue; /* Check if it is a target file */ From owner-svn-src-stable@FreeBSD.ORG Sun Jul 24 19:19:50 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 950F0106564A; Sun, 24 Jul 2011 19:19:50 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 847FC8FC16; Sun, 24 Jul 2011 19:19:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6OJJocK021243; Sun, 24 Jul 2011 19:19:50 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6OJJomX021241; Sun, 24 Jul 2011 19:19:50 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201107241919.p6OJJomX021241@svn.freebsd.org> From: Ed Schouten Date: Sun, 24 Jul 2011 19:19:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224296 - stable/8/usr.bin/lock X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Jul 2011 19:19:50 -0000 Author: ed Date: Sun Jul 24 19:19:50 2011 New Revision: 224296 URL: http://svn.freebsd.org/changeset/base/224296 Log: MFC r216696 and r216737: Slightly improve output of lock(1). - Remove the /dev/ portion of the TTY name. - In case we use lock -p, print the username that was used to obtain the password hash. Modified: stable/8/usr.bin/lock/lock.c Directory Properties: stable/8/usr.bin/lock/ (props changed) Modified: stable/8/usr.bin/lock/lock.c ============================================================================== --- stable/8/usr.bin/lock/lock.c Sun Jul 24 19:13:54 2011 (r224295) +++ stable/8/usr.bin/lock/lock.c Sun Jul 24 19:19:50 2011 (r224296) @@ -64,6 +64,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -102,6 +103,7 @@ main(int argc, char **argv) openlog("lock", LOG_ODELAY, LOG_AUTH); sectimeout = TIMEOUT; + pw = NULL; mypw = NULL; usemine = 0; no_timeout = 0; @@ -137,6 +139,8 @@ main(int argc, char **argv) gethostname(hostname, sizeof(hostname)); if (!(ttynam = ttyname(0))) errx(1, "not a terminal?"); + if (strncmp(ttynam, _PATH_DEV, strlen(_PATH_DEV)) == 0) + ttynam += strlen(_PATH_DEV); if (gettimeofday(&timval, (struct timezone *)NULL)) err(1, "gettimeofday"); nexttime = timval.tv_sec + (sectimeout * 60); @@ -196,7 +200,11 @@ main(int argc, char **argv) } /* header info */ - (void)printf("lock: %s on %s.", ttynam, hostname); + if (pw != NULL) + (void)printf("lock: %s using %s on %s.", pw->pw_name, + ttynam, hostname); + else + (void)printf("lock: %s on %s.", ttynam, hostname); if (no_timeout) (void)printf(" no timeout."); else From owner-svn-src-stable@FreeBSD.ORG Sun Jul 24 20:09:43 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6992F106566B; Sun, 24 Jul 2011 20:09:43 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 573308FC1A; Sun, 24 Jul 2011 20:09:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6OK9hYx022788; Sun, 24 Jul 2011 20:09:43 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6OK9hMg022774; Sun, 24 Jul 2011 20:09:43 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201107242009.p6OK9hMg022774@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 24 Jul 2011 20:09:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224297 - in stable/8: lib/libc/gen lib/libc/sys usr.bin/lastcomm X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Jul 2011 20:09:43 -0000 Author: jilles Date: Sun Jul 24 20:09:42 2011 New Revision: 224297 URL: http://svn.freebsd.org/changeset/base/224297 Log: MFC r207735: Update xrefs from 4.3BSD to modern signal functions in various man pages. sigvec(2) references have been updated to sigaction(2), sigsetmask(2) and sigblock(2) to sigprocmask(2), sigpause(2) to sigsuspend(2). Some legacy man pages still refer to them, that is OK. Modified: stable/8/lib/libc/gen/alarm.3 stable/8/lib/libc/gen/siginterrupt.3 stable/8/lib/libc/gen/ualarm.3 stable/8/lib/libc/sys/execve.2 stable/8/lib/libc/sys/fcntl.2 stable/8/lib/libc/sys/getitimer.2 stable/8/lib/libc/sys/getrlimit.2 stable/8/lib/libc/sys/sigaction.2 stable/8/lib/libc/sys/sigreturn.2 stable/8/lib/libc/sys/vfork.2 stable/8/usr.bin/lastcomm/lastcomm.1 Directory Properties: stable/8/lib/libc/ (props changed) stable/8/lib/libc/stdtime/ (props changed) stable/8/usr.bin/lastcomm/ (props changed) Modified: stable/8/lib/libc/gen/alarm.3 ============================================================================== --- stable/8/lib/libc/gen/alarm.3 Sun Jul 24 19:19:50 2011 (r224296) +++ stable/8/lib/libc/gen/alarm.3 Sun Jul 24 20:09:42 2011 (r224297) @@ -76,8 +76,7 @@ If no alarm is currently set, the return .Sh SEE ALSO .Xr setitimer 2 , .Xr sigaction 2 , -.Xr sigpause 2 , -.Xr sigvec 2 , +.Xr sigsuspend 2 , .Xr signal 3 , .Xr sleep 3 , .Xr ualarm 3 , Modified: stable/8/lib/libc/gen/siginterrupt.3 ============================================================================== --- stable/8/lib/libc/gen/siginterrupt.3 Sun Jul 24 19:19:50 2011 (r224296) +++ stable/8/lib/libc/gen/siginterrupt.3 Sun Jul 24 20:09:42 2011 (r224297) @@ -109,9 +109,8 @@ is not a valid signal number. .El .Sh SEE ALSO .Xr sigaction 2 , -.Xr sigblock 2 , -.Xr sigpause 2 , -.Xr sigsetmask 2 , +.Xr sigprocmask 2 , +.Xr sigsuspend 2 , .Xr signal 3 .Sh HISTORY The Modified: stable/8/lib/libc/gen/ualarm.3 ============================================================================== --- stable/8/lib/libc/gen/ualarm.3 Sun Jul 24 19:19:50 2011 (r224296) +++ stable/8/lib/libc/gen/ualarm.3 Sun Jul 24 20:09:42 2011 (r224297) @@ -84,8 +84,8 @@ A microsecond is 0.000001 seconds. .Sh SEE ALSO .Xr getitimer 2 , .Xr setitimer 2 , -.Xr sigpause 2 , -.Xr sigvec 2 , +.Xr sigaction 2 , +.Xr sigsuspend 2 , .Xr alarm 3 , .Xr signal 3 , .Xr sleep 3 , Modified: stable/8/lib/libc/sys/execve.2 ============================================================================== --- stable/8/lib/libc/sys/execve.2 Sun Jul 24 19:19:50 2011 (r224296) +++ stable/8/lib/libc/sys/execve.2 Sun Jul 24 20:09:42 2011 (r224297) @@ -189,8 +189,8 @@ the calling process: .It interval timers Ta see Xr getitimer 2 .It resource limits Ta see Xr getrlimit 2 .It file mode mask Ta see Xr umask 2 -.It signal mask Ta see Xr sigvec 2 , -.Xr sigsetmask 2 +.It signal mask Ta see Xr sigaction 2 , +.Xr sigprocmask 2 .El .Pp When a program is executed as a result of an Modified: stable/8/lib/libc/sys/fcntl.2 ============================================================================== --- stable/8/lib/libc/sys/fcntl.2 Sun Jul 24 19:19:50 2011 (r224296) +++ stable/8/lib/libc/sys/fcntl.2 Sun Jul 24 20:09:42 2011 (r224297) @@ -618,7 +618,7 @@ for the reasons as stated in .Xr flock 2 , .Xr getdtablesize 2 , .Xr open 2 , -.Xr sigvec 2 , +.Xr sigaction 2 , .Xr lockf 3 , .Xr tcgetpgrp 3 , .Xr tcsetpgrp 3 Modified: stable/8/lib/libc/sys/getitimer.2 ============================================================================== --- stable/8/lib/libc/sys/getitimer.2 Sun Jul 24 19:19:50 2011 (r224296) +++ stable/8/lib/libc/sys/getitimer.2 Sun Jul 24 20:09:42 2011 (r224297) @@ -171,7 +171,7 @@ to be handled. .Sh SEE ALSO .Xr gettimeofday 2 , .Xr select 2 , -.Xr sigvec 2 , +.Xr sigaction 2 , .Xr clocks 7 .Sh HISTORY The Modified: stable/8/lib/libc/sys/getrlimit.2 ============================================================================== --- stable/8/lib/libc/sys/getrlimit.2 Sun Jul 24 19:19:50 2011 (r224296) +++ stable/8/lib/libc/sys/getrlimit.2 Sun Jul 24 20:09:42 2011 (r224297) @@ -193,7 +193,7 @@ raised the maximum limit value, and the .Xr quota 1 , .Xr quotactl 2 , .Xr sigaltstack 2 , -.Xr sigvec 2 , +.Xr sigaction 2 , .Xr sysctl 3 , .Xr ulimit 3 .Sh HISTORY Modified: stable/8/lib/libc/sys/sigaction.2 ============================================================================== --- stable/8/lib/libc/sys/sigaction.2 Sun Jul 24 19:19:50 2011 (r224296) +++ stable/8/lib/libc/sys/sigaction.2 Sun Jul 24 20:09:42 2011 (r224297) @@ -609,13 +609,9 @@ or .Xr kill 2 , .Xr ptrace 2 , .Xr sigaltstack 2 , -.Xr sigblock 2 , -.Xr sigpause 2 , .Xr sigpending 2 , .Xr sigprocmask 2 , -.Xr sigsetmask 2 , .Xr sigsuspend 2 , -.Xr sigvec 2 , .Xr wait 2 , .Xr fpsetmask 3 , .Xr setjmp 3 , Modified: stable/8/lib/libc/sys/sigreturn.2 ============================================================================== --- stable/8/lib/libc/sys/sigreturn.2 Sun Jul 24 19:19:50 2011 (r224296) +++ stable/8/lib/libc/sys/sigreturn.2 Sun Jul 24 20:09:42 2011 (r224297) @@ -83,7 +83,7 @@ The process status longword is invalid o raise the privilege level of the process. .El .Sh SEE ALSO -.Xr sigvec 2 , +.Xr sigaction 2 , .Xr setjmp 3 , .Xr ucontext 3 .Sh HISTORY Modified: stable/8/lib/libc/sys/vfork.2 ============================================================================== --- stable/8/lib/libc/sys/vfork.2 Sun Jul 24 19:19:50 2011 (r224296) +++ stable/8/lib/libc/sys/vfork.2 Sun Jul 24 20:09:42 2011 (r224297) @@ -104,7 +104,7 @@ Same as for .Xr _exit 2 , .Xr fork 2 , .Xr rfork 2 , -.Xr sigvec 2 , +.Xr sigaction 2 , .Xr wait 2 , .Xr exit 3 .Sh HISTORY Modified: stable/8/usr.bin/lastcomm/lastcomm.1 ============================================================================== --- stable/8/usr.bin/lastcomm/lastcomm.1 Sun Jul 24 19:19:50 2011 (r224296) +++ stable/8/usr.bin/lastcomm/lastcomm.1 Sun Jul 24 20:09:42 2011 (r224297) @@ -168,7 +168,7 @@ while will print details of each terminating command. .Sh SEE ALSO .Xr last 1 , -.Xr sigvec 2 , +.Xr sigaction 2 , .Xr acct 5 , .Xr core 5 .Sh HISTORY From owner-svn-src-stable@FreeBSD.ORG Sun Jul 24 23:43:40 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 67AAB1065672; Sun, 24 Jul 2011 23:43:40 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 56E7D8FC1B; Sun, 24 Jul 2011 23:43:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6ONhebp029102; Sun, 24 Jul 2011 23:43:40 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6ONhexX029100; Sun, 24 Jul 2011 23:43:40 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201107242343.p6ONhexX029100@svn.freebsd.org> From: Doug Barton Date: Sun, 24 Jul 2011 23:43:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224299 - stable/8/etc X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Jul 2011 23:43:40 -0000 Author: dougb Date: Sun Jul 24 23:43:40 2011 New Revision: 224299 URL: http://svn.freebsd.org/changeset/base/224299 Log: MFC r197728: Add OpenVPN IANA assigned port number. Modified: stable/8/etc/services Directory Properties: stable/8/etc/ (props changed) Modified: stable/8/etc/services ============================================================================== --- stable/8/etc/services Sun Jul 24 23:02:24 2011 (r224298) +++ stable/8/etc/services Sun Jul 24 23:43:40 2011 (r224299) @@ -1533,6 +1533,8 @@ cisco-ipsla 1167/sctp #Cisco IP SLAs Co cisco-ipsla 1167/tcp #Cisco IP SLAs Control Protocol cisco-ipsla 1167/udp #Cisco IP SLAs Control Protocol skkserv 1178/tcp #SKK (kanji input) +openvpn 1194/tcp #OpenVPN +openvpn 1194/udp #OpenVPN lupa 1212/tcp lupa 1212/udp nerv 1222/tcp #SNI R&D network From owner-svn-src-stable@FreeBSD.ORG Sun Jul 24 23:44:16 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E15751065674; Sun, 24 Jul 2011 23:44:16 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D0BC58FC0C; Sun, 24 Jul 2011 23:44:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6ONiG7R029188; Sun, 24 Jul 2011 23:44:16 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6ONiG3S029186; Sun, 24 Jul 2011 23:44:16 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201107242344.p6ONiG3S029186@svn.freebsd.org> From: Doug Barton Date: Sun, 24 Jul 2011 23:44:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224300 - stable/7/etc X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Jul 2011 23:44:17 -0000 Author: dougb Date: Sun Jul 24 23:44:16 2011 New Revision: 224300 URL: http://svn.freebsd.org/changeset/base/224300 Log: MFC r197728: Add OpenVPN IANA assigned port number. Modified: stable/7/etc/services Directory Properties: stable/7/etc/ (props changed) Modified: stable/7/etc/services ============================================================================== --- stable/7/etc/services Sun Jul 24 23:43:40 2011 (r224299) +++ stable/7/etc/services Sun Jul 24 23:44:16 2011 (r224300) @@ -1521,6 +1521,8 @@ nfa 1155/tcp #Network File Access nfa 1155/udp #Network File Access phone 1167/udp #conference calling skkserv 1178/tcp #SKK (kanji input) +openvpn 1194/tcp #OpenVPN +openvpn 1194/udp #OpenVPN lupa 1212/tcp lupa 1212/udp nerv 1222/tcp #SNI R&D network From owner-svn-src-stable@FreeBSD.ORG Mon Jul 25 00:17:20 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D877C1065670; Mon, 25 Jul 2011 00:17:20 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C752C8FC12; Mon, 25 Jul 2011 00:17:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6P0HK8g030183; Mon, 25 Jul 2011 00:17:20 GMT (envelope-from sobomax@svn.freebsd.org) Received: (from sobomax@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6P0HKTf030181; Mon, 25 Jul 2011 00:17:20 GMT (envelope-from sobomax@svn.freebsd.org) Message-Id: <201107250017.p6P0HKTf030181@svn.freebsd.org> From: Maxim Sobolev Date: Mon, 25 Jul 2011 00:17:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224301 - stable/8/sys/geom/label X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 00:17:21 -0000 Author: sobomax Date: Mon Jul 25 00:17:20 2011 New Revision: 224301 URL: http://svn.freebsd.org/changeset/base/224301 Log: MFC: Strip any leading slashes before feeding the label to the geom_label code. Some linux distros put mount point into the ext2fs labels, such as '/', or '/boot', which confuses the devfs code and can cause userland programs to fail reading /dev/ext2fs directory with weird error code. Modified: stable/8/sys/geom/label/g_label_ext2fs.c Directory Properties: stable/8/sys/geom/label/ (props changed) Modified: stable/8/sys/geom/label/g_label_ext2fs.c ============================================================================== --- stable/8/sys/geom/label/g_label_ext2fs.c Sun Jul 24 23:44:16 2011 (r224300) +++ stable/8/sys/geom/label/g_label_ext2fs.c Mon Jul 25 00:17:20 2011 (r224301) @@ -53,6 +53,7 @@ g_label_ext2fs_taste(struct g_consumer * { struct g_provider *pp; e2sb_t *fs; + char *s_volume_name; g_topology_assert_not(); pp = cp->provider; @@ -74,13 +75,18 @@ g_label_ext2fs_taste(struct g_consumer * goto exit_free; } + s_volume_name = fs->s_volume_name; + /* Terminate label */ + s_volume_name[sizeof(fs->s_volume_name) - 1] = '\0'; + + if (s_volume_name[0] == '/') + s_volume_name += 1; + /* Check for volume label */ - if (fs->s_volume_name[0] == '\0') + if (s_volume_name[0] == '\0') goto exit_free; - /* Terminate label */ - fs->s_volume_name[sizeof(fs->s_volume_name) - 1] = '\0'; - strlcpy(label, fs->s_volume_name, size); + strlcpy(label, s_volume_name, size); exit_free: g_free(fs); From owner-svn-src-stable@FreeBSD.ORG Mon Jul 25 01:42:52 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6334B106566C; Mon, 25 Jul 2011 01:42:52 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 386CF8FC12; Mon, 25 Jul 2011 01:42:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6P1gqq3032693; Mon, 25 Jul 2011 01:42:52 GMT (envelope-from sobomax@svn.freebsd.org) Received: (from sobomax@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6P1gq5t032691; Mon, 25 Jul 2011 01:42:52 GMT (envelope-from sobomax@svn.freebsd.org) Message-Id: <201107250142.p6P1gq5t032691@svn.freebsd.org> From: Maxim Sobolev Date: Mon, 25 Jul 2011 01:42:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224302 - stable/8/sys/amd64/amd64 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 01:42:52 -0000 Author: sobomax Date: Mon Jul 25 01:42:51 2011 New Revision: 224302 URL: http://svn.freebsd.org/changeset/base/224302 Log: MFC: re-work dump progress indicator to work better with more than few gigs of RAM. Modified: stable/8/sys/amd64/amd64/minidump_machdep.c Modified: stable/8/sys/amd64/amd64/minidump_machdep.c ============================================================================== --- stable/8/sys/amd64/amd64/minidump_machdep.c Mon Jul 25 00:17:20 2011 (r224301) +++ stable/8/sys/amd64/amd64/minidump_machdep.c Mon Jul 25 01:42:51 2011 (r224302) @@ -69,7 +69,7 @@ static off_t dumplo; /* Handle chunked writes. */ static size_t fragsz; static void *dump_va; -static size_t counter, progress; +static size_t counter, progress, dumpsize; CTASSERT(sizeof(*vm_page_dump) == 8); @@ -101,6 +101,40 @@ blk_flush(struct dumperinfo *di) return (error); } +static struct { + int min_per; + int max_per; + int visited; +} progress_track[10] = { + { 0, 10, 0}, + { 10, 20, 0}, + { 20, 30, 0}, + { 30, 40, 0}, + { 40, 50, 0}, + { 50, 60, 0}, + { 60, 70, 0}, + { 70, 80, 0}, + { 80, 90, 0}, + { 90, 100, 0} +}; + +static void +report_progress(size_t progress, size_t dumpsize) +{ + int sofar, i; + + sofar = 100 - ((progress * 100) / dumpsize); + for (i = 0; i < 10; i++) { + if (sofar < progress_track[i].min_per || sofar > progress_track[i].max_per) + continue; + if (progress_track[i].visited) + return; + progress_track[i].visited = 1; + printf("..%d%%", sofar); + return; + } +} + static int blk_write(struct dumperinfo *di, char *ptr, vm_paddr_t pa, size_t sz) { @@ -137,7 +171,7 @@ blk_write(struct dumperinfo *di, char *p counter += len; progress -= len; if (counter >> 24) { - printf(" %ld", PG2MB(progress >> PAGE_SHIFT)); + report_progress(progress, dumpsize); counter &= (1<<24) - 1; } #ifdef SW_WATCHDOG @@ -180,7 +214,6 @@ static pd_entry_t fakepd[NPDEPG]; void minidumpsys(struct dumperinfo *di) { - uint64_t dumpsize; uint32_t pmapsize; vm_offset_t va; int error; @@ -300,8 +333,8 @@ minidumpsys(struct dumperinfo *di) mkdumpheader(&kdh, KERNELDUMPMAGIC, KERNELDUMP_AMD64_VERSION, dumpsize, di->blocksize); - printf("Physical memory: %ju MB\n", ptoa((uintmax_t)physmem) / 1048576); - printf("Dumping %llu MB:", (long long)dumpsize >> 20); + printf("Dumping %llu out of %ju MB:", (long long)dumpsize >> 20, + ptoa((uintmax_t)physmem) / 1048576); /* Dump leader */ error = dump_write(di, &kdh, 0, dumplo, sizeof(kdh)); From owner-svn-src-stable@FreeBSD.ORG Mon Jul 25 02:27:38 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E5FA91065670; Mon, 25 Jul 2011 02:27:38 +0000 (UTC) (envelope-from prvs=1180d2598a=brian@Awfulhak.org) Received: from idcmail-mo2no.shaw.ca (idcmail-mo2no.shaw.ca [64.59.134.9]) by mx1.freebsd.org (Postfix) with ESMTP id 723E88FC0C; Mon, 25 Jul 2011 02:27:38 +0000 (UTC) Received: from pd6ml2no-ssvc.prod.shaw.ca ([10.0.153.163]) by pd7mo1no-svcs.prod.shaw.ca with ESMTP; 24 Jul 2011 20:12:36 -0600 X-Cloudmark-SP-Filtered: true X-Cloudmark-SP-Result: v=1.1 cv=Mj7okGGiyvljez8nourwAOSCyIXzraNcHEi86Qy5a+Y= c=1 sm=1 a=wom5GMh1gUkA:10 a=J1aGlPMB6iMA:10 a=dBRESv0yCI8A:10 a=BLceEmwcHowA:10 a=kj9zAlcOel0A:10 a=cmB/9TsswV7PJ0tytqGp1Q==:17 a=6I5d2MoRAAAA:8 a=MMwg4So0AAAA:8 a=3pS6OY6mvVe0ZjVZ7A4A:9 a=CjuIK1q_8ugA:10 a=WJ3hkfHDukgA:10 a=SV7veod9ZcQA:10 a=MmZFRhEyO09k63mk:21 a=sJ8ujE9dZp4tHHAS:21 a=HpAAvcLHHh0Zw7uRqdWCyQ==:117 Received: from unknown (HELO store.lan.Awfulhak.org) ([70.79.183.1]) by pd6ml2no-dmz.prod.shaw.ca with ESMTP; 24 Jul 2011 20:12:36 -0600 Received: from store.lan.Awfulhak.org (localhost.localdomain [127.0.0.1]) by localhost (Email Security Appliance) with SMTP id 2AE11C433AB_E2CD114B; Mon, 25 Jul 2011 02:12:36 +0000 (GMT) Received: from gw.Awfulhak.org (gw.lan.Awfulhak.org [172.16.0.1]) by store.lan.Awfulhak.org (Sophos Email Appliance) with ESMTP id 2AFFDC46106_E2CD112F; Mon, 25 Jul 2011 02:12:34 +0000 (GMT) Received: from thong.lan.Awfulhak.org (thong.lan.Awfulhak.org [172.16.0.31]) by gw.Awfulhak.org (8.14.5/8.14.5) with ESMTP id p6P2CY9e035062; Sun, 24 Jul 2011 19:12:34 -0700 (PDT) (envelope-from brian@lan.Awfulhak.org) Received: from thong.lan.Awfulhak.org (localhost [127.0.0.1]) by thong.lan.Awfulhak.org (8.14.5/8.14.5) with ESMTP id p6P2CXYW005777; Sun, 24 Jul 2011 19:12:33 -0700 (PDT) (envelope-from brian@thong.lan.Awfulhak.org) Received: (from brian@localhost) by thong.lan.Awfulhak.org (8.14.5/8.14.5/Submit) id p6P2CXjV005776; Sun, 24 Jul 2011 19:12:33 -0700 (PDT) (envelope-from brian) Date: Sun, 24 Jul 2011 19:12:33 -0700 From: Brian Somers To: Maxim Sobolev Message-ID: <20110725021233.GA2047@thong.lan.Awfulhak.org> References: <201107241803.p6OI32ST018756@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201107241803.p6OI32ST018756@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-stable@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, svn-src-stable-8@FreeBSD.org Subject: Re: svn commit: r224292 - stable/8/sbin/natd X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 02:27:39 -0000 On Sun, Jul 24, 2011 at 06:03:02PM +0000, Maxim Sobolev wrote: > Author: sobomax > Date: Sun Jul 24 18:03:02 2011 > New Revision: 224292 > URL: http://svn.freebsd.org/changeset/base/224292 > > Log: > MFC: 220736, 220806, 220808 > > If we can retrieve interface address sleep for one second and try again. > This can happen during start-up, when natd starts before dhclient has a > chance to receive IP address from the upstream provider. Do this only in > background, dynamic mode. > > Reminded by: brian [.....] Thanks :*) -- Brian Somers Don't _EVER_ lose your sense of humour ! From owner-svn-src-stable@FreeBSD.ORG Mon Jul 25 07:45:22 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 984CF106564A; Mon, 25 Jul 2011 07:45:22 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 865158FC0A; Mon, 25 Jul 2011 07:45:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6P7jM49043715; Mon, 25 Jul 2011 07:45:22 GMT (envelope-from sobomax@svn.freebsd.org) Received: (from sobomax@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6P7jMQX043712; Mon, 25 Jul 2011 07:45:22 GMT (envelope-from sobomax@svn.freebsd.org) Message-Id: <201107250745.p6P7jMQX043712@svn.freebsd.org> From: Maxim Sobolev Date: Mon, 25 Jul 2011 07:45:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224306 - stable/8/usr.sbin/newsyslog X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 07:45:22 -0000 Author: sobomax Date: Mon Jul 25 07:45:22 2011 New Revision: 224306 URL: http://svn.freebsd.org/changeset/base/224306 Log: MFC: Add new modifier - "R", path to executable to run after rotatiion instead of sending signal. Modified: stable/8/usr.sbin/newsyslog/newsyslog.c stable/8/usr.sbin/newsyslog/newsyslog.conf.5 Directory Properties: stable/8/usr.sbin/newsyslog/ (props changed) Modified: stable/8/usr.sbin/newsyslog/newsyslog.c ============================================================================== --- stable/8/usr.sbin/newsyslog/newsyslog.c Mon Jul 25 07:14:59 2011 (r224305) +++ stable/8/usr.sbin/newsyslog/newsyslog.c Mon Jul 25 07:45:22 2011 (r224306) @@ -125,6 +125,7 @@ __FBSDID("$FreeBSD$"); /* process when trimming this file. */ #define CE_CREATE 0x0100 /* Create the log file if it does not exist. */ #define CE_NODUMP 0x0200 /* Set 'nodump' on newly created log file. */ +#define CE_PID2CMD 0x0400 /* Replace PID file with a shell command.*/ #define MIN_PID 5 /* Don't touch pids lower than this */ #define MAX_PID 99999 /* was lower, see /usr/include/sys/proc.h */ @@ -154,7 +155,7 @@ const struct compress_types compress_typ struct conf_entry { STAILQ_ENTRY(conf_entry) cf_nextp; char *log; /* Name of the log */ - char *pid_file; /* PID file */ + char *pid_cmd_file; /* PID or command file */ char *r_reason; /* The reason this file is being rotated */ int firstcreate; /* Creating log for the first time (-C). */ int rotate; /* Non-zero if this file should be rotated */ @@ -178,7 +179,8 @@ struct sigwork_entry { int sw_pidok; /* true if pid value is valid */ pid_t sw_pid; /* the process id from the PID file */ const char *sw_pidtype; /* "daemon" or "process group" */ - char sw_fname[1]; /* file the PID was read from */ + int run_cmd; /* run command or send PID to signal */ + char sw_fname[1]; /* file the PID was read from or shell cmd */ }; struct zipwork_entry { @@ -384,9 +386,9 @@ init_entry(const char *fname, struct con err(1, "strdup for %s", fname); if (src_entry != NULL) { - tempwork->pid_file = NULL; - if (src_entry->pid_file) - tempwork->pid_file = strdup(src_entry->pid_file); + tempwork->pid_cmd_file = NULL; + if (src_entry->pid_cmd_file) + tempwork->pid_cmd_file = strdup(src_entry->pid_cmd_file); tempwork->r_reason = NULL; tempwork->firstcreate = 0; tempwork->rotate = 0; @@ -406,7 +408,7 @@ init_entry(const char *fname, struct con tempwork->def_cfg = src_entry->def_cfg; } else { /* Initialize as a "do-nothing" entry */ - tempwork->pid_file = NULL; + tempwork->pid_cmd_file = NULL; tempwork->r_reason = NULL; tempwork->firstcreate = 0; tempwork->rotate = 0; @@ -441,9 +443,9 @@ free_entry(struct conf_entry *ent) ent->log = NULL; } - if (ent->pid_file != NULL) { - free(ent->pid_file); - ent->pid_file = NULL; + if (ent->pid_cmd_file != NULL) { + free(ent->pid_cmd_file); + ent->pid_cmd_file = NULL; } if (ent->r_reason != NULL) { @@ -1291,6 +1293,9 @@ no_trimat: case 'n': working->flags |= CE_NOSIGNAL; break; + case 'r': + working->flags |= CE_PID2CMD; + break; case 'u': working->flags |= CE_SIGNALGROUP; break; @@ -1324,10 +1329,10 @@ no_trimat: *parse = '\0'; } - working->pid_file = NULL; + working->pid_cmd_file = NULL; if (q && *q) { if (*q == '/') - working->pid_file = strdup(q); + working->pid_cmd_file = strdup(q); else if (isdigit(*q)) goto got_sig; else @@ -1364,16 +1369,16 @@ no_trimat: if ((working->flags & CE_NOSIGNAL) == CE_NOSIGNAL) { /* * This config-entry specified 'n' for nosignal, - * see if it also specified an explicit pid_file. + * see if it also specified an explicit pid_cmd_file. * This would be a pretty pointless combination. */ - if (working->pid_file != NULL) { + if (working->pid_cmd_file != NULL) { warnx("Ignoring '%s' because flag 'n' was specified in line:\n%s", - working->pid_file, errline); - free(working->pid_file); - working->pid_file = NULL; + working->pid_cmd_file, errline); + free(working->pid_cmd_file); + working->pid_cmd_file = NULL; } - } else if (working->pid_file == NULL) { + } else if (working->pid_cmd_file == NULL) { /* * This entry did not specify the 'n' flag, which * means it should signal syslogd unless it had @@ -1388,7 +1393,7 @@ no_trimat: working->flags &= ~CE_SIGNALGROUP; } if (needroot) - working->pid_file = strdup(path_syslogpid); + working->pid_cmd_file = strdup(path_syslogpid); } /* @@ -1795,7 +1800,7 @@ do_rotate(const struct conf_entry *ent) * multiple log files had to be rotated. */ swork = NULL; - if (ent->pid_file != NULL) + if (ent->pid_cmd_file != NULL) swork = save_sigwork(ent); if (ent->numlogs > 0 && ent->compress > COMPRESS_NONE) { /* @@ -1814,6 +1819,7 @@ do_sigwork(struct sigwork_entry *swork) { struct sigwork_entry *nextsig; int kres, secs; + char *tmp; if (!(swork->sw_pidok) || swork->sw_pid == 0) return; /* no work to do... */ @@ -1856,6 +1862,24 @@ do_sigwork(struct sigwork_entry *swork) return; } + if (swork->run_cmd) { + asprintf(&tmp, "%s %d", swork->sw_fname, swork->sw_signum); + if (tmp == NULL) { + warn("can't allocate memory to run %s", + swork->sw_fname); + return; + } + if (verbose) + printf("Run command: %s\n", tmp); + kres = system(tmp); + if (kres) { + warnx("%s: returned non-zero exit code: %d", + tmp, kres); + } + free(tmp); + return; + } + kres = kill(swork->sw_pid, swork->sw_signum); if (kres != 0) { /* @@ -1984,7 +2008,7 @@ save_sigwork(const struct conf_entry *en sprev = NULL; ndiff = 1; SLIST_FOREACH(stmp, &swhead, sw_nextp) { - ndiff = strcmp(ent->pid_file, stmp->sw_fname); + ndiff = strcmp(ent->pid_cmd_file, stmp->sw_fname); if (ndiff > 0) break; if (ndiff == 0) { @@ -2000,11 +2024,18 @@ save_sigwork(const struct conf_entry *en if (stmp != NULL && ndiff == 0) return (stmp); - tmpsiz = sizeof(struct sigwork_entry) + strlen(ent->pid_file) + 1; + tmpsiz = sizeof(struct sigwork_entry) + strlen(ent->pid_cmd_file) + 1; stmp = malloc(tmpsiz); - set_swpid(stmp, ent); + + stmp->run_cmd = 0; + /* If this is a command to run we just set the flag and run command */ + if (ent->flags & CE_PID2CMD) { + stmp->run_cmd = 1; + } else { + set_swpid(stmp, ent); + } stmp->sw_signum = ent->sig; - strcpy(stmp->sw_fname, ent->pid_file); + strcpy(stmp->sw_fname, ent->pid_cmd_file); if (sprev == NULL) SLIST_INSERT_HEAD(&swhead, stmp, sw_nextp); else @@ -2081,7 +2112,7 @@ set_swpid(struct sigwork_entry *swork, c swork->sw_pidtype = "process-group"; } - f = fopen(ent->pid_file, "r"); + f = fopen(ent->pid_cmd_file, "r"); if (f == NULL) { if (errno == ENOENT && enforcepid == 0) { /* @@ -2092,9 +2123,9 @@ set_swpid(struct sigwork_entry *swork, c * files that the process would have been using. */ swork->sw_pidok = 1; - warnx("pid file doesn't exist: %s", ent->pid_file); + warnx("pid file doesn't exist: %s", ent->pid_cmd_file); } else - warn("can't open pid file: %s", ent->pid_file); + warn("can't open pid file: %s", ent->pid_cmd_file); return; } @@ -2107,9 +2138,9 @@ set_swpid(struct sigwork_entry *swork, c */ if (feof(f) && enforcepid == 0) { swork->sw_pidok = 1; - warnx("pid file is empty: %s", ent->pid_file); + warnx("pid/cmd file is empty: %s", ent->pid_cmd_file); } else - warn("can't read from pid file: %s", ent->pid_file); + warn("can't read from pid file: %s", ent->pid_cmd_file); (void)fclose(f); return; } @@ -2122,10 +2153,10 @@ set_swpid(struct sigwork_entry *swork, c rval = strtol(linep, &endp, 10); if (*endp != '\0' && !isspacech(*endp)) { warnx("pid file does not start with a valid number: %s", - ent->pid_file); + ent->pid_cmd_file); } else if (rval < minok || rval > maxok) { warnx("bad value '%ld' for process number in %s", - rval, ent->pid_file); + rval, ent->pid_cmd_file); if (verbose) warnx("\t(expecting value between %ld and %ld)", minok, maxok); Modified: stable/8/usr.sbin/newsyslog/newsyslog.conf.5 ============================================================================== --- stable/8/usr.sbin/newsyslog/newsyslog.conf.5 Mon Jul 25 07:14:59 2011 (r224305) +++ stable/8/usr.sbin/newsyslog/newsyslog.conf.5 Mon Jul 25 07:45:22 2011 (r224306) @@ -301,9 +301,16 @@ log file using .It Cm N indicates that there is no process which needs to be signaled when this log file is rotated. +.It Cm R +if this flag is set the +.Xr newsyslog 8 +will run executable defined in +.Ar path_to_pid_cmd_file +after rotation instead of trying to send signal to a process id +stored in the file. .It Cm U indicates that the file specified by -.Ar path_to_pid_file +.Ar path_to_pid_cmd_file will contain the ID for a process group instead of a process. This option also requires that the first line in that file be a negative value to distinguish it from a process ID. @@ -319,7 +326,7 @@ can be used as a placeholder to create a .Ar flags field when you need to specify any of the following fields. .El -.It Ar path_to_pid_file +.It Ar path_to_pid_cmd_file This optional field specifies the file name containing a daemon's process ID or to find a group process ID if the .Cm U @@ -340,6 +347,12 @@ switch. This field must start with .Ql / in order to be recognized properly. +When used with the +.Cm R +flag, the file is treated as a path to a binary to be executed +by the +.Xr newsyslog 8 +after rotation instead of sending the signal out. .It Ar signal_number This optional field specifies the signal number that will be sent to the daemon process (or to all processes in a process group, if the From owner-svn-src-stable@FreeBSD.ORG Mon Jul 25 13:50:56 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 35BB0106567D; Mon, 25 Jul 2011 13:50:56 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 51BC38FC26; Mon, 25 Jul 2011 13:50:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PDosxc057234; Mon, 25 Jul 2011 13:50:54 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PDosEb057226; Mon, 25 Jul 2011 13:50:54 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201107251350.p6PDosEb057226@svn.freebsd.org> From: Martin Matuska Date: Mon, 25 Jul 2011 13:50:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224308 - in stable/8: contrib/xz contrib/xz/po contrib/xz/src/common contrib/xz/src/liblzma/api/lzma contrib/xz/src/liblzma/common contrib/xz/src/liblzma/delta contrib/xz/src/liblzma/l... X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 13:50:56 -0000 Author: mm Date: Mon Jul 25 13:50:54 2011 New Revision: 224308 URL: http://svn.freebsd.org/changeset/base/224308 Log: MFC r223935: Update xz to git snapshot of v5.0 branch as of 20110711 (post-5.0.3) For architectures with __NO_STRICT_ALIGNMENT define TUKLIB_FAST_UNALIGNED_ACCESS Added: stable/8/contrib/xz/po/fr.po - copied unchanged from r223935, head/contrib/xz/po/fr.po stable/8/contrib/xz/po/pl.po - copied unchanged from r223935, head/contrib/xz/po/pl.po Modified: stable/8/contrib/xz/ChangeLog (contents, props changed) stable/8/contrib/xz/FREEBSD-Xlist (contents, props changed) stable/8/contrib/xz/FREEBSD-upgrade (contents, props changed) stable/8/contrib/xz/THANKS (contents, props changed) stable/8/contrib/xz/po/LINGUAS stable/8/contrib/xz/po/it.po stable/8/contrib/xz/src/common/tuklib_open_stdxxx.c stable/8/contrib/xz/src/liblzma/api/lzma/block.h stable/8/contrib/xz/src/liblzma/api/lzma/container.h stable/8/contrib/xz/src/liblzma/api/lzma/filter.h stable/8/contrib/xz/src/liblzma/api/lzma/version.h stable/8/contrib/xz/src/liblzma/common/alone_decoder.c stable/8/contrib/xz/src/liblzma/common/alone_encoder.c stable/8/contrib/xz/src/liblzma/common/block_buffer_encoder.c stable/8/contrib/xz/src/liblzma/common/block_encoder.c stable/8/contrib/xz/src/liblzma/common/common.c stable/8/contrib/xz/src/liblzma/common/common.h stable/8/contrib/xz/src/liblzma/common/filter_common.c stable/8/contrib/xz/src/liblzma/common/index.c stable/8/contrib/xz/src/liblzma/common/index_decoder.c stable/8/contrib/xz/src/liblzma/common/index_encoder.c stable/8/contrib/xz/src/liblzma/common/stream_buffer_encoder.c stable/8/contrib/xz/src/liblzma/common/stream_encoder.c stable/8/contrib/xz/src/liblzma/delta/delta_encoder.c stable/8/contrib/xz/src/liblzma/lz/lz_decoder.c stable/8/contrib/xz/src/liblzma/lz/lz_encoder.c stable/8/contrib/xz/src/liblzma/lz/lz_encoder_hash.h stable/8/contrib/xz/src/liblzma/lzma/lzma2_decoder.c stable/8/contrib/xz/src/liblzma/lzma/lzma2_encoder.c stable/8/contrib/xz/src/liblzma/simple/arm.c stable/8/contrib/xz/src/liblzma/simple/armthumb.c stable/8/contrib/xz/src/liblzma/simple/ia64.c stable/8/contrib/xz/src/liblzma/simple/powerpc.c stable/8/contrib/xz/src/liblzma/simple/simple_coder.c stable/8/contrib/xz/src/liblzma/simple/sparc.c stable/8/contrib/xz/src/lzmainfo/lzmainfo.c stable/8/contrib/xz/src/xz/coder.c stable/8/contrib/xz/src/xz/file_io.c stable/8/contrib/xz/src/xz/hardware.h stable/8/contrib/xz/src/xz/list.c stable/8/contrib/xz/src/xz/message.c stable/8/contrib/xz/src/xz/message.h stable/8/contrib/xz/src/xz/options.c stable/8/contrib/xz/src/xz/signals.c stable/8/contrib/xz/src/xz/suffix.c stable/8/contrib/xz/src/xz/util.h stable/8/contrib/xz/src/xz/xz.1 stable/8/contrib/xz/src/xzdec/xzdec.c stable/8/lib/liblzma/config.h Directory Properties: stable/8/contrib/xz/ (props changed) stable/8/contrib/xz/AUTHORS (props changed) stable/8/contrib/xz/COPYING (props changed) stable/8/contrib/xz/README (props changed) stable/8/contrib/xz/TODO (props changed) stable/8/contrib/xz/po/ (props changed) stable/8/contrib/xz/src/ (props changed) stable/8/lib/liblzma/ (props changed) Modified: stable/8/contrib/xz/ChangeLog ============================================================================== --- stable/8/contrib/xz/ChangeLog Mon Jul 25 09:12:48 2011 (r224307) +++ stable/8/contrib/xz/ChangeLog Mon Jul 25 13:50:54 2011 (r224308) @@ -1,3 +1,328 @@ +commit edf339227a966f24aebe1845fcca9429b8f6e318 +Author: Anders F Bjorklund +Date: Fri Nov 5 12:56:11 2010 +0100 + + add build script for macosx universal + +commit 7fcc6334ea8923550ba6b5347ff99dc8432234b0 +Author: Lasse Collin +Date: Thu Jun 16 12:15:29 2011 +0300 + + liblzma: Remove unneeded semicolon. + +commit 631f4d3ae6adfda84d1a110781d9402c12e16cfc +Author: Lasse Collin +Date: Sat May 28 16:43:26 2011 +0300 + + Don't call close(-1) in tuklib_open_stdxxx() on error. + + Thanks to Jim Meyering. + +commit c89faf4c9e5970e7f7f8a25521ed9aa62d1a2d9a +Author: Lasse Collin +Date: Sat May 28 09:47:56 2011 +0300 + + Translations: Update Italian translation. + + Thanks to Milo Casagrande. + +commit 6fe2fc9b6ab5bf6848140823e9536370834f42fb +Author: Lasse Collin +Date: Sat May 28 08:46:04 2011 +0300 + + Tests: Add a test file for the bug in the previous commit. + +commit 6c4d4db2bc8d8b682bd927144d37daa2ab21a6d6 +Author: Lasse Collin +Date: Fri May 27 22:25:44 2011 +0300 + + xz: Fix error handling in xz -lvv. + + It could do an invalid free() and read past the end + of the uninitialized filters array. + +commit 844f84fcad9670c543550edf7c7e42630c8f7715 +Author: Lasse Collin +Date: Fri May 27 22:09:49 2011 +0300 + + liblzma: Handle allocation failures correctly in lzma_index_init(). + + Thanks to Jim Meyering. + +commit 240e8b9791df597063a3b68d04ffcb3aa4f2de6a +Author: Lasse Collin +Date: Mon May 23 18:30:30 2011 +0300 + + Build: Set GZIP_ENV=-9n in top-level Makefile.am. + +commit e32cb264ea72a4459810f30abad70dae5a4fa17d +Author: Lasse Collin +Date: Sat May 21 16:59:22 2011 +0300 + + Bump version and soname for 5.0.3. + +commit 65cff45f8fd1c250491557157cce0f5f38481082 +Author: Lasse Collin +Date: Sat May 21 16:56:53 2011 +0300 + + Update NEWS for 5.0.3. + +commit 316c67ffdae1f811ac95e838d5290a013bff4ca7 +Author: Lasse Collin +Date: Sat May 21 16:28:44 2011 +0300 + + Add French translation. + + It is known that the BCJ filter --help text is only + partially translated. + +commit 1931175eea6d09c0845d6e8e334a7333647f11c0 +Author: Lasse Collin +Date: Sat May 21 15:12:10 2011 +0300 + + xz: Translate also the string used to print the program name. + + French needs a space before a colon, e.g. "xz : foo error". + +commit 841dc1f891b48b23f84c0f0e0c86c7c4e4bdcdf5 +Author: Lasse Collin +Date: Tue May 17 12:26:28 2011 +0300 + + Update THANKS. + +commit 0f7e2d36240ebf1159d5fb85d8cd7422337a0d3f +Author: Lasse Collin +Date: Tue May 17 12:21:33 2011 +0300 + + Update INSTALL with a note about linker problem on OpenSolaris x86. + +commit 793d857e01e1725f16fc0c8af8172c91a9e38617 +Author: Lasse Collin +Date: Tue May 17 12:01:37 2011 +0300 + + Build: Fix initialization of enable_check_* variables in configure.ac. + + This doesn't matter much in practice since it is unlikely + that anyone would have such environment variable names. + + Thanks to Wim Lewis. + +commit afcff45cee04c5c7d9c333504046ffb63d1418b5 +Author: Lasse Collin +Date: Tue May 17 11:54:38 2011 +0300 + + Add underscores to attributes (__attribute((__foo__))). + +commit 22159c6ba2300a006f2e46ce85ae132e2d2f7d57 +Author: Lasse Collin +Date: Mon Apr 18 19:35:49 2011 +0300 + + Update THANKS. + +commit 5e3499059515033d1ce44b6fb0fa49183c7ac633 +Author: Martin Väth +Date: Fri Apr 15 04:54:49 2011 -0400 + + xzgrep: fix typo in $0 parsing + + Reported-by: Diego Elio Pettenò + Signed-off-by: Martin Väth + Signed-off-by: Mike Frysinger + +commit 1125611b9b8d4a209b6a73d2c76e1b39c065972a +Author: Lasse Collin +Date: Tue Apr 12 11:59:49 2011 +0300 + + Remove doubled words from documentation and comments. + + Spot candidates by running these commands: + git ls-files |xargs perl -0777 -n \ + -e 'while (/\b(then?|[iao]n|i[fst]|but|f?or|at|and|[dt]o)\s+\1\b/gims)' \ + -e '{$n=($` =~ tr/\n/\n/ + 1); ($v=$&)=~s/\n/\\n/g; print "$ARGV:$n:$v\n"}' + + Thanks to Jim Meyering for the original patch. + +commit 3f8fa53837bae8b44f3addf19923e26401336c3d +Author: Lasse Collin +Date: Mon Apr 11 21:04:13 2011 +0300 + + liblzma: Document lzma_easy_(enc|dec)oder_memusage() better too. + +commit 320d734c20d0776e3eb80f6b5984ddeb494715b5 +Author: Lasse Collin +Date: Mon Apr 11 20:59:07 2011 +0300 + + liblzma: Document lzma_raw_(enc|dec)oder_memusage() better. + + It didn't mention the return value that is used if + an error occurs. + +commit 2ee4edeffc8d9734bf68230df31b20ac6a94c9b5 +Author: Lasse Collin +Date: Mon Apr 11 13:59:50 2011 +0300 + + liblzma: Don't create an empty Block in lzma_stream_buffer_encode(). + + Empty Block was created if the input buffer was empty. + Empty Block wastes a few bytes of space, but more importantly + it triggers a bug in XZ Utils 5.0.1 and older when trying + to decompress such a file. 5.0.1 and older consider such + files to be corrupt. I thought that no encoder creates empty + Blocks when releasing 5.0.2 but I was wrong. + +commit 73f56fb87d54091d0c4fd22d70e6f042902e3b63 +Author: Lasse Collin +Date: Mon Apr 11 13:28:40 2011 +0300 + + liblzma: Fix API docs to mention LZMA_UNSUPPORTED_CHECK. + + This return value was missing from the API comments of + four functions. + +commit 4ce1cf97a88ae1640a380dd19cbc255d729f966b +Author: Lasse Collin +Date: Mon Apr 11 13:21:28 2011 +0300 + + liblzma: Validate encoder arguments better. + + The biggest problem was that the integrity check type + wasn't validated, and e.g. lzma_easy_buffer_encode() + would create a corrupt .xz Stream if given an unsupported + Check ID. Luckily applications don't usually try to use + an unsupport Check ID, so this bug is unlikely to cause + many real-world problems. + +commit 972f05d7a4268dbe42573701f83faa45d03249eb +Author: Lasse Collin +Date: Sat Apr 9 18:29:30 2011 +0300 + + Update THANKS. + +commit 28154eeaf6e3442cd1e174f4e81266d60c4dac60 +Author: Lasse Collin +Date: Sat Apr 9 18:28:58 2011 +0300 + + liblzma: Add missing #ifdefs to filter_common.c. + + Passing --disable-decoders to configure broke a few + encoders due to missing #ifdefs in filter_common.c. + + Thanks to Jason Gorski for the patch. + +commit aa95516d3d509c6b7895ee519004afcf500a0759 +Author: Lasse Collin +Date: Sat Apr 2 14:49:56 2011 +0300 + + liblzma: Fix a memory leak in stream_encoder.c. + + It leaks old filter options structures (hundred bytes or so) + every time the lzma_stream is reinitialized. With the xz tool, + this happens when compressing multiple files. + +commit 58f52c72f49562a08042da9a2f4bbdf4dd162d0c +Author: Lasse Collin +Date: Fri Apr 1 08:47:46 2011 +0300 + + Bumped version and liblzma soname to 5.0.2. + +commit 162779682e01d15f0ce386ef7f40d1be05ad0053 +Author: Lasse Collin +Date: Fri Apr 1 08:47:20 2011 +0300 + + Updated NEWS for 5.0.2. + +commit 45553f9b4b0175c292023010dc41520347004852 +Author: Lasse Collin +Date: Thu Mar 31 15:06:58 2011 +0300 + + Update INSTALL with another note about IRIX. + +commit af9d48d5515eadef689b1ce9ffb91e4dbcbc7f35 +Author: Lasse Collin +Date: Thu Mar 31 12:22:55 2011 +0300 + + Tests: Add a new file to test empty LZMA2 streams. + +commit d099ef9f517b59ab8e3b6f6aa0543c3643983470 +Author: Lasse Collin +Date: Thu Mar 31 11:54:48 2011 +0300 + + liblzma: Fix decoding of LZMA2 streams having no uncompressed data. + + The decoder considered empty LZMA2 streams to be corrupt. + This shouldn't matter much with .xz files, because no encoder + creates empty LZMA2 streams in .xz. This bug is more likely + to cause problems in applications that use raw LZMA2 streams. + +commit df87249b26e79a75fd91041e85512944fc247b57 +Author: Lasse Collin +Date: Thu Mar 24 01:42:49 2011 +0200 + + Scripts: Better fix for xzgrep. + + Now it uses "grep -q". + + Thanks to Gregory Margo. + +commit 68c453e1c7b09dc9c7d2ef9d994c46f5b367f5d3 +Author: Lasse Collin +Date: Thu Mar 24 01:22:18 2011 +0200 + + Updated THANKS. + +commit b441d39855516ae618faffd5156261b8b413394f +Author: Lasse Collin +Date: Thu Mar 24 01:21:32 2011 +0200 + + Scripts: Fix xzgrep -l. + + It didn't work at all. It tried to use the -q option + for grep, but it appended it after "--". This works + around it by redirecting to /dev/null. The downside + is that this can be slower with big files compared + to proper use of "grep -q". + + Thanks to Gregory Margo. + +commit 82d5164839517f55daeadd9ee88c76425db30224 +Author: Lasse Collin +Date: Fri Feb 4 22:49:31 2011 +0200 + + xz: Clean up suffix.c. + + struct suffix_pair isn't needed in compresed_name() + so get rid of it there. + +commit 6decc8b41882c2250f0450eb87b83c9fbf495e95 +Author: Lasse Collin +Date: Fri Feb 4 11:29:47 2011 +0200 + + xz: Check if the file already has custom suffix when compressing. + + Now "xz -S .test foo.test" refuses to compress the + file because it already has the suffix .test. The man + page had it documented this way already. + +commit ecda90061df8d39399e707e5c76c2ec0a0f400e5 +Author: Lasse Collin +Date: Wed Feb 2 23:01:51 2011 +0200 + + Updated THANKS. + +commit 0fda1ae5b1aa0a5c629a09e5228db8ba1cd0dd5f +Author: Lasse Collin +Date: Wed Feb 2 23:00:33 2011 +0200 + + Translations: Add Polish translation. + + Thanks to Jakub Bogusz. + +commit 00be32978fedc5038748438bf685ac1713d1db83 +Author: Lasse Collin +Date: Wed Feb 2 22:24:00 2011 +0200 + + Updated THANKS. + commit 7232fcf96bf4bd5f9cd4fc6c93ca2912c665e004 Author: Lasse Collin Date: Fri Jan 28 20:26:38 2011 +0200 Modified: stable/8/contrib/xz/FREEBSD-Xlist ============================================================================== --- stable/8/contrib/xz/FREEBSD-Xlist Mon Jul 25 09:12:48 2011 (r224307) +++ stable/8/contrib/xz/FREEBSD-Xlist Mon Jul 25 13:50:54 2011 (r224308) @@ -28,6 +28,7 @@ dos/ extra/ lib/ m4/ +macosx/ makefile.am src/*/*.rc src/liblzma/liblzma.pc.in Modified: stable/8/contrib/xz/FREEBSD-upgrade ============================================================================== --- stable/8/contrib/xz/FREEBSD-upgrade Mon Jul 25 09:12:48 2011 (r224307) +++ stable/8/contrib/xz/FREEBSD-upgrade Mon Jul 25 13:50:54 2011 (r224308) @@ -4,7 +4,7 @@ xz The source code is pulled with git: - git clone http://git.tukaani.org/xz.git xz + git clone --branch=v5.0 http://git.tukaani.org/xz.git xz ChangeLog is generated with: @@ -25,4 +25,4 @@ To make local changes to xz, simply patc branch (aka HEAD). Never make local changes on the vendor branch. mm@FreeBSD.org -10-May-2010 +11-July-2011 Modified: stable/8/contrib/xz/THANKS ============================================================================== --- stable/8/contrib/xz/THANKS Mon Jul 25 09:12:48 2011 (r224307) +++ stable/8/contrib/xz/THANKS Mon Jul 25 13:50:54 2011 (r224308) @@ -10,6 +10,9 @@ has been important. :-) In alphabetical - Karl Berry - Anders F. Björklund - Emmanuel Blot + - Martin Blumenstingl + - Jakub Bogusz + - Maarten Bosmans - Trent W. Buck - David Burklund - Daniel Mealha Cabrita @@ -22,6 +25,7 @@ has been important. :-) In alphabetical - Gilles Espinasse - Denis Excoffier - Mike Frysinger + - Jason Gorski - Juan Manuel Guerrero - Joachim Henke - Peter Ivanov @@ -34,7 +38,9 @@ has been important. :-) In alphabetical - Peter Lawler - Hin-Tak Leung - Andraž 'ruskie' Levstik + - Wim Lewis - Lorenzo De Liso + - Gregory Margo - Jim Meyering - RafaÅ‚ MużyÅ‚o - Adrien Nader @@ -43,6 +49,7 @@ has been important. :-) In alphabetical - Andre Noll - Peter O'Gorman - Igor Pavlov + - Diego Elio Pettenò - Elbert Pol - Mikko Pouru - Robert Readman @@ -55,10 +62,12 @@ has been important. :-) In alphabetical - Dan Shechter - Stuart Shelton - Jonathan Stott + - Dan Stromberg - Paul Townsend - Mohammed Adnène Trojette - Alexey Tourbin - Patrick J. Volkerding + - Martin Väth - Christian Weisgerber - Bert Wesarg - Ralf Wildenhues Modified: stable/8/contrib/xz/po/LINGUAS ============================================================================== --- stable/8/contrib/xz/po/LINGUAS Mon Jul 25 09:12:48 2011 (r224307) +++ stable/8/contrib/xz/po/LINGUAS Mon Jul 25 13:50:54 2011 (r224308) @@ -1,3 +1,5 @@ cs de +fr it +pl Copied: stable/8/contrib/xz/po/fr.po (from r223935, head/contrib/xz/po/fr.po) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/contrib/xz/po/fr.po Mon Jul 25 13:50:54 2011 (r224308, copy of r223935, head/contrib/xz/po/fr.po) @@ -0,0 +1,864 @@ +# XZ Utils French Translation +# This file is put in the public domain. +# Adrien Nader , 2011. +# +msgid "" +msgstr "" +"Project-Id-Version: xz-utils\n" +"Report-Msgid-Bugs-To: lasse.collin@tukaani.org\n" +"POT-Creation-Date: 2011-05-21 14:35+0200\n" +"PO-Revision-Date: 2010-09-24 21;12+0200\n" +"Last-Translator: Adrien Nader \n" +"Language-Team: None\n" +"Language: fr\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n==1) ? 0 : 1;\n" + +#: src/xz/args.c:338 +#, c-format +msgid "%s: Unknown file format type" +msgstr "%s : Format de fichier inconnu" + +#: src/xz/args.c:361 src/xz/args.c:369 +#, c-format +msgid "%s: Unsupported integrity check type" +msgstr "%s : Type de vérification d'intégrité inconnu" + +#: src/xz/args.c:396 +msgid "Only one file can be specified with `--files' or `--files0'." +msgstr "Un seul fichier peut être spécifié avec `--files' ou `--files0'." + +#: src/xz/args.c:459 +#, c-format +msgid "The environment variable %s contains too many arguments" +msgstr "La variable d'environnement %s contient trop d'arguments" + +#: src/xz/coder.c:105 +msgid "Maximum number of filters is four" +msgstr "Le nombre maximal de filtres est quatre" + +#: src/xz/coder.c:118 +msgid "Memory usage limit is too low for the given filter setup." +msgstr "La limite d'utilisation mémoire est trop basse pour la configuration de filtres donnée." + +#: src/xz/coder.c:148 +msgid "Using a preset in raw mode is discouraged." +msgstr "Utiliser un préréglage en mode `raw' est déconseillé." + +#: src/xz/coder.c:150 +msgid "The exact options of the presets may vary between software versions." +msgstr "Le détail des préréglages peut varier entre différentes versions du logiciel." + +#: src/xz/coder.c:176 +msgid "The .lzma format supports only the LZMA1 filter" +msgstr "Le format .lzma ne prend en charge que le filtre LZMA1" + +#: src/xz/coder.c:184 +msgid "LZMA1 cannot be used with the .xz format" +msgstr "Le filtre LZMA1 ne peut être utilisé avec le format .xz" + +#: src/xz/coder.c:203 +#, c-format +msgid "Using up to % threads." +msgstr "Jusqu'à % threads seront utilisés." + +#: src/xz/coder.c:216 +msgid "Unsupported filter chain or filter options" +msgstr "Enchaînement ou options de filtres non pris en charge" + +#: src/xz/coder.c:224 +#, c-format +msgid "Decompression will need %s MiB of memory." +msgstr "La décompression nécessitera %s MiB de mémoire." + +#: src/xz/coder.c:259 +#, c-format +msgid "Adjusted the number of threads from %s to %s to not exceed the memory usage limit of %s MiB" +msgstr "Nombre de threads réduit de %s à %s pour ne pas dépasser la limite d'utilisation mémoire de %s MiB" + +#: src/xz/coder.c:313 +#, c-format +msgid "Adjusted LZMA%c dictionary size from %s MiB to %s MiB to not exceed the memory usage limit of %s MiB" +msgstr "Taille du dictionnaire LZMA%c réduite de %s MiB à %s MiB pour ne pas dépasser la limite d'utilisation mémoire de %s MiB" + +#. TRANSLATORS: When compression or decompression finishes, +#. and xz is going to remove the source file, xz first checks +#. if the source file still exists, and if it does, does its +#. device and inode numbers match what xz saw when it opened +#. the source file. If these checks fail, this message is +#. shown, %s being the filename, and the file is not deleted. +#. The check for device and inode numbers is there, because +#. it is possible that the user has put a new file in place +#. of the original file, and in that case it obviously +#. shouldn't be removed. +#: src/xz/file_io.c:136 +#, c-format +msgid "%s: File seems to have been moved, not removing" +msgstr "%s : Le fichier a apparemment été déplacé, suppression annulée" + +#: src/xz/file_io.c:143 src/xz/file_io.c:635 +#, c-format +msgid "%s: Cannot remove: %s" +msgstr "%s : Impossible de supprimer : %s" + +#: src/xz/file_io.c:168 +#, c-format +msgid "%s: Cannot set the file owner: %s" +msgstr "%s : Impossible de modifier le propriétaire du fichier : %s" + +#: src/xz/file_io.c:174 +#, c-format +msgid "%s: Cannot set the file group: %s" +msgstr "%s : Impossible de modifier le groupe propriétaire du fichier : %s" + +#: src/xz/file_io.c:193 +#, c-format +msgid "%s: Cannot set the file permissions: %s" +msgstr "%s : Impossible de modifier les permissions du fichier : %s" + +#: src/xz/file_io.c:340 src/xz/file_io.c:423 +#, c-format +msgid "%s: Is a symbolic link, skipping" +msgstr "%s est un lien symbolique : ignoré" + +#: src/xz/file_io.c:468 +#, c-format +msgid "%s: Is a directory, skipping" +msgstr "%s est un répertoire : ignoré" + +#: src/xz/file_io.c:474 +#, c-format +msgid "%s: Not a regular file, skipping" +msgstr "%s n'est pas un fichier régulier : ignoré" + +#: src/xz/file_io.c:491 +#, c-format +msgid "%s: File has setuid or setgid bit set, skipping" +msgstr "%s : Le fichier possède les bits `setuid' ou `setgid' : ignoré" + +#: src/xz/file_io.c:498 +#, c-format +msgid "%s: File has sticky bit set, skipping" +msgstr "%s : Le fichier possède le bit `sticky' : ignoré" + +#: src/xz/file_io.c:505 +#, c-format +msgid "%s: Input file has more than one hard link, skipping" +msgstr "%s : Le fichier d'entrée a plus d'un lien matériel : ignoré" + +#: src/xz/file_io.c:761 +#, c-format +msgid "Error restoring the O_APPEND flag to standard output: %s" +msgstr "Impossible de rétablir le drapeau O_APPEND sur la sortie standard : %s" + +#: src/xz/file_io.c:773 +#, c-format +msgid "%s: Closing the file failed: %s" +msgstr "%s : Impossible de fermer le fichier : %s" + +#: src/xz/file_io.c:809 src/xz/file_io.c:1008 +#, c-format +msgid "%s: Seeking failed when trying to create a sparse file: %s" +msgstr "%s : Impossible de se déplacer dans le fichier pour créer un 'sparse file' : %s" + +#: src/xz/file_io.c:883 +#, c-format +msgid "%s: Read error: %s" +msgstr "%s : Erreur d'écriture : %s" + +#: src/xz/file_io.c:906 +#, c-format +msgid "%s: Error seeking the file: %s" +msgstr "%s : Impossible de se déplacer dans le fichier : %s" + +#: src/xz/file_io.c:916 +#, c-format +msgid "%s: Unexpected end of file" +msgstr "%s : Fin de fichier inattendue" + +#: src/xz/file_io.c:966 +#, c-format +msgid "%s: Write error: %s" +msgstr "%s : Erreur d'écriture : %s" + +#: src/xz/hardware.c:101 +msgid "Disabled" +msgstr "Désactivé" + +#. TRANSLATORS: Test with "xz --info-memory" to see if +#. the alignment looks nice. +#: src/xz/hardware.c:120 +msgid "Total amount of physical memory (RAM): " +msgstr "Quantité totale de mémoire physique (RAM) : " + +#: src/xz/hardware.c:122 +msgid "Memory usage limit for compression: " +msgstr "Limite d'utilisation pour la compression : " + +#: src/xz/hardware.c:124 +msgid "Memory usage limit for decompression: " +msgstr "Limite d'utilisation pour la décompression : " + +#. TRANSLATORS: Indicates that there is no integrity check. +#. This string is used in tables, so the width must not +#. exceed ten columns with a fixed-width font. +#: src/xz/list.c:62 +msgid "None" +msgstr "Aucune" + +#. TRANSLATORS: Indicates that integrity check name is not known, +#. but the Check ID is known (here 2). This and other "Unknown-N" +#. strings are used in tables, so the width must not exceed ten +#. columns with a fixed-width font. It's OK to omit the dash if +#. you need space for one extra letter, but don't use spaces. +#: src/xz/list.c:69 +msgid "Unknown-2" +msgstr "Inconnue-2" + +#: src/xz/list.c:70 +msgid "Unknown-3" +msgstr "Inconnue-3" + +#: src/xz/list.c:72 +msgid "Unknown-5" +msgstr "Inconnue-5" + +#: src/xz/list.c:73 +msgid "Unknown-6" +msgstr "Inconnue-6" + +#: src/xz/list.c:74 +msgid "Unknown-7" +msgstr "Inconnue-7" + +#: src/xz/list.c:75 +msgid "Unknown-8" +msgstr "Inconnue-8" + +#: src/xz/list.c:76 +msgid "Unknown-9" +msgstr "Inconnue-9" + +#: src/xz/list.c:78 +msgid "Unknown-11" +msgstr "Inconnue-11" + +#: src/xz/list.c:79 +msgid "Unknown-12" +msgstr "Inconnue-12" + +#: src/xz/list.c:80 +msgid "Unknown-13" +msgstr "Inconnue-13" + +#: src/xz/list.c:81 +msgid "Unknown-14" +msgstr "Inconnue-14" + +#: src/xz/list.c:82 +msgid "Unknown-15" +msgstr "Inconnue-15" + +#: src/xz/list.c:126 +#, c-format +msgid "%s: File is empty" +msgstr "%s : Le fichier est vide" + +#: src/xz/list.c:131 +#, c-format +msgid "%s: Too small to be a valid .xz file" +msgstr "%s : Trop petit pour être un fichier xz valide." + +#. TRANSLATORS: These are column headings. From Strms (Streams) +#. to Ratio, the columns are right aligned. Check and Filename +#. are left aligned. If you need longer words, it's OK to +#. use two lines here. Test with "xz -l foo.xz". +#: src/xz/list.c:612 +msgid "Strms Blocks Compressed Uncompressed Ratio Check Filename" +msgstr "Flux Blocs Compressé Décompressé Ratio Vérif Nom de fichier" + +#: src/xz/list.c:652 +#, c-format +msgid " Streams: %s\n" +msgstr " Flux : %s\n" + +#: src/xz/list.c:654 +#, c-format +msgid " Blocks: %s\n" +msgstr " Blocs : %s\n" + +#: src/xz/list.c:656 +#, c-format +msgid " Compressed size: %s\n" +msgstr " Taille compressé : %s\n" + +#: src/xz/list.c:659 +#, c-format +msgid " Uncompressed size: %s\n" +msgstr " Taille décompressé : %s\n" + +#: src/xz/list.c:662 +#, c-format +msgid " Ratio: %s\n" +msgstr " Ratio : %s\n" + +#: src/xz/list.c:664 +#, c-format +msgid " Check: %s\n" +msgstr " Vérification : %s\n" + +#: src/xz/list.c:665 +#, c-format +msgid " Stream padding: %s\n" +msgstr " Octets de rembourrage du flux : %s\n" + +#. TRANSLATORS: The second line is column headings. All except +#. Check are right aligned; Check is left aligned. Test with +#. "xz -lv foo.xz". +#: src/xz/list.c:693 +msgid "" +" Streams:\n" +" Stream Blocks CompOffset UncompOffset CompSize UncompSize Ratio Check Padding" +msgstr "" +" Flux :\n" +" Flux Blocs PositionComp PositionDécomp TailleComp TailleDécomp Ratio Vérif. Bourrage" + +#. TRANSLATORS: The second line is column headings. All +#. except Check are right aligned; Check is left aligned. +#: src/xz/list.c:748 +#, c-format +msgid "" +" Blocks:\n" +" Stream Block CompOffset UncompOffset TotalSize UncompSize Ratio Check" +msgstr "" +" Blocs :\n" +" Flux Bloc PositionComp PositionDécomp TailleTot TailleDécomp Ratio Vérif." + +#. TRANSLATORS: These are additional column headings +#. for the most verbose listing mode. CheckVal +#. (Check value), Flags, and Filters are left aligned. +#. Header (Block Header Size), CompSize, and MemUsage +#. are right aligned. %*s is replaced with 0-120 +#. spaces to make the CheckVal column wide enough. +#. Test with "xz -lvv foo.xz". +#: src/xz/list.c:760 +#, c-format +msgid " CheckVal %*s Header Flags CompSize MemUsage Filters" +msgstr " ValVérif %*sEn-tête Drapeaux TailleComp UtilMém Filtres" + +#: src/xz/list.c:838 src/xz/list.c:1007 +#, c-format +msgid " Memory needed: %s MiB\n" +msgstr " Mémoire nécessaire : %s MiB\n" + +#: src/xz/list.c:840 src/xz/list.c:1009 +#, c-format +msgid " Sizes in headers: %s\n" +msgstr " Tailles stockées dans l'en-tête : %s\n" + +#: src/xz/list.c:841 src/xz/list.c:1010 +msgid "Yes" +msgstr "Oui" + +#: src/xz/list.c:841 src/xz/list.c:1010 +msgid "No" +msgstr "Non" + +#. TRANSLATORS: %s is an integer. Only the plural form of this +#. message is used (e.g. "2 files"). Test with "xz -l foo.xz bar.xz". +#: src/xz/list.c:986 +#, c-format +msgid "%s file\n" +msgid_plural "%s files\n" +msgstr[0] "%s fichier\n" +msgstr[1] "%s fichiers\n" + +#: src/xz/list.c:999 +msgid "Totals:" +msgstr "Totaux :" + +#: src/xz/list.c:1000 +#, c-format +msgid " Number of files: %s\n" +msgstr " Nombre de fichiers : %s\n" + +#: src/xz/list.c:1072 +msgid "--list works only on .xz files (--format=xz or --format=auto)" +msgstr "--list ne marche que sur les fichiers .xz (--format=xz ou --format=auto)" + +#: src/xz/list.c:1078 +msgid "--list does not support reading from standard input" +msgstr "--list est incompatible avec la lecture sur l'entrée standard" + +#: src/xz/main.c:89 +#, c-format +msgid "%s: Error reading filenames: %s" +msgstr "%s : Erreur lors de la lecture des noms de fichiers : %s" + +#: src/xz/main.c:96 +#, c-format +msgid "%s: Unexpected end of input when reading filenames" +msgstr "%s : Fin des données inattendue lors de la lecture des noms de fichiers" + +#: src/xz/main.c:120 +#, c-format +msgid "%s: Null character found when reading filenames; maybe you meant to use `--files0' instead of `--files'?" +msgstr "%s : Caractère NULL détecté lors de la lecture des noms de fichiers ; peut-être pensiez-vous à `--files0' plutot qu'a `--files' ?" + +#: src/xz/main.c:174 +msgid "Compression and decompression with --robot are not supported yet." +msgstr "La compression et la décompression ne marchent pas encore avec --robot." + +#: src/xz/main.c:231 +msgid "Cannot read data from standard input when reading filenames from standard input" +msgstr "Impossible de lire à la fois les données et les noms de fichiers depuis l'entrée standard" + +#. TRANSLATORS: This is the program name in the beginning +#. of the line in messages. Usually it becomes "xz: ". +#. This is a translatable string because French needs +#. a space before a colon. +#: src/xz/message.c:733 +#, c-format +msgid "%s: " +msgstr "%s : " + +#: src/xz/message.c:796 src/xz/message.c:846 +msgid "Internal error (bug)" +msgstr "Erreur interne (bug)" + +#: src/xz/message.c:803 +msgid "Cannot establish signal handlers" +msgstr "Impossible d'installer le gestionnaire de signaux" + +#: src/xz/message.c:812 +msgid "No integrity check; not verifying file integrity" +msgstr "Pas de données de vérification d'intégrité ; vérification non effectuée" + +#: src/xz/message.c:815 +msgid "Unsupported type of integrity check; not verifying file integrity" +msgstr "Méthode de vérification d'intégrité non prise en charge ; vérification non effectuée" + +#: src/xz/message.c:822 +msgid "Memory usage limit reached" +msgstr "Limite d'utilisation mémoire atteinte" + +#: src/xz/message.c:825 +msgid "File format not recognized" +msgstr "Format de fichier inconnu" + +#: src/xz/message.c:828 +msgid "Unsupported options" +msgstr "Options non prises en charge" + +#: src/xz/message.c:831 +msgid "Compressed data is corrupt" +msgstr "Les données compressées sont corrompues" + +#: src/xz/message.c:834 +msgid "Unexpected end of input" +msgstr "Fin des données inattendue " + +#: src/xz/message.c:885 +#, c-format +msgid "%s MiB of memory is required. The limit is %s." +msgstr "%s MiB de mémoire sont nécessaires, la limite étant %s." + +#: src/xz/message.c:1052 +#, c-format +msgid "%s: Filter chain: %s\n" +msgstr "%s : Enchaînement de filtres : %s\n" + +#: src/xz/message.c:1062 +#, c-format +msgid "Try `%s --help' for more information." +msgstr "Utilisez `%s --help' pour plus d'informations." + +#: src/xz/message.c:1088 +#, c-format +msgid "" +"Usage: %s [OPTION]... [FILE]...\n" +"Compress or decompress FILEs in the .xz format.\n" +"\n" +msgstr "" +"Utilisation : %s [OPTION]... [FICHIER]...\n" +"Compresse ou decompresse FICHIER(s) au format .xz.\n" +"\n" + +#: src/xz/message.c:1095 +msgid "Mandatory arguments to long options are mandatory for short options too.\n" +msgstr "" +"Les arguments obligatoires pour les options longues le sont aussi pour les\n" +"options courtes.\n" + +#: src/xz/message.c:1099 +msgid " Operation mode:\n" +msgstr " Mode d'opération :\n" + +#: src/xz/message.c:1102 +msgid "" +" -z, --compress force compression\n" +" -d, --decompress force decompression\n" +" -t, --test test compressed file integrity\n" +" -l, --list list information about .xz files" +msgstr "" +" -z, --compress forcer la compression\n" +" -d, --decompress forcer la décompression\n" +" -t, --test tester l'intégrité du fichier compressé\n" +" -l, --list lister les informations à propos des fichiers .xz" + +#: src/xz/message.c:1108 +msgid "" +"\n" +" Operation modifiers:\n" +msgstr "" +"\n" +" Modifictauers :\n" + +#: src/xz/message.c:1111 +msgid "" +" -k, --keep keep (don't delete) input files\n" +" -f, --force force overwrite of output file and (de)compress links\n" +" -c, --stdout write to standard output and don't delete input files" +msgstr "" +" -k, --keep ne pas supprimer les fichiers d'entrée (\"keep\")\n" +" -f, --force forcer l'écrasement du fichier de sortie et\n" +" (dé)compresser les liens\n" +" -c, --stdout écrire sur la sortie standard et ne pas supprimer les\n" +" fichiers d'entrée" + +#: src/xz/message.c:1117 +msgid "" +" --single-stream decompress only the first stream, and silently\n" +" ignore possible remaining input data" +msgstr "" +" --single-stream décompresser uniquement le premier flux et ignorer\n" +" silenciseusement les données éventuellement restantes" + +#: src/xz/message.c:1120 +msgid "" +" --no-sparse do not create sparse files when decompressing\n" +" -S, --suffix=.SUF use the suffix `.SUF' on compressed files\n" +" --files[=FILE] read filenames to process from FILE; if FILE is\n" +" omitted, filenames are read from the standard input;\n" +" filenames must be terminated with the newline character\n" +" --files0[=FILE] like --files but use the null character as terminator" +msgstr "" +" --no-sparse ne pas créer de 'sparse file' lors de la décompression\n" +" -S, --suffix=.SUF utiliser le suffixe `.SUF' pour les fichiers compressés\n" +" --files[=FILE] lire les fichiers sur lesquels opérer depuis FILE ; si\n" +" FILE est omis, ceux-ci sont lus depuis l'entrée standard\n" +" et doivent être suivis d'un caractère de retour à la ligne\n" +" --files0[=FILE] comme --files mais avec un caractère null comme séparateur" + +#: src/xz/message.c:1129 +msgid "" +"\n" +" Basic file format and compression options:\n" +msgstr "" +"\n" +" Options basiques de format de fichier et de compression :\n" + +#: src/xz/message.c:1131 +msgid "" +" -F, --format=FMT file format to encode or decode; possible values are\n" +" `auto' (default), `xz', `lzma', and `raw'\n" +" -C, --check=CHECK integrity check type: `none' (use with caution),\n" +" `crc32', `crc64' (default), or `sha256'" +msgstr "" +" -F, --format=FMT format de fichier à encoder ou décoder ; les possibilités\n" +" sont : `auto' (par défaut), `xz', `lzma' et `raw'\n" +" -C, --check=CHECK type de vérification d'intégrité : `none' (à utiliser avec\n" +" précaution), `crc32', `crc64' (par défaut) ou `sha256'" + +#: src/xz/message.c:1138 +msgid "" +" -0 ... -9 compression preset; default is 6; take compressor *and*\n" +" decompressor memory usage into account before using 7-9!" +msgstr "" +" -0 ... -9 préréglage de compression ; 6 par défaut ; pensez à\n" *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable@FreeBSD.ORG Mon Jul 25 14:30:45 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3458F106564A; Mon, 25 Jul 2011 14:30:45 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 22C888FC08; Mon, 25 Jul 2011 14:30:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PEUj0n060017; Mon, 25 Jul 2011 14:30:45 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PEUjYM060015; Mon, 25 Jul 2011 14:30:45 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251430.p6PEUjYM060015@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 14:30:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224309 - stable/8/sys/sparc64/include X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 14:30:45 -0000 Author: marius Date: Mon Jul 25 14:30:44 2011 New Revision: 224309 URL: http://svn.freebsd.org/changeset/base/224309 Log: MFC: r216016 Define VM_KMEM_SIZE_MAX on sparc64. Otherwise kernel built with DEBUG_MEMGUARD panics early in kmeminit() with the message "kmem_suballoc: bad status return of 1" because of zero "size" argument passed to kmem_suballoc() due to "vm_kmem_size_max" being zero. The problem also exists on ia64. Modified: stable/8/sys/sparc64/include/vmparam.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/geom/label/ (props changed) Modified: stable/8/sys/sparc64/include/vmparam.h ============================================================================== --- stable/8/sys/sparc64/include/vmparam.h Mon Jul 25 13:50:54 2011 (r224308) +++ stable/8/sys/sparc64/include/vmparam.h Mon Jul 25 14:30:44 2011 (r224309) @@ -226,6 +226,14 @@ #endif /* + * Ceiling on amount of kmem_map kva space. + */ +#ifndef VM_KMEM_SIZE_MAX +#define VM_KMEM_SIZE_MAX ((VM_MAX_KERNEL_ADDRESS - \ + VM_MIN_KERNEL_ADDRESS + 1) * 3 / 5) +#endif + +/* * Initial pagein size of beginning of executable file. */ #ifndef VM_INITIAL_PAGEIN From owner-svn-src-stable@FreeBSD.ORG Mon Jul 25 14:33:37 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 663DF1065673; Mon, 25 Jul 2011 14:33:37 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 54F898FC19; Mon, 25 Jul 2011 14:33:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PEXbBK060287; Mon, 25 Jul 2011 14:33:37 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PEXbh0060285; Mon, 25 Jul 2011 14:33:37 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251433.p6PEXbh0060285@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 14:33:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224310 - stable/7/sys/sparc64/include X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 14:33:37 -0000 Author: marius Date: Mon Jul 25 14:33:37 2011 New Revision: 224310 URL: http://svn.freebsd.org/changeset/base/224310 Log: MFC: r216016 Define VM_KMEM_SIZE_MAX on sparc64. Otherwise kernel built with DEBUG_MEMGUARD panics early in kmeminit() with the message "kmem_suballoc: bad status return of 1" because of zero "size" argument passed to kmem_suballoc() due to "vm_kmem_size_max" being zero. The problem also exists on ia64. Modified: stable/7/sys/sparc64/include/vmparam.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/sparc64/include/vmparam.h ============================================================================== --- stable/7/sys/sparc64/include/vmparam.h Mon Jul 25 14:30:44 2011 (r224309) +++ stable/7/sys/sparc64/include/vmparam.h Mon Jul 25 14:33:37 2011 (r224310) @@ -230,6 +230,14 @@ #endif /* + * Ceiling on amount of kmem_map kva space. + */ +#ifndef VM_KMEM_SIZE_MAX +#define VM_KMEM_SIZE_MAX ((VM_MAX_KERNEL_ADDRESS - \ + VM_MIN_KERNEL_ADDRESS + 1) * 3 / 5) +#endif + +/* * Initial pagein size of beginning of executable file. */ #ifndef VM_INITIAL_PAGEIN From owner-svn-src-stable@FreeBSD.ORG Mon Jul 25 14:34:31 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0704B106566B; Mon, 25 Jul 2011 14:34:31 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E9A418FC13; Mon, 25 Jul 2011 14:34:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PEYUif060395; Mon, 25 Jul 2011 14:34:30 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PEYUYv060393; Mon, 25 Jul 2011 14:34:30 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251434.p6PEYUYv060393@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 14:34:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224311 - stable/7/sys/sparc64/sparc64 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 14:34:31 -0000 Author: marius Date: Mon Jul 25 14:34:30 2011 New Revision: 224311 URL: http://svn.freebsd.org/changeset/base/224311 Log: MFC: r219782 On Serengeti-class machines the OFW root isn't the parent of the CPU nodes. Modified: stable/7/sys/sparc64/sparc64/tick.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/sparc64/sparc64/tick.c ============================================================================== --- stable/7/sys/sparc64/sparc64/tick.c Mon Jul 25 14:33:37 2011 (r224310) +++ stable/7/sys/sparc64/sparc64/tick.c Mon Jul 25 14:34:30 2011 (r224311) @@ -118,8 +118,8 @@ cpu_initclocks(void) sclock = 0; if (PCPU_GET(impl) == CPU_IMPL_SPARC64V || PCPU_GET(impl) >= CPU_IMPL_ULTRASPARCIII) { - if (OF_getprop(OF_parent(PCPU_GET(node)), "stick-frequency", - &sclock, sizeof(sclock)) == -1) { + if (OF_getprop(OF_peer(0), "stick-frequency", &sclock, + sizeof(sclock)) == -1) { panic("%s: could not determine STICK frequency", __func__); } From owner-svn-src-stable@FreeBSD.ORG Mon Jul 25 14:39:23 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 51E94106566C; Mon, 25 Jul 2011 14:39:23 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 26F638FC17; Mon, 25 Jul 2011 14:39:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PEdNrV060580; Mon, 25 Jul 2011 14:39:23 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PEdNIV060578; Mon, 25 Jul 2011 14:39:23 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251439.p6PEdNIV060578@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 14:39:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224312 - stable/8/sys/sparc64/sparc64 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 14:39:23 -0000 Author: marius Date: Mon Jul 25 14:39:22 2011 New Revision: 224312 URL: http://svn.freebsd.org/changeset/base/224312 Log: MFC: r220931 - Use the streaming cache unless BUS_DMA_COHERENT is specified. Since r220375 (MFC'ed to stable/8 in r221191) all drivers enabled in the sparc64 GENERIC should be either correctly using bus_dmamap_sync(9) calls or supply BUS_DMA_COHERENT when appropriate or as a workaround for missing bus_dmamap_sync(9) calls (sound(4) drivers and partially sym(4)). In at least some configurations taking advantage of the streaming cache results in a modest performance improvement. - Remove the memory barrier for BUS_DMASYNC_PREREAD which as the comment already suggested is bogus. - Add my copyright for having implemented several things like support for the Fire and Oberon IOMMUs, taking over PROM IOMMU mappings etc. Modified: stable/8/sys/sparc64/sparc64/iommu.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/geom/label/ (props changed) Modified: stable/8/sys/sparc64/sparc64/iommu.c ============================================================================== --- stable/8/sys/sparc64/sparc64/iommu.c Mon Jul 25 14:34:30 2011 (r224311) +++ stable/8/sys/sparc64/sparc64/iommu.c Mon Jul 25 14:39:22 2011 (r224312) @@ -28,6 +28,7 @@ /*- * Copyright (c) 1999-2002 Eduardo Horvath * Copyright (c) 2001-2003 Thomas Moestl + * Copyright (c) 2007, 2009 Marius Strobl * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -77,7 +78,6 @@ __FBSDID("$FreeBSD$"); * - When running out of DVMA space, return EINPROGRESS in the non- * BUS_DMA_NOWAIT case and delay the callback until sufficient space * becomes available. - * - Use the streaming cache unless BUS_DMA_COHERENT is specified. */ #include "opt_iommu.h" @@ -564,17 +564,8 @@ static __inline int iommu_use_streaming(struct iommu_state *is, bus_dmamap_t map, bus_size_t size) { - /* - * This cannot be enabled yet, as many driver are still missing - * bus_dmamap_sync() calls. As soon as there is a BUS_DMA_STREAMING - * flag, this should be reenabled conditionally on it. - */ -#ifdef notyet return (size >= IOMMU_STREAM_THRESH && IOMMU_HAS_SB(is) && (map->dm_flags & DMF_COHERENT) == 0); -#else - return (0); -#endif } /* @@ -1182,9 +1173,6 @@ iommu_dvmamap_sync(bus_dma_tag_t dt, bus if ((map->dm_flags & DMF_LOADED) == 0) return; - /* XXX This is probably bogus. */ - if ((op & BUS_DMASYNC_PREREAD) != 0) - membar(Sync); if ((map->dm_flags & DMF_STREAMED) != 0 && ((op & BUS_DMASYNC_POSTREAD) != 0 || (op & BUS_DMASYNC_PREWRITE) != 0)) { From owner-svn-src-stable@FreeBSD.ORG Mon Jul 25 14:42:34 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8751A106566B; Mon, 25 Jul 2011 14:42:34 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 75D2B8FC13; Mon, 25 Jul 2011 14:42:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PEgYkn060720; Mon, 25 Jul 2011 14:42:34 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PEgYNn060718; Mon, 25 Jul 2011 14:42:34 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251442.p6PEgYNn060718@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 14:42:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224313 - stable/8/sys/sparc64/include X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 14:42:34 -0000 Author: marius Date: Mon Jul 25 14:42:34 2011 New Revision: 224313 URL: http://svn.freebsd.org/changeset/base/224313 Log: MFC: r221750 Add an ATOMIC_CLEAR_LONG. Modified: stable/8/sys/sparc64/include/asmacros.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/geom/label/ (props changed) Modified: stable/8/sys/sparc64/include/asmacros.h ============================================================================== --- stable/8/sys/sparc64/include/asmacros.h Mon Jul 25 14:39:22 2011 (r224312) +++ stable/8/sys/sparc64/include/asmacros.h Mon Jul 25 14:42:34 2011 (r224313) @@ -90,6 +90,17 @@ bne,pn %icc, 9b ; \ mov r3, r2 +/* + * Atomically clear a number of bits of an u_long in memory. + */ +#define ATOMIC_CLEAR_LONG(r1, r2, r3, bits) \ + ldx [r1], r2 ; \ +9: andn r2, bits, r3 ; \ + casxa [r1] ASI_N, r2, r3 ; \ + cmp r2, r3 ; \ + bne,pn %icc, 9b ; \ + mov r3, r2 + #define PCPU(member) PCPU_REG + PC_ ## member #define PCPU_ADDR(member, reg) \ add PCPU_REG, PC_ ## member, reg From owner-svn-src-stable@FreeBSD.ORG Mon Jul 25 14:43:52 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4EB0B1065673; Mon, 25 Jul 2011 14:43:52 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 38D728FC17; Mon, 25 Jul 2011 14:43:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PEhqEX060823; Mon, 25 Jul 2011 14:43:52 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PEhqJl060814; Mon, 25 Jul 2011 14:43:52 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251443.p6PEhqJl060814@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 14:43:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224314 - stable/8/sys/dev/mii X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 14:43:52 -0000 Author: marius Date: Mon Jul 25 14:43:51 2011 New Revision: 224314 URL: http://svn.freebsd.org/changeset/base/224314 Log: MFC: r220938 Correct spelling in comments. Submitted by: brucec Modified: stable/8/sys/dev/mii/brgphyreg.h stable/8/sys/dev/mii/ciphyreg.h stable/8/sys/dev/mii/e1000phy.c stable/8/sys/dev/mii/e1000phyreg.h stable/8/sys/dev/mii/mii_physubr.c stable/8/sys/dev/mii/miivar.h stable/8/sys/dev/mii/rgephyreg.h stable/8/sys/dev/mii/xmphyreg.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/geom/label/ (props changed) Modified: stable/8/sys/dev/mii/brgphyreg.h ============================================================================== --- stable/8/sys/dev/mii/brgphyreg.h Mon Jul 25 14:42:34 2011 (r224313) +++ stable/8/sys/dev/mii/brgphyreg.h Mon Jul 25 14:43:51 2011 (r224314) @@ -59,7 +59,7 @@ #define BRGPHY_BMSR_EXTSTS 0x0100 /* Extended status present */ #define BRGPHY_BMSR_PRESUB 0x0040 /* Preamble surpression */ #define BRGPHY_BMSR_ACOMP 0x0020 /* Autoneg complete */ -#define BRGPHY_BMSR_RFAULT 0x0010 /* Remote fault condition occured */ +#define BRGPHY_BMSR_RFAULT 0x0010 /* Remote fault condition occurred */ #define BRGPHY_BMSR_ANEG 0x0008 /* Autoneg capable */ #define BRGPHY_BMSR_LINK 0x0004 /* Link status */ #define BRGPHY_BMSR_JABBER 0x0002 /* Jabber detected */ Modified: stable/8/sys/dev/mii/ciphyreg.h ============================================================================== --- stable/8/sys/dev/mii/ciphyreg.h Mon Jul 25 14:42:34 2011 (r224313) +++ stable/8/sys/dev/mii/ciphyreg.h Mon Jul 25 14:43:51 2011 (r224314) @@ -68,7 +68,7 @@ #define CIPHY_BMSR_EXTSTS 0x0100 /* Extended status present */ #define CIPHY_BMSR_PRESUB 0x0040 /* Preamble surpression */ #define CIPHY_BMSR_ACOMP 0x0020 /* Autoneg complete */ -#define CIPHY_BMSR_RFAULT 0x0010 /* Remote fault condition occured */ +#define CIPHY_BMSR_RFAULT 0x0010 /* Remote fault condition occurred */ #define CIPHY_BMSR_ANEG 0x0008 /* Autoneg capable */ #define CIPHY_BMSR_LINK 0x0004 /* Link status */ #define CIPHY_BMSR_JABBER 0x0002 /* Jabber detected */ @@ -170,7 +170,7 @@ /* Vendor-specific PHY registers */ -/* 100baseTX status extention register */ +/* 100baseTX status extension register */ #define CIPHY_MII_100STS 0x10 #define CIPHY_100STS_DESLCK 0x8000 /* descrambler locked */ #define CIPHY_100STS_LKCERR 0x4000 /* lock error detected/lock lost */ @@ -181,7 +181,7 @@ #define CIPHY_100STS_SSDERR 0x0200 /* false carrier error detected */ #define CIPHY_100STS_ESDERR 0x0100 /* premature end of stream error */ -/* 1000BT status extention register #2 */ +/* 1000BT status extension register #2 */ #define CIPHY_MII_1000STS2 0x11 #define CIPHY_1000STS2_DESLCK 0x8000 /* descrambler locked */ #define CIPHY_1000STS2_LKCERR 0x4000 /* lock error detected/lock lost */ @@ -191,7 +191,7 @@ #define CIPHY_1000STS2_TXERR 0x0400 /* transmit error detected */ #define CIPHY_1000STS2_SSDERR 0x0200 /* false carrier error detected */ #define CIPHY_1000STS2_ESDERR 0x0100 /* premature end of stream error */ -#define CIPHY_1000STS2_CARREXT 0x0080 /* carrier extention err detected */ +#define CIPHY_1000STS2_CARREXT 0x0080 /* carrier extension err detected */ #define CIPHY_1000STS2_BCM5400 0x0040 /* non-complient BCM5400 detected */ /* Bypass control register */ @@ -332,7 +332,7 @@ #define CIPHY_LED_LINKACTBLINK 0x0004 /* enable link/activity LED blink */ #define CIPHY_LED_BLINKRATE 0x0002 /* blink rate 0=10hz, 1=5hz */ -/* Auxilliary control and status register */ +/* Auxiliary control and status register */ #define CIPHY_MII_AUXCSR 0x1C #define CIPHY_AUXCSR_ANEGDONE 0x8000 /* Autoneg complete */ #define CIPHY_AUXCSR_ANEGOFF 0x4000 /* Autoneg disabled */ Modified: stable/8/sys/dev/mii/e1000phy.c ============================================================================== --- stable/8/sys/dev/mii/e1000phy.c Mon Jul 25 14:42:34 2011 (r224313) +++ stable/8/sys/dev/mii/e1000phy.c Mon Jul 25 14:43:51 2011 (r224314) @@ -25,7 +25,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * Additonal Copyright (c) 2001 by Traakan Software under same licence. + * Additional Copyright (c) 2001 by Traakan Software under same licence. * Secondary Author: Matthew Jacob */ Modified: stable/8/sys/dev/mii/e1000phyreg.h ============================================================================== --- stable/8/sys/dev/mii/e1000phyreg.h Mon Jul 25 14:42:34 2011 (r224313) +++ stable/8/sys/dev/mii/e1000phyreg.h Mon Jul 25 14:43:51 2011 (r224314) @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * Additonal Copyright (c) 2001 by Traakan Software under same licence. + * Additional Copyright (c) 2001 by Traakan Software under same licence. * Secondary Author: Matthew Jacob */ Modified: stable/8/sys/dev/mii/mii_physubr.c ============================================================================== --- stable/8/sys/dev/mii/mii_physubr.c Mon Jul 25 14:42:34 2011 (r224313) +++ stable/8/sys/dev/mii/mii_physubr.c Mon Jul 25 14:43:51 2011 (r224314) @@ -109,7 +109,7 @@ mii_phy_setmedia(struct mii_softc *sc) /* * Force renegotiation if MIIF_DOPAUSE or MIIF_FORCEANEG. * The former is necessary as we might switch from flow- - * control advertisment being off to on or vice versa. + * control advertisement being off to on or vice versa. */ if ((PHY_READ(sc, MII_BMCR) & BMCR_AUTOEN) == 0 || (sc->mii_flags & (MIIF_DOPAUSE | MIIF_FORCEANEG)) != 0) Modified: stable/8/sys/dev/mii/miivar.h ============================================================================== --- stable/8/sys/dev/mii/miivar.h Mon Jul 25 14:42:34 2011 (r224313) +++ stable/8/sys/dev/mii/miivar.h Mon Jul 25 14:43:51 2011 (r224314) @@ -134,7 +134,7 @@ typedef struct mii_softc mii_softc_t; #define MIIF_IS_HPNA 0x00000200 /* is a HomePNA device */ #define MIIF_FORCEANEG 0x00000400 /* force auto-negotiation */ #define MIIF_NOMANPAUSE 0x00100000 /* no manual PAUSE selection */ -#define MIIF_FORCEPAUSE 0x00200000 /* force PAUSE advertisment */ +#define MIIF_FORCEPAUSE 0x00200000 /* force PAUSE advertisement */ #define MIIF_MACPRIV0 0x01000000 /* private to the MAC driver */ #define MIIF_MACPRIV1 0x02000000 /* private to the MAC driver */ #define MIIF_MACPRIV2 0x04000000 /* private to the MAC driver */ Modified: stable/8/sys/dev/mii/rgephyreg.h ============================================================================== --- stable/8/sys/dev/mii/rgephyreg.h Mon Jul 25 14:42:34 2011 (r224313) +++ stable/8/sys/dev/mii/rgephyreg.h Mon Jul 25 14:43:51 2011 (r224314) @@ -66,7 +66,7 @@ #define RGEPHY_BMSR_EXTSTS 0x0100 /* Extended status present */ #define RGEPHY_BMSR_PRESUB 0x0040 /* Preamble surpression */ #define RGEPHY_BMSR_ACOMP 0x0020 /* Autoneg complete */ -#define RGEPHY_BMSR_RFAULT 0x0010 /* Remote fault condition occured */ +#define RGEPHY_BMSR_RFAULT 0x0010 /* Remote fault condition occurred */ #define RGEPHY_BMSR_ANEG 0x0008 /* Autoneg capable */ #define RGEPHY_BMSR_LINK 0x0004 /* Link status */ #define RGEPHY_BMSR_JABBER 0x0002 /* Jabber detected */ Modified: stable/8/sys/dev/mii/xmphyreg.h ============================================================================== --- stable/8/sys/dev/mii/xmphyreg.h Mon Jul 25 14:42:34 2011 (r224313) +++ stable/8/sys/dev/mii/xmphyreg.h Mon Jul 25 14:43:51 2011 (r224314) @@ -51,7 +51,7 @@ #define XMPHY_MII_BMSR 0x01 #define XMPHY_BMSR_EXTSTS 0x0100 /* Extended status present */ #define XMPHY_BMSR_ACOMP 0x0020 /* Autoneg complete */ -#define XMPHY_BMSR_RFAULT 0x0010 /* Remote fault condition occured */ +#define XMPHY_BMSR_RFAULT 0x0010 /* Remote fault condition occurred */ #define XMPHY_BMSR_ANEG 0x0008 /* Autoneg capable */ #define XMPHY_BMSR_LINK 0x0004 /* Link status */ #define XMPHY_BMSR_EXT 0x0001 /* Extended capability */ From owner-svn-src-stable@FreeBSD.ORG Mon Jul 25 14:44:01 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3E8B6106566B; Mon, 25 Jul 2011 14:44:01 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2CB618FC12; Mon, 25 Jul 2011 14:44:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PEi1eH060874; Mon, 25 Jul 2011 14:44:01 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PEi0XM060865; Mon, 25 Jul 2011 14:44:00 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251444.p6PEi0XM060865@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 14:44:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224315 - stable/7/sys/dev/mii X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 14:44:01 -0000 Author: marius Date: Mon Jul 25 14:44:00 2011 New Revision: 224315 URL: http://svn.freebsd.org/changeset/base/224315 Log: MFC: r220938 Correct spelling in comments. Submitted by: brucec Modified: stable/7/sys/dev/mii/brgphyreg.h stable/7/sys/dev/mii/ciphyreg.h stable/7/sys/dev/mii/e1000phy.c stable/7/sys/dev/mii/e1000phyreg.h stable/7/sys/dev/mii/mii_physubr.c stable/7/sys/dev/mii/miivar.h stable/7/sys/dev/mii/rgephyreg.h stable/7/sys/dev/mii/xmphyreg.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/mii/brgphyreg.h ============================================================================== --- stable/7/sys/dev/mii/brgphyreg.h Mon Jul 25 14:43:51 2011 (r224314) +++ stable/7/sys/dev/mii/brgphyreg.h Mon Jul 25 14:44:00 2011 (r224315) @@ -59,7 +59,7 @@ #define BRGPHY_BMSR_EXTSTS 0x0100 /* Extended status present */ #define BRGPHY_BMSR_PRESUB 0x0040 /* Preamble surpression */ #define BRGPHY_BMSR_ACOMP 0x0020 /* Autoneg complete */ -#define BRGPHY_BMSR_RFAULT 0x0010 /* Remote fault condition occured */ +#define BRGPHY_BMSR_RFAULT 0x0010 /* Remote fault condition occurred */ #define BRGPHY_BMSR_ANEG 0x0008 /* Autoneg capable */ #define BRGPHY_BMSR_LINK 0x0004 /* Link status */ #define BRGPHY_BMSR_JABBER 0x0002 /* Jabber detected */ Modified: stable/7/sys/dev/mii/ciphyreg.h ============================================================================== --- stable/7/sys/dev/mii/ciphyreg.h Mon Jul 25 14:43:51 2011 (r224314) +++ stable/7/sys/dev/mii/ciphyreg.h Mon Jul 25 14:44:00 2011 (r224315) @@ -68,7 +68,7 @@ #define CIPHY_BMSR_EXTSTS 0x0100 /* Extended status present */ #define CIPHY_BMSR_PRESUB 0x0040 /* Preamble surpression */ #define CIPHY_BMSR_ACOMP 0x0020 /* Autoneg complete */ -#define CIPHY_BMSR_RFAULT 0x0010 /* Remote fault condition occured */ +#define CIPHY_BMSR_RFAULT 0x0010 /* Remote fault condition occurred */ #define CIPHY_BMSR_ANEG 0x0008 /* Autoneg capable */ #define CIPHY_BMSR_LINK 0x0004 /* Link status */ #define CIPHY_BMSR_JABBER 0x0002 /* Jabber detected */ @@ -170,7 +170,7 @@ /* Vendor-specific PHY registers */ -/* 100baseTX status extention register */ +/* 100baseTX status extension register */ #define CIPHY_MII_100STS 0x10 #define CIPHY_100STS_DESLCK 0x8000 /* descrambler locked */ #define CIPHY_100STS_LKCERR 0x4000 /* lock error detected/lock lost */ @@ -181,7 +181,7 @@ #define CIPHY_100STS_SSDERR 0x0200 /* false carrier error detected */ #define CIPHY_100STS_ESDERR 0x0100 /* premature end of stream error */ -/* 1000BT status extention register #2 */ +/* 1000BT status extension register #2 */ #define CIPHY_MII_1000STS2 0x11 #define CIPHY_1000STS2_DESLCK 0x8000 /* descrambler locked */ #define CIPHY_1000STS2_LKCERR 0x4000 /* lock error detected/lock lost */ @@ -191,7 +191,7 @@ #define CIPHY_1000STS2_TXERR 0x0400 /* transmit error detected */ #define CIPHY_1000STS2_SSDERR 0x0200 /* false carrier error detected */ #define CIPHY_1000STS2_ESDERR 0x0100 /* premature end of stream error */ -#define CIPHY_1000STS2_CARREXT 0x0080 /* carrier extention err detected */ +#define CIPHY_1000STS2_CARREXT 0x0080 /* carrier extension err detected */ #define CIPHY_1000STS2_BCM5400 0x0040 /* non-complient BCM5400 detected */ /* Bypass control register */ @@ -332,7 +332,7 @@ #define CIPHY_LED_LINKACTBLINK 0x0004 /* enable link/activity LED blink */ #define CIPHY_LED_BLINKRATE 0x0002 /* blink rate 0=10hz, 1=5hz */ -/* Auxilliary control and status register */ +/* Auxiliary control and status register */ #define CIPHY_MII_AUXCSR 0x1C #define CIPHY_AUXCSR_ANEGDONE 0x8000 /* Autoneg complete */ #define CIPHY_AUXCSR_ANEGOFF 0x4000 /* Autoneg disabled */ Modified: stable/7/sys/dev/mii/e1000phy.c ============================================================================== --- stable/7/sys/dev/mii/e1000phy.c Mon Jul 25 14:43:51 2011 (r224314) +++ stable/7/sys/dev/mii/e1000phy.c Mon Jul 25 14:44:00 2011 (r224315) @@ -25,7 +25,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * Additonal Copyright (c) 2001 by Traakan Software under same licence. + * Additional Copyright (c) 2001 by Traakan Software under same licence. * Secondary Author: Matthew Jacob */ Modified: stable/7/sys/dev/mii/e1000phyreg.h ============================================================================== --- stable/7/sys/dev/mii/e1000phyreg.h Mon Jul 25 14:43:51 2011 (r224314) +++ stable/7/sys/dev/mii/e1000phyreg.h Mon Jul 25 14:44:00 2011 (r224315) @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * Additonal Copyright (c) 2001 by Traakan Software under same licence. + * Additional Copyright (c) 2001 by Traakan Software under same licence. * Secondary Author: Matthew Jacob */ Modified: stable/7/sys/dev/mii/mii_physubr.c ============================================================================== --- stable/7/sys/dev/mii/mii_physubr.c Mon Jul 25 14:43:51 2011 (r224314) +++ stable/7/sys/dev/mii/mii_physubr.c Mon Jul 25 14:44:00 2011 (r224315) @@ -109,7 +109,7 @@ mii_phy_setmedia(struct mii_softc *sc) /* * Force renegotiation if MIIF_DOPAUSE or MIIF_FORCEANEG. * The former is necessary as we might switch from flow- - * control advertisment being off to on or vice versa. + * control advertisement being off to on or vice versa. */ if ((PHY_READ(sc, MII_BMCR) & BMCR_AUTOEN) == 0 || (sc->mii_flags & (MIIF_DOPAUSE | MIIF_FORCEANEG)) != 0) Modified: stable/7/sys/dev/mii/miivar.h ============================================================================== --- stable/7/sys/dev/mii/miivar.h Mon Jul 25 14:43:51 2011 (r224314) +++ stable/7/sys/dev/mii/miivar.h Mon Jul 25 14:44:00 2011 (r224315) @@ -134,7 +134,7 @@ typedef struct mii_softc mii_softc_t; #define MIIF_IS_HPNA 0x00000200 /* is a HomePNA device */ #define MIIF_FORCEANEG 0x00000400 /* force auto-negotiation */ #define MIIF_NOMANPAUSE 0x00100000 /* no manual PAUSE selection */ -#define MIIF_FORCEPAUSE 0x00200000 /* force PAUSE advertisment */ +#define MIIF_FORCEPAUSE 0x00200000 /* force PAUSE advertisement */ #define MIIF_MACPRIV0 0x01000000 /* private to the MAC driver */ #define MIIF_MACPRIV1 0x02000000 /* private to the MAC driver */ #define MIIF_MACPRIV2 0x04000000 /* private to the MAC driver */ Modified: stable/7/sys/dev/mii/rgephyreg.h ============================================================================== --- stable/7/sys/dev/mii/rgephyreg.h Mon Jul 25 14:43:51 2011 (r224314) +++ stable/7/sys/dev/mii/rgephyreg.h Mon Jul 25 14:44:00 2011 (r224315) @@ -66,7 +66,7 @@ #define RGEPHY_BMSR_EXTSTS 0x0100 /* Extended status present */ #define RGEPHY_BMSR_PRESUB 0x0040 /* Preamble surpression */ #define RGEPHY_BMSR_ACOMP 0x0020 /* Autoneg complete */ -#define RGEPHY_BMSR_RFAULT 0x0010 /* Remote fault condition occured */ +#define RGEPHY_BMSR_RFAULT 0x0010 /* Remote fault condition occurred */ #define RGEPHY_BMSR_ANEG 0x0008 /* Autoneg capable */ #define RGEPHY_BMSR_LINK 0x0004 /* Link status */ #define RGEPHY_BMSR_JABBER 0x0002 /* Jabber detected */ Modified: stable/7/sys/dev/mii/xmphyreg.h ============================================================================== --- stable/7/sys/dev/mii/xmphyreg.h Mon Jul 25 14:43:51 2011 (r224314) +++ stable/7/sys/dev/mii/xmphyreg.h Mon Jul 25 14:44:00 2011 (r224315) @@ -51,7 +51,7 @@ #define XMPHY_MII_BMSR 0x01 #define XMPHY_BMSR_EXTSTS 0x0100 /* Extended status present */ #define XMPHY_BMSR_ACOMP 0x0020 /* Autoneg complete */ -#define XMPHY_BMSR_RFAULT 0x0010 /* Remote fault condition occured */ +#define XMPHY_BMSR_RFAULT 0x0010 /* Remote fault condition occurred */ #define XMPHY_BMSR_ANEG 0x0008 /* Autoneg capable */ #define XMPHY_BMSR_LINK 0x0004 /* Link status */ #define XMPHY_BMSR_EXT 0x0001 /* Extended capability */ From owner-svn-src-stable@FreeBSD.ORG Mon Jul 25 14:45:14 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0A26D1065670; Mon, 25 Jul 2011 14:45:14 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EC0078FC0C; Mon, 25 Jul 2011 14:45:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PEjD40061000; Mon, 25 Jul 2011 14:45:13 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PEjDC4060993; Mon, 25 Jul 2011 14:45:13 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251445.p6PEjDC4060993@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 14:45:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224316 - in stable/7/sys/sparc64: include sbus sparc64 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 14:45:14 -0000 Author: marius Date: Mon Jul 25 14:45:13 2011 New Revision: 224316 URL: http://svn.freebsd.org/changeset/base/224316 Log: MFC: r220939 Correct spelling in comments. Submitted by: brucec Modified: stable/7/sys/sparc64/include/cpufunc.h stable/7/sys/sparc64/sbus/lsi64854.c stable/7/sys/sparc64/sbus/ofw_sbus.h stable/7/sys/sparc64/sparc64/exception.S stable/7/sys/sparc64/sparc64/machdep.c stable/7/sys/sparc64/sparc64/pmap.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/sparc64/include/cpufunc.h ============================================================================== --- stable/7/sys/sparc64/include/cpufunc.h Mon Jul 25 14:44:00 2011 (r224315) +++ stable/7/sys/sparc64/include/cpufunc.h Mon Jul 25 14:45:13 2011 (r224316) @@ -187,7 +187,7 @@ int fasword32(u_long asi, void *addr, ui /* * Macro intended to be used instead of wr(asr23, val, xorval) for writing to * the TICK_COMPARE register in order to avoid a bug in BlackBird CPUs that - * can cause these writes to fail under certain condidtions which in turn + * can cause these writes to fail under certain conditions which in turn * causes the hardclock to stop. The workaround is to read the TICK_COMPARE * register back immediately after writing to it with these two instructions * aligned to a quadword boundary in order to ensure that I$ misses won't Modified: stable/7/sys/sparc64/sbus/lsi64854.c ============================================================================== --- stable/7/sys/sparc64/sbus/lsi64854.c Mon Jul 25 14:44:00 2011 (r224315) +++ stable/7/sys/sparc64/sbus/lsi64854.c Mon Jul 25 14:45:13 2011 (r224316) @@ -528,7 +528,7 @@ lsi64854_scsi_intr(void *arg) } trans = sc->sc_dmasize - resid; - if (trans < 0) { /* transfered < 0? */ + if (trans < 0) { /* transferred < 0? */ #if 0 /* * This situation can happen in perfectly normal operation @@ -718,7 +718,7 @@ lsi64854_pp_intr(void *arg) sc->sc_active = 0; trans = sc->sc_dmasize - resid; - if (trans < 0) /* transfered < 0? */ + if (trans < 0) /* transferred < 0? */ trans = sc->sc_dmasize; *sc->sc_dmalen -= trans; *sc->sc_dmaaddr += trans; Modified: stable/7/sys/sparc64/sbus/ofw_sbus.h ============================================================================== --- stable/7/sys/sparc64/sbus/ofw_sbus.h Mon Jul 25 14:44:00 2011 (r224315) +++ stable/7/sys/sparc64/sbus/ofw_sbus.h Mon Jul 25 14:45:13 2011 (r224316) @@ -41,7 +41,7 @@ struct sbus_regs { u_int32_t sbr_size; }; -/* Address translation accross busses */ +/* Address translation across busses */ struct sbus_ranges { u_int32_t cspace; /* Client space */ u_int32_t coffset; /* Client offset */ Modified: stable/7/sys/sparc64/sparc64/exception.S ============================================================================== --- stable/7/sys/sparc64/sparc64/exception.S Mon Jul 25 14:44:00 2011 (r224315) +++ stable/7/sys/sparc64/sparc64/exception.S Mon Jul 25 14:45:13 2011 (r224316) @@ -377,7 +377,7 @@ END(rsf_fatal) * Due to its size a trap table is an inherently hard thing to represent in * code in a clean way. There are approximately 1024 vectors, of 8 or 32 * instructions each, many of which are identical. The way that this is - * layed out is the instructions (8 or 32) for the actual trap vector appear + * laid out is the instructions (8 or 32) for the actual trap vector appear * as an AS macro. In general this code branches to tl0_trap or tl1_trap, * but if not supporting code can be placed just after the definition of the * macro. The macros are then instantiated in a different section (.trap), @@ -2405,7 +2405,7 @@ ENTRY(tl0_ret) * Check for pending asts atomically with returning. We must raise * the PIL before checking, and if no asts are found the PIL must * remain raised until the retry is executed, or we risk missing asts - * caused by interrupts occuring after the test. If the PIL is + * caused by interrupts occurring after the test. If the PIL is * lowered, as it is when we call ast, the check must be re-executed. */ wrpr %g0, PIL_TICK, %pil Modified: stable/7/sys/sparc64/sparc64/machdep.c ============================================================================== --- stable/7/sys/sparc64/sparc64/machdep.c Mon Jul 25 14:44:00 2011 (r224315) +++ stable/7/sys/sparc64/sparc64/machdep.c Mon Jul 25 14:45:13 2011 (r224316) @@ -557,7 +557,7 @@ sparc64_init(caddr_t mdp, u_long o1, u_l * is necessary in order to set obp-control-relinquished to true * within the PROM so obtaining /virtual-memory/translations doesn't * trigger a fatal reset error or worse things further down the road. - * XXX it should be possible to use this soley instead of writing + * XXX it should be possible to use this solely instead of writing * %tba in cpu_setregs(). Doing so causes a hang however. */ sun4u_set_traptable(tl0_base); Modified: stable/7/sys/sparc64/sparc64/pmap.c ============================================================================== --- stable/7/sys/sparc64/sparc64/pmap.c Mon Jul 25 14:44:00 2011 (r224315) +++ stable/7/sys/sparc64/sparc64/pmap.c Mon Jul 25 14:45:13 2011 (r224316) @@ -930,7 +930,7 @@ pmap_kenter(vm_offset_t va, vm_page_t m) /* * Map a wired page into kernel virtual address space. This additionally - * takes a flag argument wich is or'ed to the TTE data. This is used by + * takes a flag argument which is or'ed to the TTE data. This is used by * sparc64_bus_mem_map(). * NOTE: if the mapping is non-cacheable, it's the caller's responsibility * to flush entries that might still be in the cache, if applicable. From owner-svn-src-stable@FreeBSD.ORG Mon Jul 25 14:45:18 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 315981065676; Mon, 25 Jul 2011 14:45:18 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1F3C38FC1C; Mon, 25 Jul 2011 14:45:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PEjIra061035; Mon, 25 Jul 2011 14:45:18 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PEjHZj061028; Mon, 25 Jul 2011 14:45:17 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251445.p6PEjHZj061028@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 14:45:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224317 - in stable/8/sys/sparc64: include sbus sparc64 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 14:45:18 -0000 Author: marius Date: Mon Jul 25 14:45:17 2011 New Revision: 224317 URL: http://svn.freebsd.org/changeset/base/224317 Log: MFC: r220939 Correct spelling in comments. Submitted by: brucec Modified: stable/8/sys/sparc64/include/cpufunc.h stable/8/sys/sparc64/sbus/lsi64854.c stable/8/sys/sparc64/sbus/ofw_sbus.h stable/8/sys/sparc64/sparc64/exception.S stable/8/sys/sparc64/sparc64/machdep.c stable/8/sys/sparc64/sparc64/pmap.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/geom/label/ (props changed) Modified: stable/8/sys/sparc64/include/cpufunc.h ============================================================================== --- stable/8/sys/sparc64/include/cpufunc.h Mon Jul 25 14:45:13 2011 (r224316) +++ stable/8/sys/sparc64/include/cpufunc.h Mon Jul 25 14:45:17 2011 (r224317) @@ -187,7 +187,7 @@ int fasword32(u_long asi, void *addr, ui /* * Macro intended to be used instead of wr(asr23, val, xorval) for writing to * the TICK_COMPARE register in order to avoid a bug in BlackBird CPUs that - * can cause these writes to fail under certain condidtions which in turn + * can cause these writes to fail under certain conditions which in turn * causes the hardclock to stop. The workaround is to read the TICK_COMPARE * register back immediately after writing to it with these two instructions * aligned to a quadword boundary in order to ensure that I$ misses won't Modified: stable/8/sys/sparc64/sbus/lsi64854.c ============================================================================== --- stable/8/sys/sparc64/sbus/lsi64854.c Mon Jul 25 14:45:13 2011 (r224316) +++ stable/8/sys/sparc64/sbus/lsi64854.c Mon Jul 25 14:45:17 2011 (r224317) @@ -521,7 +521,7 @@ lsi64854_scsi_intr(void *arg) } trans = sc->sc_dmasize - resid; - if (trans < 0) { /* transfered < 0? */ + if (trans < 0) { /* transferred < 0? */ #if 0 /* * This situation can happen in perfectly normal operation @@ -711,7 +711,7 @@ lsi64854_pp_intr(void *arg) sc->sc_active = 0; trans = sc->sc_dmasize - resid; - if (trans < 0) /* transfered < 0? */ + if (trans < 0) /* transferred < 0? */ trans = sc->sc_dmasize; *sc->sc_dmalen -= trans; *sc->sc_dmaaddr += trans; Modified: stable/8/sys/sparc64/sbus/ofw_sbus.h ============================================================================== --- stable/8/sys/sparc64/sbus/ofw_sbus.h Mon Jul 25 14:45:13 2011 (r224316) +++ stable/8/sys/sparc64/sbus/ofw_sbus.h Mon Jul 25 14:45:17 2011 (r224317) @@ -41,7 +41,7 @@ struct sbus_regs { u_int32_t sbr_size; }; -/* Address translation accross busses */ +/* Address translation across busses */ struct sbus_ranges { u_int32_t cspace; /* Client space */ u_int32_t coffset; /* Client offset */ Modified: stable/8/sys/sparc64/sparc64/exception.S ============================================================================== --- stable/8/sys/sparc64/sparc64/exception.S Mon Jul 25 14:45:13 2011 (r224316) +++ stable/8/sys/sparc64/sparc64/exception.S Mon Jul 25 14:45:17 2011 (r224317) @@ -381,7 +381,7 @@ END(rsf_fatal) * Due to its size a trap table is an inherently hard thing to represent in * code in a clean way. There are approximately 1024 vectors, of 8 or 32 * instructions each, many of which are identical. The way that this is - * layed out is the instructions (8 or 32) for the actual trap vector appear + * laid out is the instructions (8 or 32) for the actual trap vector appear * as an AS macro. In general this code branches to tl0_trap or tl1_trap, * but if not supporting code can be placed just after the definition of the * macro. The macros are then instantiated in a different section (.trap), @@ -2486,7 +2486,7 @@ ENTRY(tl0_ret) * Check for pending asts atomically with returning. We must raise * the PIL before checking, and if no asts are found the PIL must * remain raised until the retry is executed, or we risk missing asts - * caused by interrupts occuring after the test. If the PIL is + * caused by interrupts occurring after the test. If the PIL is * lowered, as it is when we call ast, the check must be re-executed. */ wrpr %g0, PIL_TICK, %pil Modified: stable/8/sys/sparc64/sparc64/machdep.c ============================================================================== --- stable/8/sys/sparc64/sparc64/machdep.c Mon Jul 25 14:45:13 2011 (r224316) +++ stable/8/sys/sparc64/sparc64/machdep.c Mon Jul 25 14:45:17 2011 (r224317) @@ -565,7 +565,7 @@ sparc64_init(caddr_t mdp, u_long o1, u_l * is necessary in order to set obp-control-relinquished to true * within the PROM so obtaining /virtual-memory/translations doesn't * trigger a fatal reset error or worse things further down the road. - * XXX it should be possible to use this soley instead of writing + * XXX it should be possible to use this solely instead of writing * %tba in cpu_setregs(). Doing so causes a hang however. */ sun4u_set_traptable(tl0_base); Modified: stable/8/sys/sparc64/sparc64/pmap.c ============================================================================== --- stable/8/sys/sparc64/sparc64/pmap.c Mon Jul 25 14:45:13 2011 (r224316) +++ stable/8/sys/sparc64/sparc64/pmap.c Mon Jul 25 14:45:17 2011 (r224317) @@ -1058,7 +1058,7 @@ pmap_kenter(vm_offset_t va, vm_page_t m) /* * Map a wired page into kernel virtual address space. This additionally - * takes a flag argument wich is or'ed to the TTE data. This is used by + * takes a flag argument which is or'ed to the TTE data. This is used by * sparc64_bus_mem_map(). * NOTE: if the mapping is non-cacheable, it's the caller's responsibility * to flush entries that might still be in the cache, if applicable. From owner-svn-src-stable@FreeBSD.ORG Mon Jul 25 14:46:25 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 55ACC1065673; Mon, 25 Jul 2011 14:46:25 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2AC5B8FC1E; Mon, 25 Jul 2011 14:46:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PEkPKb061161; Mon, 25 Jul 2011 14:46:25 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PEkPuO061158; Mon, 25 Jul 2011 14:46:25 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251446.p6PEkPuO061158@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 14:46:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224318 - stable/8/sys/dev/hme X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 14:46:25 -0000 Author: marius Date: Mon Jul 25 14:46:24 2011 New Revision: 224318 URL: http://svn.freebsd.org/changeset/base/224318 Log: MFC: r220940 Correct spelling in comments. Submitted by: brucec Modified: stable/8/sys/dev/hme/if_hme.c stable/8/sys/dev/hme/if_hmereg.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/geom/label/ (props changed) Modified: stable/8/sys/dev/hme/if_hme.c ============================================================================== --- stable/8/sys/dev/hme/if_hme.c Mon Jul 25 14:45:17 2011 (r224317) +++ stable/8/sys/dev/hme/if_hme.c Mon Jul 25 14:46:24 2011 (r224318) @@ -203,7 +203,7 @@ hme_config(struct hme_softc *sc) * the DMA bus tag: * sc_dmatag * - * the bus handles, tags and offsets (splitted for SBus compatability): + * the bus handles, tags and offsets (splitted for SBus compatibility): * sc_seb{t,h,o} (Shared Ethernet Block registers) * sc_erx{t,h,o} (Receiver Unit registers) * sc_etx{t,h,o} (Transmitter Unit registers) @@ -1559,7 +1559,7 @@ hme_mediachange_locked(struct hme_softc * If both PHYs are present reset them. This is required for * unisolating the previously isolated PHY when switching PHYs. * As the above hme_mifinit() call will set the MII drivers in - * the XIF configuration register accoring to the currently + * the XIF configuration register according to the currently * selected media, there should be no window during which the * data paths of both transceivers are open at the same time, * even if the PHY device drivers use MIIF_NOISOLATE. Modified: stable/8/sys/dev/hme/if_hmereg.h ============================================================================== --- stable/8/sys/dev/hme/if_hmereg.h Mon Jul 25 14:45:17 2011 (r224317) +++ stable/8/sys/dev/hme/if_hmereg.h Mon Jul 25 14:46:24 2011 (r224318) @@ -79,7 +79,7 @@ #define HME_SEB_STAT_TXEACK 0x04000000 /* error during tx DMA */ #define HME_SEB_STAT_TXLERR 0x08000000 /* late error during tx DMA */ #define HME_SEB_STAT_TXPERR 0x10000000 /* parity error during tx DMA */ -#define HME_SEB_STAT_TXTERR 0x20000000 /* tag error durig tx DMA */ +#define HME_SEB_STAT_TXTERR 0x20000000 /* tag error during tx DMA */ #define HME_SEB_STAT_SLVERR 0x40000000 /* pio access error */ #define HME_SEB_STAT_SLVPERR 0x80000000 /* pio access parity error */ #define HME_SEB_STAT_BITS "\177\020" \ From owner-svn-src-stable@FreeBSD.ORG Mon Jul 25 14:46:25 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 762B8106564A; Mon, 25 Jul 2011 14:46:25 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4B72A8FC1F; Mon, 25 Jul 2011 14:46:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PEkPdW061166; Mon, 25 Jul 2011 14:46:25 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PEkPkp061163; Mon, 25 Jul 2011 14:46:25 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251446.p6PEkPkp061163@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 14:46:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224319 - stable/7/sys/dev/hme X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 14:46:25 -0000 Author: marius Date: Mon Jul 25 14:46:24 2011 New Revision: 224319 URL: http://svn.freebsd.org/changeset/base/224319 Log: MFC: r220940 Correct spelling in comments. Submitted by: brucec Modified: stable/7/sys/dev/hme/if_hme.c stable/7/sys/dev/hme/if_hmereg.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/hme/if_hme.c ============================================================================== --- stable/7/sys/dev/hme/if_hme.c Mon Jul 25 14:46:24 2011 (r224318) +++ stable/7/sys/dev/hme/if_hme.c Mon Jul 25 14:46:24 2011 (r224319) @@ -203,7 +203,7 @@ hme_config(struct hme_softc *sc) * the DMA bus tag: * sc_dmatag * - * the bus handles, tags and offsets (splitted for SBus compatability): + * the bus handles, tags and offsets (splitted for SBus compatibility): * sc_seb{t,h,o} (Shared Ethernet Block registers) * sc_erx{t,h,o} (Receiver Unit registers) * sc_etx{t,h,o} (Transmitter Unit registers) @@ -1559,7 +1559,7 @@ hme_mediachange_locked(struct hme_softc * If both PHYs are present reset them. This is required for * unisolating the previously isolated PHY when switching PHYs. * As the above hme_mifinit() call will set the MII drivers in - * the XIF configuration register accoring to the currently + * the XIF configuration register according to the currently * selected media, there should be no window during which the * data paths of both transceivers are open at the same time, * even if the PHY device drivers use MIIF_NOISOLATE. Modified: stable/7/sys/dev/hme/if_hmereg.h ============================================================================== --- stable/7/sys/dev/hme/if_hmereg.h Mon Jul 25 14:46:24 2011 (r224318) +++ stable/7/sys/dev/hme/if_hmereg.h Mon Jul 25 14:46:24 2011 (r224319) @@ -79,7 +79,7 @@ #define HME_SEB_STAT_TXEACK 0x04000000 /* error during tx DMA */ #define HME_SEB_STAT_TXLERR 0x08000000 /* late error during tx DMA */ #define HME_SEB_STAT_TXPERR 0x10000000 /* parity error during tx DMA */ -#define HME_SEB_STAT_TXTERR 0x20000000 /* tag error durig tx DMA */ +#define HME_SEB_STAT_TXTERR 0x20000000 /* tag error during tx DMA */ #define HME_SEB_STAT_SLVERR 0x40000000 /* pio access error */ #define HME_SEB_STAT_SLVPERR 0x80000000 /* pio access parity error */ #define HME_SEB_STAT_BITS "\177\020" \ From owner-svn-src-stable@FreeBSD.ORG Mon Jul 25 15:01:38 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 30E39106566C; Mon, 25 Jul 2011 15:01:38 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1F7068FC1A; Mon, 25 Jul 2011 15:01:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PF1cVc061731; Mon, 25 Jul 2011 15:01:38 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PF1c0D061729; Mon, 25 Jul 2011 15:01:38 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251501.p6PF1c0D061729@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 15:01:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224320 - stable/8/sys/dev/gem X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 15:01:38 -0000 Author: marius Date: Mon Jul 25 15:01:37 2011 New Revision: 224320 URL: http://svn.freebsd.org/changeset/base/224320 Log: MFC: r220941 Correct spelling in comments. Submitted by: brucec Modified: stable/8/sys/dev/gem/if_gem.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/geom/label/ (props changed) Modified: stable/8/sys/dev/gem/if_gem.c ============================================================================== --- stable/8/sys/dev/gem/if_gem.c Mon Jul 25 14:46:24 2011 (r224319) +++ stable/8/sys/dev/gem/if_gem.c Mon Jul 25 15:01:37 2011 (r224320) @@ -1069,7 +1069,7 @@ gem_init_locked(struct gem_softc *sc) /* step 14. Issue Transmit Pending command. */ - /* step 15. Give the reciever a swift kick. */ + /* step 15. Give the receiver a swift kick. */ GEM_BANK1_WRITE_4(sc, GEM_RX_KICK, GEM_NRXDESC - 4); ifp->if_drv_flags |= IFF_DRV_RUNNING; From owner-svn-src-stable@FreeBSD.ORG Mon Jul 25 15:01:40 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7C86F106564A; Mon, 25 Jul 2011 15:01:40 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6B3B78FC0A; Mon, 25 Jul 2011 15:01:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PF1ewf061766; Mon, 25 Jul 2011 15:01:40 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PF1eqf061764; Mon, 25 Jul 2011 15:01:40 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251501.p6PF1eqf061764@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 15:01:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224321 - stable/7/sys/dev/gem X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 15:01:40 -0000 Author: marius Date: Mon Jul 25 15:01:40 2011 New Revision: 224321 URL: http://svn.freebsd.org/changeset/base/224321 Log: MFC: r220941 Correct spelling in comments. Submitted by: brucec Modified: stable/7/sys/dev/gem/if_gem.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/gem/if_gem.c ============================================================================== --- stable/7/sys/dev/gem/if_gem.c Mon Jul 25 15:01:37 2011 (r224320) +++ stable/7/sys/dev/gem/if_gem.c Mon Jul 25 15:01:40 2011 (r224321) @@ -1069,7 +1069,7 @@ gem_init_locked(struct gem_softc *sc) /* step 14. Issue Transmit Pending command. */ - /* step 15. Give the reciever a swift kick. */ + /* step 15. Give the receiver a swift kick. */ GEM_BANK1_WRITE_4(sc, GEM_RX_KICK, GEM_NRXDESC - 4); ifp->if_drv_flags |= IFF_DRV_RUNNING; From owner-svn-src-stable@FreeBSD.ORG Mon Jul 25 15:05:37 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A51D7106564A; Mon, 25 Jul 2011 15:05:37 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 93B208FC1E; Mon, 25 Jul 2011 15:05:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PF5bHB061988; Mon, 25 Jul 2011 15:05:37 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PF5bv4061986; Mon, 25 Jul 2011 15:05:37 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251505.p6PF5bv4061986@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 15:05:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224322 - stable/7/sys/dev/cas X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 15:05:37 -0000 Author: marius Date: Mon Jul 25 15:05:37 2011 New Revision: 224322 URL: http://svn.freebsd.org/changeset/base/224322 Log: MFC: r220943 Correct spelling in a comment. Submitted by: brucec Modified: stable/7/sys/dev/cas/if_cas.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/cas/if_cas.c ============================================================================== --- stable/7/sys/dev/cas/if_cas.c Mon Jul 25 15:01:40 2011 (r224321) +++ stable/7/sys/dev/cas/if_cas.c Mon Jul 25 15:05:37 2011 (r224322) @@ -1153,7 +1153,7 @@ cas_init_locked(struct cas_softc *sc) /* step 14. Issue Transmit Pending command. */ - /* step 15. Give the reciever a swift kick. */ + /* step 15. Give the receiver a swift kick. */ CAS_WRITE_4(sc, CAS_RX_KICK, CAS_NRXDESC - 4); CAS_WRITE_4(sc, CAS_RX_COMP_TAIL, 0); if ((sc->sc_flags & CAS_REG_PLUS) != 0) From owner-svn-src-stable@FreeBSD.ORG Mon Jul 25 15:05:38 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 099A01065676; Mon, 25 Jul 2011 15:05:38 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ECB908FC1F; Mon, 25 Jul 2011 15:05:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PF5bbW062003; Mon, 25 Jul 2011 15:05:37 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PF5b53062001; Mon, 25 Jul 2011 15:05:37 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251505.p6PF5b53062001@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 15:05:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224323 - stable/8/sys/dev/cas X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 15:05:38 -0000 Author: marius Date: Mon Jul 25 15:05:37 2011 New Revision: 224323 URL: http://svn.freebsd.org/changeset/base/224323 Log: MFC: r220943 Correct spelling in a comment. Submitted by: brucec Modified: stable/8/sys/dev/cas/if_cas.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/geom/label/ (props changed) Modified: stable/8/sys/dev/cas/if_cas.c ============================================================================== --- stable/8/sys/dev/cas/if_cas.c Mon Jul 25 15:05:37 2011 (r224322) +++ stable/8/sys/dev/cas/if_cas.c Mon Jul 25 15:05:37 2011 (r224323) @@ -1153,7 +1153,7 @@ cas_init_locked(struct cas_softc *sc) /* step 14. Issue Transmit Pending command. */ - /* step 15. Give the reciever a swift kick. */ + /* step 15. Give the receiver a swift kick. */ CAS_WRITE_4(sc, CAS_RX_KICK, CAS_NRXDESC - 4); CAS_WRITE_4(sc, CAS_RX_COMP_TAIL, 0); if ((sc->sc_flags & CAS_REG_PLUS) != 0) From owner-svn-src-stable@FreeBSD.ORG Mon Jul 25 15:10:53 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5DB4A106566C; Mon, 25 Jul 2011 15:10:53 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4BB378FC1A; Mon, 25 Jul 2011 15:10:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PFArMr062276; Mon, 25 Jul 2011 15:10:53 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PFArYG062271; Mon, 25 Jul 2011 15:10:53 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251510.p6PFArYG062271@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 15:10:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224324 - stable/8/sys/dev/sym X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 15:10:53 -0000 Author: marius Date: Mon Jul 25 15:10:52 2011 New Revision: 224324 URL: http://svn.freebsd.org/changeset/base/224324 Log: MFC: r220944, r220950 - Correct spelling. [1] - Remove variables which are unused besides initialization. [2] Submitted by: brucec, N.J. Mann [1], Christoph Mallon [2] Modified: stable/8/sys/dev/sym/README.sym stable/8/sys/dev/sym/sym_fw1.h stable/8/sys/dev/sym/sym_fw2.h stable/8/sys/dev/sym/sym_hipd.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/geom/label/ (props changed) Modified: stable/8/sys/dev/sym/README.sym ============================================================================== --- stable/8/sys/dev/sym/README.sym Mon Jul 25 15:05:37 2011 (r224323) +++ stable/8/sys/dev/sym/README.sym Mon Jul 25 15:10:52 2011 (r224324) @@ -70,7 +70,7 @@ using `man sym' for driver usage and fea I haven't removed this README file from the repository since I may have to provide additional documentation to people interested in understanding the driver sources and/or in helping -driver development and maintainance. +driver development and maintenance. As a result, this file is now under reconstruction. :-) Modified: stable/8/sys/dev/sym/sym_fw1.h ============================================================================== --- stable/8/sys/dev/sym/sym_fw1.h Mon Jul 25 15:05:37 2011 (r224323) +++ stable/8/sys/dev/sym/sym_fw1.h Mon Jul 25 15:10:52 2011 (r224324) @@ -1027,7 +1027,7 @@ static const struct SYM_FWA_SCR SYM_FWA_ * It shall be a tagged command. * Read SIMPLE+TAG. * The C code will deal with errors. - * Agressive optimization, is'nt it? :) + * Aggressive optimization, isn't it? :) */ SCR_MOVE_ABS (2) ^ SCR_MSG_IN, HADDR_1 (msgin), @@ -1051,7 +1051,7 @@ static const struct SYM_FWA_SCR SYM_FWA_ RADDR_1 (dsa), /* * The SIDL still contains the TAG value. - * Agressive optimization, isn't it? :):) + * Aggressive optimization, isn't it? :):) */ SCR_REG_SFBR (sidl, SCR_SHL, 0), 0, @@ -1352,7 +1352,7 @@ static const struct SYM_FWB_SCR SYM_FWB_ * some target to reset or some disconnected * job to abort. Since error recovery is a serious * busyness, we will really reset the SCSI BUS, if - * case of a SCSI interrupt occuring in this path. + * case of a SCSI interrupt occurring in this path. */ /* @@ -1461,7 +1461,7 @@ static const struct SYM_FWB_SCR SYM_FWB_ PADDR_B (msg_weird_seen), /* * We donnot handle extended messages from SCRIPTS. - * Read the amount of data correponding to the + * Read the amount of data corresponding to the * message length and call the C code. */ SCR_COPY (1), Modified: stable/8/sys/dev/sym/sym_fw2.h ============================================================================== --- stable/8/sys/dev/sym/sym_fw2.h Mon Jul 25 15:05:37 2011 (r224323) +++ stable/8/sys/dev/sym/sym_fw2.h Mon Jul 25 15:10:52 2011 (r224324) @@ -945,7 +945,7 @@ static const struct SYM_FWA_SCR SYM_FWA_ * It shall be a tagged command. * Read SIMPLE+TAG. * The C code will deal with errors. - * Agressive optimization, is'nt it? :) + * Aggressive optimization, isn't it? :) */ SCR_MOVE_ABS (2) ^ SCR_MSG_IN, HADDR_1 (msgin), @@ -957,7 +957,7 @@ static const struct SYM_FWA_SCR SYM_FWA_ offsetof(struct sym_lcb, head.itlq_tbl_sa), /* * The SIDL still contains the TAG value. - * Agressive optimization, isn't it? :):) + * Aggressive optimization, isn't it? :):) */ SCR_REG_SFBR (sidl, SCR_SHL, 0), 0, @@ -1213,7 +1213,7 @@ static const struct SYM_FWB_SCR SYM_FWB_ * some target to reset or some disconnected * job to abort. Since error recovery is a serious * busyness, we will really reset the SCSI BUS, if - * case of a SCSI interrupt occuring in this path. + * case of a SCSI interrupt occurring in this path. */ /* @@ -1320,7 +1320,7 @@ static const struct SYM_FWB_SCR SYM_FWB_ PADDR_B (msg_weird_seen), /* * We donnot handle extended messages from SCRIPTS. - * Read the amount of data correponding to the + * Read the amount of data corresponding to the * message length and call the C code. */ SCR_STORE_REL (scratcha, 1), Modified: stable/8/sys/dev/sym/sym_hipd.c ============================================================================== --- stable/8/sys/dev/sym/sym_hipd.c Mon Jul 25 15:05:37 2011 (r224323) +++ stable/8/sys/dev/sym/sym_hipd.c Mon Jul 25 15:10:52 2011 (r224324) @@ -366,7 +366,7 @@ static void MDELAY(int ms) { while (ms-- * from the SCRIPTS code. In addition, cache line alignment * is guaranteed for power of 2 cache line size. * - * This allocator has been developped for the Linux sym53c8xx + * This allocator has been developed for the Linux sym53c8xx * driver, since this O/S does not provide naturally aligned * allocations. * It has the advantage of allowing the driver to use private @@ -1959,10 +1959,8 @@ static void sym_fw1_setup(hcb_p np, const struct sym_fw *fw) { struct sym_fw1a_scr *scripta0; - struct sym_fw1b_scr *scriptb0; scripta0 = (struct sym_fw1a_scr *) np->scripta0; - scriptb0 = (struct sym_fw1b_scr *) np->scriptb0; /* * Fill variable parts in scripts. @@ -1983,10 +1981,8 @@ static void sym_fw2_setup(hcb_p np, const struct sym_fw *fw) { struct sym_fw2a_scr *scripta0; - struct sym_fw2b_scr *scriptb0; scripta0 = (struct sym_fw2a_scr *) np->scripta0; - scriptb0 = (struct sym_fw2b_scr *) np->scriptb0; /* * Fill variable parts in scripts. @@ -2294,7 +2290,7 @@ static void sym_nvram_setup_target (hcb_ static int sym_read_nvram (hcb_p np, struct sym_nvram *nvp); /* - * Print something which allows to retrieve the controler type, + * Print something which allows to retrieve the controller type, * unit, target, lun concerned by a kernel message. */ static void PRINT_TARGET (hcb_p np, int target) @@ -4300,7 +4296,7 @@ static void sym_int_ma (hcb_p np) } /* - * The data in the dma fifo has not been transfered to + * The data in the dma fifo has not been transferred to * the target -> add the amount to the rest * and clear the data. * Check the sstat2 register in case of wide transfer. @@ -7520,7 +7516,7 @@ static void sym_action(struct cam_sim *s } /* - * Retreive the target and lun descriptors. + * Retrieve the target and lun descriptors. */ tp = &np->target[ccb_h->target_id]; lp = sym_lp(np, tp, ccb_h->target_lun); From owner-svn-src-stable@FreeBSD.ORG Mon Jul 25 15:10:53 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C9B081065673; Mon, 25 Jul 2011 15:10:53 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B7B168FC1C; Mon, 25 Jul 2011 15:10:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PFArc2062294; Mon, 25 Jul 2011 15:10:53 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PFArgw062289; Mon, 25 Jul 2011 15:10:53 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251510.p6PFArgw062289@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 15:10:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224325 - stable/7/sys/dev/sym X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 15:10:53 -0000 Author: marius Date: Mon Jul 25 15:10:53 2011 New Revision: 224325 URL: http://svn.freebsd.org/changeset/base/224325 Log: MFC: r220944, r220950 - Correct spelling. [1] - Remove variables which are unused besides initialization. [2] Submitted by: brucec, N.J. Mann [1], Christoph Mallon [2] Modified: stable/7/sys/dev/sym/README.sym stable/7/sys/dev/sym/sym_fw1.h stable/7/sys/dev/sym/sym_fw2.h stable/7/sys/dev/sym/sym_hipd.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/sym/README.sym ============================================================================== --- stable/7/sys/dev/sym/README.sym Mon Jul 25 15:10:52 2011 (r224324) +++ stable/7/sys/dev/sym/README.sym Mon Jul 25 15:10:53 2011 (r224325) @@ -70,7 +70,7 @@ using `man sym' for driver usage and fea I haven't removed this README file from the repository since I may have to provide additional documentation to people interested in understanding the driver sources and/or in helping -driver development and maintainance. +driver development and maintenance. As a result, this file is now under reconstruction. :-) Modified: stable/7/sys/dev/sym/sym_fw1.h ============================================================================== --- stable/7/sys/dev/sym/sym_fw1.h Mon Jul 25 15:10:52 2011 (r224324) +++ stable/7/sys/dev/sym/sym_fw1.h Mon Jul 25 15:10:53 2011 (r224325) @@ -1027,7 +1027,7 @@ static const struct SYM_FWA_SCR SYM_FWA_ * It shall be a tagged command. * Read SIMPLE+TAG. * The C code will deal with errors. - * Agressive optimization, is'nt it? :) + * Aggressive optimization, isn't it? :) */ SCR_MOVE_ABS (2) ^ SCR_MSG_IN, HADDR_1 (msgin), @@ -1051,7 +1051,7 @@ static const struct SYM_FWA_SCR SYM_FWA_ RADDR_1 (dsa), /* * The SIDL still contains the TAG value. - * Agressive optimization, isn't it? :):) + * Aggressive optimization, isn't it? :):) */ SCR_REG_SFBR (sidl, SCR_SHL, 0), 0, @@ -1352,7 +1352,7 @@ static const struct SYM_FWB_SCR SYM_FWB_ * some target to reset or some disconnected * job to abort. Since error recovery is a serious * busyness, we will really reset the SCSI BUS, if - * case of a SCSI interrupt occuring in this path. + * case of a SCSI interrupt occurring in this path. */ /* @@ -1461,7 +1461,7 @@ static const struct SYM_FWB_SCR SYM_FWB_ PADDR_B (msg_weird_seen), /* * We donnot handle extended messages from SCRIPTS. - * Read the amount of data correponding to the + * Read the amount of data corresponding to the * message length and call the C code. */ SCR_COPY (1), Modified: stable/7/sys/dev/sym/sym_fw2.h ============================================================================== --- stable/7/sys/dev/sym/sym_fw2.h Mon Jul 25 15:10:52 2011 (r224324) +++ stable/7/sys/dev/sym/sym_fw2.h Mon Jul 25 15:10:53 2011 (r224325) @@ -945,7 +945,7 @@ static const struct SYM_FWA_SCR SYM_FWA_ * It shall be a tagged command. * Read SIMPLE+TAG. * The C code will deal with errors. - * Agressive optimization, is'nt it? :) + * Aggressive optimization, isn't it? :) */ SCR_MOVE_ABS (2) ^ SCR_MSG_IN, HADDR_1 (msgin), @@ -957,7 +957,7 @@ static const struct SYM_FWA_SCR SYM_FWA_ offsetof(struct sym_lcb, head.itlq_tbl_sa), /* * The SIDL still contains the TAG value. - * Agressive optimization, isn't it? :):) + * Aggressive optimization, isn't it? :):) */ SCR_REG_SFBR (sidl, SCR_SHL, 0), 0, @@ -1213,7 +1213,7 @@ static const struct SYM_FWB_SCR SYM_FWB_ * some target to reset or some disconnected * job to abort. Since error recovery is a serious * busyness, we will really reset the SCSI BUS, if - * case of a SCSI interrupt occuring in this path. + * case of a SCSI interrupt occurring in this path. */ /* @@ -1320,7 +1320,7 @@ static const struct SYM_FWB_SCR SYM_FWB_ PADDR_B (msg_weird_seen), /* * We donnot handle extended messages from SCRIPTS. - * Read the amount of data correponding to the + * Read the amount of data corresponding to the * message length and call the C code. */ SCR_STORE_REL (scratcha, 1), Modified: stable/7/sys/dev/sym/sym_hipd.c ============================================================================== --- stable/7/sys/dev/sym/sym_hipd.c Mon Jul 25 15:10:52 2011 (r224324) +++ stable/7/sys/dev/sym/sym_hipd.c Mon Jul 25 15:10:53 2011 (r224325) @@ -366,7 +366,7 @@ static void MDELAY(int ms) { while (ms-- * from the SCRIPTS code. In addition, cache line alignment * is guaranteed for power of 2 cache line size. * - * This allocator has been developped for the Linux sym53c8xx + * This allocator has been developed for the Linux sym53c8xx * driver, since this O/S does not provide naturally aligned * allocations. * It has the advantage of allowing the driver to use private @@ -1959,10 +1959,8 @@ static void sym_fw1_setup(hcb_p np, const struct sym_fw *fw) { struct sym_fw1a_scr *scripta0; - struct sym_fw1b_scr *scriptb0; scripta0 = (struct sym_fw1a_scr *) np->scripta0; - scriptb0 = (struct sym_fw1b_scr *) np->scriptb0; /* * Fill variable parts in scripts. @@ -1983,10 +1981,8 @@ static void sym_fw2_setup(hcb_p np, const struct sym_fw *fw) { struct sym_fw2a_scr *scripta0; - struct sym_fw2b_scr *scriptb0; scripta0 = (struct sym_fw2a_scr *) np->scripta0; - scriptb0 = (struct sym_fw2b_scr *) np->scriptb0; /* * Fill variable parts in scripts. @@ -2294,7 +2290,7 @@ static void sym_nvram_setup_target (hcb_ static int sym_read_nvram (hcb_p np, struct sym_nvram *nvp); /* - * Print something which allows to retrieve the controler type, + * Print something which allows to retrieve the controller type, * unit, target, lun concerned by a kernel message. */ static void PRINT_TARGET (hcb_p np, int target) @@ -4300,7 +4296,7 @@ static void sym_int_ma (hcb_p np) } /* - * The data in the dma fifo has not been transfered to + * The data in the dma fifo has not been transferred to * the target -> add the amount to the rest * and clear the data. * Check the sstat2 register in case of wide transfer. @@ -7520,7 +7516,7 @@ static void sym_action(struct cam_sim *s } /* - * Retreive the target and lun descriptors. + * Retrieve the target and lun descriptors. */ tp = &np->target[ccb_h->target_id]; lp = sym_lp(np, tp, ccb_h->target_lun); From owner-svn-src-stable@FreeBSD.ORG Mon Jul 25 15:14:04 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4B635106564A; Mon, 25 Jul 2011 15:14:04 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3A10A8FC12; Mon, 25 Jul 2011 15:14:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PFE4xQ062461; Mon, 25 Jul 2011 15:14:04 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PFE466062459; Mon, 25 Jul 2011 15:14:04 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201107251514.p6PFE466062459@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Mon, 25 Jul 2011 15:14:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224326 - stable/8/contrib/pf/ftp-proxy X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 15:14:04 -0000 Author: bz Date: Mon Jul 25 15:14:03 2011 New Revision: 224326 URL: http://svn.freebsd.org/changeset/base/224326 Log: Flush output buffers before closing TCP session. Fixes the case where the proxy would eat the 221 response coming from the server towards the client. This is a commit as HEAD got the change with the entire pf45 import. PR: bin/154469 Obtained from: OpenBSD r1.18 MFC after: 2 weeks Modified: stable/8/contrib/pf/ftp-proxy/ftp-proxy.c Modified: stable/8/contrib/pf/ftp-proxy/ftp-proxy.c ============================================================================== --- stable/8/contrib/pf/ftp-proxy/ftp-proxy.c Mon Jul 25 15:10:53 2011 (r224325) +++ stable/8/contrib/pf/ftp-proxy/ftp-proxy.c Mon Jul 25 15:14:03 2011 (r224326) @@ -273,6 +273,12 @@ end_session(struct session *s) logmsg(LOG_INFO, "#%d ending session", s->id); + /* Flush output buffers. */ + if (s->client_bufev && s->client_fd != -1) + evbuffer_write(s->client_bufev->output, s->client_fd); + if (s->server_bufev && s->server_fd != -1) + evbuffer_write(s->server_bufev->output, s->server_fd); + if (s->client_fd != -1) close(s->client_fd); if (s->server_fd != -1) From owner-svn-src-stable@FreeBSD.ORG Mon Jul 25 16:11:52 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E080D106566C; Mon, 25 Jul 2011 16:11:52 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CEB488FC1A; Mon, 25 Jul 2011 16:11:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PGBqka064184; Mon, 25 Jul 2011 16:11:52 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PGBq7O064179; Mon, 25 Jul 2011 16:11:52 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251611.p6PGBq7O064179@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 16:11:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224327 - stable/7/sys/dev/mpt X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 16:11:53 -0000 Author: marius Date: Mon Jul 25 16:11:52 2011 New Revision: 224327 URL: http://svn.freebsd.org/changeset/base/224327 Log: MFC: r198262 Use callout_init_mtx on FreeBSD versions recent enough. This closes the race where interrupt thread can complete the request for which timeout has fired and while mpt_timeout has blocked on mpt_lock. Modified: stable/7/sys/dev/mpt/mpt.c stable/7/sys/dev/mpt/mpt.h stable/7/sys/dev/mpt/mpt_cam.c stable/7/sys/dev/mpt/mpt_raid.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/mpt/mpt.c ============================================================================== --- stable/7/sys/dev/mpt/mpt.c Mon Jul 25 15:14:03 2011 (r224326) +++ stable/7/sys/dev/mpt/mpt.c Mon Jul 25 16:11:52 2011 (r224327) @@ -1239,7 +1239,6 @@ retry: req->state = REQ_STATE_ALLOCATED; req->chain = NULL; mpt_assign_serno(mpt, req); - mpt_callout_init(&req->callout); } else if (sleep_ok != 0) { mpt->getreqwaiter = 1; mpt_sleep(mpt, &mpt->request_free_list, PUSER, "mptgreq", 0); @@ -2252,6 +2251,7 @@ mpt_core_attach(struct mpt_softc *mpt) for (val = 0; val < MPT_MAX_REQUESTS(mpt); val++) { request_t *req = &mpt->request_pool[val]; req->state = REQ_STATE_ALLOCATED; + mpt_callout_init(mpt, &req->callout); mpt_free_request(mpt, req); } MPT_UNLOCK(mpt); @@ -2335,10 +2335,18 @@ mpt_core_shutdown(struct mpt_softc *mpt) void mpt_core_detach(struct mpt_softc *mpt) { + int val; + /* * XXX: FREE MEMORY */ mpt_disable_ints(mpt); + + /* Make sure no request has pending timeouts. */ + for (val = 0; val < MPT_MAX_REQUESTS(mpt); val++) { + request_t *req = &mpt->request_pool[val]; + mpt_callout_drain(mpt, &req->callout); + } } int Modified: stable/7/sys/dev/mpt/mpt.h ============================================================================== --- stable/7/sys/dev/mpt/mpt.h Mon Jul 25 15:14:03 2011 (r224326) +++ stable/7/sys/dev/mpt/mpt.h Mon Jul 25 16:11:52 2011 (r224327) @@ -303,13 +303,6 @@ void mpt_map_rquest(void *, bus_dma_segm kthread_exit(status) #endif -/****************************** Timer Facilities ******************************/ -#if __FreeBSD_version > 500000 -#define mpt_callout_init(c) callout_init(c, /*mpsafe*/1); -#else -#define mpt_callout_init(c) callout_init(c); -#endif - /********************************** Endianess *********************************/ #define MPT_2_HOST64(ptr, tag) ptr->tag = le64toh(ptr->tag) #define MPT_2_HOST32(ptr, tag) ptr->tag = le32toh(ptr->tag) @@ -897,6 +890,10 @@ mpt_sleep(struct mpt_softc *mpt, void *i callout_reset(&(req)->callout, (ticks), (func), (arg)); #define mpt_req_untimeout(req, func, arg) \ callout_stop(&(req)->callout) +#define mpt_callout_init(mpt, c) \ + callout_init(c) +#define mpt_callout_drain(mpt, c) \ + callout_stop(c) #else #if 1 @@ -919,9 +916,13 @@ mpt_sleep(struct mpt_softc *mpt, void *i #define mpt_sleep(mpt, ident, priority, wmesg, timo) \ msleep(ident, &(mpt)->mpt_lock, priority, wmesg, timo) #define mpt_req_timeout(req, ticks, func, arg) \ - callout_reset(&(req)->callout, (ticks), (func), (arg)); + callout_reset(&(req)->callout, (ticks), (func), (arg)) #define mpt_req_untimeout(req, func, arg) \ callout_stop(&(req)->callout) +#define mpt_callout_init(mpt, c) \ + callout_init_mtx(c, &(mpt)->mpt_lock, 0) +#define mpt_callout_drain(mpt, c) \ + callout_drain(c) #else @@ -934,18 +935,18 @@ mpt_sleep(struct mpt_softc *mpt, void *i #define MPTLOCK_2_CAMLOCK(mpt) #define CAMLOCK_2_MPTLOCK(mpt) +#define mpt_req_timeout(req, ticks, func, arg) \ + callout_reset(&(req)->callout, (ticks), (func), (arg)) +#define mpt_req_untimeout(req, func, arg) \ + callout_stop(&(req)->callout) +#define mpt_callout_init(mpt, c) \ + callout_init(c, 0) +#define mpt_callout_drain(mpt, c) \ + callout_drain(c) + static __inline int mpt_sleep(struct mpt_softc *, void *, int, const char *, int); -#define mpt_ccb_timeout(ccb, ticks, func, arg) \ - do { \ - (ccb)->ccb_h.timeout_ch = timeout((func), (arg), (ticks)); \ - } while (0) -#define mpt_ccb_untimeout(ccb, func, arg) \ - untimeout((func), (arg), (ccb)->ccb_h.timeout_ch) -#define mpt_ccb_timeout_init(ccb) \ - callout_handle_init(&(ccb)->ccb_h.timeout_ch) - static __inline int mpt_sleep(struct mpt_softc *mpt, void *i, int p, const char *w, int t) { Modified: stable/7/sys/dev/mpt/mpt_cam.c ============================================================================== --- stable/7/sys/dev/mpt/mpt_cam.c Mon Jul 25 15:14:03 2011 (r224326) +++ stable/7/sys/dev/mpt/mpt_cam.c Mon Jul 25 16:11:52 2011 (r224327) @@ -1250,7 +1250,10 @@ mpt_timeout(void *arg) ccb = (union ccb *)arg; mpt = ccb->ccb_h.ccb_mpt_ptr; +#if __FreeBSD_version < 500000 MPT_LOCK(mpt); +#endif + MPT_LOCK_ASSERT(mpt); req = ccb->ccb_h.ccb_req_ptr; mpt_prt(mpt, "request %p:%u timed out for ccb %p (req->ccb %p)\n", req, req->serno, ccb, req->ccb); @@ -1261,7 +1264,9 @@ mpt_timeout(void *arg) req->state |= REQ_STATE_TIMEDOUT; mpt_wakeup_recovery_thread(mpt); } +#if __FreeBSD_version < 500000 MPT_UNLOCK(mpt); +#endif } /* Modified: stable/7/sys/dev/mpt/mpt_raid.c ============================================================================== --- stable/7/sys/dev/mpt/mpt_raid.c Mon Jul 25 15:14:03 2011 (r224326) +++ stable/7/sys/dev/mpt/mpt_raid.c Mon Jul 25 16:11:52 2011 (r224327) @@ -271,7 +271,7 @@ mpt_raid_attach(struct mpt_softc *mpt) mpt_handler_t handler; int error; - mpt_callout_init(&mpt->raid_timer); + mpt_callout_init(mpt, &mpt->raid_timer); error = mpt_spawn_raid_thread(mpt); if (error != 0) { @@ -320,10 +320,10 @@ mpt_raid_detach(struct mpt_softc *mpt) struct ccb_setasync csa; mpt_handler_t handler; - callout_stop(&mpt->raid_timer); + mpt_callout_drain(mpt, &mpt->raid_timer); + MPT_LOCK(mpt); mpt_terminate_raid_thread(mpt); - handler.reply_handler = mpt_raid_reply_handler; mpt_deregister_handler(mpt, MPT_HANDLER_REPLY, handler, raid_handler_id); @@ -1570,9 +1570,14 @@ mpt_raid_timer(void *arg) struct mpt_softc *mpt; mpt = (struct mpt_softc *)arg; +#if __FreeBSD_version < 500000 MPT_LOCK(mpt); +#endif + MPT_LOCK_ASSERT(mpt); mpt_raid_wakeup(mpt); +#if __FreeBSD_version < 500000 MPT_UNLOCK(mpt); +#endif } void From owner-svn-src-stable@FreeBSD.ORG Mon Jul 25 16:14:37 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 16C361065692; Mon, 25 Jul 2011 16:14:37 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 057548FC12; Mon, 25 Jul 2011 16:14:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PGEajT064313; Mon, 25 Jul 2011 16:14:36 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PGEaHl064311; Mon, 25 Jul 2011 16:14:36 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251614.p6PGEaHl064311@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 16:14:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224328 - stable/7/sys/dev/mpt X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 16:14:37 -0000 Author: marius Date: Mon Jul 25 16:14:36 2011 New Revision: 224328 URL: http://svn.freebsd.org/changeset/base/224328 Log: MFC: r207543 Print IR_RESYNC updates informatively. Obtained from: pluknet Modified: stable/7/sys/dev/mpt/mpt_cam.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/mpt/mpt_cam.c ============================================================================== --- stable/7/sys/dev/mpt/mpt_cam.c Mon Jul 25 16:11:52 2011 (r224327) +++ stable/7/sys/dev/mpt/mpt_cam.c Mon Jul 25 16:14:36 2011 (r224328) @@ -2574,6 +2574,10 @@ mpt_cam_event(struct mpt_softc *mpt, req CAMLOCK_2_MPTLOCK(mpt); break; } + case MPI_EVENT_IR_RESYNC_UPDATE: + mpt_prt(mpt, "IR resync update %d completed\n", + (data0 >> 16) & 0xff); + break; case MPI_EVENT_EVENT_CHANGE: case MPI_EVENT_INTEGRATED_RAID: case MPI_EVENT_SAS_DEVICE_STATUS_CHANGE: From owner-svn-src-stable@FreeBSD.ORG Mon Jul 25 16:20:00 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AA481106566C; Mon, 25 Jul 2011 16:20:00 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7F5788FC08; Mon, 25 Jul 2011 16:20:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PGK088064551; Mon, 25 Jul 2011 16:20:00 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PGK0x8064549; Mon, 25 Jul 2011 16:20:00 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251620.p6PGK0x8064549@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 16:20:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224329 - stable/8/sys/dev/mpt X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 16:20:00 -0000 Author: marius Date: Mon Jul 25 16:20:00 2011 New Revision: 224329 URL: http://svn.freebsd.org/changeset/base/224329 Log: MFC: r210943 Figure which is the IO and MEM bars- do not assume that they are in a fixed order. PR: 149220 Obtained from: John Baldwin Modified: stable/8/sys/dev/mpt/mpt_pci.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/geom/label/ (props changed) Modified: stable/8/sys/dev/mpt/mpt_pci.c ============================================================================== --- stable/8/sys/dev/mpt/mpt_pci.c Mon Jul 25 16:14:36 2011 (r224328) +++ stable/8/sys/dev/mpt/mpt_pci.c Mon Jul 25 16:20:00 2011 (r224329) @@ -194,8 +194,6 @@ __FBSDID("$FreeBSD$"); #endif -#define MPT_IO_BAR 0 -#define MPT_MEM_BAR 1 static int mpt_pci_probe(device_t); static int mpt_pci_attach(device_t); @@ -420,6 +418,7 @@ mpt_pci_attach(device_t dev) struct mpt_softc *mpt; int iqd; uint32_t data, cmd; + int mpt_io_bar, mpt_mem_bar; /* Allocate the softc structure */ mpt = (struct mpt_softc*)device_get_softc(dev); @@ -505,11 +504,25 @@ mpt_pci_attach(device_t dev) } /* + * Figure out which are the I/O and MEM Bars + */ + data = pci_read_config(dev, PCIR_BAR(0), 4); + if (PCI_BAR_IO(data)) { + /* BAR0 is IO, BAR1 is memory */ + mpt_io_bar = 0; + mpt_mem_bar = 1; + } else { + /* BAR0 is memory, BAR1 is IO */ + mpt_mem_bar = 0; + mpt_io_bar = 1; + } + + /* * Set up register access. PIO mode is required for * certain reset operations (but must be disabled for * some cards otherwise). */ - mpt->pci_pio_rid = PCIR_BAR(MPT_IO_BAR); + mpt->pci_pio_rid = PCIR_BAR(mpt_io_bar); mpt->pci_pio_reg = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &mpt->pci_pio_rid, RF_ACTIVE); if (mpt->pci_pio_reg == NULL) { @@ -520,7 +533,7 @@ mpt_pci_attach(device_t dev) mpt->pci_pio_sh = rman_get_bushandle(mpt->pci_pio_reg); /* Allocate kernel virtual memory for the 9x9's Mem0 region */ - mpt->pci_mem_rid = PCIR_BAR(MPT_MEM_BAR); + mpt->pci_mem_rid = PCIR_BAR(mpt_mem_bar); mpt->pci_reg = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &mpt->pci_mem_rid, RF_ACTIVE); if (mpt->pci_reg == NULL) { From owner-svn-src-stable@FreeBSD.ORG Mon Jul 25 16:20:02 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D3820106564A; Mon, 25 Jul 2011 16:20:02 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A8EA28FC13; Mon, 25 Jul 2011 16:20:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PGK2ce064583; Mon, 25 Jul 2011 16:20:02 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PGK2HM064582; Mon, 25 Jul 2011 16:20:02 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251620.p6PGK2HM064582@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 16:20:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224330 - stable/7/sys/dev/mpt X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 16:20:02 -0000 Author: marius Date: Mon Jul 25 16:20:02 2011 New Revision: 224330 URL: http://svn.freebsd.org/changeset/base/224330 Log: MFC: r210943 Figure which is the IO and MEM bars- do not assume that they are in a fixed order. PR: 149220 Obtained from: John Baldwin Modified: stable/7/sys/dev/mpt/mpt_pci.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/mpt/mpt_pci.c ============================================================================== --- stable/7/sys/dev/mpt/mpt_pci.c Mon Jul 25 16:20:00 2011 (r224329) +++ stable/7/sys/dev/mpt/mpt_pci.c Mon Jul 25 16:20:02 2011 (r224330) @@ -194,8 +194,6 @@ __FBSDID("$FreeBSD$"); #endif -#define MPT_IO_BAR 0 -#define MPT_MEM_BAR 1 static int mpt_pci_probe(device_t); static int mpt_pci_attach(device_t); @@ -420,6 +418,7 @@ mpt_pci_attach(device_t dev) struct mpt_softc *mpt; int iqd; uint32_t data, cmd; + int mpt_io_bar, mpt_mem_bar; /* Allocate the softc structure */ mpt = (struct mpt_softc*)device_get_softc(dev); @@ -505,11 +504,25 @@ mpt_pci_attach(device_t dev) } /* + * Figure out which are the I/O and MEM Bars + */ + data = pci_read_config(dev, PCIR_BAR(0), 4); + if (PCI_BAR_IO(data)) { + /* BAR0 is IO, BAR1 is memory */ + mpt_io_bar = 0; + mpt_mem_bar = 1; + } else { + /* BAR0 is memory, BAR1 is IO */ + mpt_mem_bar = 0; + mpt_io_bar = 1; + } + + /* * Set up register access. PIO mode is required for * certain reset operations (but must be disabled for * some cards otherwise). */ - mpt->pci_pio_rid = PCIR_BAR(MPT_IO_BAR); + mpt->pci_pio_rid = PCIR_BAR(mpt_io_bar); mpt->pci_pio_reg = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &mpt->pci_pio_rid, RF_ACTIVE); if (mpt->pci_pio_reg == NULL) { @@ -520,7 +533,7 @@ mpt_pci_attach(device_t dev) mpt->pci_pio_sh = rman_get_bushandle(mpt->pci_pio_reg); /* Allocate kernel virtual memory for the 9x9's Mem0 region */ - mpt->pci_mem_rid = PCIR_BAR(MPT_MEM_BAR); + mpt->pci_mem_rid = PCIR_BAR(mpt_mem_bar); mpt->pci_reg = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &mpt->pci_mem_rid, RF_ACTIVE); if (mpt->pci_reg == NULL) { From owner-svn-src-stable@FreeBSD.ORG Mon Jul 25 16:24:27 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C99D2106566B; Mon, 25 Jul 2011 16:24:27 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B85578FC1A; Mon, 25 Jul 2011 16:24:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PGORYj064771; Mon, 25 Jul 2011 16:24:27 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PGORJT064768; Mon, 25 Jul 2011 16:24:27 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251624.p6PGORJT064768@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 16:24:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224331 - stable/7/sys/dev/mpt X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 16:24:27 -0000 Author: marius Date: Mon Jul 25 16:24:27 2011 New Revision: 224331 URL: http://svn.freebsd.org/changeset/base/224331 Log: MFC: r203484 Do not release device, when changing number of openings. Modified: stable/7/sys/dev/mpt/mpt_cam.c stable/7/sys/dev/mpt/mpt_raid.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/mpt/mpt_cam.c ============================================================================== --- stable/7/sys/dev/mpt/mpt_cam.c Mon Jul 25 16:20:02 2011 (r224330) +++ stable/7/sys/dev/mpt/mpt_cam.c Mon Jul 25 16:24:27 2011 (r224331) @@ -2563,6 +2563,7 @@ mpt_cam_event(struct mpt_softc *mpt, req } xpt_setup_ccb(&crs.ccb_h, tmppath, 5); crs.ccb_h.func_code = XPT_REL_SIMQ; + crs.ccb_h.flags = CAM_DEV_QFREEZE; crs.release_flags = RELSIM_ADJUST_OPENINGS; crs.openings = pqf->CurrentDepth - 1; xpt_action((union ccb *)&crs); Modified: stable/7/sys/dev/mpt/mpt_raid.c ============================================================================== --- stable/7/sys/dev/mpt/mpt_raid.c Mon Jul 25 16:20:02 2011 (r224330) +++ stable/7/sys/dev/mpt/mpt_raid.c Mon Jul 25 16:24:27 2011 (r224331) @@ -1062,6 +1062,7 @@ mpt_adjust_queue_depth(struct mpt_softc xpt_setup_ccb(&crs.ccb_h, path, /*priority*/5); crs.ccb_h.func_code = XPT_REL_SIMQ; + crs.ccb_h.flags = CAM_DEV_QFREEZE; crs.release_flags = RELSIM_ADJUST_OPENINGS; crs.openings = mpt->raid_queue_depth; xpt_action((union ccb *)&crs); From owner-svn-src-stable@FreeBSD.ORG Mon Jul 25 16:45:13 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1FB031065670; Mon, 25 Jul 2011 16:45:13 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0D45B8FC15; Mon, 25 Jul 2011 16:45:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PGjDTm065506; Mon, 25 Jul 2011 16:45:13 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PGjC1i065500; Mon, 25 Jul 2011 16:45:12 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251645.p6PGjC1i065500@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 16:45:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224332 - stable/7/sys/dev/mpt X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 16:45:13 -0000 Author: marius Date: Mon Jul 25 16:45:12 2011 New Revision: 224332 URL: http://svn.freebsd.org/changeset/base/224332 Log: MFC: r209599 (partial), r209960: r209960 | marius - Make the maxsize parameter of the data buffer DMA tag match maxio, which was missed in r209599. Reported and tested by: Michael Moll - Declare mpt_dma_buf_alloc() static just like mpt_dma_buf_free(), both are used in mpt.c only. Reviewed by: ken MFC after: r209599 r209599 | ken Change the mpt driver to allow larger I/O sizes. The mpt driver previously didn't report a 'maxio' size to CAM, and so the da(4) driver limited I/O sizes to DFLTPHYS (64K) by default. The number of scatter gather segments allowed, as reported to busdma, was (128K / PAGE_SIZE) + 1, or 33 on architectures with 4K pages. Change things around so that we wait until we've determined how many segments the adapter can support before creating the busdma tag used for buffers, so we can potentially support more S/G segments and therefore larger I/O sizes. Also, fix some things that were broken about the module unload path. It still gets hung up inside CAM, though. mpt.c: Move some busdma initialization calls in here, and call them just after we've gotten the IOCFacts, and know how many S/G segments this adapter can support. mpt.h: Add max_cam_seg_cnt. mpt_cam.c: Fix the locking in mpt_cam_detach(). mpt_pci.c: Pull some busdma initialization and teardown out and put it in mpt.c. We now delay it until we know many scatter gather segments the adapter can support, and therefore how to setup our busdma tags. mpt_raid.c: Make sure we wake up the right wait channel to get the raid thread to wake up when we're trying to shut it down. Reviewed by: gibbs, mjacob MFC after: 2 weeks Modified: stable/7/sys/dev/mpt/mpt.c stable/7/sys/dev/mpt/mpt.h stable/7/sys/dev/mpt/mpt_cam.c stable/7/sys/dev/mpt/mpt_pci.c stable/7/sys/dev/mpt/mpt_raid.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/mpt/mpt.c ============================================================================== --- stable/7/sys/dev/mpt/mpt.c Mon Jul 25 16:24:27 2011 (r224331) +++ stable/7/sys/dev/mpt/mpt.c Mon Jul 25 16:45:12 2011 (r224332) @@ -128,6 +128,8 @@ static void mpt_send_event_ack(struct mp static int mpt_send_event_request(struct mpt_softc *mpt, int onoff); static int mpt_soft_reset(struct mpt_softc *mpt); static void mpt_hard_reset(struct mpt_softc *mpt); +static int mpt_dma_buf_alloc(struct mpt_softc *mpt); +static void mpt_dma_buf_free(struct mpt_softc *mpt); static int mpt_configure_ioc(struct mpt_softc *mpt, int, int); static int mpt_enable_ioc(struct mpt_softc *mpt, int); @@ -2247,14 +2249,6 @@ mpt_core_attach(struct mpt_softc *mpt) TAILQ_INIT(&mpt->request_pending_list); TAILQ_INIT(&mpt->request_free_list); TAILQ_INIT(&mpt->request_timeout_list); - MPT_LOCK(mpt); - for (val = 0; val < MPT_MAX_REQUESTS(mpt); val++) { - request_t *req = &mpt->request_pool[val]; - req->state = REQ_STATE_ALLOCATED; - mpt_callout_init(mpt, &req->callout); - mpt_free_request(mpt, req); - } - MPT_UNLOCK(mpt); for (val = 0; val < MPT_MAX_LUNS; val++) { STAILQ_INIT(&mpt->trt[val].atios); STAILQ_INIT(&mpt->trt[val].inots); @@ -2347,6 +2341,8 @@ mpt_core_detach(struct mpt_softc *mpt) request_t *req = &mpt->request_pool[val]; mpt_callout_drain(mpt, &req->callout); } + + mpt_dma_buf_free(mpt); } int @@ -2481,6 +2477,105 @@ mpt_download_fw(struct mpt_softc *mpt) return (0); } +static int +mpt_dma_buf_alloc(struct mpt_softc *mpt) +{ + struct mpt_map_info mi; + uint8_t *vptr; + uint32_t pptr, end; + int i, error; + + /* Create a child tag for data buffers */ + if (mpt_dma_tag_create(mpt, mpt->parent_dmat, 1, + 0, BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, + NULL, NULL, (mpt->max_cam_seg_cnt - 1) * PAGE_SIZE, + mpt->max_cam_seg_cnt, BUS_SPACE_MAXSIZE_32BIT, 0, + &mpt->buffer_dmat) != 0) { + mpt_prt(mpt, "cannot create a dma tag for data buffers\n"); + return (1); + } + + /* Create a child tag for request buffers */ + if (mpt_dma_tag_create(mpt, mpt->parent_dmat, PAGE_SIZE, 0, + BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, + NULL, NULL, MPT_REQ_MEM_SIZE(mpt), 1, BUS_SPACE_MAXSIZE_32BIT, 0, + &mpt->request_dmat) != 0) { + mpt_prt(mpt, "cannot create a dma tag for requests\n"); + return (1); + } + + /* Allocate some DMA accessable memory for requests */ + if (bus_dmamem_alloc(mpt->request_dmat, (void **)&mpt->request, + BUS_DMA_NOWAIT, &mpt->request_dmap) != 0) { + mpt_prt(mpt, "cannot allocate %d bytes of request memory\n", + MPT_REQ_MEM_SIZE(mpt)); + return (1); + } + + mi.mpt = mpt; + mi.error = 0; + + /* Load and lock it into "bus space" */ + bus_dmamap_load(mpt->request_dmat, mpt->request_dmap, mpt->request, + MPT_REQ_MEM_SIZE(mpt), mpt_map_rquest, &mi, 0); + + if (mi.error) { + mpt_prt(mpt, "error %d loading dma map for DMA request queue\n", + mi.error); + return (1); + } + mpt->request_phys = mi.phys; + + /* + * Now create per-request dma maps + */ + i = 0; + pptr = mpt->request_phys; + vptr = mpt->request; + end = pptr + MPT_REQ_MEM_SIZE(mpt); + while(pptr < end) { + request_t *req = &mpt->request_pool[i]; + req->index = i++; + + /* Store location of Request Data */ + req->req_pbuf = pptr; + req->req_vbuf = vptr; + + pptr += MPT_REQUEST_AREA; + vptr += MPT_REQUEST_AREA; + + req->sense_pbuf = (pptr - MPT_SENSE_SIZE); + req->sense_vbuf = (vptr - MPT_SENSE_SIZE); + + error = bus_dmamap_create(mpt->buffer_dmat, 0, &req->dmap); + if (error) { + mpt_prt(mpt, "error %d creating per-cmd DMA maps\n", + error); + return (1); + } + } + + return (0); +} + +static void +mpt_dma_buf_free(struct mpt_softc *mpt) +{ + int i; + if (mpt->request_dmat == 0) { + mpt_lprt(mpt, MPT_PRT_DEBUG, "already released dma memory\n"); + return; + } + for (i = 0; i < MPT_MAX_REQUESTS(mpt); i++) { + bus_dmamap_destroy(mpt->buffer_dmat, mpt->request_pool[i].dmap); + } + bus_dmamap_unload(mpt->request_dmat, mpt->request_dmap); + bus_dmamem_free(mpt->request_dmat, mpt->request, mpt->request_dmap); + bus_dma_tag_destroy(mpt->request_dmat); + mpt->request_dmat = 0; + bus_dma_tag_destroy(mpt->buffer_dmat); +} + /* * Allocate/Initialize data structures for the controller. Called * once at instance startup. @@ -2489,7 +2584,7 @@ static int mpt_configure_ioc(struct mpt_softc *mpt, int tn, int needreset) { PTR_MSG_PORT_FACTS_REPLY pfp; - int error, port; + int error, port, val; size_t len; if (tn == MPT_MAX_TRYS) { @@ -2549,7 +2644,7 @@ mpt_configure_ioc(struct mpt_softc *mpt, /* limited by the number of chain areas the card will support */ if (mpt->max_seg_cnt > mpt->ioc_facts.MaxChainDepth) { - mpt_lprt(mpt, MPT_PRT_DEBUG, + mpt_lprt(mpt, MPT_PRT_INFO, "chain depth limited to %u (from %u)\n", mpt->ioc_facts.MaxChainDepth, mpt->max_seg_cnt); mpt->max_seg_cnt = mpt->ioc_facts.MaxChainDepth; @@ -2558,17 +2653,37 @@ mpt_configure_ioc(struct mpt_softc *mpt, /* converted to the number of simple sges in chain segments. */ mpt->max_seg_cnt *= (MPT_NSGL(mpt) - 1); - mpt_lprt(mpt, MPT_PRT_DEBUG, "Maximum Segment Count: %u\n", - mpt->max_seg_cnt); - mpt_lprt(mpt, MPT_PRT_DEBUG, "MsgLength=%u IOCNumber = %d\n", + /* + * Use this as the basis for reporting the maximum I/O size to CAM. + */ + mpt->max_cam_seg_cnt = min(mpt->max_seg_cnt, (MAXPHYS / PAGE_SIZE) + 1); + + error = mpt_dma_buf_alloc(mpt); + if (error != 0) { + mpt_prt(mpt, "mpt_dma_buf_alloc() failed!\n"); + return (EIO); + } + + for (val = 0; val < MPT_MAX_REQUESTS(mpt); val++) { + request_t *req = &mpt->request_pool[val]; + req->state = REQ_STATE_ALLOCATED; + mpt_callout_init(mpt, &req->callout); + mpt_free_request(mpt, req); + } + + mpt_lprt(mpt, MPT_PRT_INFO, "Maximum Segment Count: %u, Maximum " + "CAM Segment Count: %u\n", mpt->max_seg_cnt, + mpt->max_cam_seg_cnt); + + mpt_lprt(mpt, MPT_PRT_INFO, "MsgLength=%u IOCNumber = %d\n", mpt->ioc_facts.MsgLength, mpt->ioc_facts.IOCNumber); - mpt_lprt(mpt, MPT_PRT_DEBUG, + mpt_lprt(mpt, MPT_PRT_INFO, "IOCFACTS: GlobalCredits=%d BlockSize=%u bytes " "Request Frame Size %u bytes Max Chain Depth %u\n", mpt->ioc_facts.GlobalCredits, mpt->ioc_facts.BlockSize, mpt->ioc_facts.RequestFrameSize << 2, mpt->ioc_facts.MaxChainDepth); - mpt_lprt(mpt, MPT_PRT_DEBUG, "IOCFACTS: Num Ports %d, FWImageSize %d, " + mpt_lprt(mpt, MPT_PRT_INFO, "IOCFACTS: Num Ports %d, FWImageSize %d, " "Flags=%#x\n", mpt->ioc_facts.NumberOfPorts, mpt->ioc_facts.FWImageSize, mpt->ioc_facts.Flags); @@ -2758,7 +2873,7 @@ mpt_enable_ioc(struct mpt_softc *mpt, in mpt_send_event_request(mpt, 1); if (mpt_send_port_enable(mpt, 0) != MPT_OK) { - mpt_prt(mpt, "failed to enable port 0\n"); + mpt_prt(mpt, "%s: failed to enable port 0\n", __func__); return (ENXIO); } } Modified: stable/7/sys/dev/mpt/mpt.h ============================================================================== --- stable/7/sys/dev/mpt/mpt.h Mon Jul 25 16:24:27 2011 (r224331) +++ stable/7/sys/dev/mpt/mpt.h Mon Jul 25 16:45:12 2011 (r224332) @@ -743,6 +743,7 @@ struct mpt_softc { bus_addr_t request_phys; /* BusAddr of request memory */ uint32_t max_seg_cnt; /* calculated after IOC facts */ + uint32_t max_cam_seg_cnt;/* calculated from MAXPHYS*/ /* * Hardware management Modified: stable/7/sys/dev/mpt/mpt_cam.c ============================================================================== --- stable/7/sys/dev/mpt/mpt_cam.c Mon Jul 25 16:24:27 2011 (r224331) +++ stable/7/sys/dev/mpt/mpt_cam.c Mon Jul 25 16:45:12 2011 (r224332) @@ -1205,25 +1205,21 @@ mpt_cam_detach(struct mpt_softc *mpt) free(mpt->sas_portinfo, M_DEVBUF); mpt->sas_portinfo = NULL; } - MPT_UNLOCK(mpt); if (mpt->sim != NULL) { xpt_free_path(mpt->path); - MPT_LOCK(mpt); xpt_bus_deregister(cam_sim_path(mpt->sim)); - MPT_UNLOCK(mpt); cam_sim_free(mpt->sim, TRUE); mpt->sim = NULL; } if (mpt->phydisk_sim != NULL) { xpt_free_path(mpt->phydisk_path); - MPT_LOCK(mpt); xpt_bus_deregister(cam_sim_path(mpt->phydisk_sim)); - MPT_UNLOCK(mpt); cam_sim_free(mpt->phydisk_sim, TRUE); mpt->phydisk_sim = NULL; } + MPT_UNLOCK(mpt); } /* This routine is used after a system crash to dump core onto the swap device. @@ -3586,6 +3582,10 @@ mpt_action(struct cam_sim *sim, union cc cpi->target_sprt = 0; cpi->hba_eng_cnt = 0; cpi->max_target = mpt->port_facts[0].MaxDevices - 1; +#if 0 + cpi->maxio = (mpt->max_cam_seg_cnt - 1) * PAGE_SIZE; +#endif + /* * FC cards report MAX_DEVICES of 512, but * the MSG_SCSI_IO_REQUEST target id field @@ -4226,7 +4226,7 @@ mpt_fc_post_els(struct mpt_softc *mpt, r /* * Okay, set up ELS buffer pointers. ELS buffer pointers * consist of a TE SGL element (with details length of zero) - * followe by a SIMPLE SGL element which holds the address + * followed by a SIMPLE SGL element which holds the address * of the buffer. */ Modified: stable/7/sys/dev/mpt/mpt_pci.c ============================================================================== --- stable/7/sys/dev/mpt/mpt_pci.c Mon Jul 25 16:24:27 2011 (r224331) +++ stable/7/sys/dev/mpt/mpt_pci.c Mon Jul 25 16:45:12 2011 (r224332) @@ -733,9 +733,6 @@ mpt_pci_shutdown(device_t dev) static int mpt_dma_mem_alloc(struct mpt_softc *mpt) { - int i, error, nsegs; - uint8_t *vptr; - uint32_t pptr, end; size_t len; struct mpt_map_info mi; @@ -808,82 +805,6 @@ mpt_dma_mem_alloc(struct mpt_softc *mpt) } mpt->reply_phys = mi.phys; - /* Create a child tag for data buffers */ - - /* - * XXX: we should say that nsegs is 'unrestricted, but that - * XXX: tickles a horrible bug in the busdma code. Instead, - * XXX: we'll derive a reasonable segment limit from MAXPHYS - */ - nsegs = (MAXPHYS / PAGE_SIZE) + 1; - if (mpt_dma_tag_create(mpt, mpt->parent_dmat, 1, - 0, BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, - NULL, NULL, MAXBSIZE, nsegs, BUS_SPACE_MAXSIZE_32BIT, 0, - &mpt->buffer_dmat) != 0) { - mpt_prt(mpt, "cannot create a dma tag for data buffers\n"); - return (1); - } - - /* Create a child tag for request buffers */ - if (mpt_dma_tag_create(mpt, mpt->parent_dmat, PAGE_SIZE, 0, - BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, - NULL, NULL, MPT_REQ_MEM_SIZE(mpt), 1, BUS_SPACE_MAXSIZE_32BIT, 0, - &mpt->request_dmat) != 0) { - mpt_prt(mpt, "cannot create a dma tag for requests\n"); - return (1); - } - - /* Allocate some DMA accessable memory for requests */ - if (bus_dmamem_alloc(mpt->request_dmat, (void **)&mpt->request, - BUS_DMA_NOWAIT, &mpt->request_dmap) != 0) { - mpt_prt(mpt, "cannot allocate %d bytes of request memory\n", - MPT_REQ_MEM_SIZE(mpt)); - return (1); - } - - mi.mpt = mpt; - mi.error = 0; - - /* Load and lock it into "bus space" */ - bus_dmamap_load(mpt->request_dmat, mpt->request_dmap, mpt->request, - MPT_REQ_MEM_SIZE(mpt), mpt_map_rquest, &mi, 0); - - if (mi.error) { - mpt_prt(mpt, "error %d loading dma map for DMA request queue\n", - mi.error); - return (1); - } - mpt->request_phys = mi.phys; - - /* - * Now create per-request dma maps - */ - i = 0; - pptr = mpt->request_phys; - vptr = mpt->request; - end = pptr + MPT_REQ_MEM_SIZE(mpt); - while(pptr < end) { - request_t *req = &mpt->request_pool[i]; - req->index = i++; - - /* Store location of Request Data */ - req->req_pbuf = pptr; - req->req_vbuf = vptr; - - pptr += MPT_REQUEST_AREA; - vptr += MPT_REQUEST_AREA; - - req->sense_pbuf = (pptr - MPT_SENSE_SIZE); - req->sense_vbuf = (vptr - MPT_SENSE_SIZE); - - error = bus_dmamap_create(mpt->buffer_dmat, 0, &req->dmap); - if (error) { - mpt_prt(mpt, "error %d creating per-cmd DMA maps\n", - error); - return (1); - } - } - return (0); } @@ -894,7 +815,6 @@ mpt_dma_mem_alloc(struct mpt_softc *mpt) static void mpt_dma_mem_free(struct mpt_softc *mpt) { - int i; /* Make sure we aren't double destroying */ if (mpt->reply_dmat == 0) { @@ -902,13 +822,6 @@ mpt_dma_mem_free(struct mpt_softc *mpt) return; } - for (i = 0; i < MPT_MAX_REQUESTS(mpt); i++) { - bus_dmamap_destroy(mpt->buffer_dmat, mpt->request_pool[i].dmap); - } - bus_dmamap_unload(mpt->request_dmat, mpt->request_dmap); - bus_dmamem_free(mpt->request_dmat, mpt->request, mpt->request_dmap); - bus_dma_tag_destroy(mpt->request_dmat); - bus_dma_tag_destroy(mpt->buffer_dmat); bus_dmamap_unload(mpt->reply_dmat, mpt->reply_dmap); bus_dmamem_free(mpt->reply_dmat, mpt->reply, mpt->reply_dmap); bus_dma_tag_destroy(mpt->reply_dmat); Modified: stable/7/sys/dev/mpt/mpt_raid.c ============================================================================== --- stable/7/sys/dev/mpt/mpt_raid.c Mon Jul 25 16:24:27 2011 (r224331) +++ stable/7/sys/dev/mpt/mpt_raid.c Mon Jul 25 16:45:12 2011 (r224332) @@ -647,7 +647,7 @@ mpt_terminate_raid_thread(struct mpt_sof return; } mpt->shutdwn_raid = 1; - wakeup(mpt->raid_volumes); + wakeup(&mpt->raid_volumes); /* * Sleep on a slightly different location * for this interlock just for added safety. From owner-svn-src-stable@FreeBSD.ORG Mon Jul 25 16:54:32 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 13F01106566B; Mon, 25 Jul 2011 16:54:32 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DDDD38FC12; Mon, 25 Jul 2011 16:54:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PGsVh9065901; Mon, 25 Jul 2011 16:54:31 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PGsVp9065899; Mon, 25 Jul 2011 16:54:31 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251654.p6PGsVp9065899@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 16:54:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224334 - stable/7/sys/dev/mpt X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 16:54:32 -0000 Author: marius Date: Mon Jul 25 16:54:31 2011 New Revision: 224334 URL: http://svn.freebsd.org/changeset/base/224334 Log: MFC: r195274 Change explicit maximium numbers to the defined macro MPT_MAX_LUNS. Modified: stable/7/sys/dev/mpt/mpt_cam.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/mpt/mpt_cam.c ============================================================================== --- stable/7/sys/dev/mpt/mpt_cam.c Mon Jul 25 16:45:47 2011 (r224333) +++ stable/7/sys/dev/mpt/mpt_cam.c Mon Jul 25 16:54:31 2011 (r224334) @@ -2158,7 +2158,7 @@ mpt_start(struct cam_sim *sim, union ccb mpt_req->TargetID = tgt; /* We assume a single level LUN type */ - if (ccb->ccb_h.target_lun >= 256) { + if (ccb->ccb_h.target_lun >= MPT_MAX_LUNS) { mpt_req->LUN[0] = 0x40 | ((ccb->ccb_h.target_lun >> 8) & 0x3f); mpt_req->LUN[1] = ccb->ccb_h.target_lun & 0xff; } else { @@ -4043,7 +4043,7 @@ mpt_scsi_send_tmf(struct mpt_softc *mpt, tmf_req->MsgFlags = flags; tmf_req->MsgContext = htole32(mpt->tmf_req->index | scsi_tmf_handler_id); - if (lun > 256) { + if (lun > MPT_MAX_LUNS) { tmf_req->LUN[0] = 0x40 | ((lun >> 8) & 0x3f); tmf_req->LUN[1] = lun & 0xff; } else { @@ -4517,7 +4517,7 @@ mpt_target_start_io(struct mpt_softc *mp ta->Function = MPI_FUNCTION_TARGET_ASSIST; ta->MsgContext = htole32(req->index | mpt->scsi_tgt_handler_id); ta->ReplyWord = htole32(tgt->reply_desc); - if (csio->ccb_h.target_lun > 256) { + if (csio->ccb_h.target_lun > MPT_MAX_LUNS) { ta->LUN[0] = 0x40 | ((csio->ccb_h.target_lun >> 8) & 0x3f); ta->LUN[1] = csio->ccb_h.target_lun & 0xff; @@ -4669,7 +4669,7 @@ mpt_scsi_tgt_local(struct mpt_softc *mpt ta->Function = MPI_FUNCTION_TARGET_ASSIST; ta->MsgContext = htole32(req->index | mpt->scsi_tgt_handler_id); ta->ReplyWord = htole32(tgt->reply_desc); - if (lun > 256) { + if (lun > MPT_MAX_LUNS) { ta->LUN[0] = 0x40 | ((lun >> 8) & 0x3f); ta->LUN[1] = lun & 0xff; } else { From owner-svn-src-stable@FreeBSD.ORG Mon Jul 25 16:59:42 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 065A51065673; Mon, 25 Jul 2011 16:59:42 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E8C648FC19; Mon, 25 Jul 2011 16:59:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PGxfbZ066096; Mon, 25 Jul 2011 16:59:41 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PGxfas066092; Mon, 25 Jul 2011 16:59:41 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251659.p6PGxfas066092@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 16:59:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224335 - stable/7/sys/dev/mpt X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 16:59:42 -0000 Author: marius Date: Mon Jul 25 16:59:41 2011 New Revision: 224335 URL: http://svn.freebsd.org/changeset/base/224335 Log: MFC: r219335 - Allocate the DMA memory shared between the host and the controller as coherent. - Add some missing bus_dmamap_sync() calls. This includes putting such calls before calling reply handlers instead of calling bus_dmamap_sync() for the request queue from individual reply handlers as these handlers generally read back updates by the controller. Tested on amd64 and sparc64. Modified: stable/7/sys/dev/mpt/mpt.c stable/7/sys/dev/mpt/mpt_cam.c stable/7/sys/dev/mpt/mpt_user.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/mpt/mpt.c ============================================================================== --- stable/7/sys/dev/mpt/mpt.c Mon Jul 25 16:54:31 2011 (r224334) +++ stable/7/sys/dev/mpt/mpt.c Mon Jul 25 16:59:41 2011 (r224335) @@ -718,15 +718,16 @@ mpt_intr(void *arg) uint32_t ctxt_idx; u_int cb_index; u_int req_index; + u_int offset; int free_rf; req = NULL; reply_frame = NULL; reply_baddr = 0; + offset = 0; if ((reply_desc & MPI_ADDRESS_REPLY_A_BIT) != 0) { - u_int offset; /* - * Insure that the reply frame is coherent. + * Ensure that the reply frame is coherent. */ reply_baddr = MPT_REPLY_BADDR(reply_desc); offset = reply_baddr - (mpt->reply_phys & 0xFFFFFFFF); @@ -808,10 +809,15 @@ mpt_intr(void *arg) " 0x%x)\n", req_index, reply_desc); } + bus_dmamap_sync(mpt->request_dmat, mpt->request_dmap, + BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); free_rf = mpt_reply_handlers[cb_index](mpt, req, reply_desc, reply_frame); if (reply_frame != NULL && free_rf) { + bus_dmamap_sync_range(mpt->reply_dmat, + mpt->reply_dmap, offset, MPT_REPLY_SIZE, + BUS_DMASYNC_PREREAD); mpt_free_reply(mpt, reply_baddr); } @@ -844,6 +850,8 @@ mpt_complete_request_chain(struct mpt_so MSG_REQUEST_HEADER *msg_hdr; u_int cb_index; + bus_dmamap_sync(mpt->request_dmat, mpt->request_dmap, + BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); msg_hdr = (MSG_REQUEST_HEADER *)req->req_vbuf; ioc_status_frame.Function = msg_hdr->Function; ioc_status_frame.MsgContext = msg_hdr->MsgContext; @@ -1167,7 +1175,7 @@ mpt_free_request(struct mpt_softc *mpt, { request_t *nxt; struct mpt_evtf_record *record; - uint32_t reply_baddr; + uint32_t offset, reply_baddr; if (req == NULL || req != &mpt->request_pool[req->index]) { panic("mpt_free_request bad req ptr\n"); @@ -1216,8 +1224,10 @@ mpt_free_request(struct mpt_softc *mpt, req->state = REQ_STATE_ALLOCATED; mpt_assign_serno(mpt, req); mpt_send_event_ack(mpt, req, &record->reply, record->context); - reply_baddr = (uint32_t)((uint8_t *)record - mpt->reply) - + (mpt->reply_phys & 0xFFFFFFFF); + offset = (uint32_t)((uint8_t *)record - mpt->reply); + reply_baddr = offset + (mpt->reply_phys & 0xFFFFFFFF); + bus_dmamap_sync_range(mpt->reply_dmat, mpt->reply_dmap, offset, + MPT_REPLY_SIZE, BUS_DMASYNC_PREREAD); mpt_free_reply(mpt, reply_baddr); } @@ -1257,7 +1267,7 @@ mpt_send_cmd(struct mpt_softc *mpt, requ mpt_dump_request(mpt, req); } bus_dmamap_sync(mpt->request_dmat, mpt->request_dmap, - BUS_DMASYNC_PREWRITE); + BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); req->state |= REQ_STATE_QUEUED; KASSERT(mpt_req_on_free_list(mpt, req) == 0, ("req %p:%u func %x on freelist list in mpt_send_cmd", @@ -1696,8 +1706,6 @@ mpt_read_extcfg_page(struct mpt_softc *m mpt_free_request(mpt, req); return (-1); } - bus_dmamap_sync(mpt->request_dmat, mpt->request_dmap, - BUS_DMASYNC_POSTREAD); memcpy(buf, ((uint8_t *)req->req_vbuf)+MPT_RQSL(mpt), len); mpt_free_request(mpt, req); return (0); @@ -1795,8 +1803,6 @@ mpt_read_cfg_page(struct mpt_softc *mpt, mpt_free_request(mpt, req); return (-1); } - bus_dmamap_sync(mpt->request_dmat, mpt->request_dmap, - BUS_DMASYNC_POSTREAD); memcpy(hdr, ((uint8_t *)req->req_vbuf)+MPT_RQSL(mpt), len); mpt_free_request(mpt, req); return (0); @@ -2383,10 +2389,12 @@ mpt_upload_fw(struct mpt_softc *mpt) flags <<= MPI_SGE_FLAGS_SHIFT; sge->FlagsLength = htole32(flags | mpt->fw_image_size); sge->Address = htole32(mpt->fw_phys); + bus_dmamap_sync(mpt->fw_dmat, mpt->fw_dmap, BUS_DMASYNC_PREREAD); error = mpt_send_handshake_cmd(mpt, sizeof(fw_req_buf), &fw_req_buf); if (error) return(error); error = mpt_recv_handshake_reply(mpt, sizeof(fw_reply), &fw_reply); + bus_dmamap_sync(mpt->fw_dmat, mpt->fw_dmap, BUS_DMASYNC_POSTREAD); return (error); } @@ -2431,8 +2439,10 @@ mpt_download_fw(struct mpt_softc *mpt) MPI_DIAG_RW_ENABLE|MPI_DIAG_DISABLE_ARM); fw_hdr = (MpiFwHeader_t *)mpt->fw_image; + bus_dmamap_sync(mpt->fw_dmat, mpt->fw_dmap, BUS_DMASYNC_PREWRITE); mpt_diag_outsl(mpt, fw_hdr->LoadStartAddress, (uint32_t*)fw_hdr, fw_hdr->ImageSize); + bus_dmamap_sync(mpt->fw_dmat, mpt->fw_dmap, BUS_DMASYNC_POSTWRITE); ext_offset = fw_hdr->NextImageHeaderOffset; while (ext_offset != 0) { @@ -2440,9 +2450,12 @@ mpt_download_fw(struct mpt_softc *mpt) ext = (MpiExtImageHeader_t *)((uintptr_t)fw_hdr + ext_offset); ext_offset = ext->NextImageHeaderOffset; - + bus_dmamap_sync(mpt->fw_dmat, mpt->fw_dmap, + BUS_DMASYNC_PREWRITE); mpt_diag_outsl(mpt, ext->LoadStartAddress, (uint32_t*)ext, ext->ImageSize); + bus_dmamap_sync(mpt->fw_dmat, mpt->fw_dmap, + BUS_DMASYNC_POSTWRITE); } if (mpt->is_sas) { @@ -2506,7 +2519,7 @@ mpt_dma_buf_alloc(struct mpt_softc *mpt) /* Allocate some DMA accessable memory for requests */ if (bus_dmamem_alloc(mpt->request_dmat, (void **)&mpt->request, - BUS_DMA_NOWAIT, &mpt->request_dmap) != 0) { + BUS_DMA_NOWAIT | BUS_DMA_COHERENT, &mpt->request_dmap) != 0) { mpt_prt(mpt, "cannot allocate %d bytes of request memory\n", MPT_REQ_MEM_SIZE(mpt)); return (1); @@ -2714,11 +2727,12 @@ mpt_configure_ioc(struct mpt_softc *mpt, mpt->fw_image_size, 1, mpt->fw_image_size, 0, &mpt->fw_dmat); if (error != 0) { - mpt_prt(mpt, "cannot create firmwarew dma tag\n"); + mpt_prt(mpt, "cannot create firmware dma tag\n"); return (ENOMEM); } error = bus_dmamem_alloc(mpt->fw_dmat, - (void **)&mpt->fw_image, BUS_DMA_NOWAIT, &mpt->fw_dmap); + (void **)&mpt->fw_image, BUS_DMA_NOWAIT | + BUS_DMA_COHERENT, &mpt->fw_dmap); if (error != 0) { mpt_prt(mpt, "cannot allocate firmware memory\n"); bus_dma_tag_destroy(mpt->fw_dmat); Modified: stable/7/sys/dev/mpt/mpt_cam.c ============================================================================== --- stable/7/sys/dev/mpt/mpt_cam.c Mon Jul 25 16:54:31 2011 (r224334) +++ stable/7/sys/dev/mpt/mpt_cam.c Mon Jul 25 16:59:41 2011 (r224335) @@ -3585,7 +3585,6 @@ mpt_action(struct cam_sim *sim, union cc #if 0 cpi->maxio = (mpt->max_cam_seg_cnt - 1) * PAGE_SIZE; #endif - /* * FC cards report MAX_DEVICES of 512, but * the MSG_SCSI_IO_REQUEST target id field @@ -5026,15 +5025,6 @@ mpt_scsi_tgt_atio(struct mpt_softc *mpt, uint8_t *cdbp; /* - * First, DMA sync the received command- - * which is in the *request* * phys area. - * - * XXX: We could optimize this for a range - */ - bus_dmamap_sync(mpt->request_dmat, mpt->request_dmap, - BUS_DMASYNC_POSTREAD); - - /* * Stash info for the current command where we can get at it later. */ vbuf = req->req_vbuf; Modified: stable/7/sys/dev/mpt/mpt_user.c ============================================================================== --- stable/7/sys/dev/mpt/mpt_user.c Mon Jul 25 16:54:31 2011 (r224334) +++ stable/7/sys/dev/mpt/mpt_user.c Mon Jul 25 16:59:41 2011 (r224335) @@ -204,7 +204,7 @@ mpt_alloc_buffer(struct mpt_softc *mpt, if (error) return (error); error = bus_dmamem_alloc(page_mem->tag, &page_mem->vaddr, - BUS_DMA_NOWAIT, &page_mem->map); + BUS_DMA_NOWAIT | BUS_DMA_COHERENT, &page_mem->map); if (error) { bus_dma_tag_destroy(page_mem->tag); return (error); @@ -302,6 +302,8 @@ mpt_user_read_cfg_page(struct mpt_softc params.PageNumber = hdr->PageNumber; params.PageType = hdr->PageType & MPI_CONFIG_PAGETYPE_MASK; params.PageAddress = le32toh(page_req->page_address); + bus_dmamap_sync(mpt_page->tag, mpt_page->map, + BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); error = mpt_issue_cfg_req(mpt, req, ¶ms, mpt_page->paddr, le32toh(page_req->len), TRUE, 5000); if (error != 0) { @@ -312,7 +314,7 @@ mpt_user_read_cfg_page(struct mpt_softc page_req->ioc_status = htole16(req->IOCStatus); if ((req->IOCStatus & MPI_IOCSTATUS_MASK) == MPI_IOCSTATUS_SUCCESS) bus_dmamap_sync(mpt_page->tag, mpt_page->map, - BUS_DMASYNC_POSTREAD); + BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); mpt_free_request(mpt, req); return (0); } @@ -390,6 +392,8 @@ mpt_user_read_extcfg_page(struct mpt_sof params.PageAddress = le32toh(ext_page_req->page_address); params.ExtPageType = hdr->ExtPageType; params.ExtPageLength = hdr->ExtPageLength; + bus_dmamap_sync(mpt_page->tag, mpt_page->map, + BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); error = mpt_issue_cfg_req(mpt, req, ¶ms, mpt_page->paddr, le32toh(ext_page_req->len), TRUE, 5000); if (error != 0) { @@ -400,7 +404,7 @@ mpt_user_read_extcfg_page(struct mpt_sof ext_page_req->ioc_status = htole16(req->IOCStatus); if ((req->IOCStatus & MPI_IOCSTATUS_MASK) == MPI_IOCSTATUS_SUCCESS) bus_dmamap_sync(mpt_page->tag, mpt_page->map, - BUS_DMASYNC_POSTREAD); + BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); mpt_free_request(mpt, req); return (0); } @@ -435,7 +439,8 @@ mpt_user_write_cfg_page(struct mpt_softc if (req == NULL) return (ENOMEM); - bus_dmamap_sync(mpt_page->tag, mpt_page->map, BUS_DMASYNC_PREWRITE); + bus_dmamap_sync(mpt_page->tag, mpt_page->map, BUS_DMASYNC_PREREAD | + BUS_DMASYNC_PREWRITE); /* * There isn't any point in restoring stripped out attributes @@ -462,6 +467,8 @@ mpt_user_write_cfg_page(struct mpt_softc } page_req->ioc_status = htole16(req->IOCStatus); + bus_dmamap_sync(mpt_page->tag, mpt_page->map, BUS_DMASYNC_POSTREAD | + BUS_DMASYNC_POSTWRITE); mpt_free_request(mpt, req); return (0); } @@ -477,8 +484,6 @@ mpt_user_reply_handler(struct mpt_softc return (TRUE); if (reply_frame != NULL) { - bus_dmamap_sync(mpt->request_dmat, mpt->request_dmap, - BUS_DMASYNC_POSTREAD); reply = (MSG_RAID_ACTION_REPLY *)reply_frame; req->IOCStatus = le16toh(reply->IOCStatus); res = (struct mpt_user_raid_action_result *) @@ -535,7 +540,7 @@ mpt_user_raid_action(struct mpt_softc *m se = (SGE_SIMPLE32 *)&rap->ActionDataSGE; if (mpt_page->vaddr != NULL && raid_act->len != 0) { bus_dmamap_sync(mpt_page->tag, mpt_page->map, - BUS_DMASYNC_PREWRITE); + BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); se->Address = htole32(mpt_page->paddr); MPI_pSGE_SET_LENGTH(se, le32toh(raid_act->len)); MPI_pSGE_SET_FLAGS(se, (MPI_SGE_FLAGS_SIMPLE_ELEMENT | @@ -574,7 +579,7 @@ mpt_user_raid_action(struct mpt_softc *m sizeof(res->action_data)); if (mpt_page->vaddr != NULL) bus_dmamap_sync(mpt_page->tag, mpt_page->map, - BUS_DMASYNC_POSTREAD); + BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); mpt_free_request(mpt, req); return (0); } From owner-svn-src-stable@FreeBSD.ORG Mon Jul 25 17:01:14 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 64C10106568A; Mon, 25 Jul 2011 17:01:14 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5326C8FC1B; Mon, 25 Jul 2011 17:01:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PH1Eeh066251; Mon, 25 Jul 2011 17:01:14 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PH1ENt066240; Mon, 25 Jul 2011 17:01:14 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251701.p6PH1ENt066240@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 17:01:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224336 - stable/8/sys/dev/mpt X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 17:01:14 -0000 Author: marius Date: Mon Jul 25 17:01:13 2011 New Revision: 224336 URL: http://svn.freebsd.org/changeset/base/224336 Log: MFC: r220945 Correct spelling. Submitted by: brucec Modified: stable/8/sys/dev/mpt/mpt.c stable/8/sys/dev/mpt/mpt.h stable/8/sys/dev/mpt/mpt_cam.c stable/8/sys/dev/mpt/mpt_debug.c stable/8/sys/dev/mpt/mpt_pci.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/geom/label/ (props changed) Modified: stable/8/sys/dev/mpt/mpt.c ============================================================================== --- stable/8/sys/dev/mpt/mpt.c Mon Jul 25 16:59:41 2011 (r224335) +++ stable/8/sys/dev/mpt/mpt.c Mon Jul 25 17:01:13 2011 (r224336) @@ -304,28 +304,28 @@ mpt_modevent(module_t mod, int type, voi int mpt_stdload(struct mpt_personality *pers) { - /* Load is always successfull. */ + /* Load is always successful. */ return (0); } int mpt_stdprobe(struct mpt_softc *mpt) { - /* Probe is always successfull. */ + /* Probe is always successful. */ return (0); } int mpt_stdattach(struct mpt_softc *mpt) { - /* Attach is always successfull. */ + /* Attach is always successful. */ return (0); } int mpt_stdenable(struct mpt_softc *mpt) { - /* Enable is always successfull. */ + /* Enable is always successful. */ return (0); } @@ -361,7 +361,7 @@ mpt_stddetach(struct mpt_softc *mpt) int mpt_stdunload(struct mpt_personality *pers) { - /* Unload is always successfull. */ + /* Unload is always successful. */ return (0); } @@ -659,7 +659,7 @@ mpt_core_event(struct mpt_softc *mpt, re { int i; - /* Some error occured that LSI wants logged */ + /* Some error occurred that LSI wants logged */ mpt_prt(mpt, "EvtLogData: IOCLogInfo: 0x%08x\n", msg->IOCLogInfo); mpt_prt(mpt, "\tEvtLogData: Event Data:"); @@ -2354,7 +2354,7 @@ mpt_core_detach(struct mpt_softc *mpt) int mpt_core_unload(struct mpt_personality *pers) { - /* Unload is always successfull. */ + /* Unload is always successful. */ return (0); } @@ -2517,7 +2517,7 @@ mpt_dma_buf_alloc(struct mpt_softc *mpt) return (1); } - /* Allocate some DMA accessable memory for requests */ + /* Allocate some DMA accessible memory for requests */ if (bus_dmamem_alloc(mpt->request_dmat, (void **)&mpt->request, BUS_DMA_NOWAIT | BUS_DMA_COHERENT, &mpt->request_dmap) != 0) { mpt_prt(mpt, "cannot allocate %d bytes of request memory\n", @@ -2715,7 +2715,7 @@ mpt_configure_ioc(struct mpt_softc *mpt, /* * In some configurations, the IOC's firmware is * stored in a shared piece of system NVRAM that - * is only accessable via the BIOS. In this + * is only accessible via the BIOS. In this * case, the firmware keeps a copy of firmware in * RAM until the OS driver retrieves it. Once * retrieved, we are responsible for re-downloading Modified: stable/8/sys/dev/mpt/mpt.h ============================================================================== --- stable/8/sys/dev/mpt/mpt.h Mon Jul 25 16:59:41 2011 (r224335) +++ stable/8/sys/dev/mpt/mpt.h Mon Jul 25 17:01:13 2011 (r224336) @@ -371,7 +371,7 @@ struct req_entry { mpt_req_state_t state; /* Request State Information */ uint16_t index; /* Index of this entry */ uint16_t IOCStatus; /* Completion status */ - uint16_t ResponseCode; /* TMF Reponse Code */ + uint16_t ResponseCode; /* TMF Response Code */ uint16_t serno; /* serial number */ union ccb *ccb; /* CAM request */ void *req_vbuf; /* Virtual Address of Entry */ @@ -714,7 +714,7 @@ struct mpt_softc { */ int pci_msi_count; struct resource * pci_irq; /* Interrupt map for chip */ - void * ih; /* Interupt handle */ + void * ih; /* Interrupt handle */ struct mpt_pci_cfg pci_cfg; /* saved PCI conf registers */ /* @@ -1052,7 +1052,7 @@ mpt_pop_reply_queue(struct mpt_softc *mp void mpt_complete_request_chain(struct mpt_softc *, struct req_queue *, u_int); -/************************** Scatter Gather Managment **************************/ +/************************** Scatter Gather Management **************************/ /* MPT_RQSL- size of request frame, in bytes */ #define MPT_RQSL(mpt) (mpt->ioc_facts.RequestFrameSize << 2) Modified: stable/8/sys/dev/mpt/mpt_cam.c ============================================================================== --- stable/8/sys/dev/mpt/mpt_cam.c Mon Jul 25 16:59:41 2011 (r224335) +++ stable/8/sys/dev/mpt/mpt_cam.c Mon Jul 25 17:01:13 2011 (r224336) @@ -3015,7 +3015,7 @@ mpt_fc_els_reply_handler(struct mpt_soft elsbuf[1] = htobe32((ox_id << 16) | rx_id); elsbuf[2] = htobe32(0x000ffff); /* - * Dork with the reply frame so that the reponse to it + * Dork with the reply frame so that the response to it * will be correct. */ rp->Rctl_Did += ((BA_ACC - ABTS) << MPI_FC_RCTL_SHIFT); @@ -3142,7 +3142,7 @@ XXXX mpt_set_ccb_status(ccb, CAM_AUTOSENSE_FAIL); } else if ((sstate & MPI_SCSI_STATE_RESPONSE_INFO_VALID) != 0) { - /* XXX Handle SPI-Packet and FCP-2 reponse info. */ + /* XXX Handle SPI-Packet and FCP-2 response info. */ mpt_set_ccb_status(ccb, CAM_REQ_CMP_ERR); } else mpt_set_ccb_status(ccb, CAM_REQ_CMP); Modified: stable/8/sys/dev/mpt/mpt_debug.c ============================================================================== --- stable/8/sys/dev/mpt/mpt_debug.c Mon Jul 25 16:59:41 2011 (r224335) +++ stable/8/sys/dev/mpt/mpt_debug.c Mon Jul 25 17:01:13 2011 (r224336) @@ -119,15 +119,15 @@ static const struct Error_Map IOC_Status { MPI_IOCSTATUS_TARGET_NO_CONNECTION, "SCSI Target: No Connection" }, { MPI_IOCSTATUS_TARGET_XFER_COUNT_MISMATCH,"SCSI Target: Transfer Count Mismatch" }, { MPI_IOCSTATUS_TARGET_FC_ABORTED, "FC: Aborted" }, -{ MPI_IOCSTATUS_TARGET_FC_RX_ID_INVALID, "FC: Recieve ID Invalid" }, -{ MPI_IOCSTATUS_TARGET_FC_DID_INVALID, "FC: Recieve DID Invalid" }, +{ MPI_IOCSTATUS_TARGET_FC_RX_ID_INVALID, "FC: Receive ID Invalid" }, +{ MPI_IOCSTATUS_TARGET_FC_DID_INVALID, "FC: Receive DID Invalid" }, { MPI_IOCSTATUS_TARGET_FC_NODE_LOGGED_OUT,"FC: Node Logged Out" }, { MPI_IOCSTATUS_LAN_DEVICE_NOT_FOUND, "LAN: Device Not Found" }, { MPI_IOCSTATUS_LAN_DEVICE_FAILURE, "LAN: Device Not Failure" }, { MPI_IOCSTATUS_LAN_TRANSMIT_ERROR, "LAN: Transmit Error" }, { MPI_IOCSTATUS_LAN_TRANSMIT_ABORTED, "LAN: Transmit Aborted" }, -{ MPI_IOCSTATUS_LAN_RECEIVE_ERROR, "LAN: Recieve Error" }, -{ MPI_IOCSTATUS_LAN_RECEIVE_ABORTED, "LAN: Recieve Aborted" }, +{ MPI_IOCSTATUS_LAN_RECEIVE_ERROR, "LAN: Receive Error" }, +{ MPI_IOCSTATUS_LAN_RECEIVE_ABORTED, "LAN: Receive Aborted" }, { MPI_IOCSTATUS_LAN_PARTIAL_PACKET, "LAN: Partial Packet" }, { MPI_IOCSTATUS_LAN_CANCELED, "LAN: Canceled" }, { -1, 0}, Modified: stable/8/sys/dev/mpt/mpt_pci.c ============================================================================== --- stable/8/sys/dev/mpt/mpt_pci.c Mon Jul 25 16:59:41 2011 (r224335) +++ stable/8/sys/dev/mpt/mpt_pci.c Mon Jul 25 17:01:13 2011 (r224336) @@ -783,7 +783,7 @@ mpt_dma_mem_alloc(struct mpt_softc *mpt) return (1); } - /* Allocate some DMA accessable memory for replies */ + /* Allocate some DMA accessible memory for replies */ if (bus_dmamem_alloc(mpt->reply_dmat, (void **)&mpt->reply, BUS_DMA_NOWAIT, &mpt->reply_dmap) != 0) { mpt_prt(mpt, "cannot allocate %lu bytes of reply memory\n", From owner-svn-src-stable@FreeBSD.ORG Mon Jul 25 17:01:15 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0062F106568D; Mon, 25 Jul 2011 17:01:15 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E30B88FC23; Mon, 25 Jul 2011 17:01:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PH1EIM066271; Mon, 25 Jul 2011 17:01:14 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PH1EJY066265; Mon, 25 Jul 2011 17:01:14 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251701.p6PH1EJY066265@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 17:01:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224337 - stable/7/sys/dev/mpt X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 17:01:15 -0000 Author: marius Date: Mon Jul 25 17:01:14 2011 New Revision: 224337 URL: http://svn.freebsd.org/changeset/base/224337 Log: MFC: r220945 Correct spelling. Submitted by: brucec Modified: stable/7/sys/dev/mpt/mpt.c stable/7/sys/dev/mpt/mpt.h stable/7/sys/dev/mpt/mpt_cam.c stable/7/sys/dev/mpt/mpt_debug.c stable/7/sys/dev/mpt/mpt_pci.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/mpt/mpt.c ============================================================================== --- stable/7/sys/dev/mpt/mpt.c Mon Jul 25 17:01:13 2011 (r224336) +++ stable/7/sys/dev/mpt/mpt.c Mon Jul 25 17:01:14 2011 (r224337) @@ -304,28 +304,28 @@ mpt_modevent(module_t mod, int type, voi int mpt_stdload(struct mpt_personality *pers) { - /* Load is always successfull. */ + /* Load is always successful. */ return (0); } int mpt_stdprobe(struct mpt_softc *mpt) { - /* Probe is always successfull. */ + /* Probe is always successful. */ return (0); } int mpt_stdattach(struct mpt_softc *mpt) { - /* Attach is always successfull. */ + /* Attach is always successful. */ return (0); } int mpt_stdenable(struct mpt_softc *mpt) { - /* Enable is always successfull. */ + /* Enable is always successful. */ return (0); } @@ -361,7 +361,7 @@ mpt_stddetach(struct mpt_softc *mpt) int mpt_stdunload(struct mpt_personality *pers) { - /* Unload is always successfull. */ + /* Unload is always successful. */ return (0); } @@ -659,7 +659,7 @@ mpt_core_event(struct mpt_softc *mpt, re { int i; - /* Some error occured that LSI wants logged */ + /* Some error occurred that LSI wants logged */ mpt_prt(mpt, "EvtLogData: IOCLogInfo: 0x%08x\n", msg->IOCLogInfo); mpt_prt(mpt, "\tEvtLogData: Event Data:"); @@ -2354,7 +2354,7 @@ mpt_core_detach(struct mpt_softc *mpt) int mpt_core_unload(struct mpt_personality *pers) { - /* Unload is always successfull. */ + /* Unload is always successful. */ return (0); } @@ -2517,7 +2517,7 @@ mpt_dma_buf_alloc(struct mpt_softc *mpt) return (1); } - /* Allocate some DMA accessable memory for requests */ + /* Allocate some DMA accessible memory for requests */ if (bus_dmamem_alloc(mpt->request_dmat, (void **)&mpt->request, BUS_DMA_NOWAIT | BUS_DMA_COHERENT, &mpt->request_dmap) != 0) { mpt_prt(mpt, "cannot allocate %d bytes of request memory\n", @@ -2715,7 +2715,7 @@ mpt_configure_ioc(struct mpt_softc *mpt, /* * In some configurations, the IOC's firmware is * stored in a shared piece of system NVRAM that - * is only accessable via the BIOS. In this + * is only accessible via the BIOS. In this * case, the firmware keeps a copy of firmware in * RAM until the OS driver retrieves it. Once * retrieved, we are responsible for re-downloading Modified: stable/7/sys/dev/mpt/mpt.h ============================================================================== --- stable/7/sys/dev/mpt/mpt.h Mon Jul 25 17:01:13 2011 (r224336) +++ stable/7/sys/dev/mpt/mpt.h Mon Jul 25 17:01:14 2011 (r224337) @@ -371,7 +371,7 @@ struct req_entry { mpt_req_state_t state; /* Request State Information */ uint16_t index; /* Index of this entry */ uint16_t IOCStatus; /* Completion status */ - uint16_t ResponseCode; /* TMF Reponse Code */ + uint16_t ResponseCode; /* TMF Response Code */ uint16_t serno; /* serial number */ union ccb *ccb; /* CAM request */ void *req_vbuf; /* Virtual Address of Entry */ @@ -714,7 +714,7 @@ struct mpt_softc { */ int pci_msi_count; struct resource * pci_irq; /* Interrupt map for chip */ - void * ih; /* Interupt handle */ + void * ih; /* Interrupt handle */ struct mpt_pci_cfg pci_cfg; /* saved PCI conf registers */ /* @@ -1052,7 +1052,7 @@ mpt_pop_reply_queue(struct mpt_softc *mp void mpt_complete_request_chain(struct mpt_softc *, struct req_queue *, u_int); -/************************** Scatter Gather Managment **************************/ +/************************** Scatter Gather Management **************************/ /* MPT_RQSL- size of request frame, in bytes */ #define MPT_RQSL(mpt) (mpt->ioc_facts.RequestFrameSize << 2) Modified: stable/7/sys/dev/mpt/mpt_cam.c ============================================================================== --- stable/7/sys/dev/mpt/mpt_cam.c Mon Jul 25 17:01:13 2011 (r224336) +++ stable/7/sys/dev/mpt/mpt_cam.c Mon Jul 25 17:01:14 2011 (r224337) @@ -3015,7 +3015,7 @@ mpt_fc_els_reply_handler(struct mpt_soft elsbuf[1] = htobe32((ox_id << 16) | rx_id); elsbuf[2] = htobe32(0x000ffff); /* - * Dork with the reply frame so that the reponse to it + * Dork with the reply frame so that the response to it * will be correct. */ rp->Rctl_Did += ((BA_ACC - ABTS) << MPI_FC_RCTL_SHIFT); @@ -3142,7 +3142,7 @@ XXXX mpt_set_ccb_status(ccb, CAM_AUTOSENSE_FAIL); } else if ((sstate & MPI_SCSI_STATE_RESPONSE_INFO_VALID) != 0) { - /* XXX Handle SPI-Packet and FCP-2 reponse info. */ + /* XXX Handle SPI-Packet and FCP-2 response info. */ mpt_set_ccb_status(ccb, CAM_REQ_CMP_ERR); } else mpt_set_ccb_status(ccb, CAM_REQ_CMP); Modified: stable/7/sys/dev/mpt/mpt_debug.c ============================================================================== --- stable/7/sys/dev/mpt/mpt_debug.c Mon Jul 25 17:01:13 2011 (r224336) +++ stable/7/sys/dev/mpt/mpt_debug.c Mon Jul 25 17:01:14 2011 (r224337) @@ -119,15 +119,15 @@ static const struct Error_Map IOC_Status { MPI_IOCSTATUS_TARGET_NO_CONNECTION, "SCSI Target: No Connection" }, { MPI_IOCSTATUS_TARGET_XFER_COUNT_MISMATCH,"SCSI Target: Transfer Count Mismatch" }, { MPI_IOCSTATUS_TARGET_FC_ABORTED, "FC: Aborted" }, -{ MPI_IOCSTATUS_TARGET_FC_RX_ID_INVALID, "FC: Recieve ID Invalid" }, -{ MPI_IOCSTATUS_TARGET_FC_DID_INVALID, "FC: Recieve DID Invalid" }, +{ MPI_IOCSTATUS_TARGET_FC_RX_ID_INVALID, "FC: Receive ID Invalid" }, +{ MPI_IOCSTATUS_TARGET_FC_DID_INVALID, "FC: Receive DID Invalid" }, { MPI_IOCSTATUS_TARGET_FC_NODE_LOGGED_OUT,"FC: Node Logged Out" }, { MPI_IOCSTATUS_LAN_DEVICE_NOT_FOUND, "LAN: Device Not Found" }, { MPI_IOCSTATUS_LAN_DEVICE_FAILURE, "LAN: Device Not Failure" }, { MPI_IOCSTATUS_LAN_TRANSMIT_ERROR, "LAN: Transmit Error" }, { MPI_IOCSTATUS_LAN_TRANSMIT_ABORTED, "LAN: Transmit Aborted" }, -{ MPI_IOCSTATUS_LAN_RECEIVE_ERROR, "LAN: Recieve Error" }, -{ MPI_IOCSTATUS_LAN_RECEIVE_ABORTED, "LAN: Recieve Aborted" }, +{ MPI_IOCSTATUS_LAN_RECEIVE_ERROR, "LAN: Receive Error" }, +{ MPI_IOCSTATUS_LAN_RECEIVE_ABORTED, "LAN: Receive Aborted" }, { MPI_IOCSTATUS_LAN_PARTIAL_PACKET, "LAN: Partial Packet" }, { MPI_IOCSTATUS_LAN_CANCELED, "LAN: Canceled" }, { -1, 0}, Modified: stable/7/sys/dev/mpt/mpt_pci.c ============================================================================== --- stable/7/sys/dev/mpt/mpt_pci.c Mon Jul 25 17:01:13 2011 (r224336) +++ stable/7/sys/dev/mpt/mpt_pci.c Mon Jul 25 17:01:14 2011 (r224337) @@ -783,7 +783,7 @@ mpt_dma_mem_alloc(struct mpt_softc *mpt) return (1); } - /* Allocate some DMA accessable memory for replies */ + /* Allocate some DMA accessible memory for replies */ if (bus_dmamem_alloc(mpt->reply_dmat, (void **)&mpt->reply, BUS_DMA_NOWAIT, &mpt->reply_dmap) != 0) { mpt_prt(mpt, "cannot allocate %lu bytes of reply memory\n", From owner-svn-src-stable@FreeBSD.ORG Mon Jul 25 17:12:53 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 687281065674; Mon, 25 Jul 2011 17:12:53 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 57D8C8FC08; Mon, 25 Jul 2011 17:12:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PHCr0c066682; Mon, 25 Jul 2011 17:12:53 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PHCqkR066679; Mon, 25 Jul 2011 17:12:52 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251712.p6PHCqkR066679@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 17:12:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224338 - stable/8/sys/dev/esp X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 17:12:53 -0000 Author: marius Date: Mon Jul 25 17:12:52 2011 New Revision: 224338 URL: http://svn.freebsd.org/changeset/base/224338 Log: MFC: r220951 Correct spelling in comments. Submitted by: brucec Modified: stable/8/sys/dev/esp/ncr53c9x.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/geom/label/ (props changed) Modified: stable/8/sys/dev/esp/ncr53c9x.c ============================================================================== --- stable/8/sys/dev/esp/ncr53c9x.c Mon Jul 25 17:01:14 2011 (r224337) +++ stable/8/sys/dev/esp/ncr53c9x.c Mon Jul 25 17:12:52 2011 (r224338) @@ -2560,7 +2560,7 @@ again: * XXX This will cause a chip reset and will * prevent us from finding out the real * problem with the device. However, it's - * neccessary until a way can be found to + * necessary until a way can be found to * safely cancel the DMA that is in * progress. */ From owner-svn-src-stable@FreeBSD.ORG Mon Jul 25 17:12:56 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 12855106564A; Mon, 25 Jul 2011 17:12:56 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 020238FC1A; Mon, 25 Jul 2011 17:12:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PHCtQD066715; Mon, 25 Jul 2011 17:12:55 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PHCt0A066713; Mon, 25 Jul 2011 17:12:55 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251712.p6PHCt0A066713@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 17:12:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224339 - stable/7/sys/dev/esp X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 17:12:56 -0000 Author: marius Date: Mon Jul 25 17:12:55 2011 New Revision: 224339 URL: http://svn.freebsd.org/changeset/base/224339 Log: MFC: r220951 Correct spelling in comments. Submitted by: brucec Modified: stable/7/sys/dev/esp/ncr53c9x.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/esp/ncr53c9x.c ============================================================================== --- stable/7/sys/dev/esp/ncr53c9x.c Mon Jul 25 17:12:52 2011 (r224338) +++ stable/7/sys/dev/esp/ncr53c9x.c Mon Jul 25 17:12:55 2011 (r224339) @@ -2560,7 +2560,7 @@ again: * XXX This will cause a chip reset and will * prevent us from finding out the real * problem with the device. However, it's - * neccessary until a way can be found to + * necessary until a way can be found to * safely cancel the DMA that is in * progress. */ From owner-svn-src-stable@FreeBSD.ORG Mon Jul 25 17:14:49 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 647941065670; Mon, 25 Jul 2011 17:14:49 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 541548FC0C; Mon, 25 Jul 2011 17:14:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PHEnJB066831; Mon, 25 Jul 2011 17:14:49 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PHEnq3066829; Mon, 25 Jul 2011 17:14:49 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251714.p6PHEnq3066829@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 17:14:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224340 - stable/8/sys/dev/bge X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 17:14:49 -0000 Author: marius Date: Mon Jul 25 17:14:49 2011 New Revision: 224340 URL: http://svn.freebsd.org/changeset/base/224340 Log: MFC: r221344 Correct spelling in comments. Submitted by: brucec Modified: stable/8/sys/dev/bge/if_bge.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/geom/label/ (props changed) Modified: stable/8/sys/dev/bge/if_bge.c ============================================================================== --- stable/8/sys/dev/bge/if_bge.c Mon Jul 25 17:12:55 2011 (r224339) +++ stable/8/sys/dev/bge/if_bge.c Mon Jul 25 17:14:49 2011 (r224340) @@ -39,7 +39,7 @@ __FBSDID("$FreeBSD$"); * * The Broadcom BCM5700 is based on technology originally developed by * Alteon Networks as part of the Tigon I and Tigon II gigabit ethernet - * MAC chips. The BCM5700, sometimes refered to as the Tigon III, has + * MAC chips. The BCM5700, sometimes referred to as the Tigon III, has * two on-board MIPS R4000 CPUs and can have as much as 16MB of external * SSRAM. The BCM5700 supports TCP, UDP and IP checksum offload, jumbo * frames, highly configurable RX filtering, and 16 RX and TX queues @@ -3513,7 +3513,7 @@ bge_reset(struct bge_softc *sc) pci_write_config(dev, sc->bge_pcixcap + PCIXR_COMMAND, devctl, 2); } - /* Re-enable MSI, if neccesary, and enable the memory arbiter. */ + /* Re-enable MSI, if necessary, and enable the memory arbiter. */ if (BGE_IS_5714_FAMILY(sc)) { /* This chip disables MSI on reset. */ if (sc->bge_flags & BGE_FLAG_MSI) { From owner-svn-src-stable@FreeBSD.ORG Mon Jul 25 17:14:57 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C43E0106576B; Mon, 25 Jul 2011 17:14:56 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 00C298FC15; Mon, 25 Jul 2011 17:14:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PHEtBw066870; Mon, 25 Jul 2011 17:14:55 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PHEt3J066868; Mon, 25 Jul 2011 17:14:55 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251714.p6PHEt3J066868@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 17:14:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224341 - stable/7/sys/dev/bge X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 17:14:57 -0000 Author: marius Date: Mon Jul 25 17:14:55 2011 New Revision: 224341 URL: http://svn.freebsd.org/changeset/base/224341 Log: MFC: r221344 Correct spelling in comments. Submitted by: brucec Modified: stable/7/sys/dev/bge/if_bge.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/bge/if_bge.c ============================================================================== --- stable/7/sys/dev/bge/if_bge.c Mon Jul 25 17:14:49 2011 (r224340) +++ stable/7/sys/dev/bge/if_bge.c Mon Jul 25 17:14:55 2011 (r224341) @@ -39,7 +39,7 @@ __FBSDID("$FreeBSD$"); * * The Broadcom BCM5700 is based on technology originally developed by * Alteon Networks as part of the Tigon I and Tigon II gigabit ethernet - * MAC chips. The BCM5700, sometimes refered to as the Tigon III, has + * MAC chips. The BCM5700, sometimes referred to as the Tigon III, has * two on-board MIPS R4000 CPUs and can have as much as 16MB of external * SSRAM. The BCM5700 supports TCP, UDP and IP checksum offload, jumbo * frames, highly configurable RX filtering, and 16 RX and TX queues @@ -3513,7 +3513,7 @@ bge_reset(struct bge_softc *sc) pci_write_config(dev, sc->bge_pcixcap + PCIXR_COMMAND, devctl, 2); } - /* Re-enable MSI, if neccesary, and enable the memory arbiter. */ + /* Re-enable MSI, if necessary, and enable the memory arbiter. */ if (BGE_IS_5714_FAMILY(sc)) { /* This chip disables MSI on reset. */ if (sc->bge_flags & BGE_FLAG_MSI) { From owner-svn-src-stable@FreeBSD.ORG Mon Jul 25 17:18:46 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9232F106566B; Mon, 25 Jul 2011 17:18:46 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 819578FC0A; Mon, 25 Jul 2011 17:18:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PHIkAs067050; Mon, 25 Jul 2011 17:18:46 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PHIkVe067048; Mon, 25 Jul 2011 17:18:46 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251718.p6PHIkVe067048@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 17:18:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224342 - stable/8/sbin/ifconfig X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 17:18:46 -0000 Author: marius Date: Mon Jul 25 17:18:46 2011 New Revision: 224342 URL: http://svn.freebsd.org/changeset/base/224342 Log: MFC: r221954 When setting media always and not just in case of switching to IFM_AUTO clear the options of the current media, i.e. only inherit the instance, which matches what NetBSD does. Without this it's really non-intuitive that the following sequence: ifconfig bge0 media 1000baseT mediaopt full-duplex ifconfig bge0 media 100baseTX results in 100baseTX full-duplex to be set or that: ifconfig bge0 media autoselect mediaopt flowcontrol ifconfig bge0 media 1000baseT mediaopt full-duplex tries to set 1000baseT full-duplex with flowcontrol, which isn't suported und thus fails while the following: ifconfig re0 media 1000baseT mediaopt flowcontrol,full-duplex ifconfig re0 media autoselect just switches to autoselection without flowcontrol. Modified: stable/8/sbin/ifconfig/ifmedia.c Directory Properties: stable/8/sbin/ifconfig/ (props changed) Modified: stable/8/sbin/ifconfig/ifmedia.c ============================================================================== --- stable/8/sbin/ifconfig/ifmedia.c Mon Jul 25 17:14:55 2011 (r224341) +++ stable/8/sbin/ifconfig/ifmedia.c Mon Jul 25 17:18:46 2011 (r224342) @@ -272,13 +272,9 @@ setmedia(const char *val, int d, int s, subtype = get_media_subtype(IFM_TYPE(ifmr->ifm_ulist[0]), val); strncpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); - ifr.ifr_media = (ifmr->ifm_current & ~(IFM_NMASK|IFM_TMASK)) | + ifr.ifr_media = (ifmr->ifm_current & IFM_IMASK) | IFM_TYPE(ifmr->ifm_ulist[0]) | subtype; - if ((ifr.ifr_media & IFM_TMASK) == 0) { - ifr.ifr_media &= ~(IFM_GMASK | IFM_OMASK); - } - ifmr->ifm_current = ifr.ifr_media; callback_register(setifmediacallback, (void *)ifmr); } From owner-svn-src-stable@FreeBSD.ORG Mon Jul 25 17:18:48 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 54AA21065673; Mon, 25 Jul 2011 17:18:48 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 444658FC12; Mon, 25 Jul 2011 17:18:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PHImwY067085; Mon, 25 Jul 2011 17:18:48 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PHIm88067083; Mon, 25 Jul 2011 17:18:48 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251718.p6PHIm88067083@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 17:18:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224343 - stable/7/sbin/ifconfig X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 17:18:48 -0000 Author: marius Date: Mon Jul 25 17:18:47 2011 New Revision: 224343 URL: http://svn.freebsd.org/changeset/base/224343 Log: MFC: r221954 When setting media always and not just in case of switching to IFM_AUTO clear the options of the current media, i.e. only inherit the instance, which matches what NetBSD does. Without this it's really non-intuitive that the following sequence: ifconfig bge0 media 1000baseT mediaopt full-duplex ifconfig bge0 media 100baseTX results in 100baseTX full-duplex to be set or that: ifconfig bge0 media autoselect mediaopt flowcontrol ifconfig bge0 media 1000baseT mediaopt full-duplex tries to set 1000baseT full-duplex with flowcontrol, which isn't suported und thus fails while the following: ifconfig re0 media 1000baseT mediaopt flowcontrol,full-duplex ifconfig re0 media autoselect just switches to autoselection without flowcontrol. Modified: stable/7/sbin/ifconfig/ifmedia.c Directory Properties: stable/7/sbin/ifconfig/ (props changed) Modified: stable/7/sbin/ifconfig/ifmedia.c ============================================================================== --- stable/7/sbin/ifconfig/ifmedia.c Mon Jul 25 17:18:46 2011 (r224342) +++ stable/7/sbin/ifconfig/ifmedia.c Mon Jul 25 17:18:47 2011 (r224343) @@ -263,13 +263,9 @@ setmedia(const char *val, int d, int s, subtype = get_media_subtype(IFM_TYPE(ifmr->ifm_ulist[0]), val); strncpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); - ifr.ifr_media = (ifmr->ifm_current & ~(IFM_NMASK|IFM_TMASK)) | + ifr.ifr_media = (ifmr->ifm_current & IFM_IMASK) | IFM_TYPE(ifmr->ifm_ulist[0]) | subtype; - if ((ifr.ifr_media & IFM_TMASK) == 0) { - ifr.ifr_media &= ~(IFM_GMASK | IFM_OMASK); - } - ifmr->ifm_current = ifr.ifr_media; callback_register(setifmediacallback, (void *)ifmr); } From owner-svn-src-stable@FreeBSD.ORG Mon Jul 25 17:20:33 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 963F51065675; Mon, 25 Jul 2011 17:20:33 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6CCDB8FC1C; Mon, 25 Jul 2011 17:20:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PHKXid067208; Mon, 25 Jul 2011 17:20:33 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PHKX1a067206; Mon, 25 Jul 2011 17:20:33 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251720.p6PHKX1a067206@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 17:20:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224344 - stable/7/sys/net X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 17:20:33 -0000 Author: marius Date: Mon Jul 25 17:20:33 2011 New Revision: 224344 URL: http://svn.freebsd.org/changeset/base/224344 Log: MFC: r221955 - Add 10baseT as an alias for 10baseT/UTP. - Add shorthand aliases for common media+option combinations as announced by miibus(4) so that one can actually supply the media strings found in the dmesg output to ifconfig(8). Obtained from: NetBSD (in principle) Modified: stable/7/sys/net/if_media.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/net/if_media.h ============================================================================== --- stable/7/sys/net/if_media.h Mon Jul 25 17:18:47 2011 (r224343) +++ stable/7/sys/net/if_media.h Mon Jul 25 17:20:33 2011 (r224344) @@ -369,6 +369,7 @@ struct ifmedia_description { } #define IFM_SUBTYPE_ETHERNET_ALIASES { \ + { IFM_10_T, "10baseT" }, \ { IFM_10_T, "UTP" }, \ { IFM_10_T, "10UTP" }, \ { IFM_10_2, "BNC" }, \ @@ -388,6 +389,23 @@ struct ifmedia_description { { IFM_1000_T, "1000TX" }, \ { IFM_1000_T, "1000T" }, \ { IFM_2500_SX, "2500SX" }, \ + \ + /* \ + * Shorthands for common media+option combinations as announced \ + * by miibus(4) \ + */ \ + { IFM_10_T | IFM_FDX, "10baseT-FDX" }, \ + { IFM_10_T | IFM_FDX | IFM_FLOW, "10baseT-FDX-flow" }, \ + { IFM_100_TX | IFM_FDX, "100baseTX-FDX" }, \ + { IFM_100_TX | IFM_FDX | IFM_FLOW, "100baseTX-FDX-flow" }, \ + { IFM_1000_T | IFM_FDX, "1000baseT-FDX" }, \ + { IFM_1000_T | IFM_FDX | IFM_FLOW, "1000baseT-FDX-flow" }, \ + { IFM_1000_T | IFM_FDX | IFM_FLOW | IFM_ETH_MASTER, \ + "1000baseT-FDX-flow-master" }, \ + { IFM_1000_T | IFM_FDX | IFM_ETH_MASTER, \ + "1000baseT-FDX-master" }, \ + { IFM_1000_T | IFM_ETH_MASTER, "1000baseT-master" }, \ + \ { 0, NULL }, \ } @@ -580,6 +598,13 @@ struct ifmedia_description { #define IFM_SUBTYPE_SHARED_ALIASES { \ { IFM_AUTO, "auto" }, \ + \ + /* \ + * Shorthands for common media+option combinations as announced \ + * by miibus(4) \ + */ \ + { IFM_AUTO | IFM_FLOW, "auto-flow" }, \ + \ { 0, NULL }, \ } From owner-svn-src-stable@FreeBSD.ORG Mon Jul 25 17:20:36 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B7220106566C; Mon, 25 Jul 2011 17:20:36 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A6CE28FC08; Mon, 25 Jul 2011 17:20:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PHKaPS067239; Mon, 25 Jul 2011 17:20:36 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PHKaJF067237; Mon, 25 Jul 2011 17:20:36 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251720.p6PHKaJF067237@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 17:20:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224345 - stable/8/sys/net X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 17:20:36 -0000 Author: marius Date: Mon Jul 25 17:20:36 2011 New Revision: 224345 URL: http://svn.freebsd.org/changeset/base/224345 Log: MFC: r221955 - Add 10baseT as an alias for 10baseT/UTP. - Add shorthand aliases for common media+option combinations as announced by miibus(4) so that one can actually supply the media strings found in the dmesg output to ifconfig(8). Obtained from: NetBSD (in principle) Modified: stable/8/sys/net/if_media.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/geom/label/ (props changed) Modified: stable/8/sys/net/if_media.h ============================================================================== --- stable/8/sys/net/if_media.h Mon Jul 25 17:20:33 2011 (r224344) +++ stable/8/sys/net/if_media.h Mon Jul 25 17:20:36 2011 (r224345) @@ -370,6 +370,7 @@ struct ifmedia_description { } #define IFM_SUBTYPE_ETHERNET_ALIASES { \ + { IFM_10_T, "10baseT" }, \ { IFM_10_T, "UTP" }, \ { IFM_10_T, "10UTP" }, \ { IFM_10_2, "BNC" }, \ @@ -389,6 +390,23 @@ struct ifmedia_description { { IFM_1000_T, "1000TX" }, \ { IFM_1000_T, "1000T" }, \ { IFM_2500_SX, "2500SX" }, \ + \ + /* \ + * Shorthands for common media+option combinations as announced \ + * by miibus(4) \ + */ \ + { IFM_10_T | IFM_FDX, "10baseT-FDX" }, \ + { IFM_10_T | IFM_FDX | IFM_FLOW, "10baseT-FDX-flow" }, \ + { IFM_100_TX | IFM_FDX, "100baseTX-FDX" }, \ + { IFM_100_TX | IFM_FDX | IFM_FLOW, "100baseTX-FDX-flow" }, \ + { IFM_1000_T | IFM_FDX, "1000baseT-FDX" }, \ + { IFM_1000_T | IFM_FDX | IFM_FLOW, "1000baseT-FDX-flow" }, \ + { IFM_1000_T | IFM_FDX | IFM_FLOW | IFM_ETH_MASTER, \ + "1000baseT-FDX-flow-master" }, \ + { IFM_1000_T | IFM_FDX | IFM_ETH_MASTER, \ + "1000baseT-FDX-master" }, \ + { IFM_1000_T | IFM_ETH_MASTER, "1000baseT-master" }, \ + \ { 0, NULL }, \ } @@ -582,6 +600,13 @@ struct ifmedia_description { #define IFM_SUBTYPE_SHARED_ALIASES { \ { IFM_AUTO, "auto" }, \ + \ + /* \ + * Shorthands for common media+option combinations as announced \ + * by miibus(4) \ + */ \ + { IFM_AUTO | IFM_FLOW, "auto-flow" }, \ + \ { 0, NULL }, \ } From owner-svn-src-stable@FreeBSD.ORG Mon Jul 25 17:31:09 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EEBCC1065674; Mon, 25 Jul 2011 17:31:09 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DE38D8FC21; Mon, 25 Jul 2011 17:31:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PHV9cp067637; Mon, 25 Jul 2011 17:31:09 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PHV9me067633; Mon, 25 Jul 2011 17:31:09 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251731.p6PHV9me067633@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 17:31:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224346 - stable/8/sys/dev/mk48txx X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 17:31:10 -0000 Author: marius Date: Mon Jul 25 17:31:09 2011 New Revision: 224346 URL: http://svn.freebsd.org/changeset/base/224346 Log: MFC: r221957 Add support for MK48T37. Modified: stable/8/sys/dev/mk48txx/mk48txx.c stable/8/sys/dev/mk48txx/mk48txxreg.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/geom/label/ (props changed) Modified: stable/8/sys/dev/mk48txx/mk48txx.c ============================================================================== --- stable/8/sys/dev/mk48txx/mk48txx.c Mon Jul 25 17:20:36 2011 (r224345) +++ stable/8/sys/dev/mk48txx/mk48txx.c Mon Jul 25 17:31:09 2011 (r224346) @@ -33,7 +33,8 @@ __FBSDID("$FreeBSD$"); /* - * Mostek MK48T02, MK48T08, MK48T18, MK48T59 time-of-day chip subroutines + * Mostek MK48T02, MK48T08, MK48T18, MK48T37 and MK48T59 time-of-day chip + * subroutines */ #include @@ -67,6 +68,7 @@ static const struct { { "mk48t02", MK48T02_CLKSZ, MK48T02_CLKOFF, 0 }, { "mk48t08", MK48T08_CLKSZ, MK48T08_CLKOFF, 0 }, { "mk48t18", MK48T18_CLKSZ, MK48T18_CLKOFF, 0 }, + { "mk48t37", MK48T37_CLKSZ, MK48T37_CLKOFF, MK48TXX_EXT_REGISTERS }, { "mk48t59", MK48T59_CLKSZ, MK48T59_CLKOFF, MK48TXX_EXT_REGISTERS }, }; Modified: stable/8/sys/dev/mk48txx/mk48txxreg.h ============================================================================== --- stable/8/sys/dev/mk48txx/mk48txxreg.h Mon Jul 25 17:20:36 2011 (r224345) +++ stable/8/sys/dev/mk48txx/mk48txxreg.h Mon Jul 25 17:31:09 2011 (r224346) @@ -152,5 +152,8 @@ #define MK48T18_CLKSZ 8192 #define MK48T18_CLKOFF 0x1ff0 +#define MK48T37_CLKSZ 32768 +#define MK48T37_CLKOFF 0x1ff0 + #define MK48T59_CLKSZ 8192 #define MK48T59_CLKOFF 0x1ff0 From owner-svn-src-stable@FreeBSD.ORG Mon Jul 25 17:31:10 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 233C41065675; Mon, 25 Jul 2011 17:31:10 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 12B278FC12; Mon, 25 Jul 2011 17:31:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PHV9md067644; Mon, 25 Jul 2011 17:31:09 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PHV9tc067641; Mon, 25 Jul 2011 17:31:09 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251731.p6PHV9tc067641@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 17:31:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224347 - stable/7/sys/dev/mk48txx X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 17:31:10 -0000 Author: marius Date: Mon Jul 25 17:31:09 2011 New Revision: 224347 URL: http://svn.freebsd.org/changeset/base/224347 Log: MFC: r221957 Add support for MK48T37. Modified: stable/7/sys/dev/mk48txx/mk48txx.c stable/7/sys/dev/mk48txx/mk48txxreg.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/mk48txx/mk48txx.c ============================================================================== --- stable/7/sys/dev/mk48txx/mk48txx.c Mon Jul 25 17:31:09 2011 (r224346) +++ stable/7/sys/dev/mk48txx/mk48txx.c Mon Jul 25 17:31:09 2011 (r224347) @@ -33,7 +33,8 @@ __FBSDID("$FreeBSD$"); /* - * Mostek MK48T02, MK48T08, MK48T18, MK48T59 time-of-day chip subroutines + * Mostek MK48T02, MK48T08, MK48T18, MK48T37 and MK48T59 time-of-day chip + * subroutines */ #include @@ -67,6 +68,7 @@ static const struct { { "mk48t02", MK48T02_CLKSZ, MK48T02_CLKOFF, 0 }, { "mk48t08", MK48T08_CLKSZ, MK48T08_CLKOFF, 0 }, { "mk48t18", MK48T18_CLKSZ, MK48T18_CLKOFF, 0 }, + { "mk48t37", MK48T37_CLKSZ, MK48T37_CLKOFF, MK48TXX_EXT_REGISTERS }, { "mk48t59", MK48T59_CLKSZ, MK48T59_CLKOFF, MK48TXX_EXT_REGISTERS }, }; Modified: stable/7/sys/dev/mk48txx/mk48txxreg.h ============================================================================== --- stable/7/sys/dev/mk48txx/mk48txxreg.h Mon Jul 25 17:31:09 2011 (r224346) +++ stable/7/sys/dev/mk48txx/mk48txxreg.h Mon Jul 25 17:31:09 2011 (r224347) @@ -152,5 +152,8 @@ #define MK48T18_CLKSZ 8192 #define MK48T18_CLKOFF 0x1ff0 +#define MK48T37_CLKSZ 32768 +#define MK48T37_CLKOFF 0x1ff0 + #define MK48T59_CLKSZ 8192 #define MK48T59_CLKOFF 0x1ff0 From owner-svn-src-stable@FreeBSD.ORG Mon Jul 25 17:32:22 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A534B106566C; Mon, 25 Jul 2011 17:32:22 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 94C428FC15; Mon, 25 Jul 2011 17:32:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PHWM4u067771; Mon, 25 Jul 2011 17:32:22 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PHWM5A067766; Mon, 25 Jul 2011 17:32:22 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251732.p6PHWM5A067766@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 17:32:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224348 - stable/8/sys/sparc64/sparc64 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 17:32:22 -0000 Author: marius Date: Mon Jul 25 17:32:22 2011 New Revision: 224348 URL: http://svn.freebsd.org/changeset/base/224348 Log: MFC: r221958 Recognize the eeprom device found in Fujitsu PRIMEPOWER650 and 900. Modified: stable/8/sys/sparc64/sparc64/eeprom.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/geom/label/ (props changed) Modified: stable/8/sys/sparc64/sparc64/eeprom.c ============================================================================== --- stable/8/sys/sparc64/sparc64/eeprom.c Mon Jul 25 17:31:09 2011 (r224347) +++ stable/8/sys/sparc64/sparc64/eeprom.c Mon Jul 25 17:32:22 2011 (r224348) @@ -107,8 +107,11 @@ DRIVER_MODULE(eeprom, sbus, eeprom_drive static int eeprom_probe(device_t dev) { + const char *name; - if (strcmp("eeprom", ofw_bus_get_name(dev)) == 0) { + name = ofw_bus_get_name(dev); + if (strcmp(name, "eeprom") == 0 || + strcmp(name, "FJSV,eeprom") == 0) { device_set_desc(dev, "EEPROM/clock"); return (0); } From owner-svn-src-stable@FreeBSD.ORG Mon Jul 25 17:32:22 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D19A81065670; Mon, 25 Jul 2011 17:32:22 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C10278FC1A; Mon, 25 Jul 2011 17:32:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PHWMjK067777; Mon, 25 Jul 2011 17:32:22 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PHWMi6067775; Mon, 25 Jul 2011 17:32:22 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251732.p6PHWMi6067775@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 17:32:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224349 - stable/7/sys/sparc64/sparc64 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 17:32:22 -0000 Author: marius Date: Mon Jul 25 17:32:22 2011 New Revision: 224349 URL: http://svn.freebsd.org/changeset/base/224349 Log: MFC: r221958 Recognize the eeprom device found in Fujitsu PRIMEPOWER650 and 900. Modified: stable/7/sys/sparc64/sparc64/eeprom.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/sparc64/sparc64/eeprom.c ============================================================================== --- stable/7/sys/sparc64/sparc64/eeprom.c Mon Jul 25 17:32:22 2011 (r224348) +++ stable/7/sys/sparc64/sparc64/eeprom.c Mon Jul 25 17:32:22 2011 (r224349) @@ -107,8 +107,11 @@ DRIVER_MODULE(eeprom, sbus, eeprom_drive static int eeprom_probe(device_t dev) { + const char *name; - if (strcmp("eeprom", ofw_bus_get_name(dev)) == 0) { + name = ofw_bus_get_name(dev); + if (strcmp(name, "eeprom") == 0 || + strcmp(name, "FJSV,eeprom") == 0) { device_set_desc(dev, "EEPROM/clock"); return (0); } From owner-svn-src-stable@FreeBSD.ORG Mon Jul 25 17:37:53 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B065D106566B; Mon, 25 Jul 2011 17:37:53 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 869B98FC16; Mon, 25 Jul 2011 17:37:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PHbrE3068057; Mon, 25 Jul 2011 17:37:53 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PHbrMA068054; Mon, 25 Jul 2011 17:37:53 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251737.p6PHbrMA068054@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 17:37:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224350 - in stable/8/sys/dev: scc uart X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 17:37:53 -0000 Author: marius Date: Mon Jul 25 17:37:53 2011 New Revision: 224350 URL: http://svn.freebsd.org/changeset/base/224350 Log: MFC: r221960 Recognize the SAB 82532 found in Fujitsu PRIMEPOWER650 and 900. Modified: stable/8/sys/dev/scc/scc_bfe_ebus.c stable/8/sys/dev/uart/uart_cpu_sparc64.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/geom/label/ (props changed) Modified: stable/8/sys/dev/scc/scc_bfe_ebus.c ============================================================================== --- stable/8/sys/dev/scc/scc_bfe_ebus.c Mon Jul 25 17:32:22 2011 (r224349) +++ stable/8/sys/dev/scc/scc_bfe_ebus.c Mon Jul 25 17:37:53 2011 (r224350) @@ -56,7 +56,8 @@ scc_ebus_probe(device_t dev) cmpt = ofw_bus_get_compat(dev); if (cmpt == NULL) cmpt = ""; - if (!strcmp(nm, "se") || !strcmp(cmpt, "sab82532")) { + if (!strcmp(nm, "se") || !strcmp(nm, "FJSV,se") || + !strcmp(cmpt, "sab82532")) { device_set_desc(dev, "Siemens SAB 82532 dual channel SCC"); sc->sc_class = &scc_sab82532_class; return (scc_bfe_probe(dev, EBUS_REGSHFT, EBUS_RCLK, 0)); Modified: stable/8/sys/dev/uart/uart_cpu_sparc64.c ============================================================================== --- stable/8/sys/dev/uart/uart_cpu_sparc64.c Mon Jul 25 17:32:22 2011 (r224349) +++ stable/8/sys/dev/uart/uart_cpu_sparc64.c Mon Jul 25 17:37:53 2011 (r224350) @@ -230,7 +230,8 @@ uart_cpu_getdev(int devtype, struct uart di->bas.regshft = 0; di->bas.rclk = 0; class = NULL; - if (!strcmp(buf, "se") || !strcmp(compat, "sab82532")) { + if (!strcmp(buf, "se") || !strcmp(buf, "FJSV,se") || + !strcmp(compat, "sab82532")) { class = &uart_sab82532_class; /* SAB82532 are only known to be used for TTYs. */ if ((di->bas.chan = uart_cpu_channel(dev)) == 0) From owner-svn-src-stable@FreeBSD.ORG Mon Jul 25 17:37:54 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D0EFE1065672; Mon, 25 Jul 2011 17:37:54 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C076C8FC1D; Mon, 25 Jul 2011 17:37:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PHbsaY068088; Mon, 25 Jul 2011 17:37:54 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PHbs3I068085; Mon, 25 Jul 2011 17:37:54 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251737.p6PHbs3I068085@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 17:37:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224351 - in stable/7/sys/dev: scc uart X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 17:37:54 -0000 Author: marius Date: Mon Jul 25 17:37:54 2011 New Revision: 224351 URL: http://svn.freebsd.org/changeset/base/224351 Log: MFC: r221960 Recognize the SAB 82532 found in Fujitsu PRIMEPOWER650 and 900. Modified: stable/7/sys/dev/scc/scc_bfe_ebus.c stable/7/sys/dev/uart/uart_cpu_sparc64.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/scc/scc_bfe_ebus.c ============================================================================== --- stable/7/sys/dev/scc/scc_bfe_ebus.c Mon Jul 25 17:37:53 2011 (r224350) +++ stable/7/sys/dev/scc/scc_bfe_ebus.c Mon Jul 25 17:37:54 2011 (r224351) @@ -56,7 +56,8 @@ scc_ebus_probe(device_t dev) cmpt = ofw_bus_get_compat(dev); if (cmpt == NULL) cmpt = ""; - if (!strcmp(nm, "se") || !strcmp(cmpt, "sab82532")) { + if (!strcmp(nm, "se") || !strcmp(nm, "FJSV,se") || + !strcmp(cmpt, "sab82532")) { device_set_desc(dev, "Siemens SAB 82532 dual channel SCC"); sc->sc_class = &scc_sab82532_class; return (scc_bfe_probe(dev, EBUS_REGSHFT, EBUS_RCLK, 0)); Modified: stable/7/sys/dev/uart/uart_cpu_sparc64.c ============================================================================== --- stable/7/sys/dev/uart/uart_cpu_sparc64.c Mon Jul 25 17:37:53 2011 (r224350) +++ stable/7/sys/dev/uart/uart_cpu_sparc64.c Mon Jul 25 17:37:54 2011 (r224351) @@ -230,7 +230,8 @@ uart_cpu_getdev(int devtype, struct uart di->bas.regshft = 0; di->bas.rclk = 0; class = NULL; - if (!strcmp(buf, "se") || !strcmp(compat, "sab82532")) { + if (!strcmp(buf, "se") || !strcmp(buf, "FJSV,se") || + !strcmp(compat, "sab82532")) { class = &uart_sab82532_class; /* SAB82532 are only known to be used for TTYs. */ if ((di->bas.chan = uart_cpu_channel(dev)) == 0) From owner-svn-src-stable@FreeBSD.ORG Mon Jul 25 17:54:05 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 56DC9106564A; Mon, 25 Jul 2011 17:54:05 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2C66C8FC08; Mon, 25 Jul 2011 17:54:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PHs5i2068640; Mon, 25 Jul 2011 17:54:05 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PHs5qj068633; Mon, 25 Jul 2011 17:54:05 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251754.p6PHs5qj068633@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 17:54:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224352 - in stable/8/sys/sparc64: include sparc64 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 17:54:05 -0000 Author: marius Date: Mon Jul 25 17:54:04 2011 New Revision: 224352 URL: http://svn.freebsd.org/changeset/base/224352 Log: MFC: r222828 (partial) - Test KTR_CPUMASK against pc_cpuid rather than pc_mid to match what the C version does. - Initialize global registers early in the MP startup code so PCPU can be used. Modified: stable/8/sys/sparc64/include/ktr.h stable/8/sys/sparc64/sparc64/mp_locore.S stable/8/sys/sparc64/sparc64/mp_machdep.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/geom/label/ (props changed) Modified: stable/8/sys/sparc64/include/ktr.h ============================================================================== --- stable/8/sys/sparc64/include/ktr.h Mon Jul 25 17:37:54 2011 (r224351) +++ stable/8/sys/sparc64/include/ktr.h Mon Jul 25 17:54:04 2011 (r224352) @@ -82,7 +82,7 @@ l2: add r2, 1, r3 ; \ #define CATR(mask, desc, r1, r2, r3, l1, l2, l3) \ set mask, r1 ; \ TEST(ktr_mask, r1, r2, r2, l3) ; \ - lduw [PCPU(MID)], r1 ; \ + lduw [PCPU(CPUID)], r1 ; \ mov 1, r2 ; \ sllx r2, r1, r1 ; \ TEST(ktr_cpumask, r1, r2, r3, l3) ; \ Modified: stable/8/sys/sparc64/sparc64/mp_locore.S ============================================================================== --- stable/8/sys/sparc64/sparc64/mp_locore.S Mon Jul 25 17:37:54 2011 (r224351) +++ stable/8/sys/sparc64/sparc64/mp_locore.S Mon Jul 25 17:54:04 2011 (r224352) @@ -269,13 +269,17 @@ ENTRY(mp_startup) add %l1, %l2, %l1 sub %l1, SPOFF + CCFSZ, %sp + /* Initialize global registers. */ + call cpu_setregs + mov %l1, %o0 + #if KTR_COMPILE & KTR_SMP CATR(KTR_SMP, "mp_startup: bootstrap cpuid=%d mid=%d pcpu=%#lx data=%#lx sp=%#lx" , %g1, %g2, %g3, 7, 8, 9) - lduw [%l1 + PC_CPUID], %g2 + lduw [PCPU(CPUID)], %g2 stx %g2, [%g1 + KTR_PARM1] - lduw [%l1 + PC_MID], %g2 + lduw [PCPU(MID)], %g2 stx %g2, [%g1 + KTR_PARM2] stx %l1, [%g1 + KTR_PARM3] stx %sp, [%g1 + KTR_PARM5] Modified: stable/8/sys/sparc64/sparc64/mp_machdep.c ============================================================================== --- stable/8/sys/sparc64/sparc64/mp_machdep.c Mon Jul 25 17:37:54 2011 (r224351) +++ stable/8/sys/sparc64/sparc64/mp_machdep.c Mon Jul 25 17:54:04 2011 (r224352) @@ -451,9 +451,6 @@ cpu_mp_bootstrap(struct pcpu *pc) */ tlb_flush_nonlocked(); - /* Initialize global registers. */ - cpu_setregs(pc); - /* * Enable interrupts. * Note that the PIL we be lowered indirectly via sched_throw(NULL) From owner-svn-src-stable@FreeBSD.ORG Mon Jul 25 17:54:06 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2F1631065672; Mon, 25 Jul 2011 17:54:06 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 04E378FC13; Mon, 25 Jul 2011 17:54:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PHs5H6068670; Mon, 25 Jul 2011 17:54:05 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PHs5Hw068666; Mon, 25 Jul 2011 17:54:05 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251754.p6PHs5Hw068666@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 17:54:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224353 - in stable/7/sys/sparc64: include sparc64 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 17:54:06 -0000 Author: marius Date: Mon Jul 25 17:54:05 2011 New Revision: 224353 URL: http://svn.freebsd.org/changeset/base/224353 Log: MFC: r222828 (partial) - Test KTR_CPUMASK against pc_cpuid rather than pc_mid to match what the C version does. - Initialize global registers early in the MP startup code so PCPU can be used. Modified: stable/7/sys/sparc64/include/ktr.h stable/7/sys/sparc64/sparc64/mp_locore.S stable/7/sys/sparc64/sparc64/mp_machdep.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/sparc64/include/ktr.h ============================================================================== --- stable/7/sys/sparc64/include/ktr.h Mon Jul 25 17:54:04 2011 (r224352) +++ stable/7/sys/sparc64/include/ktr.h Mon Jul 25 17:54:05 2011 (r224353) @@ -82,7 +82,7 @@ l2: add r2, 1, r3 ; \ #define CATR(mask, desc, r1, r2, r3, l1, l2, l3) \ set mask, r1 ; \ TEST(ktr_mask, r1, r2, r2, l3) ; \ - lduw [PCPU(MID)], r1 ; \ + lduw [PCPU(CPUID)], r1 ; \ mov 1, r2 ; \ sllx r2, r1, r1 ; \ TEST(ktr_cpumask, r1, r2, r3, l3) ; \ Modified: stable/7/sys/sparc64/sparc64/mp_locore.S ============================================================================== --- stable/7/sys/sparc64/sparc64/mp_locore.S Mon Jul 25 17:54:04 2011 (r224352) +++ stable/7/sys/sparc64/sparc64/mp_locore.S Mon Jul 25 17:54:05 2011 (r224353) @@ -269,13 +269,17 @@ ENTRY(mp_startup) add %l1, %l2, %l1 sub %l1, SPOFF + CCFSZ, %sp + /* Initialize global registers. */ + call cpu_setregs + mov %l1, %o0 + #if KTR_COMPILE & KTR_SMP CATR(KTR_SMP, "mp_startup: bootstrap cpuid=%d mid=%d pcpu=%#lx data=%#lx sp=%#lx" , %g1, %g2, %g3, 7, 8, 9) - lduw [%l1 + PC_CPUID], %g2 + lduw [PCPU(CPUID)], %g2 stx %g2, [%g1 + KTR_PARM1] - lduw [%l1 + PC_MID], %g2 + lduw [PCPU(MID)], %g2 stx %g2, [%g1 + KTR_PARM2] stx %l1, [%g1 + KTR_PARM3] stx %sp, [%g1 + KTR_PARM5] Modified: stable/7/sys/sparc64/sparc64/mp_machdep.c ============================================================================== --- stable/7/sys/sparc64/sparc64/mp_machdep.c Mon Jul 25 17:54:04 2011 (r224352) +++ stable/7/sys/sparc64/sparc64/mp_machdep.c Mon Jul 25 17:54:05 2011 (r224353) @@ -438,9 +438,6 @@ cpu_mp_bootstrap(struct pcpu *pc) */ tlb_flush_nonlocked(); - /* Initialize global registers. */ - cpu_setregs(pc); - /* * Enable interrupts. * Note that the PIL we be lowered indirectly via sched_throw(NULL) From owner-svn-src-stable@FreeBSD.ORG Mon Jul 25 17:56:06 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D6D1F1065672; Mon, 25 Jul 2011 17:56:06 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C647F8FC17; Mon, 25 Jul 2011 17:56:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PHu6xw068819; Mon, 25 Jul 2011 17:56:06 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PHu6fV068817; Mon, 25 Jul 2011 17:56:06 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251756.p6PHu6fV068817@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 17:56:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224354 - stable/8/sys/sparc64/sparc64 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 17:56:07 -0000 Author: marius Date: Mon Jul 25 17:56:06 2011 New Revision: 224354 URL: http://svn.freebsd.org/changeset/base/224354 Log: MFC: r222840 - For the case when tl1_align(_trap) is used to call rsf_fatal via RSF_FATAL we need to switch to alternate globals for KSTACK_CHECK just like tl1_data_excptn(_trap) does. This is more or less cosmetic because in case RSF_FATAL is called we're already heading south. - Correct an END(). - Read the window state from the correct register for a CATR(). Modified: stable/8/sys/sparc64/sparc64/exception.S Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/geom/label/ (props changed) Modified: stable/8/sys/sparc64/sparc64/exception.S ============================================================================== --- stable/8/sys/sparc64/sparc64/exception.S Mon Jul 25 17:54:05 2011 (r224353) +++ stable/8/sys/sparc64/sparc64/exception.S Mon Jul 25 17:56:06 2011 (r224354) @@ -1280,6 +1280,7 @@ ENTRY(tl1_data_excptn_trap) END(tl1_data_excptn_trap) .macro tl1_align + wrpr %g0, PSTATE_ALT, %pstate ba,a %xcc, tl1_align_trap nop .align 32 @@ -1289,7 +1290,7 @@ ENTRY(tl1_align_trap) RESUME_SPILLFILL_ALIGN ba %xcc, tl1_sfsr_trap mov T_MEM_ADDRESS_NOT_ALIGNED | T_KERNEL, %g2 -END(tl1_data_excptn_trap) +END(tl1_align_trap) ENTRY(tl1_sfsr_trap) wr %g0, ASI_DMMU, %asi @@ -2697,7 +2698,7 @@ tl0_ret_fill_end: , %l0, %l1, %l2, 7, 8, 9) rdpr %pstate, %l1 stx %l1, [%l0 + KTR_PARM1] - stx %l5, [%l0 + KTR_PARM2] + stx %l6, [%l0 + KTR_PARM2] stx %sp, [%l0 + KTR_PARM3] 9: #endif From owner-svn-src-stable@FreeBSD.ORG Mon Jul 25 17:56:07 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5F99D1065675; Mon, 25 Jul 2011 17:56:07 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4EF678FC08; Mon, 25 Jul 2011 17:56:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PHu7ql068841; Mon, 25 Jul 2011 17:56:07 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PHu7aJ068839; Mon, 25 Jul 2011 17:56:07 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251756.p6PHu7aJ068839@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 17:56:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224355 - stable/7/sys/sparc64/sparc64 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 17:56:07 -0000 Author: marius Date: Mon Jul 25 17:56:06 2011 New Revision: 224355 URL: http://svn.freebsd.org/changeset/base/224355 Log: MFC: r222840 - For the case when tl1_align(_trap) is used to call rsf_fatal via RSF_FATAL we need to switch to alternate globals for KSTACK_CHECK just like tl1_data_excptn(_trap) does. This is more or less cosmetic because in case RSF_FATAL is called we're already heading south. - Correct an END(). - Read the window state from the correct register for a CATR(). Modified: stable/7/sys/sparc64/sparc64/exception.S Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/sparc64/sparc64/exception.S ============================================================================== --- stable/7/sys/sparc64/sparc64/exception.S Mon Jul 25 17:56:06 2011 (r224354) +++ stable/7/sys/sparc64/sparc64/exception.S Mon Jul 25 17:56:06 2011 (r224355) @@ -1276,6 +1276,7 @@ ENTRY(tl1_data_excptn_trap) END(tl1_data_excptn_trap) .macro tl1_align + wrpr %g0, PSTATE_ALT, %pstate ba,a %xcc, tl1_align_trap nop .align 32 @@ -1285,7 +1286,7 @@ ENTRY(tl1_align_trap) RESUME_SPILLFILL_ALIGN ba %xcc, tl1_sfsr_trap mov T_MEM_ADDRESS_NOT_ALIGNED | T_KERNEL, %g2 -END(tl1_data_excptn_trap) +END(tl1_align_trap) ENTRY(tl1_sfsr_trap) wr %g0, ASI_DMMU, %asi @@ -2616,7 +2617,7 @@ tl0_ret_fill_end: , %l0, %l1, %l2, 7, 8, 9) rdpr %pstate, %l1 stx %l1, [%l0 + KTR_PARM1] - stx %l5, [%l0 + KTR_PARM2] + stx %l6, [%l0 + KTR_PARM2] stx %sp, [%l0 + KTR_PARM3] 9: #endif From owner-svn-src-stable@FreeBSD.ORG Mon Jul 25 18:17:11 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 68939106566B; Mon, 25 Jul 2011 18:17:11 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4EE368FC18; Mon, 25 Jul 2011 18:17:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PIHBt8069475; Mon, 25 Jul 2011 18:17:11 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PIHBSn069473; Mon, 25 Jul 2011 18:17:11 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251817.p6PIHBSn069473@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 18:17:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224356 - stable/8/sys/sparc64/include X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 18:17:11 -0000 Author: marius Date: Mon Jul 25 18:17:11 2011 New Revision: 224356 URL: http://svn.freebsd.org/changeset/base/224356 Log: MFC: r223126 (partial) Don't include curcpu in the mask which is used as the IPI cookie as we have to ignore it when sending the IPI anyway. Actually I can't think of a good reason why this ever was done that way in the first place as it's not even usefull for debugging. Modified: stable/8/sys/sparc64/include/smp.h Modified: stable/8/sys/sparc64/include/smp.h ============================================================================== --- stable/8/sys/sparc64/include/smp.h Mon Jul 25 17:56:06 2011 (r224355) +++ stable/8/sys/sparc64/include/smp.h Mon Jul 25 18:17:11 2011 (r224356) @@ -1,5 +1,6 @@ /*- * Copyright (c) 2001 Jake Burkholder. + * Copyright (c) 2007 - 2011 Marius Strobl * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -164,9 +165,9 @@ ipi_dcache_page_inval(void *func, vm_pad sched_pin(); ica = &ipi_cache_args; mtx_lock_spin(&ipi_mtx); - ica->ica_mask = all_cpus; + ica->ica_mask = PCPU_GET(other_cpus); ica->ica_pa = pa; - cpu_ipi_selected(PCPU_GET(other_cpus), 0, (u_long)func, (u_long)ica); + cpu_ipi_selected(ica->ica_mask, 0, (u_long)func, (u_long)ica); return (&ica->ica_mask); } @@ -180,9 +181,9 @@ ipi_icache_page_inval(void *func, vm_pad sched_pin(); ica = &ipi_cache_args; mtx_lock_spin(&ipi_mtx); - ica->ica_mask = all_cpus; + ica->ica_mask = PCPU_GET(other_cpus); ica->ica_pa = pa; - cpu_ipi_selected(PCPU_GET(other_cpus), 0, (u_long)func, (u_long)ica); + cpu_ipi_selected(ica->ica_mask, 0, (u_long)func, (u_long)ica); return (&ica->ica_mask); } @@ -196,7 +197,7 @@ ipi_rd(u_int cpu, void *func, u_long *va sched_pin(); ira = &ipi_rd_args; mtx_lock_spin(&ipi_mtx); - ira->ira_mask = 1 << cpu | PCPU_GET(cpumask); + ira->ira_mask = 1 << cpu; ira->ira_val = val; cpu_ipi_single(cpu, 0, (u_long)func, (u_long)ira); return (&ira->ira_mask); @@ -217,7 +218,7 @@ ipi_tlb_context_demap(struct pmap *pm) } ita = &ipi_tlb_args; mtx_lock_spin(&ipi_mtx); - ita->ita_mask = cpus | PCPU_GET(cpumask); + ita->ita_mask = cpus; ita->ita_pmap = pm; cpu_ipi_selected(cpus, 0, (u_long)tl_ipi_tlb_context_demap, (u_long)ita); @@ -239,7 +240,7 @@ ipi_tlb_page_demap(struct pmap *pm, vm_o } ita = &ipi_tlb_args; mtx_lock_spin(&ipi_mtx); - ita->ita_mask = cpus | PCPU_GET(cpumask); + ita->ita_mask = cpus; ita->ita_pmap = pm; ita->ita_va = va; cpu_ipi_selected(cpus, 0, (u_long)tl_ipi_tlb_page_demap, (u_long)ita); @@ -261,7 +262,7 @@ ipi_tlb_range_demap(struct pmap *pm, vm_ } ita = &ipi_tlb_args; mtx_lock_spin(&ipi_mtx); - ita->ita_mask = cpus | PCPU_GET(cpumask); + ita->ita_mask = cpus; ita->ita_pmap = pm; ita->ita_start = start; ita->ita_end = end; @@ -276,7 +277,6 @@ ipi_wait(void *cookie) volatile cpumask_t *mask; if ((mask = cookie) != NULL) { - atomic_clear_int(mask, PCPU_GET(cpumask)); while (*mask != 0) ; mtx_unlock_spin(&ipi_mtx); From owner-svn-src-stable@FreeBSD.ORG Mon Jul 25 18:17:13 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2B9CE106564A; Mon, 25 Jul 2011 18:17:13 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 114518FC08; Mon, 25 Jul 2011 18:17:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PIHCxO069509; Mon, 25 Jul 2011 18:17:12 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PIHCug069507; Mon, 25 Jul 2011 18:17:12 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251817.p6PIHCug069507@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 18:17:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224357 - stable/7/sys/sparc64/include X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 18:17:13 -0000 Author: marius Date: Mon Jul 25 18:17:12 2011 New Revision: 224357 URL: http://svn.freebsd.org/changeset/base/224357 Log: MFC: r223126 (partial) Don't include curcpu in the mask which is used as the IPI cookie as we have to ignore it when sending the IPI anyway. Actually I can't think of a good reason why this ever was done that way in the first place as it's not even usefull for debugging. Modified: stable/7/sys/sparc64/include/smp.h Modified: stable/7/sys/sparc64/include/smp.h ============================================================================== --- stable/7/sys/sparc64/include/smp.h Mon Jul 25 18:17:11 2011 (r224356) +++ stable/7/sys/sparc64/include/smp.h Mon Jul 25 18:17:12 2011 (r224357) @@ -1,5 +1,6 @@ /*- * Copyright (c) 2001 Jake Burkholder. + * Copyright (c) 2007 - 2011 Marius Strobl * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -156,9 +157,9 @@ ipi_dcache_page_inval(void *func, vm_pad sched_pin(); ica = &ipi_cache_args; mtx_lock_spin(&ipi_mtx); - ica->ica_mask = all_cpus; + ica->ica_mask = PCPU_GET(other_cpus); ica->ica_pa = pa; - cpu_ipi_selected(PCPU_GET(other_cpus), 0, (u_long)func, (u_long)ica); + cpu_ipi_selected(ica->ica_mask, 0, (u_long)func, (u_long)ica); return (&ica->ica_mask); } @@ -172,9 +173,9 @@ ipi_icache_page_inval(void *func, vm_pad sched_pin(); ica = &ipi_cache_args; mtx_lock_spin(&ipi_mtx); - ica->ica_mask = all_cpus; + ica->ica_mask = PCPU_GET(other_cpus); ica->ica_pa = pa; - cpu_ipi_selected(PCPU_GET(other_cpus), 0, (u_long)func, (u_long)ica); + cpu_ipi_selected(ica->ica_mask, 0, (u_long)func, (u_long)ica); return (&ica->ica_mask); } @@ -188,7 +189,7 @@ ipi_rd(u_int cpu, void *func, u_long *va sched_pin(); ira = &ipi_rd_args; mtx_lock_spin(&ipi_mtx); - ira->ira_mask = 1 << cpu | PCPU_GET(cpumask); + ira->ira_mask = 1 << cpu; ira->ira_val = val; cpu_ipi_single(cpu, 0, (u_long)func, (u_long)ira); return (&ira->ira_mask); @@ -209,7 +210,7 @@ ipi_tlb_context_demap(struct pmap *pm) } ita = &ipi_tlb_args; mtx_lock_spin(&ipi_mtx); - ita->ita_mask = cpus | PCPU_GET(cpumask); + ita->ita_mask = cpus; ita->ita_pmap = pm; cpu_ipi_selected(cpus, 0, (u_long)tl_ipi_tlb_context_demap, (u_long)ita); @@ -231,7 +232,7 @@ ipi_tlb_page_demap(struct pmap *pm, vm_o } ita = &ipi_tlb_args; mtx_lock_spin(&ipi_mtx); - ita->ita_mask = cpus | PCPU_GET(cpumask); + ita->ita_mask = cpus; ita->ita_pmap = pm; ita->ita_va = va; cpu_ipi_selected(cpus, 0, (u_long)tl_ipi_tlb_page_demap, (u_long)ita); @@ -253,7 +254,7 @@ ipi_tlb_range_demap(struct pmap *pm, vm_ } ita = &ipi_tlb_args; mtx_lock_spin(&ipi_mtx); - ita->ita_mask = cpus | PCPU_GET(cpumask); + ita->ita_mask = cpus; ita->ita_pmap = pm; ita->ita_start = start; ita->ita_end = end; @@ -268,7 +269,6 @@ ipi_wait(void *cookie) volatile u_int *mask; if ((mask = cookie) != NULL) { - atomic_clear_int(mask, PCPU_GET(cpumask)); while (*mask != 0) ; mtx_unlock_spin(&ipi_mtx); From owner-svn-src-stable@FreeBSD.ORG Mon Jul 25 18:23:24 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DEC061065687; Mon, 25 Jul 2011 18:23:24 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B49348FC0C; Mon, 25 Jul 2011 18:23:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PINOdO069792; Mon, 25 Jul 2011 18:23:24 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PINO4f069790; Mon, 25 Jul 2011 18:23:24 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251823.p6PINO4f069790@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 18:23:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224358 - stable/8/sys/sparc64/sparc64 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 18:23:25 -0000 Author: marius Date: Mon Jul 25 18:23:24 2011 New Revision: 224358 URL: http://svn.freebsd.org/changeset/base/224358 Log: MFC: r223235 - As with stray vector interrupts limit the reporting of stray level interrupts. Bringup on additional machine models repeatedly reveals firmware that enables interrupts behind our back, causing the console to be flooded otherwise. - As with the regular interrupt counters using uint16_t instead of u_long for counting the stray vector interrupts should be more than sufficient. - Cache the interrupt vector in intr_stray_vector(). Modified: stable/8/sys/sparc64/sparc64/intr_machdep.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/geom/label/ (props changed) Modified: stable/8/sys/sparc64/sparc64/intr_machdep.c ============================================================================== --- stable/8/sys/sparc64/sparc64/intr_machdep.c Mon Jul 25 18:17:12 2011 (r224357) +++ stable/8/sys/sparc64/sparc64/intr_machdep.c Mon Jul 25 18:23:24 2011 (r224358) @@ -83,10 +83,11 @@ CTASSERT((1 << IV_SHIFT) == sizeof(struc ih_func_t *intr_handlers[PIL_MAX]; uint16_t pil_countp[PIL_MAX]; +static uint16_t pil_stray_count[PIL_MAX]; struct intr_vector intr_vectors[IV_MAX]; uint16_t intr_countp[IV_MAX]; -static u_long intr_stray_count[IV_MAX]; +static uint16_t intr_stray_count[IV_MAX]; static const char *const pil_names[] = { "stray", @@ -198,22 +199,32 @@ intr_setup(int pri, ih_func_t *ihf, int static void intr_stray_level(struct trapframe *tf) { + uint64_t level; - printf("stray level interrupt %ld\n", tf->tf_level); + level = tf->tf_level; + if (pil_stray_count[level] < MAX_STRAY_LOG) { + printf("stray level interrupt %ld\n", level); + pil_stray_count[level]++; + if (pil_stray_count[level] >= MAX_STRAY_LOG) + printf("got %d stray level interrupt %ld's: not " + "logging anymore\n", MAX_STRAY_LOG, level); + } } static void intr_stray_vector(void *cookie) { struct intr_vector *iv; + u_int vec; iv = cookie; - if (intr_stray_count[iv->iv_vec] < MAX_STRAY_LOG) { - printf("stray vector interrupt %d\n", iv->iv_vec); - intr_stray_count[iv->iv_vec]++; - if (intr_stray_count[iv->iv_vec] >= MAX_STRAY_LOG) - printf("got %d stray interrupt %d's: not logging " - "anymore\n", MAX_STRAY_LOG, iv->iv_vec); + vec = iv->iv_vec; + if (intr_stray_count[vec] < MAX_STRAY_LOG) { + printf("stray vector interrupt %d\n", vec); + intr_stray_count[vec]++; + if (intr_stray_count[vec] >= MAX_STRAY_LOG) + printf("got %d stray vector interrupt %d's: not " + "logging anymore\n", MAX_STRAY_LOG, vec); } } From owner-svn-src-stable@FreeBSD.ORG Mon Jul 25 18:24:18 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F346E106566C; Mon, 25 Jul 2011 18:24:17 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C91E38FC0A; Mon, 25 Jul 2011 18:24:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PIOHQT069858; Mon, 25 Jul 2011 18:24:17 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PIOHxP069856; Mon, 25 Jul 2011 18:24:17 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251824.p6PIOHxP069856@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 18:24:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224359 - stable/7/sys/sparc64/sparc64 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 18:24:18 -0000 Author: marius Date: Mon Jul 25 18:24:17 2011 New Revision: 224359 URL: http://svn.freebsd.org/changeset/base/224359 Log: MFC: r223235 - As with stray vector interrupts limit the reporting of stray level interrupts. Bringup on additional machine models repeatedly reveals firmware that enables interrupts behind our back, causing the console to be flooded otherwise. - As with the regular interrupt counters using uint16_t instead of u_long for counting the stray vector interrupts should be more than sufficient. - Cache the interrupt vector in intr_stray_vector(). Modified: stable/7/sys/sparc64/sparc64/intr_machdep.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/sparc64/sparc64/intr_machdep.c ============================================================================== --- stable/7/sys/sparc64/sparc64/intr_machdep.c Mon Jul 25 18:23:24 2011 (r224358) +++ stable/7/sys/sparc64/sparc64/intr_machdep.c Mon Jul 25 18:24:17 2011 (r224359) @@ -84,10 +84,11 @@ CTASSERT((1 << IV_SHIFT) == sizeof(struc ih_func_t *intr_handlers[PIL_MAX]; uint16_t pil_countp[PIL_MAX]; +static uint16_t pil_stray_count[PIL_MAX]; struct intr_vector intr_vectors[IV_MAX]; uint16_t intr_countp[IV_MAX]; -static u_long intr_stray_count[IV_MAX]; +static uint16_t intr_stray_count[IV_MAX]; static const char *const pil_names[] = { "stray", @@ -199,22 +200,32 @@ intr_setup(int pri, ih_func_t *ihf, int static void intr_stray_level(struct trapframe *tf) { + uint64_t level; - printf("stray level interrupt %ld\n", tf->tf_level); + level = tf->tf_level; + if (pil_stray_count[level] < MAX_STRAY_LOG) { + printf("stray level interrupt %ld\n", level); + pil_stray_count[level]++; + if (pil_stray_count[level] >= MAX_STRAY_LOG) + printf("got %d stray level interrupt %ld's: not " + "logging anymore\n", MAX_STRAY_LOG, level); + } } static void intr_stray_vector(void *cookie) { struct intr_vector *iv; + u_int vec; iv = cookie; - if (intr_stray_count[iv->iv_vec] < MAX_STRAY_LOG) { - printf("stray vector interrupt %d\n", iv->iv_vec); - intr_stray_count[iv->iv_vec]++; - if (intr_stray_count[iv->iv_vec] >= MAX_STRAY_LOG) - printf("got %d stray interrupt %d's: not logging " - "anymore\n", MAX_STRAY_LOG, iv->iv_vec); + vec = iv->iv_vec; + if (intr_stray_count[vec] < MAX_STRAY_LOG) { + printf("stray vector interrupt %d\n", vec); + intr_stray_count[vec]++; + if (intr_stray_count[vec] >= MAX_STRAY_LOG) + printf("got %d stray vector interrupt %d's: not " + "logging anymore\n", MAX_STRAY_LOG, vec); } } From owner-svn-src-stable@FreeBSD.ORG Mon Jul 25 18:25:30 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CB856106566C; Mon, 25 Jul 2011 18:25:30 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BACC48FC08; Mon, 25 Jul 2011 18:25:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PIPU7X069988; Mon, 25 Jul 2011 18:25:30 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PIPUGT069986; Mon, 25 Jul 2011 18:25:30 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251825.p6PIPUGT069986@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 18:25:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224360 - stable/7/sys/sparc64/sparc64 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 18:25:30 -0000 Author: marius Date: Mon Jul 25 18:25:30 2011 New Revision: 224360 URL: http://svn.freebsd.org/changeset/base/224360 Log: MFC: r223347 As astopgap minimize the sched_lock coverage in pmap_activate() in order to reduce lock contention. Modified: stable/7/sys/sparc64/sparc64/pmap.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/sparc64/sparc64/pmap.c ============================================================================== --- stable/7/sys/sparc64/sparc64/pmap.c Mon Jul 25 18:24:17 2011 (r224359) +++ stable/7/sys/sparc64/sparc64/pmap.c Mon Jul 25 18:25:30 2011 (r224360) @@ -1988,11 +1988,10 @@ pmap_activate(struct thread *td) struct pmap *pm; int context; + critical_enter(); vm = td->td_proc->p_vmspace; pm = vmspace_pmap(vm); - mtx_lock_spin(&sched_lock); - context = PCPU_GET(tlb_ctx); if (context == PCPU_GET(tlb_ctx_max)) { tlb_flush_user(); @@ -2000,17 +1999,18 @@ pmap_activate(struct thread *td) } PCPU_SET(tlb_ctx, context + 1); + mtx_lock_spin(&sched_lock); pm->pm_context[curcpu] = context; pm->pm_active |= PCPU_GET(cpumask); PCPU_SET(pmap, pm); + mtx_unlock_spin(&sched_lock); stxa(AA_DMMU_TSB, ASI_DMMU, pm->pm_tsb); stxa(AA_IMMU_TSB, ASI_IMMU, pm->pm_tsb); stxa(AA_DMMU_PCXR, ASI_DMMU, (ldxa(AA_DMMU_PCXR, ASI_DMMU) & TLB_CXR_PGSZ_MASK) | context); flush(KERNBASE); - - mtx_unlock_spin(&sched_lock); + critical_exit(); } vm_offset_t From owner-svn-src-stable@FreeBSD.ORG Mon Jul 25 18:25:30 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EAC1E1065672; Mon, 25 Jul 2011 18:25:30 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D9F258FC0A; Mon, 25 Jul 2011 18:25:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PIPUI4069994; Mon, 25 Jul 2011 18:25:30 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PIPUgf069991; Mon, 25 Jul 2011 18:25:30 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251825.p6PIPUgf069991@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 18:25:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224361 - stable/8/sys/sparc64/sparc64 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 18:25:31 -0000 Author: marius Date: Mon Jul 25 18:25:30 2011 New Revision: 224361 URL: http://svn.freebsd.org/changeset/base/224361 Log: MFC: r223347 As astopgap minimize the sched_lock coverage in pmap_activate() in order to reduce lock contention. Modified: stable/8/sys/sparc64/sparc64/pmap.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/geom/label/ (props changed) Modified: stable/8/sys/sparc64/sparc64/pmap.c ============================================================================== --- stable/8/sys/sparc64/sparc64/pmap.c Mon Jul 25 18:25:30 2011 (r224360) +++ stable/8/sys/sparc64/sparc64/pmap.c Mon Jul 25 18:25:30 2011 (r224361) @@ -2136,11 +2136,10 @@ pmap_activate(struct thread *td) struct pmap *pm; int context; + critical_enter(); vm = td->td_proc->p_vmspace; pm = vmspace_pmap(vm); - mtx_lock_spin(&sched_lock); - context = PCPU_GET(tlb_ctx); if (context == PCPU_GET(tlb_ctx_max)) { tlb_flush_user(); @@ -2148,17 +2147,18 @@ pmap_activate(struct thread *td) } PCPU_SET(tlb_ctx, context + 1); + mtx_lock_spin(&sched_lock); pm->pm_context[curcpu] = context; pm->pm_active |= PCPU_GET(cpumask); PCPU_SET(pmap, pm); + mtx_unlock_spin(&sched_lock); stxa(AA_DMMU_TSB, ASI_DMMU, pm->pm_tsb); stxa(AA_IMMU_TSB, ASI_IMMU, pm->pm_tsb); stxa(AA_DMMU_PCXR, ASI_DMMU, (ldxa(AA_DMMU_PCXR, ASI_DMMU) & TLB_CXR_PGSZ_MASK) | context); flush(KERNBASE); - - mtx_unlock_spin(&sched_lock); + critical_exit(); } void From owner-svn-src-stable@FreeBSD.ORG Mon Jul 25 18:26:55 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 39945106566B; Mon, 25 Jul 2011 18:26:55 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 290EF8FC15; Mon, 25 Jul 2011 18:26:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PIQt1F070087; Mon, 25 Jul 2011 18:26:55 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PIQt92070085; Mon, 25 Jul 2011 18:26:55 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251826.p6PIQt92070085@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 18:26:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224362 - stable/8/sys/sparc64/sparc64 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 18:26:55 -0000 Author: marius Date: Mon Jul 25 18:26:54 2011 New Revision: 224362 URL: http://svn.freebsd.org/changeset/base/224362 Log: MFC: r223377 On machines where we don't need to lock the kernel TSB into the dTLB and thus may basically use the entire 64-bit kernel address space increase the kernel virtual memory to not be limited by VM_KMEM_SIZE_MAX. Modified: stable/8/sys/sparc64/sparc64/pmap.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/geom/label/ (props changed) Modified: stable/8/sys/sparc64/sparc64/pmap.c ============================================================================== --- stable/8/sys/sparc64/sparc64/pmap.c Mon Jul 25 18:25:30 2011 (r224361) +++ stable/8/sys/sparc64/sparc64/pmap.c Mon Jul 25 18:26:54 2011 (r224362) @@ -384,11 +384,12 @@ pmap_bootstrap(u_int cpu_impl) * public documentation is available for these, the latter just might * not support it, yet. */ - virtsz = roundup(physsz, PAGE_SIZE_4M << (PAGE_SHIFT - TTE_SHIFT)); if (cpu_impl == CPU_IMPL_SPARC64V || - cpu_impl >= CPU_IMPL_ULTRASPARCIIIp) + cpu_impl >= CPU_IMPL_ULTRASPARCIIIp) { tsb_kernel_ldd_phys = 1; - else { + virtsz = roundup(5 / 3 * physsz, PAGE_SIZE_4M << + (PAGE_SHIFT - TTE_SHIFT)); + } else { dtlb_slots_avail = 0; for (i = 0; i < dtlb_slots; i++) { data = dtlb_get_data(i); @@ -401,6 +402,8 @@ pmap_bootstrap(u_int cpu_impl) if (cpu_impl >= CPU_IMPL_ULTRASPARCI && cpu_impl < CPU_IMPL_ULTRASPARCIII) dtlb_slots_avail /= 2; + virtsz = roundup(physsz, PAGE_SIZE_4M << + (PAGE_SHIFT - TTE_SHIFT)); virtsz = MIN(virtsz, (dtlb_slots_avail * PAGE_SIZE_4M) << (PAGE_SHIFT - TTE_SHIFT)); } From owner-svn-src-stable@FreeBSD.ORG Mon Jul 25 18:28:12 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 783E6106564A; Mon, 25 Jul 2011 18:28:12 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 677618FC1C; Mon, 25 Jul 2011 18:28:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PISCbL070172; Mon, 25 Jul 2011 18:28:12 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PISCuU070169; Mon, 25 Jul 2011 18:28:12 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251828.p6PISCuU070169@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 18:28:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224363 - stable/8/sys/sparc64/include X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 18:28:12 -0000 Author: marius Date: Mon Jul 25 18:28:12 2011 New Revision: 224363 URL: http://svn.freebsd.org/changeset/base/224363 Log: MFC: r223378 On machines where we don't need to lock the kernel TSB into the dTLB and thus may basically use the entire 64-bit kernel address space reduce VM_KMEM_SIZE_SCALE to 1 allowing kernel to use more memory. Modified: stable/8/sys/sparc64/include/tsb.h stable/8/sys/sparc64/include/vmparam.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/geom/label/ (props changed) Modified: stable/8/sys/sparc64/include/tsb.h ============================================================================== --- stable/8/sys/sparc64/include/tsb.h Mon Jul 25 18:26:54 2011 (r224362) +++ stable/8/sys/sparc64/include/tsb.h Mon Jul 25 18:28:12 2011 (r224363) @@ -50,7 +50,6 @@ extern struct tte *tsb_kernel; extern vm_size_t tsb_kernel_mask; extern vm_size_t tsb_kernel_size; extern vm_paddr_t tsb_kernel_phys; -extern u_int tsb_kernel_ldd_phys; static __inline struct tte * tsb_vpntobucket(pmap_t pm, vm_offset_t vpn) Modified: stable/8/sys/sparc64/include/vmparam.h ============================================================================== --- stable/8/sys/sparc64/include/vmparam.h Mon Jul 25 18:26:54 2011 (r224362) +++ stable/8/sys/sparc64/include/vmparam.h Mon Jul 25 18:28:12 2011 (r224363) @@ -222,7 +222,7 @@ * is the total KVA space allocated for kmem_map. */ #ifndef VM_KMEM_SIZE_SCALE -#define VM_KMEM_SIZE_SCALE (3) +#define VM_KMEM_SIZE_SCALE (tsb_kernel_ldd_phys == 0 ? 3 : 1) #endif /* @@ -242,6 +242,7 @@ #define UMA_MD_SMALL_ALLOC +extern u_int tsb_kernel_ldd_phys; extern vm_offset_t vm_max_kernel_address; #endif /* !_MACHINE_VMPARAM_H_ */ From owner-svn-src-stable@FreeBSD.ORG Mon Jul 25 18:29:35 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C9C7E1065677; Mon, 25 Jul 2011 18:29:35 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B91368FC0A; Mon, 25 Jul 2011 18:29:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PITZeU070292; Mon, 25 Jul 2011 18:29:35 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PITZmP070290; Mon, 25 Jul 2011 18:29:35 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251829.p6PITZmP070290@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 18:29:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224364 - stable/7/sys/sparc64/include X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 18:29:35 -0000 Author: marius Date: Mon Jul 25 18:29:35 2011 New Revision: 224364 URL: http://svn.freebsd.org/changeset/base/224364 Log: MFC: r223379 Fix whitespace Modified: stable/7/sys/sparc64/include/vmparam.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/sparc64/include/vmparam.h ============================================================================== --- stable/7/sys/sparc64/include/vmparam.h Mon Jul 25 18:28:12 2011 (r224363) +++ stable/7/sys/sparc64/include/vmparam.h Mon Jul 25 18:29:35 2011 (r224364) @@ -85,7 +85,7 @@ * The number of PHYSSEG entries must be one greater than the number * of phys_avail entries because the phys_avail entry that spans the * largest physical address that is accessible by ISA DMA is split - * into two PHYSSEG entries. + * into two PHYSSEG entries. */ #define VM_PHYSSEG_MAX 64 @@ -144,13 +144,13 @@ * 43 bits of user address space is considered to be "enough", so we ignore it. * * Upper region: 0xffffffffffffffff - * 0xfffff80000000000 - * + * 0xfffff80000000000 + * * Hole: 0xfffff7ffffffffff - * 0x0000080000000000 + * 0x0000080000000000 * * Lower region: 0x000007ffffffffff - * 0x0000000000000000 + * 0x0000000000000000 * * In general we ignore the upper region, and use the lower region as mappable * space. From owner-svn-src-stable@FreeBSD.ORG Mon Jul 25 18:29:36 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 077F3106567A; Mon, 25 Jul 2011 18:29:36 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EB13C8FC1B; Mon, 25 Jul 2011 18:29:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PITZUG070306; Mon, 25 Jul 2011 18:29:35 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PITZNK070304; Mon, 25 Jul 2011 18:29:35 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251829.p6PITZNK070304@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 18:29:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224365 - stable/8/sys/sparc64/include X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 18:29:36 -0000 Author: marius Date: Mon Jul 25 18:29:35 2011 New Revision: 224365 URL: http://svn.freebsd.org/changeset/base/224365 Log: MFC: r223379 Fix whitespace Modified: stable/8/sys/sparc64/include/vmparam.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/geom/label/ (props changed) Modified: stable/8/sys/sparc64/include/vmparam.h ============================================================================== --- stable/8/sys/sparc64/include/vmparam.h Mon Jul 25 18:29:35 2011 (r224364) +++ stable/8/sys/sparc64/include/vmparam.h Mon Jul 25 18:29:35 2011 (r224365) @@ -81,7 +81,7 @@ * The number of PHYSSEG entries must be one greater than the number * of phys_avail entries because the phys_avail entry that spans the * largest physical address that is accessible by ISA DMA is split - * into two PHYSSEG entries. + * into two PHYSSEG entries. */ #define VM_PHYSSEG_MAX 64 @@ -140,13 +140,13 @@ * 43 bits of user address space is considered to be "enough", so we ignore it. * * Upper region: 0xffffffffffffffff - * 0xfffff80000000000 - * + * 0xfffff80000000000 + * * Hole: 0xfffff7ffffffffff - * 0x0000080000000000 + * 0x0000080000000000 * * Lower region: 0x000007ffffffffff - * 0x0000000000000000 + * 0x0000000000000000 * * In general we ignore the upper region, and use the lower region as mappable * space. From owner-svn-src-stable@FreeBSD.ORG Mon Jul 25 18:32:55 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3BA34106566B; Mon, 25 Jul 2011 18:32:55 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 29D498FC0A; Mon, 25 Jul 2011 18:32:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PIWt0n070498; Mon, 25 Jul 2011 18:32:55 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PIWtLD070495; Mon, 25 Jul 2011 18:32:55 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251832.p6PIWtLD070495@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 18:32:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224366 - stable/7/sys/dev/gem X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 18:32:55 -0000 Author: marius Date: Mon Jul 25 18:32:54 2011 New Revision: 224366 URL: http://svn.freebsd.org/changeset/base/224366 Log: MFC: r223648, r223949 - In gem_reset_rx() also reset the RX MAC which is necessary in order to get it out of a stuck condition that can be caused by GEM_MAC_RX_OVERFLOW. - In gem_reset_rxdma() call gem_setladrf() in order to reprogram the RX filter and restore the previous content of GEM_MAC_RX_CONFIG. While at it consistently use the newly introduced sc_mac_rxcfg throughout the driver instead of reading the its old content. - Increment if_iqdrops instead of if_ierrors in case of RX buffer allocation failure. - According to the GEM datasheet the RX MAC should also be disabled in gem_setladrf() before changing its configuration. - Add error messages to gem_disable_{r,t}x() and take advantage of these throughout the driver instead of duplicating their functionality all over the place. In joint forces with: yongari Modified: stable/7/sys/dev/gem/if_gem.c stable/7/sys/dev/gem/if_gemvar.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/gem/if_gem.c ============================================================================== --- stable/7/sys/dev/gem/if_gem.c Mon Jul 25 18:29:35 2011 (r224365) +++ stable/7/sys/dev/gem/if_gem.c Mon Jul 25 18:32:54 2011 (r224366) @@ -705,7 +705,7 @@ gem_reset_rx(struct gem_softc *sc) * Resetting while DMA is in progress can cause a bus hang, so we * disable DMA first. */ - gem_disable_rx(sc); + (void)gem_disable_rx(sc); GEM_BANK1_WRITE_4(sc, GEM_RX_CONFIG, 0); GEM_BANK1_BARRIER(sc, GEM_RX_CONFIG, 4, BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); @@ -715,7 +715,7 @@ gem_reset_rx(struct gem_softc *sc) /* Wait 5ms extra. */ DELAY(5000); - /* Finally, reset the ERX. */ + /* Reset the ERX. */ GEM_BANK2_WRITE_4(sc, GEM_RESET, GEM_RESET_RX); GEM_BANK2_BARRIER(sc, GEM_RESET, 4, BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); @@ -724,6 +724,16 @@ gem_reset_rx(struct gem_softc *sc) device_printf(sc->sc_dev, "cannot reset receiver\n"); return (1); } + + /* Finally, reset RX MAC. */ + GEM_BANK1_WRITE_4(sc, GEM_MAC_RXRESET, 1); + GEM_BANK1_BARRIER(sc, GEM_MAC_RXRESET, 4, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); + if (!GEM_BANK1_BITWAIT(sc, GEM_MAC_RXRESET, 1, 0)) { + device_printf(sc->sc_dev, "cannot reset RX MAC\n"); + return (1); + } + return (0); } @@ -759,7 +769,7 @@ gem_reset_rxdma(struct gem_softc *sc) GEM_RX_CONFIG_CXM_START_SHFT) | (GEM_THRSH_1024 << GEM_RX_CONFIG_FIFO_THRS_SHIFT) | (ETHER_ALIGN << GEM_RX_CONFIG_FBOFF_SHFT)); - /* Adjust for the SBus clock probably isn't worth the fuzz. */ + /* Adjusting for the SBus clock probably isn't worth the fuzz. */ GEM_BANK1_WRITE_4(sc, GEM_RX_BLANKING, ((6 * (sc->sc_flags & GEM_PCI66) != 0 ? 2 : 1) << GEM_RX_BLANKING_TIME_SHIFT) | 6); @@ -770,8 +780,11 @@ gem_reset_rxdma(struct gem_softc *sc) GEM_BANK1_READ_4(sc, GEM_RX_CONFIG) | GEM_RX_CONFIG_RXDMA_EN); GEM_BANK1_WRITE_4(sc, GEM_MAC_RX_MASK, GEM_MAC_RX_DONE | GEM_MAC_RX_FRAME_CNT); - GEM_BANK1_WRITE_4(sc, GEM_MAC_RX_CONFIG, - GEM_BANK1_READ_4(sc, GEM_MAC_RX_CONFIG) | GEM_MAC_RX_ENABLE); + /* + * Clear the RX filter and reprogram it. This will also set the + * current RX MAC configuration and enable it. + */ + gem_setladrf(sc); } static int @@ -782,7 +795,7 @@ gem_reset_tx(struct gem_softc *sc) * Resetting while DMA is in progress can cause a bus hang, so we * disable DMA first. */ - gem_disable_tx(sc); + (void)gem_disable_tx(sc); GEM_BANK1_WRITE_4(sc, GEM_TX_CONFIG, 0); GEM_BANK1_BARRIER(sc, GEM_TX_CONFIG, 4, BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); @@ -812,8 +825,10 @@ gem_disable_rx(struct gem_softc *sc) GEM_BANK1_READ_4(sc, GEM_MAC_RX_CONFIG) & ~GEM_MAC_RX_ENABLE); GEM_BANK1_BARRIER(sc, GEM_MAC_RX_CONFIG, 4, BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); - return (GEM_BANK1_BITWAIT(sc, GEM_MAC_RX_CONFIG, GEM_MAC_RX_ENABLE, - 0)); + if (GEM_BANK1_BITWAIT(sc, GEM_MAC_RX_CONFIG, GEM_MAC_RX_ENABLE, 0)) + return (1); + device_printf(sc->sc_dev, "cannot disable RX MAC\n"); + return (0); } static int @@ -824,8 +839,10 @@ gem_disable_tx(struct gem_softc *sc) GEM_BANK1_READ_4(sc, GEM_MAC_TX_CONFIG) & ~GEM_MAC_TX_ENABLE); GEM_BANK1_BARRIER(sc, GEM_MAC_TX_CONFIG, 4, BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); - return (GEM_BANK1_BITWAIT(sc, GEM_MAC_TX_CONFIG, GEM_MAC_TX_ENABLE, - 0)); + if (GEM_BANK1_BITWAIT(sc, GEM_MAC_TX_CONFIG, GEM_MAC_TX_ENABLE, 0)) + return (1); + device_printf(sc->sc_dev, "cannot disable TX MAC\n"); + return (0); } static int @@ -960,7 +977,6 @@ gem_init_locked(struct gem_softc *sc) gem_init_regs(sc); /* step 5. RX MAC registers & counters */ - gem_setladrf(sc); /* step 6 & 7. Program Descriptor Ring Base Addresses. */ /* NOTE: we use only 32-bit DMA addresses here. */ @@ -1032,7 +1048,7 @@ gem_init_locked(struct gem_softc *sc) (ETHER_ALIGN << GEM_RX_CONFIG_FBOFF_SHFT) | GEM_RX_CONFIG_RXDMA_EN); - /* Adjust for the SBus clock probably isn't worth the fuzz. */ + /* Adjusting for the SBus clock probably isn't worth the fuzz. */ GEM_BANK1_WRITE_4(sc, GEM_RX_BLANKING, ((6 * (sc->sc_flags & GEM_PCI66) != 0 ? 2 : 1) << GEM_RX_BLANKING_TIME_SHIFT) | 6); @@ -1049,22 +1065,19 @@ gem_init_locked(struct gem_softc *sc) /* step 12. RX_MAC Configuration Register */ v = GEM_BANK1_READ_4(sc, GEM_MAC_RX_CONFIG); - v |= GEM_MAC_RX_ENABLE | GEM_MAC_RX_STRIP_CRC; - GEM_BANK1_WRITE_4(sc, GEM_MAC_RX_CONFIG, 0); - GEM_BANK1_BARRIER(sc, GEM_MAC_RX_CONFIG, 4, - BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); - if (!GEM_BANK1_BITWAIT(sc, GEM_MAC_RX_CONFIG, GEM_MAC_RX_ENABLE, 0)) - device_printf(sc->sc_dev, "cannot configure RX MAC\n"); - GEM_BANK1_WRITE_4(sc, GEM_MAC_RX_CONFIG, v); + v &= ~GEM_MAC_RX_ENABLE; + v |= GEM_MAC_RX_STRIP_CRC; + sc->sc_mac_rxcfg = v; + /* + * Clear the RX filter and reprogram it. This will also set the + * current RX MAC configuration and enable it. + */ + gem_setladrf(sc); /* step 13. TX_MAC Configuration Register */ v = GEM_BANK1_READ_4(sc, GEM_MAC_TX_CONFIG); v |= GEM_MAC_TX_ENABLE; - GEM_BANK1_WRITE_4(sc, GEM_MAC_TX_CONFIG, 0); - GEM_BANK1_BARRIER(sc, GEM_MAC_TX_CONFIG, 4, - BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); - if (!GEM_BANK1_BITWAIT(sc, GEM_MAC_TX_CONFIG, GEM_MAC_TX_ENABLE, 0)) - device_printf(sc->sc_dev, "cannot configure TX MAC\n"); + (void)gem_disable_tx(sc); GEM_BANK1_WRITE_4(sc, GEM_MAC_TX_CONFIG, v); /* step 14. Issue Transmit Pending command. */ @@ -1588,7 +1601,7 @@ gem_rint(struct gem_softc *sc) * the buffer that's already attached to this descriptor. */ if (gem_add_rxbuf(sc, sc->sc_rxptr) != 0) { - ifp->if_ierrors++; + ifp->if_iqdrops++; GEM_INIT_RXDESC(sc, sc->sc_rxptr); m = NULL; } @@ -2028,8 +2041,8 @@ gem_mii_statchg(device_t dev) * the GEM Gigabit Ethernet ASIC Specification. */ - rxcfg = GEM_BANK1_READ_4(sc, GEM_MAC_RX_CONFIG); - rxcfg &= ~(GEM_MAC_RX_CARR_EXTEND | GEM_MAC_RX_ENABLE); + rxcfg = sc->sc_mac_rxcfg; + rxcfg &= ~GEM_MAC_RX_CARR_EXTEND; txcfg = GEM_MAC_TX_ENA_IPG0 | GEM_MAC_TX_NGU | GEM_MAC_TX_NGU_LIMIT; if ((IFM_OPTIONS(sc->sc_mii->mii_media_active) & IFM_FDX) != 0) txcfg |= GEM_MAC_TX_IGN_CARRIER | GEM_MAC_TX_IGN_COLLIS; @@ -2037,17 +2050,9 @@ gem_mii_statchg(device_t dev) rxcfg |= GEM_MAC_RX_CARR_EXTEND; txcfg |= GEM_MAC_TX_CARR_EXTEND; } - GEM_BANK1_WRITE_4(sc, GEM_MAC_TX_CONFIG, 0); - GEM_BANK1_BARRIER(sc, GEM_MAC_TX_CONFIG, 4, - BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); - if (!GEM_BANK1_BITWAIT(sc, GEM_MAC_TX_CONFIG, GEM_MAC_TX_ENABLE, 0)) - device_printf(sc->sc_dev, "cannot disable TX MAC\n"); + (void)gem_disable_tx(sc); GEM_BANK1_WRITE_4(sc, GEM_MAC_TX_CONFIG, txcfg); - GEM_BANK1_WRITE_4(sc, GEM_MAC_RX_CONFIG, 0); - GEM_BANK1_BARRIER(sc, GEM_MAC_RX_CONFIG, 4, - BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); - if (!GEM_BANK1_BITWAIT(sc, GEM_MAC_RX_CONFIG, GEM_MAC_RX_ENABLE, 0)) - device_printf(sc->sc_dev, "cannot disable RX MAC\n"); + (void)gem_disable_rx(sc); GEM_BANK1_WRITE_4(sc, GEM_MAC_RX_CONFIG, rxcfg); v = GEM_BANK1_READ_4(sc, GEM_MAC_CONTROL_CONFIG) & @@ -2092,6 +2097,7 @@ gem_mii_statchg(device_t dev) v |= GEM_MAC_XIF_FDPLX_LED; GEM_BANK1_WRITE_4(sc, GEM_MAC_XIF_CONFIG, v); + sc->sc_mac_rxcfg = rxcfg; if ((sc->sc_ifp->if_drv_flags & IFF_DRV_RUNNING) != 0 && (sc->sc_flags & GEM_LINK) != 0) { GEM_BANK1_WRITE_4(sc, GEM_MAC_TX_CONFIG, @@ -2164,7 +2170,8 @@ gem_ioctl(struct ifnet *ifp, u_long cmd, case SIOCADDMULTI: case SIOCDELMULTI: GEM_LOCK(sc); - gem_setladrf(sc); + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) + gem_setladrf(sc); GEM_UNLOCK(sc); break; case SIOCGIFMEDIA: @@ -2199,24 +2206,20 @@ gem_setladrf(struct gem_softc *sc) GEM_LOCK_ASSERT(sc, MA_OWNED); - /* Get the current RX configuration. */ - v = GEM_BANK1_READ_4(sc, GEM_MAC_RX_CONFIG); - /* - * Turn off promiscuous mode, promiscuous group mode (all multicast), - * and hash filter. Depending on the case, the right bit will be - * enabled. + * Turn off the RX MAC and the hash filter as required by the Sun GEM + * programming restrictions. */ - v &= ~(GEM_MAC_RX_PROMISCUOUS | GEM_MAC_RX_HASH_FILTER | - GEM_MAC_RX_PROMISC_GRP); - + v = sc->sc_mac_rxcfg & GEM_MAC_RX_HASH_FILTER; GEM_BANK1_WRITE_4(sc, GEM_MAC_RX_CONFIG, v); GEM_BANK1_BARRIER(sc, GEM_MAC_RX_CONFIG, 4, BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); - if (!GEM_BANK1_BITWAIT(sc, GEM_MAC_RX_CONFIG, GEM_MAC_RX_HASH_FILTER, - 0)) - device_printf(sc->sc_dev, "cannot disable RX hash filter\n"); + if (!GEM_BANK1_BITWAIT(sc, GEM_MAC_RX_CONFIG, GEM_MAC_RX_HASH_FILTER | + GEM_MAC_RX_ENABLE, 0)) + device_printf(sc->sc_dev, + "cannot disable RX MAC or hash filter\n"); + v &= ~(GEM_MAC_RX_PROMISCUOUS | GEM_MAC_RX_PROMISC_GRP); if ((ifp->if_flags & IFF_PROMISC) != 0) { v |= GEM_MAC_RX_PROMISCUOUS; goto chipit; @@ -2262,5 +2265,6 @@ gem_setladrf(struct gem_softc *sc) hash[i]); chipit: - GEM_BANK1_WRITE_4(sc, GEM_MAC_RX_CONFIG, v); + sc->sc_mac_rxcfg = v; + GEM_BANK1_WRITE_4(sc, GEM_MAC_RX_CONFIG, v | GEM_MAC_RX_ENABLE); } Modified: stable/7/sys/dev/gem/if_gemvar.h ============================================================================== --- stable/7/sys/dev/gem/if_gemvar.h Mon Jul 25 18:29:35 2011 (r224365) +++ stable/7/sys/dev/gem/if_gemvar.h Mon Jul 25 18:32:54 2011 (r224366) @@ -173,6 +173,8 @@ struct gem_softc { u_int sc_rxptr; /* next ready RX descriptor/state */ u_int sc_rxfifosize; /* RX FIFO size (bytes) */ + uint32_t sc_mac_rxcfg; /* RX MAC conf. % GEM_MAC_RX_ENABLE */ + int sc_ifflags; u_long sc_csum_features; }; From owner-svn-src-stable@FreeBSD.ORG Mon Jul 25 18:32:57 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0E95E106564A; Mon, 25 Jul 2011 18:32:57 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E7B788FC0C; Mon, 25 Jul 2011 18:32:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PIWuLD070530; Mon, 25 Jul 2011 18:32:56 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PIWu9l070527; Mon, 25 Jul 2011 18:32:56 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251832.p6PIWu9l070527@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 18:32:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224367 - stable/8/sys/dev/gem X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 18:32:57 -0000 Author: marius Date: Mon Jul 25 18:32:56 2011 New Revision: 224367 URL: http://svn.freebsd.org/changeset/base/224367 Log: MFC: r223648, r223949 - In gem_reset_rx() also reset the RX MAC which is necessary in order to get it out of a stuck condition that can be caused by GEM_MAC_RX_OVERFLOW. - In gem_reset_rxdma() call gem_setladrf() in order to reprogram the RX filter and restore the previous content of GEM_MAC_RX_CONFIG. While at it consistently use the newly introduced sc_mac_rxcfg throughout the driver instead of reading the its old content. - Increment if_iqdrops instead of if_ierrors in case of RX buffer allocation failure. - According to the GEM datasheet the RX MAC should also be disabled in gem_setladrf() before changing its configuration. - Add error messages to gem_disable_{r,t}x() and take advantage of these throughout the driver instead of duplicating their functionality all over the place. In joint forces with: yongari Modified: stable/8/sys/dev/gem/if_gem.c stable/8/sys/dev/gem/if_gemvar.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/geom/label/ (props changed) Modified: stable/8/sys/dev/gem/if_gem.c ============================================================================== --- stable/8/sys/dev/gem/if_gem.c Mon Jul 25 18:32:54 2011 (r224366) +++ stable/8/sys/dev/gem/if_gem.c Mon Jul 25 18:32:56 2011 (r224367) @@ -705,7 +705,7 @@ gem_reset_rx(struct gem_softc *sc) * Resetting while DMA is in progress can cause a bus hang, so we * disable DMA first. */ - gem_disable_rx(sc); + (void)gem_disable_rx(sc); GEM_BANK1_WRITE_4(sc, GEM_RX_CONFIG, 0); GEM_BANK1_BARRIER(sc, GEM_RX_CONFIG, 4, BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); @@ -715,7 +715,7 @@ gem_reset_rx(struct gem_softc *sc) /* Wait 5ms extra. */ DELAY(5000); - /* Finally, reset the ERX. */ + /* Reset the ERX. */ GEM_BANK2_WRITE_4(sc, GEM_RESET, GEM_RESET_RX); GEM_BANK2_BARRIER(sc, GEM_RESET, 4, BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); @@ -724,6 +724,16 @@ gem_reset_rx(struct gem_softc *sc) device_printf(sc->sc_dev, "cannot reset receiver\n"); return (1); } + + /* Finally, reset RX MAC. */ + GEM_BANK1_WRITE_4(sc, GEM_MAC_RXRESET, 1); + GEM_BANK1_BARRIER(sc, GEM_MAC_RXRESET, 4, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); + if (!GEM_BANK1_BITWAIT(sc, GEM_MAC_RXRESET, 1, 0)) { + device_printf(sc->sc_dev, "cannot reset RX MAC\n"); + return (1); + } + return (0); } @@ -759,7 +769,7 @@ gem_reset_rxdma(struct gem_softc *sc) GEM_RX_CONFIG_CXM_START_SHFT) | (GEM_THRSH_1024 << GEM_RX_CONFIG_FIFO_THRS_SHIFT) | (ETHER_ALIGN << GEM_RX_CONFIG_FBOFF_SHFT)); - /* Adjust for the SBus clock probably isn't worth the fuzz. */ + /* Adjusting for the SBus clock probably isn't worth the fuzz. */ GEM_BANK1_WRITE_4(sc, GEM_RX_BLANKING, ((6 * (sc->sc_flags & GEM_PCI66) != 0 ? 2 : 1) << GEM_RX_BLANKING_TIME_SHIFT) | 6); @@ -770,8 +780,11 @@ gem_reset_rxdma(struct gem_softc *sc) GEM_BANK1_READ_4(sc, GEM_RX_CONFIG) | GEM_RX_CONFIG_RXDMA_EN); GEM_BANK1_WRITE_4(sc, GEM_MAC_RX_MASK, GEM_MAC_RX_DONE | GEM_MAC_RX_FRAME_CNT); - GEM_BANK1_WRITE_4(sc, GEM_MAC_RX_CONFIG, - GEM_BANK1_READ_4(sc, GEM_MAC_RX_CONFIG) | GEM_MAC_RX_ENABLE); + /* + * Clear the RX filter and reprogram it. This will also set the + * current RX MAC configuration and enable it. + */ + gem_setladrf(sc); } static int @@ -782,7 +795,7 @@ gem_reset_tx(struct gem_softc *sc) * Resetting while DMA is in progress can cause a bus hang, so we * disable DMA first. */ - gem_disable_tx(sc); + (void)gem_disable_tx(sc); GEM_BANK1_WRITE_4(sc, GEM_TX_CONFIG, 0); GEM_BANK1_BARRIER(sc, GEM_TX_CONFIG, 4, BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); @@ -812,8 +825,10 @@ gem_disable_rx(struct gem_softc *sc) GEM_BANK1_READ_4(sc, GEM_MAC_RX_CONFIG) & ~GEM_MAC_RX_ENABLE); GEM_BANK1_BARRIER(sc, GEM_MAC_RX_CONFIG, 4, BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); - return (GEM_BANK1_BITWAIT(sc, GEM_MAC_RX_CONFIG, GEM_MAC_RX_ENABLE, - 0)); + if (GEM_BANK1_BITWAIT(sc, GEM_MAC_RX_CONFIG, GEM_MAC_RX_ENABLE, 0)) + return (1); + device_printf(sc->sc_dev, "cannot disable RX MAC\n"); + return (0); } static int @@ -824,8 +839,10 @@ gem_disable_tx(struct gem_softc *sc) GEM_BANK1_READ_4(sc, GEM_MAC_TX_CONFIG) & ~GEM_MAC_TX_ENABLE); GEM_BANK1_BARRIER(sc, GEM_MAC_TX_CONFIG, 4, BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); - return (GEM_BANK1_BITWAIT(sc, GEM_MAC_TX_CONFIG, GEM_MAC_TX_ENABLE, - 0)); + if (GEM_BANK1_BITWAIT(sc, GEM_MAC_TX_CONFIG, GEM_MAC_TX_ENABLE, 0)) + return (1); + device_printf(sc->sc_dev, "cannot disable TX MAC\n"); + return (0); } static int @@ -960,7 +977,6 @@ gem_init_locked(struct gem_softc *sc) gem_init_regs(sc); /* step 5. RX MAC registers & counters */ - gem_setladrf(sc); /* step 6 & 7. Program Descriptor Ring Base Addresses. */ /* NOTE: we use only 32-bit DMA addresses here. */ @@ -1032,7 +1048,7 @@ gem_init_locked(struct gem_softc *sc) (ETHER_ALIGN << GEM_RX_CONFIG_FBOFF_SHFT) | GEM_RX_CONFIG_RXDMA_EN); - /* Adjust for the SBus clock probably isn't worth the fuzz. */ + /* Adjusting for the SBus clock probably isn't worth the fuzz. */ GEM_BANK1_WRITE_4(sc, GEM_RX_BLANKING, ((6 * (sc->sc_flags & GEM_PCI66) != 0 ? 2 : 1) << GEM_RX_BLANKING_TIME_SHIFT) | 6); @@ -1049,22 +1065,19 @@ gem_init_locked(struct gem_softc *sc) /* step 12. RX_MAC Configuration Register */ v = GEM_BANK1_READ_4(sc, GEM_MAC_RX_CONFIG); - v |= GEM_MAC_RX_ENABLE | GEM_MAC_RX_STRIP_CRC; - GEM_BANK1_WRITE_4(sc, GEM_MAC_RX_CONFIG, 0); - GEM_BANK1_BARRIER(sc, GEM_MAC_RX_CONFIG, 4, - BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); - if (!GEM_BANK1_BITWAIT(sc, GEM_MAC_RX_CONFIG, GEM_MAC_RX_ENABLE, 0)) - device_printf(sc->sc_dev, "cannot configure RX MAC\n"); - GEM_BANK1_WRITE_4(sc, GEM_MAC_RX_CONFIG, v); + v &= ~GEM_MAC_RX_ENABLE; + v |= GEM_MAC_RX_STRIP_CRC; + sc->sc_mac_rxcfg = v; + /* + * Clear the RX filter and reprogram it. This will also set the + * current RX MAC configuration and enable it. + */ + gem_setladrf(sc); /* step 13. TX_MAC Configuration Register */ v = GEM_BANK1_READ_4(sc, GEM_MAC_TX_CONFIG); v |= GEM_MAC_TX_ENABLE; - GEM_BANK1_WRITE_4(sc, GEM_MAC_TX_CONFIG, 0); - GEM_BANK1_BARRIER(sc, GEM_MAC_TX_CONFIG, 4, - BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); - if (!GEM_BANK1_BITWAIT(sc, GEM_MAC_TX_CONFIG, GEM_MAC_TX_ENABLE, 0)) - device_printf(sc->sc_dev, "cannot configure TX MAC\n"); + (void)gem_disable_tx(sc); GEM_BANK1_WRITE_4(sc, GEM_MAC_TX_CONFIG, v); /* step 14. Issue Transmit Pending command. */ @@ -1588,7 +1601,7 @@ gem_rint(struct gem_softc *sc) * the buffer that's already attached to this descriptor. */ if (gem_add_rxbuf(sc, sc->sc_rxptr) != 0) { - ifp->if_ierrors++; + ifp->if_iqdrops++; GEM_INIT_RXDESC(sc, sc->sc_rxptr); m = NULL; } @@ -2028,8 +2041,8 @@ gem_mii_statchg(device_t dev) * the GEM Gigabit Ethernet ASIC Specification. */ - rxcfg = GEM_BANK1_READ_4(sc, GEM_MAC_RX_CONFIG); - rxcfg &= ~(GEM_MAC_RX_CARR_EXTEND | GEM_MAC_RX_ENABLE); + rxcfg = sc->sc_mac_rxcfg; + rxcfg &= ~GEM_MAC_RX_CARR_EXTEND; txcfg = GEM_MAC_TX_ENA_IPG0 | GEM_MAC_TX_NGU | GEM_MAC_TX_NGU_LIMIT; if ((IFM_OPTIONS(sc->sc_mii->mii_media_active) & IFM_FDX) != 0) txcfg |= GEM_MAC_TX_IGN_CARRIER | GEM_MAC_TX_IGN_COLLIS; @@ -2037,17 +2050,9 @@ gem_mii_statchg(device_t dev) rxcfg |= GEM_MAC_RX_CARR_EXTEND; txcfg |= GEM_MAC_TX_CARR_EXTEND; } - GEM_BANK1_WRITE_4(sc, GEM_MAC_TX_CONFIG, 0); - GEM_BANK1_BARRIER(sc, GEM_MAC_TX_CONFIG, 4, - BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); - if (!GEM_BANK1_BITWAIT(sc, GEM_MAC_TX_CONFIG, GEM_MAC_TX_ENABLE, 0)) - device_printf(sc->sc_dev, "cannot disable TX MAC\n"); + (void)gem_disable_tx(sc); GEM_BANK1_WRITE_4(sc, GEM_MAC_TX_CONFIG, txcfg); - GEM_BANK1_WRITE_4(sc, GEM_MAC_RX_CONFIG, 0); - GEM_BANK1_BARRIER(sc, GEM_MAC_RX_CONFIG, 4, - BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); - if (!GEM_BANK1_BITWAIT(sc, GEM_MAC_RX_CONFIG, GEM_MAC_RX_ENABLE, 0)) - device_printf(sc->sc_dev, "cannot disable RX MAC\n"); + (void)gem_disable_rx(sc); GEM_BANK1_WRITE_4(sc, GEM_MAC_RX_CONFIG, rxcfg); v = GEM_BANK1_READ_4(sc, GEM_MAC_CONTROL_CONFIG) & @@ -2092,6 +2097,7 @@ gem_mii_statchg(device_t dev) v |= GEM_MAC_XIF_FDPLX_LED; GEM_BANK1_WRITE_4(sc, GEM_MAC_XIF_CONFIG, v); + sc->sc_mac_rxcfg = rxcfg; if ((sc->sc_ifp->if_drv_flags & IFF_DRV_RUNNING) != 0 && (sc->sc_flags & GEM_LINK) != 0) { GEM_BANK1_WRITE_4(sc, GEM_MAC_TX_CONFIG, @@ -2164,7 +2170,8 @@ gem_ioctl(struct ifnet *ifp, u_long cmd, case SIOCADDMULTI: case SIOCDELMULTI: GEM_LOCK(sc); - gem_setladrf(sc); + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) + gem_setladrf(sc); GEM_UNLOCK(sc); break; case SIOCGIFMEDIA: @@ -2199,24 +2206,20 @@ gem_setladrf(struct gem_softc *sc) GEM_LOCK_ASSERT(sc, MA_OWNED); - /* Get the current RX configuration. */ - v = GEM_BANK1_READ_4(sc, GEM_MAC_RX_CONFIG); - /* - * Turn off promiscuous mode, promiscuous group mode (all multicast), - * and hash filter. Depending on the case, the right bit will be - * enabled. + * Turn off the RX MAC and the hash filter as required by the Sun GEM + * programming restrictions. */ - v &= ~(GEM_MAC_RX_PROMISCUOUS | GEM_MAC_RX_HASH_FILTER | - GEM_MAC_RX_PROMISC_GRP); - + v = sc->sc_mac_rxcfg & GEM_MAC_RX_HASH_FILTER; GEM_BANK1_WRITE_4(sc, GEM_MAC_RX_CONFIG, v); GEM_BANK1_BARRIER(sc, GEM_MAC_RX_CONFIG, 4, BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); - if (!GEM_BANK1_BITWAIT(sc, GEM_MAC_RX_CONFIG, GEM_MAC_RX_HASH_FILTER, - 0)) - device_printf(sc->sc_dev, "cannot disable RX hash filter\n"); + if (!GEM_BANK1_BITWAIT(sc, GEM_MAC_RX_CONFIG, GEM_MAC_RX_HASH_FILTER | + GEM_MAC_RX_ENABLE, 0)) + device_printf(sc->sc_dev, + "cannot disable RX MAC or hash filter\n"); + v &= ~(GEM_MAC_RX_PROMISCUOUS | GEM_MAC_RX_PROMISC_GRP); if ((ifp->if_flags & IFF_PROMISC) != 0) { v |= GEM_MAC_RX_PROMISCUOUS; goto chipit; @@ -2262,5 +2265,6 @@ gem_setladrf(struct gem_softc *sc) hash[i]); chipit: - GEM_BANK1_WRITE_4(sc, GEM_MAC_RX_CONFIG, v); + sc->sc_mac_rxcfg = v; + GEM_BANK1_WRITE_4(sc, GEM_MAC_RX_CONFIG, v | GEM_MAC_RX_ENABLE); } Modified: stable/8/sys/dev/gem/if_gemvar.h ============================================================================== --- stable/8/sys/dev/gem/if_gemvar.h Mon Jul 25 18:32:54 2011 (r224366) +++ stable/8/sys/dev/gem/if_gemvar.h Mon Jul 25 18:32:56 2011 (r224367) @@ -173,6 +173,8 @@ struct gem_softc { u_int sc_rxptr; /* next ready RX descriptor/state */ u_int sc_rxfifosize; /* RX FIFO size (bytes) */ + uint32_t sc_mac_rxcfg; /* RX MAC conf. % GEM_MAC_RX_ENABLE */ + int sc_ifflags; u_long sc_csum_features; }; From owner-svn-src-stable@FreeBSD.ORG Mon Jul 25 18:34:42 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 675B01065673; Mon, 25 Jul 2011 18:34:42 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 56F7B8FC13; Mon, 25 Jul 2011 18:34:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PIYgmc070687; Mon, 25 Jul 2011 18:34:42 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PIYgWk070685; Mon, 25 Jul 2011 18:34:42 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251834.p6PIYgWk070685@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 18:34:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224368 - stable/7/sys/sparc64/sparc64 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 18:34:42 -0000 Author: marius Date: Mon Jul 25 18:34:42 2011 New Revision: 224368 URL: http://svn.freebsd.org/changeset/base/224368 Log: MFC: r223718 Using .comm to declare intrnames and eintrnames causes binutils 2.17.50 to merge the two. Modified: stable/7/sys/sparc64/sparc64/exception.S Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/sparc64/sparc64/exception.S ============================================================================== --- stable/7/sys/sparc64/sparc64/exception.S Mon Jul 25 18:32:56 2011 (r224367) +++ stable/7/sys/sparc64/sparc64/exception.S Mon Jul 25 18:34:42 2011 (r224368) @@ -365,11 +365,18 @@ ENTRY(rsf_fatal) sir END(rsf_fatal) - .comm intrnames, IV_MAX * (MAXCOMLEN + 1) - .comm eintrnames, 0 + .data + _ALIGN_DATA + .globl intrnames, eintrnames +intrnames: + .space IV_MAX * (MAXCOMLEN + 1) +eintrnames: + .globl intrcnt, eintrcnt +intrcnt: + .space IV_MAX * 8 +eintrcnt: - .comm intrcnt, IV_MAX * 8 - .comm eintrcnt, 0 + .text /* * Trap table and associated macros From owner-svn-src-stable@FreeBSD.ORG Mon Jul 25 18:34:42 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 711511065674; Mon, 25 Jul 2011 18:34:42 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6072F8FC14; Mon, 25 Jul 2011 18:34:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PIYg1R070691; Mon, 25 Jul 2011 18:34:42 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PIYgkV070689; Mon, 25 Jul 2011 18:34:42 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251834.p6PIYgkV070689@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 18:34:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224369 - stable/8/sys/sparc64/sparc64 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 18:34:42 -0000 Author: marius Date: Mon Jul 25 18:34:42 2011 New Revision: 224369 URL: http://svn.freebsd.org/changeset/base/224369 Log: MFC: r223718 Using .comm to declare intrnames and eintrnames causes binutils 2.17.50 to merge the two. Modified: stable/8/sys/sparc64/sparc64/exception.S Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/geom/label/ (props changed) Modified: stable/8/sys/sparc64/sparc64/exception.S ============================================================================== --- stable/8/sys/sparc64/sparc64/exception.S Mon Jul 25 18:34:42 2011 (r224368) +++ stable/8/sys/sparc64/sparc64/exception.S Mon Jul 25 18:34:42 2011 (r224369) @@ -369,11 +369,18 @@ ENTRY(rsf_fatal) sir END(rsf_fatal) - .comm intrnames, IV_MAX * (MAXCOMLEN + 1) - .comm eintrnames, 0 + .data + _ALIGN_DATA + .globl intrnames, eintrnames +intrnames: + .space IV_MAX * (MAXCOMLEN + 1) +eintrnames: + .globl intrcnt, eintrcnt +intrcnt: + .space IV_MAX * 8 +eintrcnt: - .comm intrcnt, IV_MAX * 8 - .comm eintrcnt, 0 + .text /* * Trap table and associated macros From owner-svn-src-stable@FreeBSD.ORG Mon Jul 25 18:41:53 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2454B106566B; Mon, 25 Jul 2011 18:41:53 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 11CCF8FC14; Mon, 25 Jul 2011 18:41:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PIfrlQ070957; Mon, 25 Jul 2011 18:41:53 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PIfqND070945; Mon, 25 Jul 2011 18:41:52 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251841.p6PIfqND070945@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 18:41:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224370 - in stable/8/sys: boot/sparc64/loader sparc64/include sparc64/sparc64 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 18:41:53 -0000 Author: marius Date: Mon Jul 25 18:41:52 2011 New Revision: 224370 URL: http://svn.freebsd.org/changeset/base/224370 Log: MFC: r223719 - For Cheetah- and Zeus-class CPUs don't flush all unlocked entries from the TLBs in order to get rid of the user mappings but instead traverse them an flush only the latter like we also do for the Spitfire-class. Also flushing the unlocked kernel entries can cause instant faults which when called from within cpu_switch() are handled with the scheduler lock held which in turn can cause timeouts on the acquisition of the lock by other CPUs. This was easily seen with a 16-core V890 but occasionally also happened with 2-way machines. While at it, move the SPARC64-V support code entirely to zeus.c. This causes a little bit of duplication but is less confusing than partially using Cheetah-class bits for these. - For SPARC64-V ensure that 4-Mbyte page entries are stored in the 1024- entry, 2-way set associative TLB. - In {d,i}tlb_get_data_sun4u() turn off the interrupts in order to ensure that ASI_{D,I}TLB_DATA_ACCESS_REG actually are read twice back-to-back. Tested by: Peter Jeremy (16-core US-IV), Michael Moll (2-way SPARC64-V) Modified: stable/8/sys/boot/sparc64/loader/main.c stable/8/sys/sparc64/include/cache.h stable/8/sys/sparc64/include/cpu.h stable/8/sys/sparc64/include/tlb.h stable/8/sys/sparc64/sparc64/cache.c stable/8/sys/sparc64/sparc64/cheetah.c stable/8/sys/sparc64/sparc64/machdep.c stable/8/sys/sparc64/sparc64/mp_machdep.c stable/8/sys/sparc64/sparc64/pmap.c stable/8/sys/sparc64/sparc64/spitfire.c stable/8/sys/sparc64/sparc64/zeus.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/geom/label/ (props changed) Modified: stable/8/sys/boot/sparc64/loader/main.c ============================================================================== --- stable/8/sys/boot/sparc64/loader/main.c Mon Jul 25 18:34:42 2011 (r224369) +++ stable/8/sys/boot/sparc64/loader/main.c Mon Jul 25 18:41:52 2011 (r224370) @@ -96,10 +96,10 @@ static struct mmu_ops { typedef void kernel_entry_t(vm_offset_t mdp, u_long o1, u_long o2, u_long o3, void *openfirmware); -static inline u_long dtlb_get_data_sun4u(u_int); +static inline u_long dtlb_get_data_sun4u(u_int, u_int); static int dtlb_enter_sun4u(u_int, u_long data, vm_offset_t); static vm_offset_t dtlb_va_to_pa_sun4u(vm_offset_t); -static inline u_long itlb_get_data_sun4u(u_int); +static inline u_long itlb_get_data_sun4u(u_int, u_int); static int itlb_enter_sun4u(u_int, u_long data, vm_offset_t); static vm_offset_t itlb_va_to_pa_sun4u(vm_offset_t); static void itlb_relocate_locked0_sun4u(void); @@ -140,6 +140,7 @@ u_int itlb_slot; static int cpu_impl; static u_int dtlb_slot_max; static u_int itlb_slot_max; +static u_int tlb_locked; /* sun4v */ static struct tlb_entry *tlb_store; @@ -413,42 +414,55 @@ __elfN(exec)(struct preloaded_file *fp) } static inline u_long -dtlb_get_data_sun4u(u_int slot) +dtlb_get_data_sun4u(u_int tlb, u_int slot) { + u_long data, pstate; + slot = TLB_DAR_SLOT(tlb, slot); /* - * We read ASI_DTLB_DATA_ACCESS_REG twice in order to work - * around errata of USIII and beyond. + * We read ASI_DTLB_DATA_ACCESS_REG twice back-to-back in order to + * work around errata of USIII and beyond. */ - (void)ldxa(TLB_DAR_SLOT(slot), ASI_DTLB_DATA_ACCESS_REG); - return (ldxa(TLB_DAR_SLOT(slot), ASI_DTLB_DATA_ACCESS_REG)); + pstate = rdpr(pstate); + wrpr(pstate, pstate & ~PSTATE_IE, 0); + (void)ldxa(slot, ASI_DTLB_DATA_ACCESS_REG); + data = ldxa(slot, ASI_DTLB_DATA_ACCESS_REG); + wrpr(pstate, pstate, 0); + return (data); } static inline u_long -itlb_get_data_sun4u(u_int slot) +itlb_get_data_sun4u(u_int tlb, u_int slot) { + u_long data, pstate; + slot = TLB_DAR_SLOT(tlb, slot); /* - * We read ASI_ITLB_DATA_ACCESS_REG twice in order to work - * around errata of USIII and beyond. + * We read ASI_DTLB_DATA_ACCESS_REG twice back-to-back in order to + * work around errata of USIII and beyond. */ - (void)ldxa(TLB_DAR_SLOT(slot), ASI_ITLB_DATA_ACCESS_REG); - return (ldxa(TLB_DAR_SLOT(slot), ASI_ITLB_DATA_ACCESS_REG)); + pstate = rdpr(pstate); + wrpr(pstate, pstate & ~PSTATE_IE, 0); + (void)ldxa(slot, ASI_ITLB_DATA_ACCESS_REG); + data = ldxa(slot, ASI_ITLB_DATA_ACCESS_REG); + wrpr(pstate, pstate, 0); + return (data); } static vm_offset_t dtlb_va_to_pa_sun4u(vm_offset_t va) { u_long pstate, reg; - int i; + u_int i, tlb; pstate = rdpr(pstate); wrpr(pstate, pstate & ~PSTATE_IE, 0); for (i = 0; i < dtlb_slot_max; i++) { - reg = ldxa(TLB_DAR_SLOT(i), ASI_DTLB_TAG_READ_REG); + reg = ldxa(TLB_DAR_SLOT(tlb_locked, i), + ASI_DTLB_TAG_READ_REG); if (TLB_TAR_VA(reg) != va) continue; - reg = dtlb_get_data_sun4u(i); + reg = dtlb_get_data_sun4u(tlb_locked, i); wrpr(pstate, pstate, 0); reg >>= TD_PA_SHIFT; if (cpu_impl == CPU_IMPL_SPARC64V || @@ -469,10 +483,11 @@ itlb_va_to_pa_sun4u(vm_offset_t va) pstate = rdpr(pstate); wrpr(pstate, pstate & ~PSTATE_IE, 0); for (i = 0; i < itlb_slot_max; i++) { - reg = ldxa(TLB_DAR_SLOT(i), ASI_ITLB_TAG_READ_REG); + reg = ldxa(TLB_DAR_SLOT(tlb_locked, i), + ASI_ITLB_TAG_READ_REG); if (TLB_TAR_VA(reg) != va) continue; - reg = itlb_get_data_sun4u(i); + reg = itlb_get_data_sun4u(tlb_locked, i); wrpr(pstate, pstate, 0); reg >>= TD_PA_SHIFT; if (cpu_impl == CPU_IMPL_SPARC64V || @@ -516,14 +531,14 @@ itlb_relocate_locked0_sun4u(void) pstate = rdpr(pstate); wrpr(pstate, pstate & ~PSTATE_IE, 0); - data = itlb_get_data_sun4u(0); + data = itlb_get_data_sun4u(tlb_locked, 0); if ((data & (TD_V | TD_L)) != (TD_V | TD_L)) { wrpr(pstate, pstate, 0); return; } /* Flush the mapping of slot 0. */ - tag = ldxa(TLB_DAR_SLOT(0), ASI_ITLB_TAG_READ_REG); + tag = ldxa(TLB_DAR_SLOT(tlb_locked, 0), ASI_ITLB_TAG_READ_REG); stxa(TLB_DEMAP_VA(TLB_TAR_VA(tag)) | TLB_DEMAP_PRIMARY | TLB_DEMAP_PAGE, ASI_IMMU_DEMAP, 0); flush(0); /* The USIII-family ignores the address. */ @@ -533,11 +548,12 @@ itlb_relocate_locked0_sun4u(void) * that formerly were in slot 0. */ for (i = 1; i < itlb_slot_max; i++) { - if ((itlb_get_data_sun4u(i) & TD_V) != 0) + if ((itlb_get_data_sun4u(tlb_locked, i) & TD_V) != 0) continue; stxa(AA_IMMU_TAR, ASI_IMMU, tag); - stxa(TLB_DAR_SLOT(i), ASI_ITLB_DATA_ACCESS_REG, data); + stxa(TLB_DAR_SLOT(tlb_locked, i), ASI_ITLB_DATA_ACCESS_REG, + data); flush(0); /* The USIII-family ignores the address. */ break; } @@ -750,6 +766,26 @@ tlb_init_sun4u(void) phandle_t bsp; cpu_impl = VER_IMPL(rdpr(ver)); + switch (cpu_impl) { + case CPU_IMPL_SPARC64: + case CPU_IMPL_ULTRASPARCI: + case CPU_IMPL_ULTRASPARCII: + case CPU_IMPL_ULTRASPARCIIi: + case CPU_IMPL_ULTRASPARCIIe: + tlb_locked = TLB_DAR_T32; + break; + case CPU_IMPL_ULTRASPARCIII: + case CPU_IMPL_ULTRASPARCIIIp: + case CPU_IMPL_ULTRASPARCIIIi: + case CPU_IMPL_ULTRASPARCIIIip: + case CPU_IMPL_ULTRASPARCIV: + case CPU_IMPL_ULTRASPARCIVp: + tlb_locked = TLB_DAR_T16; + break; + case CPU_IMPL_SPARC64V: + tlb_locked = TLB_DAR_FTLB; + break; + } bsp = find_bsp_sun4u(OF_child(root), cpu_get_mid_sun4u()); if (bsp == 0) panic("%s: no node for bootcpu?!?!", __func__); @@ -936,21 +972,23 @@ pmap_print_tlb_sun4u(void) pstate = rdpr(pstate); for (i = 0; i < itlb_slot_max; i++) { wrpr(pstate, pstate & ~PSTATE_IE, 0); - tte = itlb_get_data_sun4u(i); + tte = itlb_get_data_sun4u(tlb_locked, i); wrpr(pstate, pstate, 0); if (!(tte & TD_V)) continue; - tag = ldxa(TLB_DAR_SLOT(i), ASI_ITLB_TAG_READ_REG); + tag = ldxa(TLB_DAR_SLOT(tlb_locked, i), + ASI_ITLB_TAG_READ_REG); printf("iTLB-%2u: ", i); pmap_print_tte_sun4u(tag, tte); } for (i = 0; i < dtlb_slot_max; i++) { wrpr(pstate, pstate & ~PSTATE_IE, 0); - tte = dtlb_get_data_sun4u(i); + tte = dtlb_get_data_sun4u(tlb_locked, i); wrpr(pstate, pstate, 0); if (!(tte & TD_V)) continue; - tag = ldxa(TLB_DAR_SLOT(i), ASI_DTLB_TAG_READ_REG); + tag = ldxa(TLB_DAR_SLOT(tlb_locked, i), + ASI_DTLB_TAG_READ_REG); printf("dTLB-%2u: ", i); pmap_print_tte_sun4u(tag, tte); } Modified: stable/8/sys/sparc64/include/cache.h ============================================================================== --- stable/8/sys/sparc64/include/cache.h Mon Jul 25 18:34:42 2011 (r224369) +++ stable/8/sys/sparc64/include/cache.h Mon Jul 25 18:41:52 2011 (r224370) @@ -110,15 +110,16 @@ cache_flush_t spitfire_cache_flush; dcache_page_inval_t spitfire_dcache_page_inval; icache_page_inval_t spitfire_icache_page_inval; +cache_enable_t zeus_cache_enable; +cache_flush_t zeus_cache_flush; +dcache_page_inval_t zeus_dcache_page_inval; +icache_page_inval_t zeus_icache_page_inval; + extern cache_enable_t *cache_enable; extern cache_flush_t *cache_flush; extern dcache_page_inval_t *dcache_page_inval; extern icache_page_inval_t *icache_page_inval; -cache_flush_t zeus_cache_flush; -dcache_page_inval_t zeus_dcache_page_inval; -icache_page_inval_t zeus_icache_page_inval; - #endif /* KERNEL */ #endif /* !LOCORE */ Modified: stable/8/sys/sparc64/include/cpu.h ============================================================================== --- stable/8/sys/sparc64/include/cpu.h Mon Jul 25 18:34:42 2011 (r224369) +++ stable/8/sys/sparc64/include/cpu.h Mon Jul 25 18:41:52 2011 (r224370) @@ -57,6 +57,7 @@ void cpu_halt(void); void cpu_reset(void); void fork_trampoline(void); void swi_vm(void *v); +void zeus_init(u_int cpu_impl); static __inline u_int64_t get_cyclecount(void) Modified: stable/8/sys/sparc64/include/tlb.h ============================================================================== --- stable/8/sys/sparc64/include/tlb.h Mon Jul 25 18:34:42 2011 (r224369) +++ stable/8/sys/sparc64/include/tlb.h Mon Jul 25 18:41:52 2011 (r224370) @@ -44,7 +44,17 @@ (TD_V | TD_4M | (TLB_DIRECT_ADDRESS_MASK - TLB_DIRECT_PAGE_MASK)) #define TLB_DAR_SLOT_SHIFT (3) -#define TLB_DAR_SLOT(slot) ((slot) << TLB_DAR_SLOT_SHIFT) +#define TLB_DAR_TLB_SHIFT (16) +#define TLB_DAR_SLOT(tlb, slot) \ + ((tlb) << TLB_DAR_TLB_SHIFT | (slot) << TLB_DAR_SLOT_SHIFT) +#define TLB_DAR_T16 (0) /* US-III{,i,+}, IV{,+} */ +#define TLB_DAR_T32 (0) /* US-I, II{,e,i} */ +#define TLB_DAR_DT512_0 (2) /* US-III{,i,+}, IV{,+} */ +#define TLB_DAR_DT512_1 (3) /* US-III{,i,+}, IV{,+} */ +#define TLB_DAR_IT128 (2) /* US-III{,i,+}, IV */ +#define TLB_DAR_IT512 (2) /* US-IV+ */ +#define TLB_DAR_FTLB (0) /* SPARC64 V, VI, VII, VIIIfx */ +#define TLB_DAR_STLB (2) /* SPARC64 V, VI, VII, VIIIfx */ #define TAR_VPN_SHIFT (13) #define TAR_CTX_MASK ((1 << TAR_VPN_SHIFT) - 1) @@ -156,6 +166,9 @@ tlb_flush_user_t cheetah_tlb_flush_user; tlb_flush_nonlocked_t spitfire_tlb_flush_nonlocked; tlb_flush_user_t spitfire_tlb_flush_user; +tlb_flush_nonlocked_t zeus_tlb_flush_nonlocked; +tlb_flush_user_t zeus_tlb_flush_user; + extern tlb_flush_nonlocked_t *tlb_flush_nonlocked; extern tlb_flush_user_t *tlb_flush_user; Modified: stable/8/sys/sparc64/sparc64/cache.c ============================================================================== --- stable/8/sys/sparc64/sparc64/cache.c Mon Jul 25 18:34:42 2011 (r224369) +++ stable/8/sys/sparc64/sparc64/cache.c Mon Jul 25 18:41:52 2011 (r224370) @@ -169,12 +169,12 @@ cache_init(struct pcpu *pcpu) tlb_flush_nonlocked = cheetah_tlb_flush_nonlocked; tlb_flush_user = cheetah_tlb_flush_user; } else if (pcpu->pc_impl == CPU_IMPL_SPARC64V) { - cache_enable = cheetah_cache_enable; + cache_enable = zeus_cache_enable; cache_flush = zeus_cache_flush; dcache_page_inval = zeus_dcache_page_inval; icache_page_inval = zeus_icache_page_inval; - tlb_flush_nonlocked = cheetah_tlb_flush_nonlocked; - tlb_flush_user = cheetah_tlb_flush_user; + tlb_flush_nonlocked = zeus_tlb_flush_nonlocked; + tlb_flush_user = zeus_tlb_flush_user; } else if (pcpu->pc_impl >= CPU_IMPL_ULTRASPARCI && pcpu->pc_impl < CPU_IMPL_ULTRASPARCIII) { cache_enable = spitfire_cache_enable; Modified: stable/8/sys/sparc64/sparc64/cheetah.c ============================================================================== --- stable/8/sys/sparc64/sparc64/cheetah.c Mon Jul 25 18:34:42 2011 (r224369) +++ stable/8/sys/sparc64/sparc64/cheetah.c Mon Jul 25 18:41:52 2011 (r224370) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2003 Jake Burkholder. - * Copyright (c) 2005, 2008, 2010 Marius Strobl + * Copyright (c) 2005 - 2011 Marius Strobl * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -28,8 +28,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_pmap.h" - #include #include #include @@ -45,17 +43,19 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include #include #define CHEETAH_ICACHE_TAG_LOWER 0x30 +#define CHEETAH_T16_ENTRIES 16 +#define CHEETAH_DT512_ENTRIES 512 +#define CHEETAH_IT128_ENTRIES 128 +#define CHEETAH_IT512_ENTRIES 512 /* - * CPU-specific initialization - this is used for both the Sun Cheetah and - * later as well as the Fujitsu Zeus and later CPUs. + * CPU-specific initialization for Sun Cheetah and later CPUs */ void cheetah_init(u_int cpu_impl) @@ -78,14 +78,6 @@ cheetah_init(u_int cpu_impl) stxa(AA_IMMU_TSB_NEXT_REG, ASI_IMMU, 0); membar(Sync); - if (cpu_impl == CPU_IMPL_SPARC64V) { - /* Ensure MCNTL_JPS1_TSBP is 0. */ - val = ldxa(AA_MCNTL, ASI_MCNTL); - val &= ~MCNTL_JPS1_TSBP; - stxa(AA_MCNTL, ASI_MCNTL, val); - return; - } - /* * Configure the first large dTLB to hold 4MB pages (e.g. for direct * mappings) for all three contexts and ensure the second one is set @@ -223,33 +215,92 @@ cheetah_icache_page_inval(vm_paddr_t pa } -#define cheetah_dmap_all() do { \ - stxa(TLB_DEMAP_ALL, ASI_DMMU_DEMAP, 0); \ - stxa(TLB_DEMAP_ALL, ASI_IMMU_DEMAP, 0); \ - flush(KERNBASE); \ -} while (0) - /* - * Flush all non-locked mappings from the TLB. + * Flush all non-locked mappings from the TLBs. */ void cheetah_tlb_flush_nonlocked(void) { - cheetah_dmap_all(); + stxa(TLB_DEMAP_ALL, ASI_DMMU_DEMAP, 0); + stxa(TLB_DEMAP_ALL, ASI_IMMU_DEMAP, 0); + flush(KERNBASE); } /* - * Flush all user mappings from the TLB. + * Flush all user mappings from the TLBs. */ void -cheetah_tlb_flush_user() +cheetah_tlb_flush_user(void) { + u_long data, tag; + register_t s; + u_int i, slot; /* - * Just use cheetah_dmap_all() and accept somes TLB misses - * rather than searching all 1040 D-TLB and 144 I-TLB slots - * for non-kernel mappings. + * We read ASI_{D,I}TLB_DATA_ACCESS_REG twice back-to-back in order + * to work around errata of USIII and beyond. */ - cheetah_dmap_all(); + for (i = 0; i < CHEETAH_T16_ENTRIES; i++) { + slot = TLB_DAR_SLOT(TLB_DAR_T16, i); + s = intr_disable(); + (void)ldxa(slot, ASI_DTLB_DATA_ACCESS_REG); + data = ldxa(slot, ASI_DTLB_DATA_ACCESS_REG); + intr_restore(s); + tag = ldxa(slot, ASI_DTLB_TAG_READ_REG); + if ((data & TD_V) != 0 && (data & TD_L) == 0 && + TLB_TAR_CTX(tag) != TLB_CTX_KERNEL) + stxa_sync(slot, ASI_DTLB_DATA_ACCESS_REG, 0); + s = intr_disable(); + (void)ldxa(slot, ASI_ITLB_DATA_ACCESS_REG); + data = ldxa(slot, ASI_ITLB_DATA_ACCESS_REG); + intr_restore(s); + tag = ldxa(slot, ASI_ITLB_TAG_READ_REG); + if ((data & TD_V) != 0 && (data & TD_L) == 0 && + TLB_TAR_CTX(tag) != TLB_CTX_KERNEL) + stxa_sync(slot, ASI_ITLB_DATA_ACCESS_REG, 0); + } + for (i = 0; i < CHEETAH_DT512_ENTRIES; i++) { + slot = TLB_DAR_SLOT(TLB_DAR_DT512_0, i); + s = intr_disable(); + (void)ldxa(slot, ASI_DTLB_DATA_ACCESS_REG); + data = ldxa(slot, ASI_DTLB_DATA_ACCESS_REG); + intr_restore(s); + tag = ldxa(slot, ASI_DTLB_TAG_READ_REG); + if ((data & TD_V) != 0 && TLB_TAR_CTX(tag) != TLB_CTX_KERNEL) + stxa_sync(slot, ASI_DTLB_DATA_ACCESS_REG, 0); + slot = TLB_DAR_SLOT(TLB_DAR_DT512_1, i); + s = intr_disable(); + (void)ldxa(slot, ASI_ITLB_DATA_ACCESS_REG); + data = ldxa(slot, ASI_DTLB_DATA_ACCESS_REG); + intr_restore(s); + tag = ldxa(slot, ASI_DTLB_TAG_READ_REG); + if ((data & TD_V) != 0 && TLB_TAR_CTX(tag) != TLB_CTX_KERNEL) + stxa_sync(slot, ASI_DTLB_DATA_ACCESS_REG, 0); + } + if (PCPU_GET(impl) == CPU_IMPL_ULTRASPARCIVp) { + for (i = 0; i < CHEETAH_IT512_ENTRIES; i++) { + slot = TLB_DAR_SLOT(TLB_DAR_IT512, i); + s = intr_disable(); + (void)ldxa(slot, ASI_ITLB_DATA_ACCESS_REG); + data = ldxa(slot, ASI_ITLB_DATA_ACCESS_REG); + intr_restore(s); + tag = ldxa(slot, ASI_ITLB_TAG_READ_REG); + if ((data & TD_V) != 0 && + TLB_TAR_CTX(tag) != TLB_CTX_KERNEL) + stxa_sync(slot, ASI_ITLB_DATA_ACCESS_REG, 0); + } + } else { + for (i = 0; i < CHEETAH_IT128_ENTRIES; i++) { + slot = TLB_DAR_SLOT(TLB_DAR_IT128, i); + s = intr_disable(); + (void)ldxa(slot, ASI_ITLB_DATA_ACCESS_REG); + data = ldxa(slot, ASI_ITLB_DATA_ACCESS_REG); + tag = ldxa(slot, ASI_ITLB_TAG_READ_REG); + intr_restore(s); + if ((data & TD_V) != 0 && + TLB_TAR_CTX(tag) != TLB_CTX_KERNEL) + stxa_sync(slot, ASI_ITLB_DATA_ACCESS_REG, 0); + } + } } Modified: stable/8/sys/sparc64/sparc64/machdep.c ============================================================================== --- stable/8/sys/sparc64/sparc64/machdep.c Mon Jul 25 18:34:42 2011 (r224369) +++ stable/8/sys/sparc64/sparc64/machdep.c Mon Jul 25 18:41:52 2011 (r224370) @@ -347,9 +347,10 @@ sparc64_init(caddr_t mdp, u_long o1, u_l /* * Do CPU-specific initialization. */ - if (cpu_impl == CPU_IMPL_SPARC64V || - cpu_impl >= CPU_IMPL_ULTRASPARCIII) + if (cpu_impl >= CPU_IMPL_ULTRASPARCIII) cheetah_init(cpu_impl); + else if (cpu_impl == CPU_IMPL_SPARC64V) + zeus_init(cpu_impl); /* * Clear (S)TICK timer (including NPT). Modified: stable/8/sys/sparc64/sparc64/mp_machdep.c ============================================================================== --- stable/8/sys/sparc64/sparc64/mp_machdep.c Mon Jul 25 18:34:42 2011 (r224369) +++ stable/8/sys/sparc64/sparc64/mp_machdep.c Mon Jul 25 18:41:52 2011 (r224370) @@ -424,9 +424,11 @@ cpu_mp_bootstrap(struct pcpu *pc) csa = &cpu_start_args; /* Do CPU-specific initialization. */ - if (pc->pc_impl == CPU_IMPL_SPARC64V || - pc->pc_impl >= CPU_IMPL_ULTRASPARCIII) + if (pc->pc_impl >= CPU_IMPL_ULTRASPARCIII) cheetah_init(pc->pc_impl); + else if (pc->pc_impl == CPU_IMPL_SPARC64V) + zeus_init(pc->pc_impl); + /* * Enable the caches. Note that his may include applying workarounds. */ Modified: stable/8/sys/sparc64/sparc64/pmap.c ============================================================================== --- stable/8/sys/sparc64/sparc64/pmap.c Mon Jul 25 18:34:42 2011 (r224369) +++ stable/8/sys/sparc64/sparc64/pmap.c Mon Jul 25 18:41:52 2011 (r224370) @@ -247,7 +247,7 @@ PMAP_STATS_VAR(pmap_ncopy_page_soc); PMAP_STATS_VAR(pmap_nnew_thread); PMAP_STATS_VAR(pmap_nnew_thread_oc); -static inline u_long dtlb_get_data(u_int slot); +static inline u_long dtlb_get_data(u_int tlb, u_int slot); /* * Quick sort callout for comparing memory regions @@ -288,15 +288,21 @@ om_cmp(const void *a, const void *b) } static inline u_long -dtlb_get_data(u_int slot) +dtlb_get_data(u_int tlb, u_int slot) { + u_long data; + register_t s; + slot = TLB_DAR_SLOT(tlb, slot); /* - * We read ASI_DTLB_DATA_ACCESS_REG twice in order to work - * around errata of USIII and beyond. + * We read ASI_DTLB_DATA_ACCESS_REG twice back-to-back in order to + * work around errata of USIII and beyond. */ - (void)ldxa(TLB_DAR_SLOT(slot), ASI_DTLB_DATA_ACCESS_REG); - return (ldxa(TLB_DAR_SLOT(slot), ASI_DTLB_DATA_ACCESS_REG)); + s = intr_disable(); + (void)ldxa(slot, ASI_DTLB_DATA_ACCESS_REG); + data = ldxa(slot, ASI_DTLB_DATA_ACCESS_REG); + intr_restore(s); + return (data); } /* @@ -392,7 +398,9 @@ pmap_bootstrap(u_int cpu_impl) } else { dtlb_slots_avail = 0; for (i = 0; i < dtlb_slots; i++) { - data = dtlb_get_data(i); + data = dtlb_get_data(cpu_impl == + CPU_IMPL_ULTRASPARCIII ? TLB_DAR_T16 : + TLB_DAR_T32, i); if ((data & (TD_V | TD_L)) != (TD_V | TD_L)) dtlb_slots_avail++; } Modified: stable/8/sys/sparc64/sparc64/spitfire.c ============================================================================== --- stable/8/sys/sparc64/sparc64/spitfire.c Mon Jul 25 18:34:42 2011 (r224369) +++ stable/8/sys/sparc64/sparc64/spitfire.c Mon Jul 25 18:41:52 2011 (r224370) @@ -140,47 +140,45 @@ spitfire_icache_page_inval(vm_paddr_t pa } /* - * Flush all non-locked mappings from the TLB. + * Flush all non-locked mappings from the TLBs. */ void spitfire_tlb_flush_nonlocked(void) { - int i; + u_int i; + u_int slot; for (i = 0; i < SPITFIRE_TLB_ENTRIES; i++) { - if ((ldxa(TLB_DAR_SLOT(i), ASI_DTLB_DATA_ACCESS_REG) & - TD_L) == 0) - stxa_sync(TLB_DAR_SLOT(i), - ASI_DTLB_DATA_ACCESS_REG, 0); - if ((ldxa(TLB_DAR_SLOT(i), ASI_ITLB_DATA_ACCESS_REG) & - TD_L) == 0) - stxa_sync(TLB_DAR_SLOT(i), - ASI_ITLB_DATA_ACCESS_REG, 0); + slot = TLB_DAR_SLOT(TLB_DAR_T32, i); + if ((ldxa(slot, ASI_DTLB_DATA_ACCESS_REG) & TD_L) == 0) + stxa_sync(slot, ASI_DTLB_DATA_ACCESS_REG, 0); + if ((ldxa(slot, ASI_ITLB_DATA_ACCESS_REG) & TD_L) == 0) + stxa_sync(slot, ASI_ITLB_DATA_ACCESS_REG, 0); } } /* - * Flush all user mappings from the TLB. + * Flush all user mappings from the TLBs. */ void spitfire_tlb_flush_user(void) { u_long data; u_long tag; - int i; + u_int i; + u_int slot; for (i = 0; i < SPITFIRE_TLB_ENTRIES; i++) { - data = ldxa(TLB_DAR_SLOT(i), ASI_DTLB_DATA_ACCESS_REG); - tag = ldxa(TLB_DAR_SLOT(i), ASI_DTLB_TAG_READ_REG); + slot = TLB_DAR_SLOT(TLB_DAR_T32, i); + data = ldxa(slot, ASI_DTLB_DATA_ACCESS_REG); + tag = ldxa(slot, ASI_DTLB_TAG_READ_REG); if ((data & TD_V) != 0 && (data & TD_L) == 0 && TLB_TAR_CTX(tag) != TLB_CTX_KERNEL) - stxa_sync(TLB_DAR_SLOT(i), - ASI_DTLB_DATA_ACCESS_REG, 0); - data = ldxa(TLB_DAR_SLOT(i), ASI_ITLB_DATA_ACCESS_REG); - tag = ldxa(TLB_DAR_SLOT(i), ASI_ITLB_TAG_READ_REG); + stxa_sync(slot, ASI_DTLB_DATA_ACCESS_REG, 0); + data = ldxa(slot, ASI_ITLB_DATA_ACCESS_REG); + tag = ldxa(slot, ASI_ITLB_TAG_READ_REG); if ((data & TD_V) != 0 && (data & TD_L) == 0 && TLB_TAR_CTX(tag) != TLB_CTX_KERNEL) - stxa_sync(TLB_DAR_SLOT(i), - ASI_ITLB_DATA_ACCESS_REG, 0); + stxa_sync(slot, ASI_ITLB_DATA_ACCESS_REG, 0); } } Modified: stable/8/sys/sparc64/sparc64/zeus.c ============================================================================== --- stable/8/sys/sparc64/sparc64/zeus.c Mon Jul 25 18:34:42 2011 (r224369) +++ stable/8/sys/sparc64/sparc64/zeus.c Mon Jul 25 18:41:52 2011 (r224370) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2010 Marius Strobl + * Copyright (c) 2010 - 2011 Marius Strobl * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -32,7 +32,64 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include +#include +#include +#include +#include +#include + +#define ZEUS_FTLB_ENTRIES 32 +#define ZEUS_STLB_ENTRIES 2048 + +/* + * CPU-specific initialization for Fujitsu Zeus CPUs + */ +void +zeus_init(u_int cpu_impl) +{ + u_long val; + + /* Ensure the TSB Extension Registers hold 0 as TSB_Base. */ + + stxa(AA_DMMU_TSB_PEXT_REG, ASI_DMMU, 0); + stxa(AA_IMMU_TSB_PEXT_REG, ASI_IMMU, 0); + membar(Sync); + + stxa(AA_DMMU_TSB_SEXT_REG, ASI_DMMU, 0); + /* + * NB: the secondary context was removed from the iMMU. + */ + membar(Sync); + + stxa(AA_DMMU_TSB_NEXT_REG, ASI_DMMU, 0); + stxa(AA_IMMU_TSB_NEXT_REG, ASI_IMMU, 0); + membar(Sync); + + val = ldxa(AA_MCNTL, ASI_MCNTL); + /* Ensure MCNTL_JPS1_TSBP is 0. */ + val &= ~MCNTL_JPS1_TSBP; + /* + * Ensure 4-Mbyte page entries are stored in the 1024-entry, 2-way set + * associative TLB. + */ + val = (val & ~MCNTL_RMD_MASK) | MCNTL_RMD_1024; + stxa(AA_MCNTL, ASI_MCNTL, val); +} + +/* + * Enable level 1 caches. + */ +void +zeus_cache_enable(u_int cpu_impl) +{ + u_long lsu; + + lsu = ldxa(0, ASI_LSU_CTL_REG); + stxa(0, ASI_LSU_CTL_REG, lsu | LSU_IC | LSU_DC); + flush(KERNBASE); +} /* * Flush all lines from the level 1 caches. @@ -63,3 +120,52 @@ zeus_icache_page_inval(vm_paddr_t pa __u { } + +/* + * Flush all non-locked mappings from the TLBs. + */ +void +zeus_tlb_flush_nonlocked(void) +{ + + stxa(TLB_DEMAP_ALL, ASI_DMMU_DEMAP, 0); + stxa(TLB_DEMAP_ALL, ASI_IMMU_DEMAP, 0); + flush(KERNBASE); +} + +/* + * Flush all user mappings from the TLBs. + */ +void +zeus_tlb_flush_user(void) +{ + u_long data, tag; + u_int i, slot; + + for (i = 0; i < ZEUS_FTLB_ENTRIES; i++) { + slot = TLB_DAR_SLOT(TLB_DAR_FTLB, i); + data = ldxa(slot, ASI_DTLB_DATA_ACCESS_REG); + tag = ldxa(slot, ASI_DTLB_TAG_READ_REG); + if ((data & TD_V) != 0 && (data & TD_L) == 0 && + TLB_TAR_CTX(tag) != TLB_CTX_KERNEL) + stxa_sync(slot, ASI_DTLB_DATA_ACCESS_REG, 0); + data = ldxa(slot, ASI_ITLB_DATA_ACCESS_REG); + tag = ldxa(slot, ASI_ITLB_TAG_READ_REG); + if ((data & TD_V) != 0 && (data & TD_L) == 0 && + TLB_TAR_CTX(tag) != TLB_CTX_KERNEL) + stxa_sync(slot, ASI_ITLB_DATA_ACCESS_REG, 0); + } + for (i = 0; i < ZEUS_STLB_ENTRIES; i++) { + slot = TLB_DAR_SLOT(TLB_DAR_STLB, i); + data = ldxa(slot, ASI_DTLB_DATA_ACCESS_REG); + tag = ldxa(slot, ASI_DTLB_TAG_READ_REG); + if ((data & TD_V) != 0 && (data & TD_L) == 0 && + TLB_TAR_CTX(tag) != TLB_CTX_KERNEL) + stxa_sync(slot, ASI_DTLB_DATA_ACCESS_REG, 0); + data = ldxa(slot, ASI_ITLB_DATA_ACCESS_REG); + tag = ldxa(slot, ASI_ITLB_TAG_READ_REG); + if ((data & TD_V) != 0 && (data & TD_L) == 0 && + TLB_TAR_CTX(tag) != TLB_CTX_KERNEL) + stxa_sync(slot, ASI_ITLB_DATA_ACCESS_REG, 0); + } +} From owner-svn-src-stable@FreeBSD.ORG Mon Jul 25 18:42:45 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E20D61065670; Mon, 25 Jul 2011 18:42:45 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CF91A8FC08; Mon, 25 Jul 2011 18:42:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PIgjrg071043; Mon, 25 Jul 2011 18:42:45 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PIgjC1071031; Mon, 25 Jul 2011 18:42:45 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251842.p6PIgjC1071031@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 18:42:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224371 - in stable/7/sys: boot/sparc64/loader sparc64/include sparc64/sparc64 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 18:42:46 -0000 Author: marius Date: Mon Jul 25 18:42:45 2011 New Revision: 224371 URL: http://svn.freebsd.org/changeset/base/224371 Log: MFC: r223719 - For Cheetah- and Zeus-class CPUs don't flush all unlocked entries from the TLBs in order to get rid of the user mappings but instead traverse them an flush only the latter like we also do for the Spitfire-class. Also flushing the unlocked kernel entries can cause instant faults which when called from within cpu_switch() are handled with the scheduler lock held which in turn can cause timeouts on the acquisition of the lock by other CPUs. This was easily seen with a 16-core V890 but occasionally also happened with 2-way machines. While at it, move the SPARC64-V support code entirely to zeus.c. This causes a little bit of duplication but is less confusing than partially using Cheetah-class bits for these. - For SPARC64-V ensure that 4-Mbyte page entries are stored in the 1024- entry, 2-way set associative TLB. - In {d,i}tlb_get_data_sun4u() turn off the interrupts in order to ensure that ASI_{D,I}TLB_DATA_ACCESS_REG actually are read twice back-to-back. Tested by: Peter Jeremy (16-core US-IV), Michael Moll (2-way SPARC64-V) Modified: stable/7/sys/boot/sparc64/loader/main.c stable/7/sys/sparc64/include/cache.h stable/7/sys/sparc64/include/cpu.h stable/7/sys/sparc64/include/tlb.h stable/7/sys/sparc64/sparc64/cache.c stable/7/sys/sparc64/sparc64/cheetah.c stable/7/sys/sparc64/sparc64/machdep.c stable/7/sys/sparc64/sparc64/mp_machdep.c stable/7/sys/sparc64/sparc64/pmap.c stable/7/sys/sparc64/sparc64/spitfire.c stable/7/sys/sparc64/sparc64/zeus.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/boot/sparc64/loader/main.c ============================================================================== --- stable/7/sys/boot/sparc64/loader/main.c Mon Jul 25 18:41:52 2011 (r224370) +++ stable/7/sys/boot/sparc64/loader/main.c Mon Jul 25 18:42:45 2011 (r224371) @@ -96,10 +96,10 @@ static struct mmu_ops { typedef void kernel_entry_t(vm_offset_t mdp, u_long o1, u_long o2, u_long o3, void *openfirmware); -static inline u_long dtlb_get_data_sun4u(u_int); +static inline u_long dtlb_get_data_sun4u(u_int, u_int); static int dtlb_enter_sun4u(u_int, u_long data, vm_offset_t); static vm_offset_t dtlb_va_to_pa_sun4u(vm_offset_t); -static inline u_long itlb_get_data_sun4u(u_int); +static inline u_long itlb_get_data_sun4u(u_int, u_int); static int itlb_enter_sun4u(u_int, u_long data, vm_offset_t); static vm_offset_t itlb_va_to_pa_sun4u(vm_offset_t); static void itlb_relocate_locked0_sun4u(void); @@ -140,6 +140,7 @@ u_int itlb_slot; static int cpu_impl; static u_int dtlb_slot_max; static u_int itlb_slot_max; +static u_int tlb_locked; /* sun4v */ static struct tlb_entry *tlb_store; @@ -414,42 +415,55 @@ __elfN(exec)(struct preloaded_file *fp) } static inline u_long -dtlb_get_data_sun4u(u_int slot) +dtlb_get_data_sun4u(u_int tlb, u_int slot) { + u_long data, pstate; + slot = TLB_DAR_SLOT(tlb, slot); /* - * We read ASI_DTLB_DATA_ACCESS_REG twice in order to work - * around errata of USIII and beyond. + * We read ASI_DTLB_DATA_ACCESS_REG twice back-to-back in order to + * work around errata of USIII and beyond. */ - (void)ldxa(TLB_DAR_SLOT(slot), ASI_DTLB_DATA_ACCESS_REG); - return (ldxa(TLB_DAR_SLOT(slot), ASI_DTLB_DATA_ACCESS_REG)); + pstate = rdpr(pstate); + wrpr(pstate, pstate & ~PSTATE_IE, 0); + (void)ldxa(slot, ASI_DTLB_DATA_ACCESS_REG); + data = ldxa(slot, ASI_DTLB_DATA_ACCESS_REG); + wrpr(pstate, pstate, 0); + return (data); } static inline u_long -itlb_get_data_sun4u(u_int slot) +itlb_get_data_sun4u(u_int tlb, u_int slot) { + u_long data, pstate; + slot = TLB_DAR_SLOT(tlb, slot); /* - * We read ASI_ITLB_DATA_ACCESS_REG twice in order to work - * around errata of USIII and beyond. + * We read ASI_DTLB_DATA_ACCESS_REG twice back-to-back in order to + * work around errata of USIII and beyond. */ - (void)ldxa(TLB_DAR_SLOT(slot), ASI_ITLB_DATA_ACCESS_REG); - return (ldxa(TLB_DAR_SLOT(slot), ASI_ITLB_DATA_ACCESS_REG)); + pstate = rdpr(pstate); + wrpr(pstate, pstate & ~PSTATE_IE, 0); + (void)ldxa(slot, ASI_ITLB_DATA_ACCESS_REG); + data = ldxa(slot, ASI_ITLB_DATA_ACCESS_REG); + wrpr(pstate, pstate, 0); + return (data); } static vm_offset_t dtlb_va_to_pa_sun4u(vm_offset_t va) { u_long pstate, reg; - int i; + u_int i, tlb; pstate = rdpr(pstate); wrpr(pstate, pstate & ~PSTATE_IE, 0); for (i = 0; i < dtlb_slot_max; i++) { - reg = ldxa(TLB_DAR_SLOT(i), ASI_DTLB_TAG_READ_REG); + reg = ldxa(TLB_DAR_SLOT(tlb_locked, i), + ASI_DTLB_TAG_READ_REG); if (TLB_TAR_VA(reg) != va) continue; - reg = dtlb_get_data_sun4u(i); + reg = dtlb_get_data_sun4u(tlb_locked, i); wrpr(pstate, pstate, 0); reg >>= TD_PA_SHIFT; if (cpu_impl == CPU_IMPL_SPARC64V || @@ -470,10 +484,11 @@ itlb_va_to_pa_sun4u(vm_offset_t va) pstate = rdpr(pstate); wrpr(pstate, pstate & ~PSTATE_IE, 0); for (i = 0; i < itlb_slot_max; i++) { - reg = ldxa(TLB_DAR_SLOT(i), ASI_ITLB_TAG_READ_REG); + reg = ldxa(TLB_DAR_SLOT(tlb_locked, i), + ASI_ITLB_TAG_READ_REG); if (TLB_TAR_VA(reg) != va) continue; - reg = itlb_get_data_sun4u(i); + reg = itlb_get_data_sun4u(tlb_locked, i); wrpr(pstate, pstate, 0); reg >>= TD_PA_SHIFT; if (cpu_impl == CPU_IMPL_SPARC64V || @@ -517,14 +532,14 @@ itlb_relocate_locked0_sun4u(void) pstate = rdpr(pstate); wrpr(pstate, pstate & ~PSTATE_IE, 0); - data = itlb_get_data_sun4u(0); + data = itlb_get_data_sun4u(tlb_locked, 0); if ((data & (TD_V | TD_L)) != (TD_V | TD_L)) { wrpr(pstate, pstate, 0); return; } /* Flush the mapping of slot 0. */ - tag = ldxa(TLB_DAR_SLOT(0), ASI_ITLB_TAG_READ_REG); + tag = ldxa(TLB_DAR_SLOT(tlb_locked, 0), ASI_ITLB_TAG_READ_REG); stxa(TLB_DEMAP_VA(TLB_TAR_VA(tag)) | TLB_DEMAP_PRIMARY | TLB_DEMAP_PAGE, ASI_IMMU_DEMAP, 0); flush(0); /* The USIII-family ignores the address. */ @@ -534,11 +549,12 @@ itlb_relocate_locked0_sun4u(void) * that formerly were in slot 0. */ for (i = 1; i < itlb_slot_max; i++) { - if ((itlb_get_data_sun4u(i) & TD_V) != 0) + if ((itlb_get_data_sun4u(tlb_locked, i) & TD_V) != 0) continue; stxa(AA_IMMU_TAR, ASI_IMMU, tag); - stxa(TLB_DAR_SLOT(i), ASI_ITLB_DATA_ACCESS_REG, data); + stxa(TLB_DAR_SLOT(tlb_locked, i), ASI_ITLB_DATA_ACCESS_REG, + data); flush(0); /* The USIII-family ignores the address. */ break; } @@ -751,6 +767,26 @@ tlb_init_sun4u(void) phandle_t bsp; cpu_impl = VER_IMPL(rdpr(ver)); + switch (cpu_impl) { + case CPU_IMPL_SPARC64: + case CPU_IMPL_ULTRASPARCI: + case CPU_IMPL_ULTRASPARCII: + case CPU_IMPL_ULTRASPARCIIi: + case CPU_IMPL_ULTRASPARCIIe: + tlb_locked = TLB_DAR_T32; + break; + case CPU_IMPL_ULTRASPARCIII: + case CPU_IMPL_ULTRASPARCIIIp: + case CPU_IMPL_ULTRASPARCIIIi: + case CPU_IMPL_ULTRASPARCIIIip: + case CPU_IMPL_ULTRASPARCIV: + case CPU_IMPL_ULTRASPARCIVp: + tlb_locked = TLB_DAR_T16; + break; + case CPU_IMPL_SPARC64V: + tlb_locked = TLB_DAR_FTLB; + break; + } bsp = find_bsp_sun4u(OF_child(root), cpu_get_mid_sun4u()); if (bsp == 0) panic("%s: no node for bootcpu?!?!", __func__); @@ -937,21 +973,23 @@ pmap_print_tlb_sun4u(void) pstate = rdpr(pstate); for (i = 0; i < itlb_slot_max; i++) { wrpr(pstate, pstate & ~PSTATE_IE, 0); - tte = itlb_get_data_sun4u(i); + tte = itlb_get_data_sun4u(tlb_locked, i); wrpr(pstate, pstate, 0); if (!(tte & TD_V)) continue; - tag = ldxa(TLB_DAR_SLOT(i), ASI_ITLB_TAG_READ_REG); + tag = ldxa(TLB_DAR_SLOT(tlb_locked, i), + ASI_ITLB_TAG_READ_REG); printf("iTLB-%2u: ", i); pmap_print_tte_sun4u(tag, tte); } for (i = 0; i < dtlb_slot_max; i++) { wrpr(pstate, pstate & ~PSTATE_IE, 0); - tte = dtlb_get_data_sun4u(i); + tte = dtlb_get_data_sun4u(tlb_locked, i); wrpr(pstate, pstate, 0); if (!(tte & TD_V)) continue; - tag = ldxa(TLB_DAR_SLOT(i), ASI_DTLB_TAG_READ_REG); + tag = ldxa(TLB_DAR_SLOT(tlb_locked, i), + ASI_DTLB_TAG_READ_REG); printf("dTLB-%2u: ", i); pmap_print_tte_sun4u(tag, tte); } Modified: stable/7/sys/sparc64/include/cache.h ============================================================================== --- stable/7/sys/sparc64/include/cache.h Mon Jul 25 18:41:52 2011 (r224370) +++ stable/7/sys/sparc64/include/cache.h Mon Jul 25 18:42:45 2011 (r224371) @@ -110,15 +110,16 @@ cache_flush_t spitfire_cache_flush; dcache_page_inval_t spitfire_dcache_page_inval; icache_page_inval_t spitfire_icache_page_inval; +cache_enable_t zeus_cache_enable; +cache_flush_t zeus_cache_flush; +dcache_page_inval_t zeus_dcache_page_inval; +icache_page_inval_t zeus_icache_page_inval; + extern cache_enable_t *cache_enable; extern cache_flush_t *cache_flush; extern dcache_page_inval_t *dcache_page_inval; extern icache_page_inval_t *icache_page_inval; -cache_flush_t zeus_cache_flush; -dcache_page_inval_t zeus_dcache_page_inval; -icache_page_inval_t zeus_icache_page_inval; - #endif /* KERNEL */ #endif /* !LOCORE */ Modified: stable/7/sys/sparc64/include/cpu.h ============================================================================== --- stable/7/sys/sparc64/include/cpu.h Mon Jul 25 18:41:52 2011 (r224370) +++ stable/7/sys/sparc64/include/cpu.h Mon Jul 25 18:42:45 2011 (r224371) @@ -57,6 +57,7 @@ void cpu_halt(void); void cpu_reset(void); void fork_trampoline(void); void swi_vm(void *v); +void zeus_init(u_int cpu_impl); static __inline u_int64_t get_cyclecount(void) Modified: stable/7/sys/sparc64/include/tlb.h ============================================================================== --- stable/7/sys/sparc64/include/tlb.h Mon Jul 25 18:41:52 2011 (r224370) +++ stable/7/sys/sparc64/include/tlb.h Mon Jul 25 18:42:45 2011 (r224371) @@ -44,7 +44,17 @@ (TD_V | TD_4M | (TLB_DIRECT_ADDRESS_MASK - TLB_DIRECT_PAGE_MASK)) #define TLB_DAR_SLOT_SHIFT (3) -#define TLB_DAR_SLOT(slot) ((slot) << TLB_DAR_SLOT_SHIFT) +#define TLB_DAR_TLB_SHIFT (16) +#define TLB_DAR_SLOT(tlb, slot) \ + ((tlb) << TLB_DAR_TLB_SHIFT | (slot) << TLB_DAR_SLOT_SHIFT) +#define TLB_DAR_T16 (0) /* US-III{,i,+}, IV{,+} */ +#define TLB_DAR_T32 (0) /* US-I, II{,e,i} */ +#define TLB_DAR_DT512_0 (2) /* US-III{,i,+}, IV{,+} */ +#define TLB_DAR_DT512_1 (3) /* US-III{,i,+}, IV{,+} */ +#define TLB_DAR_IT128 (2) /* US-III{,i,+}, IV */ +#define TLB_DAR_IT512 (2) /* US-IV+ */ +#define TLB_DAR_FTLB (0) /* SPARC64 V, VI, VII, VIIIfx */ +#define TLB_DAR_STLB (2) /* SPARC64 V, VI, VII, VIIIfx */ #define TAR_VPN_SHIFT (13) #define TAR_CTX_MASK ((1 << TAR_VPN_SHIFT) - 1) @@ -156,6 +166,9 @@ tlb_flush_user_t cheetah_tlb_flush_user; tlb_flush_nonlocked_t spitfire_tlb_flush_nonlocked; tlb_flush_user_t spitfire_tlb_flush_user; +tlb_flush_nonlocked_t zeus_tlb_flush_nonlocked; +tlb_flush_user_t zeus_tlb_flush_user; + extern tlb_flush_nonlocked_t *tlb_flush_nonlocked; extern tlb_flush_user_t *tlb_flush_user; Modified: stable/7/sys/sparc64/sparc64/cache.c ============================================================================== --- stable/7/sys/sparc64/sparc64/cache.c Mon Jul 25 18:41:52 2011 (r224370) +++ stable/7/sys/sparc64/sparc64/cache.c Mon Jul 25 18:42:45 2011 (r224371) @@ -169,12 +169,12 @@ cache_init(struct pcpu *pcpu) tlb_flush_nonlocked = cheetah_tlb_flush_nonlocked; tlb_flush_user = cheetah_tlb_flush_user; } else if (pcpu->pc_impl == CPU_IMPL_SPARC64V) { - cache_enable = cheetah_cache_enable; + cache_enable = zeus_cache_enable; cache_flush = zeus_cache_flush; dcache_page_inval = zeus_dcache_page_inval; icache_page_inval = zeus_icache_page_inval; - tlb_flush_nonlocked = cheetah_tlb_flush_nonlocked; - tlb_flush_user = cheetah_tlb_flush_user; + tlb_flush_nonlocked = zeus_tlb_flush_nonlocked; + tlb_flush_user = zeus_tlb_flush_user; } else if (pcpu->pc_impl >= CPU_IMPL_ULTRASPARCI && pcpu->pc_impl < CPU_IMPL_ULTRASPARCIII) { cache_enable = spitfire_cache_enable; Modified: stable/7/sys/sparc64/sparc64/cheetah.c ============================================================================== --- stable/7/sys/sparc64/sparc64/cheetah.c Mon Jul 25 18:41:52 2011 (r224370) +++ stable/7/sys/sparc64/sparc64/cheetah.c Mon Jul 25 18:42:45 2011 (r224371) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2003 Jake Burkholder. - * Copyright (c) 2005, 2008, 2010 Marius Strobl + * Copyright (c) 2005 - 2011 Marius Strobl * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -28,8 +28,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_pmap.h" - #include #include #include @@ -45,17 +43,19 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include #include #define CHEETAH_ICACHE_TAG_LOWER 0x30 +#define CHEETAH_T16_ENTRIES 16 +#define CHEETAH_DT512_ENTRIES 512 +#define CHEETAH_IT128_ENTRIES 128 +#define CHEETAH_IT512_ENTRIES 512 /* - * CPU-specific initialization - this is used for both the Sun Cheetah and - * later as well as the Fujitsu Zeus and later CPUs. + * CPU-specific initialization for Sun Cheetah and later CPUs */ void cheetah_init(u_int cpu_impl) @@ -78,14 +78,6 @@ cheetah_init(u_int cpu_impl) stxa(AA_IMMU_TSB_NEXT_REG, ASI_IMMU, 0); membar(Sync); - if (cpu_impl == CPU_IMPL_SPARC64V) { - /* Ensure MCNTL_JPS1_TSBP is 0. */ - val = ldxa(AA_MCNTL, ASI_MCNTL); - val &= ~MCNTL_JPS1_TSBP; - stxa(AA_MCNTL, ASI_MCNTL, val); - return; - } - /* * Configure the first large dTLB to hold 4MB pages (e.g. for direct * mappings) for all three contexts and ensure the second one is set @@ -223,33 +215,92 @@ cheetah_icache_page_inval(vm_paddr_t pa } -#define cheetah_dmap_all() do { \ - stxa(TLB_DEMAP_ALL, ASI_DMMU_DEMAP, 0); \ - stxa(TLB_DEMAP_ALL, ASI_IMMU_DEMAP, 0); \ - flush(KERNBASE); \ -} while (0) - /* - * Flush all non-locked mappings from the TLB. + * Flush all non-locked mappings from the TLBs. */ void cheetah_tlb_flush_nonlocked(void) { - cheetah_dmap_all(); + stxa(TLB_DEMAP_ALL, ASI_DMMU_DEMAP, 0); + stxa(TLB_DEMAP_ALL, ASI_IMMU_DEMAP, 0); + flush(KERNBASE); } /* - * Flush all user mappings from the TLB. + * Flush all user mappings from the TLBs. */ void -cheetah_tlb_flush_user() +cheetah_tlb_flush_user(void) { + u_long data, tag; + register_t s; + u_int i, slot; /* - * Just use cheetah_dmap_all() and accept somes TLB misses - * rather than searching all 1040 D-TLB and 144 I-TLB slots - * for non-kernel mappings. + * We read ASI_{D,I}TLB_DATA_ACCESS_REG twice back-to-back in order + * to work around errata of USIII and beyond. */ - cheetah_dmap_all(); + for (i = 0; i < CHEETAH_T16_ENTRIES; i++) { + slot = TLB_DAR_SLOT(TLB_DAR_T16, i); + s = intr_disable(); + (void)ldxa(slot, ASI_DTLB_DATA_ACCESS_REG); + data = ldxa(slot, ASI_DTLB_DATA_ACCESS_REG); + intr_restore(s); + tag = ldxa(slot, ASI_DTLB_TAG_READ_REG); + if ((data & TD_V) != 0 && (data & TD_L) == 0 && + TLB_TAR_CTX(tag) != TLB_CTX_KERNEL) + stxa_sync(slot, ASI_DTLB_DATA_ACCESS_REG, 0); + s = intr_disable(); + (void)ldxa(slot, ASI_ITLB_DATA_ACCESS_REG); + data = ldxa(slot, ASI_ITLB_DATA_ACCESS_REG); + intr_restore(s); + tag = ldxa(slot, ASI_ITLB_TAG_READ_REG); + if ((data & TD_V) != 0 && (data & TD_L) == 0 && + TLB_TAR_CTX(tag) != TLB_CTX_KERNEL) + stxa_sync(slot, ASI_ITLB_DATA_ACCESS_REG, 0); + } + for (i = 0; i < CHEETAH_DT512_ENTRIES; i++) { + slot = TLB_DAR_SLOT(TLB_DAR_DT512_0, i); + s = intr_disable(); + (void)ldxa(slot, ASI_DTLB_DATA_ACCESS_REG); + data = ldxa(slot, ASI_DTLB_DATA_ACCESS_REG); + intr_restore(s); + tag = ldxa(slot, ASI_DTLB_TAG_READ_REG); + if ((data & TD_V) != 0 && TLB_TAR_CTX(tag) != TLB_CTX_KERNEL) + stxa_sync(slot, ASI_DTLB_DATA_ACCESS_REG, 0); + slot = TLB_DAR_SLOT(TLB_DAR_DT512_1, i); + s = intr_disable(); + (void)ldxa(slot, ASI_ITLB_DATA_ACCESS_REG); + data = ldxa(slot, ASI_DTLB_DATA_ACCESS_REG); + intr_restore(s); + tag = ldxa(slot, ASI_DTLB_TAG_READ_REG); + if ((data & TD_V) != 0 && TLB_TAR_CTX(tag) != TLB_CTX_KERNEL) + stxa_sync(slot, ASI_DTLB_DATA_ACCESS_REG, 0); + } + if (PCPU_GET(impl) == CPU_IMPL_ULTRASPARCIVp) { + for (i = 0; i < CHEETAH_IT512_ENTRIES; i++) { + slot = TLB_DAR_SLOT(TLB_DAR_IT512, i); + s = intr_disable(); + (void)ldxa(slot, ASI_ITLB_DATA_ACCESS_REG); + data = ldxa(slot, ASI_ITLB_DATA_ACCESS_REG); + intr_restore(s); + tag = ldxa(slot, ASI_ITLB_TAG_READ_REG); + if ((data & TD_V) != 0 && + TLB_TAR_CTX(tag) != TLB_CTX_KERNEL) + stxa_sync(slot, ASI_ITLB_DATA_ACCESS_REG, 0); + } + } else { + for (i = 0; i < CHEETAH_IT128_ENTRIES; i++) { + slot = TLB_DAR_SLOT(TLB_DAR_IT128, i); + s = intr_disable(); + (void)ldxa(slot, ASI_ITLB_DATA_ACCESS_REG); + data = ldxa(slot, ASI_ITLB_DATA_ACCESS_REG); + tag = ldxa(slot, ASI_ITLB_TAG_READ_REG); + intr_restore(s); + if ((data & TD_V) != 0 && + TLB_TAR_CTX(tag) != TLB_CTX_KERNEL) + stxa_sync(slot, ASI_ITLB_DATA_ACCESS_REG, 0); + } + } } Modified: stable/7/sys/sparc64/sparc64/machdep.c ============================================================================== --- stable/7/sys/sparc64/sparc64/machdep.c Mon Jul 25 18:41:52 2011 (r224370) +++ stable/7/sys/sparc64/sparc64/machdep.c Mon Jul 25 18:42:45 2011 (r224371) @@ -347,9 +347,10 @@ sparc64_init(caddr_t mdp, u_long o1, u_l /* * Do CPU-specific initialization. */ - if (cpu_impl == CPU_IMPL_SPARC64V || - cpu_impl >= CPU_IMPL_ULTRASPARCIII) + if (cpu_impl >= CPU_IMPL_ULTRASPARCIII) cheetah_init(cpu_impl); + else if (cpu_impl == CPU_IMPL_SPARC64V) + zeus_init(cpu_impl); /* * Clear (S)TICK timer (including NPT). Modified: stable/7/sys/sparc64/sparc64/mp_machdep.c ============================================================================== --- stable/7/sys/sparc64/sparc64/mp_machdep.c Mon Jul 25 18:41:52 2011 (r224370) +++ stable/7/sys/sparc64/sparc64/mp_machdep.c Mon Jul 25 18:42:45 2011 (r224371) @@ -415,9 +415,11 @@ cpu_mp_bootstrap(struct pcpu *pc) csa = &cpu_start_args; /* Do CPU-specific initialization. */ - if (pc->pc_impl == CPU_IMPL_SPARC64V || - pc->pc_impl >= CPU_IMPL_ULTRASPARCIII) + if (pc->pc_impl >= CPU_IMPL_ULTRASPARCIII) cheetah_init(pc->pc_impl); + else if (pc->pc_impl == CPU_IMPL_SPARC64V) + zeus_init(pc->pc_impl); + /* * Enable the caches. Note that his may include applying workarounds. */ Modified: stable/7/sys/sparc64/sparc64/pmap.c ============================================================================== --- stable/7/sys/sparc64/sparc64/pmap.c Mon Jul 25 18:41:52 2011 (r224370) +++ stable/7/sys/sparc64/sparc64/pmap.c Mon Jul 25 18:42:45 2011 (r224371) @@ -236,7 +236,7 @@ PMAP_STATS_VAR(pmap_ncopy_page_soc); PMAP_STATS_VAR(pmap_nnew_thread); PMAP_STATS_VAR(pmap_nnew_thread_oc); -static inline u_long dtlb_get_data(u_int slot); +static inline u_long dtlb_get_data(u_int tlb, u_int slot); /* * Quick sort callout for comparing memory regions @@ -277,15 +277,21 @@ om_cmp(const void *a, const void *b) } static inline u_long -dtlb_get_data(u_int slot) +dtlb_get_data(u_int tlb, u_int slot) { + u_long data; + register_t s; + slot = TLB_DAR_SLOT(tlb, slot); /* - * We read ASI_DTLB_DATA_ACCESS_REG twice in order to work - * around errata of USIII and beyond. + * We read ASI_DTLB_DATA_ACCESS_REG twice back-to-back in order to + * work around errata of USIII and beyond. */ - (void)ldxa(TLB_DAR_SLOT(slot), ASI_DTLB_DATA_ACCESS_REG); - return (ldxa(TLB_DAR_SLOT(slot), ASI_DTLB_DATA_ACCESS_REG)); + s = intr_disable(); + (void)ldxa(slot, ASI_DTLB_DATA_ACCESS_REG); + data = ldxa(slot, ASI_DTLB_DATA_ACCESS_REG); + intr_restore(s); + return (data); } /* @@ -362,7 +368,8 @@ pmap_bootstrap(u_int cpu_impl) */ dtlb_slots_avail = 0; for (i = 0; i < dtlb_slots; i++) { - data = dtlb_get_data(i); + data = dtlb_get_data(cpu_impl == CPU_IMPL_ULTRASPARCIII ? + TLB_DAR_T16 : TLB_DAR_T32, i); if ((data & (TD_V | TD_L)) != (TD_V | TD_L)) dtlb_slots_avail++; } Modified: stable/7/sys/sparc64/sparc64/spitfire.c ============================================================================== --- stable/7/sys/sparc64/sparc64/spitfire.c Mon Jul 25 18:41:52 2011 (r224370) +++ stable/7/sys/sparc64/sparc64/spitfire.c Mon Jul 25 18:42:45 2011 (r224371) @@ -140,47 +140,45 @@ spitfire_icache_page_inval(vm_paddr_t pa } /* - * Flush all non-locked mappings from the TLB. + * Flush all non-locked mappings from the TLBs. */ void spitfire_tlb_flush_nonlocked(void) { - int i; + u_int i; + u_int slot; for (i = 0; i < SPITFIRE_TLB_ENTRIES; i++) { - if ((ldxa(TLB_DAR_SLOT(i), ASI_DTLB_DATA_ACCESS_REG) & - TD_L) == 0) - stxa_sync(TLB_DAR_SLOT(i), - ASI_DTLB_DATA_ACCESS_REG, 0); - if ((ldxa(TLB_DAR_SLOT(i), ASI_ITLB_DATA_ACCESS_REG) & - TD_L) == 0) - stxa_sync(TLB_DAR_SLOT(i), - ASI_ITLB_DATA_ACCESS_REG, 0); + slot = TLB_DAR_SLOT(TLB_DAR_T32, i); + if ((ldxa(slot, ASI_DTLB_DATA_ACCESS_REG) & TD_L) == 0) + stxa_sync(slot, ASI_DTLB_DATA_ACCESS_REG, 0); + if ((ldxa(slot, ASI_ITLB_DATA_ACCESS_REG) & TD_L) == 0) + stxa_sync(slot, ASI_ITLB_DATA_ACCESS_REG, 0); } } /* - * Flush all user mappings from the TLB. + * Flush all user mappings from the TLBs. */ void spitfire_tlb_flush_user(void) { u_long data; u_long tag; - int i; + u_int i; + u_int slot; for (i = 0; i < SPITFIRE_TLB_ENTRIES; i++) { - data = ldxa(TLB_DAR_SLOT(i), ASI_DTLB_DATA_ACCESS_REG); - tag = ldxa(TLB_DAR_SLOT(i), ASI_DTLB_TAG_READ_REG); + slot = TLB_DAR_SLOT(TLB_DAR_T32, i); + data = ldxa(slot, ASI_DTLB_DATA_ACCESS_REG); + tag = ldxa(slot, ASI_DTLB_TAG_READ_REG); if ((data & TD_V) != 0 && (data & TD_L) == 0 && TLB_TAR_CTX(tag) != TLB_CTX_KERNEL) - stxa_sync(TLB_DAR_SLOT(i), - ASI_DTLB_DATA_ACCESS_REG, 0); - data = ldxa(TLB_DAR_SLOT(i), ASI_ITLB_DATA_ACCESS_REG); - tag = ldxa(TLB_DAR_SLOT(i), ASI_ITLB_TAG_READ_REG); + stxa_sync(slot, ASI_DTLB_DATA_ACCESS_REG, 0); + data = ldxa(slot, ASI_ITLB_DATA_ACCESS_REG); + tag = ldxa(slot, ASI_ITLB_TAG_READ_REG); if ((data & TD_V) != 0 && (data & TD_L) == 0 && TLB_TAR_CTX(tag) != TLB_CTX_KERNEL) - stxa_sync(TLB_DAR_SLOT(i), - ASI_ITLB_DATA_ACCESS_REG, 0); + stxa_sync(slot, ASI_ITLB_DATA_ACCESS_REG, 0); } } Modified: stable/7/sys/sparc64/sparc64/zeus.c ============================================================================== --- stable/7/sys/sparc64/sparc64/zeus.c Mon Jul 25 18:41:52 2011 (r224370) +++ stable/7/sys/sparc64/sparc64/zeus.c Mon Jul 25 18:42:45 2011 (r224371) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2010 Marius Strobl + * Copyright (c) 2010 - 2011 Marius Strobl * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -32,7 +32,64 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include +#include +#include +#include +#include +#include + +#define ZEUS_FTLB_ENTRIES 32 +#define ZEUS_STLB_ENTRIES 2048 + +/* + * CPU-specific initialization for Fujitsu Zeus CPUs + */ +void +zeus_init(u_int cpu_impl) +{ + u_long val; + + /* Ensure the TSB Extension Registers hold 0 as TSB_Base. */ + + stxa(AA_DMMU_TSB_PEXT_REG, ASI_DMMU, 0); + stxa(AA_IMMU_TSB_PEXT_REG, ASI_IMMU, 0); + membar(Sync); + + stxa(AA_DMMU_TSB_SEXT_REG, ASI_DMMU, 0); + /* + * NB: the secondary context was removed from the iMMU. + */ + membar(Sync); + + stxa(AA_DMMU_TSB_NEXT_REG, ASI_DMMU, 0); + stxa(AA_IMMU_TSB_NEXT_REG, ASI_IMMU, 0); + membar(Sync); + + val = ldxa(AA_MCNTL, ASI_MCNTL); + /* Ensure MCNTL_JPS1_TSBP is 0. */ + val &= ~MCNTL_JPS1_TSBP; + /* + * Ensure 4-Mbyte page entries are stored in the 1024-entry, 2-way set + * associative TLB. + */ + val = (val & ~MCNTL_RMD_MASK) | MCNTL_RMD_1024; + stxa(AA_MCNTL, ASI_MCNTL, val); +} + +/* + * Enable level 1 caches. + */ +void +zeus_cache_enable(u_int cpu_impl) +{ + u_long lsu; + + lsu = ldxa(0, ASI_LSU_CTL_REG); + stxa(0, ASI_LSU_CTL_REG, lsu | LSU_IC | LSU_DC); + flush(KERNBASE); +} /* * Flush all lines from the level 1 caches. @@ -63,3 +120,52 @@ zeus_icache_page_inval(vm_paddr_t pa __u { } + +/* + * Flush all non-locked mappings from the TLBs. + */ +void +zeus_tlb_flush_nonlocked(void) +{ + + stxa(TLB_DEMAP_ALL, ASI_DMMU_DEMAP, 0); + stxa(TLB_DEMAP_ALL, ASI_IMMU_DEMAP, 0); + flush(KERNBASE); +} + +/* + * Flush all user mappings from the TLBs. + */ +void +zeus_tlb_flush_user(void) +{ + u_long data, tag; + u_int i, slot; + + for (i = 0; i < ZEUS_FTLB_ENTRIES; i++) { + slot = TLB_DAR_SLOT(TLB_DAR_FTLB, i); + data = ldxa(slot, ASI_DTLB_DATA_ACCESS_REG); + tag = ldxa(slot, ASI_DTLB_TAG_READ_REG); + if ((data & TD_V) != 0 && (data & TD_L) == 0 && + TLB_TAR_CTX(tag) != TLB_CTX_KERNEL) + stxa_sync(slot, ASI_DTLB_DATA_ACCESS_REG, 0); + data = ldxa(slot, ASI_ITLB_DATA_ACCESS_REG); + tag = ldxa(slot, ASI_ITLB_TAG_READ_REG); + if ((data & TD_V) != 0 && (data & TD_L) == 0 && + TLB_TAR_CTX(tag) != TLB_CTX_KERNEL) + stxa_sync(slot, ASI_ITLB_DATA_ACCESS_REG, 0); + } + for (i = 0; i < ZEUS_STLB_ENTRIES; i++) { + slot = TLB_DAR_SLOT(TLB_DAR_STLB, i); + data = ldxa(slot, ASI_DTLB_DATA_ACCESS_REG); + tag = ldxa(slot, ASI_DTLB_TAG_READ_REG); + if ((data & TD_V) != 0 && (data & TD_L) == 0 && + TLB_TAR_CTX(tag) != TLB_CTX_KERNEL) + stxa_sync(slot, ASI_DTLB_DATA_ACCESS_REG, 0); + data = ldxa(slot, ASI_ITLB_DATA_ACCESS_REG); + tag = ldxa(slot, ASI_ITLB_TAG_READ_REG); + if ((data & TD_V) != 0 && (data & TD_L) == 0 && + TLB_TAR_CTX(tag) != TLB_CTX_KERNEL) + stxa_sync(slot, ASI_ITLB_DATA_ACCESS_REG, 0); + } +} From owner-svn-src-stable@FreeBSD.ORG Mon Jul 25 18:43:24 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E68D110656D5; Mon, 25 Jul 2011 18:43:24 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D60E38FC20; Mon, 25 Jul 2011 18:43:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PIhOxH071119; Mon, 25 Jul 2011 18:43:24 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PIhO5V071117; Mon, 25 Jul 2011 18:43:24 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251843.p6PIhO5V071117@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 18:43:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224372 - stable/7/sys/sparc64/sparc64 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 18:43:25 -0000 Author: marius Date: Mon Jul 25 18:43:24 2011 New Revision: 224372 URL: http://svn.freebsd.org/changeset/base/224372 Log: MFC: r223720 Don't waste a delay slot. Modified: stable/7/sys/sparc64/sparc64/mp_exception.S Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/sparc64/sparc64/mp_exception.S ============================================================================== --- stable/7/sys/sparc64/sparc64/mp_exception.S Mon Jul 25 18:42:45 2011 (r224371) +++ stable/7/sys/sparc64/sparc64/mp_exception.S Mon Jul 25 18:43:24 2011 (r224372) @@ -235,8 +235,8 @@ ENTRY(tl_ipi_tlb_range_demap) ldx [%g5 + ITA_START], %g1 ldx [%g5 + ITA_END], %g2 -1: or %g1, %g3, %g4 sethi %hi(KERNBASE), %g6 +1: or %g1, %g3, %g4 stxa %g0, [%g4] ASI_DMMU_DEMAP stxa %g0, [%g4] ASI_IMMU_DEMAP flush %g6 @@ -245,7 +245,7 @@ ENTRY(tl_ipi_tlb_range_demap) add %g1, %g6, %g1 cmp %g1, %g2 blt,a,pt %xcc, 1b - nop + sethi %hi(KERNBASE), %g6 IPI_DONE(%g5, %g1, %g2, %g3) retry From owner-svn-src-stable@FreeBSD.ORG Mon Jul 25 18:43:25 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C29D210656D7; Mon, 25 Jul 2011 18:43:25 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B1ED58FC13; Mon, 25 Jul 2011 18:43:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PIhPiD071150; Mon, 25 Jul 2011 18:43:25 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PIhP3O071147; Mon, 25 Jul 2011 18:43:25 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251843.p6PIhP3O071147@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 18:43:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224373 - stable/8/sys/sparc64/sparc64 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 18:43:25 -0000 Author: marius Date: Mon Jul 25 18:43:25 2011 New Revision: 224373 URL: http://svn.freebsd.org/changeset/base/224373 Log: MFC: r223720 Don't waste a delay slot. Modified: stable/8/sys/sparc64/sparc64/mp_exception.S Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/geom/label/ (props changed) Modified: stable/8/sys/sparc64/sparc64/mp_exception.S ============================================================================== --- stable/8/sys/sparc64/sparc64/mp_exception.S Mon Jul 25 18:43:24 2011 (r224372) +++ stable/8/sys/sparc64/sparc64/mp_exception.S Mon Jul 25 18:43:25 2011 (r224373) @@ -235,8 +235,8 @@ ENTRY(tl_ipi_tlb_range_demap) ldx [%g5 + ITA_START], %g1 ldx [%g5 + ITA_END], %g2 -1: or %g1, %g3, %g4 sethi %hi(KERNBASE), %g6 +1: or %g1, %g3, %g4 stxa %g0, [%g4] ASI_DMMU_DEMAP stxa %g0, [%g4] ASI_IMMU_DEMAP flush %g6 @@ -245,7 +245,7 @@ ENTRY(tl_ipi_tlb_range_demap) add %g1, %g6, %g1 cmp %g1, %g2 blt,a,pt %xcc, 1b - nop + sethi %hi(KERNBASE), %g6 IPI_DONE(%g5, %g1, %g2, %g3) retry From owner-svn-src-stable@FreeBSD.ORG Mon Jul 25 18:44:47 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 387ED106564A; Mon, 25 Jul 2011 18:44:47 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0E8278FC1A; Mon, 25 Jul 2011 18:44:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PIikqG071289; Mon, 25 Jul 2011 18:44:46 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PIik2H071286; Mon, 25 Jul 2011 18:44:46 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251844.p6PIik2H071286@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 18:44:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224374 - stable/7/sys/sparc64/sparc64 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 18:44:47 -0000 Author: marius Date: Mon Jul 25 18:44:46 2011 New Revision: 224374 URL: http://svn.freebsd.org/changeset/base/224374 Log: MFC: r223721 UltraSPARC-IV CPUs seem to be affected by a not publicly documented erratum causing them to trigger stray vector interrupts accompanied by a state in which they even fault on locked TLB entries. Just retrying the instruction in that case gets the CPU back on track though. OpenSolaris also just ignores a certain number of stray vector interrupts. While at it, implement the stray vector interrupt handling for SPARC64-VI which use these for indicating uncorrectable errors in interrupt packets. Modified: stable/7/sys/sparc64/sparc64/exception.S stable/7/sys/sparc64/sparc64/interrupt.S Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/sparc64/sparc64/exception.S ============================================================================== --- stable/7/sys/sparc64/sparc64/exception.S Mon Jul 25 18:43:25 2011 (r224373) +++ stable/7/sys/sparc64/sparc64/exception.S Mon Jul 25 18:44:46 2011 (r224374) @@ -581,7 +581,8 @@ END(tl0_sfsr_trap) andcc %g1, IRSR_BUSY, %g0 bnz,a,pt %xcc, intr_vector nop - sir + ba,a,pt %xcc, intr_vector_stray + nop .align 32 .endm Modified: stable/7/sys/sparc64/sparc64/interrupt.S ============================================================================== --- stable/7/sys/sparc64/sparc64/interrupt.S Mon Jul 25 18:43:25 2011 (r224373) +++ stable/7/sys/sparc64/sparc64/interrupt.S Mon Jul 25 18:44:46 2011 (r224374) @@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "assym.s" @@ -153,6 +154,29 @@ ENTRY(intr_vector) retry END(intr_vector) +ENTRY(intr_vector_stray) + /* + * SPARC64-VI trigger stray vector interrupts in order to indicate + * uncorrectable errors in interrupt packets, which still need to be + * acknowledged though. + * US-IV occasionally trigger stray vector interrupts for reasons + * unknown accompanied by a state in which they even fault on locked + * TLB entries so we can't even log these here. Just retrying the + * instruction in that case gets the CPU back on track. + */ + rdpr %ver, %g1 + srlx %g1, VER_IMPL_SHIFT, %g1 + sll %g1, VER_IMPL_SIZE, %g1 + srl %g1, VER_IMPL_SIZE, %g1 + cmp %g1, CPU_IMPL_SPARC64VI + bne,a,pn %icc, 1f + nop + stxa %g0, [%g0] ASI_INTR_RECEIVE + membar #Sync + +1: retry +END(intr_vector_stray) + ENTRY(intr_fast) save %sp, -CCFSZ, %sp From owner-svn-src-stable@FreeBSD.ORG Mon Jul 25 18:44:47 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7986C1065674; Mon, 25 Jul 2011 18:44:47 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4F24C8FC08; Mon, 25 Jul 2011 18:44:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PIilhu071304; Mon, 25 Jul 2011 18:44:47 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PIil1R071301; Mon, 25 Jul 2011 18:44:47 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251844.p6PIil1R071301@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 18:44:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224375 - stable/8/sys/sparc64/sparc64 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 18:44:47 -0000 Author: marius Date: Mon Jul 25 18:44:46 2011 New Revision: 224375 URL: http://svn.freebsd.org/changeset/base/224375 Log: MFC: r223721 UltraSPARC-IV CPUs seem to be affected by a not publicly documented erratum causing them to trigger stray vector interrupts accompanied by a state in which they even fault on locked TLB entries. Just retrying the instruction in that case gets the CPU back on track though. OpenSolaris also just ignores a certain number of stray vector interrupts. While at it, implement the stray vector interrupt handling for SPARC64-VI which use these for indicating uncorrectable errors in interrupt packets. Modified: stable/8/sys/sparc64/sparc64/exception.S stable/8/sys/sparc64/sparc64/interrupt.S Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/geom/label/ (props changed) Modified: stable/8/sys/sparc64/sparc64/exception.S ============================================================================== --- stable/8/sys/sparc64/sparc64/exception.S Mon Jul 25 18:44:46 2011 (r224374) +++ stable/8/sys/sparc64/sparc64/exception.S Mon Jul 25 18:44:46 2011 (r224375) @@ -585,7 +585,8 @@ END(tl0_sfsr_trap) andcc %g1, IRSR_BUSY, %g0 bnz,a,pt %xcc, intr_vector nop - sir + ba,a,pt %xcc, intr_vector_stray + nop .align 32 .endm Modified: stable/8/sys/sparc64/sparc64/interrupt.S ============================================================================== --- stable/8/sys/sparc64/sparc64/interrupt.S Mon Jul 25 18:44:46 2011 (r224374) +++ stable/8/sys/sparc64/sparc64/interrupt.S Mon Jul 25 18:44:46 2011 (r224375) @@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "assym.s" @@ -153,6 +154,29 @@ ENTRY(intr_vector) retry END(intr_vector) +ENTRY(intr_vector_stray) + /* + * SPARC64-VI trigger stray vector interrupts in order to indicate + * uncorrectable errors in interrupt packets, which still need to be + * acknowledged though. + * US-IV occasionally trigger stray vector interrupts for reasons + * unknown accompanied by a state in which they even fault on locked + * TLB entries so we can't even log these here. Just retrying the + * instruction in that case gets the CPU back on track. + */ + rdpr %ver, %g1 + srlx %g1, VER_IMPL_SHIFT, %g1 + sll %g1, VER_IMPL_SIZE, %g1 + srl %g1, VER_IMPL_SIZE, %g1 + cmp %g1, CPU_IMPL_SPARC64VI + bne,a,pn %icc, 1f + nop + stxa %g0, [%g0] ASI_INTR_RECEIVE + membar #Sync + +1: retry +END(intr_vector_stray) + ENTRY(intr_fast) save %sp, -CCFSZ, %sp From owner-svn-src-stable@FreeBSD.ORG Mon Jul 25 18:46:54 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BDC6B106564A; Mon, 25 Jul 2011 18:46:54 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 934398FC19; Mon, 25 Jul 2011 18:46:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PIkstX071495; Mon, 25 Jul 2011 18:46:54 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PIksDM071492; Mon, 25 Jul 2011 18:46:54 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251846.p6PIksDM071492@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 18:46:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224376 - in stable/8/sys: kern sparc64/sparc64 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 18:46:54 -0000 Author: marius Date: Mon Jul 25 18:46:54 2011 New Revision: 224376 URL: http://svn.freebsd.org/changeset/base/224376 Log: MFC: r223795 Call pmap_qremove() before freeing or unwiring the pages, otherwise there's a window during which a page can be re-used before its previous mapping is removed. Reviewed by: alc Modified: stable/8/sys/kern/vfs_bio.c stable/8/sys/sparc64/sparc64/pmap.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/geom/label/ (props changed) Modified: stable/8/sys/kern/vfs_bio.c ============================================================================== --- stable/8/sys/kern/vfs_bio.c Mon Jul 25 18:44:46 2011 (r224375) +++ stable/8/sys/kern/vfs_bio.c Mon Jul 25 18:46:54 2011 (r224376) @@ -1602,6 +1602,7 @@ vfs_vmio_release(struct buf *bp) int i; vm_page_t m; + pmap_qremove(trunc_page((vm_offset_t)bp->b_data), bp->b_npages); VM_OBJECT_LOCK(bp->b_bufobj->bo_object); vm_page_lock_queues(); for (i = 0; i < bp->b_npages; i++) { @@ -1638,7 +1639,6 @@ vfs_vmio_release(struct buf *bp) } vm_page_unlock_queues(); VM_OBJECT_UNLOCK(bp->b_bufobj->bo_object); - pmap_qremove(trunc_page((vm_offset_t) bp->b_data), bp->b_npages); if (bp->b_bufsize) { bufspacewakeup(); @@ -2995,6 +2995,10 @@ allocbuf(struct buf *bp, int size) if (desiredpages < bp->b_npages) { vm_page_t m; + pmap_qremove((vm_offset_t)trunc_page( + (vm_offset_t)bp->b_data) + + (desiredpages << PAGE_SHIFT), + (bp->b_npages - desiredpages)); VM_OBJECT_LOCK(bp->b_bufobj->bo_object); vm_page_lock_queues(); for (i = desiredpages; i < bp->b_npages; i++) { @@ -3014,8 +3018,6 @@ allocbuf(struct buf *bp, int size) } vm_page_unlock_queues(); VM_OBJECT_UNLOCK(bp->b_bufobj->bo_object); - pmap_qremove((vm_offset_t) trunc_page((vm_offset_t)bp->b_data) + - (desiredpages << PAGE_SHIFT), (bp->b_npages - desiredpages)); bp->b_npages = desiredpages; } } else if (size > bp->b_bcount) { Modified: stable/8/sys/sparc64/sparc64/pmap.c ============================================================================== --- stable/8/sys/sparc64/sparc64/pmap.c Mon Jul 25 18:44:46 2011 (r224375) +++ stable/8/sys/sparc64/sparc64/pmap.c Mon Jul 25 18:46:54 2011 (r224376) @@ -1290,6 +1290,7 @@ pmap_release(pmap_t pm) pc->pc_pmap = NULL; mtx_unlock_spin(&sched_lock); + pmap_qremove((vm_offset_t)pm->pm_tsb, TSB_PAGES); obj = pm->pm_tsb_obj; VM_OBJECT_LOCK(obj); KASSERT(obj->ref_count == 1, ("pmap_release: tsbobj ref count != 1")); @@ -1307,7 +1308,6 @@ pmap_release(pmap_t pm) vm_page_unlock_queues(); } VM_OBJECT_UNLOCK(obj); - pmap_qremove((vm_offset_t)pm->pm_tsb, TSB_PAGES); PMAP_LOCK_DESTROY(pm); } From owner-svn-src-stable@FreeBSD.ORG Mon Jul 25 18:46:56 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9C0D7106566C; Mon, 25 Jul 2011 18:46:56 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 71BEF8FC16; Mon, 25 Jul 2011 18:46:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PIkuV8071527; Mon, 25 Jul 2011 18:46:56 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PIkuM0071524; Mon, 25 Jul 2011 18:46:56 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251846.p6PIkuM0071524@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 18:46:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224377 - in stable/7/sys: kern sparc64/sparc64 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 18:46:56 -0000 Author: marius Date: Mon Jul 25 18:46:56 2011 New Revision: 224377 URL: http://svn.freebsd.org/changeset/base/224377 Log: MFC: r223795 Call pmap_qremove() before freeing or unwiring the pages, otherwise there's a window during which a page can be re-used before its previous mapping is removed. Reviewed by: alc Modified: stable/7/sys/kern/vfs_bio.c stable/7/sys/sparc64/sparc64/pmap.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/kern/vfs_bio.c ============================================================================== --- stable/7/sys/kern/vfs_bio.c Mon Jul 25 18:46:54 2011 (r224376) +++ stable/7/sys/kern/vfs_bio.c Mon Jul 25 18:46:56 2011 (r224377) @@ -1574,6 +1574,7 @@ vfs_vmio_release(struct buf *bp) int i; vm_page_t m; + pmap_qremove(trunc_page((vm_offset_t)bp->b_data), bp->b_npages); VM_OBJECT_LOCK(bp->b_bufobj->bo_object); vm_page_lock_queues(); for (i = 0; i < bp->b_npages; i++) { @@ -1610,7 +1611,6 @@ vfs_vmio_release(struct buf *bp) } vm_page_unlock_queues(); VM_OBJECT_UNLOCK(bp->b_bufobj->bo_object); - pmap_qremove(trunc_page((vm_offset_t) bp->b_data), bp->b_npages); if (bp->b_bufsize) { bufspacewakeup(); @@ -2950,6 +2950,10 @@ allocbuf(struct buf *bp, int size) if (desiredpages < bp->b_npages) { vm_page_t m; + pmap_qremove((vm_offset_t)trunc_page( + (vm_offset_t)bp->b_data) + + (desiredpages << PAGE_SHIFT), + (bp->b_npages - desiredpages)); VM_OBJECT_LOCK(bp->b_bufobj->bo_object); vm_page_lock_queues(); for (i = desiredpages; i < bp->b_npages; i++) { @@ -2969,8 +2973,6 @@ allocbuf(struct buf *bp, int size) } vm_page_unlock_queues(); VM_OBJECT_UNLOCK(bp->b_bufobj->bo_object); - pmap_qremove((vm_offset_t) trunc_page((vm_offset_t)bp->b_data) + - (desiredpages << PAGE_SHIFT), (bp->b_npages - desiredpages)); bp->b_npages = desiredpages; } } else if (size > bp->b_bcount) { Modified: stable/7/sys/sparc64/sparc64/pmap.c ============================================================================== --- stable/7/sys/sparc64/sparc64/pmap.c Mon Jul 25 18:46:54 2011 (r224376) +++ stable/7/sys/sparc64/sparc64/pmap.c Mon Jul 25 18:46:56 2011 (r224377) @@ -1158,6 +1158,7 @@ pmap_release(pmap_t pm) pc->pc_pmap = NULL; mtx_unlock_spin(&sched_lock); + pmap_qremove((vm_offset_t)pm->pm_tsb, TSB_PAGES); obj = pm->pm_tsb_obj; VM_OBJECT_LOCK(obj); KASSERT(obj->ref_count == 1, ("pmap_release: tsbobj ref count != 1")); @@ -1175,7 +1176,6 @@ pmap_release(pmap_t pm) vm_page_unlock_queues(); } VM_OBJECT_UNLOCK(obj); - pmap_qremove((vm_offset_t)pm->pm_tsb, TSB_PAGES); PMAP_LOCK_DESTROY(pm); } From owner-svn-src-stable@FreeBSD.ORG Mon Jul 25 18:52:49 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A5B7E106566C; Mon, 25 Jul 2011 18:52:49 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7B6A58FC1A; Mon, 25 Jul 2011 18:52:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PIqnIR071768; Mon, 25 Jul 2011 18:52:49 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PIqnnt071765; Mon, 25 Jul 2011 18:52:49 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251852.p6PIqnnt071765@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 18:52:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224378 - in stable/8/sys/sparc64: include sparc64 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 18:52:49 -0000 Author: marius Date: Mon Jul 25 18:52:49 2011 New Revision: 224378 URL: http://svn.freebsd.org/changeset/base/224378 Log: MFC: r223800 - pmap_cache_remove() and pmap_protect_tte() are only used within pmap.c so static'ize them. - Correct a typo. Modified: stable/8/sys/sparc64/include/pmap.h stable/8/sys/sparc64/sparc64/pmap.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/geom/label/ (props changed) Modified: stable/8/sys/sparc64/include/pmap.h ============================================================================== --- stable/8/sys/sparc64/include/pmap.h Mon Jul 25 18:46:56 2011 (r224377) +++ stable/8/sys/sparc64/include/pmap.h Mon Jul 25 18:52:49 2011 (r224378) @@ -89,12 +89,9 @@ void pmap_kremove_flags(vm_offset_t va); boolean_t pmap_page_is_mapped(vm_page_t m); int pmap_cache_enter(vm_page_t m, vm_offset_t va); -void pmap_cache_remove(vm_page_t m, vm_offset_t va); int pmap_remove_tte(struct pmap *pm1, struct pmap *pm2, struct tte *tp, vm_offset_t va); -int pmap_protect_tte(struct pmap *pm1, struct pmap *pm2, struct tte *tp, - vm_offset_t va); void pmap_map_tsb(void); void pmap_set_kctx(void); Modified: stable/8/sys/sparc64/sparc64/pmap.c ============================================================================== --- stable/8/sys/sparc64/sparc64/pmap.c Mon Jul 25 18:46:56 2011 (r224377) +++ stable/8/sys/sparc64/sparc64/pmap.c Mon Jul 25 18:52:49 2011 (r224378) @@ -152,6 +152,9 @@ struct pmap kernel_pmap_store; static vm_paddr_t pmap_bootstrap_alloc(vm_size_t size, uint32_t colors); static void pmap_bootstrap_set_tte(struct tte *tp, u_long vpn, u_long data); +static void pmap_cache_remove(vm_page_t m, vm_offset_t va); +static int pmap_protect_tte(struct pmap *pm1, struct pmap *pm2, + struct tte *tp, vm_offset_t va); /* * Map the given physical page at the specified virtual address in the @@ -952,7 +955,7 @@ pmap_cache_enter(vm_page_t m, vm_offset_ return (0); } -void +static void pmap_cache_remove(vm_page_t m, vm_offset_t va) { struct tte *tp; @@ -1414,7 +1417,7 @@ pmap_remove_all(vm_page_t m) vm_page_flag_clear(m, PG_WRITEABLE); } -int +static int pmap_protect_tte(struct pmap *pm, struct pmap *pm2, struct tte *tp, vm_offset_t va) { @@ -1971,7 +1974,7 @@ pmap_page_wired_mappings(vm_page_t m) /* * Remove all pages from specified address space, this aids process exit - * speeds. This is much faster than pmap_remove n the case of running down + * speeds. This is much faster than pmap_remove in the case of running down * an entire address space. Only works for the current pmap. */ void From owner-svn-src-stable@FreeBSD.ORG Mon Jul 25 18:53:24 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0E0D21065678; Mon, 25 Jul 2011 18:53:24 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D7FFA8FC20; Mon, 25 Jul 2011 18:53:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PIrN0T071822; Mon, 25 Jul 2011 18:53:23 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PIrNck071819; Mon, 25 Jul 2011 18:53:23 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251853.p6PIrNck071819@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 18:53:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224379 - in stable/7/sys/sparc64: include sparc64 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 18:53:24 -0000 Author: marius Date: Mon Jul 25 18:53:23 2011 New Revision: 224379 URL: http://svn.freebsd.org/changeset/base/224379 Log: MFC: r223800 - pmap_cache_remove() and pmap_protect_tte() are only used within pmap.c so static'ize them. - Correct a typo. Modified: stable/7/sys/sparc64/include/pmap.h stable/7/sys/sparc64/sparc64/pmap.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/sparc64/include/pmap.h ============================================================================== --- stable/7/sys/sparc64/include/pmap.h Mon Jul 25 18:52:49 2011 (r224378) +++ stable/7/sys/sparc64/include/pmap.h Mon Jul 25 18:53:23 2011 (r224379) @@ -89,12 +89,9 @@ void pmap_kremove_flags(vm_offset_t va); boolean_t pmap_page_is_mapped(vm_page_t m); int pmap_cache_enter(vm_page_t m, vm_offset_t va); -void pmap_cache_remove(vm_page_t m, vm_offset_t va); int pmap_remove_tte(struct pmap *pm1, struct pmap *pm2, struct tte *tp, vm_offset_t va); -int pmap_protect_tte(struct pmap *pm1, struct pmap *pm2, struct tte *tp, - vm_offset_t va); void pmap_map_tsb(void); Modified: stable/7/sys/sparc64/sparc64/pmap.c ============================================================================== --- stable/7/sys/sparc64/sparc64/pmap.c Mon Jul 25 18:52:49 2011 (r224378) +++ stable/7/sys/sparc64/sparc64/pmap.c Mon Jul 25 18:53:23 2011 (r224379) @@ -156,6 +156,10 @@ struct pmap kernel_pmap_store; */ static vm_paddr_t pmap_bootstrap_alloc(vm_size_t size, uint32_t colors); +static void pmap_cache_remove(vm_page_t m, vm_offset_t va); +static int pmap_protect_tte(struct pmap *pm1, struct pmap *pm2, + struct tte *tp, vm_offset_t va); + /* * Map the given physical page at the specified virtual address in the * target pmap with the protection requested. If specified the page @@ -819,7 +823,7 @@ pmap_cache_enter(vm_page_t m, vm_offset_ return (0); } -void +static void pmap_cache_remove(vm_page_t m, vm_offset_t va) { struct tte *tp; @@ -1282,7 +1286,7 @@ pmap_remove_all(vm_page_t m) vm_page_flag_clear(m, PG_WRITEABLE); } -int +static int pmap_protect_tte(struct pmap *pm, struct pmap *pm2, struct tte *tp, vm_offset_t va) { @@ -1819,7 +1823,7 @@ pmap_page_exists_quick(pmap_t pm, vm_pag /* * Remove all pages from specified address space, this aids process exit - * speeds. This is much faster than pmap_remove n the case of running down + * speeds. This is much faster than pmap_remove in the case of running down * an entire address space. Only works for the current pmap. */ void From owner-svn-src-stable@FreeBSD.ORG Mon Jul 25 18:54:28 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C15071065730; Mon, 25 Jul 2011 18:54:28 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B08A98FC0A; Mon, 25 Jul 2011 18:54:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PIsSGS071920; Mon, 25 Jul 2011 18:54:28 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PIsS8W071918; Mon, 25 Jul 2011 18:54:28 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251854.p6PIsS8W071918@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 18:54:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224380 - stable/8/sys/sparc64/sparc64 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 18:54:28 -0000 Author: marius Date: Mon Jul 25 18:54:28 2011 New Revision: 224380 URL: http://svn.freebsd.org/changeset/base/224380 Log: MFC: r223801 It can be useful to know which page still has mappings. Modified: stable/8/sys/sparc64/sparc64/vm_machdep.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/geom/label/ (props changed) Modified: stable/8/sys/sparc64/sparc64/vm_machdep.c ============================================================================== --- stable/8/sys/sparc64/sparc64/vm_machdep.c Mon Jul 25 18:53:23 2011 (r224379) +++ stable/8/sys/sparc64/sparc64/vm_machdep.c Mon Jul 25 18:54:28 2011 (r224380) @@ -525,7 +525,7 @@ uma_small_alloc(uma_zone_t zone, int byt pa = VM_PAGE_TO_PHYS(m); if (dcache_color_ignore == 0 && m->md.color != DCACHE_COLOR(pa)) { KASSERT(m->md.colors[0] == 0 && m->md.colors[1] == 0, - ("uma_small_alloc: free page still has mappings!")); + ("uma_small_alloc: free page %p still has mappings!", m)); PMAP_STATS_INC(uma_nsmall_alloc_oc); m->md.color = DCACHE_COLOR(pa); dcache_page_inval(pa); From owner-svn-src-stable@FreeBSD.ORG Mon Jul 25 18:54:30 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 18DA71065777; Mon, 25 Jul 2011 18:54:30 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 085818FC1D; Mon, 25 Jul 2011 18:54:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PIsTWU071951; Mon, 25 Jul 2011 18:54:29 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PIsTJB071949; Mon, 25 Jul 2011 18:54:29 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251854.p6PIsTJB071949@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 18:54:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224381 - stable/7/sys/sparc64/sparc64 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 18:54:30 -0000 Author: marius Date: Mon Jul 25 18:54:29 2011 New Revision: 224381 URL: http://svn.freebsd.org/changeset/base/224381 Log: MFC: r223801 It can be useful to know which page still has mappings. Modified: stable/7/sys/sparc64/sparc64/vm_machdep.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/sparc64/sparc64/vm_machdep.c ============================================================================== --- stable/7/sys/sparc64/sparc64/vm_machdep.c Mon Jul 25 18:54:28 2011 (r224380) +++ stable/7/sys/sparc64/sparc64/vm_machdep.c Mon Jul 25 18:54:29 2011 (r224381) @@ -494,7 +494,7 @@ uma_small_alloc(uma_zone_t zone, int byt pa = VM_PAGE_TO_PHYS(m); if (dcache_color_ignore == 0 && m->md.color != DCACHE_COLOR(pa)) { KASSERT(m->md.colors[0] == 0 && m->md.colors[1] == 0, - ("uma_small_alloc: free page still has mappings!")); + ("uma_small_alloc: free page %p still has mappings!", m)); PMAP_STATS_INC(uma_nsmall_alloc_oc); m->md.color = DCACHE_COLOR(pa); dcache_page_inval(pa); From owner-svn-src-stable@FreeBSD.ORG Mon Jul 25 18:57:50 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 65858106564A; Mon, 25 Jul 2011 18:57:50 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 546908FC0C; Mon, 25 Jul 2011 18:57:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PIvoMt072130; Mon, 25 Jul 2011 18:57:50 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PIvo77072123; Mon, 25 Jul 2011 18:57:50 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251857.p6PIvo77072123@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 18:57:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224382 - stable/8/sys/dev/gem X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 18:57:50 -0000 Author: marius Date: Mon Jul 25 18:57:49 2011 New Revision: 224382 URL: http://svn.freebsd.org/changeset/base/224382 Log: MFC: r223944 According to the OpenSolaris source the PCI latency and the cache line size should be set for Sun ERI. Tested by: yongari Modified: stable/8/sys/dev/gem/if_gem.c stable/8/sys/dev/gem/if_gem_pci.c stable/8/sys/dev/gem/if_gemreg.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/geom/label/ (props changed) Modified: stable/8/sys/dev/gem/if_gem.c ============================================================================== --- stable/8/sys/dev/gem/if_gem.c Mon Jul 25 18:54:29 2011 (r224381) +++ stable/8/sys/dev/gem/if_gem.c Mon Jul 25 18:57:49 2011 (r224382) @@ -626,7 +626,9 @@ gem_reset(struct gem_softc *sc) gem_reset_tx(sc); /* Do a full reset. */ - GEM_BANK2_WRITE_4(sc, GEM_RESET, GEM_RESET_RX | GEM_RESET_TX); + GEM_BANK2_WRITE_4(sc, GEM_RESET, GEM_RESET_RX | GEM_RESET_TX | + (sc->sc_variant == GEM_SUN_ERI ? GEM_ERI_CACHE_LINE_SIZE << + GEM_RESET_CLSZ_SHFT : 0)); GEM_BANK2_BARRIER(sc, GEM_RESET, 4, BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); if (!GEM_BANK2_BITWAIT(sc, GEM_RESET, GEM_RESET_RX | GEM_RESET_TX, 0)) @@ -716,11 +718,12 @@ gem_reset_rx(struct gem_softc *sc) DELAY(5000); /* Reset the ERX. */ - GEM_BANK2_WRITE_4(sc, GEM_RESET, GEM_RESET_RX); + GEM_BANK2_WRITE_4(sc, GEM_RESET, GEM_RESET_RX | + (sc->sc_variant == GEM_SUN_ERI ? GEM_ERI_CACHE_LINE_SIZE << + GEM_RESET_CLSZ_SHFT : 0)); GEM_BANK2_BARRIER(sc, GEM_RESET, 4, BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); - if (!GEM_BANK2_BITWAIT(sc, GEM_RESET, GEM_RESET_RX | GEM_RESET_TX, - 0)) { + if (!GEM_BANK2_BITWAIT(sc, GEM_RESET, GEM_RESET_RX, 0)) { device_printf(sc->sc_dev, "cannot reset receiver\n"); return (1); } @@ -806,11 +809,12 @@ gem_reset_tx(struct gem_softc *sc) DELAY(5000); /* Finally, reset the ETX. */ - GEM_BANK2_WRITE_4(sc, GEM_RESET, GEM_RESET_TX); + GEM_BANK2_WRITE_4(sc, GEM_RESET, GEM_RESET_TX | + (sc->sc_variant == GEM_SUN_ERI ? GEM_ERI_CACHE_LINE_SIZE << + GEM_RESET_CLSZ_SHFT : 0)); GEM_BANK2_BARRIER(sc, GEM_RESET, 4, BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); - if (!GEM_BANK2_BITWAIT(sc, GEM_RESET, GEM_RESET_RX | GEM_RESET_TX, - 0)) { + if (!GEM_BANK2_BITWAIT(sc, GEM_RESET, GEM_RESET_TX, 0)) { device_printf(sc->sc_dev, "cannot reset transmitter\n"); return (1); } Modified: stable/8/sys/dev/gem/if_gem_pci.c ============================================================================== --- stable/8/sys/dev/gem/if_gem_pci.c Mon Jul 25 18:54:29 2011 (r224381) +++ stable/8/sys/dev/gem/if_gem_pci.c Mon Jul 25 18:57:49 2011 (r224382) @@ -177,6 +177,10 @@ gem_pci_attach(device_t dev) if (pci_get_intpin(dev) == 0) pci_set_intpin(dev, 1); + /* Set the PCI latency timer for Sun ERIs. */ + if (sc->sc_variant == GEM_SUN_ERI) + pci_write_config(dev, PCIR_LATTIMER, GEM_ERI_LATENCY_TIMER, 1); + sc->sc_dev = dev; sc->sc_flags |= GEM_PCI; Modified: stable/8/sys/dev/gem/if_gemreg.h ============================================================================== --- stable/8/sys/dev/gem/if_gemreg.h Mon Jul 25 18:54:29 2011 (r224381) +++ stable/8/sys/dev/gem/if_gemreg.h Mon Jul 25 18:57:49 2011 (r224382) @@ -35,7 +35,7 @@ /* register definitions for Apple GMAC, Sun ERI and Sun GEM */ /* - * First bank: this registers live at the start of the PCI + * First bank: these registers live at the start of the PCI * mapping, and at the start of the second bank of the SBus * version. */ @@ -93,7 +93,7 @@ "b\x10MAC_CONTROL\0b\x11MIF\0b\x12IBERR\0\0" /* - * Second bank: this registers live at offset 0x1000 of the PCI + * Second bank: these registers live at offset 0x1000 of the PCI * mapping, and at the start of the first bank of the SBus * version. */ @@ -128,7 +128,7 @@ /* GEM_PCI_BIF_DIAG register bits */ #define GEN_PCI_BIF_DIAG_BC_SM 0x007f0000 /* burst ctrl. state machine */ -#define GEN_PCI_BIF_DIAG_SM 0xff000000 /* BIF state machine */ +#define GEN_PCI_BIF_DIAG_SM 0xff000000 /* BIF state machine */ /* Bits in GEM_SBUS_CONFIG register */ #define GEM_SBUS_CFG_BURST_32 0x00000001 /* 32 byte bursts */ @@ -147,6 +147,8 @@ #define GEM_RESET_TX 0x00000001 /* Reset TX half. */ #define GEM_RESET_RX 0x00000002 /* Reset RX half. */ #define GEM_RESET_PCI_RSTOUT 0x00000004 /* Force PCI RSTOUT#. */ +#define GEM_RESET_CLSZ_MASK 0x00ff0000 /* ERI cache line size */ +#define GEM_RESET_CLSZ_SHFT 16 /* The rest of the registers live in the first bank again. */ @@ -586,6 +588,10 @@ #define GEM_PHYAD_INTERNAL 1 #define GEM_PHYAD_EXTERNAL 0 +/* Miscellaneous */ +#define GEM_ERI_CACHE_LINE_SIZE 16 +#define GEM_ERI_LATENCY_TIMER 64 + /* * descriptor table structures */ @@ -594,7 +600,11 @@ struct gem_desc { uint64_t gd_addr; }; -/* Transmit flags */ +/* + * Transmit flags + * GEM_TD_CXSUM_ENABLE, GEM_TD_CXSUM_START, GEM_TD_CXSUM_STUFF and + * GEM_TD_INTERRUPT_ME only need to be set in the first descriptor of a group. + */ #define GEM_TD_BUFSIZE 0x0000000000007fffULL #define GEM_TD_CXSUM_START 0x00000000001f8000ULL /* Cxsum start offset */ #define GEM_TD_CXSUM_STARTSHFT 15 @@ -605,10 +615,6 @@ struct gem_desc { #define GEM_TD_START_OF_PACKET 0x0000000080000000ULL #define GEM_TD_INTERRUPT_ME 0x0000000100000000ULL /* Interrupt me now */ #define GEM_TD_NO_CRC 0x0000000200000000ULL /* do not insert crc */ -/* - * Only need to set GEM_TD_CXSUM_ENABLE, GEM_TD_CXSUM_STUFF, - * GEM_TD_CXSUM_START, and GEM_TD_INTERRUPT_ME in 1st descriptor of a group. - */ /* Receive flags */ #define GEM_RD_CHECKSUM 0x000000000000ffffULL /* is the complement */ @@ -618,7 +624,6 @@ struct gem_desc { #define GEM_RD_HASH_PASS 0x1000000000000000ULL /* passed hash filter */ #define GEM_RD_ALTERNATE_MAC 0x2000000000000000ULL /* Alternate MAC adrs */ #define GEM_RD_BAD_CRC 0x4000000000000000ULL - #define GEM_RD_BUFSHIFT 16 #define GEM_RD_BUFLEN(x) (((x) & GEM_RD_BUFSIZE) >> GEM_RD_BUFSHIFT) From owner-svn-src-stable@FreeBSD.ORG Mon Jul 25 18:57:51 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2AF0F106566B; Mon, 25 Jul 2011 18:57:51 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 19C9A8FC12; Mon, 25 Jul 2011 18:57:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PIvokM072154; Mon, 25 Jul 2011 18:57:50 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PIvoKM072150; Mon, 25 Jul 2011 18:57:50 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251857.p6PIvoKM072150@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 18:57:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224383 - stable/7/sys/dev/gem X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 18:57:51 -0000 Author: marius Date: Mon Jul 25 18:57:50 2011 New Revision: 224383 URL: http://svn.freebsd.org/changeset/base/224383 Log: MFC: r223944 According to the OpenSolaris source the PCI latency and the cache line size should be set for Sun ERI. Tested by: yongari Modified: stable/7/sys/dev/gem/if_gem.c stable/7/sys/dev/gem/if_gem_pci.c stable/7/sys/dev/gem/if_gemreg.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/gem/if_gem.c ============================================================================== --- stable/7/sys/dev/gem/if_gem.c Mon Jul 25 18:57:49 2011 (r224382) +++ stable/7/sys/dev/gem/if_gem.c Mon Jul 25 18:57:50 2011 (r224383) @@ -626,7 +626,9 @@ gem_reset(struct gem_softc *sc) gem_reset_tx(sc); /* Do a full reset. */ - GEM_BANK2_WRITE_4(sc, GEM_RESET, GEM_RESET_RX | GEM_RESET_TX); + GEM_BANK2_WRITE_4(sc, GEM_RESET, GEM_RESET_RX | GEM_RESET_TX | + (sc->sc_variant == GEM_SUN_ERI ? GEM_ERI_CACHE_LINE_SIZE << + GEM_RESET_CLSZ_SHFT : 0)); GEM_BANK2_BARRIER(sc, GEM_RESET, 4, BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); if (!GEM_BANK2_BITWAIT(sc, GEM_RESET, GEM_RESET_RX | GEM_RESET_TX, 0)) @@ -716,11 +718,12 @@ gem_reset_rx(struct gem_softc *sc) DELAY(5000); /* Reset the ERX. */ - GEM_BANK2_WRITE_4(sc, GEM_RESET, GEM_RESET_RX); + GEM_BANK2_WRITE_4(sc, GEM_RESET, GEM_RESET_RX | + (sc->sc_variant == GEM_SUN_ERI ? GEM_ERI_CACHE_LINE_SIZE << + GEM_RESET_CLSZ_SHFT : 0)); GEM_BANK2_BARRIER(sc, GEM_RESET, 4, BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); - if (!GEM_BANK2_BITWAIT(sc, GEM_RESET, GEM_RESET_RX | GEM_RESET_TX, - 0)) { + if (!GEM_BANK2_BITWAIT(sc, GEM_RESET, GEM_RESET_RX, 0)) { device_printf(sc->sc_dev, "cannot reset receiver\n"); return (1); } @@ -806,11 +809,12 @@ gem_reset_tx(struct gem_softc *sc) DELAY(5000); /* Finally, reset the ETX. */ - GEM_BANK2_WRITE_4(sc, GEM_RESET, GEM_RESET_TX); + GEM_BANK2_WRITE_4(sc, GEM_RESET, GEM_RESET_TX | + (sc->sc_variant == GEM_SUN_ERI ? GEM_ERI_CACHE_LINE_SIZE << + GEM_RESET_CLSZ_SHFT : 0)); GEM_BANK2_BARRIER(sc, GEM_RESET, 4, BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); - if (!GEM_BANK2_BITWAIT(sc, GEM_RESET, GEM_RESET_RX | GEM_RESET_TX, - 0)) { + if (!GEM_BANK2_BITWAIT(sc, GEM_RESET, GEM_RESET_TX, 0)) { device_printf(sc->sc_dev, "cannot reset transmitter\n"); return (1); } Modified: stable/7/sys/dev/gem/if_gem_pci.c ============================================================================== --- stable/7/sys/dev/gem/if_gem_pci.c Mon Jul 25 18:57:49 2011 (r224382) +++ stable/7/sys/dev/gem/if_gem_pci.c Mon Jul 25 18:57:50 2011 (r224383) @@ -177,6 +177,10 @@ gem_pci_attach(device_t dev) if (pci_get_intpin(dev) == 0) pci_set_intpin(dev, 1); + /* Set the PCI latency timer for Sun ERIs. */ + if (sc->sc_variant == GEM_SUN_ERI) + pci_write_config(dev, PCIR_LATTIMER, GEM_ERI_LATENCY_TIMER, 1); + sc->sc_dev = dev; sc->sc_flags |= GEM_PCI; Modified: stable/7/sys/dev/gem/if_gemreg.h ============================================================================== --- stable/7/sys/dev/gem/if_gemreg.h Mon Jul 25 18:57:49 2011 (r224382) +++ stable/7/sys/dev/gem/if_gemreg.h Mon Jul 25 18:57:50 2011 (r224383) @@ -35,7 +35,7 @@ /* register definitions for Apple GMAC, Sun ERI and Sun GEM */ /* - * First bank: this registers live at the start of the PCI + * First bank: these registers live at the start of the PCI * mapping, and at the start of the second bank of the SBus * version. */ @@ -93,7 +93,7 @@ "b\x10MAC_CONTROL\0b\x11MIF\0b\x12IBERR\0\0" /* - * Second bank: this registers live at offset 0x1000 of the PCI + * Second bank: these registers live at offset 0x1000 of the PCI * mapping, and at the start of the first bank of the SBus * version. */ @@ -128,7 +128,7 @@ /* GEM_PCI_BIF_DIAG register bits */ #define GEN_PCI_BIF_DIAG_BC_SM 0x007f0000 /* burst ctrl. state machine */ -#define GEN_PCI_BIF_DIAG_SM 0xff000000 /* BIF state machine */ +#define GEN_PCI_BIF_DIAG_SM 0xff000000 /* BIF state machine */ /* Bits in GEM_SBUS_CONFIG register */ #define GEM_SBUS_CFG_BURST_32 0x00000001 /* 32 byte bursts */ @@ -147,6 +147,8 @@ #define GEM_RESET_TX 0x00000001 /* Reset TX half. */ #define GEM_RESET_RX 0x00000002 /* Reset RX half. */ #define GEM_RESET_PCI_RSTOUT 0x00000004 /* Force PCI RSTOUT#. */ +#define GEM_RESET_CLSZ_MASK 0x00ff0000 /* ERI cache line size */ +#define GEM_RESET_CLSZ_SHFT 16 /* The rest of the registers live in the first bank again. */ @@ -586,6 +588,10 @@ #define GEM_PHYAD_INTERNAL 1 #define GEM_PHYAD_EXTERNAL 0 +/* Miscellaneous */ +#define GEM_ERI_CACHE_LINE_SIZE 16 +#define GEM_ERI_LATENCY_TIMER 64 + /* * descriptor table structures */ @@ -594,7 +600,11 @@ struct gem_desc { uint64_t gd_addr; }; -/* Transmit flags */ +/* + * Transmit flags + * GEM_TD_CXSUM_ENABLE, GEM_TD_CXSUM_START, GEM_TD_CXSUM_STUFF and + * GEM_TD_INTERRUPT_ME only need to be set in the first descriptor of a group. + */ #define GEM_TD_BUFSIZE 0x0000000000007fffULL #define GEM_TD_CXSUM_START 0x00000000001f8000ULL /* Cxsum start offset */ #define GEM_TD_CXSUM_STARTSHFT 15 @@ -605,10 +615,6 @@ struct gem_desc { #define GEM_TD_START_OF_PACKET 0x0000000080000000ULL #define GEM_TD_INTERRUPT_ME 0x0000000100000000ULL /* Interrupt me now */ #define GEM_TD_NO_CRC 0x0000000200000000ULL /* do not insert crc */ -/* - * Only need to set GEM_TD_CXSUM_ENABLE, GEM_TD_CXSUM_STUFF, - * GEM_TD_CXSUM_START, and GEM_TD_INTERRUPT_ME in 1st descriptor of a group. - */ /* Receive flags */ #define GEM_RD_CHECKSUM 0x000000000000ffffULL /* is the complement */ @@ -618,7 +624,6 @@ struct gem_desc { #define GEM_RD_HASH_PASS 0x1000000000000000ULL /* passed hash filter */ #define GEM_RD_ALTERNATE_MAC 0x2000000000000000ULL /* Alternate MAC adrs */ #define GEM_RD_BAD_CRC 0x4000000000000000ULL - #define GEM_RD_BUFSHIFT 16 #define GEM_RD_BUFLEN(x) (((x) & GEM_RD_BUFSIZE) >> GEM_RD_BUFSHIFT) From owner-svn-src-stable@FreeBSD.ORG Mon Jul 25 18:59:44 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3A657106566B; Mon, 25 Jul 2011 18:59:44 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 29EA58FC16; Mon, 25 Jul 2011 18:59:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PIxina072274; Mon, 25 Jul 2011 18:59:44 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PIxiN6072272; Mon, 25 Jul 2011 18:59:44 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251859.p6PIxiN6072272@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 18:59:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224384 - stable/7/sys/sparc64/pci X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 18:59:44 -0000 Author: marius Date: Mon Jul 25 18:59:43 2011 New Revision: 224384 URL: http://svn.freebsd.org/changeset/base/224384 Log: MFC: r223959 - Add a missing shift in schizo_get_timecount(). This happened to be non-fatal as STX_CTRL_PERF_CNT_CNT0_SHIFT actually is zero, if we were using the second counter in the upper 32 bits this would be required though as the MI timecounter code doesn't support 64-bit counters/counter registers. - Remove a redundant NULL assignment from the timecounter initialization. Modified: stable/7/sys/sparc64/pci/schizo.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/sparc64/pci/schizo.c ============================================================================== --- stable/7/sys/sparc64/pci/schizo.c Mon Jul 25 18:57:50 2011 (r224383) +++ stable/7/sys/sparc64/pci/schizo.c Mon Jul 25 18:59:43 2011 (r224384) @@ -482,7 +482,6 @@ schizo_attach(device_t dev) if (tc == NULL) panic("%s: could not malloc timecounter", __func__); tc->tc_get_timecount = schizo_get_timecount; - tc->tc_poll_pps = NULL; tc->tc_counter_mask = STX_CTRL_PERF_CNT_MASK; if (OF_getprop(OF_peer(0), "clock-frequency", &prop, sizeof(prop)) == -1) @@ -1521,6 +1520,7 @@ schizo_get_timecount(struct timecounter struct schizo_softc *sc; sc = tc->tc_priv; - return (SCHIZO_CTRL_READ_8(sc, STX_CTRL_PERF_CNT) & - (STX_CTRL_PERF_CNT_MASK << STX_CTRL_PERF_CNT_CNT0_SHIFT)); + return ((SCHIZO_CTRL_READ_8(sc, STX_CTRL_PERF_CNT) & + (STX_CTRL_PERF_CNT_MASK << STX_CTRL_PERF_CNT_CNT0_SHIFT)) >> + STX_CTRL_PERF_CNT_CNT0_SHIFT); } From owner-svn-src-stable@FreeBSD.ORG Mon Jul 25 18:59:45 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9ABF3106566C; Mon, 25 Jul 2011 18:59:45 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8A0B28FC08; Mon, 25 Jul 2011 18:59:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PIxjMr072305; Mon, 25 Jul 2011 18:59:45 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PIxjhW072303; Mon, 25 Jul 2011 18:59:45 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251859.p6PIxjhW072303@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 18:59:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224385 - stable/8/sys/sparc64/pci X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 18:59:45 -0000 Author: marius Date: Mon Jul 25 18:59:45 2011 New Revision: 224385 URL: http://svn.freebsd.org/changeset/base/224385 Log: MFC: r223959 - Add a missing shift in schizo_get_timecount(). This happened to be non-fatal as STX_CTRL_PERF_CNT_CNT0_SHIFT actually is zero, if we were using the second counter in the upper 32 bits this would be required though as the MI timecounter code doesn't support 64-bit counters/counter registers. - Remove a redundant NULL assignment from the timecounter initialization. Modified: stable/8/sys/sparc64/pci/schizo.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/geom/label/ (props changed) Modified: stable/8/sys/sparc64/pci/schizo.c ============================================================================== --- stable/8/sys/sparc64/pci/schizo.c Mon Jul 25 18:59:43 2011 (r224384) +++ stable/8/sys/sparc64/pci/schizo.c Mon Jul 25 18:59:45 2011 (r224385) @@ -482,7 +482,6 @@ schizo_attach(device_t dev) if (tc == NULL) panic("%s: could not malloc timecounter", __func__); tc->tc_get_timecount = schizo_get_timecount; - tc->tc_poll_pps = NULL; tc->tc_counter_mask = STX_CTRL_PERF_CNT_MASK; if (OF_getprop(OF_peer(0), "clock-frequency", &prop, sizeof(prop)) == -1) @@ -1521,6 +1520,7 @@ schizo_get_timecount(struct timecounter struct schizo_softc *sc; sc = tc->tc_priv; - return (SCHIZO_CTRL_READ_8(sc, STX_CTRL_PERF_CNT) & - (STX_CTRL_PERF_CNT_MASK << STX_CTRL_PERF_CNT_CNT0_SHIFT)); + return ((SCHIZO_CTRL_READ_8(sc, STX_CTRL_PERF_CNT) & + (STX_CTRL_PERF_CNT_MASK << STX_CTRL_PERF_CNT_CNT0_SHIFT)) >> + STX_CTRL_PERF_CNT_CNT0_SHIFT); } From owner-svn-src-stable@FreeBSD.ORG Mon Jul 25 19:01:36 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7683D106566C; Mon, 25 Jul 2011 19:01:36 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 428738FC0A; Mon, 25 Jul 2011 19:01:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PJ1adA072464; Mon, 25 Jul 2011 19:01:36 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PJ1aW8072462; Mon, 25 Jul 2011 19:01:36 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251901.p6PJ1aW8072462@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 19:01:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224386 - stable/7/sys/sparc64/pci X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 19:01:36 -0000 Author: marius Date: Mon Jul 25 19:01:35 2011 New Revision: 224386 URL: http://svn.freebsd.org/changeset/base/224386 Log: MFC: r223960 - Current testing shows that (ab)using the JBC performance counter in bus cycle mode as timecounter just works fine. My best guess is that a firmware update has fixed this, so check at run-time whether it advances and use a positive quality if it does. The latter will cause this timecounter to be used instead of the tick counter based one, which just sucks for SMP. - Remove a redundant NULL assignment from the timecounter initialization. Modified: stable/7/sys/sparc64/pci/fire.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/sparc64/pci/fire.c ============================================================================== --- stable/7/sys/sparc64/pci/fire.c Mon Jul 25 18:59:45 2011 (r224385) +++ stable/7/sys/sparc64/pci/fire.c Mon Jul 25 19:01:35 2011 (r224386) @@ -663,9 +663,7 @@ fire_attach(device_t dev) /* * Setup JBC/UBC performance counter 0 in bus cycle counting - * mode as timecounter. Unfortunately, at least with Fire all - * JBus-driven performance counters just don't advance in bus - * cycle counting mode. + * mode as timecounter. */ if (device_get_unit(dev) == 0) { FIRE_CTRL_SET(sc, FO_XBC_PRF_CNT0, 0); @@ -673,19 +671,10 @@ fire_attach(device_t dev) FIRE_CTRL_SET(sc, FO_XBC_PRF_CNT_SEL, (FO_XBC_PRF_CNT_NONE << FO_XBC_PRF_CNT_CNT1_SHFT) | (FO_XBC_PRF_CNT_XB_CLK << FO_XBC_PRF_CNT_CNT0_SHFT)); -#ifdef FIRE_DEBUG - device_printf(dev, "FO_XBC_PRF_CNT0 0x%016llx\n", - (long long unsigned)FIRE_CTRL_READ_8(sc, - FO_XBC_PRF_CNT0)); - device_printf(dev, "FO_XBC_PRF_CNT0 0x%016llx\n", - (long long unsigned)FIRE_CTRL_READ_8(sc, - FO_XBC_PRF_CNT0)); -#endif tc = malloc(sizeof(*tc), M_DEVBUF, M_NOWAIT | M_ZERO); if (tc == NULL) panic("%s: could not malloc timecounter", __func__); tc->tc_get_timecount = fire_get_timecount; - tc->tc_poll_pps = NULL; tc->tc_counter_mask = TC_COUNTER_MAX_MASK; if (OF_getprop(OF_peer(0), "clock-frequency", &prop, sizeof(prop)) == -1) @@ -693,8 +682,16 @@ fire_attach(device_t dev) __func__); tc->tc_frequency = prop; tc->tc_name = strdup(device_get_nameunit(dev), M_DEVBUF); - tc->tc_quality = -FIRE_PERF_CNT_QLTY; tc->tc_priv = sc; + /* + * Due to initial problems with the JBus-driven performance + * counters not advancing which might be firmware dependent + * ensure that it actually works. + */ + if (fire_get_timecount(tc) - fire_get_timecount(tc) != 0) + tc->tc_quality = FIRE_PERF_CNT_QLTY; + else + tc->tc_quality = -FIRE_PERF_CNT_QLTY; tc_init(tc); } From owner-svn-src-stable@FreeBSD.ORG Mon Jul 25 19:01:36 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C00EC1065670; Mon, 25 Jul 2011 19:01:36 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 95F098FC17; Mon, 25 Jul 2011 19:01:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PJ1aUa072479; Mon, 25 Jul 2011 19:01:36 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PJ1aaC072477; Mon, 25 Jul 2011 19:01:36 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251901.p6PJ1aaC072477@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 19:01:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224387 - stable/8/sys/sparc64/pci X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 19:01:36 -0000 Author: marius Date: Mon Jul 25 19:01:36 2011 New Revision: 224387 URL: http://svn.freebsd.org/changeset/base/224387 Log: MFC: r223960 - Current testing shows that (ab)using the JBC performance counter in bus cycle mode as timecounter just works fine. My best guess is that a firmware update has fixed this, so check at run-time whether it advances and use a positive quality if it does. The latter will cause this timecounter to be used instead of the tick counter based one, which just sucks for SMP. - Remove a redundant NULL assignment from the timecounter initialization. Modified: stable/8/sys/sparc64/pci/fire.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/geom/label/ (props changed) Modified: stable/8/sys/sparc64/pci/fire.c ============================================================================== --- stable/8/sys/sparc64/pci/fire.c Mon Jul 25 19:01:35 2011 (r224386) +++ stable/8/sys/sparc64/pci/fire.c Mon Jul 25 19:01:36 2011 (r224387) @@ -664,9 +664,7 @@ fire_attach(device_t dev) /* * Setup JBC/UBC performance counter 0 in bus cycle counting - * mode as timecounter. Unfortunately, at least with Fire all - * JBus-driven performance counters just don't advance in bus - * cycle counting mode. + * mode as timecounter. */ if (device_get_unit(dev) == 0) { FIRE_CTRL_SET(sc, FO_XBC_PRF_CNT0, 0); @@ -674,19 +672,10 @@ fire_attach(device_t dev) FIRE_CTRL_SET(sc, FO_XBC_PRF_CNT_SEL, (FO_XBC_PRF_CNT_NONE << FO_XBC_PRF_CNT_CNT1_SHFT) | (FO_XBC_PRF_CNT_XB_CLK << FO_XBC_PRF_CNT_CNT0_SHFT)); -#ifdef FIRE_DEBUG - device_printf(dev, "FO_XBC_PRF_CNT0 0x%016llx\n", - (long long unsigned)FIRE_CTRL_READ_8(sc, - FO_XBC_PRF_CNT0)); - device_printf(dev, "FO_XBC_PRF_CNT0 0x%016llx\n", - (long long unsigned)FIRE_CTRL_READ_8(sc, - FO_XBC_PRF_CNT0)); -#endif tc = malloc(sizeof(*tc), M_DEVBUF, M_NOWAIT | M_ZERO); if (tc == NULL) panic("%s: could not malloc timecounter", __func__); tc->tc_get_timecount = fire_get_timecount; - tc->tc_poll_pps = NULL; tc->tc_counter_mask = TC_COUNTER_MAX_MASK; if (OF_getprop(OF_peer(0), "clock-frequency", &prop, sizeof(prop)) == -1) @@ -694,8 +683,16 @@ fire_attach(device_t dev) __func__); tc->tc_frequency = prop; tc->tc_name = strdup(device_get_nameunit(dev), M_DEVBUF); - tc->tc_quality = -FIRE_PERF_CNT_QLTY; tc->tc_priv = sc; + /* + * Due to initial problems with the JBus-driven performance + * counters not advancing which might be firmware dependent + * ensure that it actually works. + */ + if (fire_get_timecount(tc) - fire_get_timecount(tc) != 0) + tc->tc_quality = FIRE_PERF_CNT_QLTY; + else + tc->tc_quality = -FIRE_PERF_CNT_QLTY; tc_init(tc); } From owner-svn-src-stable@FreeBSD.ORG Mon Jul 25 19:03:45 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D3139106566C; Mon, 25 Jul 2011 19:03:45 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C24E48FC12; Mon, 25 Jul 2011 19:03:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PJ3jMH072603; Mon, 25 Jul 2011 19:03:45 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PJ3jNX072601; Mon, 25 Jul 2011 19:03:45 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251903.p6PJ3jNX072601@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 19:03:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224388 - stable/8/sys/sparc64/sparc64 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 19:03:45 -0000 Author: marius Date: Mon Jul 25 19:03:45 2011 New Revision: 224388 URL: http://svn.freebsd.org/changeset/base/224388 Log: MFC: r223961 - Remove redundant timecounter masking from counter_get_timecount(). - Zero the timecounter when allocation so we don't need to initialize unused members and remove a now redundant NULL assignment. Submitted by: jkim Modified: stable/8/sys/sparc64/sparc64/counter.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/geom/label/ (props changed) Modified: stable/8/sys/sparc64/sparc64/counter.c ============================================================================== --- stable/8/sys/sparc64/sparc64/counter.c Mon Jul 25 19:01:36 2011 (r224387) +++ stable/8/sys/sparc64/sparc64/counter.c Mon Jul 25 19:03:45 2011 (r224388) @@ -86,13 +86,12 @@ sparc64_counter_init(const char *name, b bus_space_write_8(tag, handle, offset + CTR_CT1 + CTR_LIMIT, COUNTER_MASK); /* Register as a time counter. */ - tc = malloc(sizeof(*tc), M_DEVBUF, M_WAITOK); + tc = malloc(sizeof(*tc), M_DEVBUF, M_WAITOK | M_ZERO); sc = malloc(sizeof(*sc), M_DEVBUF, M_WAITOK); sc->sc_tag = tag; sc->sc_handle = handle; sc->sc_offset = offset + CTR_CT0; tc->tc_get_timecount = counter_get_timecount; - tc->tc_poll_pps = NULL; tc->tc_counter_mask = COUNTER_MASK; tc->tc_frequency = COUNTER_FREQ; tc->tc_name = strdup(name, M_DEVBUF); @@ -107,6 +106,5 @@ counter_get_timecount(struct timecounter struct ct_softc *sc; sc = tc->tc_priv; - return (bus_space_read_8(sc->sc_tag, sc->sc_handle, sc->sc_offset) & - COUNTER_MASK); + return (bus_space_read_8(sc->sc_tag, sc->sc_handle, sc->sc_offset)); } From owner-svn-src-stable@FreeBSD.ORG Mon Jul 25 19:03:50 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8EBF4106566B; Mon, 25 Jul 2011 19:03:50 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7E0B18FC0C; Mon, 25 Jul 2011 19:03:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PJ3o4Q072639; Mon, 25 Jul 2011 19:03:50 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PJ3oNg072637; Mon, 25 Jul 2011 19:03:50 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251903.p6PJ3oNg072637@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 19:03:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224389 - stable/7/sys/sparc64/sparc64 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 19:03:50 -0000 Author: marius Date: Mon Jul 25 19:03:50 2011 New Revision: 224389 URL: http://svn.freebsd.org/changeset/base/224389 Log: MFC: r223961 - Remove redundant timecounter masking from counter_get_timecount(). - Zero the timecounter when allocation so we don't need to initialize unused members and remove a now redundant NULL assignment. Submitted by: jkim Modified: stable/7/sys/sparc64/sparc64/counter.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/sparc64/sparc64/counter.c ============================================================================== --- stable/7/sys/sparc64/sparc64/counter.c Mon Jul 25 19:03:45 2011 (r224388) +++ stable/7/sys/sparc64/sparc64/counter.c Mon Jul 25 19:03:50 2011 (r224389) @@ -86,13 +86,12 @@ sparc64_counter_init(const char *name, b bus_space_write_8(tag, handle, offset + CTR_CT1 + CTR_LIMIT, COUNTER_MASK); /* Register as a time counter. */ - tc = malloc(sizeof(*tc), M_DEVBUF, M_WAITOK); + tc = malloc(sizeof(*tc), M_DEVBUF, M_WAITOK | M_ZERO); sc = malloc(sizeof(*sc), M_DEVBUF, M_WAITOK); sc->sc_tag = tag; sc->sc_handle = handle; sc->sc_offset = offset + CTR_CT0; tc->tc_get_timecount = counter_get_timecount; - tc->tc_poll_pps = NULL; tc->tc_counter_mask = COUNTER_MASK; tc->tc_frequency = COUNTER_FREQ; tc->tc_name = strdup(name, M_DEVBUF); @@ -107,6 +106,5 @@ counter_get_timecount(struct timecounter struct ct_softc *sc; sc = tc->tc_priv; - return (bus_space_read_8(sc->sc_tag, sc->sc_handle, sc->sc_offset) & - COUNTER_MASK); + return (bus_space_read_8(sc->sc_tag, sc->sc_handle, sc->sc_offset)); } From owner-svn-src-stable@FreeBSD.ORG Mon Jul 25 19:04:57 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 60AA7106564A; Mon, 25 Jul 2011 19:04:57 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 500F98FC18; Mon, 25 Jul 2011 19:04:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PJ4vv5072765; Mon, 25 Jul 2011 19:04:57 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PJ4vGA072763; Mon, 25 Jul 2011 19:04:57 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251904.p6PJ4vGA072763@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 19:04:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224390 - stable/8/sys/sparc64/sparc64 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 19:04:57 -0000 Author: marius Date: Mon Jul 25 19:04:57 2011 New Revision: 224390 URL: http://svn.freebsd.org/changeset/base/224390 Log: MFC: r223962 Remove NULL assignments which are redundant for static timecounters. Submitted by: jkim Modified: stable/8/sys/sparc64/sparc64/tick.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/geom/label/ (props changed) Modified: stable/8/sys/sparc64/sparc64/tick.c ============================================================================== --- stable/8/sys/sparc64/sparc64/tick.c Mon Jul 25 19:03:50 2011 (r224389) +++ stable/8/sys/sparc64/sparc64/tick.c Mon Jul 25 19:04:57 2011 (r224390) @@ -161,12 +161,10 @@ cpu_initclocks(void) * quality (S)TICK timers in the MP case. */ tick_tc.tc_get_timecount = tick_get_timecount_up; - tick_tc.tc_poll_pps = NULL; tick_tc.tc_counter_mask = ~0u; tick_tc.tc_frequency = clock; tick_tc.tc_name = "tick"; tick_tc.tc_quality = TICK_QUALITY_UP; - tick_tc.tc_priv = NULL; #ifdef SMP if (cpu_mp_probe()) { tick_tc.tc_get_timecount = tick_get_timecount_mp; @@ -176,12 +174,10 @@ cpu_initclocks(void) tc_init(&tick_tc); if (sclock != 0) { stick_tc.tc_get_timecount = stick_get_timecount_up; - stick_tc.tc_poll_pps = NULL; stick_tc.tc_counter_mask = ~0u; stick_tc.tc_frequency = sclock; stick_tc.tc_name = "stick"; stick_tc.tc_quality = TICK_QUALITY_UP; - stick_tc.tc_priv = NULL; #ifdef SMP if (cpu_mp_probe()) { stick_tc.tc_get_timecount = stick_get_timecount_mp; From owner-svn-src-stable@FreeBSD.ORG Mon Jul 25 19:04:57 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 71D01106566C; Mon, 25 Jul 2011 19:04:57 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 611F18FC0C; Mon, 25 Jul 2011 19:04:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PJ4vFg072769; Mon, 25 Jul 2011 19:04:57 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PJ4vCj072767; Mon, 25 Jul 2011 19:04:57 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251904.p6PJ4vCj072767@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 19:04:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224391 - stable/7/sys/sparc64/sparc64 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 19:04:57 -0000 Author: marius Date: Mon Jul 25 19:04:57 2011 New Revision: 224391 URL: http://svn.freebsd.org/changeset/base/224391 Log: MFC: r223962 Remove NULL assignments which are redundant for static timecounters. Submitted by: jkim Modified: stable/7/sys/sparc64/sparc64/tick.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/sparc64/sparc64/tick.c ============================================================================== --- stable/7/sys/sparc64/sparc64/tick.c Mon Jul 25 19:04:57 2011 (r224390) +++ stable/7/sys/sparc64/sparc64/tick.c Mon Jul 25 19:04:57 2011 (r224391) @@ -161,12 +161,10 @@ cpu_initclocks(void) * quality (S)TICK timers in the MP case. */ tick_tc.tc_get_timecount = tick_get_timecount_up; - tick_tc.tc_poll_pps = NULL; tick_tc.tc_counter_mask = ~0u; tick_tc.tc_frequency = clock; tick_tc.tc_name = "tick"; tick_tc.tc_quality = TICK_QUALITY_UP; - tick_tc.tc_priv = NULL; #ifdef SMP if (cpu_mp_probe()) { tick_tc.tc_get_timecount = tick_get_timecount_mp; @@ -176,12 +174,10 @@ cpu_initclocks(void) tc_init(&tick_tc); if (sclock != 0) { stick_tc.tc_get_timecount = stick_get_timecount_up; - stick_tc.tc_poll_pps = NULL; stick_tc.tc_counter_mask = ~0u; stick_tc.tc_frequency = sclock; stick_tc.tc_name = "stick"; stick_tc.tc_quality = TICK_QUALITY_UP; - stick_tc.tc_priv = NULL; #ifdef SMP if (cpu_mp_probe()) { stick_tc.tc_get_timecount = stick_get_timecount_mp; From owner-svn-src-stable@FreeBSD.ORG Mon Jul 25 19:06:30 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8D0E61065672; Mon, 25 Jul 2011 19:06:30 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 635958FC0C; Mon, 25 Jul 2011 19:06:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PJ6U8M072924; Mon, 25 Jul 2011 19:06:30 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PJ6U8f072919; Mon, 25 Jul 2011 19:06:30 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251906.p6PJ6U8f072919@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 19:06:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224392 - stable/7/sys/dev/mpt X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 19:06:30 -0000 Author: marius Date: Mon Jul 25 19:06:30 2011 New Revision: 224392 URL: http://svn.freebsd.org/changeset/base/224392 Log: MFC: r223981 Remove extra empty lines. Modified: stable/7/sys/dev/mpt/mpt_pci.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/mpt/mpt_pci.c ============================================================================== --- stable/7/sys/dev/mpt/mpt_pci.c Mon Jul 25 19:04:57 2011 (r224391) +++ stable/7/sys/dev/mpt/mpt_pci.c Mon Jul 25 19:06:30 2011 (r224392) @@ -193,8 +193,6 @@ __FBSDID("$FreeBSD$"); #define PCIM_CMD_SERRESPEN 0x0100 #endif - - static int mpt_pci_probe(device_t); static int mpt_pci_attach(device_t); static void mpt_free_bus_resources(struct mpt_softc *mpt); @@ -362,7 +360,6 @@ mpt_set_options(struct mpt_softc *mpt) mpt->cfg_role = tval; mpt->do_cfg_role = 1; } - tval = 0; mpt->msi_enable = 0; if (resource_int_value(device_get_name(mpt->dev), @@ -372,7 +369,6 @@ mpt_set_options(struct mpt_softc *mpt) } #endif - static void mpt_link_peer(struct mpt_softc *mpt) { @@ -411,7 +407,6 @@ mpt_unlink_peer(struct mpt_softc *mpt) } } - static int mpt_pci_attach(device_t dev) { @@ -687,7 +682,6 @@ mpt_free_bus_resources(struct mpt_softc MPT_LOCK_DESTROY(mpt); } - /* * Disconnect ourselves from the system. */ @@ -712,7 +706,6 @@ mpt_pci_detach(device_t dev) return(0); } - /* * Disable the hardware */ @@ -808,8 +801,6 @@ mpt_dma_mem_alloc(struct mpt_softc *mpt) return (0); } - - /* Deallocate memory that was allocated by mpt_dma_mem_alloc */ static void @@ -832,8 +823,6 @@ mpt_dma_mem_free(struct mpt_softc *mpt) } - - /* Reads modifiable (via PCI transactions) config registers */ static void mpt_read_config_regs(struct mpt_softc *mpt) From owner-svn-src-stable@FreeBSD.ORG Mon Jul 25 19:06:30 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8E5C31065673; Mon, 25 Jul 2011 19:06:30 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 649738FC12; Mon, 25 Jul 2011 19:06:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PJ6UiC072925; Mon, 25 Jul 2011 19:06:30 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PJ6UfE072922; Mon, 25 Jul 2011 19:06:30 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251906.p6PJ6UfE072922@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 19:06:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224393 - stable/8/sys/dev/mpt X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 19:06:30 -0000 Author: marius Date: Mon Jul 25 19:06:30 2011 New Revision: 224393 URL: http://svn.freebsd.org/changeset/base/224393 Log: MFC: r223981 Remove extra empty lines. Modified: stable/8/sys/dev/mpt/mpt_pci.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/geom/label/ (props changed) Modified: stable/8/sys/dev/mpt/mpt_pci.c ============================================================================== --- stable/8/sys/dev/mpt/mpt_pci.c Mon Jul 25 19:06:30 2011 (r224392) +++ stable/8/sys/dev/mpt/mpt_pci.c Mon Jul 25 19:06:30 2011 (r224393) @@ -193,8 +193,6 @@ __FBSDID("$FreeBSD$"); #define PCIM_CMD_SERRESPEN 0x0100 #endif - - static int mpt_pci_probe(device_t); static int mpt_pci_attach(device_t); static void mpt_free_bus_resources(struct mpt_softc *mpt); @@ -362,7 +360,6 @@ mpt_set_options(struct mpt_softc *mpt) mpt->cfg_role = tval; mpt->do_cfg_role = 1; } - tval = 0; mpt->msi_enable = 0; if (resource_int_value(device_get_name(mpt->dev), @@ -372,7 +369,6 @@ mpt_set_options(struct mpt_softc *mpt) } #endif - static void mpt_link_peer(struct mpt_softc *mpt) { @@ -411,7 +407,6 @@ mpt_unlink_peer(struct mpt_softc *mpt) } } - static int mpt_pci_attach(device_t dev) { @@ -687,7 +682,6 @@ mpt_free_bus_resources(struct mpt_softc MPT_LOCK_DESTROY(mpt); } - /* * Disconnect ourselves from the system. */ @@ -712,7 +706,6 @@ mpt_pci_detach(device_t dev) return(0); } - /* * Disable the hardware */ @@ -808,8 +801,6 @@ mpt_dma_mem_alloc(struct mpt_softc *mpt) return (0); } - - /* Deallocate memory that was allocated by mpt_dma_mem_alloc */ static void @@ -832,8 +823,6 @@ mpt_dma_mem_free(struct mpt_softc *mpt) } - - /* Reads modifiable (via PCI transactions) config registers */ static void mpt_read_config_regs(struct mpt_softc *mpt) From owner-svn-src-stable@FreeBSD.ORG Mon Jul 25 19:11:29 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B73C21065670; Mon, 25 Jul 2011 19:11:29 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A6AC78FC0C; Mon, 25 Jul 2011 19:11:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PJBTcu073164; Mon, 25 Jul 2011 19:11:29 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PJBTX8073162; Mon, 25 Jul 2011 19:11:29 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251911.p6PJBTX8073162@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 19:11:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224394 - stable/8/sys/dev/pci X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 19:11:29 -0000 Author: marius Date: Mon Jul 25 19:11:29 2011 New Revision: 224394 URL: http://svn.freebsd.org/changeset/base/224394 Log: MFC: r223984 PCIB_ALLOC_MSIX() may already fail on the first pass, f.e. when the PCI-PCI bridge is blacklisted. In that case just return from pci_alloc_msix_method(), otherwise we continue without a single MSI-X resource, causing subsequent attempts to use the seemingly available resource to fail or when booting verbose to NULL-dereference rle->start when trying to print the IRQ in pci_alloc_msix_method(). Reviewed by: jhb Modified: stable/8/sys/dev/pci/pci.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/geom/label/ (props changed) Modified: stable/8/sys/dev/pci/pci.c ============================================================================== --- stable/8/sys/dev/pci/pci.c Mon Jul 25 19:06:30 2011 (r224393) +++ stable/8/sys/dev/pci/pci.c Mon Jul 25 19:11:29 2011 (r224394) @@ -1294,8 +1294,11 @@ pci_alloc_msix_method(device_t dev, devi for (i = 0; i < max; i++) { /* Allocate a message. */ error = PCIB_ALLOC_MSIX(device_get_parent(dev), child, &irq); - if (error) + if (error) { + if (i == 0) + return (error); break; + } resource_list_add(&dinfo->resources, SYS_RES_IRQ, i + 1, irq, irq, 1); } From owner-svn-src-stable@FreeBSD.ORG Mon Jul 25 19:11:30 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5A89E1065672; Mon, 25 Jul 2011 19:11:30 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 49F5C8FC13; Mon, 25 Jul 2011 19:11:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PJBUmq073187; Mon, 25 Jul 2011 19:11:30 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PJBUW0073185; Mon, 25 Jul 2011 19:11:30 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251911.p6PJBUW0073185@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 19:11:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224395 - stable/7/sys/dev/pci X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 19:11:30 -0000 Author: marius Date: Mon Jul 25 19:11:29 2011 New Revision: 224395 URL: http://svn.freebsd.org/changeset/base/224395 Log: MFC: r223984 PCIB_ALLOC_MSIX() may already fail on the first pass, f.e. when the PCI-PCI bridge is blacklisted. In that case just return from pci_alloc_msix_method(), otherwise we continue without a single MSI-X resource, causing subsequent attempts to use the seemingly available resource to fail or when booting verbose to NULL-dereference rle->start when trying to print the IRQ in pci_alloc_msix_method(). Reviewed by: jhb Modified: stable/7/sys/dev/pci/pci.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/pci/pci.c ============================================================================== --- stable/7/sys/dev/pci/pci.c Mon Jul 25 19:11:29 2011 (r224394) +++ stable/7/sys/dev/pci/pci.c Mon Jul 25 19:11:29 2011 (r224395) @@ -1243,8 +1243,11 @@ pci_alloc_msix_method(device_t dev, devi for (i = 0; i < max; i++) { /* Allocate a message. */ error = PCIB_ALLOC_MSIX(device_get_parent(dev), child, &irq); - if (error) + if (error) { + if (i == 0) + return (error); break; + } resource_list_add(&dinfo->resources, SYS_RES_IRQ, i + 1, irq, irq, 1); } From owner-svn-src-stable@FreeBSD.ORG Mon Jul 25 19:13:51 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9B8FC106566B; Mon, 25 Jul 2011 19:13:51 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8A8228FC0C; Mon, 25 Jul 2011 19:13:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PJDpES073346; Mon, 25 Jul 2011 19:13:51 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PJDplE073342; Mon, 25 Jul 2011 19:13:51 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251913.p6PJDplE073342@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 19:13:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224396 - stable/8/sys/dev/cas X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 19:13:51 -0000 Author: marius Date: Mon Jul 25 19:13:51 2011 New Revision: 224396 URL: http://svn.freebsd.org/changeset/base/224396 Log: MFC: r223986 - Expand the scope of the lock in the interrupt routine to close races with checking IFF_DRV_RUNNING and simplify the code. This also involves holding the driver lock in the rx_ch callout. - Just use ifp instead of sc->sc_ifp. Submitted by: jhb (mostly) Modified: stable/8/sys/dev/cas/if_cas.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/geom/label/ (props changed) Modified: stable/8/sys/dev/cas/if_cas.c ============================================================================== --- stable/8/sys/dev/cas/if_cas.c Mon Jul 25 19:11:29 2011 (r224395) +++ stable/8/sys/dev/cas/if_cas.c Mon Jul 25 19:13:51 2011 (r224396) @@ -203,7 +203,7 @@ cas_attach(struct cas_softc *sc) IFQ_SET_READY(&ifp->if_snd); callout_init_mtx(&sc->sc_tick_ch, &sc->sc_mtx, 0); - callout_init(&sc->sc_rx_ch, 1); + callout_init_mtx(&sc->sc_rx_ch, &sc->sc_mtx, 0); /* Create local taskq. */ TASK_INIT(&sc->sc_intr_task, 0, cas_intr_task, sc); TASK_INIT(&sc->sc_tx_task, 1, cas_tx_task, ifp); @@ -1597,7 +1597,7 @@ cas_rint_timeout(void *arg) { struct cas_softc *sc = arg; - CAS_LOCK_ASSERT(sc, MA_NOTOWNED); + CAS_LOCK_ASSERT(sc, MA_OWNED); cas_rint(sc); } @@ -1612,7 +1612,7 @@ cas_rint(struct cas_softc *sc) uint32_t rxhead; u_int idx, idx2, len, off, skip; - CAS_LOCK_ASSERT(sc, MA_NOTOWNED); + CAS_LOCK_ASSERT(sc, MA_OWNED); callout_stop(&sc->sc_rx_ch); @@ -1740,7 +1740,9 @@ cas_rint(struct cas_softc *sc) cas_rxcksum(m, CAS_GET(word4, CAS_RC4_TCP_CSUM)); /* Pass it on. */ + CAS_UNLOCK(sc); (*ifp->if_input)(ifp, m); + CAS_LOCK(sc); } else ifp->if_ierrors++; @@ -1836,7 +1838,9 @@ cas_rint(struct cas_softc *sc) cas_rxcksum(m, CAS_GET(word4, CAS_RC4_TCP_CSUM)); /* Pass it on. */ + CAS_UNLOCK(sc); (*ifp->if_input)(ifp, m); + CAS_LOCK(sc); } else ifp->if_ierrors++; @@ -1874,7 +1878,7 @@ cas_free(void *arg1, void *arg2) { struct cas_rxdsoft *rxds; struct cas_softc *sc; - u_int idx; + u_int idx, locked; #if __FreeBSD_version < 800016 rxds = arg2; @@ -1892,17 +1896,18 @@ cas_free(void *arg1, void *arg2) * NB: this function can be called via m_freem(9) within * this driver! */ - + if ((locked = CAS_LOCK_OWNED(sc)) == 0) + CAS_LOCK(sc); cas_add_rxdesc(sc, idx); + if (locked == 0) + CAS_UNLOCK(sc); } static inline void cas_add_rxdesc(struct cas_softc *sc, u_int idx) { - u_int locked; - if ((locked = CAS_LOCK_OWNED(sc)) == 0) - CAS_LOCK(sc); + CAS_LOCK_ASSERT(sc, MA_OWNED); bus_dmamap_sync(sc->sc_rdmatag, sc->sc_rxdsoft[idx].rxds_dmamap, BUS_DMASYNC_PREREAD); @@ -1920,9 +1925,6 @@ cas_add_rxdesc(struct cas_softc *sc, u_i CAS_WRITE_4(sc, CAS_RX_KICK, (sc->sc_rxdptr + CAS_NRXDESC - 4) & CAS_NRXDESC_MASK); } - - if (locked == 0) - CAS_UNLOCK(sc); } static void @@ -1930,7 +1932,7 @@ cas_eint(struct cas_softc *sc, u_int sta { struct ifnet *ifp = sc->sc_ifp; - CAS_LOCK_ASSERT(sc, MA_NOTOWNED); + CAS_LOCK_ASSERT(sc, MA_OWNED); ifp->if_ierrors++; @@ -1947,7 +1949,7 @@ cas_eint(struct cas_softc *sc, u_int sta printf("\n"); ifp->if_drv_flags &= ~IFF_DRV_RUNNING; - cas_init(sc); + cas_init_locked(sc); if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) taskqueue_enqueue(sc->sc_tq, &sc->sc_tx_task); } @@ -1984,6 +1986,7 @@ cas_intr_task(void *arg, int pending __u if (__predict_false((status & CAS_INTR_SUMMARY) == 0)) goto done; + CAS_LOCK(sc); #ifdef CAS_DEBUG CTR4(KTR_CAS, "%s: %s: cplt %x, status %x", device_get_name(sc->sc_dev), __func__, @@ -2023,6 +2026,7 @@ cas_intr_task(void *arg, int pending __u (CAS_INTR_TX_TAG_ERR | CAS_INTR_RX_TAG_ERR | CAS_INTR_RX_LEN_MMATCH | CAS_INTR_PCI_ERROR_INT)) != 0)) { cas_eint(sc, status); + CAS_UNLOCK(sc); return; } @@ -2030,7 +2034,7 @@ cas_intr_task(void *arg, int pending __u status2 = CAS_READ_4(sc, CAS_MAC_TX_STATUS); if ((status2 & (CAS_MAC_TX_UNDERRUN | CAS_MAC_TX_MAX_PKT_ERR)) != 0) - sc->sc_ifp->if_oerrors++; + ifp->if_oerrors++; else if ((status2 & ~CAS_MAC_TX_FRAME_XMTD) != 0) device_printf(sc->sc_dev, "MAC TX fault, status %x\n", status2); @@ -2039,7 +2043,7 @@ cas_intr_task(void *arg, int pending __u if (__predict_false(status & CAS_INTR_RX_MAC_INT)) { status2 = CAS_READ_4(sc, CAS_MAC_RX_STATUS); if ((status2 & CAS_MAC_RX_OVERFLOW) != 0) - sc->sc_ifp->if_ierrors++; + ifp->if_ierrors++; else if ((status2 & ~CAS_MAC_RX_FRAME_RCVD) != 0) device_printf(sc->sc_dev, "MAC RX fault, status %x\n", status2); @@ -2059,16 +2063,15 @@ cas_intr_task(void *arg, int pending __u } if ((status & - (CAS_INTR_TX_INT_ME | CAS_INTR_TX_ALL | CAS_INTR_TX_DONE)) != 0) { - CAS_LOCK(sc); + (CAS_INTR_TX_INT_ME | CAS_INTR_TX_ALL | CAS_INTR_TX_DONE)) != 0) cas_tint(sc); - CAS_UNLOCK(sc); - } - if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) { + CAS_UNLOCK(sc); return; - else if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) + } else if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) taskqueue_enqueue(sc->sc_tq, &sc->sc_tx_task); + CAS_UNLOCK(sc); status = CAS_READ_4(sc, CAS_STATUS_ALIAS); if (__predict_false((status & CAS_INTR_SUMMARY) != 0)) { @@ -2408,7 +2411,7 @@ cas_mii_statchg(device_t dev) v |= CAS_MAC_XIF_CONF_FDXLED; CAS_WRITE_4(sc, CAS_MAC_XIF_CONF, v); - if ((sc->sc_ifp->if_drv_flags & IFF_DRV_RUNNING) != 0 && + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0 && (sc->sc_flags & CAS_LINK) != 0) { CAS_WRITE_4(sc, CAS_MAC_TX_CONF, txcfg | CAS_MAC_TX_CONF_EN); From owner-svn-src-stable@FreeBSD.ORG Mon Jul 25 19:13:51 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A0076106566C; Mon, 25 Jul 2011 19:13:51 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8EF728FC12; Mon, 25 Jul 2011 19:13:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PJDpdj073348; Mon, 25 Jul 2011 19:13:51 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PJDpkT073345; Mon, 25 Jul 2011 19:13:51 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251913.p6PJDpkT073345@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 19:13:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224397 - stable/7/sys/dev/cas X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 19:13:51 -0000 Author: marius Date: Mon Jul 25 19:13:51 2011 New Revision: 224397 URL: http://svn.freebsd.org/changeset/base/224397 Log: MFC: r223986 - Expand the scope of the lock in the interrupt routine to close races with checking IFF_DRV_RUNNING and simplify the code. This also involves holding the driver lock in the rx_ch callout. - Just use ifp instead of sc->sc_ifp. Submitted by: jhb (mostly) Modified: stable/7/sys/dev/cas/if_cas.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/cas/if_cas.c ============================================================================== --- stable/7/sys/dev/cas/if_cas.c Mon Jul 25 19:13:51 2011 (r224396) +++ stable/7/sys/dev/cas/if_cas.c Mon Jul 25 19:13:51 2011 (r224397) @@ -203,7 +203,7 @@ cas_attach(struct cas_softc *sc) IFQ_SET_READY(&ifp->if_snd); callout_init_mtx(&sc->sc_tick_ch, &sc->sc_mtx, 0); - callout_init(&sc->sc_rx_ch, 1); + callout_init_mtx(&sc->sc_rx_ch, &sc->sc_mtx, 0); /* Create local taskq. */ TASK_INIT(&sc->sc_intr_task, 0, cas_intr_task, sc); TASK_INIT(&sc->sc_tx_task, 1, cas_tx_task, ifp); @@ -1597,7 +1597,7 @@ cas_rint_timeout(void *arg) { struct cas_softc *sc = arg; - CAS_LOCK_ASSERT(sc, MA_NOTOWNED); + CAS_LOCK_ASSERT(sc, MA_OWNED); cas_rint(sc); } @@ -1612,7 +1612,7 @@ cas_rint(struct cas_softc *sc) uint32_t rxhead; u_int idx, idx2, len, off, skip; - CAS_LOCK_ASSERT(sc, MA_NOTOWNED); + CAS_LOCK_ASSERT(sc, MA_OWNED); callout_stop(&sc->sc_rx_ch); @@ -1740,7 +1740,9 @@ cas_rint(struct cas_softc *sc) cas_rxcksum(m, CAS_GET(word4, CAS_RC4_TCP_CSUM)); /* Pass it on. */ + CAS_UNLOCK(sc); (*ifp->if_input)(ifp, m); + CAS_LOCK(sc); } else ifp->if_ierrors++; @@ -1836,7 +1838,9 @@ cas_rint(struct cas_softc *sc) cas_rxcksum(m, CAS_GET(word4, CAS_RC4_TCP_CSUM)); /* Pass it on. */ + CAS_UNLOCK(sc); (*ifp->if_input)(ifp, m); + CAS_LOCK(sc); } else ifp->if_ierrors++; @@ -1874,7 +1878,7 @@ cas_free(void *arg1, void *arg2) { struct cas_rxdsoft *rxds; struct cas_softc *sc; - u_int idx; + u_int idx, locked; #if __FreeBSD_version < 800016 rxds = arg2; @@ -1892,17 +1896,18 @@ cas_free(void *arg1, void *arg2) * NB: this function can be called via m_freem(9) within * this driver! */ - + if ((locked = CAS_LOCK_OWNED(sc)) == 0) + CAS_LOCK(sc); cas_add_rxdesc(sc, idx); + if (locked == 0) + CAS_UNLOCK(sc); } static inline void cas_add_rxdesc(struct cas_softc *sc, u_int idx) { - u_int locked; - if ((locked = CAS_LOCK_OWNED(sc)) == 0) - CAS_LOCK(sc); + CAS_LOCK_ASSERT(sc, MA_OWNED); bus_dmamap_sync(sc->sc_rdmatag, sc->sc_rxdsoft[idx].rxds_dmamap, BUS_DMASYNC_PREREAD); @@ -1920,9 +1925,6 @@ cas_add_rxdesc(struct cas_softc *sc, u_i CAS_WRITE_4(sc, CAS_RX_KICK, (sc->sc_rxdptr + CAS_NRXDESC - 4) & CAS_NRXDESC_MASK); } - - if (locked == 0) - CAS_UNLOCK(sc); } static void @@ -1930,7 +1932,7 @@ cas_eint(struct cas_softc *sc, u_int sta { struct ifnet *ifp = sc->sc_ifp; - CAS_LOCK_ASSERT(sc, MA_NOTOWNED); + CAS_LOCK_ASSERT(sc, MA_OWNED); ifp->if_ierrors++; @@ -1947,7 +1949,7 @@ cas_eint(struct cas_softc *sc, u_int sta printf("\n"); ifp->if_drv_flags &= ~IFF_DRV_RUNNING; - cas_init(sc); + cas_init_locked(sc); if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) taskqueue_enqueue(sc->sc_tq, &sc->sc_tx_task); } @@ -1984,6 +1986,7 @@ cas_intr_task(void *arg, int pending __u if (__predict_false((status & CAS_INTR_SUMMARY) == 0)) goto done; + CAS_LOCK(sc); #ifdef CAS_DEBUG CTR4(KTR_CAS, "%s: %s: cplt %x, status %x", device_get_name(sc->sc_dev), __func__, @@ -2023,6 +2026,7 @@ cas_intr_task(void *arg, int pending __u (CAS_INTR_TX_TAG_ERR | CAS_INTR_RX_TAG_ERR | CAS_INTR_RX_LEN_MMATCH | CAS_INTR_PCI_ERROR_INT)) != 0)) { cas_eint(sc, status); + CAS_UNLOCK(sc); return; } @@ -2030,7 +2034,7 @@ cas_intr_task(void *arg, int pending __u status2 = CAS_READ_4(sc, CAS_MAC_TX_STATUS); if ((status2 & (CAS_MAC_TX_UNDERRUN | CAS_MAC_TX_MAX_PKT_ERR)) != 0) - sc->sc_ifp->if_oerrors++; + ifp->if_oerrors++; else if ((status2 & ~CAS_MAC_TX_FRAME_XMTD) != 0) device_printf(sc->sc_dev, "MAC TX fault, status %x\n", status2); @@ -2039,7 +2043,7 @@ cas_intr_task(void *arg, int pending __u if (__predict_false(status & CAS_INTR_RX_MAC_INT)) { status2 = CAS_READ_4(sc, CAS_MAC_RX_STATUS); if ((status2 & CAS_MAC_RX_OVERFLOW) != 0) - sc->sc_ifp->if_ierrors++; + ifp->if_ierrors++; else if ((status2 & ~CAS_MAC_RX_FRAME_RCVD) != 0) device_printf(sc->sc_dev, "MAC RX fault, status %x\n", status2); @@ -2059,16 +2063,15 @@ cas_intr_task(void *arg, int pending __u } if ((status & - (CAS_INTR_TX_INT_ME | CAS_INTR_TX_ALL | CAS_INTR_TX_DONE)) != 0) { - CAS_LOCK(sc); + (CAS_INTR_TX_INT_ME | CAS_INTR_TX_ALL | CAS_INTR_TX_DONE)) != 0) cas_tint(sc); - CAS_UNLOCK(sc); - } - if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) { + CAS_UNLOCK(sc); return; - else if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) + } else if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) taskqueue_enqueue(sc->sc_tq, &sc->sc_tx_task); + CAS_UNLOCK(sc); status = CAS_READ_4(sc, CAS_STATUS_ALIAS); if (__predict_false((status & CAS_INTR_SUMMARY) != 0)) { @@ -2408,7 +2411,7 @@ cas_mii_statchg(device_t dev) v |= CAS_MAC_XIF_CONF_FDXLED; CAS_WRITE_4(sc, CAS_MAC_XIF_CONF, v); - if ((sc->sc_ifp->if_drv_flags & IFF_DRV_RUNNING) != 0 && + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0 && (sc->sc_flags & CAS_LINK) != 0) { CAS_WRITE_4(sc, CAS_MAC_TX_CONF, txcfg | CAS_MAC_TX_CONF_EN); From owner-svn-src-stable@FreeBSD.ORG Mon Jul 25 20:06:19 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5122E1065670; Mon, 25 Jul 2011 20:06:19 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3F45F8FC08; Mon, 25 Jul 2011 20:06:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PK6Jtv074980; Mon, 25 Jul 2011 20:06:19 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PK6JKD074976; Mon, 25 Jul 2011 20:06:19 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201107252006.p6PK6JKD074976@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 25 Jul 2011 20:06:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224398 - in stable/8/sys/dev/usb: . net X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 20:06:19 -0000 Author: yongari Date: Mon Jul 25 20:06:18 2011 New Revision: 224398 URL: http://svn.freebsd.org/changeset/base/224398 Log: MFC r224020: Add initial support for AX88772B USB Fast Ethernet. AX88772B supports IPv4/IPv6 checksum offloading and VLAN tag insertion/ stripping as well as WOL. Because uether does not provide a way to announce driver specific offload capabilities to upper stack, checksum offloading support needs more work and will be done in future. Special thanks to ASIX for donating sample hardware. H/W donated by: ASIX Electronics Reviewed by: hselasky Modified: stable/8/sys/dev/usb/net/if_axe.c stable/8/sys/dev/usb/net/if_axereg.h stable/8/sys/dev/usb/usbdevs Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/geom/label/ (props changed) Modified: stable/8/sys/dev/usb/net/if_axe.c ============================================================================== --- stable/8/sys/dev/usb/net/if_axe.c Mon Jul 25 19:13:51 2011 (r224397) +++ stable/8/sys/dev/usb/net/if_axe.c Mon Jul 25 20:06:18 2011 (r224398) @@ -142,6 +142,7 @@ static const STRUCT_USB_HOST_ID axe_devs AXE_DEV(ASIX, AX88178, AXE_FLAG_178), AXE_DEV(ASIX, AX88772, AXE_FLAG_772), AXE_DEV(ASIX, AX88772A, AXE_FLAG_772A), + AXE_DEV(ASIX, AX88772B, AXE_FLAG_772B), AXE_DEV(ATEN, UC210T, 0), AXE_DEV(BELKIN, F5D5055, AXE_FLAG_178), AXE_DEV(BILLIONTON, USB2AR, 0), @@ -190,7 +191,9 @@ static void axe_ifmedia_sts(struct ifnet static int axe_cmd(struct axe_softc *, int, int, int, void *); static void axe_ax88178_init(struct axe_softc *); static void axe_ax88772_init(struct axe_softc *); +static void axe_ax88772_phywake(struct axe_softc *); static void axe_ax88772a_init(struct axe_softc *); +static void axe_ax88772b_init(struct axe_softc *); static int axe_get_phyno(struct axe_softc *, int); static const struct usb_config axe_config[AXE_N_TRANSFER] = { @@ -217,6 +220,17 @@ static const struct usb_config axe_confi }, }; +static const struct ax88772b_mfb ax88772b_mfb_table[] = { + { 0x8000, 0x8001, 2048 }, + { 0x8100, 0x8147, 4096}, + { 0x8200, 0x81EB, 6144}, + { 0x8300, 0x83D7, 8192}, + { 0x8400, 0x851E, 16384}, + { 0x8500, 0x8666, 20480}, + { 0x8600, 0x87AE, 24576}, + { 0x8700, 0x8A3D, 32768} +}; + static device_method_t axe_methods[] = { /* Device interface */ DEVMETHOD(device_probe, axe_probe), @@ -671,16 +685,11 @@ axe_ax88772_init(struct axe_softc *sc) } static void -axe_ax88772a_init(struct axe_softc *sc) +axe_ax88772_phywake(struct axe_softc *sc) { struct usb_ether *ue; - uint16_t eeprom; ue = &sc->sc_ue; - axe_cmd(sc, AXE_CMD_SROM_READ, 0, 0x0017, &eeprom); - eeprom = le16toh(eeprom); - /* Reload EEPROM. */ - AXE_GPIO_WRITE(AXE_GPIO_RELOAD_EEPROM, hz / 32); if (sc->sc_phyno == AXE_772_PHY_NO_EPHY) { /* Manually select internal(embedded) PHY - MAC mode. */ axe_cmd(sc, AXE_CMD_SW_PHY_SELECT, 0, AXE_SW_PHY_SELECT_SS_ENB | @@ -706,6 +715,55 @@ axe_ax88772a_init(struct axe_softc *sc) uether_pause(&sc->sc_ue, hz / 32); axe_cmd(sc, AXE_CMD_SW_RESET_REG, 0, AXE_SW_RESET_IPRL, NULL); uether_pause(&sc->sc_ue, hz / 32); +} + +static void +axe_ax88772a_init(struct axe_softc *sc) +{ + struct usb_ether *ue; + + ue = &sc->sc_ue; + /* Reload EEPROM. */ + AXE_GPIO_WRITE(AXE_GPIO_RELOAD_EEPROM, hz / 32); + axe_ax88772_phywake(sc); + /* Stop MAC. */ + axe_cmd(sc, AXE_CMD_RXCTL_WRITE, 0, 0, NULL); +} + +static void +axe_ax88772b_init(struct axe_softc *sc) +{ + struct usb_ether *ue; + uint16_t eeprom; + uint8_t *eaddr; + int i; + + ue = &sc->sc_ue; + /* Reload EEPROM. */ + AXE_GPIO_WRITE(AXE_GPIO_RELOAD_EEPROM, hz / 32); + /* + * Save PHY power saving configuration(high byte) and + * clear EEPROM checksum value(low byte). + */ + axe_cmd(sc, AXE_CMD_SROM_READ, 0, AXE_EEPROM_772B_PHY_PWRCFG, &eeprom); + sc->sc_pwrcfg = le16toh(eeprom) & 0xFF00; + + /* + * Auto-loaded default station address from internal ROM is + * 00:00:00:00:00:00 such that an explicit access to EEPROM + * is required to get real station address. + */ + eaddr = ue->ue_eaddr; + for (i = 0; i < ETHER_ADDR_LEN / 2; i++) { + axe_cmd(sc, AXE_CMD_SROM_READ, 0, AXE_EEPROM_772B_NODE_ID + i, + &eeprom); + eeprom = le16toh(eeprom); + *eaddr++ = (uint8_t)(eeprom & 0xFF); + *eaddr++ = (uint8_t)((eeprom >> 8) & 0xFF); + } + /* Wakeup PHY. */ + axe_ax88772_phywake(sc); + /* Stop MAC. */ axe_cmd(sc, AXE_CMD_RXCTL_WRITE, 0, 0, NULL); } @@ -734,6 +792,8 @@ axe_reset(struct axe_softc *sc) axe_ax88772_init(sc); else if (sc->sc_flags & AXE_FLAG_772A) axe_ax88772a_init(sc); + else if (sc->sc_flags & AXE_FLAG_772B) + axe_ax88772b_init(sc); } static void @@ -757,29 +817,29 @@ axe_attach_post(struct usb_ether *ue) sc->sc_phyno = 0; } + /* Initialize controller and get station address. */ if (sc->sc_flags & AXE_FLAG_178) { axe_ax88178_init(sc); sc->sc_tx_bufsz = 16 * 1024; + axe_cmd(sc, AXE_178_CMD_READ_NODEID, 0, 0, ue->ue_eaddr); } else if (sc->sc_flags & AXE_FLAG_772) { axe_ax88772_init(sc); sc->sc_tx_bufsz = 8 * 1024; + axe_cmd(sc, AXE_178_CMD_READ_NODEID, 0, 0, ue->ue_eaddr); } else if (sc->sc_flags & AXE_FLAG_772A) { axe_ax88772a_init(sc); sc->sc_tx_bufsz = 8 * 1024; - } - - /* - * Get station address. - */ - if (AXE_IS_178_FAMILY(sc)) axe_cmd(sc, AXE_178_CMD_READ_NODEID, 0, 0, ue->ue_eaddr); - else + } else if (sc->sc_flags & AXE_FLAG_772B) { + axe_ax88772b_init(sc); + sc->sc_tx_bufsz = 8 * 1024; + } else axe_cmd(sc, AXE_172_CMD_READ_NODEID, 0, 0, ue->ue_eaddr); /* * Fetch IPG values. */ - if (sc->sc_flags & AXE_FLAG_772A) { + if (sc->sc_flags & (AXE_FLAG_772A | AXE_FLAG_772B)) { /* Set IPG values. */ sc->sc_ipgs[0] = 0x15; sc->sc_ipgs[1] = 0x16; @@ -1106,18 +1166,30 @@ axe_init(struct usb_ether *ue) axe_cmd(sc, AXE_172_CMD_WRITE_IPG2, 0, sc->sc_ipgs[2], NULL); } - /* Enable receiver, set RX mode */ + /* AX88772B uses different maximum frame burst configuration. */ + if (sc->sc_flags & AXE_FLAG_772B) + axe_cmd(sc, AXE_772B_CMD_RXCTL_WRITE_CFG, + ax88772b_mfb_table[AX88772B_MFB_16K].threshold, + ax88772b_mfb_table[AX88772B_MFB_16K].byte_cnt, NULL); + + /* Enable receiver, set RX mode. */ rxmode = (AXE_RXCMD_MULTICAST | AXE_RXCMD_ENABLE); if (AXE_IS_178_FAMILY(sc)) { -#if 0 - rxmode |= AXE_178_RXCMD_MFB_2048; /* chip default */ -#else - /* - * Default Rx buffer size is too small to get - * maximum performance. - */ - rxmode |= AXE_178_RXCMD_MFB_16384; -#endif + if (sc->sc_flags & AXE_FLAG_772B) { + /* + * Select RX header format type 1. Aligning IP + * header on 4 byte boundary is not needed + * because we always copy the received frame in + * RX handler. + */ + rxmode |= AXE_772B_RXCMD_HDR_TYPE_1; + } else { + /* + * Default Rx buffer size is too small to get + * maximum performance. + */ + rxmode |= AXE_178_RXCMD_MFB_16384; + } } else { rxmode |= AXE_172_RXCMD_UNICAST; } Modified: stable/8/sys/dev/usb/net/if_axereg.h ============================================================================== --- stable/8/sys/dev/usb/net/if_axereg.h Mon Jul 25 19:13:51 2011 (r224397) +++ stable/8/sys/dev/usb/net/if_axereg.h Mon Jul 25 20:06:18 2011 (r224398) @@ -96,6 +96,8 @@ #define AXE_CMD_READ_VLAN_CTRL 0x4027 #define AXE_CMD_WRITE_VLAN_CTRL 0x4028 +#define AXE_772B_CMD_RXCTL_WRITE_CFG 0x012A + #define AXE_SW_RESET_CLEAR 0x00 #define AXE_SW_RESET_RR 0x01 #define AXE_SW_RESET_RT 0x02 @@ -132,12 +134,18 @@ #define AXE_178_RXCMD_KEEP_INVALID_CRC 0x0004 #define AXE_RXCMD_BROADCAST 0x0008 #define AXE_RXCMD_MULTICAST 0x0010 +#define AXE_RXCMD_ACCEPT_RUNT 0x0040 /* AX88772B */ #define AXE_RXCMD_ENABLE 0x0080 #define AXE_178_RXCMD_MFB_MASK 0x0300 #define AXE_178_RXCMD_MFB_2048 0x0000 #define AXE_178_RXCMD_MFB_4096 0x0100 #define AXE_178_RXCMD_MFB_8192 0x0200 #define AXE_178_RXCMD_MFB_16384 0x0300 +#define AXE_772B_RXCMD_HDR_TYPE_0 0x0000 +#define AXE_772B_RXCMD_HDR_TYPE_1 0x0100 +#define AXE_772B_RXCMD_IPHDR_ALIGN 0x0200 +#define AXE_772B_RXCMD_ADD_CHKSUM 0x0400 +#define AXE_RXCMD_LOOPBACK 0x1000 /* AX88772A/AX88772B */ #define AXE_PHY_SEL_PRI 1 #define AXE_PHY_SEL_SEC 0 @@ -176,7 +184,7 @@ #define AXE_PHY_MODE_REALTEK_8251CL 0x0E #define AXE_PHY_MODE_ATTANSIC 0x40 -/* AX88772A only. */ +/* AX88772A/AX88772B only. */ #define AXE_SW_PHY_SELECT_EXT 0x0000 #define AXE_SW_PHY_SELECT_EMBEDDED 0x0001 #define AXE_SW_PHY_SELECT_AUTO 0x0002 @@ -199,6 +207,24 @@ #define AXE_CONFIG_IDX 0 /* config number 1 */ #define AXE_IFACE_IDX 0 +/* EEPROM Map. */ +#define AXE_EEPROM_772B_NODE_ID 0x04 +#define AXE_EEPROM_772B_PHY_PWRCFG 0x18 + +struct ax88772b_mfb { + int byte_cnt; + int threshold; + int size; +}; +#define AX88772B_MFB_2K 0 +#define AX88772B_MFB_4K 1 +#define AX88772B_MFB_6K 2 +#define AX88772B_MFB_8K 3 +#define AX88772B_MFB_16K 4 +#define AX88772B_MFB_20K 5 +#define AX88772B_MFB_24K 6 +#define AX88772B_MFB_32K 7 + struct axe_sframe_hdr { uint16_t len; uint16_t ilen; @@ -228,6 +254,7 @@ struct axe_softc { uint8_t sc_ipgs[3]; uint8_t sc_phyaddrs[2]; + uint16_t sc_pwrcfg; int sc_tx_bufsz; }; Modified: stable/8/sys/dev/usb/usbdevs ============================================================================== --- stable/8/sys/dev/usb/usbdevs Mon Jul 25 19:13:51 2011 (r224397) +++ stable/8/sys/dev/usb/usbdevs Mon Jul 25 20:06:18 2011 (r224398) @@ -1043,6 +1043,7 @@ product ASIX AX88172 0x1720 10/100 Ethe product ASIX AX88178 0x1780 AX88178 product ASIX AX88772 0x7720 AX88772 product ASIX AX88772A 0x772a AX88772A USB 2.0 10/100 Ethernet +product ASIX AX88772B 0x772b AX88772B USB 2.0 10/100 Ethernet /* ASUS products */ product ASUS2 USBN11 0x0b05 USB-N11 From owner-svn-src-stable@FreeBSD.ORG Mon Jul 25 20:09:09 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C2C941065670; Mon, 25 Jul 2011 20:09:09 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B1B4C8FC1A; Mon, 25 Jul 2011 20:09:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PK99mx075119; Mon, 25 Jul 2011 20:09:09 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PK99q0075117; Mon, 25 Jul 2011 20:09:09 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201107252009.p6PK99q0075117@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 25 Jul 2011 20:09:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224399 - stable/8/share/man/man4 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 20:09:09 -0000 Author: yongari Date: Mon Jul 25 20:09:09 2011 New Revision: 224399 URL: http://svn.freebsd.org/changeset/base/224399 Log: MFC r224023,224060: Document AX88772B and AX88760. AX88760 is treated as AX88772A in driver. Mention all ASIX USB controllers that are supported by axe(4). Reword media types and explicly mention AX88178 is the only controller that supports gigabit link. While I'm here use shorten model instead of showing all controller model numbers. Modified: stable/8/share/man/man4/axe.4 Directory Properties: stable/8/share/man/man4/ (props changed) Modified: stable/8/share/man/man4/axe.4 ============================================================================== --- stable/8/share/man/man4/axe.4 Mon Jul 25 20:06:18 2011 (r224398) +++ stable/8/share/man/man4/axe.4 Mon Jul 25 20:09:09 2011 (r224399) @@ -30,12 +30,12 @@ .\" .\" $FreeBSD$ .\" -.Dd January 16, 2011 +.Dd July 14, 2011 .Dt AXE 4 .Os .Sh NAME .Nm axe -.Nd "ASIX Electronics AX88172/178/772 USB Ethernet driver" +.Nd "ASIX Electronics AX88x7x/760 USB Ethernet driver" .Sh SYNOPSIS To compile this driver into the kernel, place the following lines in your @@ -59,12 +59,14 @@ if_axe_load="YES" The .Nm driver provides support for USB Ethernet adapters based on the ASIX -Electronics AX88172, AX88178 and AX88772 USB 2.0 chipsets. +Electronics AX88172, AX88178, AX88772, AX88772A, AX88772B and AX88760 +USB 2.0 chipsets. .Pp -The AX88172 and AX88178 are USB 2.0 devices that contain a 10/100 +The AX88172, AX88772, AX88772A, AX88772B and AX88760 contain a 10/100 Ethernet MAC with MII interface and are designed to work with both Ethernet and HomePNA transceivers. -The AX88772 will additionally support 10/100/1000 MACs. +The AX88178 has a 10/100/1000 Ethernet MAC with GMII/RGMII interface +for interfacing with Gigabit Ethernet PHY. .Pp These devices will operate with both USB 1.x and USB 2.0 controllers, however performance with 1.x @@ -85,43 +87,48 @@ driver supports the following media type .It Cm autoselect Enable autoselection of the media type and options. The user can manually override -the autoselected mode by adding media options to the -.Pa /etc/rc.conf -file. +the autoselected mode by adding media options to +.Xr rc.conf 5 . .It Cm 10baseT/UTP Set 10Mbps operation. The +.Xr ifconfig 8 .Cm mediaopt -option can also be used to enable -.Cm full-duplex -operation. -Not specifying +option can also be used to select either .Cm full-duplex -implies +or .Cm half-duplex -mode. +modes. .It Cm 100baseTX Set 100Mbps (Fast Ethernet) operation. The +.Xr ifconfig 8 .Cm mediaopt -option can also be used to enable +option can also be used to select either .Cm full-duplex -operation. -Not specifying +or +.Cm half-duplex +modes. +.It Cm 1000baseT +Set 1000Mbps (Gigabit Ethernet) operation (AX88178 only). +The +.Xr ifconfig 8 +.Cm mediaopt +option can also be used to select either .Cm full-duplex -implies +or .Cm half-duplex -mode. +modes. .El .Pp The .Nm driver supports the following media options: -.Bl -tag -width ".Cm 10baseT/UTP" +.Bl -tag -width ".Cm full-duplex" .It Cm full-duplex Force full duplex operation. -The interface will operate in -half duplex mode if this media option is not specified. +.It Cm half-duplex +Force half duplex operation. .El .Pp For more information on configuring this device, see @@ -129,8 +136,8 @@ For more information on configuring this .Sh HARDWARE The .Nm -driver supports ASIX Electronics AX88172/AX88178/AX88772 based USB Ethernet -adapters including: +driver supports ASIX Electronics AX88172/AX88178/AX88772/AX88772A/AX88772B/AX88760 +based USB Ethernet adapters including: .Pp AX88172: .Bl -bullet -compact @@ -139,6 +146,8 @@ AboCom UF200 .It Acer Communications EP1427X2 .It +ASIX AX88172 +.It ATen UC210T .It Billionton SnapPort @@ -167,6 +176,8 @@ System TALKS Inc.\& SGC-X2UL AX88178: .Bl -bullet -compact .It +ASIX AX88178 +.It Belkin F5D5055 .It Logitec LAN-GTJ/U2A @@ -181,9 +192,9 @@ Sitecom Europe LN-028 AX88772: .Bl -bullet -compact .It -Buffalo (Melco Inc.) LUA3-U2-ATX +ASIX AX88772 .It -Cisco-Linksys USB200Mv2 +Buffalo (Melco Inc.) LUA3-U2-ATX .It D-Link DUBE100B1 .It @@ -191,6 +202,26 @@ Planex UE-200TX-G .It Planex UE-200TX-G2 .El +.Pp +AX88772A: +.Bl -bullet -compact +.It +ASIX AX88772A +.It +Cisco-Linksys USB200Mv2 +.El +.Pp +AX88772B: +.Bl -bullet -compact +.It +ASIX AX88772B +.El +.Pp +AX88760: +.Bl -bullet -compact +.It +ASIX AX88760 +.El .Sh DIAGNOSTICS .Bl -diag .It "axe%d: watchdog timeout" @@ -209,7 +240,7 @@ The driver failed to allocate an mbuf fo .Xr rgephy 4 , .Xr ifconfig 8 .Rs -.%T "ASIX AX88172 AX88178 and AX88772 data sheets" +.%T "ASIX AX88x7x and AX88760 data sheets" .%O http://www.asix.com.tw .Re .Sh HISTORY From owner-svn-src-stable@FreeBSD.ORG Mon Jul 25 20:12:31 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EE498106564A; Mon, 25 Jul 2011 20:12:31 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DD8968FC0A; Mon, 25 Jul 2011 20:12:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PKCVTF075334; Mon, 25 Jul 2011 20:12:31 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PKCVk1075332; Mon, 25 Jul 2011 20:12:31 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201107252012.p6PKCVk1075332@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 25 Jul 2011 20:12:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224401 - stable/8/sys/dev/gem X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 20:12:32 -0000 Author: yongari Date: Mon Jul 25 20:12:31 2011 New Revision: 224401 URL: http://svn.freebsd.org/changeset/base/224401 Log: MFC r224157: Revert r222135 by allowing controller reinitialization. Due to unknown reason Apple UniNorth2 gem(4) device required manual interface down/up operation after r222135. Even though this is not correct thing and I don't like to revert it but it would be better than breaking gem(4) on PPC. This should be revisited. PR: kern/157405 Modified: stable/8/sys/dev/gem/if_gem.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/geom/label/ (props changed) Modified: stable/8/sys/dev/gem/if_gem.c ============================================================================== --- stable/8/sys/dev/gem/if_gem.c Mon Jul 25 20:10:01 2011 (r224400) +++ stable/8/sys/dev/gem/if_gem.c Mon Jul 25 20:12:31 2011 (r224401) @@ -947,8 +947,10 @@ gem_init_locked(struct gem_softc *sc) GEM_LOCK_ASSERT(sc, MA_OWNED); +#ifdef notyet if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) return; +#endif #ifdef GEM_DEBUG CTR2(KTR_GEM, "%s: %s: calling stop", device_get_name(sc->sc_dev), From owner-svn-src-stable@FreeBSD.ORG Mon Jul 25 20:13:35 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D1471106566B; Mon, 25 Jul 2011 20:13:35 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C07BF8FC12; Mon, 25 Jul 2011 20:13:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PKDZgf075400; Mon, 25 Jul 2011 20:13:35 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PKDZ48075398; Mon, 25 Jul 2011 20:13:35 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201107252013.p6PKDZ48075398@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 25 Jul 2011 20:13:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224402 - stable/7/sys/dev/gem X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 20:13:35 -0000 Author: yongari Date: Mon Jul 25 20:13:35 2011 New Revision: 224402 URL: http://svn.freebsd.org/changeset/base/224402 Log: MFC r224157: Revert r222135 by allowing controller reinitialization. Due to unknown reason Apple UniNorth2 gem(4) device required manual interface down/up operation after r222135. Even though this is not correct thing and I don't like to revert it but it would be better than breaking gem(4) on PPC. This should be revisited. PR: kern/157405 Modified: stable/7/sys/dev/gem/if_gem.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/gem/if_gem.c ============================================================================== --- stable/7/sys/dev/gem/if_gem.c Mon Jul 25 20:12:31 2011 (r224401) +++ stable/7/sys/dev/gem/if_gem.c Mon Jul 25 20:13:35 2011 (r224402) @@ -947,8 +947,10 @@ gem_init_locked(struct gem_softc *sc) GEM_LOCK_ASSERT(sc, MA_OWNED); +#ifdef notyet if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) return; +#endif #ifdef GEM_DEBUG CTR2(KTR_GEM, "%s: %s: calling stop", device_get_name(sc->sc_dev), From owner-svn-src-stable@FreeBSD.ORG Mon Jul 25 21:37:53 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 06576106564A; Mon, 25 Jul 2011 21:37:53 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E96718FC0C; Mon, 25 Jul 2011 21:37:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PLbqQL077909; Mon, 25 Jul 2011 21:37:52 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PLbqd3077907; Mon, 25 Jul 2011 21:37:52 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107252137.p6PLbqd3077907@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 21:37:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224403 - stable/7/sys/boot/common X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 21:37:53 -0000 Author: marius Date: Mon Jul 25 21:37:52 2011 New Revision: 224403 URL: http://svn.freebsd.org/changeset/base/224403 Log: MFC: r192972 (partial) Some of the boot loader code only works on a ufs file system, but it uses the generic struct dirent, which happens to look identical to UFS's struct direct. If BSD ever changes dirent then this will be a problem. Submitted by: matthew dot fleming at isilon dot com Modified: stable/7/sys/boot/common/ufsread.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/boot/common/ufsread.c ============================================================================== --- stable/7/sys/boot/common/ufsread.c Mon Jul 25 20:13:35 2011 (r224402) +++ stable/7/sys/boot/common/ufsread.c Mon Jul 25 21:37:52 2011 (r224403) @@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include #ifdef UFS_SMALL_CGBASE /* XXX: Revert to old (broken for over 1.5Tb filesystems) version of cgbase @@ -93,7 +94,7 @@ static __inline int fsfind(const char *name, ino_t * ino) { char buf[DEV_BSIZE]; - struct dirent *d; + struct direct *d; char *s; ssize_t n; @@ -104,7 +105,7 @@ fsfind(const char *name, ino_t * ino) if (ls) printf("%s ", d->d_name); else if (!strcmp(name, d->d_name)) { - *ino = d->d_fileno; + *ino = d->d_ino; return d->d_type; } s += d->d_reclen; From owner-svn-src-stable@FreeBSD.ORG Mon Jul 25 21:39:09 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 76CA51065670; Mon, 25 Jul 2011 21:39:09 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 661FA8FC17; Mon, 25 Jul 2011 21:39:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PLd9DS078002; Mon, 25 Jul 2011 21:39:09 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PLd9jq078000; Mon, 25 Jul 2011 21:39:09 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107252139.p6PLd9jq078000@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 21:39:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224404 - stable/7/sys/boot/common X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 21:39:09 -0000 Author: marius Date: Mon Jul 25 21:39:09 2011 New Revision: 224404 URL: http://svn.freebsd.org/changeset/base/224404 Log: MFC: r211747 Replace structure assignments with explicity memcpy calls. This allows Clang to compile this file: it was using the builtin memcpy and we want to use the memcpy defined in gptboot.c. (Clang can't compile boot2 yet). Submitted by: Dimitry Andric Reviewed by: jhb Modified: stable/7/sys/boot/common/ufsread.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/boot/common/ufsread.c ============================================================================== --- stable/7/sys/boot/common/ufsread.c Mon Jul 25 21:37:52 2011 (r224403) +++ stable/7/sys/boot/common/ufsread.c Mon Jul 25 21:39:09 2011 (r224404) @@ -223,14 +223,19 @@ fsread(ino_t inode, void *buf, size_t nb return -1; n = INO_TO_VBO(n, inode); #if defined(UFS1_ONLY) - dp1 = ((struct ufs1_dinode *)blkbuf)[n]; + memcpy(&dp1, (struct ufs1_dinode *)blkbuf + n, + sizeof(struct ufs1_dinode)); #elif defined(UFS2_ONLY) - dp2 = ((struct ufs2_dinode *)blkbuf)[n]; + memcpy(&dp2, (struct ufs2_dinode *)blkbuf + n, + sizeof(struct ufs2_dinode)); #else if (fs->fs_magic == FS_UFS1_MAGIC) - dp1 = ((struct ufs1_dinode *)blkbuf)[n]; + memcpy(&dp1, (struct ufs1_dinode *)blkbuf + n, + sizeof(struct ufs1_dinode)); else - dp2 = ((struct ufs2_dinode *)blkbuf)[n]; + memcpy(&dp2, (struct ufs2_dinode *)blkbuf + n, + sizeof(struct ufs2_dinode)); + #endif inomap = inode; fs_off = 0; From owner-svn-src-stable@FreeBSD.ORG Mon Jul 25 21:41:46 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 905011065670; Mon, 25 Jul 2011 21:41:46 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 662CF8FC18; Mon, 25 Jul 2011 21:41:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PLfkKn078187; Mon, 25 Jul 2011 21:41:46 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PLfkqt078184; Mon, 25 Jul 2011 21:41:46 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107252141.p6PLfkqt078184@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 21:41:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224405 - in stable/7/sys/boot: common i386/boot2 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 21:41:46 -0000 Author: marius Date: Mon Jul 25 21:41:46 2011 New Revision: 224405 URL: http://svn.freebsd.org/changeset/base/224405 Log: MFC: r218713, r218716 Apply a few small optimizations to boot2's code, to make it shrink a little further. This gets us further on the way to be able to build it successfully with clang. Using in-tree gcc, this shrinks boot2.bin with 60 bytes, the in-tree clang shaves off 72 bytes, and ToT clang 84 bytes. Submitted by: rdivacky Reviewed by: imp Modified: stable/7/sys/boot/common/ufsread.c stable/7/sys/boot/i386/boot2/boot2.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/boot/common/ufsread.c ============================================================================== --- stable/7/sys/boot/common/ufsread.c Mon Jul 25 21:39:09 2011 (r224404) +++ stable/7/sys/boot/common/ufsread.c Mon Jul 25 21:41:46 2011 (r224405) @@ -122,7 +122,7 @@ lookup(const char *path) const char *s; ino_t ino; ssize_t n; - int dt; + uint8_t dt; ino = ROOTINO; dt = DT_DIR; Modified: stable/7/sys/boot/i386/boot2/boot2.c ============================================================================== --- stable/7/sys/boot/i386/boot2/boot2.c Mon Jul 25 21:39:09 2011 (r224404) +++ stable/7/sys/boot/i386/boot2/boot2.c Mon Jul 25 21:41:46 2011 (r224405) @@ -132,7 +132,7 @@ static struct dsk { } dsk; static char cmd[512], cmddup[512]; static char kname[1024]; -static uint32_t opts; +static uint16_t opts; static int comspeed = SIOSPD; static struct bootinfo bootinfo; static uint8_t ioctrl = IO_KEYBOARD; @@ -233,7 +233,7 @@ putc(int c) int main(void) { - int autoboot; + uint8_t autoboot; ino_t ino; dmadat = (void *)(roundup2(__base + (int32_t)&_end, 0x10000) - __base); @@ -320,7 +320,8 @@ load(void) caddr_t p; ino_t ino; uint32_t addr, x; - int fmt, i, j; + int i, j; + uint8_t fmt; if (!(ino = lookup(kname))) { if (!ls) From owner-svn-src-stable@FreeBSD.ORG Mon Jul 25 21:44:36 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 309771065670; Mon, 25 Jul 2011 21:44:36 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 062758FC12; Mon, 25 Jul 2011 21:44:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PLiZAH078325; Mon, 25 Jul 2011 21:44:35 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PLiZYx078322; Mon, 25 Jul 2011 21:44:35 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107252144.p6PLiZYx078322@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 21:44:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224406 - in stable/8/sys/boot: common i386/boot2 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 21:44:36 -0000 Author: marius Date: Mon Jul 25 21:44:35 2011 New Revision: 224406 URL: http://svn.freebsd.org/changeset/base/224406 Log: MFC: r218713, r218716 Apply a few small optimizations to boot2's code, to make it shrink a little further. This gets us further on the way to be able to build it successfully with clang. Using in-tree gcc, this shrinks boot2.bin with 60 bytes, the in-tree clang shaves off 72 bytes, and ToT clang 84 bytes. Submitted by: rdivacky Reviewed by: imp Modified: stable/8/sys/boot/common/ufsread.c stable/8/sys/boot/i386/boot2/boot2.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/geom/label/ (props changed) Modified: stable/8/sys/boot/common/ufsread.c ============================================================================== --- stable/8/sys/boot/common/ufsread.c Mon Jul 25 21:41:46 2011 (r224405) +++ stable/8/sys/boot/common/ufsread.c Mon Jul 25 21:44:35 2011 (r224406) @@ -122,7 +122,7 @@ lookup(const char *path) const char *s; ino_t ino; ssize_t n; - int dt; + uint8_t dt; ino = ROOTINO; dt = DT_DIR; Modified: stable/8/sys/boot/i386/boot2/boot2.c ============================================================================== --- stable/8/sys/boot/i386/boot2/boot2.c Mon Jul 25 21:41:46 2011 (r224405) +++ stable/8/sys/boot/i386/boot2/boot2.c Mon Jul 25 21:44:35 2011 (r224406) @@ -132,7 +132,7 @@ static struct dsk { } dsk; static char cmd[512], cmddup[512]; static char kname[1024]; -static uint32_t opts; +static uint16_t opts; static int comspeed = SIOSPD; static struct bootinfo bootinfo; static uint8_t ioctrl = IO_KEYBOARD; @@ -233,7 +233,7 @@ putc(int c) int main(void) { - int autoboot; + uint8_t autoboot; ino_t ino; dmadat = (void *)(roundup2(__base + (int32_t)&_end, 0x10000) - __base); @@ -320,7 +320,8 @@ load(void) caddr_t p; ino_t ino; uint32_t addr, x; - int fmt, i, j; + int i, j; + uint8_t fmt; if (!(ino = lookup(kname))) { if (!ls) From owner-svn-src-stable@FreeBSD.ORG Mon Jul 25 21:58:39 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8B8F4106564A; Mon, 25 Jul 2011 21:58:39 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7B0278FC16; Mon, 25 Jul 2011 21:58:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PLwdSi078878; Mon, 25 Jul 2011 21:58:39 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PLwdAl078876; Mon, 25 Jul 2011 21:58:39 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201107252158.p6PLwdAl078876@svn.freebsd.org> From: Jilles Tjoelker Date: Mon, 25 Jul 2011 21:58:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224409 - stable/8/share/skel X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 21:58:39 -0000 Author: jilles Date: Mon Jul 25 21:58:39 2011 New Revision: 224409 URL: http://svn.freebsd.org/changeset/base/224409 Log: MFC r222932: skel/.shrc: Improve commented CDPATH example for POSIX requirements. POSIX says an empty entry in CDPATH shall not result in the new directory being printed, while any non-empty entry shall result in the new directory being printed, including ".". Therefore, the value of CDPATH should almost always start with a colon, not dot and colon. Our sh does not print the name for empty entries as well as "." entries. Modified: stable/8/share/skel/dot.shrc Directory Properties: stable/8/share/skel/ (props changed) Modified: stable/8/share/skel/dot.shrc ============================================================================== --- stable/8/share/skel/dot.shrc Mon Jul 25 21:52:17 2011 (r224408) +++ stable/8/share/skel/dot.shrc Mon Jul 25 21:58:39 2011 (r224409) @@ -44,4 +44,4 @@ alias g='egrep -i' # esac # search path for cd(1) -# CDPATH=.:$HOME +# CDPATH=:$HOME From owner-svn-src-stable@FreeBSD.ORG Mon Jul 25 23:01:08 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 88CE1106564A; Mon, 25 Jul 2011 23:01:08 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 76B858FC0A; Mon, 25 Jul 2011 23:01:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PN18tM080863; Mon, 25 Jul 2011 23:01:08 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PN18tF080861; Mon, 25 Jul 2011 23:01:08 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107252301.p6PN18tF080861@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 23:01:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224410 - stable/7/sys/boot/common X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 23:01:08 -0000 Author: marius Date: Mon Jul 25 23:01:08 2011 New Revision: 224410 URL: http://svn.freebsd.org/changeset/base/224410 Log: MFC: r223938 Since r219452 the alignment of __dmadat has changed, revealing that fsread() bogusly casts its contents around causing alignment faults on sparc64 and most likely also on at least powerpc. Fix this by copying the contents bytewise instead as partly already done here. Solving this the right way costs some space, i.e. 148 bytes with GCC and 16 bytes with clang on x86 there are still some bytes left there though, and an acceptable hack which tricks the compiler into only using a 2-byte alignment instead of the native one when accessing the contents turned out to even take up more space that. Modified: stable/7/sys/boot/common/ufsread.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/boot/common/ufsread.c ============================================================================== --- stable/7/sys/boot/common/ufsread.c Mon Jul 25 21:58:39 2011 (r224409) +++ stable/7/sys/boot/common/ufsread.c Mon Jul 25 23:01:08 2011 (r224410) @@ -49,6 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include #include + #ifdef UFS_SMALL_CGBASE /* XXX: Revert to old (broken for over 1.5Tb filesystems) version of cgbase (see sys/ufs/ffs/fs.h rev 1.39) so that small boot loaders (e.g. boot2) can @@ -90,7 +91,7 @@ static ssize_t fsread(ino_t, void *, siz static int ls, dsk_meta; static uint32_t fs_off; -static __inline int +static __inline uint8_t fsfind(const char *name, ino_t * ino) { char buf[DEV_BSIZE]; @@ -160,7 +161,7 @@ static int sblock_try[] = SBLOCKSEARCH; #elif defined(UFS1_ONLY) #define DIP(field) dp1.field #else -#define DIP(field) fs->fs_magic == FS_UFS1_MAGIC ? dp1.field : dp2.field +#define DIP(field) fs.fs_magic == FS_UFS1_MAGIC ? dp1.field : dp2.field #endif static ssize_t @@ -175,7 +176,7 @@ fsread(ino_t inode, void *buf, size_t nb static ino_t inomap; char *blkbuf; void *indbuf; - struct fs *fs; + struct fs fs; char *s; size_t n, nb, size, off, vboff; ufs_lbn_t lbn; @@ -183,30 +184,29 @@ fsread(ino_t inode, void *buf, size_t nb static ufs2_daddr_t blkmap, indmap; u_int u; - blkbuf = dmadat->blkbuf; indbuf = dmadat->indbuf; - fs = (struct fs *)dmadat->sbbuf; if (!dsk_meta) { inomap = 0; for (n = 0; sblock_try[n] != -1; n++) { - if (dskread(fs, sblock_try[n] / DEV_BSIZE, + if (dskread(dmadat->sbbuf, sblock_try[n] / DEV_BSIZE, SBLOCKSIZE / DEV_BSIZE)) return -1; + memcpy(&fs, dmadat->sbbuf, sizeof(struct fs)); if (( #if defined(UFS1_ONLY) - fs->fs_magic == FS_UFS1_MAGIC + fs.fs_magic == FS_UFS1_MAGIC #elif defined(UFS2_ONLY) - (fs->fs_magic == FS_UFS2_MAGIC && - fs->fs_sblockloc == sblock_try[n]) + (fs.fs_magic == FS_UFS2_MAGIC && + fs.fs_sblockloc == sblock_try[n]) #else - fs->fs_magic == FS_UFS1_MAGIC || - (fs->fs_magic == FS_UFS2_MAGIC && - fs->fs_sblockloc == sblock_try[n]) + fs.fs_magic == FS_UFS1_MAGIC || + (fs.fs_magic == FS_UFS2_MAGIC && + fs.fs_sblockloc == sblock_try[n]) #endif ) && - fs->fs_bsize <= MAXBSIZE && - fs->fs_bsize >= sizeof(struct fs)) + fs.fs_bsize <= MAXBSIZE && + fs.fs_bsize >= sizeof(struct fs)) break; } if (sblock_try[n] == -1) { @@ -214,12 +214,13 @@ fsread(ino_t inode, void *buf, size_t nb return -1; } dsk_meta++; - } + } else + memcpy(&fs, dmadat->sbbuf, sizeof(struct fs)); if (!inode) return 0; if (inomap != inode) { - n = IPERVBLK(fs); - if (dskread(blkbuf, INO_TO_VBA(fs, n, inode), DBPERVBLK)) + n = IPERVBLK(&fs); + if (dskread(blkbuf, INO_TO_VBA(&fs, n, inode), DBPERVBLK)) return -1; n = INO_TO_VBO(n, inode); #if defined(UFS1_ONLY) @@ -229,13 +230,12 @@ fsread(ino_t inode, void *buf, size_t nb memcpy(&dp2, (struct ufs2_dinode *)blkbuf + n, sizeof(struct ufs2_dinode)); #else - if (fs->fs_magic == FS_UFS1_MAGIC) + if (fs.fs_magic == FS_UFS1_MAGIC) memcpy(&dp1, (struct ufs1_dinode *)blkbuf + n, sizeof(struct ufs1_dinode)); else memcpy(&dp2, (struct ufs2_dinode *)blkbuf + n, sizeof(struct ufs2_dinode)); - #endif inomap = inode; fs_off = 0; @@ -248,15 +248,15 @@ fsread(ino_t inode, void *buf, size_t nb nbyte = n; nb = nbyte; while (nb) { - lbn = lblkno(fs, fs_off); - off = blkoff(fs, fs_off); + lbn = lblkno(&fs, fs_off); + off = blkoff(&fs, fs_off); if (lbn < NDADDR) { addr = DIP(di_db[lbn]); - } else if (lbn < NDADDR + NINDIR(fs)) { - n = INDIRPERVBLK(fs); + } else if (lbn < NDADDR + NINDIR(&fs)) { + n = INDIRPERVBLK(&fs); addr = DIP(di_ib[0]); u = (u_int)(lbn - NDADDR) / n * DBPERVBLK; - vbaddr = fsbtodb(fs, addr) + u; + vbaddr = fsbtodb(&fs, addr) + u; if (indmap != vbaddr) { if (dskread(indbuf, vbaddr, DBPERVBLK)) return -1; @@ -264,21 +264,25 @@ fsread(ino_t inode, void *buf, size_t nb } n = (lbn - NDADDR) & (n - 1); #if defined(UFS1_ONLY) - addr = ((ufs1_daddr_t *)indbuf)[n]; + memcpy(&addr, (ufs1_daddr_t *)indbuf + n, + sizeof(ufs1_daddr_t)); #elif defined(UFS2_ONLY) - addr = ((ufs2_daddr_t *)indbuf)[n]; + memcpy(&addr, (ufs2_daddr_t *)indbuf + n, + sizeof(ufs2_daddr_t)); #else - if (fs->fs_magic == FS_UFS1_MAGIC) - addr = ((ufs1_daddr_t *)indbuf)[n]; + if (fs.fs_magic == FS_UFS1_MAGIC) + memcpy(&addr, (ufs1_daddr_t *)indbuf + n, + sizeof(ufs1_daddr_t)); else - addr = ((ufs2_daddr_t *)indbuf)[n]; + memcpy(&addr, (ufs2_daddr_t *)indbuf + n, + sizeof(ufs2_daddr_t)); #endif } else { return -1; } - vbaddr = fsbtodb(fs, addr) + (off >> VBLKSHIFT) * DBPERVBLK; + vbaddr = fsbtodb(&fs, addr) + (off >> VBLKSHIFT) * DBPERVBLK; vboff = off & VBLKMASK; - n = sblksize(fs, size, lbn) - (off & ~VBLKMASK); + n = sblksize(&fs, size, lbn) - (off & ~VBLKMASK); if (n > VBLKSIZE) n = VBLKSIZE; if (blkmap != vbaddr) { From owner-svn-src-stable@FreeBSD.ORG Mon Jul 25 23:01:09 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2521F1065672; Mon, 25 Jul 2011 23:01:09 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 132F48FC12; Mon, 25 Jul 2011 23:01:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PN18sI080885; Mon, 25 Jul 2011 23:01:08 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PN189D080883; Mon, 25 Jul 2011 23:01:08 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107252301.p6PN189D080883@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 23:01:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224411 - stable/8/sys/boot/common X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 23:01:09 -0000 Author: marius Date: Mon Jul 25 23:01:08 2011 New Revision: 224411 URL: http://svn.freebsd.org/changeset/base/224411 Log: MFC: r223938 Since r219452 the alignment of __dmadat has changed, revealing that fsread() bogusly casts its contents around causing alignment faults on sparc64 and most likely also on at least powerpc. Fix this by copying the contents bytewise instead as partly already done here. Solving this the right way costs some space, i.e. 148 bytes with GCC and 16 bytes with clang on x86 there are still some bytes left there though, and an acceptable hack which tricks the compiler into only using a 2-byte alignment instead of the native one when accessing the contents turned out to even take up more space that. Modified: stable/8/sys/boot/common/ufsread.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/geom/label/ (props changed) Modified: stable/8/sys/boot/common/ufsread.c ============================================================================== --- stable/8/sys/boot/common/ufsread.c Mon Jul 25 23:01:08 2011 (r224410) +++ stable/8/sys/boot/common/ufsread.c Mon Jul 25 23:01:08 2011 (r224411) @@ -49,6 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include #include + #ifdef UFS_SMALL_CGBASE /* XXX: Revert to old (broken for over 1.5Tb filesystems) version of cgbase (see sys/ufs/ffs/fs.h rev 1.39) so that small boot loaders (e.g. boot2) can @@ -90,7 +91,7 @@ static ssize_t fsread(ino_t, void *, siz static int ls, dsk_meta; static uint32_t fs_off; -static __inline int +static __inline uint8_t fsfind(const char *name, ino_t * ino) { char buf[DEV_BSIZE]; @@ -160,7 +161,7 @@ static int sblock_try[] = SBLOCKSEARCH; #elif defined(UFS1_ONLY) #define DIP(field) dp1.field #else -#define DIP(field) fs->fs_magic == FS_UFS1_MAGIC ? dp1.field : dp2.field +#define DIP(field) fs.fs_magic == FS_UFS1_MAGIC ? dp1.field : dp2.field #endif static ssize_t @@ -175,7 +176,7 @@ fsread(ino_t inode, void *buf, size_t nb static ino_t inomap; char *blkbuf; void *indbuf; - struct fs *fs; + struct fs fs; char *s; size_t n, nb, size, off, vboff; ufs_lbn_t lbn; @@ -183,30 +184,29 @@ fsread(ino_t inode, void *buf, size_t nb static ufs2_daddr_t blkmap, indmap; u_int u; - blkbuf = dmadat->blkbuf; indbuf = dmadat->indbuf; - fs = (struct fs *)dmadat->sbbuf; if (!dsk_meta) { inomap = 0; for (n = 0; sblock_try[n] != -1; n++) { - if (dskread(fs, sblock_try[n] / DEV_BSIZE, + if (dskread(dmadat->sbbuf, sblock_try[n] / DEV_BSIZE, SBLOCKSIZE / DEV_BSIZE)) return -1; + memcpy(&fs, dmadat->sbbuf, sizeof(struct fs)); if (( #if defined(UFS1_ONLY) - fs->fs_magic == FS_UFS1_MAGIC + fs.fs_magic == FS_UFS1_MAGIC #elif defined(UFS2_ONLY) - (fs->fs_magic == FS_UFS2_MAGIC && - fs->fs_sblockloc == sblock_try[n]) + (fs.fs_magic == FS_UFS2_MAGIC && + fs.fs_sblockloc == sblock_try[n]) #else - fs->fs_magic == FS_UFS1_MAGIC || - (fs->fs_magic == FS_UFS2_MAGIC && - fs->fs_sblockloc == sblock_try[n]) + fs.fs_magic == FS_UFS1_MAGIC || + (fs.fs_magic == FS_UFS2_MAGIC && + fs.fs_sblockloc == sblock_try[n]) #endif ) && - fs->fs_bsize <= MAXBSIZE && - fs->fs_bsize >= sizeof(struct fs)) + fs.fs_bsize <= MAXBSIZE && + fs.fs_bsize >= sizeof(struct fs)) break; } if (sblock_try[n] == -1) { @@ -214,12 +214,13 @@ fsread(ino_t inode, void *buf, size_t nb return -1; } dsk_meta++; - } + } else + memcpy(&fs, dmadat->sbbuf, sizeof(struct fs)); if (!inode) return 0; if (inomap != inode) { - n = IPERVBLK(fs); - if (dskread(blkbuf, INO_TO_VBA(fs, n, inode), DBPERVBLK)) + n = IPERVBLK(&fs); + if (dskread(blkbuf, INO_TO_VBA(&fs, n, inode), DBPERVBLK)) return -1; n = INO_TO_VBO(n, inode); #if defined(UFS1_ONLY) @@ -229,13 +230,12 @@ fsread(ino_t inode, void *buf, size_t nb memcpy(&dp2, (struct ufs2_dinode *)blkbuf + n, sizeof(struct ufs2_dinode)); #else - if (fs->fs_magic == FS_UFS1_MAGIC) + if (fs.fs_magic == FS_UFS1_MAGIC) memcpy(&dp1, (struct ufs1_dinode *)blkbuf + n, sizeof(struct ufs1_dinode)); else memcpy(&dp2, (struct ufs2_dinode *)blkbuf + n, sizeof(struct ufs2_dinode)); - #endif inomap = inode; fs_off = 0; @@ -248,15 +248,15 @@ fsread(ino_t inode, void *buf, size_t nb nbyte = n; nb = nbyte; while (nb) { - lbn = lblkno(fs, fs_off); - off = blkoff(fs, fs_off); + lbn = lblkno(&fs, fs_off); + off = blkoff(&fs, fs_off); if (lbn < NDADDR) { addr = DIP(di_db[lbn]); - } else if (lbn < NDADDR + NINDIR(fs)) { - n = INDIRPERVBLK(fs); + } else if (lbn < NDADDR + NINDIR(&fs)) { + n = INDIRPERVBLK(&fs); addr = DIP(di_ib[0]); u = (u_int)(lbn - NDADDR) / n * DBPERVBLK; - vbaddr = fsbtodb(fs, addr) + u; + vbaddr = fsbtodb(&fs, addr) + u; if (indmap != vbaddr) { if (dskread(indbuf, vbaddr, DBPERVBLK)) return -1; @@ -264,21 +264,25 @@ fsread(ino_t inode, void *buf, size_t nb } n = (lbn - NDADDR) & (n - 1); #if defined(UFS1_ONLY) - addr = ((ufs1_daddr_t *)indbuf)[n]; + memcpy(&addr, (ufs1_daddr_t *)indbuf + n, + sizeof(ufs1_daddr_t)); #elif defined(UFS2_ONLY) - addr = ((ufs2_daddr_t *)indbuf)[n]; + memcpy(&addr, (ufs2_daddr_t *)indbuf + n, + sizeof(ufs2_daddr_t)); #else - if (fs->fs_magic == FS_UFS1_MAGIC) - addr = ((ufs1_daddr_t *)indbuf)[n]; + if (fs.fs_magic == FS_UFS1_MAGIC) + memcpy(&addr, (ufs1_daddr_t *)indbuf + n, + sizeof(ufs1_daddr_t)); else - addr = ((ufs2_daddr_t *)indbuf)[n]; + memcpy(&addr, (ufs2_daddr_t *)indbuf + n, + sizeof(ufs2_daddr_t)); #endif } else { return -1; } - vbaddr = fsbtodb(fs, addr) + (off >> VBLKSHIFT) * DBPERVBLK; + vbaddr = fsbtodb(&fs, addr) + (off >> VBLKSHIFT) * DBPERVBLK; vboff = off & VBLKMASK; - n = sblksize(fs, size, lbn) - (off & ~VBLKMASK); + n = sblksize(&fs, size, lbn) - (off & ~VBLKMASK); if (n > VBLKSIZE) n = VBLKSIZE; if (blkmap != vbaddr) { From owner-svn-src-stable@FreeBSD.ORG Tue Jul 26 04:33:01 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3CBFC106566B; Tue, 26 Jul 2011 04:33:01 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 11A518FC0C; Tue, 26 Jul 2011 04:33:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6Q4X0R2091370; Tue, 26 Jul 2011 04:33:00 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6Q4X05A091358; Tue, 26 Jul 2011 04:33:00 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201107260433.p6Q4X05A091358@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Tue, 26 Jul 2011 04:33:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224414 - stable/8/sbin/newfs_msdos X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jul 2011 04:33:01 -0000 Author: ae Date: Tue Jul 26 04:33:00 2011 New Revision: 224414 URL: http://svn.freebsd.org/changeset/base/224414 Log: MFC r223945: Add SIGINFO handler. Obtained from: NetBSD (partly) MFC r223946: Use NULL instead of 0 for third argument of sigaction(2). Modified: stable/8/sbin/newfs_msdos/newfs_msdos.c Directory Properties: stable/8/sbin/newfs_msdos/ (props changed) Modified: stable/8/sbin/newfs_msdos/newfs_msdos.c ============================================================================== --- stable/8/sbin/newfs_msdos/newfs_msdos.c Tue Jul 26 04:00:00 2011 (r224413) +++ stable/8/sbin/newfs_msdos/newfs_msdos.c Tue Jul 26 04:33:00 2011 (r224414) @@ -44,6 +44,7 @@ static const char rcsid[] = #include #include #include +#include #include #include #include @@ -216,6 +217,9 @@ static const u_int8_t bootcode[] = { 0 }; +static volatile sig_atomic_t got_siginfo; +static void infohandler(int); + static void check_mounted(const char *, mode_t); static void getstdfmt(const char *, struct bpb *); static void getdiskinfo(int, const char *, const char *, int, @@ -243,6 +247,7 @@ main(int argc, char *argv[]) int opt_N = 0; int Iflag = 0, mflag = 0, oflag = 0; char buf[MAXPATHLEN]; + struct sigaction si_sa; struct stat sb; struct timeval tv; struct bpb bpb; @@ -604,7 +609,19 @@ main(int argc, char *argv[]) if (!(img = malloc(bpb.bpbBytesPerSec))) err(1, NULL); dir = bpb.bpbResSectors + (bpb.bpbFATsecs ? bpb.bpbFATsecs : bpb.bpbBigFATsecs) * bpb.bpbFATs; + memset(&si_sa, 0, sizeof(si_sa)); + si_sa.sa_handler = infohandler; + if (sigaction(SIGINFO, &si_sa, NULL) == -1) + err(1, "sigaction SIGINFO"); for (lsn = 0; lsn < dir + (fat == 32 ? bpb.bpbSecPerClust : rds); lsn++) { + if (got_siginfo) { + fprintf(stderr,"%s: writing sector %u of %u (%u%%)\n", + fname, lsn, + (dir + (fat == 32 ? bpb.bpbSecPerClust: rds)), + (lsn * 100) / (dir + + (fat == 32 ? bpb.bpbSecPerClust: rds))); + got_siginfo = 0; + } x = lsn; if (opt_B && fat == 32 && bpb.bpbBackup != MAXU16 && @@ -1017,3 +1034,10 @@ usage(void) "\t-u sectors/track\n"); exit(1); } + +static void +infohandler(int sig __unused) +{ + + got_siginfo = 1; +} From owner-svn-src-stable@FreeBSD.ORG Tue Jul 26 12:57:22 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BA3361065676; Tue, 26 Jul 2011 12:57:22 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 887B48FC18; Tue, 26 Jul 2011 12:57:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6QCvMZC008477; Tue, 26 Jul 2011 12:57:22 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6QCvMhI008475; Tue, 26 Jul 2011 12:57:22 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107261257.p6QCvMhI008475@svn.freebsd.org> From: Marius Strobl Date: Tue, 26 Jul 2011 12:57:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224416 - stable/7/sys/boot/pc98/boot2 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jul 2011 12:57:23 -0000 Author: marius Date: Tue Jul 26 12:57:22 2011 New Revision: 224416 URL: http://svn.freebsd.org/changeset/base/224416 Log: MFC: r212064, r212098 Use a cleaner expression to retrieve the memory size in pc98's boot2.c, which also avoids NULL pointer arithmetic, as suggested by jhb. The available space goes from 11 bytes to 7. Reviewed by: nyan Approved by: rpaulo (mentor) Modified: stable/7/sys/boot/pc98/boot2/boot2.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/boot/pc98/boot2/boot2.c ============================================================================== --- stable/7/sys/boot/pc98/boot2/boot2.c Tue Jul 26 10:50:33 2011 (r224415) +++ stable/7/sys/boot/pc98/boot2/boot2.c Tue Jul 26 12:57:22 2011 (r224416) @@ -187,9 +187,8 @@ xfsread(ino_t inode, void *buf, size_t n static inline uint32_t memsize(void) { - u_char *p = (u_char *)PTOV(0); - - return *(p + 0x401) * 128 * 1024 + *(u_int16_t *)(p + 0x594) * 1024 * 1024; + return (*(u_char *)PTOV(0x401) * 128 * 1024 + + *(uint16_t *)PTOV(0x594) * 1024 * 1024); } static inline void From owner-svn-src-stable@FreeBSD.ORG Tue Jul 26 12:57:23 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D11131065670; Tue, 26 Jul 2011 12:57:23 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C00768FC1E; Tue, 26 Jul 2011 12:57:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6QCvNu0008507; Tue, 26 Jul 2011 12:57:23 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6QCvNtk008505; Tue, 26 Jul 2011 12:57:23 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107261257.p6QCvNtk008505@svn.freebsd.org> From: Marius Strobl Date: Tue, 26 Jul 2011 12:57:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224417 - stable/8/sys/boot/pc98/boot2 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jul 2011 12:57:23 -0000 Author: marius Date: Tue Jul 26 12:57:23 2011 New Revision: 224417 URL: http://svn.freebsd.org/changeset/base/224417 Log: MFC: r212064, r212098 Use a cleaner expression to retrieve the memory size in pc98's boot2.c, which also avoids NULL pointer arithmetic, as suggested by jhb. The available space goes from 11 bytes to 7. Reviewed by: nyan Approved by: rpaulo (mentor) Modified: stable/8/sys/boot/pc98/boot2/boot2.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/geom/label/ (props changed) Modified: stable/8/sys/boot/pc98/boot2/boot2.c ============================================================================== --- stable/8/sys/boot/pc98/boot2/boot2.c Tue Jul 26 12:57:22 2011 (r224416) +++ stable/8/sys/boot/pc98/boot2/boot2.c Tue Jul 26 12:57:23 2011 (r224417) @@ -187,9 +187,8 @@ xfsread(ino_t inode, void *buf, size_t n static inline uint32_t memsize(void) { - u_char *p = (u_char *)PTOV(0); - - return *(p + 0x401) * 128 * 1024 + *(u_int16_t *)(p + 0x594) * 1024 * 1024; + return (*(u_char *)PTOV(0x401) * 128 * 1024 + + *(uint16_t *)PTOV(0x594) * 1024 * 1024); } static inline void From owner-svn-src-stable@FreeBSD.ORG Tue Jul 26 12:58:30 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4B6E9106567A; Tue, 26 Jul 2011 12:58:30 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3A5E28FC1F; Tue, 26 Jul 2011 12:58:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6QCwUoF008631; Tue, 26 Jul 2011 12:58:30 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6QCwUxq008629; Tue, 26 Jul 2011 12:58:30 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107261258.p6QCwUxq008629@svn.freebsd.org> From: Marius Strobl Date: Tue, 26 Jul 2011 12:58:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224418 - stable/8/sys/boot/pc98/boot2 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jul 2011 12:58:30 -0000 Author: marius Date: Tue Jul 26 12:58:29 2011 New Revision: 224418 URL: http://svn.freebsd.org/changeset/base/224418 Log: MFC: r214257 MFi386: revision 214210 Avoid using memcpy() for copying 32bit chunks. This shrinks the resulting code a little. Modified: stable/8/sys/boot/pc98/boot2/boot2.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/geom/label/ (props changed) Modified: stable/8/sys/boot/pc98/boot2/boot2.c ============================================================================== --- stable/8/sys/boot/pc98/boot2/boot2.c Tue Jul 26 12:57:23 2011 (r224417) +++ stable/8/sys/boot/pc98/boot2/boot2.c Tue Jul 26 12:58:29 2011 (r224418) @@ -485,7 +485,7 @@ load(void) return; p += hdr.ex.a_data + roundup2(hdr.ex.a_bss, PAGE_SIZE); bootinfo.bi_symtab = VTOP(p); - memcpy(p, &hdr.ex.a_syms, sizeof(hdr.ex.a_syms)); + *(uint32_t*)p = hdr.ex.a_syms; p += sizeof(hdr.ex.a_syms); if (hdr.ex.a_syms) { if (xfsread(ino, p, hdr.ex.a_syms)) @@ -522,7 +522,7 @@ load(void) if (xfsread(ino, &es, sizeof(es))) return; for (i = 0; i < 2; i++) { - memcpy(p, &es[i].sh_size, sizeof(es[i].sh_size)); + *(Elf32_Word *)p = es[i].sh_size; p += sizeof(es[i].sh_size); fs_off = es[i].sh_offset; if (xfsread(ino, p, es[i].sh_size)) From owner-svn-src-stable@FreeBSD.ORG Tue Jul 26 12:58:30 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5B50E106567D; Tue, 26 Jul 2011 12:58:30 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 428A98FC21; Tue, 26 Jul 2011 12:58:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6QCwUos008635; Tue, 26 Jul 2011 12:58:30 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6QCwUJk008633; Tue, 26 Jul 2011 12:58:30 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107261258.p6QCwUJk008633@svn.freebsd.org> From: Marius Strobl Date: Tue, 26 Jul 2011 12:58:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224419 - stable/7/sys/boot/pc98/boot2 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jul 2011 12:58:30 -0000 Author: marius Date: Tue Jul 26 12:58:29 2011 New Revision: 224419 URL: http://svn.freebsd.org/changeset/base/224419 Log: MFC: r214257 MFi386: revision 214210 Avoid using memcpy() for copying 32bit chunks. This shrinks the resulting code a little. Modified: stable/7/sys/boot/pc98/boot2/boot2.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/boot/pc98/boot2/boot2.c ============================================================================== --- stable/7/sys/boot/pc98/boot2/boot2.c Tue Jul 26 12:58:29 2011 (r224418) +++ stable/7/sys/boot/pc98/boot2/boot2.c Tue Jul 26 12:58:29 2011 (r224419) @@ -485,7 +485,7 @@ load(void) return; p += hdr.ex.a_data + roundup2(hdr.ex.a_bss, PAGE_SIZE); bootinfo.bi_symtab = VTOP(p); - memcpy(p, &hdr.ex.a_syms, sizeof(hdr.ex.a_syms)); + *(uint32_t*)p = hdr.ex.a_syms; p += sizeof(hdr.ex.a_syms); if (hdr.ex.a_syms) { if (xfsread(ino, p, hdr.ex.a_syms)) @@ -522,7 +522,7 @@ load(void) if (xfsread(ino, &es, sizeof(es))) return; for (i = 0; i < 2; i++) { - memcpy(p, &es[i].sh_size, sizeof(es[i].sh_size)); + *(Elf32_Word *)p = es[i].sh_size; p += sizeof(es[i].sh_size); fs_off = es[i].sh_offset; if (xfsread(ino, p, es[i].sh_size)) From owner-svn-src-stable@FreeBSD.ORG Tue Jul 26 13:01:14 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6B9DB1065673; Tue, 26 Jul 2011 13:01:14 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5AC778FC12; Tue, 26 Jul 2011 13:01:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6QD1E4M008853; Tue, 26 Jul 2011 13:01:14 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6QD1EVl008850; Tue, 26 Jul 2011 13:01:14 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107261301.p6QD1EVl008850@svn.freebsd.org> From: Marius Strobl Date: Tue, 26 Jul 2011 13:01:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224420 - stable/7/sys/boot/pc98/boot2 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jul 2011 13:01:14 -0000 Author: marius Date: Tue Jul 26 13:01:14 2011 New Revision: 224420 URL: http://svn.freebsd.org/changeset/base/224420 Log: MFC: r218737, r218946 MFi386: revision 218713 Apply a few small optimizations to boot2's code, to make it shrink a little further. Modified: stable/7/sys/boot/pc98/boot2/boot2.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/boot/pc98/boot2/boot2.c ============================================================================== --- stable/7/sys/boot/pc98/boot2/boot2.c Tue Jul 26 12:58:29 2011 (r224419) +++ stable/7/sys/boot/pc98/boot2/boot2.c Tue Jul 26 13:01:14 2011 (r224420) @@ -360,7 +360,7 @@ main(void) #ifdef GET_BIOSGEOM int i; #endif - int autoboot; + uint8_t autoboot; ino_t ino; dmadat = (void *)(roundup2(__base + (int32_t)&_end, 0x10000) - __base); @@ -457,7 +457,8 @@ load(void) caddr_t p; ino_t ino; uint32_t addr, x; - int fmt, i, j; + int i, j; + uint8_t fmt; if (!(ino = lookup(kname))) { if (!ls) From owner-svn-src-stable@FreeBSD.ORG Tue Jul 26 13:01:14 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B87B21065674; Tue, 26 Jul 2011 13:01:14 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A794D8FC13; Tue, 26 Jul 2011 13:01:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6QD1EKK008867; Tue, 26 Jul 2011 13:01:14 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6QD1EJ1008865; Tue, 26 Jul 2011 13:01:14 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107261301.p6QD1EJ1008865@svn.freebsd.org> From: Marius Strobl Date: Tue, 26 Jul 2011 13:01:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224421 - stable/8/sys/boot/pc98/boot2 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jul 2011 13:01:14 -0000 Author: marius Date: Tue Jul 26 13:01:14 2011 New Revision: 224421 URL: http://svn.freebsd.org/changeset/base/224421 Log: MFC: r218737, r218946 MFi386: revision 218713 Apply a few small optimizations to boot2's code, to make it shrink a little further. Modified: stable/8/sys/boot/pc98/boot2/boot2.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/geom/label/ (props changed) Modified: stable/8/sys/boot/pc98/boot2/boot2.c ============================================================================== --- stable/8/sys/boot/pc98/boot2/boot2.c Tue Jul 26 13:01:14 2011 (r224420) +++ stable/8/sys/boot/pc98/boot2/boot2.c Tue Jul 26 13:01:14 2011 (r224421) @@ -360,7 +360,7 @@ main(void) #ifdef GET_BIOSGEOM int i; #endif - int autoboot; + uint8_t autoboot; ino_t ino; dmadat = (void *)(roundup2(__base + (int32_t)&_end, 0x10000) - __base); @@ -457,7 +457,8 @@ load(void) caddr_t p; ino_t ino; uint32_t addr, x; - int fmt, i, j; + int i, j; + uint8_t fmt; if (!(ino = lookup(kname))) { if (!ls) From owner-svn-src-stable@FreeBSD.ORG Tue Jul 26 13:04:43 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D53511065674; Tue, 26 Jul 2011 13:04:43 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C3F2A8FC08; Tue, 26 Jul 2011 13:04:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6QD4hFg009026; Tue, 26 Jul 2011 13:04:43 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6QD4hU2009024; Tue, 26 Jul 2011 13:04:43 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107261304.p6QD4hU2009024@svn.freebsd.org> From: Marius Strobl Date: Tue, 26 Jul 2011 13:04:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224422 - stable/8/sys/boot/pc98/boot2 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jul 2011 13:04:43 -0000 Author: marius Date: Tue Jul 26 13:04:43 2011 New Revision: 224422 URL: http://svn.freebsd.org/changeset/base/224422 Log: MFC: r218842 MFi386: revision 218745 Remove reading of symbols from a.out loaded files. Modified: stable/8/sys/boot/pc98/boot2/boot2.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/geom/label/ (props changed) Modified: stable/8/sys/boot/pc98/boot2/boot2.c ============================================================================== --- stable/8/sys/boot/pc98/boot2/boot2.c Tue Jul 26 13:01:14 2011 (r224421) +++ stable/8/sys/boot/pc98/boot2/boot2.c Tue Jul 26 13:04:43 2011 (r224422) @@ -484,23 +484,6 @@ load(void) p += roundup2(hdr.ex.a_text, PAGE_SIZE); if (xfsread(ino, p, hdr.ex.a_data)) return; - p += hdr.ex.a_data + roundup2(hdr.ex.a_bss, PAGE_SIZE); - bootinfo.bi_symtab = VTOP(p); - *(uint32_t*)p = hdr.ex.a_syms; - p += sizeof(hdr.ex.a_syms); - if (hdr.ex.a_syms) { - if (xfsread(ino, p, hdr.ex.a_syms)) - return; - p += hdr.ex.a_syms; - if (xfsread(ino, p, sizeof(int))) - return; - x = *(uint32_t *)p; - p += sizeof(int); - x -= sizeof(int); - if (xfsread(ino, p, x)) - return; - p += x; - } } else { fs_off = hdr.eh.e_phoff; for (j = i = 0; i < hdr.eh.e_phnum && j < 2; i++) { @@ -532,8 +515,8 @@ load(void) } } addr = hdr.eh.e_entry & 0xffffff; + bootinfo.bi_esymtab = VTOP(p); } - bootinfo.bi_esymtab = VTOP(p); bootinfo.bi_kernelname = VTOP(kname); bootinfo.bi_bios_dev = dsk.daua; __exec((caddr_t)addr, RB_BOOTINFO | (opts & RBX_MASK), From owner-svn-src-stable@FreeBSD.ORG Tue Jul 26 13:04:48 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5E3B5106566C; Tue, 26 Jul 2011 13:04:48 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4D2FE8FC0A; Tue, 26 Jul 2011 13:04:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6QD4mrE009063; Tue, 26 Jul 2011 13:04:48 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6QD4mB6009061; Tue, 26 Jul 2011 13:04:48 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107261304.p6QD4mB6009061@svn.freebsd.org> From: Marius Strobl Date: Tue, 26 Jul 2011 13:04:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224423 - stable/7/sys/boot/pc98/boot2 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jul 2011 13:04:48 -0000 Author: marius Date: Tue Jul 26 13:04:48 2011 New Revision: 224423 URL: http://svn.freebsd.org/changeset/base/224423 Log: MFC: r218842 MFi386: revision 218745 Remove reading of symbols from a.out loaded files. Modified: stable/7/sys/boot/pc98/boot2/boot2.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/boot/pc98/boot2/boot2.c ============================================================================== --- stable/7/sys/boot/pc98/boot2/boot2.c Tue Jul 26 13:04:43 2011 (r224422) +++ stable/7/sys/boot/pc98/boot2/boot2.c Tue Jul 26 13:04:48 2011 (r224423) @@ -484,23 +484,6 @@ load(void) p += roundup2(hdr.ex.a_text, PAGE_SIZE); if (xfsread(ino, p, hdr.ex.a_data)) return; - p += hdr.ex.a_data + roundup2(hdr.ex.a_bss, PAGE_SIZE); - bootinfo.bi_symtab = VTOP(p); - *(uint32_t*)p = hdr.ex.a_syms; - p += sizeof(hdr.ex.a_syms); - if (hdr.ex.a_syms) { - if (xfsread(ino, p, hdr.ex.a_syms)) - return; - p += hdr.ex.a_syms; - if (xfsread(ino, p, sizeof(int))) - return; - x = *(uint32_t *)p; - p += sizeof(int); - x -= sizeof(int); - if (xfsread(ino, p, x)) - return; - p += x; - } } else { fs_off = hdr.eh.e_phoff; for (j = i = 0; i < hdr.eh.e_phnum && j < 2; i++) { @@ -532,8 +515,8 @@ load(void) } } addr = hdr.eh.e_entry & 0xffffff; + bootinfo.bi_esymtab = VTOP(p); } - bootinfo.bi_esymtab = VTOP(p); bootinfo.bi_kernelname = VTOP(kname); bootinfo.bi_bios_dev = dsk.daua; __exec((caddr_t)addr, RB_BOOTINFO | (opts & RBX_MASK), From owner-svn-src-stable@FreeBSD.ORG Tue Jul 26 13:06:20 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BAA42106564A; Tue, 26 Jul 2011 13:06:20 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9FF5D8FC1B; Tue, 26 Jul 2011 13:06:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6QD6KYm009180; Tue, 26 Jul 2011 13:06:20 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6QD6KNC009178; Tue, 26 Jul 2011 13:06:20 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107261306.p6QD6KNC009178@svn.freebsd.org> From: Marius Strobl Date: Tue, 26 Jul 2011 13:06:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224424 - stable/7/sys/boot/pc98/boot2 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jul 2011 13:06:20 -0000 Author: marius Date: Tue Jul 26 13:06:20 2011 New Revision: 224424 URL: http://svn.freebsd.org/changeset/base/224424 Log: MFC: r219225 MFi386: revision 219186 This patch shrinks boot2 a little. o It switches kname to be just a pointer instead of an array. o It changes ioctl to unsigned from uint8_t. o It changes the second keyhit limit to 3 seconds from 5. o It removes bi_basemem/bi_extmem/bi_memsizes_valid setting. Modified: stable/7/sys/boot/pc98/boot2/boot2.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/boot/pc98/boot2/boot2.c ============================================================================== --- stable/7/sys/boot/pc98/boot2/boot2.c Tue Jul 26 13:04:48 2011 (r224423) +++ stable/7/sys/boot/pc98/boot2/boot2.c Tue Jul 26 13:06:20 2011 (r224424) @@ -133,11 +133,11 @@ static struct dsk { unsigned start; } dsk; static char cmd[512], cmddup[512]; -static char kname[1024]; +static const char *kname = NULL; static uint32_t opts; static int comspeed = SIOSPD; static struct bootinfo bootinfo; -static uint8_t ioctrl = IO_KEYBOARD; +static unsigned ioctrl = IO_KEYBOARD; void exit(int); static void load(void); @@ -146,7 +146,6 @@ static int xfsread(ino_t, void *, size_t static int dskread(void *, unsigned, unsigned); static void printf(const char *,...); static void putchar(int); -static uint32_t memsize(void); static int drvread(void *, unsigned); static int keyhit(unsigned); static int xputc(int); @@ -184,13 +183,6 @@ xfsread(ino_t inode, void *buf, size_t n return 0; } -static inline uint32_t -memsize(void) -{ - return (*(u_char *)PTOV(0x401) * 128 * 1024 + - *(uint16_t *)PTOV(0x594) * 1024 * 1024); -} - static inline void getstr(void) { @@ -382,9 +374,6 @@ main(void) #endif bootinfo.bi_version = BOOTINFO_VERSION; bootinfo.bi_size = sizeof(bootinfo); - bootinfo.bi_basemem = 0; /* XXX will be filled by loader or kernel */ - bootinfo.bi_extmem = memsize(); - bootinfo.bi_memsizes_valid++; /* Process configuration file */ @@ -408,11 +397,11 @@ main(void) * or in case of failure, try to load a kernel directly instead. */ - if (autoboot && !*kname) { - memcpy(kname, PATH_BOOT3, sizeof(PATH_BOOT3)); + if (autoboot && !kname) { + kname = PATH_BOOT3; if (!keyhit(3*SECOND)) { load(); - memcpy(kname, PATH_KERNEL, sizeof(PATH_KERNEL)); + kname = PATH_KERNEL; } } @@ -427,7 +416,7 @@ main(void) 'a' + dsk.part, kname); if (ioctrl & IO_SERIAL) sio_flush(); - if (!autoboot || keyhit(5*SECOND)) + if (!autoboot || keyhit(3*SECOND)) getstr(); else if (!autoboot || !OPT_CHECK(RBX_QUIET)) putchar('\n'); @@ -611,11 +600,7 @@ parse() dsk.daua = dsk.disk | dsk.unit; dsk_meta = 0; } - if ((i = ep - arg)) { - if ((size_t)i >= sizeof(kname)) - return -1; - memcpy(kname, arg, i + 1); - } + kname = arg; } arg = p; } From owner-svn-src-stable@FreeBSD.ORG Tue Jul 26 13:06:22 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 51D211065670; Tue, 26 Jul 2011 13:06:22 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3753D8FC0A; Tue, 26 Jul 2011 13:06:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6QD6MtR009212; Tue, 26 Jul 2011 13:06:22 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6QD6Mp2009210; Tue, 26 Jul 2011 13:06:22 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107261306.p6QD6Mp2009210@svn.freebsd.org> From: Marius Strobl Date: Tue, 26 Jul 2011 13:06:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224425 - stable/8/sys/boot/pc98/boot2 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jul 2011 13:06:22 -0000 Author: marius Date: Tue Jul 26 13:06:21 2011 New Revision: 224425 URL: http://svn.freebsd.org/changeset/base/224425 Log: MFC: r219225 MFi386: revision 219186 This patch shrinks boot2 a little. o It switches kname to be just a pointer instead of an array. o It changes ioctl to unsigned from uint8_t. o It changes the second keyhit limit to 3 seconds from 5. o It removes bi_basemem/bi_extmem/bi_memsizes_valid setting. Modified: stable/8/sys/boot/pc98/boot2/boot2.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/geom/label/ (props changed) Modified: stable/8/sys/boot/pc98/boot2/boot2.c ============================================================================== --- stable/8/sys/boot/pc98/boot2/boot2.c Tue Jul 26 13:06:20 2011 (r224424) +++ stable/8/sys/boot/pc98/boot2/boot2.c Tue Jul 26 13:06:21 2011 (r224425) @@ -133,11 +133,11 @@ static struct dsk { unsigned start; } dsk; static char cmd[512], cmddup[512]; -static char kname[1024]; +static const char *kname = NULL; static uint32_t opts; static int comspeed = SIOSPD; static struct bootinfo bootinfo; -static uint8_t ioctrl = IO_KEYBOARD; +static unsigned ioctrl = IO_KEYBOARD; void exit(int); static void load(void); @@ -146,7 +146,6 @@ static int xfsread(ino_t, void *, size_t static int dskread(void *, unsigned, unsigned); static void printf(const char *,...); static void putchar(int); -static uint32_t memsize(void); static int drvread(void *, unsigned); static int keyhit(unsigned); static int xputc(int); @@ -184,13 +183,6 @@ xfsread(ino_t inode, void *buf, size_t n return 0; } -static inline uint32_t -memsize(void) -{ - return (*(u_char *)PTOV(0x401) * 128 * 1024 + - *(uint16_t *)PTOV(0x594) * 1024 * 1024); -} - static inline void getstr(void) { @@ -382,9 +374,6 @@ main(void) #endif bootinfo.bi_version = BOOTINFO_VERSION; bootinfo.bi_size = sizeof(bootinfo); - bootinfo.bi_basemem = 0; /* XXX will be filled by loader or kernel */ - bootinfo.bi_extmem = memsize(); - bootinfo.bi_memsizes_valid++; /* Process configuration file */ @@ -408,11 +397,11 @@ main(void) * or in case of failure, try to load a kernel directly instead. */ - if (autoboot && !*kname) { - memcpy(kname, PATH_BOOT3, sizeof(PATH_BOOT3)); + if (autoboot && !kname) { + kname = PATH_BOOT3; if (!keyhit(3*SECOND)) { load(); - memcpy(kname, PATH_KERNEL, sizeof(PATH_KERNEL)); + kname = PATH_KERNEL; } } @@ -427,7 +416,7 @@ main(void) 'a' + dsk.part, kname); if (ioctrl & IO_SERIAL) sio_flush(); - if (!autoboot || keyhit(5*SECOND)) + if (!autoboot || keyhit(3*SECOND)) getstr(); else if (!autoboot || !OPT_CHECK(RBX_QUIET)) putchar('\n'); @@ -611,11 +600,7 @@ parse() dsk.daua = dsk.disk | dsk.unit; dsk_meta = 0; } - if ((i = ep - arg)) { - if ((size_t)i >= sizeof(kname)) - return -1; - memcpy(kname, arg, i + 1); - } + kname = arg; } arg = p; } From owner-svn-src-stable@FreeBSD.ORG Tue Jul 26 13:12:08 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A4854106566B; Tue, 26 Jul 2011 13:12:08 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7A11F8FC16; Tue, 26 Jul 2011 13:12:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6QDC8Z3009486; Tue, 26 Jul 2011 13:12:08 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6QDC8AO009484; Tue, 26 Jul 2011 13:12:08 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107261312.p6QDC8AO009484@svn.freebsd.org> From: Marius Strobl Date: Tue, 26 Jul 2011 13:12:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224426 - stable/7/sys/boot/pc98/boot2 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jul 2011 13:12:08 -0000 Author: marius Date: Tue Jul 26 13:12:08 2011 New Revision: 224426 URL: http://svn.freebsd.org/changeset/base/224426 Log: MFC: r219960 MFi386: the part of 219452 - bunch of variables are turned into uint8_t. - the setting and reading of "fmt" in load() is removed. - buf in printf() is made static to save space. Modified: stable/7/sys/boot/pc98/boot2/boot2.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/boot/pc98/boot2/boot2.c ============================================================================== --- stable/7/sys/boot/pc98/boot2/boot2.c Tue Jul 26 13:06:21 2011 (r224425) +++ stable/7/sys/boot/pc98/boot2/boot2.c Tue Jul 26 13:12:08 2011 (r224426) @@ -137,7 +137,7 @@ static const char *kname = NULL; static uint32_t opts; static int comspeed = SIOSPD; static struct bootinfo bootinfo; -static unsigned ioctrl = IO_KEYBOARD; +static uint8_t ioctrl = IO_KEYBOARD; void exit(int); static void load(void); @@ -445,9 +445,8 @@ load(void) static Elf32_Shdr es[2]; caddr_t p; ino_t ino; - uint32_t addr, x; + uint32_t addr; int i, j; - uint8_t fmt; if (!(ino = lookup(kname))) { if (!ls) @@ -456,15 +455,8 @@ load(void) } if (xfsread(ino, &hdr, sizeof(hdr))) return; - if (N_GETMAGIC(hdr.ex) == ZMAGIC) - fmt = 0; - else if (IS_ELF(hdr.eh)) - fmt = 1; - else { - printf("Invalid %s\n", "format"); - return; - } - if (fmt == 0) { + + if (N_GETMAGIC(hdr.ex) == ZMAGIC) { addr = hdr.ex.a_entry & 0xffffff; p = PTOV(addr); fs_off = PAGE_SIZE; @@ -473,7 +465,7 @@ load(void) p += roundup2(hdr.ex.a_text, PAGE_SIZE); if (xfsread(ino, p, hdr.ex.a_data)) return; - } else { + } else if (IS_ELF(hdr.eh)) { fs_off = hdr.eh.e_phoff; for (j = i = 0; i < hdr.eh.e_phnum && j < 2; i++) { if (xfsread(ino, ep + j, sizeof(ep[0]))) @@ -505,7 +497,11 @@ load(void) } addr = hdr.eh.e_entry & 0xffffff; bootinfo.bi_esymtab = VTOP(p); + } else { + printf("Invalid %s\n", "format"); + return; } + bootinfo.bi_kernelname = VTOP(kname); bootinfo.bi_bios_dev = dsk.daua; __exec((caddr_t)addr, RB_BOOTINFO | (opts & RBX_MASK), @@ -672,7 +668,7 @@ static void printf(const char *fmt,...) { va_list ap; - char buf[10]; + static char buf[10]; char *s; unsigned u; int c; From owner-svn-src-stable@FreeBSD.ORG Tue Jul 26 13:12:10 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 066C9106564A; Tue, 26 Jul 2011 13:12:10 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D030A8FC14; Tue, 26 Jul 2011 13:12:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6QDC99d009519; Tue, 26 Jul 2011 13:12:09 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6QDC9Uw009517; Tue, 26 Jul 2011 13:12:09 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107261312.p6QDC9Uw009517@svn.freebsd.org> From: Marius Strobl Date: Tue, 26 Jul 2011 13:12:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224427 - stable/8/sys/boot/pc98/boot2 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jul 2011 13:12:10 -0000 Author: marius Date: Tue Jul 26 13:12:09 2011 New Revision: 224427 URL: http://svn.freebsd.org/changeset/base/224427 Log: MFC: r219960 MFi386: the part of 219452 - bunch of variables are turned into uint8_t. - the setting and reading of "fmt" in load() is removed. - buf in printf() is made static to save space. Modified: stable/8/sys/boot/pc98/boot2/boot2.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/geom/label/ (props changed) Modified: stable/8/sys/boot/pc98/boot2/boot2.c ============================================================================== --- stable/8/sys/boot/pc98/boot2/boot2.c Tue Jul 26 13:12:08 2011 (r224426) +++ stable/8/sys/boot/pc98/boot2/boot2.c Tue Jul 26 13:12:09 2011 (r224427) @@ -137,7 +137,7 @@ static const char *kname = NULL; static uint32_t opts; static int comspeed = SIOSPD; static struct bootinfo bootinfo; -static unsigned ioctrl = IO_KEYBOARD; +static uint8_t ioctrl = IO_KEYBOARD; void exit(int); static void load(void); @@ -445,9 +445,8 @@ load(void) static Elf32_Shdr es[2]; caddr_t p; ino_t ino; - uint32_t addr, x; + uint32_t addr; int i, j; - uint8_t fmt; if (!(ino = lookup(kname))) { if (!ls) @@ -456,15 +455,8 @@ load(void) } if (xfsread(ino, &hdr, sizeof(hdr))) return; - if (N_GETMAGIC(hdr.ex) == ZMAGIC) - fmt = 0; - else if (IS_ELF(hdr.eh)) - fmt = 1; - else { - printf("Invalid %s\n", "format"); - return; - } - if (fmt == 0) { + + if (N_GETMAGIC(hdr.ex) == ZMAGIC) { addr = hdr.ex.a_entry & 0xffffff; p = PTOV(addr); fs_off = PAGE_SIZE; @@ -473,7 +465,7 @@ load(void) p += roundup2(hdr.ex.a_text, PAGE_SIZE); if (xfsread(ino, p, hdr.ex.a_data)) return; - } else { + } else if (IS_ELF(hdr.eh)) { fs_off = hdr.eh.e_phoff; for (j = i = 0; i < hdr.eh.e_phnum && j < 2; i++) { if (xfsread(ino, ep + j, sizeof(ep[0]))) @@ -505,7 +497,11 @@ load(void) } addr = hdr.eh.e_entry & 0xffffff; bootinfo.bi_esymtab = VTOP(p); + } else { + printf("Invalid %s\n", "format"); + return; } + bootinfo.bi_kernelname = VTOP(kname); bootinfo.bi_bios_dev = dsk.daua; __exec((caddr_t)addr, RB_BOOTINFO | (opts & RBX_MASK), @@ -672,7 +668,7 @@ static void printf(const char *fmt,...) { va_list ap; - char buf[10]; + static char buf[10]; char *s; unsigned u; int c; From owner-svn-src-stable@FreeBSD.ORG Tue Jul 26 13:13:31 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D4177106566B; Tue, 26 Jul 2011 13:13:31 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C32E78FC0C; Tue, 26 Jul 2011 13:13:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6QDDVMV009643; Tue, 26 Jul 2011 13:13:31 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6QDDVIk009641; Tue, 26 Jul 2011 13:13:31 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107261313.p6QDDVIk009641@svn.freebsd.org> From: Marius Strobl Date: Tue, 26 Jul 2011 13:13:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224428 - stable/8/sys/boot/pc98/boot2 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jul 2011 13:13:31 -0000 Author: marius Date: Tue Jul 26 13:13:31 2011 New Revision: 224428 URL: http://svn.freebsd.org/changeset/base/224428 Log: MFC: r220685 MFi386: revisions 220389 and 220392 - Mark getc() as inline, this has no effect on gcc but helps clang. - Move getc() body before xgetc() so gcc does not emit a warning about function having no body. Modified: stable/8/sys/boot/pc98/boot2/boot2.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/geom/label/ (props changed) Modified: stable/8/sys/boot/pc98/boot2/boot2.c ============================================================================== --- stable/8/sys/boot/pc98/boot2/boot2.c Tue Jul 26 13:12:09 2011 (r224427) +++ stable/8/sys/boot/pc98/boot2/boot2.c Tue Jul 26 13:13:31 2011 (r224428) @@ -150,7 +150,7 @@ static int drvread(void *, unsigned); static int keyhit(unsigned); static int xputc(int); static int xgetc(int); -static int getc(int); +static inline int getc(int); static void memcpy(void *, const void *, int); static void @@ -779,6 +779,18 @@ xputc(int c) } static int +getc(int fn) +{ + v86.addr = 0x18; + v86.eax = fn << 8; + v86int(); + if (fn) + return (v86.ebx >> 8) & 0x01; + else + return v86.eax & 0xff; +} + +static int xgetc(int fn) { if (OPT_CHECK(RBX_NOINTR)) @@ -792,15 +804,3 @@ xgetc(int fn) return 0; } } - -static int -getc(int fn) -{ - v86.addr = 0x18; - v86.eax = fn << 8; - v86int(); - if (fn) - return (v86.ebx >> 8) & 0x01; - else - return v86.eax & 0xff; -} From owner-svn-src-stable@FreeBSD.ORG Tue Jul 26 13:13:32 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 45A971065678; Tue, 26 Jul 2011 13:13:32 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 34CC18FC13; Tue, 26 Jul 2011 13:13:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6QDDW4J009658; Tue, 26 Jul 2011 13:13:32 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6QDDWJ8009656; Tue, 26 Jul 2011 13:13:32 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107261313.p6QDDWJ8009656@svn.freebsd.org> From: Marius Strobl Date: Tue, 26 Jul 2011 13:13:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224429 - stable/7/sys/boot/pc98/boot2 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jul 2011 13:13:32 -0000 Author: marius Date: Tue Jul 26 13:13:31 2011 New Revision: 224429 URL: http://svn.freebsd.org/changeset/base/224429 Log: MFC: r220685 MFi386: revisions 220389 and 220392 - Mark getc() as inline, this has no effect on gcc but helps clang. - Move getc() body before xgetc() so gcc does not emit a warning about function having no body. Modified: stable/7/sys/boot/pc98/boot2/boot2.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/boot/pc98/boot2/boot2.c ============================================================================== --- stable/7/sys/boot/pc98/boot2/boot2.c Tue Jul 26 13:13:31 2011 (r224428) +++ stable/7/sys/boot/pc98/boot2/boot2.c Tue Jul 26 13:13:31 2011 (r224429) @@ -150,7 +150,7 @@ static int drvread(void *, unsigned); static int keyhit(unsigned); static int xputc(int); static int xgetc(int); -static int getc(int); +static inline int getc(int); static void memcpy(void *, const void *, int); static void @@ -779,6 +779,18 @@ xputc(int c) } static int +getc(int fn) +{ + v86.addr = 0x18; + v86.eax = fn << 8; + v86int(); + if (fn) + return (v86.ebx >> 8) & 0x01; + else + return v86.eax & 0xff; +} + +static int xgetc(int fn) { if (OPT_CHECK(RBX_NOINTR)) @@ -792,15 +804,3 @@ xgetc(int fn) return 0; } } - -static int -getc(int fn) -{ - v86.addr = 0x18; - v86.eax = fn << 8; - v86int(); - if (fn) - return (v86.ebx >> 8) & 0x01; - else - return v86.eax & 0xff; -} From owner-svn-src-stable@FreeBSD.ORG Tue Jul 26 13:19:58 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DD87A1065677; Tue, 26 Jul 2011 13:19:58 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 845EC8FC1B; Tue, 26 Jul 2011 13:19:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6QDJvqK009950; Tue, 26 Jul 2011 13:19:57 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6QDJvPR009948; Tue, 26 Jul 2011 13:19:57 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107261319.p6QDJvPR009948@svn.freebsd.org> From: Marius Strobl Date: Tue, 26 Jul 2011 13:19:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224430 - stable/7/sys/boot/i386/boot2 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jul 2011 13:20:03 -0000 Author: marius Date: Tue Jul 26 13:19:57 2011 New Revision: 224430 URL: http://svn.freebsd.org/changeset/base/224430 Log: MFC: r214210 Avoid using memcpy() for copying 32bit chunks. This shrinks the resulting code a little. Approved by: rpaulo (mentor) Reviewed by: jhb Modified: stable/7/sys/boot/i386/boot2/boot2.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/boot/i386/boot2/boot2.c ============================================================================== --- stable/7/sys/boot/i386/boot2/boot2.c Tue Jul 26 13:13:31 2011 (r224429) +++ stable/7/sys/boot/i386/boot2/boot2.c Tue Jul 26 13:19:57 2011 (r224430) @@ -349,7 +349,7 @@ load(void) return; p += hdr.ex.a_data + roundup2(hdr.ex.a_bss, PAGE_SIZE); bootinfo.bi_symtab = VTOP(p); - memcpy(p, &hdr.ex.a_syms, sizeof(hdr.ex.a_syms)); + *(uint32_t*)p = hdr.ex.a_syms; p += sizeof(hdr.ex.a_syms); if (hdr.ex.a_syms) { if (xfsread(ino, p, hdr.ex.a_syms)) @@ -386,7 +386,7 @@ load(void) if (xfsread(ino, &es, sizeof(es))) return; for (i = 0; i < 2; i++) { - memcpy(p, &es[i].sh_size, sizeof(es[i].sh_size)); + *(Elf32_Word *)p = es[i].sh_size; p += sizeof(es[i].sh_size); fs_off = es[i].sh_offset; if (xfsread(ino, p, es[i].sh_size)) From owner-svn-src-stable@FreeBSD.ORG Tue Jul 26 13:20:03 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DFC8B106567B; Tue, 26 Jul 2011 13:19:58 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8B50F8FC1D; Tue, 26 Jul 2011 13:19:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6QDJvYi009956; Tue, 26 Jul 2011 13:19:57 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6QDJvgC009952; Tue, 26 Jul 2011 13:19:57 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107261319.p6QDJvgC009952@svn.freebsd.org> From: Marius Strobl Date: Tue, 26 Jul 2011 13:19:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224431 - stable/8/sys/boot/i386/boot2 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jul 2011 13:20:03 -0000 Author: marius Date: Tue Jul 26 13:19:57 2011 New Revision: 224431 URL: http://svn.freebsd.org/changeset/base/224431 Log: MFC: r214210 Avoid using memcpy() for copying 32bit chunks. This shrinks the resulting code a little. Approved by: rpaulo (mentor) Reviewed by: jhb Modified: stable/8/sys/boot/i386/boot2/boot2.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/geom/label/ (props changed) Modified: stable/8/sys/boot/i386/boot2/boot2.c ============================================================================== --- stable/8/sys/boot/i386/boot2/boot2.c Tue Jul 26 13:19:57 2011 (r224430) +++ stable/8/sys/boot/i386/boot2/boot2.c Tue Jul 26 13:19:57 2011 (r224431) @@ -349,7 +349,7 @@ load(void) return; p += hdr.ex.a_data + roundup2(hdr.ex.a_bss, PAGE_SIZE); bootinfo.bi_symtab = VTOP(p); - memcpy(p, &hdr.ex.a_syms, sizeof(hdr.ex.a_syms)); + *(uint32_t*)p = hdr.ex.a_syms; p += sizeof(hdr.ex.a_syms); if (hdr.ex.a_syms) { if (xfsread(ino, p, hdr.ex.a_syms)) @@ -386,7 +386,7 @@ load(void) if (xfsread(ino, &es, sizeof(es))) return; for (i = 0; i < 2; i++) { - memcpy(p, &es[i].sh_size, sizeof(es[i].sh_size)); + *(Elf32_Word *)p = es[i].sh_size; p += sizeof(es[i].sh_size); fs_off = es[i].sh_offset; if (xfsread(ino, p, es[i].sh_size)) From owner-svn-src-stable@FreeBSD.ORG Tue Jul 26 13:22:13 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F32EF106566C; Tue, 26 Jul 2011 13:22:12 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C90E68FC0C; Tue, 26 Jul 2011 13:22:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6QDMCHl010116; Tue, 26 Jul 2011 13:22:12 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6QDMC2C010114; Tue, 26 Jul 2011 13:22:12 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107261322.p6QDMC2C010114@svn.freebsd.org> From: Marius Strobl Date: Tue, 26 Jul 2011 13:22:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224432 - stable/8/sys/boot/i386/boot2 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jul 2011 13:22:13 -0000 Author: marius Date: Tue Jul 26 13:22:12 2011 New Revision: 224432 URL: http://svn.freebsd.org/changeset/base/224432 Log: MFC: r218745 Remove reading of symbols from a.out loaded files. Since we are tight on space for clang and a.out support is only needed for /boot/loader, they are excess bytes that serve no useful purpose other than to support really old kernels (FreeBSD < 3.2 or so). Prefer clang support over support for these old kernels and remove this code. We gain about 100 bytes of space this way. Reviewed by: rdivacky@ Modified: stable/8/sys/boot/i386/boot2/boot2.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/geom/label/ (props changed) Modified: stable/8/sys/boot/i386/boot2/boot2.c ============================================================================== --- stable/8/sys/boot/i386/boot2/boot2.c Tue Jul 26 13:19:57 2011 (r224431) +++ stable/8/sys/boot/i386/boot2/boot2.c Tue Jul 26 13:22:12 2011 (r224432) @@ -347,23 +347,6 @@ load(void) p += roundup2(hdr.ex.a_text, PAGE_SIZE); if (xfsread(ino, p, hdr.ex.a_data)) return; - p += hdr.ex.a_data + roundup2(hdr.ex.a_bss, PAGE_SIZE); - bootinfo.bi_symtab = VTOP(p); - *(uint32_t*)p = hdr.ex.a_syms; - p += sizeof(hdr.ex.a_syms); - if (hdr.ex.a_syms) { - if (xfsread(ino, p, hdr.ex.a_syms)) - return; - p += hdr.ex.a_syms; - if (xfsread(ino, p, sizeof(int))) - return; - x = *(uint32_t *)p; - p += sizeof(int); - x -= sizeof(int); - if (xfsread(ino, p, x)) - return; - p += x; - } } else { fs_off = hdr.eh.e_phoff; for (j = i = 0; i < hdr.eh.e_phnum && j < 2; i++) { @@ -395,8 +378,8 @@ load(void) } } addr = hdr.eh.e_entry & 0xffffff; + bootinfo.bi_esymtab = VTOP(p); } - bootinfo.bi_esymtab = VTOP(p); bootinfo.bi_kernelname = VTOP(kname); bootinfo.bi_bios_dev = dsk.drive; __exec((caddr_t)addr, RB_BOOTINFO | (opts & RBX_MASK), From owner-svn-src-stable@FreeBSD.ORG Tue Jul 26 13:22:13 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A97CC1065670; Tue, 26 Jul 2011 13:22:13 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7F3438FC14; Tue, 26 Jul 2011 13:22:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6QDMDDA010139; Tue, 26 Jul 2011 13:22:13 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6QDMD3O010137; Tue, 26 Jul 2011 13:22:13 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107261322.p6QDMD3O010137@svn.freebsd.org> From: Marius Strobl Date: Tue, 26 Jul 2011 13:22:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224433 - stable/7/sys/boot/i386/boot2 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jul 2011 13:22:13 -0000 Author: marius Date: Tue Jul 26 13:22:13 2011 New Revision: 224433 URL: http://svn.freebsd.org/changeset/base/224433 Log: MFC: r218745 Remove reading of symbols from a.out loaded files. Since we are tight on space for clang and a.out support is only needed for /boot/loader, they are excess bytes that serve no useful purpose other than to support really old kernels (FreeBSD < 3.2 or so). Prefer clang support over support for these old kernels and remove this code. We gain about 100 bytes of space this way. Reviewed by: rdivacky@ Modified: stable/7/sys/boot/i386/boot2/boot2.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/boot/i386/boot2/boot2.c ============================================================================== --- stable/7/sys/boot/i386/boot2/boot2.c Tue Jul 26 13:22:12 2011 (r224432) +++ stable/7/sys/boot/i386/boot2/boot2.c Tue Jul 26 13:22:13 2011 (r224433) @@ -347,23 +347,6 @@ load(void) p += roundup2(hdr.ex.a_text, PAGE_SIZE); if (xfsread(ino, p, hdr.ex.a_data)) return; - p += hdr.ex.a_data + roundup2(hdr.ex.a_bss, PAGE_SIZE); - bootinfo.bi_symtab = VTOP(p); - *(uint32_t*)p = hdr.ex.a_syms; - p += sizeof(hdr.ex.a_syms); - if (hdr.ex.a_syms) { - if (xfsread(ino, p, hdr.ex.a_syms)) - return; - p += hdr.ex.a_syms; - if (xfsread(ino, p, sizeof(int))) - return; - x = *(uint32_t *)p; - p += sizeof(int); - x -= sizeof(int); - if (xfsread(ino, p, x)) - return; - p += x; - } } else { fs_off = hdr.eh.e_phoff; for (j = i = 0; i < hdr.eh.e_phnum && j < 2; i++) { @@ -395,8 +378,8 @@ load(void) } } addr = hdr.eh.e_entry & 0xffffff; + bootinfo.bi_esymtab = VTOP(p); } - bootinfo.bi_esymtab = VTOP(p); bootinfo.bi_kernelname = VTOP(kname); bootinfo.bi_bios_dev = dsk.drive; __exec((caddr_t)addr, RB_BOOTINFO | (opts & RBX_MASK), From owner-svn-src-stable@FreeBSD.ORG Tue Jul 26 13:23:26 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 20E391065670; Tue, 26 Jul 2011 13:23:26 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 102BC8FC26; Tue, 26 Jul 2011 13:23:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6QDNPj1010268; Tue, 26 Jul 2011 13:23:25 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6QDNPK4010265; Tue, 26 Jul 2011 13:23:25 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107261323.p6QDNPK4010265@svn.freebsd.org> From: Marius Strobl Date: Tue, 26 Jul 2011 13:23:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224434 - stable/8/sys/boot/i386/boot2 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jul 2011 13:23:26 -0000 Author: marius Date: Tue Jul 26 13:23:25 2011 New Revision: 224434 URL: http://svn.freebsd.org/changeset/base/224434 Log: MFC: r218926 In sys/boot/i386/boot2/boot2.c, change the type of the 'opts' variable from uint16_t back to uint32_t. The actual option bitmasks (RB_* and RBX_*) assume at least a 32 bit variable. Submitted by: rdivacky Modified: stable/8/sys/boot/i386/boot2/boot2.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/geom/label/ (props changed) Modified: stable/8/sys/boot/i386/boot2/boot2.c ============================================================================== --- stable/8/sys/boot/i386/boot2/boot2.c Tue Jul 26 13:22:13 2011 (r224433) +++ stable/8/sys/boot/i386/boot2/boot2.c Tue Jul 26 13:23:25 2011 (r224434) @@ -132,7 +132,7 @@ static struct dsk { } dsk; static char cmd[512], cmddup[512]; static char kname[1024]; -static uint16_t opts; +static uint32_t opts; static int comspeed = SIOSPD; static struct bootinfo bootinfo; static uint8_t ioctrl = IO_KEYBOARD; From owner-svn-src-stable@FreeBSD.ORG Tue Jul 26 13:23:26 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6FDBA1065673; Tue, 26 Jul 2011 13:23:26 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5F1FE8FC27; Tue, 26 Jul 2011 13:23:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6QDNQCf010282; Tue, 26 Jul 2011 13:23:26 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6QDNQQr010280; Tue, 26 Jul 2011 13:23:26 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107261323.p6QDNQQr010280@svn.freebsd.org> From: Marius Strobl Date: Tue, 26 Jul 2011 13:23:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224435 - stable/7/sys/boot/i386/boot2 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jul 2011 13:23:26 -0000 Author: marius Date: Tue Jul 26 13:23:26 2011 New Revision: 224435 URL: http://svn.freebsd.org/changeset/base/224435 Log: MFC: r218926 In sys/boot/i386/boot2/boot2.c, change the type of the 'opts' variable from uint16_t back to uint32_t. The actual option bitmasks (RB_* and RBX_*) assume at least a 32 bit variable. Submitted by: rdivacky Modified: stable/7/sys/boot/i386/boot2/boot2.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/boot/i386/boot2/boot2.c ============================================================================== --- stable/7/sys/boot/i386/boot2/boot2.c Tue Jul 26 13:23:25 2011 (r224434) +++ stable/7/sys/boot/i386/boot2/boot2.c Tue Jul 26 13:23:26 2011 (r224435) @@ -132,7 +132,7 @@ static struct dsk { } dsk; static char cmd[512], cmddup[512]; static char kname[1024]; -static uint16_t opts; +static uint32_t opts; static int comspeed = SIOSPD; static struct bootinfo bootinfo; static uint8_t ioctrl = IO_KEYBOARD; From owner-svn-src-stable@FreeBSD.ORG Tue Jul 26 13:24:52 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 84B76106566C; Tue, 26 Jul 2011 13:24:52 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 73B468FC13; Tue, 26 Jul 2011 13:24:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6QDOqox010414; Tue, 26 Jul 2011 13:24:52 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6QDOqKC010412; Tue, 26 Jul 2011 13:24:52 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107261324.p6QDOqKC010412@svn.freebsd.org> From: Marius Strobl Date: Tue, 26 Jul 2011 13:24:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224436 - stable/7/sys/boot/i386/boot2 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jul 2011 13:24:52 -0000 Author: marius Date: Tue Jul 26 13:24:52 2011 New Revision: 224436 URL: http://svn.freebsd.org/changeset/base/224436 Log: MFC: r219186 This patch shrinks boot2 a little. o It switches kname to be just a pointer instead of an array thus avoiding a couple of memcpy()s. o It changes ioctl to unsigned from uint8_t. o It changes the second keyhit limit to 3 seconds from 5 so that constant propagation can take place. o It changes the ticks overflow computation as suggested by bde@. o It removes bi_basemem/bi_extmem/bi_memsizes_valid setting from bootinfo as it is unused. Reviewed by: jhb Modified: stable/7/sys/boot/i386/boot2/boot2.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/boot/i386/boot2/boot2.c ============================================================================== --- stable/7/sys/boot/i386/boot2/boot2.c Tue Jul 26 13:23:26 2011 (r224435) +++ stable/7/sys/boot/i386/boot2/boot2.c Tue Jul 26 13:24:52 2011 (r224436) @@ -131,11 +131,11 @@ static struct dsk { int init; } dsk; static char cmd[512], cmddup[512]; -static char kname[1024]; +static const char *kname = NULL; static uint32_t opts; static int comspeed = SIOSPD; static struct bootinfo bootinfo; -static uint8_t ioctrl = IO_KEYBOARD; +static unsigned ioctrl = IO_KEYBOARD; void exit(int); static void load(void); @@ -144,7 +144,6 @@ static int xfsread(ino_t, void *, size_t static int dskread(void *, unsigned, unsigned); static void printf(const char *,...); static void putchar(int); -static uint32_t memsize(void); static int drvread(void *, unsigned, unsigned); static int keyhit(unsigned); static int xputc(int); @@ -182,15 +181,6 @@ xfsread(ino_t inode, void *buf, size_t n return 0; } -static inline uint32_t -memsize(void) -{ - v86.addr = MEM_EXT; - v86.eax = 0x8800; - v86int(); - return v86.eax; -} - static inline void getstr(void) { @@ -245,9 +235,6 @@ main(void) dsk.slice = *(uint8_t *)PTOV(ARGS + 1) + 1; bootinfo.bi_version = BOOTINFO_VERSION; bootinfo.bi_size = sizeof(bootinfo); - bootinfo.bi_basemem = 0; /* XXX will be filled by loader or kernel */ - bootinfo.bi_extmem = memsize(); - bootinfo.bi_memsizes_valid++; /* Process configuration file */ @@ -271,11 +258,11 @@ main(void) * or in case of failure, try to load a kernel directly instead. */ - if (autoboot && !*kname) { - memcpy(kname, PATH_BOOT3, sizeof(PATH_BOOT3)); + if (autoboot && !kname) { + kname = PATH_BOOT3; if (!keyhit(3*SECOND)) { load(); - memcpy(kname, PATH_KERNEL, sizeof(PATH_KERNEL)); + kname = PATH_KERNEL; } } @@ -290,7 +277,7 @@ main(void) 'a' + dsk.part, kname); if (ioctrl & IO_SERIAL) sio_flush(); - if (!autoboot || keyhit(5*SECOND)) + if (!autoboot || keyhit(3*SECOND)) getstr(); else if (!autoboot || !OPT_CHECK(RBX_QUIET)) putchar('\n'); @@ -474,11 +461,7 @@ parse() ? DRV_HARD : 0) + drv; dsk_meta = 0; } - if ((i = ep - arg)) { - if ((size_t)i >= sizeof(kname)) - return -1; - memcpy(kname, arg, i + 1); - } + kname = arg; } arg = p; } @@ -630,7 +613,7 @@ keyhit(unsigned ticks) t1 = *(uint32_t *)PTOV(0x46c); if (!t0) t0 = t1; - if (t1 < t0 || t1 >= t0 + ticks) + if ((uint32_t)(t1 - t0) >= ticks) return 0; } } From owner-svn-src-stable@FreeBSD.ORG Tue Jul 26 13:24:52 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9E1A21065670; Tue, 26 Jul 2011 13:24:52 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 89C1F8FC14; Tue, 26 Jul 2011 13:24:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6QDOqxb010418; Tue, 26 Jul 2011 13:24:52 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6QDOqMN010416; Tue, 26 Jul 2011 13:24:52 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107261324.p6QDOqMN010416@svn.freebsd.org> From: Marius Strobl Date: Tue, 26 Jul 2011 13:24:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224437 - stable/8/sys/boot/i386/boot2 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jul 2011 13:24:52 -0000 Author: marius Date: Tue Jul 26 13:24:52 2011 New Revision: 224437 URL: http://svn.freebsd.org/changeset/base/224437 Log: MFC: r219186 This patch shrinks boot2 a little. o It switches kname to be just a pointer instead of an array thus avoiding a couple of memcpy()s. o It changes ioctl to unsigned from uint8_t. o It changes the second keyhit limit to 3 seconds from 5 so that constant propagation can take place. o It changes the ticks overflow computation as suggested by bde@. o It removes bi_basemem/bi_extmem/bi_memsizes_valid setting from bootinfo as it is unused. Reviewed by: jhb Modified: stable/8/sys/boot/i386/boot2/boot2.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/geom/label/ (props changed) Modified: stable/8/sys/boot/i386/boot2/boot2.c ============================================================================== --- stable/8/sys/boot/i386/boot2/boot2.c Tue Jul 26 13:24:52 2011 (r224436) +++ stable/8/sys/boot/i386/boot2/boot2.c Tue Jul 26 13:24:52 2011 (r224437) @@ -131,11 +131,11 @@ static struct dsk { int init; } dsk; static char cmd[512], cmddup[512]; -static char kname[1024]; +static const char *kname = NULL; static uint32_t opts; static int comspeed = SIOSPD; static struct bootinfo bootinfo; -static uint8_t ioctrl = IO_KEYBOARD; +static unsigned ioctrl = IO_KEYBOARD; void exit(int); static void load(void); @@ -144,7 +144,6 @@ static int xfsread(ino_t, void *, size_t static int dskread(void *, unsigned, unsigned); static void printf(const char *,...); static void putchar(int); -static uint32_t memsize(void); static int drvread(void *, unsigned, unsigned); static int keyhit(unsigned); static int xputc(int); @@ -182,15 +181,6 @@ xfsread(ino_t inode, void *buf, size_t n return 0; } -static inline uint32_t -memsize(void) -{ - v86.addr = MEM_EXT; - v86.eax = 0x8800; - v86int(); - return v86.eax; -} - static inline void getstr(void) { @@ -245,9 +235,6 @@ main(void) dsk.slice = *(uint8_t *)PTOV(ARGS + 1) + 1; bootinfo.bi_version = BOOTINFO_VERSION; bootinfo.bi_size = sizeof(bootinfo); - bootinfo.bi_basemem = 0; /* XXX will be filled by loader or kernel */ - bootinfo.bi_extmem = memsize(); - bootinfo.bi_memsizes_valid++; /* Process configuration file */ @@ -271,11 +258,11 @@ main(void) * or in case of failure, try to load a kernel directly instead. */ - if (autoboot && !*kname) { - memcpy(kname, PATH_BOOT3, sizeof(PATH_BOOT3)); + if (autoboot && !kname) { + kname = PATH_BOOT3; if (!keyhit(3*SECOND)) { load(); - memcpy(kname, PATH_KERNEL, sizeof(PATH_KERNEL)); + kname = PATH_KERNEL; } } @@ -290,7 +277,7 @@ main(void) 'a' + dsk.part, kname); if (ioctrl & IO_SERIAL) sio_flush(); - if (!autoboot || keyhit(5*SECOND)) + if (!autoboot || keyhit(3*SECOND)) getstr(); else if (!autoboot || !OPT_CHECK(RBX_QUIET)) putchar('\n'); @@ -474,11 +461,7 @@ parse() ? DRV_HARD : 0) + drv; dsk_meta = 0; } - if ((i = ep - arg)) { - if ((size_t)i >= sizeof(kname)) - return -1; - memcpy(kname, arg, i + 1); - } + kname = arg; } arg = p; } @@ -630,7 +613,7 @@ keyhit(unsigned ticks) t1 = *(uint32_t *)PTOV(0x46c); if (!t0) t0 = t1; - if (t1 < t0 || t1 >= t0 + ticks) + if ((uint32_t)(t1 - t0) >= ticks) return 0; } } From owner-svn-src-stable@FreeBSD.ORG Tue Jul 26 13:26:47 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2E2CE106566B; Tue, 26 Jul 2011 13:26:47 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1CB9D8FC28; Tue, 26 Jul 2011 13:26:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6QDQlrt010547; Tue, 26 Jul 2011 13:26:47 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6QDQkWZ010544; Tue, 26 Jul 2011 13:26:46 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107261326.p6QDQkWZ010544@svn.freebsd.org> From: Marius Strobl Date: Tue, 26 Jul 2011 13:26:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224438 - in stable/8/sys/boot: common i386/boot2 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jul 2011 13:26:47 -0000 Author: marius Date: Tue Jul 26 13:26:46 2011 New Revision: 224438 URL: http://svn.freebsd.org/changeset/base/224438 Log: MFC: r219452 Some more shrinking. o bunch of variables are turned into uint8_t o initial setting of namep[] in lookup() is removed as it's only overwritten a few lines down o kname is explicitly initialized in main() as BSS in boot2 is not zeroed o the setting and reading of "fmt" in load() is removed o buf in printf() is made static to save space Reviewed by: jhb Tested by: me and Fabian Keil Modified: stable/8/sys/boot/common/ufsread.c stable/8/sys/boot/i386/boot2/boot2.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/geom/label/ (props changed) Modified: stable/8/sys/boot/common/ufsread.c ============================================================================== --- stable/8/sys/boot/common/ufsread.c Tue Jul 26 13:24:52 2011 (r224437) +++ stable/8/sys/boot/common/ufsread.c Tue Jul 26 13:26:46 2011 (r224438) @@ -88,7 +88,7 @@ static struct dmadat *dmadat; static ino_t lookup(const char *); static ssize_t fsread(ino_t, void *, size_t); -static int ls, dsk_meta; +static uint8_t ls, dsk_meta; static uint32_t fs_off; static __inline uint8_t @@ -127,8 +127,6 @@ lookup(const char *path) ino = ROOTINO; dt = DT_DIR; - name[0] = '/'; - name[1] = '\0'; for (;;) { if (*path == '/') path++; Modified: stable/8/sys/boot/i386/boot2/boot2.c ============================================================================== --- stable/8/sys/boot/i386/boot2/boot2.c Tue Jul 26 13:24:52 2011 (r224437) +++ stable/8/sys/boot/i386/boot2/boot2.c Tue Jul 26 13:26:46 2011 (r224438) @@ -125,17 +125,17 @@ static struct dsk { unsigned drive; unsigned type; unsigned unit; - unsigned slice; - unsigned part; + uint8_t slice; + uint8_t part; unsigned start; int init; } dsk; static char cmd[512], cmddup[512]; -static const char *kname = NULL; +static const char *kname; static uint32_t opts; static int comspeed = SIOSPD; static struct bootinfo bootinfo; -static unsigned ioctrl = IO_KEYBOARD; +static uint8_t ioctrl = IO_KEYBOARD; void exit(int); static void load(void); @@ -226,6 +226,7 @@ main(void) uint8_t autoboot; ino_t ino; + kname = NULL; dmadat = (void *)(roundup2(__base + (int32_t)&_end, 0x10000) - __base); v86.ctl = V86_FLAGS; v86.efl = PSL_RESERVED_DEFAULT | PSL_I; @@ -306,9 +307,8 @@ load(void) static Elf32_Shdr es[2]; caddr_t p; ino_t ino; - uint32_t addr, x; + uint32_t addr; int i, j; - uint8_t fmt; if (!(ino = lookup(kname))) { if (!ls) @@ -317,15 +317,8 @@ load(void) } if (xfsread(ino, &hdr, sizeof(hdr))) return; - if (N_GETMAGIC(hdr.ex) == ZMAGIC) - fmt = 0; - else if (IS_ELF(hdr.eh)) - fmt = 1; - else { - printf("Invalid %s\n", "format"); - return; - } - if (fmt == 0) { + + if (N_GETMAGIC(hdr.ex) == ZMAGIC) { addr = hdr.ex.a_entry & 0xffffff; p = PTOV(addr); fs_off = PAGE_SIZE; @@ -334,7 +327,7 @@ load(void) p += roundup2(hdr.ex.a_text, PAGE_SIZE); if (xfsread(ino, p, hdr.ex.a_data)) return; - } else { + } else if (IS_ELF(hdr.eh)) { fs_off = hdr.eh.e_phoff; for (j = i = 0; i < hdr.eh.e_phnum && j < 2; i++) { if (xfsread(ino, ep + j, sizeof(ep[0]))) @@ -366,7 +359,11 @@ load(void) } addr = hdr.eh.e_entry & 0xffffff; bootinfo.bi_esymtab = VTOP(p); + } else { + printf("Invalid %s\n", "format"); + return; } + bootinfo.bi_kernelname = VTOP(kname); bootinfo.bi_bios_dev = dsk.drive; __exec((caddr_t)addr, RB_BOOTINFO | (opts & RBX_MASK), @@ -474,7 +471,8 @@ dskread(void *buf, unsigned lba, unsigne struct dos_partition *dp; struct disklabel *d; char *sec; - unsigned sl, i; + unsigned i; + uint8_t sl; if (!dsk_meta) { sec = dmadat->secbuf; @@ -534,7 +532,7 @@ static void printf(const char *fmt,...) { va_list ap; - char buf[10]; + static char buf[10]; char *s; unsigned u; int c; From owner-svn-src-stable@FreeBSD.ORG Tue Jul 26 13:26:51 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C96F51065670; Tue, 26 Jul 2011 13:26:51 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AED5A8FC16; Tue, 26 Jul 2011 13:26:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6QDQpV9010584; Tue, 26 Jul 2011 13:26:51 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6QDQp5K010581; Tue, 26 Jul 2011 13:26:51 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107261326.p6QDQp5K010581@svn.freebsd.org> From: Marius Strobl Date: Tue, 26 Jul 2011 13:26:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224439 - in stable/7/sys/boot: common i386/boot2 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jul 2011 13:26:52 -0000 Author: marius Date: Tue Jul 26 13:26:51 2011 New Revision: 224439 URL: http://svn.freebsd.org/changeset/base/224439 Log: MFC: r219452 Some more shrinking. o bunch of variables are turned into uint8_t o initial setting of namep[] in lookup() is removed as it's only overwritten a few lines down o kname is explicitly initialized in main() as BSS in boot2 is not zeroed o the setting and reading of "fmt" in load() is removed o buf in printf() is made static to save space Reviewed by: jhb Tested by: me and Fabian Keil Modified: stable/7/sys/boot/common/ufsread.c stable/7/sys/boot/i386/boot2/boot2.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/boot/common/ufsread.c ============================================================================== --- stable/7/sys/boot/common/ufsread.c Tue Jul 26 13:26:46 2011 (r224438) +++ stable/7/sys/boot/common/ufsread.c Tue Jul 26 13:26:51 2011 (r224439) @@ -88,7 +88,7 @@ static struct dmadat *dmadat; static ino_t lookup(const char *); static ssize_t fsread(ino_t, void *, size_t); -static int ls, dsk_meta; +static uint8_t ls, dsk_meta; static uint32_t fs_off; static __inline uint8_t @@ -127,8 +127,6 @@ lookup(const char *path) ino = ROOTINO; dt = DT_DIR; - name[0] = '/'; - name[1] = '\0'; for (;;) { if (*path == '/') path++; Modified: stable/7/sys/boot/i386/boot2/boot2.c ============================================================================== --- stable/7/sys/boot/i386/boot2/boot2.c Tue Jul 26 13:26:46 2011 (r224438) +++ stable/7/sys/boot/i386/boot2/boot2.c Tue Jul 26 13:26:51 2011 (r224439) @@ -125,17 +125,17 @@ static struct dsk { unsigned drive; unsigned type; unsigned unit; - unsigned slice; - unsigned part; + uint8_t slice; + uint8_t part; unsigned start; int init; } dsk; static char cmd[512], cmddup[512]; -static const char *kname = NULL; +static const char *kname; static uint32_t opts; static int comspeed = SIOSPD; static struct bootinfo bootinfo; -static unsigned ioctrl = IO_KEYBOARD; +static uint8_t ioctrl = IO_KEYBOARD; void exit(int); static void load(void); @@ -226,6 +226,7 @@ main(void) uint8_t autoboot; ino_t ino; + kname = NULL; dmadat = (void *)(roundup2(__base + (int32_t)&_end, 0x10000) - __base); v86.ctl = V86_FLAGS; v86.efl = PSL_RESERVED_DEFAULT | PSL_I; @@ -306,9 +307,8 @@ load(void) static Elf32_Shdr es[2]; caddr_t p; ino_t ino; - uint32_t addr, x; + uint32_t addr; int i, j; - uint8_t fmt; if (!(ino = lookup(kname))) { if (!ls) @@ -317,15 +317,8 @@ load(void) } if (xfsread(ino, &hdr, sizeof(hdr))) return; - if (N_GETMAGIC(hdr.ex) == ZMAGIC) - fmt = 0; - else if (IS_ELF(hdr.eh)) - fmt = 1; - else { - printf("Invalid %s\n", "format"); - return; - } - if (fmt == 0) { + + if (N_GETMAGIC(hdr.ex) == ZMAGIC) { addr = hdr.ex.a_entry & 0xffffff; p = PTOV(addr); fs_off = PAGE_SIZE; @@ -334,7 +327,7 @@ load(void) p += roundup2(hdr.ex.a_text, PAGE_SIZE); if (xfsread(ino, p, hdr.ex.a_data)) return; - } else { + } else if (IS_ELF(hdr.eh)) { fs_off = hdr.eh.e_phoff; for (j = i = 0; i < hdr.eh.e_phnum && j < 2; i++) { if (xfsread(ino, ep + j, sizeof(ep[0]))) @@ -366,7 +359,11 @@ load(void) } addr = hdr.eh.e_entry & 0xffffff; bootinfo.bi_esymtab = VTOP(p); + } else { + printf("Invalid %s\n", "format"); + return; } + bootinfo.bi_kernelname = VTOP(kname); bootinfo.bi_bios_dev = dsk.drive; __exec((caddr_t)addr, RB_BOOTINFO | (opts & RBX_MASK), @@ -474,7 +471,8 @@ dskread(void *buf, unsigned lba, unsigne struct dos_partition *dp; struct disklabel *d; char *sec; - unsigned sl, i; + unsigned i; + uint8_t sl; if (!dsk_meta) { sec = dmadat->secbuf; @@ -534,7 +532,7 @@ static void printf(const char *fmt,...) { va_list ap; - char buf[10]; + static char buf[10]; char *s; unsigned u; int c; From owner-svn-src-stable@FreeBSD.ORG Tue Jul 26 13:29:11 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BBF9D106564A; Tue, 26 Jul 2011 13:29:11 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AB2C88FC18; Tue, 26 Jul 2011 13:29:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6QDTBWZ010770; Tue, 26 Jul 2011 13:29:11 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6QDTBIv010768; Tue, 26 Jul 2011 13:29:11 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107261329.p6QDTBIv010768@svn.freebsd.org> From: Marius Strobl Date: Tue, 26 Jul 2011 13:29:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224440 - stable/8/sys/boot/i386/boot2 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jul 2011 13:29:11 -0000 Author: marius Date: Tue Jul 26 13:29:11 2011 New Revision: 224440 URL: http://svn.freebsd.org/changeset/base/224440 Log: MFC: r220389, r220392 - Mark getc() as inline, this has no effect on gcc but helps clang. - Move getc() body before xgetc() so gcc does not emit a warning about function having no body. Approved by: jhb Modified: stable/8/sys/boot/i386/boot2/boot2.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/geom/label/ (props changed) Modified: stable/8/sys/boot/i386/boot2/boot2.c ============================================================================== --- stable/8/sys/boot/i386/boot2/boot2.c Tue Jul 26 13:26:51 2011 (r224439) +++ stable/8/sys/boot/i386/boot2/boot2.c Tue Jul 26 13:29:11 2011 (r224440) @@ -148,7 +148,7 @@ static int drvread(void *, unsigned, uns static int keyhit(unsigned); static int xputc(int); static int xgetc(int); -static int getc(int); +static inline int getc(int); static void memcpy(void *, const void *, int); static void @@ -627,6 +627,15 @@ xputc(int c) } static int +getc(int fn) +{ + v86.addr = 0x16; + v86.eax = fn << 8; + v86int(); + return fn == 0 ? v86.eax & 0xff : !V86_ZR(v86.efl); +} + +static int xgetc(int fn) { if (OPT_CHECK(RBX_NOINTR)) @@ -640,12 +649,3 @@ xgetc(int fn) return 0; } } - -static int -getc(int fn) -{ - v86.addr = 0x16; - v86.eax = fn << 8; - v86int(); - return fn == 0 ? v86.eax & 0xff : !V86_ZR(v86.efl); -} From owner-svn-src-stable@FreeBSD.ORG Tue Jul 26 13:29:11 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D0FC51065674; Tue, 26 Jul 2011 13:29:11 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C04AB8FC19; Tue, 26 Jul 2011 13:29:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6QDTBw5010774; Tue, 26 Jul 2011 13:29:11 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6QDTBAi010772; Tue, 26 Jul 2011 13:29:11 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107261329.p6QDTBAi010772@svn.freebsd.org> From: Marius Strobl Date: Tue, 26 Jul 2011 13:29:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224441 - stable/7/sys/boot/i386/boot2 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jul 2011 13:29:12 -0000 Author: marius Date: Tue Jul 26 13:29:11 2011 New Revision: 224441 URL: http://svn.freebsd.org/changeset/base/224441 Log: MFC: r220389, r220392 - Mark getc() as inline, this has no effect on gcc but helps clang. - Move getc() body before xgetc() so gcc does not emit a warning about function having no body. Approved by: jhb Modified: stable/7/sys/boot/i386/boot2/boot2.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/boot/i386/boot2/boot2.c ============================================================================== --- stable/7/sys/boot/i386/boot2/boot2.c Tue Jul 26 13:29:11 2011 (r224440) +++ stable/7/sys/boot/i386/boot2/boot2.c Tue Jul 26 13:29:11 2011 (r224441) @@ -148,7 +148,7 @@ static int drvread(void *, unsigned, uns static int keyhit(unsigned); static int xputc(int); static int xgetc(int); -static int getc(int); +static inline int getc(int); static void memcpy(void *, const void *, int); static void @@ -627,6 +627,15 @@ xputc(int c) } static int +getc(int fn) +{ + v86.addr = 0x16; + v86.eax = fn << 8; + v86int(); + return fn == 0 ? v86.eax & 0xff : !V86_ZR(v86.efl); +} + +static int xgetc(int fn) { if (OPT_CHECK(RBX_NOINTR)) @@ -640,12 +649,3 @@ xgetc(int fn) return 0; } } - -static int -getc(int fn) -{ - v86.addr = 0x16; - v86.eax = fn << 8; - v86int(); - return fn == 0 ? v86.eax & 0xff : !V86_ZR(v86.efl); -} From owner-svn-src-stable@FreeBSD.ORG Tue Jul 26 13:58:08 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7831C106564A; Tue, 26 Jul 2011 13:58:08 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6731F8FC12; Tue, 26 Jul 2011 13:58:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6QDw8vg011733; Tue, 26 Jul 2011 13:58:08 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6QDw8xF011731; Tue, 26 Jul 2011 13:58:08 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107261358.p6QDw8xF011731@svn.freebsd.org> From: Marius Strobl Date: Tue, 26 Jul 2011 13:58:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224442 - in stable/8/usr.sbin/makefs: . ffs X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jul 2011 13:58:08 -0000 Author: marius Date: Tue Jul 26 13:58:08 2011 New Revision: 224442 URL: http://svn.freebsd.org/changeset/base/224442 Log: MFC: r203059 Correct copy-paste typo from previous option description. Modified: stable/8/usr.sbin/makefs/makefs.8 Directory Properties: stable/8/usr.sbin/makefs/ (props changed) stable/8/usr.sbin/makefs/ffs/ffs_bswap.c (props changed) stable/8/usr.sbin/makefs/ffs/ffs_subr.c (props changed) stable/8/usr.sbin/makefs/ffs/ufs_bswap.h (props changed) stable/8/usr.sbin/makefs/getid.c (props changed) Modified: stable/8/usr.sbin/makefs/makefs.8 ============================================================================== --- stable/8/usr.sbin/makefs/makefs.8 Tue Jul 26 13:29:11 2011 (r224441) +++ stable/8/usr.sbin/makefs/makefs.8 Tue Jul 26 13:58:08 2011 (r224442) @@ -159,7 +159,7 @@ free files (inodes) exist in the image. An optional .Ql % suffix may be provided to indicate that -.Ar free-blocks +.Ar free-files indicates a percentage of the calculated image size .It Fl F Ar specfile Use From owner-svn-src-stable@FreeBSD.ORG Tue Jul 26 13:58:10 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 153E8106566B; Tue, 26 Jul 2011 13:58:10 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 045458FC13; Tue, 26 Jul 2011 13:58:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6QDw9t9011768; Tue, 26 Jul 2011 13:58:09 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6QDw9Gi011766; Tue, 26 Jul 2011 13:58:09 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107261358.p6QDw9Gi011766@svn.freebsd.org> From: Marius Strobl Date: Tue, 26 Jul 2011 13:58:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224443 - in stable/7/usr.sbin/makefs: . ffs X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jul 2011 13:58:10 -0000 Author: marius Date: Tue Jul 26 13:58:09 2011 New Revision: 224443 URL: http://svn.freebsd.org/changeset/base/224443 Log: MFC: r203059 Correct copy-paste typo from previous option description. Modified: stable/7/usr.sbin/makefs/makefs.8 Directory Properties: stable/7/usr.sbin/makefs/ (props changed) stable/7/usr.sbin/makefs/ffs/ffs_bswap.c (props changed) stable/7/usr.sbin/makefs/ffs/ffs_subr.c (props changed) stable/7/usr.sbin/makefs/ffs/ufs_bswap.h (props changed) stable/7/usr.sbin/makefs/getid.c (props changed) Modified: stable/7/usr.sbin/makefs/makefs.8 ============================================================================== --- stable/7/usr.sbin/makefs/makefs.8 Tue Jul 26 13:58:08 2011 (r224442) +++ stable/7/usr.sbin/makefs/makefs.8 Tue Jul 26 13:58:09 2011 (r224443) @@ -159,7 +159,7 @@ free files (inodes) exist in the image. An optional .Ql % suffix may be provided to indicate that -.Ar free-blocks +.Ar free-files indicates a percentage of the calculated image size .It Fl F Ar specfile Use From owner-svn-src-stable@FreeBSD.ORG Tue Jul 26 14:03:50 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D47CC106566C; Tue, 26 Jul 2011 14:03:50 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C38958FC12; Tue, 26 Jul 2011 14:03:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6QE3oP7012097; Tue, 26 Jul 2011 14:03:50 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6QE3odO012095; Tue, 26 Jul 2011 14:03:50 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107261403.p6QE3odO012095@svn.freebsd.org> From: Marius Strobl Date: Tue, 26 Jul 2011 14:03:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224444 - in stable/8/usr.sbin/makefs: . ffs X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jul 2011 14:03:50 -0000 Author: marius Date: Tue Jul 26 14:03:50 2011 New Revision: 224444 URL: http://svn.freebsd.org/changeset/base/224444 Log: MFC: r210933 (partial) Fix typos and spelling mistakes. Modified: stable/8/usr.sbin/makefs/makefs.8 Directory Properties: stable/8/usr.sbin/makefs/ (props changed) stable/8/usr.sbin/makefs/ffs/ffs_bswap.c (props changed) stable/8/usr.sbin/makefs/ffs/ffs_subr.c (props changed) stable/8/usr.sbin/makefs/ffs/ufs_bswap.h (props changed) stable/8/usr.sbin/makefs/getid.c (props changed) Modified: stable/8/usr.sbin/makefs/makefs.8 ============================================================================== --- stable/8/usr.sbin/makefs/makefs.8 Tue Jul 26 13:58:09 2011 (r224443) +++ stable/8/usr.sbin/makefs/makefs.8 Tue Jul 26 14:03:50 2011 (r224444) @@ -204,7 +204,7 @@ If isn't provided, the current file flags will be used. Missing regular file entries will be created as zero-length files. .It Fl x -Exclude file system nodes not explcitly listed in the specfile. +Exclude file system nodes not explicitly listed in the specfile. .It Fl N Ar dbdir Use the user database text file .Pa master.passwd From owner-svn-src-stable@FreeBSD.ORG Tue Jul 26 14:03:53 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4BFF9106564A; Tue, 26 Jul 2011 14:03:53 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3B1178FC08; Tue, 26 Jul 2011 14:03:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6QE3rnG012133; Tue, 26 Jul 2011 14:03:53 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6QE3rID012131; Tue, 26 Jul 2011 14:03:53 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107261403.p6QE3rID012131@svn.freebsd.org> From: Marius Strobl Date: Tue, 26 Jul 2011 14:03:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224445 - in stable/7/usr.sbin/makefs: . ffs X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jul 2011 14:03:53 -0000 Author: marius Date: Tue Jul 26 14:03:52 2011 New Revision: 224445 URL: http://svn.freebsd.org/changeset/base/224445 Log: MFC: r210933 (partial) Fix typos and spelling mistakes. Modified: stable/7/usr.sbin/makefs/makefs.8 Directory Properties: stable/7/usr.sbin/makefs/ (props changed) stable/7/usr.sbin/makefs/ffs/ffs_bswap.c (props changed) stable/7/usr.sbin/makefs/ffs/ffs_subr.c (props changed) stable/7/usr.sbin/makefs/ffs/ufs_bswap.h (props changed) stable/7/usr.sbin/makefs/getid.c (props changed) Modified: stable/7/usr.sbin/makefs/makefs.8 ============================================================================== --- stable/7/usr.sbin/makefs/makefs.8 Tue Jul 26 14:03:50 2011 (r224444) +++ stable/7/usr.sbin/makefs/makefs.8 Tue Jul 26 14:03:52 2011 (r224445) @@ -204,7 +204,7 @@ If isn't provided, the current file flags will be used. Missing regular file entries will be created as zero-length files. .It Fl x -Exclude file system nodes not explcitly listed in the specfile. +Exclude file system nodes not explicitly listed in the specfile. .It Fl N Ar dbdir Use the user database text file .Pa master.passwd From owner-svn-src-stable@FreeBSD.ORG Tue Jul 26 14:41:28 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7D2E8106566C; Tue, 26 Jul 2011 14:41:28 +0000 (UTC) (envelope-from maxim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 637008FC15; Tue, 26 Jul 2011 14:41:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6QEfSmJ013488; Tue, 26 Jul 2011 14:41:28 GMT (envelope-from maxim@svn.freebsd.org) Received: (from maxim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6QEfSv4013486; Tue, 26 Jul 2011 14:41:28 GMT (envelope-from maxim@svn.freebsd.org) Message-Id: <201107261441.p6QEfSv4013486@svn.freebsd.org> From: Maxim Konovalov Date: Tue, 26 Jul 2011 14:41:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224446 - stable/8/share/misc X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jul 2011 14:41:28 -0000 Author: maxim Date: Tue Jul 26 14:41:28 2011 New Revision: 224446 URL: http://svn.freebsd.org/changeset/base/224446 Log: MFC rr215733,217577,219024,219308,221118,221319: sync with head. Modified: stable/8/share/misc/bsd-family-tree (contents, props changed) Modified: stable/8/share/misc/bsd-family-tree ============================================================================== --- stable/8/share/misc/bsd-family-tree Tue Jul 26 14:03:52 2011 (r224445) +++ stable/8/share/misc/bsd-family-tree Tue Jul 26 14:41:28 2011 (r224446) @@ -228,20 +228,25 @@ FreeBSD 5.2 | | | FreeBSD 7.1 | | | | | | | | | DragonFly 2.2.0 | FreeBSD 7.2 | NetBSD 5.0 OpenBSD 4.5 | - | \ | | | | - | | | | | DragonFly 2.4.0 - | | | | OpenBSD 4.6 | - | | | | | | - *--FreeBSD | | | | | - | 8.0 | | | | | - | | FreeBSD | | | | - | | 7.3 | | | DragonFly 2.6.0 - | | | | OpenBSD 4.7 | - | FreeBSD | | | | - | 8.1 | | | | - | | | | | DragonFly 2.8.0 - | | | | OpenBSD 4.8 | - | V | | | | + | \ | | | | | + | | Mac OS X | | | | + | | 10.6 | | | | + | | | | | | DragonFly 2.4.0 + | | | | | OpenBSD 4.6 | + | | | | | | | + *--FreeBSD | | | | | | + | 8.0 | | | | | | + | | FreeBSD | | | | | + | | 7.3 | | | | DragonFly 2.6.0 + | | | | | | OpenBSD 4.7 | + | FreeBSD | | | | | | + | 8.1 | | | | | | + | | | | | | | DragonFly 2.8.2 + | | | | | | OpenBSD 4.8 | + | | | | | NetBSD 5.1 | | + | FreeBSD FreeBSD | | | | + | 8.2 7.4 | | | DragonFly 2.10.1 + | v | | OpenBSD 4.9 | | | | | | FreeBSD 9 -current | NetBSD -current OpenBSD -current | | | | | | @@ -514,6 +519,7 @@ DragonFly 2.2.0 2009-02-17 [DFB] NetBSD 5.0 2009-04-29 [NBD] OpenBSD 4.5 2009-05-01 [OBD] FreeBSD 7.2 2009-05-04 [FBD] +Mac OS X 10.6 2009-06-08 [APL] DragonFly 2.4.0 2009-09-16 [DFB] OpenBSD 4.6 2009-10-18 [OBD] FreeBSD 8.0 2009-11-26 [FBD] @@ -521,8 +527,13 @@ FreeBSD 7.3 2010-03-23 [FBD] DragonFly 2.6.0 2010-03-28 [DFB] OpenBSD 4.7 2010-05-19 [OBD] FreeBSD 8.1 2010-07-24 [FBD] -DragonFly 2.8.0 2010-10-30 [DFB] +DragonFly 2.8.2 2010-10-30 [DFB] OpenBSD 4.8 2010-11-01 [OBD] +NetBSD 5.1 2010-11-19 [NBD] +FreeBSD 7.4 2011-02-24 [FBD] +FreeBSD 8.2 2011-02-24 [FBD] +DragonFly 2.10.1 2011-04-26 [DFB] +OpenBSD 4.9 2011-05-01 [OBD] Bibliography ------------------------ From owner-svn-src-stable@FreeBSD.ORG Tue Jul 26 14:41:54 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ED521106564A; Tue, 26 Jul 2011 14:41:54 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DA7D28FC13; Tue, 26 Jul 2011 14:41:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6QEfs0J013579; Tue, 26 Jul 2011 14:41:54 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6QEfsHK013563; Tue, 26 Jul 2011 14:41:54 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107261441.p6QEfsHK013563@svn.freebsd.org> From: Marius Strobl Date: Tue, 26 Jul 2011 14:41:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224447 - in stable/8/usr.sbin/makefs: . cd9660 compat ffs X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jul 2011 14:41:55 -0000 Author: marius Date: Tue Jul 26 14:41:54 2011 New Revision: 224447 URL: http://svn.freebsd.org/changeset/base/224447 Log: MFC: r214921, r219954, r219956, r221387, r221470, r221536, r222191 - Sync with the latest version from NetBSD. It notably addds ISO9660 support. - Add support for synthesizing an APM partition map to map Mac PowerPC bootstrap partitions from the ISO9660 boot catalog. This preserves OS X's ability to mount the CD, while allowing us a way to provide HFS-ified bootstrap code for Open Firmware. - Add analogs to the -chrp-boot and -prep-boot options to mkisofs. Added: stable/8/usr.sbin/makefs/cd9660/ - copied from r214921, head/usr.sbin/makefs/cd9660/ stable/8/usr.sbin/makefs/cd9660.c - copied, changed from r214921, head/usr.sbin/makefs/cd9660.c stable/8/usr.sbin/makefs/cd9660.h - copied, changed from r214921, head/usr.sbin/makefs/cd9660.h stable/8/usr.sbin/makefs/compat/Makefile.inc - copied unchanged from r214921, head/usr.sbin/makefs/compat/Makefile.inc stable/8/usr.sbin/makefs/ffs.h - copied unchanged from r214921, head/usr.sbin/makefs/ffs.h stable/8/usr.sbin/makefs/ffs/Makefile.inc - copied unchanged from r214921, head/usr.sbin/makefs/ffs/Makefile.inc Modified: stable/8/usr.sbin/makefs/Makefile stable/8/usr.sbin/makefs/cd9660/cd9660_eltorito.c stable/8/usr.sbin/makefs/cd9660/cd9660_strings.c stable/8/usr.sbin/makefs/ffs.c stable/8/usr.sbin/makefs/ffs/buf.c stable/8/usr.sbin/makefs/ffs/ffs_alloc.c stable/8/usr.sbin/makefs/ffs/mkfs.c stable/8/usr.sbin/makefs/makefs.8 stable/8/usr.sbin/makefs/makefs.c stable/8/usr.sbin/makefs/makefs.h stable/8/usr.sbin/makefs/walk.c Directory Properties: stable/8/usr.sbin/makefs/ (props changed) stable/8/usr.sbin/makefs/ffs/ffs_bswap.c (props changed) stable/8/usr.sbin/makefs/ffs/ffs_subr.c (props changed) stable/8/usr.sbin/makefs/ffs/ufs_bswap.h (props changed) stable/8/usr.sbin/makefs/getid.c (props changed) Modified: stable/8/usr.sbin/makefs/Makefile ============================================================================== --- stable/8/usr.sbin/makefs/Makefile Tue Jul 26 14:41:28 2011 (r224446) +++ stable/8/usr.sbin/makefs/Makefile Tue Jul 26 14:41:54 2011 (r224447) @@ -1,22 +1,23 @@ # $FreeBSD$ PROG= makefs + +CFLAGS+=-I${.CURDIR} + +SRCS= cd9660.c ffs.c \ + getid.c \ + makefs.c \ + walk.c MAN= makefs.8 WARNS?= 2 -CFLAGS+=-I${.CURDIR} -SRCS= ffs.c getid.c makefs.c walk.c +.include "${.CURDIR}/cd9660/Makefile.inc" +.include "${.CURDIR}/ffs/Makefile.inc" +.include "${.CURDIR}/compat/Makefile.inc" -.PATH: ${.CURDIR}/ffs -CFLAGS+=-I${.CURDIR}/ffs CFLAGS+=-DHAVE_STRUCT_STAT_ST_FLAGS=1 CFLAGS+=-DHAVE_STRUCT_STAT_ST_GEN=1 -SRCS+= buf.c ffs_alloc.c ffs_balloc.c ffs_bswap.c ffs_subr.c mkfs.c ufs_bmap.c - -.PATH: ${.CURDIR}/compat -CFLAGS+=-I${.CURDIR}/compat -SRCS+= pwcache.c strsuftoll.c .PATH: ${.CURDIR}/../mtree CFLAGS+=-I${.CURDIR}/../mtree Copied and modified: stable/8/usr.sbin/makefs/cd9660.c (from r214921, head/usr.sbin/makefs/cd9660.c) ============================================================================== --- head/usr.sbin/makefs/cd9660.c Sun Nov 7 16:05:04 2010 (r214921, copy source) +++ stable/8/usr.sbin/makefs/cd9660.c Tue Jul 26 14:41:54 2011 (r224447) @@ -207,6 +207,7 @@ cd9660_set_defaults(void) diskStructure.rr_moved_dir = 0; diskStructure.archimedes_enabled = 0; + diskStructure.chrp_boot = 0; diskStructure.include_padding_areas = 1; @@ -391,6 +392,8 @@ cd9660_parse_opts(const char *option, fs diskStructure.rock_ridge_enabled = 1; else if (CD9660_IS_COMMAND_ARG_DUAL(var, "A", "archimedes")) diskStructure.archimedes_enabled = 1; + else if (CD9660_IS_COMMAND_ARG(var, "chrp-boot")) + diskStructure.chrp_boot = 1; else if (CD9660_IS_COMMAND_ARG_DUAL(var, "K", "keep-bad-images")) diskStructure.keep_bad_images = 1; else if (CD9660_IS_COMMAND_ARG(var, "allow-deep-trees")) Copied and modified: stable/8/usr.sbin/makefs/cd9660.h (from r214921, head/usr.sbin/makefs/cd9660.h) ============================================================================== --- head/usr.sbin/makefs/cd9660.h Sun Nov 7 16:05:04 2010 (r214921, copy source) +++ stable/8/usr.sbin/makefs/cd9660.h Tue Jul 26 14:41:54 2011 (r224447) @@ -285,6 +285,7 @@ typedef struct _iso9660_disk { cd9660node *rr_moved_dir; int archimedes_enabled; + int chrp_boot; /* Spec breaking options */ u_char allow_deep_trees; Modified: stable/8/usr.sbin/makefs/cd9660/cd9660_eltorito.c ============================================================================== --- head/usr.sbin/makefs/cd9660/cd9660_eltorito.c Sun Nov 7 16:05:04 2010 (r214921) +++ stable/8/usr.sbin/makefs/cd9660/cd9660_eltorito.c Tue Jul 26 14:41:54 2011 (r224447) @@ -31,6 +31,9 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. */ + +#include + #include "cd9660.h" #include "cd9660_eltorito.h" @@ -497,11 +500,79 @@ cd9660_setup_boot_volume_descriptor(volu return 1; } +static int +cd9660_write_mbr_partition_entry(FILE *fd, int index, off_t sector_start, + off_t nsectors, int type) +{ + uint8_t val; + uint32_t lba; + + fseeko(fd, (off_t)(index) * 16 + 0x1be, SEEK_SET); + + val = 0x80; /* Bootable */ + fwrite(&val, sizeof(val), 1, fd); + + val = 0xff; /* CHS begin */ + fwrite(&val, sizeof(val), 1, fd); + fwrite(&val, sizeof(val), 1, fd); + fwrite(&val, sizeof(val), 1, fd); + + val = type; /* Part type */ + fwrite(&val, sizeof(val), 1, fd); + + val = 0xff; /* CHS end */ + fwrite(&val, sizeof(val), 1, fd); + fwrite(&val, sizeof(val), 1, fd); + fwrite(&val, sizeof(val), 1, fd); + + /* LBA extent */ + lba = htole32(sector_start); + fwrite(&lba, sizeof(lba), 1, fd); + lba = htole32(nsectors); + fwrite(&lba, sizeof(lba), 1, fd); + + return (0); +} + +static int +cd9660_write_apm_partition_entry(FILE *fd, int index, int total_partitions, + off_t sector_start, off_t nsectors, off_t sector_size, + const char *part_name, const char *part_type) +{ + uint32_t apm32; + uint16_t apm16; + + fseeko(fd, (off_t)(index + 1) * sector_size, SEEK_SET); + + /* Signature */ + apm16 = htobe16(0x504d); + fwrite(&apm16, sizeof(apm16), 1, fd); + apm16 = 0; + fwrite(&apm16, sizeof(apm16), 1, fd); + + /* Total number of partitions */ + apm32 = htobe32(total_partitions); + fwrite(&apm32, sizeof(apm32), 1, fd); + /* Bounds */ + apm32 = htobe32(sector_start); + fwrite(&apm32, sizeof(apm32), 1, fd); + apm32 = htobe32(nsectors); + fwrite(&apm32, sizeof(apm32), 1, fd); + + fwrite(part_name, strlen(part_name) + 1, 1, fd); + fseek(fd, 32 - strlen(part_name) - 1, SEEK_CUR); + fwrite(part_type, strlen(part_type) + 1, 1, fd); + + return 0; +} + int cd9660_write_boot(FILE *fd) { struct boot_catalog_entry *e; struct cd9660_boot_image *t; + int apm_partitions = 0; + int mbr_partitions = 0; /* write boot catalog */ if (fseeko(fd, (off_t)diskStructure.boot_catalog_sector * @@ -533,7 +604,88 @@ cd9660_write_boot(FILE *fd) t->filename, t->sector); } cd9660_copy_file(fd, t->sector, t->filename); + + if (t->system == ET_SYS_MAC) + apm_partitions++; + if (t->system == ET_SYS_PPC) + mbr_partitions++; + } + + /* some systems need partition tables as well */ + if (mbr_partitions > 0 || diskStructure.chrp_boot) { + uint16_t sig; + + fseek(fd, 0x1fe, SEEK_SET); + sig = htole16(0xaa55); + fwrite(&sig, sizeof(sig), 1, fd); + + mbr_partitions = 0; + + /* Write ISO9660 descriptor, enclosing the whole disk */ + if (diskStructure.chrp_boot) + cd9660_write_mbr_partition_entry(fd, mbr_partitions++, + 0, diskStructure.totalSectors * + (diskStructure.sectorSize / 512), 0x96); + + /* Write all partition entries */ + TAILQ_FOREACH(t, &diskStructure.boot_images, image_list) { + if (t->system != ET_SYS_PPC) + continue; + cd9660_write_mbr_partition_entry(fd, mbr_partitions++, + t->sector * (diskStructure.sectorSize / 512), + t->num_sectors * (diskStructure.sectorSize / 512), + 0x41 /* PReP Boot */); + } + } + + if (apm_partitions > 0) { + /* Write DDR and global APM info */ + uint32_t apm32; + uint16_t apm16; + int total_parts; + + fseek(fd, 0, SEEK_SET); + apm16 = htobe16(0x4552); + fwrite(&apm16, sizeof(apm16), 1, fd); + /* Device block size */ + apm16 = htobe16(512); + fwrite(&apm16, sizeof(apm16), 1, fd); + /* Device block count */ + apm32 = htobe32(diskStructure.totalSectors * + (diskStructure.sectorSize / 512)); + fwrite(&apm32, sizeof(apm32), 1, fd); + /* Device type/id */ + apm16 = htobe16(1); + fwrite(&apm16, sizeof(apm16), 1, fd); + fwrite(&apm16, sizeof(apm16), 1, fd); + + /* Count total needed entries */ + total_parts = 2 + apm_partitions; /* Self + ISO9660 */ + + /* Write self-descriptor */ + cd9660_write_apm_partition_entry(fd, 0, total_parts, 1, + total_parts, 512, "Apple", "Apple_partition_map"); + + /* Write ISO9660 descriptor, enclosing the whole disk */ + cd9660_write_apm_partition_entry(fd, 1, total_parts, 0, + diskStructure.totalSectors * + (diskStructure.sectorSize / 512), 512, "ISO9660", + "CD_ROM_Mode_1"); + + /* Write all partition entries */ + apm_partitions = 0; + TAILQ_FOREACH(t, &diskStructure.boot_images, image_list) { + if (t->system != ET_SYS_MAC) + continue; + + cd9660_write_apm_partition_entry(fd, + 2 + apm_partitions++, total_parts, + t->sector * (diskStructure.sectorSize / 512), + t->num_sectors * (diskStructure.sectorSize / 512), + 512, "CD Boot", "Apple_Bootstrap"); + } } return 0; } + Modified: stable/8/usr.sbin/makefs/cd9660/cd9660_strings.c ============================================================================== --- head/usr.sbin/makefs/cd9660/cd9660_strings.c Sun Nov 7 16:05:04 2010 (r214921) +++ stable/8/usr.sbin/makefs/cd9660/cd9660_strings.c Tue Jul 26 14:41:54 2011 (r224447) @@ -55,19 +55,19 @@ cd9660_uppercase_characters(char *str, i } static inline int -cd9660_is_a_char(char c) +cd9660_is_d_char(char c) { return (isupper((unsigned char)c) || c == '_' - || (c >= '0' && c <= '?')); + || (c >= '0' && c <= '9')); } static inline int -cd9660_is_d_char(char c) +cd9660_is_a_char(char c) { return (isupper((unsigned char)c) || c == '_' - || (c >= '%' && c <= '9') + || (c >= '%' && c <= '?') || (c >= ' ' && c <= '\"')); } Copied: stable/8/usr.sbin/makefs/compat/Makefile.inc (from r214921, head/usr.sbin/makefs/compat/Makefile.inc) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/usr.sbin/makefs/compat/Makefile.inc Tue Jul 26 14:41:54 2011 (r224447, copy of r214921, head/usr.sbin/makefs/compat/Makefile.inc) @@ -0,0 +1,8 @@ +# $FreeBSD$ +# + +.PATH: ${.CURDIR}/compat + +CFLAGS+= -I${.CURDIR}/compat + +SRCS+= pwcache.c strsuftoll.c Modified: stable/8/usr.sbin/makefs/ffs.c ============================================================================== --- stable/8/usr.sbin/makefs/ffs.c Tue Jul 26 14:41:28 2011 (r224446) +++ stable/8/usr.sbin/makefs/ffs.c Tue Jul 26 14:41:54 2011 (r224447) @@ -1,4 +1,4 @@ -/* $NetBSD: ffs.c,v 1.30 2004/06/24 22:30:13 lukem Exp $ */ +/* $NetBSD: ffs.c,v 1.44 2009/04/28 22:49:26 joerg Exp $ */ /* * Copyright (c) 2001 Wasabi Systems, Inc. @@ -76,17 +76,24 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include #include #include "makefs.h" +#include "ffs.h" + +#if HAVE_STRUCT_STATVFS_F_IOSIZE && HAVE_FSTATVFS +#include +#endif #include #include #include + #include "ffs/ufs_bswap.h" #include "ffs/ufs_inode.h" #include "ffs/newfs_extern.h" @@ -94,7 +101,7 @@ __FBSDID("$FreeBSD$"); #undef DIP #define DIP(dp, field) \ - ((fsopts->version == 1) ? \ + ((ffs_opts->version == 1) ? \ (dp)->ffs1_din.di_##field : (dp)->ffs2_din.di_##field) /* @@ -139,39 +146,71 @@ int sectorsize; /* XXX: for buf.c::getb /* publically visible functions */ +void +ffs_prep_opts(fsinfo_t *fsopts) +{ + ffs_opt_t *ffs_opts; + + if ((ffs_opts = calloc(1, sizeof(ffs_opt_t))) == NULL) + err(1, "Allocating memory for ffs_options"); + + fsopts->fs_specific = ffs_opts; + + ffs_opts->bsize= -1; + ffs_opts->fsize= -1; + ffs_opts->cpg= -1; + ffs_opts->density= -1; + ffs_opts->minfree= -1; + ffs_opts->optimization= -1; + ffs_opts->maxcontig= -1; + ffs_opts->maxbpg= -1; + ffs_opts->avgfilesize= -1; + ffs_opts->avgfpdir= -1; + ffs_opts->version = 1; +} + +void +ffs_cleanup_opts(fsinfo_t *fsopts) +{ + if (fsopts->fs_specific) + free(fsopts->fs_specific); +} + int ffs_parse_opts(const char *option, fsinfo_t *fsopts) { + ffs_opt_t *ffs_opts = fsopts->fs_specific; + option_t ffs_options[] = { - { "bsize", &fsopts->bsize, 1, INT_MAX, + { "bsize", &ffs_opts->bsize, 1, INT_MAX, "block size" }, - { "fsize", &fsopts->fsize, 1, INT_MAX, + { "fsize", &ffs_opts->fsize, 1, INT_MAX, "fragment size" }, - { "density", &fsopts->density, 1, INT_MAX, + { "density", &ffs_opts->density, 1, INT_MAX, "bytes per inode" }, - { "minfree", &fsopts->minfree, 0, 99, + { "minfree", &ffs_opts->minfree, 0, 99, "minfree" }, - { "maxbpf", &fsopts->maxbpg, 1, INT_MAX, + { "maxbpf", &ffs_opts->maxbpg, 1, INT_MAX, "max blocks per file in a cg" }, - { "avgfilesize", &fsopts->avgfilesize, 1, INT_MAX, + { "avgfilesize", &ffs_opts->avgfilesize,1, INT_MAX, "expected average file size" }, - { "avgfpdir", &fsopts->avgfpdir, 1, INT_MAX, + { "avgfpdir", &ffs_opts->avgfpdir, 1, INT_MAX, "expected # of files per directory" }, - { "extent", &fsopts->maxbsize, 1, INT_MAX, + { "extent", &ffs_opts->maxbsize, 1, INT_MAX, "maximum # extent size" }, - { "maxbpcg", &fsopts->maxblkspercg, 1, INT_MAX, + { "maxbpcg", &ffs_opts->maxblkspercg,1, INT_MAX, "max # of blocks per group" }, - { "version", &fsopts->version, 1, 2, + { "version", &ffs_opts->version, 1, 2, "UFS version" }, - { NULL } + { .name = NULL } }; char *var, *val; int rv; - (void)&ffs_options; assert(option != NULL); assert(fsopts != NULL); + assert(ffs_opts != NULL); if (debug & DEBUG_FS_PARSE_OPTS) printf("ffs_parse_opts: got `%s'\n", option); @@ -188,9 +227,9 @@ ffs_parse_opts(const char *option, fsinf if (strcmp(var, "optimization") == 0) { if (strcmp(val, "time") == 0) { - fsopts->optimization = FS_OPTTIME; + ffs_opts->optimization = FS_OPTTIME; } else if (strcmp(val, "space") == 0) { - fsopts->optimization = FS_OPTSPACE; + ffs_opts->optimization = FS_OPTSPACE; } else { warnx("Invalid optimization `%s'", val); goto leave_ffs_parse_opts; @@ -277,11 +316,12 @@ ffs_validate(const char *dir, fsnode *ro #if notyet int32_t spc, nspf, ncyl, fssize; #endif - off_t size; + ffs_opt_t *ffs_opts = fsopts->fs_specific; assert(dir != NULL); assert(root != NULL); assert(fsopts != NULL); + assert(ffs_opts != NULL); if (debug & DEBUG_FS_VALIDATE) { printf("ffs_validate: before defaults set:\n"); @@ -291,31 +331,31 @@ ffs_validate(const char *dir, fsnode *ro /* set FFS defaults */ if (fsopts->sectorsize == -1) fsopts->sectorsize = DFL_SECSIZE; - if (fsopts->fsize == -1) - fsopts->fsize = MAX(DFL_FRAGSIZE, fsopts->sectorsize); - if (fsopts->bsize == -1) - fsopts->bsize = MIN(DFL_BLKSIZE, 8 * fsopts->fsize); - if (fsopts->cpg == -1) - fsopts->cpg = DFL_CYLSPERGROUP; + if (ffs_opts->fsize == -1) + ffs_opts->fsize = MAX(DFL_FRAGSIZE, fsopts->sectorsize); + if (ffs_opts->bsize == -1) + ffs_opts->bsize = MIN(DFL_BLKSIZE, 8 * ffs_opts->fsize); + if (ffs_opts->cpg == -1) + ffs_opts->cpg = DFL_CYLSPERGROUP; else - fsopts->cpgflg = 1; + ffs_opts->cpgflg = 1; /* fsopts->density is set below */ - if (fsopts->nsectors == -1) - fsopts->nsectors = DFL_NSECTORS; - if (fsopts->minfree == -1) - fsopts->minfree = MINFREE; - if (fsopts->optimization == -1) - fsopts->optimization = DEFAULTOPT; - if (fsopts->maxcontig == -1) - fsopts->maxcontig = - MAX(1, MIN(MAXPHYS, FFS_MAXBSIZE) / fsopts->bsize); + if (ffs_opts->nsectors == -1) + ffs_opts->nsectors = DFL_NSECTORS; + if (ffs_opts->minfree == -1) + ffs_opts->minfree = MINFREE; + if (ffs_opts->optimization == -1) + ffs_opts->optimization = DEFAULTOPT; + if (ffs_opts->maxcontig == -1) + ffs_opts->maxcontig = + MAX(1, MIN(MAXPHYS, FFS_MAXBSIZE) / ffs_opts->bsize); /* XXX ondisk32 */ - if (fsopts->maxbpg == -1) - fsopts->maxbpg = fsopts->bsize / sizeof(int32_t); - if (fsopts->avgfilesize == -1) - fsopts->avgfilesize = AVFILESIZ; - if (fsopts->avgfpdir == -1) - fsopts->avgfpdir = AFPDIR; + if (ffs_opts->maxbpg == -1) + ffs_opts->maxbpg = ffs_opts->bsize / sizeof(int32_t); + if (ffs_opts->avgfilesize == -1) + ffs_opts->avgfilesize = AVFILESIZ; + if (ffs_opts->avgfpdir == -1) + ffs_opts->avgfpdir = AFPDIR; /* calculate size of tree */ ffs_size_dir(root, fsopts); @@ -343,17 +383,19 @@ ffs_validate(const char *dir, fsnode *ro */ fsopts->size += (SBLOCK_UFS1 + SBLOCKSIZE) * ncg; /* add space needed to store inodes, x3 for blockmaps, etc */ - if (fsopts->version == 1) + if (ffs_opts->version == 1) fsopts->size += ncg * DINODE1_SIZE * - roundup(fsopts->inodes / ncg, fsopts->bsize / DINODE1_SIZE); + roundup(fsopts->inodes / ncg, + ffs_opts->bsize / DINODE1_SIZE); else fsopts->size += ncg * DINODE2_SIZE * - roundup(fsopts->inodes / ncg, fsopts->bsize / DINODE2_SIZE); + roundup(fsopts->inodes / ncg, + ffs_opts->bsize / DINODE2_SIZE); /* add minfree */ - if (fsopts->minfree > 0) + if (ffs_opts->minfree > 0) fsopts->size = - fsopts->size * (100 + fsopts->minfree) / 100; + fsopts->size * (100 + ffs_opts->minfree) / 100; /* * XXX any other fs slop to add, such as csum's, bitmaps, etc ?? */ @@ -362,24 +404,11 @@ ffs_validate(const char *dir, fsnode *ro fsopts->size = fsopts->minsize; /* round up to the next block */ - size = roundup(fsopts->size, fsopts->bsize); - - /* now check calculated sizes vs requested sizes */ - if (fsopts->maxsize > 0 && size > fsopts->maxsize) { - if (debug & DEBUG_FS_VALIDATE) { - printf("%s: `%s' size of %lld is larger than the " - "maxsize of %lld; rounding down to %lld.", - __func__, dir, (long long)size, - (long long)fsopts->maxsize, - (long long) rounddown(fsopts->size, fsopts->bsize)); - } - size = rounddown(fsopts->size, fsopts->bsize); - } - fsopts->size = size; + fsopts->size = roundup(fsopts->size, ffs_opts->bsize); /* calculate density if necessary */ - if (fsopts->density == -1) - fsopts->density = fsopts->size / fsopts->inodes + 1; + if (ffs_opts->density == -1) + ffs_opts->density = fsopts->size / fsopts->inodes + 1; if (debug & DEBUG_FS_VALIDATE) { printf("ffs_validate: after defaults set:\n"); @@ -388,6 +417,12 @@ ffs_validate(const char *dir, fsnode *ro dir, (long long)fsopts->size, (long long)fsopts->inodes); } sectorsize = fsopts->sectorsize; /* XXX - see earlier */ + + /* now check calculated sizes vs requested sizes */ + if (fsopts->maxsize > 0 && fsopts->size > fsopts->maxsize) { + errx(1, "`%s' size of %lld is larger than the maxsize of %lld.", + dir, (long long)fsopts->size, (long long)fsopts->maxsize); + } } @@ -395,6 +430,8 @@ static void ffs_dump_fsinfo(fsinfo_t *f) { + ffs_opt_t *fs = f->fs_specific; + printf("fsopts at %p\n", f); printf("\tsize %lld, inodes %lld, curinode %u\n", @@ -409,20 +446,20 @@ ffs_dump_fsinfo(fsinfo_t *f) printf("\tneedswap %d, sectorsize %d\n", f->needswap, f->sectorsize); printf("\tbsize %d, fsize %d, cpg %d, density %d\n", - f->bsize, f->fsize, f->cpg, f->density); + fs->bsize, fs->fsize, fs->cpg, fs->density); printf("\tnsectors %d, rpm %d, minfree %d\n", - f->nsectors, f->rpm, f->minfree); + fs->nsectors, fs->rpm, fs->minfree); printf("\tmaxcontig %d, maxbpg %d\n", - f->maxcontig, f->maxbpg); + fs->maxcontig, fs->maxbpg); printf("\toptimization %s\n", - f->optimization == FS_OPTSPACE ? "space" : "time"); + fs->optimization == FS_OPTSPACE ? "space" : "time"); } static int ffs_create_image(const char *image, fsinfo_t *fsopts) { -#if HAVE_STRUCT_STATVFS_F_IOSIZE +#if HAVE_STRUCT_STATVFS_F_IOSIZE && HAVE_FSTATVFS struct statvfs sfs; #endif struct fs *fs; @@ -434,18 +471,18 @@ ffs_create_image(const char *image, fsin assert (fsopts != NULL); /* create image */ - if ((fsopts->fd = open(image, O_RDWR | O_CREAT | O_TRUNC, 0777)) + if ((fsopts->fd = open(image, O_RDWR | O_CREAT | O_TRUNC, 0666)) == -1) { warn("Can't open `%s' for writing", image); return (-1); } /* zero image */ -#if HAVE_STRUCT_STATVFS_F_IOSIZE +#if HAVE_STRUCT_STATVFS_F_IOSIZE && HAVE_FSTATVFS if (fstatvfs(fsopts->fd, &sfs) == -1) { #endif bufsize = 8192; -#if HAVE_STRUCT_STATVFS_F_IOSIZE +#if HAVE_STRUCT_STATVFS_F_IOSIZE && HAVE_FSTATVFS warn("can't fstatvfs `%s', using default %d byte chunk", image, bufsize); } else @@ -465,10 +502,12 @@ ffs_create_image(const char *image, fsin if (i == -1) { warn("zeroing image, %lld bytes to go", (long long)bufrem); + free(buf); return (-1); } bufrem -= i; } + free(buf); /* make the file system */ if (debug & DEBUG_FS_CREATE_IMAGE) @@ -492,7 +531,7 @@ ffs_create_image(const char *image, fsin warnx( "Image file `%s' has %lld free inodes; %lld are required.", image, - (long long)fs->fs_cstotal.cs_nifree + ROOTINO, + (long long)(fs->fs_cstotal.cs_nifree + ROOTINO), (long long)fsopts->inodes); return (-1); } @@ -506,9 +545,11 @@ ffs_size_dir(fsnode *root, fsinfo_t *fso struct direct tmpdir; fsnode * node; int curdirsize, this; + ffs_opt_t *ffs_opts = fsopts->fs_specific; /* node may be NULL (empty directory) */ assert(fsopts != NULL); + assert(ffs_opts != NULL); if (debug & DEBUG_FS_SIZE_DIR) printf("ffs_size_dir: entry: bytes %lld inodes %lld\n", @@ -516,7 +557,7 @@ ffs_size_dir(fsnode *root, fsinfo_t *fso #define ADDDIRENT(e) do { \ tmpdir.d_namlen = strlen((e)); \ - this = DIRSIZ_SWAP(0, &tmpdir, 0); \ + this = DIRSIZ_SWAP(0, &tmpdir, 0); \ if (debug & DEBUG_FS_SIZE_DIR_ADD_DIRENT) \ printf("ADDDIRENT: was: %s (%d) this %d cur %d\n", \ e, tmpdir.d_namlen, this, curdirsize); \ @@ -533,14 +574,12 @@ ffs_size_dir(fsnode *root, fsinfo_t *fso * by indirect blocks, etc. */ #define ADDSIZE(x) do { \ - fsopts->size += roundup((x), fsopts->fsize); \ + fsopts->size += roundup((x), ffs_opts->fsize); \ } while (0); curdirsize = 0; for (node = root; node != NULL; node = node->next) { ADDDIRENT(node->name); - if (FSNODE_EXCLUDE_P(fsopts, node)) - continue; if (node == root) { /* we're at "." */ assert(strcmp(node->name, ".") == 0); ADDDIRENT(".."); @@ -558,7 +597,7 @@ ffs_size_dir(fsnode *root, fsinfo_t *fso int slen; slen = strlen(node->symlink) + 1; - if (slen >= (fsopts->version == 1 ? + if (slen >= (ffs_opts->version == 1 ? MAXSYMLINKLEN_UFS1 : MAXSYMLINKLEN_UFS2)) ADDSIZE(slen); @@ -682,10 +721,12 @@ ffs_populate_dir(const char *dir, fsnode union dinode din; void *membuf; char path[MAXPATHLEN + 1]; + ffs_opt_t *ffs_opts = fsopts->fs_specific; assert(dir != NULL); assert(root != NULL); assert(fsopts != NULL); + assert(ffs_opts != NULL); (void)memset(&dirbuf, 0, sizeof(dirbuf)); @@ -696,8 +737,6 @@ ffs_populate_dir(const char *dir, fsnode * pass 1: allocate inode numbers, build directory `file' */ for (cur = root; cur != NULL; cur = cur->next) { - if (FSNODE_EXCLUDE_P(fsopts, cur)) - continue; if ((cur->inode->flags & FI_ALLOCATED) == 0) { cur->inode->flags |= FI_ALLOCATED; if (cur == root && cur->parent != NULL) @@ -732,8 +771,6 @@ ffs_populate_dir(const char *dir, fsnode if (debug & DEBUG_FS_POPULATE) printf("ffs_populate_dir: PASS 2 dir %s\n", dir); for (cur = root; cur != NULL; cur = cur->next) { - if (FSNODE_EXCLUDE_P(fsopts, cur)) - continue; if (cur->inode->flags & FI_WRITTEN) continue; /* skip hard-linked entries */ cur->inode->flags |= FI_WRITTEN; @@ -746,7 +783,7 @@ ffs_populate_dir(const char *dir, fsnode continue; /* child creates own inode */ /* build on-disk inode */ - if (fsopts->version == 1) + if (ffs_opts->version == 1) membuf = ffs_build_dinode1(&din.ffs1_din, &dirbuf, cur, root, fsopts); else @@ -777,8 +814,6 @@ ffs_populate_dir(const char *dir, fsnode if (debug & DEBUG_FS_POPULATE) printf("ffs_populate_dir: PASS 3 dir %s\n", dir); for (cur = root; cur != NULL; cur = cur->next) { - if (FSNODE_EXCLUDE_P(fsopts, cur)) - continue; if (cur->child == NULL) continue; if (snprintf(path, sizeof(path), "%s/%s", dir, cur->name) @@ -804,16 +839,20 @@ ffs_write_file(union dinode *din, uint32 int isfile, ffd; char *fbuf, *p; off_t bufleft, chunk, offset; + ssize_t nread; struct inode in; struct buf * bp; + ffs_opt_t *ffs_opts = fsopts->fs_specific; assert (din != NULL); assert (buf != NULL); assert (fsopts != NULL); + assert (ffs_opts != NULL); isfile = S_ISREG(DIP(din, mode)); fbuf = NULL; ffd = -1; + p = NULL; in.i_fs = (struct fs *)fsopts->superblock; @@ -830,7 +869,7 @@ ffs_write_file(union dinode *din, uint32 in.i_number = ino; in.i_size = DIP(din, size); - if (fsopts->version == 1) + if (ffs_opts->version == 1) memcpy(&in.i_din.ffs1_din, &din->ffs1_din, sizeof(in.i_din.ffs1_din)); else @@ -842,7 +881,7 @@ ffs_write_file(union dinode *din, uint32 goto write_inode_and_leave; /* mmm, cheating */ if (isfile) { - if ((fbuf = malloc(fsopts->bsize)) == NULL) + if ((fbuf = malloc(ffs_opts->bsize)) == NULL) err(1, "Allocating memory for write buffer"); if ((ffd = open((char *)buf, O_RDONLY, 0444)) == -1) { warn("Can't open `%s' for reading", (char *)buf); @@ -854,13 +893,20 @@ ffs_write_file(union dinode *din, uint32 chunk = 0; for (bufleft = DIP(din, size); bufleft > 0; bufleft -= chunk) { - chunk = MIN(bufleft, fsopts->bsize); - if (isfile) { - if (read(ffd, fbuf, chunk) != chunk) - err(1, "Reading `%s', %lld bytes to go", - (char *)buf, (long long)bufleft); + chunk = MIN(bufleft, ffs_opts->bsize); + if (!isfile) + ; + else if ((nread = read(ffd, fbuf, chunk)) == -1) + err(EXIT_FAILURE, "Reading `%s', %lld bytes to go", + (char *)buf, (long long)bufleft); + else if (nread != chunk) + errx(EXIT_FAILURE, "Reading `%s', %lld bytes to go, " + "read %zd bytes, expected %ju bytes, does " + "metalog size= attribute mismatch source size?", + (char *)buf, (long long)bufleft, nread, + (uintmax_t)chunk); + else p = fbuf; - } offset = DIP(din, size) - bufleft; if (debug & DEBUG_FS_WRITE_FILE_BLOCK) printf( @@ -932,7 +978,7 @@ ffs_make_dirbuf(dirbuf_t *dbuf, const ch { struct direct de, *dp; uint16_t llen, reclen; - char *newbuf; + u_char *newbuf; assert (dbuf != NULL); assert (name != NULL); @@ -969,7 +1015,7 @@ ffs_make_dirbuf(dirbuf_t *dbuf, const ch dbuf->size += DIRBLKSIZ; memset(dbuf->buf + dbuf->size - DIRBLKSIZ, 0, DIRBLKSIZ); dbuf->cur = dbuf->size - DIRBLKSIZ; - } else { /* shrink end of previous */ + } else if (dp) { /* shrink end of previous */ dp->d_reclen = ufs_rw16(llen,needswap); dbuf->cur += llen; } @@ -993,10 +1039,12 @@ ffs_write_inode(union dinode *dp, uint32 daddr_t d; char sbbuf[FFS_MAXBSIZE]; int32_t initediblk; + ffs_opt_t *ffs_opts = fsopts->fs_specific; assert (dp != NULL); assert (ino > 0); assert (fsopts != NULL); + assert (ffs_opts != NULL); fs = (struct fs *)fsopts->superblock; cg = ino_to_cg(fs, ino); @@ -1041,7 +1089,7 @@ ffs_write_inode(union dinode *dp, uint32 * Initialize inode blocks on the fly for UFS2. */ initediblk = ufs_rw32(cgp->cg_initediblk, fsopts->needswap); - if (fsopts->version == 2 && cgino + INOPB(fs) > initediblk && + if (ffs_opts->version == 2 && cgino + INOPB(fs) > initediblk && initediblk < ufs_rw32(cgp->cg_niblk, fsopts->needswap)) { memset(buf, 0, fs->fs_bsize); dip = (struct ufs2_dinode *)buf; @@ -1065,14 +1113,14 @@ ffs_write_inode(union dinode *dp, uint32 d = fsbtodb(fs, ino_to_fsba(fs, ino)); ffs_rdfs(d, fs->fs_bsize, buf, fsopts); if (fsopts->needswap) { - if (fsopts->version == 1) + if (ffs_opts->version == 1) ffs_dinode1_swap(&dp->ffs1_din, &dp1[ino_to_fsbo(fs, ino)]); else ffs_dinode2_swap(&dp->ffs2_din, &dp2[ino_to_fsbo(fs, ino)]); } else { - if (fsopts->version == 1) + if (ffs_opts->version == 1) dp1[ino_to_fsbo(fs, ino)] = dp->ffs1_din; else dp2[ino_to_fsbo(fs, ino)] = dp->ffs2_din; Copied: stable/8/usr.sbin/makefs/ffs.h (from r214921, head/usr.sbin/makefs/ffs.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/usr.sbin/makefs/ffs.h Tue Jul 26 14:41:54 2011 (r224447, copy of r214921, head/usr.sbin/makefs/ffs.h) @@ -0,0 +1,66 @@ +/* $NetBSD: ffs.h,v 1.1 2004/12/20 20:51:42 jmc Exp $ */ + +/* + * Copyright (c) 2001-2003 Wasabi Systems, Inc. + * All rights reserved. + * + * Written by Luke Mewburn for Wasabi Systems, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed for the NetBSD Project by + * Wasabi Systems, Inc. + * 4. The name of Wasabi Systems, Inc. may not be used to endorse + * or promote products derived from this software without specific prior + * written permission. + * + * THIS SOFTWARE IS PROVIDED BY WASABI SYSTEMS, INC. ``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 WASABI SYSTEMS, INC + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _FFS_H +#define _FFS_H + +typedef struct { + int bsize; /* block size */ + int fsize; /* fragment size */ + int cpg; /* cylinders per group */ + int cpgflg; /* cpg was specified by user */ + int density; /* bytes per inode */ + int ntracks; /* number of tracks */ + int nsectors; /* number of sectors */ + int rpm; /* rpm */ + int minfree; /* free space threshold */ + int optimization; /* optimization (space or time) */ + int maxcontig; /* max contiguous blocks to allocate */ + int rotdelay; /* rotational delay between blocks */ + int maxbpg; /* maximum blocks per file in a cyl group */ + int nrpos; /* # of distinguished rotational positions */ + int avgfilesize; /* expected average file size */ + int avgfpdir; /* expected # of files per directory */ + int version; /* filesystem version (1 = FFS, 2 = UFS2) */ + int maxbsize; /* maximum extent size */ + int maxblkspercg; /* max # of blocks per cylinder group */ + /* XXX: support `old' file systems ? */ +} ffs_opt_t; + +#endif /* _FFS_H */ Copied: stable/8/usr.sbin/makefs/ffs/Makefile.inc (from r214921, head/usr.sbin/makefs/ffs/Makefile.inc) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/usr.sbin/makefs/ffs/Makefile.inc Tue Jul 26 14:41:54 2011 (r224447, copy of r214921, head/usr.sbin/makefs/ffs/Makefile.inc) @@ -0,0 +1,9 @@ +# $FreeBSD$ +# + +.PATH: ${.CURDIR}/ffs ${.CURDIR}/../../sys/ufs/ffs + +CFLAGS+= -I${.CURDIR}/../../sys/ufs/ffs + +SRCS+= ffs_alloc.c ffs_balloc.c ffs_bswap.c ffs_subr.c ufs_bmap.c +SRCS+= buf.c mkfs.c Modified: stable/8/usr.sbin/makefs/ffs/buf.c ============================================================================== --- stable/8/usr.sbin/makefs/ffs/buf.c Tue Jul 26 14:41:28 2011 (r224446) +++ stable/8/usr.sbin/makefs/ffs/buf.c Tue Jul 26 14:41:54 2011 (r224447) @@ -118,7 +118,7 @@ brelse(struct buf *bp) bp->b_bcount = 0; return; } - + TAILQ_REMOVE(&buftail, bp, b_tailq); free(bp->b_data); free(bp); @@ -160,7 +160,7 @@ bcleanup(void) * know why there's still some buffers lying around that * aren't brelse()d */ - + if (TAILQ_EMPTY(&buftail)) return; @@ -201,7 +201,7 @@ getblk(int fd, struct fs *fs, daddr_t bl if (bp == NULL) { if ((bp = calloc(1, sizeof(struct buf))) == NULL) err(1, "getblk: calloc"); - + bp->b_bufsize = 0; bp->b_blkno = bp->b_lblkno = blkno; bp->b_fd = fd; Modified: stable/8/usr.sbin/makefs/ffs/ffs_alloc.c ============================================================================== --- stable/8/usr.sbin/makefs/ffs/ffs_alloc.c Tue Jul 26 14:41:28 2011 (r224446) +++ stable/8/usr.sbin/makefs/ffs/ffs_alloc.c Tue Jul 26 14:41:54 2011 (r224447) @@ -87,7 +87,7 @@ static int32_t ffs_mapsearch(struct fs * * available block is located. */ int -ffs_alloc(struct inode *ip, daddr_t lbn, daddr_t bpref, int size, +ffs_alloc(struct inode *ip, daddr_t lbn __unused, daddr_t bpref, int size, daddr_t *bnp) { struct fs *fs = ip->i_fs; @@ -95,7 +95,7 @@ ffs_alloc(struct inode *ip, daddr_t lbn, int cg; *bnp = 0; - if ((u_int)size > fs->fs_bsize || fragoff(fs, size) != 0) { + if (size > fs->fs_bsize || fragoff(fs, size) != 0) { errx(1, "ffs_alloc: bad size: bsize %d size %d", fs->fs_bsize, size); } @@ -187,11 +187,7 @@ ffs_blkpref_ufs1(struct inode *ip, daddr } daddr_t -ffs_blkpref_ufs2(ip, lbn, indx, bap) - struct inode *ip; - daddr_t lbn; - int indx; - int64_t *bap; +ffs_blkpref_ufs2(struct inode *ip, daddr_t lbn, int indx, int64_t *bap) { struct fs *fs; int cg; @@ -385,11 +381,11 @@ ffs_alloccgblk(struct inode *ip, struct int32_t bno; struct fs *fs = ip->i_fs; const int needswap = UFS_FSNEEDSWAP(fs); - u_int8_t *blksfree; + u_int8_t *blksfree_swap; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable@FreeBSD.ORG Tue Jul 26 14:41:55 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 17C00106566B; Tue, 26 Jul 2011 14:41:55 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 04C1E8FC1C; Tue, 26 Jul 2011 14:41:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6QEftV9013593; Tue, 26 Jul 2011 14:41:55 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6QEfsuF013575; Tue, 26 Jul 2011 14:41:54 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107261441.p6QEfsuF013575@svn.freebsd.org> From: Marius Strobl Date: Tue, 26 Jul 2011 14:41:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224448 - in stable/7/usr.sbin/makefs: . cd9660 compat ffs X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jul 2011 14:41:55 -0000 Author: marius Date: Tue Jul 26 14:41:54 2011 New Revision: 224448 URL: http://svn.freebsd.org/changeset/base/224448 Log: MFC: r214921, r219954, r219956, r221387, r221470, r221536, r222191 - Sync with the latest version from NetBSD. It notably addds ISO9660 support. - Add support for synthesizing an APM partition map to map Mac PowerPC bootstrap partitions from the ISO9660 boot catalog. This preserves OS X's ability to mount the CD, while allowing us a way to provide HFS-ified bootstrap code for Open Firmware. - Add analogs to the -chrp-boot and -prep-boot options to mkisofs. Added: stable/7/usr.sbin/makefs/cd9660/ - copied from r214921, head/usr.sbin/makefs/cd9660/ stable/7/usr.sbin/makefs/cd9660.c - copied, changed from r214921, head/usr.sbin/makefs/cd9660.c stable/7/usr.sbin/makefs/cd9660.h - copied, changed from r214921, head/usr.sbin/makefs/cd9660.h stable/7/usr.sbin/makefs/compat/Makefile.inc - copied unchanged from r214921, head/usr.sbin/makefs/compat/Makefile.inc stable/7/usr.sbin/makefs/ffs.h - copied unchanged from r214921, head/usr.sbin/makefs/ffs.h stable/7/usr.sbin/makefs/ffs/Makefile.inc - copied unchanged from r214921, head/usr.sbin/makefs/ffs/Makefile.inc Modified: stable/7/usr.sbin/makefs/Makefile stable/7/usr.sbin/makefs/cd9660/cd9660_eltorito.c stable/7/usr.sbin/makefs/cd9660/cd9660_strings.c stable/7/usr.sbin/makefs/ffs.c stable/7/usr.sbin/makefs/ffs/buf.c stable/7/usr.sbin/makefs/ffs/ffs_alloc.c stable/7/usr.sbin/makefs/ffs/mkfs.c stable/7/usr.sbin/makefs/makefs.8 stable/7/usr.sbin/makefs/makefs.c stable/7/usr.sbin/makefs/makefs.h stable/7/usr.sbin/makefs/walk.c Directory Properties: stable/7/usr.sbin/makefs/ (props changed) stable/7/usr.sbin/makefs/ffs/ffs_bswap.c (props changed) stable/7/usr.sbin/makefs/ffs/ffs_subr.c (props changed) stable/7/usr.sbin/makefs/ffs/ufs_bswap.h (props changed) stable/7/usr.sbin/makefs/getid.c (props changed) Modified: stable/7/usr.sbin/makefs/Makefile ============================================================================== --- stable/7/usr.sbin/makefs/Makefile Tue Jul 26 14:41:54 2011 (r224447) +++ stable/7/usr.sbin/makefs/Makefile Tue Jul 26 14:41:54 2011 (r224448) @@ -1,22 +1,23 @@ # $FreeBSD$ PROG= makefs + +CFLAGS+=-I${.CURDIR} + +SRCS= cd9660.c ffs.c \ + getid.c \ + makefs.c \ + walk.c MAN= makefs.8 WARNS?= 2 -CFLAGS+=-I${.CURDIR} -SRCS= ffs.c getid.c makefs.c walk.c +.include "${.CURDIR}/cd9660/Makefile.inc" +.include "${.CURDIR}/ffs/Makefile.inc" +.include "${.CURDIR}/compat/Makefile.inc" -.PATH: ${.CURDIR}/ffs -CFLAGS+=-I${.CURDIR}/ffs CFLAGS+=-DHAVE_STRUCT_STAT_ST_FLAGS=1 CFLAGS+=-DHAVE_STRUCT_STAT_ST_GEN=1 -SRCS+= buf.c ffs_alloc.c ffs_balloc.c ffs_bswap.c ffs_subr.c mkfs.c ufs_bmap.c - -.PATH: ${.CURDIR}/compat -CFLAGS+=-I${.CURDIR}/compat -SRCS+= pwcache.c strsuftoll.c .PATH: ${.CURDIR}/../mtree CFLAGS+=-I${.CURDIR}/../mtree Copied and modified: stable/7/usr.sbin/makefs/cd9660.c (from r214921, head/usr.sbin/makefs/cd9660.c) ============================================================================== --- head/usr.sbin/makefs/cd9660.c Sun Nov 7 16:05:04 2010 (r214921, copy source) +++ stable/7/usr.sbin/makefs/cd9660.c Tue Jul 26 14:41:54 2011 (r224448) @@ -207,6 +207,7 @@ cd9660_set_defaults(void) diskStructure.rr_moved_dir = 0; diskStructure.archimedes_enabled = 0; + diskStructure.chrp_boot = 0; diskStructure.include_padding_areas = 1; @@ -391,6 +392,8 @@ cd9660_parse_opts(const char *option, fs diskStructure.rock_ridge_enabled = 1; else if (CD9660_IS_COMMAND_ARG_DUAL(var, "A", "archimedes")) diskStructure.archimedes_enabled = 1; + else if (CD9660_IS_COMMAND_ARG(var, "chrp-boot")) + diskStructure.chrp_boot = 1; else if (CD9660_IS_COMMAND_ARG_DUAL(var, "K", "keep-bad-images")) diskStructure.keep_bad_images = 1; else if (CD9660_IS_COMMAND_ARG(var, "allow-deep-trees")) Copied and modified: stable/7/usr.sbin/makefs/cd9660.h (from r214921, head/usr.sbin/makefs/cd9660.h) ============================================================================== --- head/usr.sbin/makefs/cd9660.h Sun Nov 7 16:05:04 2010 (r214921, copy source) +++ stable/7/usr.sbin/makefs/cd9660.h Tue Jul 26 14:41:54 2011 (r224448) @@ -285,6 +285,7 @@ typedef struct _iso9660_disk { cd9660node *rr_moved_dir; int archimedes_enabled; + int chrp_boot; /* Spec breaking options */ u_char allow_deep_trees; Modified: stable/7/usr.sbin/makefs/cd9660/cd9660_eltorito.c ============================================================================== --- head/usr.sbin/makefs/cd9660/cd9660_eltorito.c Sun Nov 7 16:05:04 2010 (r214921) +++ stable/7/usr.sbin/makefs/cd9660/cd9660_eltorito.c Tue Jul 26 14:41:54 2011 (r224448) @@ -31,6 +31,9 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. */ + +#include + #include "cd9660.h" #include "cd9660_eltorito.h" @@ -497,11 +500,79 @@ cd9660_setup_boot_volume_descriptor(volu return 1; } +static int +cd9660_write_mbr_partition_entry(FILE *fd, int index, off_t sector_start, + off_t nsectors, int type) +{ + uint8_t val; + uint32_t lba; + + fseeko(fd, (off_t)(index) * 16 + 0x1be, SEEK_SET); + + val = 0x80; /* Bootable */ + fwrite(&val, sizeof(val), 1, fd); + + val = 0xff; /* CHS begin */ + fwrite(&val, sizeof(val), 1, fd); + fwrite(&val, sizeof(val), 1, fd); + fwrite(&val, sizeof(val), 1, fd); + + val = type; /* Part type */ + fwrite(&val, sizeof(val), 1, fd); + + val = 0xff; /* CHS end */ + fwrite(&val, sizeof(val), 1, fd); + fwrite(&val, sizeof(val), 1, fd); + fwrite(&val, sizeof(val), 1, fd); + + /* LBA extent */ + lba = htole32(sector_start); + fwrite(&lba, sizeof(lba), 1, fd); + lba = htole32(nsectors); + fwrite(&lba, sizeof(lba), 1, fd); + + return (0); +} + +static int +cd9660_write_apm_partition_entry(FILE *fd, int index, int total_partitions, + off_t sector_start, off_t nsectors, off_t sector_size, + const char *part_name, const char *part_type) +{ + uint32_t apm32; + uint16_t apm16; + + fseeko(fd, (off_t)(index + 1) * sector_size, SEEK_SET); + + /* Signature */ + apm16 = htobe16(0x504d); + fwrite(&apm16, sizeof(apm16), 1, fd); + apm16 = 0; + fwrite(&apm16, sizeof(apm16), 1, fd); + + /* Total number of partitions */ + apm32 = htobe32(total_partitions); + fwrite(&apm32, sizeof(apm32), 1, fd); + /* Bounds */ + apm32 = htobe32(sector_start); + fwrite(&apm32, sizeof(apm32), 1, fd); + apm32 = htobe32(nsectors); + fwrite(&apm32, sizeof(apm32), 1, fd); + + fwrite(part_name, strlen(part_name) + 1, 1, fd); + fseek(fd, 32 - strlen(part_name) - 1, SEEK_CUR); + fwrite(part_type, strlen(part_type) + 1, 1, fd); + + return 0; +} + int cd9660_write_boot(FILE *fd) { struct boot_catalog_entry *e; struct cd9660_boot_image *t; + int apm_partitions = 0; + int mbr_partitions = 0; /* write boot catalog */ if (fseeko(fd, (off_t)diskStructure.boot_catalog_sector * @@ -533,7 +604,88 @@ cd9660_write_boot(FILE *fd) t->filename, t->sector); } cd9660_copy_file(fd, t->sector, t->filename); + + if (t->system == ET_SYS_MAC) + apm_partitions++; + if (t->system == ET_SYS_PPC) + mbr_partitions++; + } + + /* some systems need partition tables as well */ + if (mbr_partitions > 0 || diskStructure.chrp_boot) { + uint16_t sig; + + fseek(fd, 0x1fe, SEEK_SET); + sig = htole16(0xaa55); + fwrite(&sig, sizeof(sig), 1, fd); + + mbr_partitions = 0; + + /* Write ISO9660 descriptor, enclosing the whole disk */ + if (diskStructure.chrp_boot) + cd9660_write_mbr_partition_entry(fd, mbr_partitions++, + 0, diskStructure.totalSectors * + (diskStructure.sectorSize / 512), 0x96); + + /* Write all partition entries */ + TAILQ_FOREACH(t, &diskStructure.boot_images, image_list) { + if (t->system != ET_SYS_PPC) + continue; + cd9660_write_mbr_partition_entry(fd, mbr_partitions++, + t->sector * (diskStructure.sectorSize / 512), + t->num_sectors * (diskStructure.sectorSize / 512), + 0x41 /* PReP Boot */); + } + } + + if (apm_partitions > 0) { + /* Write DDR and global APM info */ + uint32_t apm32; + uint16_t apm16; + int total_parts; + + fseek(fd, 0, SEEK_SET); + apm16 = htobe16(0x4552); + fwrite(&apm16, sizeof(apm16), 1, fd); + /* Device block size */ + apm16 = htobe16(512); + fwrite(&apm16, sizeof(apm16), 1, fd); + /* Device block count */ + apm32 = htobe32(diskStructure.totalSectors * + (diskStructure.sectorSize / 512)); + fwrite(&apm32, sizeof(apm32), 1, fd); + /* Device type/id */ + apm16 = htobe16(1); + fwrite(&apm16, sizeof(apm16), 1, fd); + fwrite(&apm16, sizeof(apm16), 1, fd); + + /* Count total needed entries */ + total_parts = 2 + apm_partitions; /* Self + ISO9660 */ + + /* Write self-descriptor */ + cd9660_write_apm_partition_entry(fd, 0, total_parts, 1, + total_parts, 512, "Apple", "Apple_partition_map"); + + /* Write ISO9660 descriptor, enclosing the whole disk */ + cd9660_write_apm_partition_entry(fd, 1, total_parts, 0, + diskStructure.totalSectors * + (diskStructure.sectorSize / 512), 512, "ISO9660", + "CD_ROM_Mode_1"); + + /* Write all partition entries */ + apm_partitions = 0; + TAILQ_FOREACH(t, &diskStructure.boot_images, image_list) { + if (t->system != ET_SYS_MAC) + continue; + + cd9660_write_apm_partition_entry(fd, + 2 + apm_partitions++, total_parts, + t->sector * (diskStructure.sectorSize / 512), + t->num_sectors * (diskStructure.sectorSize / 512), + 512, "CD Boot", "Apple_Bootstrap"); + } } return 0; } + Modified: stable/7/usr.sbin/makefs/cd9660/cd9660_strings.c ============================================================================== --- head/usr.sbin/makefs/cd9660/cd9660_strings.c Sun Nov 7 16:05:04 2010 (r214921) +++ stable/7/usr.sbin/makefs/cd9660/cd9660_strings.c Tue Jul 26 14:41:54 2011 (r224448) @@ -55,19 +55,19 @@ cd9660_uppercase_characters(char *str, i } static inline int -cd9660_is_a_char(char c) +cd9660_is_d_char(char c) { return (isupper((unsigned char)c) || c == '_' - || (c >= '0' && c <= '?')); + || (c >= '0' && c <= '9')); } static inline int -cd9660_is_d_char(char c) +cd9660_is_a_char(char c) { return (isupper((unsigned char)c) || c == '_' - || (c >= '%' && c <= '9') + || (c >= '%' && c <= '?') || (c >= ' ' && c <= '\"')); } Copied: stable/7/usr.sbin/makefs/compat/Makefile.inc (from r214921, head/usr.sbin/makefs/compat/Makefile.inc) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/usr.sbin/makefs/compat/Makefile.inc Tue Jul 26 14:41:54 2011 (r224448, copy of r214921, head/usr.sbin/makefs/compat/Makefile.inc) @@ -0,0 +1,8 @@ +# $FreeBSD$ +# + +.PATH: ${.CURDIR}/compat + +CFLAGS+= -I${.CURDIR}/compat + +SRCS+= pwcache.c strsuftoll.c Modified: stable/7/usr.sbin/makefs/ffs.c ============================================================================== --- stable/7/usr.sbin/makefs/ffs.c Tue Jul 26 14:41:54 2011 (r224447) +++ stable/7/usr.sbin/makefs/ffs.c Tue Jul 26 14:41:54 2011 (r224448) @@ -1,4 +1,4 @@ -/* $NetBSD: ffs.c,v 1.30 2004/06/24 22:30:13 lukem Exp $ */ +/* $NetBSD: ffs.c,v 1.44 2009/04/28 22:49:26 joerg Exp $ */ /* * Copyright (c) 2001 Wasabi Systems, Inc. @@ -76,17 +76,24 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include #include #include "makefs.h" +#include "ffs.h" + +#if HAVE_STRUCT_STATVFS_F_IOSIZE && HAVE_FSTATVFS +#include +#endif #include #include #include + #include "ffs/ufs_bswap.h" #include "ffs/ufs_inode.h" #include "ffs/newfs_extern.h" @@ -94,7 +101,7 @@ __FBSDID("$FreeBSD$"); #undef DIP #define DIP(dp, field) \ - ((fsopts->version == 1) ? \ + ((ffs_opts->version == 1) ? \ (dp)->ffs1_din.di_##field : (dp)->ffs2_din.di_##field) /* @@ -139,39 +146,71 @@ int sectorsize; /* XXX: for buf.c::getb /* publically visible functions */ +void +ffs_prep_opts(fsinfo_t *fsopts) +{ + ffs_opt_t *ffs_opts; + + if ((ffs_opts = calloc(1, sizeof(ffs_opt_t))) == NULL) + err(1, "Allocating memory for ffs_options"); + + fsopts->fs_specific = ffs_opts; + + ffs_opts->bsize= -1; + ffs_opts->fsize= -1; + ffs_opts->cpg= -1; + ffs_opts->density= -1; + ffs_opts->minfree= -1; + ffs_opts->optimization= -1; + ffs_opts->maxcontig= -1; + ffs_opts->maxbpg= -1; + ffs_opts->avgfilesize= -1; + ffs_opts->avgfpdir= -1; + ffs_opts->version = 1; +} + +void +ffs_cleanup_opts(fsinfo_t *fsopts) +{ + if (fsopts->fs_specific) + free(fsopts->fs_specific); +} + int ffs_parse_opts(const char *option, fsinfo_t *fsopts) { + ffs_opt_t *ffs_opts = fsopts->fs_specific; + option_t ffs_options[] = { - { "bsize", &fsopts->bsize, 1, INT_MAX, + { "bsize", &ffs_opts->bsize, 1, INT_MAX, "block size" }, - { "fsize", &fsopts->fsize, 1, INT_MAX, + { "fsize", &ffs_opts->fsize, 1, INT_MAX, "fragment size" }, - { "density", &fsopts->density, 1, INT_MAX, + { "density", &ffs_opts->density, 1, INT_MAX, "bytes per inode" }, - { "minfree", &fsopts->minfree, 0, 99, + { "minfree", &ffs_opts->minfree, 0, 99, "minfree" }, - { "maxbpf", &fsopts->maxbpg, 1, INT_MAX, + { "maxbpf", &ffs_opts->maxbpg, 1, INT_MAX, "max blocks per file in a cg" }, - { "avgfilesize", &fsopts->avgfilesize, 1, INT_MAX, + { "avgfilesize", &ffs_opts->avgfilesize,1, INT_MAX, "expected average file size" }, - { "avgfpdir", &fsopts->avgfpdir, 1, INT_MAX, + { "avgfpdir", &ffs_opts->avgfpdir, 1, INT_MAX, "expected # of files per directory" }, - { "extent", &fsopts->maxbsize, 1, INT_MAX, + { "extent", &ffs_opts->maxbsize, 1, INT_MAX, "maximum # extent size" }, - { "maxbpcg", &fsopts->maxblkspercg, 1, INT_MAX, + { "maxbpcg", &ffs_opts->maxblkspercg,1, INT_MAX, "max # of blocks per group" }, - { "version", &fsopts->version, 1, 2, + { "version", &ffs_opts->version, 1, 2, "UFS version" }, - { NULL } + { .name = NULL } }; char *var, *val; int rv; - (void)&ffs_options; assert(option != NULL); assert(fsopts != NULL); + assert(ffs_opts != NULL); if (debug & DEBUG_FS_PARSE_OPTS) printf("ffs_parse_opts: got `%s'\n", option); @@ -188,9 +227,9 @@ ffs_parse_opts(const char *option, fsinf if (strcmp(var, "optimization") == 0) { if (strcmp(val, "time") == 0) { - fsopts->optimization = FS_OPTTIME; + ffs_opts->optimization = FS_OPTTIME; } else if (strcmp(val, "space") == 0) { - fsopts->optimization = FS_OPTSPACE; + ffs_opts->optimization = FS_OPTSPACE; } else { warnx("Invalid optimization `%s'", val); goto leave_ffs_parse_opts; @@ -277,11 +316,12 @@ ffs_validate(const char *dir, fsnode *ro #if notyet int32_t spc, nspf, ncyl, fssize; #endif - off_t size; + ffs_opt_t *ffs_opts = fsopts->fs_specific; assert(dir != NULL); assert(root != NULL); assert(fsopts != NULL); + assert(ffs_opts != NULL); if (debug & DEBUG_FS_VALIDATE) { printf("ffs_validate: before defaults set:\n"); @@ -291,31 +331,31 @@ ffs_validate(const char *dir, fsnode *ro /* set FFS defaults */ if (fsopts->sectorsize == -1) fsopts->sectorsize = DFL_SECSIZE; - if (fsopts->fsize == -1) - fsopts->fsize = MAX(DFL_FRAGSIZE, fsopts->sectorsize); - if (fsopts->bsize == -1) - fsopts->bsize = MIN(DFL_BLKSIZE, 8 * fsopts->fsize); - if (fsopts->cpg == -1) - fsopts->cpg = DFL_CYLSPERGROUP; + if (ffs_opts->fsize == -1) + ffs_opts->fsize = MAX(DFL_FRAGSIZE, fsopts->sectorsize); + if (ffs_opts->bsize == -1) + ffs_opts->bsize = MIN(DFL_BLKSIZE, 8 * ffs_opts->fsize); + if (ffs_opts->cpg == -1) + ffs_opts->cpg = DFL_CYLSPERGROUP; else - fsopts->cpgflg = 1; + ffs_opts->cpgflg = 1; /* fsopts->density is set below */ - if (fsopts->nsectors == -1) - fsopts->nsectors = DFL_NSECTORS; - if (fsopts->minfree == -1) - fsopts->minfree = MINFREE; - if (fsopts->optimization == -1) - fsopts->optimization = DEFAULTOPT; - if (fsopts->maxcontig == -1) - fsopts->maxcontig = - MAX(1, MIN(MAXPHYS, FFS_MAXBSIZE) / fsopts->bsize); + if (ffs_opts->nsectors == -1) + ffs_opts->nsectors = DFL_NSECTORS; + if (ffs_opts->minfree == -1) + ffs_opts->minfree = MINFREE; + if (ffs_opts->optimization == -1) + ffs_opts->optimization = DEFAULTOPT; + if (ffs_opts->maxcontig == -1) + ffs_opts->maxcontig = + MAX(1, MIN(MAXPHYS, FFS_MAXBSIZE) / ffs_opts->bsize); /* XXX ondisk32 */ - if (fsopts->maxbpg == -1) - fsopts->maxbpg = fsopts->bsize / sizeof(int32_t); - if (fsopts->avgfilesize == -1) - fsopts->avgfilesize = AVFILESIZ; - if (fsopts->avgfpdir == -1) - fsopts->avgfpdir = AFPDIR; + if (ffs_opts->maxbpg == -1) + ffs_opts->maxbpg = ffs_opts->bsize / sizeof(int32_t); + if (ffs_opts->avgfilesize == -1) + ffs_opts->avgfilesize = AVFILESIZ; + if (ffs_opts->avgfpdir == -1) + ffs_opts->avgfpdir = AFPDIR; /* calculate size of tree */ ffs_size_dir(root, fsopts); @@ -343,17 +383,19 @@ ffs_validate(const char *dir, fsnode *ro */ fsopts->size += (SBLOCK_UFS1 + SBLOCKSIZE) * ncg; /* add space needed to store inodes, x3 for blockmaps, etc */ - if (fsopts->version == 1) + if (ffs_opts->version == 1) fsopts->size += ncg * DINODE1_SIZE * - roundup(fsopts->inodes / ncg, fsopts->bsize / DINODE1_SIZE); + roundup(fsopts->inodes / ncg, + ffs_opts->bsize / DINODE1_SIZE); else fsopts->size += ncg * DINODE2_SIZE * - roundup(fsopts->inodes / ncg, fsopts->bsize / DINODE2_SIZE); + roundup(fsopts->inodes / ncg, + ffs_opts->bsize / DINODE2_SIZE); /* add minfree */ - if (fsopts->minfree > 0) + if (ffs_opts->minfree > 0) fsopts->size = - fsopts->size * (100 + fsopts->minfree) / 100; + fsopts->size * (100 + ffs_opts->minfree) / 100; /* * XXX any other fs slop to add, such as csum's, bitmaps, etc ?? */ @@ -362,24 +404,11 @@ ffs_validate(const char *dir, fsnode *ro fsopts->size = fsopts->minsize; /* round up to the next block */ - size = roundup(fsopts->size, fsopts->bsize); - - /* now check calculated sizes vs requested sizes */ - if (fsopts->maxsize > 0 && size > fsopts->maxsize) { - if (debug & DEBUG_FS_VALIDATE) { - printf("%s: `%s' size of %lld is larger than the " - "maxsize of %lld; rounding down to %lld.", - __func__, dir, (long long)size, - (long long)fsopts->maxsize, - (long long) rounddown(fsopts->size, fsopts->bsize)); - } - size = rounddown(fsopts->size, fsopts->bsize); - } - fsopts->size = size; + fsopts->size = roundup(fsopts->size, ffs_opts->bsize); /* calculate density if necessary */ - if (fsopts->density == -1) - fsopts->density = fsopts->size / fsopts->inodes + 1; + if (ffs_opts->density == -1) + ffs_opts->density = fsopts->size / fsopts->inodes + 1; if (debug & DEBUG_FS_VALIDATE) { printf("ffs_validate: after defaults set:\n"); @@ -388,6 +417,12 @@ ffs_validate(const char *dir, fsnode *ro dir, (long long)fsopts->size, (long long)fsopts->inodes); } sectorsize = fsopts->sectorsize; /* XXX - see earlier */ + + /* now check calculated sizes vs requested sizes */ + if (fsopts->maxsize > 0 && fsopts->size > fsopts->maxsize) { + errx(1, "`%s' size of %lld is larger than the maxsize of %lld.", + dir, (long long)fsopts->size, (long long)fsopts->maxsize); + } } @@ -395,6 +430,8 @@ static void ffs_dump_fsinfo(fsinfo_t *f) { + ffs_opt_t *fs = f->fs_specific; + printf("fsopts at %p\n", f); printf("\tsize %lld, inodes %lld, curinode %u\n", @@ -409,20 +446,20 @@ ffs_dump_fsinfo(fsinfo_t *f) printf("\tneedswap %d, sectorsize %d\n", f->needswap, f->sectorsize); printf("\tbsize %d, fsize %d, cpg %d, density %d\n", - f->bsize, f->fsize, f->cpg, f->density); + fs->bsize, fs->fsize, fs->cpg, fs->density); printf("\tnsectors %d, rpm %d, minfree %d\n", - f->nsectors, f->rpm, f->minfree); + fs->nsectors, fs->rpm, fs->minfree); printf("\tmaxcontig %d, maxbpg %d\n", - f->maxcontig, f->maxbpg); + fs->maxcontig, fs->maxbpg); printf("\toptimization %s\n", - f->optimization == FS_OPTSPACE ? "space" : "time"); + fs->optimization == FS_OPTSPACE ? "space" : "time"); } static int ffs_create_image(const char *image, fsinfo_t *fsopts) { -#if HAVE_STRUCT_STATVFS_F_IOSIZE +#if HAVE_STRUCT_STATVFS_F_IOSIZE && HAVE_FSTATVFS struct statvfs sfs; #endif struct fs *fs; @@ -434,18 +471,18 @@ ffs_create_image(const char *image, fsin assert (fsopts != NULL); /* create image */ - if ((fsopts->fd = open(image, O_RDWR | O_CREAT | O_TRUNC, 0777)) + if ((fsopts->fd = open(image, O_RDWR | O_CREAT | O_TRUNC, 0666)) == -1) { warn("Can't open `%s' for writing", image); return (-1); } /* zero image */ -#if HAVE_STRUCT_STATVFS_F_IOSIZE +#if HAVE_STRUCT_STATVFS_F_IOSIZE && HAVE_FSTATVFS if (fstatvfs(fsopts->fd, &sfs) == -1) { #endif bufsize = 8192; -#if HAVE_STRUCT_STATVFS_F_IOSIZE +#if HAVE_STRUCT_STATVFS_F_IOSIZE && HAVE_FSTATVFS warn("can't fstatvfs `%s', using default %d byte chunk", image, bufsize); } else @@ -465,10 +502,12 @@ ffs_create_image(const char *image, fsin if (i == -1) { warn("zeroing image, %lld bytes to go", (long long)bufrem); + free(buf); return (-1); } bufrem -= i; } + free(buf); /* make the file system */ if (debug & DEBUG_FS_CREATE_IMAGE) @@ -492,7 +531,7 @@ ffs_create_image(const char *image, fsin warnx( "Image file `%s' has %lld free inodes; %lld are required.", image, - (long long)fs->fs_cstotal.cs_nifree + ROOTINO, + (long long)(fs->fs_cstotal.cs_nifree + ROOTINO), (long long)fsopts->inodes); return (-1); } @@ -506,9 +545,11 @@ ffs_size_dir(fsnode *root, fsinfo_t *fso struct direct tmpdir; fsnode * node; int curdirsize, this; + ffs_opt_t *ffs_opts = fsopts->fs_specific; /* node may be NULL (empty directory) */ assert(fsopts != NULL); + assert(ffs_opts != NULL); if (debug & DEBUG_FS_SIZE_DIR) printf("ffs_size_dir: entry: bytes %lld inodes %lld\n", @@ -516,7 +557,7 @@ ffs_size_dir(fsnode *root, fsinfo_t *fso #define ADDDIRENT(e) do { \ tmpdir.d_namlen = strlen((e)); \ - this = DIRSIZ_SWAP(0, &tmpdir, 0); \ + this = DIRSIZ_SWAP(0, &tmpdir, 0); \ if (debug & DEBUG_FS_SIZE_DIR_ADD_DIRENT) \ printf("ADDDIRENT: was: %s (%d) this %d cur %d\n", \ e, tmpdir.d_namlen, this, curdirsize); \ @@ -533,14 +574,12 @@ ffs_size_dir(fsnode *root, fsinfo_t *fso * by indirect blocks, etc. */ #define ADDSIZE(x) do { \ - fsopts->size += roundup((x), fsopts->fsize); \ + fsopts->size += roundup((x), ffs_opts->fsize); \ } while (0); curdirsize = 0; for (node = root; node != NULL; node = node->next) { ADDDIRENT(node->name); - if (FSNODE_EXCLUDE_P(fsopts, node)) - continue; if (node == root) { /* we're at "." */ assert(strcmp(node->name, ".") == 0); ADDDIRENT(".."); @@ -558,7 +597,7 @@ ffs_size_dir(fsnode *root, fsinfo_t *fso int slen; slen = strlen(node->symlink) + 1; - if (slen >= (fsopts->version == 1 ? + if (slen >= (ffs_opts->version == 1 ? MAXSYMLINKLEN_UFS1 : MAXSYMLINKLEN_UFS2)) ADDSIZE(slen); @@ -682,10 +721,12 @@ ffs_populate_dir(const char *dir, fsnode union dinode din; void *membuf; char path[MAXPATHLEN + 1]; + ffs_opt_t *ffs_opts = fsopts->fs_specific; assert(dir != NULL); assert(root != NULL); assert(fsopts != NULL); + assert(ffs_opts != NULL); (void)memset(&dirbuf, 0, sizeof(dirbuf)); @@ -696,8 +737,6 @@ ffs_populate_dir(const char *dir, fsnode * pass 1: allocate inode numbers, build directory `file' */ for (cur = root; cur != NULL; cur = cur->next) { - if (FSNODE_EXCLUDE_P(fsopts, cur)) - continue; if ((cur->inode->flags & FI_ALLOCATED) == 0) { cur->inode->flags |= FI_ALLOCATED; if (cur == root && cur->parent != NULL) @@ -732,8 +771,6 @@ ffs_populate_dir(const char *dir, fsnode if (debug & DEBUG_FS_POPULATE) printf("ffs_populate_dir: PASS 2 dir %s\n", dir); for (cur = root; cur != NULL; cur = cur->next) { - if (FSNODE_EXCLUDE_P(fsopts, cur)) - continue; if (cur->inode->flags & FI_WRITTEN) continue; /* skip hard-linked entries */ cur->inode->flags |= FI_WRITTEN; @@ -746,7 +783,7 @@ ffs_populate_dir(const char *dir, fsnode continue; /* child creates own inode */ /* build on-disk inode */ - if (fsopts->version == 1) + if (ffs_opts->version == 1) membuf = ffs_build_dinode1(&din.ffs1_din, &dirbuf, cur, root, fsopts); else @@ -777,8 +814,6 @@ ffs_populate_dir(const char *dir, fsnode if (debug & DEBUG_FS_POPULATE) printf("ffs_populate_dir: PASS 3 dir %s\n", dir); for (cur = root; cur != NULL; cur = cur->next) { - if (FSNODE_EXCLUDE_P(fsopts, cur)) - continue; if (cur->child == NULL) continue; if (snprintf(path, sizeof(path), "%s/%s", dir, cur->name) @@ -804,16 +839,20 @@ ffs_write_file(union dinode *din, uint32 int isfile, ffd; char *fbuf, *p; off_t bufleft, chunk, offset; + ssize_t nread; struct inode in; struct buf * bp; + ffs_opt_t *ffs_opts = fsopts->fs_specific; assert (din != NULL); assert (buf != NULL); assert (fsopts != NULL); + assert (ffs_opts != NULL); isfile = S_ISREG(DIP(din, mode)); fbuf = NULL; ffd = -1; + p = NULL; in.i_fs = (struct fs *)fsopts->superblock; @@ -830,7 +869,7 @@ ffs_write_file(union dinode *din, uint32 in.i_number = ino; in.i_size = DIP(din, size); - if (fsopts->version == 1) + if (ffs_opts->version == 1) memcpy(&in.i_din.ffs1_din, &din->ffs1_din, sizeof(in.i_din.ffs1_din)); else @@ -842,7 +881,7 @@ ffs_write_file(union dinode *din, uint32 goto write_inode_and_leave; /* mmm, cheating */ if (isfile) { - if ((fbuf = malloc(fsopts->bsize)) == NULL) + if ((fbuf = malloc(ffs_opts->bsize)) == NULL) err(1, "Allocating memory for write buffer"); if ((ffd = open((char *)buf, O_RDONLY, 0444)) == -1) { warn("Can't open `%s' for reading", (char *)buf); @@ -854,13 +893,20 @@ ffs_write_file(union dinode *din, uint32 chunk = 0; for (bufleft = DIP(din, size); bufleft > 0; bufleft -= chunk) { - chunk = MIN(bufleft, fsopts->bsize); - if (isfile) { - if (read(ffd, fbuf, chunk) != chunk) - err(1, "Reading `%s', %lld bytes to go", - (char *)buf, (long long)bufleft); + chunk = MIN(bufleft, ffs_opts->bsize); + if (!isfile) + ; + else if ((nread = read(ffd, fbuf, chunk)) == -1) + err(EXIT_FAILURE, "Reading `%s', %lld bytes to go", + (char *)buf, (long long)bufleft); + else if (nread != chunk) + errx(EXIT_FAILURE, "Reading `%s', %lld bytes to go, " + "read %zd bytes, expected %ju bytes, does " + "metalog size= attribute mismatch source size?", + (char *)buf, (long long)bufleft, nread, + (uintmax_t)chunk); + else p = fbuf; - } offset = DIP(din, size) - bufleft; if (debug & DEBUG_FS_WRITE_FILE_BLOCK) printf( @@ -932,7 +978,7 @@ ffs_make_dirbuf(dirbuf_t *dbuf, const ch { struct direct de, *dp; uint16_t llen, reclen; - char *newbuf; + u_char *newbuf; assert (dbuf != NULL); assert (name != NULL); @@ -969,7 +1015,7 @@ ffs_make_dirbuf(dirbuf_t *dbuf, const ch dbuf->size += DIRBLKSIZ; memset(dbuf->buf + dbuf->size - DIRBLKSIZ, 0, DIRBLKSIZ); dbuf->cur = dbuf->size - DIRBLKSIZ; - } else { /* shrink end of previous */ + } else if (dp) { /* shrink end of previous */ dp->d_reclen = ufs_rw16(llen,needswap); dbuf->cur += llen; } @@ -993,10 +1039,12 @@ ffs_write_inode(union dinode *dp, uint32 daddr_t d; char sbbuf[FFS_MAXBSIZE]; int32_t initediblk; + ffs_opt_t *ffs_opts = fsopts->fs_specific; assert (dp != NULL); assert (ino > 0); assert (fsopts != NULL); + assert (ffs_opts != NULL); fs = (struct fs *)fsopts->superblock; cg = ino_to_cg(fs, ino); @@ -1041,7 +1089,7 @@ ffs_write_inode(union dinode *dp, uint32 * Initialize inode blocks on the fly for UFS2. */ initediblk = ufs_rw32(cgp->cg_initediblk, fsopts->needswap); - if (fsopts->version == 2 && cgino + INOPB(fs) > initediblk && + if (ffs_opts->version == 2 && cgino + INOPB(fs) > initediblk && initediblk < ufs_rw32(cgp->cg_niblk, fsopts->needswap)) { memset(buf, 0, fs->fs_bsize); dip = (struct ufs2_dinode *)buf; @@ -1065,14 +1113,14 @@ ffs_write_inode(union dinode *dp, uint32 d = fsbtodb(fs, ino_to_fsba(fs, ino)); ffs_rdfs(d, fs->fs_bsize, buf, fsopts); if (fsopts->needswap) { - if (fsopts->version == 1) + if (ffs_opts->version == 1) ffs_dinode1_swap(&dp->ffs1_din, &dp1[ino_to_fsbo(fs, ino)]); else ffs_dinode2_swap(&dp->ffs2_din, &dp2[ino_to_fsbo(fs, ino)]); } else { - if (fsopts->version == 1) + if (ffs_opts->version == 1) dp1[ino_to_fsbo(fs, ino)] = dp->ffs1_din; else dp2[ino_to_fsbo(fs, ino)] = dp->ffs2_din; Copied: stable/7/usr.sbin/makefs/ffs.h (from r214921, head/usr.sbin/makefs/ffs.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/usr.sbin/makefs/ffs.h Tue Jul 26 14:41:54 2011 (r224448, copy of r214921, head/usr.sbin/makefs/ffs.h) @@ -0,0 +1,66 @@ +/* $NetBSD: ffs.h,v 1.1 2004/12/20 20:51:42 jmc Exp $ */ + +/* + * Copyright (c) 2001-2003 Wasabi Systems, Inc. + * All rights reserved. + * + * Written by Luke Mewburn for Wasabi Systems, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed for the NetBSD Project by + * Wasabi Systems, Inc. + * 4. The name of Wasabi Systems, Inc. may not be used to endorse + * or promote products derived from this software without specific prior + * written permission. + * + * THIS SOFTWARE IS PROVIDED BY WASABI SYSTEMS, INC. ``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 WASABI SYSTEMS, INC + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _FFS_H +#define _FFS_H + +typedef struct { + int bsize; /* block size */ + int fsize; /* fragment size */ + int cpg; /* cylinders per group */ + int cpgflg; /* cpg was specified by user */ + int density; /* bytes per inode */ + int ntracks; /* number of tracks */ + int nsectors; /* number of sectors */ + int rpm; /* rpm */ + int minfree; /* free space threshold */ + int optimization; /* optimization (space or time) */ + int maxcontig; /* max contiguous blocks to allocate */ + int rotdelay; /* rotational delay between blocks */ + int maxbpg; /* maximum blocks per file in a cyl group */ + int nrpos; /* # of distinguished rotational positions */ + int avgfilesize; /* expected average file size */ + int avgfpdir; /* expected # of files per directory */ + int version; /* filesystem version (1 = FFS, 2 = UFS2) */ + int maxbsize; /* maximum extent size */ + int maxblkspercg; /* max # of blocks per cylinder group */ + /* XXX: support `old' file systems ? */ +} ffs_opt_t; + +#endif /* _FFS_H */ Copied: stable/7/usr.sbin/makefs/ffs/Makefile.inc (from r214921, head/usr.sbin/makefs/ffs/Makefile.inc) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/usr.sbin/makefs/ffs/Makefile.inc Tue Jul 26 14:41:54 2011 (r224448, copy of r214921, head/usr.sbin/makefs/ffs/Makefile.inc) @@ -0,0 +1,9 @@ +# $FreeBSD$ +# + +.PATH: ${.CURDIR}/ffs ${.CURDIR}/../../sys/ufs/ffs + +CFLAGS+= -I${.CURDIR}/../../sys/ufs/ffs + +SRCS+= ffs_alloc.c ffs_balloc.c ffs_bswap.c ffs_subr.c ufs_bmap.c +SRCS+= buf.c mkfs.c Modified: stable/7/usr.sbin/makefs/ffs/buf.c ============================================================================== --- stable/7/usr.sbin/makefs/ffs/buf.c Tue Jul 26 14:41:54 2011 (r224447) +++ stable/7/usr.sbin/makefs/ffs/buf.c Tue Jul 26 14:41:54 2011 (r224448) @@ -118,7 +118,7 @@ brelse(struct buf *bp) bp->b_bcount = 0; return; } - + TAILQ_REMOVE(&buftail, bp, b_tailq); free(bp->b_data); free(bp); @@ -160,7 +160,7 @@ bcleanup(void) * know why there's still some buffers lying around that * aren't brelse()d */ - + if (TAILQ_EMPTY(&buftail)) return; @@ -201,7 +201,7 @@ getblk(int fd, struct fs *fs, daddr_t bl if (bp == NULL) { if ((bp = calloc(1, sizeof(struct buf))) == NULL) err(1, "getblk: calloc"); - + bp->b_bufsize = 0; bp->b_blkno = bp->b_lblkno = blkno; bp->b_fd = fd; Modified: stable/7/usr.sbin/makefs/ffs/ffs_alloc.c ============================================================================== --- stable/7/usr.sbin/makefs/ffs/ffs_alloc.c Tue Jul 26 14:41:54 2011 (r224447) +++ stable/7/usr.sbin/makefs/ffs/ffs_alloc.c Tue Jul 26 14:41:54 2011 (r224448) @@ -87,7 +87,7 @@ static int32_t ffs_mapsearch(struct fs * * available block is located. */ int -ffs_alloc(struct inode *ip, daddr_t lbn, daddr_t bpref, int size, +ffs_alloc(struct inode *ip, daddr_t lbn __unused, daddr_t bpref, int size, daddr_t *bnp) { struct fs *fs = ip->i_fs; @@ -95,7 +95,7 @@ ffs_alloc(struct inode *ip, daddr_t lbn, int cg; *bnp = 0; - if ((u_int)size > fs->fs_bsize || fragoff(fs, size) != 0) { + if (size > fs->fs_bsize || fragoff(fs, size) != 0) { errx(1, "ffs_alloc: bad size: bsize %d size %d", fs->fs_bsize, size); } @@ -187,11 +187,7 @@ ffs_blkpref_ufs1(struct inode *ip, daddr } daddr_t -ffs_blkpref_ufs2(ip, lbn, indx, bap) - struct inode *ip; - daddr_t lbn; - int indx; - int64_t *bap; +ffs_blkpref_ufs2(struct inode *ip, daddr_t lbn, int indx, int64_t *bap) { struct fs *fs; int cg; @@ -385,11 +381,11 @@ ffs_alloccgblk(struct inode *ip, struct int32_t bno; struct fs *fs = ip->i_fs; const int needswap = UFS_FSNEEDSWAP(fs); - u_int8_t *blksfree; + u_int8_t *blksfree_swap; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable@FreeBSD.ORG Tue Jul 26 16:14:58 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 01162106564A; Tue, 26 Jul 2011 16:14:58 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E4F538FC13; Tue, 26 Jul 2011 16:14:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6QGEvOR016464; Tue, 26 Jul 2011 16:14:57 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6QGEvRA016462; Tue, 26 Jul 2011 16:14:57 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201107261614.p6QGEvRA016462@svn.freebsd.org> From: Jaakko Heinonen Date: Tue, 26 Jul 2011 16:14:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224449 - stable/7/sys/kern X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jul 2011 16:14:58 -0000 Author: jh Date: Tue Jul 26 16:14:57 2011 New Revision: 224449 URL: http://svn.freebsd.org/changeset/base/224449 Log: MFC r219925: Recognize "ro", "rdonly", "norw", "rw" and "noro" as equal options in vfs_equalopts(). This allows vfs_sanitizeopts() to filter redundant occurrences of these options. It was possible that for example both "ro" and "rw" options became active concurrently. PR: kern/133614 MFC r220040: Fix some style issues in r219925. Modified: stable/7/sys/kern/vfs_mount.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/kern/vfs_mount.c ============================================================================== --- stable/7/sys/kern/vfs_mount.c Tue Jul 26 14:41:54 2011 (r224448) +++ stable/7/sys/kern/vfs_mount.c Tue Jul 26 16:14:57 2011 (r224449) @@ -195,6 +195,25 @@ vfs_deleteopt(struct vfsoptlist *opts, c } } +static int +vfs_isopt_ro(const char *opt) +{ + + if (strcmp(opt, "ro") == 0 || strcmp(opt, "rdonly") == 0 || + strcmp(opt, "norw") == 0) + return (1); + return (0); +} + +static int +vfs_isopt_rw(const char *opt) +{ + + if (strcmp(opt, "rw") == 0 || strcmp(opt, "noro") == 0) + return (1); + return (0); +} + /* * Check if options are equal (with or without the "no" prefix). */ @@ -211,6 +230,10 @@ vfs_equalopts(const char *opt1, const ch /* "opt" vs. "noopt" */ if (strncmp(opt2, "no", 2) == 0 && strcmp(opt1, opt2 + 2) == 0) return (1); + /* "ro" / "rdonly" / "norw" / "rw" / "noro" */ + if ((vfs_isopt_ro(opt1) || vfs_isopt_rw(opt1)) && + (vfs_isopt_ro(opt2) || vfs_isopt_rw(opt2))) + return (1); return (0); } From owner-svn-src-stable@FreeBSD.ORG Tue Jul 26 17:02:18 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 95EE7106564A; Tue, 26 Jul 2011 17:02:18 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 856258FC13; Tue, 26 Jul 2011 17:02:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6QH2Ib6018134; Tue, 26 Jul 2011 17:02:18 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6QH2I29018132; Tue, 26 Jul 2011 17:02:18 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201107261702.p6QH2I29018132@svn.freebsd.org> From: Glen Barber Date: Tue, 26 Jul 2011 17:02:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224450 - stable/8/usr.sbin/faithd X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jul 2011 17:02:18 -0000 Author: gjb (doc committer) Date: Tue Jul 26 17:02:17 2011 New Revision: 224450 URL: http://svn.freebsd.org/changeset/base/224450 Log: MFC 202386, 224284: 202386 (by ru): Use the newly brought %U macro. 224284: Fix various broken links in manual pages. PR: 159138 Modified: stable/8/usr.sbin/faithd/faithd.8 Directory Properties: stable/8/usr.sbin/faithd/ (props changed) Modified: stable/8/usr.sbin/faithd/faithd.8 ============================================================================== --- stable/8/usr.sbin/faithd/faithd.8 Tue Jul 26 16:14:57 2011 (r224449) +++ stable/8/usr.sbin/faithd/faithd.8 Tue Jul 26 17:02:17 2011 (r224450) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 9, 2010 +.Dd July 23, 2011 .Dt FAITHD 8 .Os .Sh NAME @@ -368,7 +368,7 @@ setting. .%A Kazu Yamamoto .%T "An IPv6-to-IPv4 transport relay translator" .%B RFC3142 -.%O ftp://ftp.isi.edu/in-notes/rfc3142.txt +.%U http://www.ietf.org/rfc/rfc3142.txt .%D June 2001 .Re .\" From owner-svn-src-stable@FreeBSD.ORG Tue Jul 26 17:02:54 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 33A92106566C; Tue, 26 Jul 2011 17:02:54 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 07E328FC0C; Tue, 26 Jul 2011 17:02:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6QH2rZV018190; Tue, 26 Jul 2011 17:02:53 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6QH2rmG018188; Tue, 26 Jul 2011 17:02:53 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201107261702.p6QH2rmG018188@svn.freebsd.org> From: Glen Barber Date: Tue, 26 Jul 2011 17:02:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224451 - stable/7/usr.sbin/faithd X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jul 2011 17:02:54 -0000 Author: gjb (doc committer) Date: Tue Jul 26 17:02:53 2011 New Revision: 224451 URL: http://svn.freebsd.org/changeset/base/224451 Log: MFC 202386, 224284: 202386 (by ru): Use the newly brought %U macro. 224284: Fix various broken links in manual pages. PR: 159138 Modified: stable/7/usr.sbin/faithd/faithd.8 Directory Properties: stable/7/usr.sbin/faithd/ (props changed) Modified: stable/7/usr.sbin/faithd/faithd.8 ============================================================================== --- stable/7/usr.sbin/faithd/faithd.8 Tue Jul 26 17:02:17 2011 (r224450) +++ stable/7/usr.sbin/faithd/faithd.8 Tue Jul 26 17:02:53 2011 (r224451) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 9, 2010 +.Dd July 23, 2011 .Dt FAITHD 8 .Os .Sh NAME @@ -368,7 +368,7 @@ setting. .%A Kazu Yamamoto .%T "An IPv6-to-IPv4 transport relay translator" .%B RFC3142 -.%O ftp://ftp.isi.edu/in-notes/rfc3142.txt +.%U http://www.ietf.org/rfc/rfc3142.txt .%D June 2001 .Re .\" From owner-svn-src-stable@FreeBSD.ORG Tue Jul 26 17:09:45 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4B4601065670; Tue, 26 Jul 2011 17:09:45 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3AE818FC0A; Tue, 26 Jul 2011 17:09:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6QH9jil018517; Tue, 26 Jul 2011 17:09:45 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6QH9jpQ018515; Tue, 26 Jul 2011 17:09:45 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201107261709.p6QH9jpQ018515@svn.freebsd.org> From: Glen Barber Date: Tue, 26 Jul 2011 17:09:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224452 - stable/8/share/man/man8 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jul 2011 17:09:45 -0000 Author: gjb (doc committer) Date: Tue Jul 26 17:09:44 2011 New Revision: 224452 URL: http://svn.freebsd.org/changeset/base/224452 Log: MFC 224284: Fix various broken links in manual pages. PR: 159137 Modified: stable/8/share/man/man8/crash.8 Directory Properties: stable/8/share/man/man8/ (props changed) Modified: stable/8/share/man/man8/crash.8 ============================================================================== --- stable/8/share/man/man8/crash.8 Tue Jul 26 17:02:53 2011 (r224451) +++ stable/8/share/man/man8/crash.8 Tue Jul 26 17:09:44 2011 (r224452) @@ -36,7 +36,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 2, 1996 +.Dd July 23, 2011 .Dt CRASH 8 .Os .Sh NAME @@ -207,7 +207,7 @@ the panic message is printed. For more details consult the chapter on kernel debugging in the .%B "FreeBSD Developers' Handbook" -.Pq Pa http://www.FreeBSD.org/ . +.Pq Pa http://www.freebsd.org/doc/en/books/developers-handbook/ . .Sh SEE ALSO .Xr kgdb 1 , .Xr dumpon 8 , From owner-svn-src-stable@FreeBSD.ORG Tue Jul 26 17:10:25 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ECFBE106566B; Tue, 26 Jul 2011 17:10:25 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DCA438FC18; Tue, 26 Jul 2011 17:10:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6QHAPce018584; Tue, 26 Jul 2011 17:10:25 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6QHAPgx018582; Tue, 26 Jul 2011 17:10:25 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201107261710.p6QHAPgx018582@svn.freebsd.org> From: Glen Barber Date: Tue, 26 Jul 2011 17:10:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224453 - stable/7/share/man/man8 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jul 2011 17:10:26 -0000 Author: gjb (doc committer) Date: Tue Jul 26 17:10:25 2011 New Revision: 224453 URL: http://svn.freebsd.org/changeset/base/224453 Log: MFC 224284: Fix various broken links in manual pages. PR: 159137 Modified: stable/7/share/man/man8/crash.8 Directory Properties: stable/7/share/man/man8/ (props changed) Modified: stable/7/share/man/man8/crash.8 ============================================================================== --- stable/7/share/man/man8/crash.8 Tue Jul 26 17:09:44 2011 (r224452) +++ stable/7/share/man/man8/crash.8 Tue Jul 26 17:10:25 2011 (r224453) @@ -36,7 +36,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 2, 1996 +.Dd July 23, 2011 .Dt CRASH 8 .Os .Sh NAME @@ -207,7 +207,7 @@ the panic message is printed. For more details consult the chapter on kernel debugging in the .%B "FreeBSD Developers' Handbook" -.Pq Pa http://www.FreeBSD.org/ . +.Pq Pa http://www.freebsd.org/doc/en/books/developers-handbook/ . .Sh SEE ALSO .Xr kgdb 1 , .Xr dumpon 8 , From owner-svn-src-stable@FreeBSD.ORG Tue Jul 26 17:16:14 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0FF95106564A; Tue, 26 Jul 2011 17:16:14 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F3CD88FC14; Tue, 26 Jul 2011 17:16:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6QHGDEc018841; Tue, 26 Jul 2011 17:16:13 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6QHGDLL018839; Tue, 26 Jul 2011 17:16:13 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201107261716.p6QHGDLL018839@svn.freebsd.org> From: Glen Barber Date: Tue, 26 Jul 2011 17:16:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224454 - stable/8/share/man/man5 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jul 2011 17:16:14 -0000 Author: gjb (doc committer) Date: Tue Jul 26 17:16:13 2011 New Revision: 224454 URL: http://svn.freebsd.org/changeset/base/224454 Log: MFC 224284: Fix various broken links in manual pages. PR: 159136 Modified: stable/8/share/man/man5/reiserfs.5 Directory Properties: stable/8/share/man/man5/ (props changed) Modified: stable/8/share/man/man5/reiserfs.5 ============================================================================== --- stable/8/share/man/man5/reiserfs.5 Tue Jul 26 17:10:25 2011 (r224453) +++ stable/8/share/man/man5/reiserfs.5 Tue Jul 26 17:16:13 2011 (r224454) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 16, 2006 +.Dd July 23, 2011 .Dt REISERFS 5 .Os .Sh NAME @@ -74,7 +74,6 @@ first appeared in .An -nosplit The ReiserFS kernel implementation was written by .An Hans Reiser -.Pq Pa http://www.namesys.com/ , and ported to .Fx by From owner-svn-src-stable@FreeBSD.ORG Tue Jul 26 17:16:56 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4644A106568A; Tue, 26 Jul 2011 17:16:56 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3626F8FC17; Tue, 26 Jul 2011 17:16:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6QHGu5R018896; Tue, 26 Jul 2011 17:16:56 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6QHGuqf018894; Tue, 26 Jul 2011 17:16:56 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201107261716.p6QHGuqf018894@svn.freebsd.org> From: Glen Barber Date: Tue, 26 Jul 2011 17:16:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224455 - stable/7/share/man/man5 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jul 2011 17:16:56 -0000 Author: gjb (doc committer) Date: Tue Jul 26 17:16:55 2011 New Revision: 224455 URL: http://svn.freebsd.org/changeset/base/224455 Log: MFC 224284: Fix various broken links in manual pages. PR: 159136 Modified: stable/7/share/man/man5/reiserfs.5 Directory Properties: stable/7/share/man/man5/ (props changed) Modified: stable/7/share/man/man5/reiserfs.5 ============================================================================== --- stable/7/share/man/man5/reiserfs.5 Tue Jul 26 17:16:13 2011 (r224454) +++ stable/7/share/man/man5/reiserfs.5 Tue Jul 26 17:16:55 2011 (r224455) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 16, 2006 +.Dd July 23, 2011 .Dt REISERFS 5 .Os .Sh NAME @@ -74,7 +74,6 @@ first appeared in .An -nosplit The ReiserFS kernel implementation was written by .An Hans Reiser -.Pq Pa http://www.namesys.com/ , and ported to .Fx by From owner-svn-src-stable@FreeBSD.ORG Tue Jul 26 17:38:50 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 910151065674; Tue, 26 Jul 2011 17:38:50 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7D5198FC19; Tue, 26 Jul 2011 17:38:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6QHcoY8019679; Tue, 26 Jul 2011 17:38:50 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6QHcnm3019640; Tue, 26 Jul 2011 17:38:49 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201107261738.p6QHcnm3019640@svn.freebsd.org> From: Glen Barber Date: Tue, 26 Jul 2011 17:38:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224456 - in stable/8/share/man/man4: . man4.i386 man4.sparc64 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jul 2011 17:38:50 -0000 Author: gjb (doc committer) Date: Tue Jul 26 17:38:49 2011 New Revision: 224456 URL: http://svn.freebsd.org/changeset/base/224456 Log: MFC 202386, 224284: 202386 (by ru): Use the newly brought %U macro. 224284: Fix various broken links in manual pages. PR: 159130 159131 159132 159133 PR: 159134 159135 159144 Modified: stable/8/share/man/man4/acpi.4 stable/8/share/man/man4/acpi_asus.4 stable/8/share/man/man4/aue.4 stable/8/share/man/man4/axe.4 stable/8/share/man/man4/cdce.4 stable/8/share/man/man4/dc.4 stable/8/share/man/man4/gif.4 stable/8/share/man/man4/hme.4 stable/8/share/man/man4/lge.4 stable/8/share/man/man4/lmc.4 stable/8/share/man/man4/mac.4 stable/8/share/man/man4/man4.i386/vpd.4 stable/8/share/man/man4/man4.sparc64/ebus.4 stable/8/share/man/man4/mpt.4 stable/8/share/man/man4/ndis.4 stable/8/share/man/man4/nge.4 stable/8/share/man/man4/pcm.4 stable/8/share/man/man4/pcn.4 stable/8/share/man/man4/psm.4 stable/8/share/man/man4/ral.4 stable/8/share/man/man4/re.4 stable/8/share/man/man4/rl.4 stable/8/share/man/man4/rue.4 stable/8/share/man/man4/rum.4 stable/8/share/man/man4/sf.4 stable/8/share/man/man4/sis.4 stable/8/share/man/man4/sk.4 stable/8/share/man/man4/smbus.4 stable/8/share/man/man4/snd_uaudio.4 stable/8/share/man/man4/ste.4 stable/8/share/man/man4/stf.4 stable/8/share/man/man4/targ.4 stable/8/share/man/man4/udav.4 stable/8/share/man/man4/ural.4 stable/8/share/man/man4/urio.4 stable/8/share/man/man4/urtw.4 stable/8/share/man/man4/vr.4 stable/8/share/man/man4/wi.4 Directory Properties: stable/8/share/man/man4/ (props changed) Modified: stable/8/share/man/man4/acpi.4 ============================================================================== --- stable/8/share/man/man4/acpi.4 Tue Jul 26 17:16:55 2011 (r224455) +++ stable/8/share/man/man4/acpi.4 Tue Jul 26 17:38:49 2011 (r224456) @@ -585,7 +585,7 @@ ACPI is only found and supported on i386 .%A "Toshiba Corporation" .%D August 25, 2003 .%T "Advanced Configuration and Power Interface Specification" -.%O http://acpi.info/spec.htm +.%U http://acpi.info/spec.htm .Re .Sh AUTHORS .An -nosplit Modified: stable/8/share/man/man4/acpi_asus.4 ============================================================================== --- stable/8/share/man/man4/acpi_asus.4 Tue Jul 26 17:16:55 2011 (r224455) +++ stable/8/share/man/man4/acpi_asus.4 Tue Jul 26 17:38:49 2011 (r224456) @@ -162,7 +162,7 @@ which is parsed at boot-time. .Xr sysctl 8 .Rs .%T The acpi4asus Project -.%O http://sourceforge.net/projects/acpi4asus/ +.%U http://sourceforge.net/projects/acpi4asus/ .Re .Sh HISTORY The Modified: stable/8/share/man/man4/aue.4 ============================================================================== --- stable/8/share/man/man4/aue.4 Tue Jul 26 17:16:55 2011 (r224455) +++ stable/8/share/man/man4/aue.4 Tue Jul 26 17:38:49 2011 (r224456) @@ -193,7 +193,7 @@ The driver failed to allocate an mbuf fo .Xr ifconfig 8 .Rs .%T ADMtek AN986 data sheet -.%O http://www.admtek.com.tw +.%U http://www.admtek.com.tw .Re .Sh HISTORY The Modified: stable/8/share/man/man4/axe.4 ============================================================================== --- stable/8/share/man/man4/axe.4 Tue Jul 26 17:16:55 2011 (r224455) +++ stable/8/share/man/man4/axe.4 Tue Jul 26 17:38:49 2011 (r224456) @@ -241,7 +241,7 @@ The driver failed to allocate an mbuf fo .Xr ifconfig 8 .Rs .%T "ASIX AX88x7x and AX88760 data sheets" -.%O http://www.asix.com.tw +.%U http://www.asix.com.tw .Re .Sh HISTORY The Modified: stable/8/share/man/man4/cdce.4 ============================================================================== --- stable/8/share/man/man4/cdce.4 Tue Jul 26 17:16:55 2011 (r224455) +++ stable/8/share/man/man4/cdce.4 Tue Jul 26 17:38:49 2011 (r224456) @@ -120,11 +120,11 @@ is running low on mbufs. .Xr ifconfig 8 .Rs .%T "Universal Serial Bus Class Definitions for Communication Devices" -.%O http://www.usb.org/developers/devclass_docs/usbcdc11.pdf +.%U http://www.usb.org/developers/devclass_docs/usbcdc11.pdf .Re .Rs .%T "Data sheet Prolific PL-2501 Host-to-Host Bridge/Network Controller" -.%O http://tech.prolific.com.tw/visitor/fcabdl.asp?fid=20679530 +.%U http://tech.prolific.com.tw/visitor/fcabdl.asp?fid=20679530 .Re .Sh HISTORY The Modified: stable/8/share/man/man4/dc.4 ============================================================================== --- stable/8/share/man/man4/dc.4 Tue Jul 26 17:16:55 2011 (r224455) +++ stable/8/share/man/man4/dc.4 Tue Jul 26 17:38:49 2011 (r224456) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 16, 2005 +.Dd July 23, 2011 .Dt DC 4 .Os .Sh NAME @@ -351,27 +351,27 @@ the card should be configured correctly. .Xr ifconfig 8 .Rs .%T ADMtek AL981, AL983 and AL985 data sheets -.%O http://www.admtek.com.tw +.%U http://www.admtek.com.tw .Re .Rs .%T ASIX Electronics AX88140A and AX88141 data sheets -.%O http://www.asix.com.tw +.%U http://www.asix.com.tw .Re .Rs .%T Davicom DM9102 data sheet -.%O http://www.davicom8.com +.%U http://www.davicom.com.tw/userfile/24247/DM9102H-DS-F01-021508.pdf .Re .Rs .%T Intel 21143 Hardware Reference Manual -.%O http://developer.intel.com +.%U http://developer.intel.com .Re .Rs .%T Macronix 98713/A, 98715/A and 98725 data sheets -.%O http://www.macronix.com +.%U http://www.macronix.com .Re .Rs .%T Macronix 98713/A and 98715/A app notes -.%O http://www.macronix.com +.%U http://www.macronix.com .Re .Sh HISTORY The Modified: stable/8/share/man/man4/gif.4 ============================================================================== --- stable/8/share/man/man4/gif.4 Tue Jul 26 17:16:55 2011 (r224455) +++ stable/8/share/man/man4/gif.4 Tue Jul 26 17:38:49 2011 (r224456) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 8, 2009 +.Dd July 23, 2011 .Dt GIF 4 .Os .Sh NAME @@ -198,7 +198,7 @@ to 1. .%B RFC2893 .%T Transition Mechanisms for IPv6 Hosts and Routers .%D August 2000 -.%O ftp://ftp.isi.edu/in-notes/rfc2893.txt +.%U http://www.ietf.org/rfc/rfc2893.txt .Re .Rs .%A Sally Floyd Modified: stable/8/share/man/man4/hme.4 ============================================================================== --- stable/8/share/man/man4/hme.4 Tue Jul 26 17:16:55 2011 (r224455) +++ stable/8/share/man/man4/hme.4 Tue Jul 26 17:38:49 2011 (r224456) @@ -139,7 +139,7 @@ except the single-port SBus versions. .%T "STP2002QFP Fast Ethernet, Parallel Port, SCSI (FEPS) User's Guide" .%D April 1996 .%A Sun Microelectronics -.%O http://mediacast.sun.com/users/Barton808/media/STP2002QFP-FEPs_UG.pdf +.%U http://mediacast.sun.com/users/Barton808/media/STP2002QFP-FEPs_UG.pdf .Re .Sh HISTORY The Modified: stable/8/share/man/man4/lge.4 ============================================================================== --- stable/8/share/man/man4/lge.4 Tue Jul 26 17:16:55 2011 (r224455) +++ stable/8/share/man/man4/lge.4 Tue Jul 26 17:38:49 2011 (r224456) @@ -143,7 +143,7 @@ the network connection (cable). .Xr ifconfig 8 .Rs .%T Level 1 LXT1001 Programming Manual -.%O http://www.FreeBSD.org/~wpaul/Level1/LXT1001SRM.pdf +.%U http://www.FreeBSD.org/~wpaul/Level1/LXT1001SRM.pdf .Re .Sh HISTORY The Modified: stable/8/share/man/man4/lmc.4 ============================================================================== --- stable/8/share/man/man4/lmc.4 Tue Jul 26 17:16:55 2011 (r224455) +++ stable/8/share/man/man4/lmc.4 Tue Jul 26 17:38:49 2011 (r224456) @@ -43,7 +43,7 @@ .\" this program; if not, write to the Free Software Foundation, Inc., 59 .\" Temple Place - Suite 330, Boston, MA 02111-1307, USA. .\" -.Dd May 20, 2006 +.Dd July 23, 2011 .Dt LMC 4 .Os .\" @@ -723,8 +723,6 @@ Thus, cable length does not affect data/ .Xr ngctl 8 , .Xr ping 8 , .Xr ifnet 9 -.Pp -.Pa http://www.sbei.com/ .\" .Sh HISTORY .\" Modified: stable/8/share/man/man4/mac.4 ============================================================================== --- stable/8/share/man/man4/mac.4 Tue Jul 26 17:16:55 2011 (r224455) +++ stable/8/share/man/man4/mac.4 Tue Jul 26 17:38:49 2011 (r224456) @@ -219,7 +219,7 @@ man page. .Rs .%B "The FreeBSD Handbook" .%T "Mandatory Access Control" -.%O http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/mac.html +.%U http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/mac.html .Re .Sh HISTORY The Modified: stable/8/share/man/man4/man4.i386/vpd.4 ============================================================================== --- stable/8/share/man/man4/man4.i386/vpd.4 Tue Jul 26 17:16:55 2011 (r224455) +++ stable/8/share/man/man4/man4.i386/vpd.4 Tue Jul 26 17:38:49 2011 (r224456) @@ -76,7 +76,7 @@ Motherboard Serial Number. .%T "TP General - Using the BIOS Build ID to identify IBM ThinkPad systems" .%N "Reference #: MIGR-45120" .%D "November 22, 2002" -.%O "http://www.ibm.com/support/docview.wss?uid=psg1MIGR-45120" +.%U "http://www.ibm.com/support/docview.wss?uid=psg1MIGR-45120" .Re .Sh HISTORY The Modified: stable/8/share/man/man4/man4.sparc64/ebus.4 ============================================================================== --- stable/8/share/man/man4/man4.sparc64/ebus.4 Tue Jul 26 17:16:55 2011 (r224455) +++ stable/8/share/man/man4/man4.sparc64/ebus.4 Tue Jul 26 17:38:49 2011 (r224456) @@ -99,7 +99,7 @@ DMA. .%T "Peripheral Component Interconnect Input Output Controller" .%V "Part No.: 802-7837-01" .%D "March 1997" -.%O "http://www.sun.com/oem/products/manuals/802-7837.pdf" +.%U "http://www.sun.com/oem/products/manuals/802-7837.pdf" .Re .Sh HISTORY The Modified: stable/8/share/man/man4/mpt.4 ============================================================================== --- stable/8/share/man/man4/mpt.4 Tue Jul 26 17:16:55 2011 (r224455) +++ stable/8/share/man/man4/mpt.4 Tue Jul 26 17:38:49 2011 (r224456) @@ -35,7 +35,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 13, 2010 +.Dd July 23, 2011 .Dt MPT 4 .Os .Sh NAME @@ -161,7 +161,7 @@ can take on - no separate compilation is .Xr gmultipath 8 .Rs .%T "LSI Logic Website" -.%O http://www.lsilogic.com/ +.%U http://www.lsi.com/ .Re .Sh HISTORY The Modified: stable/8/share/man/man4/ndis.4 ============================================================================== --- stable/8/share/man/man4/ndis.4 Tue Jul 26 17:16:55 2011 (r224455) +++ stable/8/share/man/man4/ndis.4 Tue Jul 26 17:38:49 2011 (r224456) @@ -139,7 +139,7 @@ before a timeout expired. .Xr wpa_supplicant 8 .Rs .%T "NDIS 5.1 specification" -.%O http://www.microsoft.com +.%U http://www.microsoft.com .Re .Sh HISTORY The Modified: stable/8/share/man/man4/nge.4 ============================================================================== --- stable/8/share/man/man4/nge.4 Tue Jul 26 17:16:55 2011 (r224455) +++ stable/8/share/man/man4/nge.4 Tue Jul 26 17:38:49 2011 (r224456) @@ -209,11 +209,11 @@ the network connection (cable). .Xr ifconfig 8 .Rs .%T National Semiconductor DP83820 datasheet -.%O http://www.national.com +.%U http://www.national.com .Re .Rs .%T National Semiconductor DP83861 datasheet -.%O http://www.national.com +.%U http://www.national.com .Re .Sh HISTORY The Modified: stable/8/share/man/man4/pcm.4 ============================================================================== --- stable/8/share/man/man4/pcm.4 Tue Jul 26 17:16:55 2011 (r224455) +++ stable/8/share/man/man4/pcm.4 Tue Jul 26 17:38:49 2011 (r224456) @@ -633,19 +633,19 @@ A device node is not created properly. .Xr sysctl 8 .Rs .%T "Cookbook formulae for audio EQ biquad filter coefficients, by Robert Bristow-Johnson" -.%O "http://www.musicdsp.org/files/Audio-EQ-Cookbook.txt" +.%U "http://www.musicdsp.org/files/Audio-EQ-Cookbook.txt" .Re .Rs .%T "Julius O'Smith's Digital Audio Resampling" -.%O "http://ccrma.stanford.edu/~jos/resample/" +.%U "http://ccrma.stanford.edu/~jos/resample/" .Re .Rs .%T "Polynomial Interpolators for High-Quality Resampling of Oversampled Audio, by Olli Niemitalo" -.%O "http://www.student.oulu.fi/~oniemita/dsp/deip.pdf" +.%U "http://www.student.oulu.fi/~oniemita/dsp/deip.pdf" .Re .Rs .%T "The OSS API" -.%O "http://www.opensound.com/pguide/oss.pdf" +.%U "http://www.opensound.com/pguide/oss.pdf" .Re .Sh HISTORY The Modified: stable/8/share/man/man4/pcn.4 ============================================================================== --- stable/8/share/man/man4/pcn.4 Tue Jul 26 17:16:55 2011 (r224455) +++ stable/8/share/man/man4/pcn.4 Tue Jul 26 17:38:49 2011 (r224456) @@ -179,7 +179,7 @@ the card should be configured correctly. .Xr ifconfig 8 .Rs .%T AMD PCnet/FAST, PCnet/FAST+ and PCnet/Home datasheets -.%O http://www.amd.com +.%U http://www.amd.com .Re .Sh HISTORY The Modified: stable/8/share/man/man4/psm.4 ============================================================================== --- stable/8/share/man/man4/psm.4 Tue Jul 26 17:16:55 2011 (r224455) +++ stable/8/share/man/man4/psm.4 Tue Jul 26 17:38:49 2011 (r224456) @@ -829,7 +829,7 @@ Clicking any button without moving the m .Xr syslogd 8 .Rs .%T Synaptics TouchPad Interfacing Guide -.%O http://www.synaptics.com/ +.%U http://www.synaptics.com/ .Re .\".Sh HISTORY .Sh AUTHORS Modified: stable/8/share/man/man4/ral.4 ============================================================================== --- stable/8/share/man/man4/ral.4 Tue Jul 26 17:16:55 2011 (r224455) +++ stable/8/share/man/man4/ral.4 Tue Jul 26 17:38:49 2011 (r224456) @@ -242,7 +242,7 @@ This should not happen. .Xr wpa_supplicant 8 . .Rs .%T "Ralink Technology" -.%O http://www.ralinktech.com/ +.%U http://www.ralinktech.com/ .Re .Sh HISTORY The Modified: stable/8/share/man/man4/re.4 ============================================================================== --- stable/8/share/man/man4/re.4 Tue Jul 26 17:16:55 2011 (r224455) +++ stable/8/share/man/man4/re.4 Tue Jul 26 17:38:49 2011 (r224456) @@ -242,7 +242,7 @@ the network connection (cable). .Xr ifconfig 8 .Rs .%T RealTek Semiconductor RTL8139C+, RTL8169, RTL8169S and RTL8110S datasheets -.%O http://www.realtek.com.tw/ +.%U http://www.realtek.com.tw/ .Re .Sh HISTORY The Modified: stable/8/share/man/man4/rl.4 ============================================================================== --- stable/8/share/man/man4/rl.4 Tue Jul 26 17:16:55 2011 (r224455) +++ stable/8/share/man/man4/rl.4 Tue Jul 26 17:38:49 2011 (r224456) @@ -262,7 +262,7 @@ the card should be configured correctly. .Xr ifconfig 8 .Rs .%B The RealTek 8129, 8139 and 8139C+ datasheets -.%O http://www.realtek.com.tw +.%U http://www.realtek.com.tw .Re .Sh HISTORY The Modified: stable/8/share/man/man4/rue.4 ============================================================================== --- stable/8/share/man/man4/rue.4 Tue Jul 26 17:16:55 2011 (r224455) +++ stable/8/share/man/man4/rue.4 Tue Jul 26 17:38:49 2011 (r224456) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 16, 2005 +.Dd July 23, 2011 .Dt RUE 4 .Os .Sh NAME @@ -139,8 +139,8 @@ The driver failed to allocate an mbuf fo .Xr ng_ether 4 , .Xr ifconfig 8 .Rs -.%T "ReakTek RTL8150 data sheet" -.%O ftp://ftp.realtek.com.tw/lancard/data_sheet/8150/ +.%T "RealTek RTL8150 data sheet" +.%U http://pdf.seekdatasheet.com/2008714/200807142333305235.pdf .Re .Sh HISTORY The Modified: stable/8/share/man/man4/rum.4 ============================================================================== --- stable/8/share/man/man4/rum.4 Tue Jul 26 17:16:55 2011 (r224455) +++ stable/8/share/man/man4/rum.4 Tue Jul 26 17:38:49 2011 (r224456) @@ -168,7 +168,7 @@ This should not happen. .Xr wpa_supplicant 8 . .Rs .%T "Ralink Technology" -.%O http://www.ralinktech.com/ +.%U http://www.ralinktech.com/ .Re .Sh HISTORY The Modified: stable/8/share/man/man4/sf.4 ============================================================================== --- stable/8/share/man/man4/sf.4 Tue Jul 26 17:16:55 2011 (r224455) +++ stable/8/share/man/man4/sf.4 Tue Jul 26 17:38:49 2011 (r224456) @@ -197,7 +197,7 @@ the network connection (cable). .Xr ifconfig 8 .Rs .%T The Adaptec AIC-6915 Programmer's Manual -.%O http://download.adaptec.com/pdfs/user_guides/aic6915_pg.pdf +.%U http://download.adaptec.com/pdfs/user_guides/aic6915_pg.pdf .Re .Sh HISTORY The Modified: stable/8/share/man/man4/sis.4 ============================================================================== --- stable/8/share/man/man4/sis.4 Tue Jul 26 17:16:55 2011 (r224455) +++ stable/8/share/man/man4/sis.4 Tue Jul 26 17:38:49 2011 (r224456) @@ -210,11 +210,11 @@ the card should be configured correctly. .Xr ifconfig 8 .Rs .%T SiS 900 and SiS 7016 datasheets -.%O http://www.sis.com.tw +.%U http://www.sis.com.tw .Re .Rs .%T NatSemi DP83815 datasheet -.%O http://www.national.com +.%U http://www.national.com .Re .Sh HISTORY The Modified: stable/8/share/man/man4/sk.4 ============================================================================== --- stable/8/share/man/man4/sk.4 Tue Jul 26 17:16:55 2011 (r224455) +++ stable/8/share/man/man4/sk.4 Tue Jul 26 17:38:49 2011 (r224456) @@ -225,11 +225,11 @@ the network connection (cable). .Xr ifconfig 8 .Rs .%T XaQti XMAC II datasheet -.%O http://www.xaqti.com +.%U http://www.xaqti.com .Re .Rs .%T SysKonnect GEnesis programming manual -.%O http://www.syskonnect.com +.%U http://www.syskonnect.com .Re .Sh HISTORY The Modified: stable/8/share/man/man4/smbus.4 ============================================================================== --- stable/8/share/man/man4/smbus.4 Tue Jul 26 17:16:55 2011 (r224455) +++ stable/8/share/man/man4/smbus.4 Tue Jul 26 17:38:49 2011 (r224456) @@ -67,7 +67,7 @@ between the internal SMB devices and ext .Xr smb 4 .Rs .%T The SMBus specification -.%O http://www.smbus.org/specs/ +.%U http://www.smbus.org/specs/ .Re .Sh HISTORY The Modified: stable/8/share/man/man4/snd_uaudio.4 ============================================================================== --- stable/8/share/man/man4/snd_uaudio.4 Tue Jul 26 17:16:55 2011 (r224455) +++ stable/8/share/man/man4/snd_uaudio.4 Tue Jul 26 17:38:49 2011 (r224456) @@ -80,7 +80,7 @@ for more information. .Xr usb 4 .Rs .%T "USB Audio Class Specifications" -.%O http://www.usb.org/developers/devclass_docs/ +.%U http://www.usb.org/developers/devclass_docs/ .Re .Sh HISTORY The Modified: stable/8/share/man/man4/ste.4 ============================================================================== --- stable/8/share/man/man4/ste.4 Tue Jul 26 17:16:55 2011 (r224455) +++ stable/8/share/man/man4/ste.4 Tue Jul 26 17:38:49 2011 (r224456) @@ -192,7 +192,7 @@ the card should be configured correctly. .Xr ifconfig 8 .Rs .%T Sundance ST201 data sheet -.%O http://www.sundanceti.com +.%U http://www.sundanceti.com .Re .Sh HISTORY The Modified: stable/8/share/man/man4/stf.4 ============================================================================== --- stable/8/share/man/man4/stf.4 Tue Jul 26 17:16:55 2011 (r224455) +++ stable/8/share/man/man4/stf.4 Tue Jul 26 17:38:49 2011 (r224456) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 27, 2001 +.Dd July 23, 2011 .Dt STF 4 .Os .Sh NAME @@ -230,7 +230,7 @@ and not to use your 6to4 prefix as a sou .Xr inet 4 , .Xr inet6 4 .Pp -.Pa http://www.6bone.net/6bone_6to4.html +.Pa http://www.ipv6day.org/action.php?n=En.IPv6day .Rs .%A Brian Carpenter .%A Keith Moore Modified: stable/8/share/man/man4/targ.4 ============================================================================== --- stable/8/share/man/man4/targ.4 Tue Jul 26 17:16:55 2011 (r224455) +++ stable/8/share/man/man4/targ.4 Tue Jul 26 17:38:49 2011 (r224456) @@ -133,7 +133,7 @@ are the control devices. .Xr scsi 4 .Rs .%T "FreeBSD Target Information" -.%O http://www.root.org/~nate/freebsd/ +.%U http://www.root.org/~nate/freebsd/ .Re .Sh AUTHORS .An -nosplit Modified: stable/8/share/man/man4/udav.4 ============================================================================== --- stable/8/share/man/man4/udav.4 Tue Jul 26 17:16:55 2011 (r224455) +++ stable/8/share/man/man4/udav.4 Tue Jul 26 17:38:49 2011 (r224456) @@ -87,7 +87,7 @@ For more information on configuring this .Xr ifconfig 8 .Rs .%T "Davicom DM9601 data sheet" -.%O http://www.davicom.com.tw/big5/download/Data%20Sheet/DM9601-DS-P01-930914.pdf +.%U http://www.davicom.com.tw/big5/download/Data%20Sheet/DM9601-DS-P01-930914.pdf .Re .Sh HISTORY The Modified: stable/8/share/man/man4/ural.4 ============================================================================== --- stable/8/share/man/man4/ural.4 Tue Jul 26 17:16:55 2011 (r224455) +++ stable/8/share/man/man4/ural.4 Tue Jul 26 17:38:49 2011 (r224456) @@ -148,7 +148,7 @@ This should not happen. .Xr wpa_supplicant 8 . .Rs .%T "Ralink Technology" -.%O http://www.ralinktech.com/ +.%U http://www.ralinktech.com/ .Re .Sh HISTORY The Modified: stable/8/share/man/man4/urio.4 ============================================================================== --- stable/8/share/man/man4/urio.4 Tue Jul 26 17:16:55 2011 (r224455) +++ stable/8/share/man/man4/urio.4 Tue Jul 26 17:38:49 2011 (r224456) @@ -106,7 +106,7 @@ section): .Xr usb 4 .Rs .%T The Rio 500 SourceForge Project Web Page -.%O http://rio500.sourceforge.net/ +.%U http://rio500.sourceforge.net/ .Re .Pp The Rio500 tools from SourceForge Modified: stable/8/share/man/man4/urtw.4 ============================================================================== --- stable/8/share/man/man4/urtw.4 Tue Jul 26 17:16:55 2011 (r224455) +++ stable/8/share/man/man4/urtw.4 Tue Jul 26 17:38:49 2011 (r224456) @@ -111,7 +111,7 @@ ifconfig wlan create wlandev urtw0 ssid .Xr wpa_supplicant 8 .Rs .%T Realtek -.%O http://www.realtek.com.tw +.%U http://www.realtek.com.tw .Re .Sh HISTORY The Modified: stable/8/share/man/man4/vr.4 ============================================================================== --- stable/8/share/man/man4/vr.4 Tue Jul 26 17:16:55 2011 (r224455) +++ stable/8/share/man/man4/vr.4 Tue Jul 26 17:38:49 2011 (r224456) @@ -194,7 +194,7 @@ the card should be configured correctly. .Xr ifconfig 8 .Rs .%T The VIA Technologies VT86C100A data sheet -.%O http://www.via.com.tw +.%U http://www.via.com.tw .Re .Sh HISTORY The Modified: stable/8/share/man/man4/wi.4 ============================================================================== --- stable/8/share/man/man4/wi.4 Tue Jul 26 17:16:55 2011 (r224455) +++ stable/8/share/man/man4/wi.4 Tue Jul 26 17:38:49 2011 (r224456) @@ -31,7 +31,7 @@ .\" $FreeBSD$ .\" $OpenBSD: wi.4tbl,v 1.14 2002/04/29 19:53:50 jsyn Exp $ .\" -.Dd August 2, 2008 +.Dd July 23, 2011 .Dt WI 4 .Os .Sh NAME @@ -321,7 +321,7 @@ command. .Xr wpa_supplicant 8 . .Rs .%T HCF Light programming specification -.%O http://www.wavelan.com +.%U http://web.archive.org/web/20040130141721/http://wavelan.com/ .Re .Sh HISTORY The From owner-svn-src-stable@FreeBSD.ORG Tue Jul 26 17:39:41 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3D7041065670; Tue, 26 Jul 2011 17:39:41 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E3B9D8FC13; Tue, 26 Jul 2011 17:39:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6QHdenf019778; Tue, 26 Jul 2011 17:39:40 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6QHdeaJ019740; Tue, 26 Jul 2011 17:39:40 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201107261739.p6QHdeaJ019740@svn.freebsd.org> From: Glen Barber Date: Tue, 26 Jul 2011 17:39:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224457 - in stable/7/share/man/man4: . man4.i386 man4.sparc64 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jul 2011 17:39:41 -0000 Author: gjb (doc committer) Date: Tue Jul 26 17:39:40 2011 New Revision: 224457 URL: http://svn.freebsd.org/changeset/base/224457 Log: MFC 202386, 224284: 202386 (by ru): Use the newly brought %U macro. 224284: Fix various broken links in manual pages. PR: 159130 159131 159132 159133 PR: 159134 159135 159144 Modified: stable/7/share/man/man4/acpi.4 stable/7/share/man/man4/aue.4 stable/7/share/man/man4/axe.4 stable/7/share/man/man4/cdce.4 stable/7/share/man/man4/dc.4 stable/7/share/man/man4/gif.4 stable/7/share/man/man4/hme.4 stable/7/share/man/man4/lge.4 stable/7/share/man/man4/lmc.4 stable/7/share/man/man4/mac.4 stable/7/share/man/man4/man4.i386/vpd.4 stable/7/share/man/man4/man4.sparc64/ebus.4 stable/7/share/man/man4/mpt.4 stable/7/share/man/man4/nge.4 stable/7/share/man/man4/pcm.4 stable/7/share/man/man4/pcn.4 stable/7/share/man/man4/psm.4 stable/7/share/man/man4/ral.4 stable/7/share/man/man4/re.4 stable/7/share/man/man4/rl.4 stable/7/share/man/man4/rue.4 stable/7/share/man/man4/rum.4 stable/7/share/man/man4/sf.4 stable/7/share/man/man4/sis.4 stable/7/share/man/man4/sk.4 stable/7/share/man/man4/smbus.4 stable/7/share/man/man4/snd_uaudio.4 stable/7/share/man/man4/ste.4 stable/7/share/man/man4/stf.4 stable/7/share/man/man4/targ.4 stable/7/share/man/man4/udav.4 stable/7/share/man/man4/ural.4 stable/7/share/man/man4/urio.4 stable/7/share/man/man4/vr.4 stable/7/share/man/man4/wi.4 Directory Properties: stable/7/share/man/man4/ (props changed) Modified: stable/7/share/man/man4/acpi.4 ============================================================================== --- stable/7/share/man/man4/acpi.4 Tue Jul 26 17:38:49 2011 (r224456) +++ stable/7/share/man/man4/acpi.4 Tue Jul 26 17:39:40 2011 (r224457) @@ -560,7 +560,7 @@ ACPI is only found and supported on i386 .%A "Toshiba Corporation" .%D August 25, 2003 .%T "Advanced Configuration and Power Interface Specification" -.%O http://acpi.info/spec.htm +.%U http://acpi.info/spec.htm .Re .Sh AUTHORS .An -nosplit Modified: stable/7/share/man/man4/aue.4 ============================================================================== --- stable/7/share/man/man4/aue.4 Tue Jul 26 17:38:49 2011 (r224456) +++ stable/7/share/man/man4/aue.4 Tue Jul 26 17:39:40 2011 (r224457) @@ -193,7 +193,7 @@ The driver failed to allocate an mbuf fo .Xr ifconfig 8 .Rs .%T ADMtek AN986 data sheet -.%O http://www.admtek.com.tw +.%U http://www.admtek.com.tw .Re .Sh HISTORY The Modified: stable/7/share/man/man4/axe.4 ============================================================================== --- stable/7/share/man/man4/axe.4 Tue Jul 26 17:38:49 2011 (r224456) +++ stable/7/share/man/man4/axe.4 Tue Jul 26 17:39:40 2011 (r224457) @@ -200,7 +200,7 @@ The driver failed to allocate an mbuf fo .Xr ifconfig 8 .Rs .%T "ASIX AX88172 AX88178 and AX88772 data sheets" -.%O http://www.asix.com.tw +.%U http://www.asix.com.tw .Re .Sh HISTORY The Modified: stable/7/share/man/man4/cdce.4 ============================================================================== --- stable/7/share/man/man4/cdce.4 Tue Jul 26 17:38:49 2011 (r224456) +++ stable/7/share/man/man4/cdce.4 Tue Jul 26 17:39:40 2011 (r224457) @@ -120,11 +120,11 @@ is running low on mbufs. .Xr ifconfig 8 .Rs .%T "Universal Serial Bus Class Definitions for Communication Devices" -.%O http://www.usb.org/developers/devclass_docs/usbcdc11.pdf +.%U http://www.usb.org/developers/devclass_docs/usbcdc11.pdf .Re .Rs .%T "Data sheet Prolific PL-2501 Host-to-Host Bridge/Network Controller" -.%O http://tech.prolific.com.tw/visitor/fcabdl.asp?fid=20679530 +.%U http://tech.prolific.com.tw/visitor/fcabdl.asp?fid=20679530 .Re .Sh HISTORY The Modified: stable/7/share/man/man4/dc.4 ============================================================================== --- stable/7/share/man/man4/dc.4 Tue Jul 26 17:38:49 2011 (r224456) +++ stable/7/share/man/man4/dc.4 Tue Jul 26 17:39:40 2011 (r224457) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 16, 2005 +.Dd July 23, 2011 .Dt DC 4 .Os .Sh NAME @@ -351,27 +351,27 @@ the card should be configured correctly. .Xr ifconfig 8 .Rs .%T ADMtek AL981, AL983 and AL985 data sheets -.%O http://www.admtek.com.tw +.%U http://www.admtek.com.tw .Re .Rs .%T ASIX Electronics AX88140A and AX88141 data sheets -.%O http://www.asix.com.tw +.%U http://www.asix.com.tw .Re .Rs .%T Davicom DM9102 data sheet -.%O http://www.davicom8.com +.%U http://www.davicom.com.tw/userfile/24247/DM9102H-DS-F01-021508.pdf .Re .Rs .%T Intel 21143 Hardware Reference Manual -.%O http://developer.intel.com +.%U http://developer.intel.com .Re .Rs .%T Macronix 98713/A, 98715/A and 98725 data sheets -.%O http://www.macronix.com +.%U http://www.macronix.com .Re .Rs .%T Macronix 98713/A and 98715/A app notes -.%O http://www.macronix.com +.%U http://www.macronix.com .Re .Sh HISTORY The Modified: stable/7/share/man/man4/gif.4 ============================================================================== --- stable/7/share/man/man4/gif.4 Tue Jul 26 17:38:49 2011 (r224456) +++ stable/7/share/man/man4/gif.4 Tue Jul 26 17:39:40 2011 (r224457) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 8, 2009 +.Dd July 23, 2011 .Dt GIF 4 .Os .Sh NAME @@ -198,7 +198,7 @@ to 1. .%B RFC2893 .%T Transition Mechanisms for IPv6 Hosts and Routers .%D August 2000 -.%O ftp://ftp.isi.edu/in-notes/rfc2893.txt +.%U http://www.ietf.org/rfc/rfc2893.txt .Re .Rs .%A Sally Floyd Modified: stable/7/share/man/man4/hme.4 ============================================================================== --- stable/7/share/man/man4/hme.4 Tue Jul 26 17:38:49 2011 (r224456) +++ stable/7/share/man/man4/hme.4 Tue Jul 26 17:39:40 2011 (r224457) @@ -129,7 +129,7 @@ except the single-port SBus versions. .%T "STP2002QFP Fast Ethernet, Parallel Port, SCSI (FEPS) User's Guide" .%D April 1996 .%A Sun Microelectronics -.%O http://mediacast.sun.com/users/Barton808/media/STP2002QFP-FEPs_UG.pdf +.%U http://mediacast.sun.com/users/Barton808/media/STP2002QFP-FEPs_UG.pdf .Re .Sh HISTORY The Modified: stable/7/share/man/man4/lge.4 ============================================================================== --- stable/7/share/man/man4/lge.4 Tue Jul 26 17:38:49 2011 (r224456) +++ stable/7/share/man/man4/lge.4 Tue Jul 26 17:39:40 2011 (r224457) @@ -143,7 +143,7 @@ the network connection (cable). .Xr ifconfig 8 .Rs .%T Level 1 LXT1001 Programming Manual -.%O http://www.FreeBSD.org/~wpaul/Level1/LXT1001SRM.pdf +.%U http://www.FreeBSD.org/~wpaul/Level1/LXT1001SRM.pdf .Re .Sh HISTORY The Modified: stable/7/share/man/man4/lmc.4 ============================================================================== --- stable/7/share/man/man4/lmc.4 Tue Jul 26 17:38:49 2011 (r224456) +++ stable/7/share/man/man4/lmc.4 Tue Jul 26 17:39:40 2011 (r224457) @@ -43,7 +43,7 @@ .\" this program; if not, write to the Free Software Foundation, Inc., 59 .\" Temple Place - Suite 330, Boston, MA 02111-1307, USA. .\" -.Dd May 20, 2006 +.Dd July 23, 2011 .Dt LMC 4 .Os .\" @@ -723,8 +723,6 @@ Thus, cable length does not affect data/ .Xr ngctl 8 , .Xr ping 8 , .Xr ifnet 9 -.Pp -.Pa http://www.sbei.com/ .\" .Sh HISTORY .\" Modified: stable/7/share/man/man4/mac.4 ============================================================================== --- stable/7/share/man/man4/mac.4 Tue Jul 26 17:38:49 2011 (r224456) +++ stable/7/share/man/man4/mac.4 Tue Jul 26 17:39:40 2011 (r224457) @@ -220,7 +220,7 @@ man page. .Rs .%B "The FreeBSD Handbook" .%T "Mandatory Access Control" -.%O http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/mac.html +.%U http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/mac.html .Re .Sh HISTORY The Modified: stable/7/share/man/man4/man4.i386/vpd.4 ============================================================================== --- stable/7/share/man/man4/man4.i386/vpd.4 Tue Jul 26 17:38:49 2011 (r224456) +++ stable/7/share/man/man4/man4.i386/vpd.4 Tue Jul 26 17:39:40 2011 (r224457) @@ -76,7 +76,7 @@ Motherboard Serial Number. .%T "TP General - Using the BIOS Build ID to identify IBM ThinkPad systems" .%N "Reference #: MIGR-45120" .%D "November 22, 2002" -.%O "http://www.ibm.com/support/docview.wss?uid=psg1MIGR-45120" +.%U "http://www.ibm.com/support/docview.wss?uid=psg1MIGR-45120" .Re .Sh HISTORY The Modified: stable/7/share/man/man4/man4.sparc64/ebus.4 ============================================================================== --- stable/7/share/man/man4/man4.sparc64/ebus.4 Tue Jul 26 17:38:49 2011 (r224456) +++ stable/7/share/man/man4/man4.sparc64/ebus.4 Tue Jul 26 17:39:40 2011 (r224457) @@ -99,7 +99,7 @@ DMA. .%T "Peripheral Component Interconnect Input Output Controller" .%V "Part No.: 802-7837-01" .%D "March 1997" -.%O "http://www.sun.com/oem/products/manuals/802-7837.pdf" +.%U "http://www.sun.com/oem/products/manuals/802-7837.pdf" .Re .Sh HISTORY The Modified: stable/7/share/man/man4/mpt.4 ============================================================================== --- stable/7/share/man/man4/mpt.4 Tue Jul 26 17:38:49 2011 (r224456) +++ stable/7/share/man/man4/mpt.4 Tue Jul 26 17:39:40 2011 (r224457) @@ -35,7 +35,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 13, 2010 +.Dd July 23, 2011 .Dt MPT 4 .Os .Sh NAME @@ -158,7 +158,7 @@ can take on - no separate compilation is .Xr targ 4 .Rs .%T "LSI Logic Website" -.%O http://www.lsilogic.com/ +.%U http://www.lsi.com/ .Re .Sh HISTORY The Modified: stable/7/share/man/man4/nge.4 ============================================================================== --- stable/7/share/man/man4/nge.4 Tue Jul 26 17:38:49 2011 (r224456) +++ stable/7/share/man/man4/nge.4 Tue Jul 26 17:39:40 2011 (r224457) @@ -209,11 +209,11 @@ the network connection (cable). .Xr ifconfig 8 .Rs .%T National Semiconductor DP83820 datasheet -.%O http://www.national.com +.%U http://www.national.com .Re .Rs .%T National Semiconductor DP83861 datasheet -.%O http://www.national.com +.%U http://www.national.com .Re .Sh HISTORY The Modified: stable/7/share/man/man4/pcm.4 ============================================================================== --- stable/7/share/man/man4/pcm.4 Tue Jul 26 17:38:49 2011 (r224456) +++ stable/7/share/man/man4/pcm.4 Tue Jul 26 17:39:40 2011 (r224457) @@ -409,7 +409,7 @@ A device node is not created properly. .Xr sysctl 8 .Rs .%T "The OSS API" -.%O "http://www.opensound.com/pguide/oss.pdf" +.%U "http://www.opensound.com/pguide/oss.pdf" .Re .Sh HISTORY The Modified: stable/7/share/man/man4/pcn.4 ============================================================================== --- stable/7/share/man/man4/pcn.4 Tue Jul 26 17:38:49 2011 (r224456) +++ stable/7/share/man/man4/pcn.4 Tue Jul 26 17:39:40 2011 (r224457) @@ -179,7 +179,7 @@ the card should be configured correctly. .Xr ifconfig 8 .Rs .%T AMD PCnet/FAST, PCnet/FAST+ and PCnet/Home datasheets -.%O http://www.amd.com +.%U http://www.amd.com .Re .Sh HISTORY The Modified: stable/7/share/man/man4/psm.4 ============================================================================== --- stable/7/share/man/man4/psm.4 Tue Jul 26 17:38:49 2011 (r224456) +++ stable/7/share/man/man4/psm.4 Tue Jul 26 17:39:40 2011 (r224457) @@ -844,7 +844,7 @@ Clicking any button without moving the m .Xr syslogd 8 .Rs .%T Synaptics TouchPad Interfacing Guide -.%O http://www.synaptics.com/ +.%U http://www.synaptics.com/ .Re .\".Sh HISTORY .Sh AUTHORS Modified: stable/7/share/man/man4/ral.4 ============================================================================== --- stable/7/share/man/man4/ral.4 Tue Jul 26 17:38:49 2011 (r224456) +++ stable/7/share/man/man4/ral.4 Tue Jul 26 17:39:40 2011 (r224457) @@ -203,7 +203,7 @@ This should not happen. .Xr ifconfig 8 .Rs .%T "Ralink Technology" -.%O http://www.ralinktech.com/ +.%U http://www.ralinktech.com/ .Re .Sh HISTORY The Modified: stable/7/share/man/man4/re.4 ============================================================================== --- stable/7/share/man/man4/re.4 Tue Jul 26 17:38:49 2011 (r224456) +++ stable/7/share/man/man4/re.4 Tue Jul 26 17:39:40 2011 (r224457) @@ -242,7 +242,7 @@ the network connection (cable). .Xr ifconfig 8 .Rs .%T RealTek Semiconductor RTL8139C+, RTL8169, RTL8169S and RTL8110S datasheets -.%O http://www.realtek.com.tw/ +.%U http://www.realtek.com.tw/ .Re .Sh HISTORY The Modified: stable/7/share/man/man4/rl.4 ============================================================================== --- stable/7/share/man/man4/rl.4 Tue Jul 26 17:38:49 2011 (r224456) +++ stable/7/share/man/man4/rl.4 Tue Jul 26 17:39:40 2011 (r224457) @@ -262,7 +262,7 @@ the card should be configured correctly. .Xr ifconfig 8 .Rs .%B The RealTek 8129, 8139 and 8139C+ datasheets -.%O http://www.realtek.com.tw +.%U http://www.realtek.com.tw .Re .Sh HISTORY The Modified: stable/7/share/man/man4/rue.4 ============================================================================== --- stable/7/share/man/man4/rue.4 Tue Jul 26 17:38:49 2011 (r224456) +++ stable/7/share/man/man4/rue.4 Tue Jul 26 17:39:40 2011 (r224457) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 16, 2005 +.Dd July 23, 2011 .Dt RUE 4 .Os .Sh NAME @@ -139,8 +139,8 @@ The driver failed to allocate an mbuf fo .Xr ng_ether 4 , .Xr ifconfig 8 .Rs -.%T "ReakTek RTL8150 data sheet" -.%O ftp://ftp.realtek.com.tw/lancard/data_sheet/8150/ +.%T "RealTek RTL8150 data sheet" +.%U http://pdf.seekdatasheet.com/2008714/200807142333305235.pdf .Re .Sh HISTORY The Modified: stable/7/share/man/man4/rum.4 ============================================================================== --- stable/7/share/man/man4/rum.4 Tue Jul 26 17:38:49 2011 (r224456) +++ stable/7/share/man/man4/rum.4 Tue Jul 26 17:39:40 2011 (r224457) @@ -144,7 +144,7 @@ This should not happen. .Xr ifconfig 8 .Rs .%T "Ralink Technology" -.%O http://www.ralinktech.com/ +.%U http://www.ralinktech.com/ .Re .Sh HISTORY The Modified: stable/7/share/man/man4/sf.4 ============================================================================== --- stable/7/share/man/man4/sf.4 Tue Jul 26 17:38:49 2011 (r224456) +++ stable/7/share/man/man4/sf.4 Tue Jul 26 17:39:40 2011 (r224457) @@ -197,7 +197,7 @@ the network connection (cable). .Xr ifconfig 8 .Rs .%T The Adaptec AIC-6915 Programmer's Manual -.%O http://download.adaptec.com/pdfs/user_guides/aic6915_pg.pdf +.%U http://download.adaptec.com/pdfs/user_guides/aic6915_pg.pdf .Re .Sh HISTORY The Modified: stable/7/share/man/man4/sis.4 ============================================================================== --- stable/7/share/man/man4/sis.4 Tue Jul 26 17:38:49 2011 (r224456) +++ stable/7/share/man/man4/sis.4 Tue Jul 26 17:39:40 2011 (r224457) @@ -210,11 +210,11 @@ the card should be configured correctly. .Xr ifconfig 8 .Rs .%T SiS 900 and SiS 7016 datasheets -.%O http://www.sis.com.tw +.%U http://www.sis.com.tw .Re .Rs .%T NatSemi DP83815 datasheet -.%O http://www.national.com +.%U http://www.national.com .Re .Sh HISTORY The Modified: stable/7/share/man/man4/sk.4 ============================================================================== --- stable/7/share/man/man4/sk.4 Tue Jul 26 17:38:49 2011 (r224456) +++ stable/7/share/man/man4/sk.4 Tue Jul 26 17:39:40 2011 (r224457) @@ -225,11 +225,11 @@ the network connection (cable). .Xr ifconfig 8 .Rs .%T XaQti XMAC II datasheet -.%O http://www.xaqti.com +.%U http://www.xaqti.com .Re .Rs .%T SysKonnect GEnesis programming manual -.%O http://www.syskonnect.com +.%U http://www.syskonnect.com .Re .Sh HISTORY The Modified: stable/7/share/man/man4/smbus.4 ============================================================================== --- stable/7/share/man/man4/smbus.4 Tue Jul 26 17:38:49 2011 (r224456) +++ stable/7/share/man/man4/smbus.4 Tue Jul 26 17:39:40 2011 (r224457) @@ -67,7 +67,7 @@ between the internal SMB devices and ext .Xr smb 4 .Rs .%T The SMBus specification -.%O http://www.smbus.org/specs/ +.%U http://www.smbus.org/specs/ .Re .Sh HISTORY The Modified: stable/7/share/man/man4/snd_uaudio.4 ============================================================================== --- stable/7/share/man/man4/snd_uaudio.4 Tue Jul 26 17:38:49 2011 (r224456) +++ stable/7/share/man/man4/snd_uaudio.4 Tue Jul 26 17:39:40 2011 (r224457) @@ -78,7 +78,7 @@ for more information. .Xr usb 4 .Rs .%T "USB Audio Class Specifications" -.%O http://www.usb.org/developers/devclass_docs/ +.%U http://www.usb.org/developers/devclass_docs/ .Re .Sh HISTORY The Modified: stable/7/share/man/man4/ste.4 ============================================================================== --- stable/7/share/man/man4/ste.4 Tue Jul 26 17:38:49 2011 (r224456) +++ stable/7/share/man/man4/ste.4 Tue Jul 26 17:39:40 2011 (r224457) @@ -192,7 +192,7 @@ the card should be configured correctly. .Xr ifconfig 8 .Rs .%T Sundance ST201 data sheet -.%O http://www.sundanceti.com +.%U http://www.sundanceti.com .Re .Sh HISTORY The Modified: stable/7/share/man/man4/stf.4 ============================================================================== --- stable/7/share/man/man4/stf.4 Tue Jul 26 17:38:49 2011 (r224456) +++ stable/7/share/man/man4/stf.4 Tue Jul 26 17:39:40 2011 (r224457) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 27, 2001 +.Dd July 23, 2011 .Dt STF 4 .Os .Sh NAME @@ -230,7 +230,7 @@ and not to use your 6to4 prefix as a sou .Xr inet 4 , .Xr inet6 4 .Pp -.Pa http://www.6bone.net/6bone_6to4.html +.Pa http://www.ipv6day.org/action.php?n=En.IPv6day .Rs .%A Brian Carpenter .%A Keith Moore Modified: stable/7/share/man/man4/targ.4 ============================================================================== --- stable/7/share/man/man4/targ.4 Tue Jul 26 17:38:49 2011 (r224456) +++ stable/7/share/man/man4/targ.4 Tue Jul 26 17:39:40 2011 (r224457) @@ -133,7 +133,7 @@ are the control devices. .Xr scsi 4 .Rs .%T "FreeBSD Target Information" -.%O http://www.root.org/~nate/freebsd/ +.%U http://www.root.org/~nate/freebsd/ .Re .Sh AUTHORS .An -nosplit Modified: stable/7/share/man/man4/udav.4 ============================================================================== --- stable/7/share/man/man4/udav.4 Tue Jul 26 17:38:49 2011 (r224456) +++ stable/7/share/man/man4/udav.4 Tue Jul 26 17:39:40 2011 (r224457) @@ -87,7 +87,7 @@ For more information on configuring this .Xr ifconfig 8 .Rs .%T "Davicom DM9601 data sheet" -.%O http://www.davicom.com.tw/big5/download/Data%20Sheet/DM9601-DS-P01-930914.pdf +.%U http://www.davicom.com.tw/big5/download/Data%20Sheet/DM9601-DS-P01-930914.pdf .Re .Sh HISTORY The Modified: stable/7/share/man/man4/ural.4 ============================================================================== --- stable/7/share/man/man4/ural.4 Tue Jul 26 17:38:49 2011 (r224456) +++ stable/7/share/man/man4/ural.4 Tue Jul 26 17:39:40 2011 (r224457) @@ -128,7 +128,7 @@ This should not happen. .Xr ifconfig 8 .Rs .%T "Ralink Technology" -.%O http://www.ralinktech.com/ +.%U http://www.ralinktech.com/ .Re .Sh HISTORY The Modified: stable/7/share/man/man4/urio.4 ============================================================================== --- stable/7/share/man/man4/urio.4 Tue Jul 26 17:38:49 2011 (r224456) +++ stable/7/share/man/man4/urio.4 Tue Jul 26 17:39:40 2011 (r224457) @@ -106,7 +106,7 @@ section): .Xr usb 4 .Rs .%T The Rio 500 SourceForge Project Web Page -.%O http://rio500.sourceforge.net/ +.%U http://rio500.sourceforge.net/ .Re .Pp The Rio500 tools from SourceForge Modified: stable/7/share/man/man4/vr.4 ============================================================================== --- stable/7/share/man/man4/vr.4 Tue Jul 26 17:38:49 2011 (r224456) +++ stable/7/share/man/man4/vr.4 Tue Jul 26 17:39:40 2011 (r224457) @@ -192,7 +192,7 @@ the card should be configured correctly. .Xr ifconfig 8 .Rs .%T The VIA Technologies VT86C100A data sheet -.%O http://www.via.com.tw +.%U http://www.via.com.tw .Re .Sh HISTORY The Modified: stable/7/share/man/man4/wi.4 ============================================================================== --- stable/7/share/man/man4/wi.4 Tue Jul 26 17:38:49 2011 (r224456) +++ stable/7/share/man/man4/wi.4 Tue Jul 26 17:39:40 2011 (r224457) @@ -31,7 +31,7 @@ .\" $FreeBSD$ .\" $OpenBSD: wi.4tbl,v 1.14 2002/04/29 19:53:50 jsyn Exp $ .\" -.Dd July 16, 2005 +.Dd July 23, 2011 .Dt WI 4 .Os .Sh NAME @@ -362,7 +362,7 @@ command. .Xr ifconfig 8 , .Rs .%T HCF Light programming specification -.%O http://www.wavelan.com +.%U http://web.archive.org/web/20040130141721/http://wavelan.com/ .Re .Sh HISTORY The From owner-svn-src-stable@FreeBSD.ORG Tue Jul 26 18:59:38 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9D054106564A; Tue, 26 Jul 2011 18:59:38 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8C6718FC19; Tue, 26 Jul 2011 18:59:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6QIxcF7022268; Tue, 26 Jul 2011 18:59:38 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6QIxcf7022266; Tue, 26 Jul 2011 18:59:38 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201107261859.p6QIxcf7022266@svn.freebsd.org> From: Jaakko Heinonen Date: Tue, 26 Jul 2011 18:59:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224458 - stable/7/sys/kern X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jul 2011 18:59:38 -0000 Author: jh Date: Tue Jul 26 18:59:38 2011 New Revision: 224458 URL: http://svn.freebsd.org/changeset/base/224458 Log: MFC r222216: In init_dynamic_kenv(), ignore environment strings exceeding the KENV_MNAMELEN + 1 + KENV_MVALLEN + 1 length limit to avoid buffer overflow in getenv(). Currenly loader(8) doesn't limit the length of environment strings. PR: kern/132104 Modified: stable/7/sys/kern/kern_environment.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/kern/kern_environment.c ============================================================================== --- stable/7/sys/kern/kern_environment.c Tue Jul 26 17:39:40 2011 (r224457) +++ stable/7/sys/kern/kern_environment.c Tue Jul 26 18:59:38 2011 (r224458) @@ -217,13 +217,19 @@ static void init_dynamic_kenv(void *data __unused) { char *cp; - int len, i; + size_t len; + int i; kenvp = malloc((KENV_SIZE + 1) * sizeof(char *), M_KENV, M_WAITOK | M_ZERO); i = 0; for (cp = kern_envp; cp != NULL; cp = kernenv_next(cp)) { len = strlen(cp) + 1; + if (len > KENV_MNAMELEN + 1 + KENV_MVALLEN + 1) { + printf("WARNING: too long kenv string, ignoring %s\n", + cp); + continue; + } if (i < KENV_SIZE) { kenvp[i] = malloc(len, M_KENV, M_WAITOK); strcpy(kenvp[i++], cp); From owner-svn-src-stable@FreeBSD.ORG Tue Jul 26 19:05:10 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 86F9C106564A; Tue, 26 Jul 2011 19:05:10 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 74BE38FC15; Tue, 26 Jul 2011 19:05:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6QJ5AgV022511; Tue, 26 Jul 2011 19:05:10 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6QJ5AWX022509; Tue, 26 Jul 2011 19:05:10 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201107261905.p6QJ5AWX022509@svn.freebsd.org> From: Glen Barber Date: Tue, 26 Jul 2011 19:05:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224459 - stable/8/sys/netinet/libalias X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jul 2011 19:05:10 -0000 Author: gjb (doc committer) Date: Tue Jul 26 19:05:10 2011 New Revision: 224459 URL: http://svn.freebsd.org/changeset/base/224459 Log: MFC 223773: - General grammar and mdoc(7) fixes. - While here, remove a paragraph about userspace operation that has been outdated for some time. PR: 158623 Modified: stable/8/sys/netinet/libalias/libalias.3 Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/geom/label/ (props changed) Modified: stable/8/sys/netinet/libalias/libalias.3 ============================================================================== --- stable/8/sys/netinet/libalias/libalias.3 Tue Jul 26 18:59:38 2011 (r224458) +++ stable/8/sys/netinet/libalias/libalias.3 Tue Jul 26 19:05:10 2011 (r224459) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 1, 2006 +.Dd July 04, 2011 .Dt LIBALIAS 3 .Os .Sh NAME @@ -52,7 +52,7 @@ machine on the local network. .Pp A certain amount of flexibility is built into the packet aliasing engine. In the simplest mode of operation, a many-to-one address mapping takes -place between local network and the packet aliasing host. +place between the local network and the packet aliasing host. This is known as IP masquerading. In addition, one-to-one mappings between local and public addresses can also be implemented, which is known as static NAT. @@ -61,15 +61,11 @@ linked to different public addresses, co many-to-one mappings. Also, a given public address and port can be statically redirected to a private address/port. -.Pp -The packet aliasing engine was designed to operate in user space outside -of the kernel, without any access to private kernel data structure, but -the source code can also be ported to a kernel environment. .Sh INITIALIZATION AND CONTROL One special function, .Fn LibAliasInit , -must always be called before any packet handling may be performed and -the returned instance pointer passed to all the other functions. +must always be called before any packet handling may be performed, and +the returned instance pointer must be passed to all the other functions. Normally, the .Fn LibAliasSetAddress function is called afterwards, to set the default aliasing address. @@ -118,8 +114,8 @@ prior to any packet handling. This function has no return value and is used to clear any resources attached to internal data structures. .Pp -This functions should be called when a program stops using the aliasing -engine; it does, amongst other things, clear out any firewall holes. +This function should be called when a program stops using the aliasing +engine; amongst other things, it clears out any firewall holes. To provide backwards compatibility and extra security, it is added to the .Xr atexit 3 @@ -135,7 +131,7 @@ local area network are aliased. All outgoing packets are re-mapped to this address unless overridden by a static address mapping established by .Fn LibAliasRedirectAddr . -If this function is not called, and no static rules match, an outgoing +If this function has not been called, and no static rules match, an outgoing packet retains its source address. .Pp If the @@ -150,7 +146,7 @@ address may or may not change on success If the .Dv PKT_ALIAS_RESET_ON_ADDR_CHANGE mode bit is set to zero, this function can also be used to dynamically change -the aliasing address on a packet to packet basis (it is a low overhead call). +the aliasing address on a packet-to-packet basis (it is a low overhead call). .Pp It is mandatory that this function be called prior to any packet handling. .Ed @@ -170,7 +166,7 @@ The following mode bits are defined in .It Dv PKT_ALIAS_LOG Enables logging into .Pa /var/log/alias.log . -Each time an aliasing link is created or deleted, the log file is appended +Each time an aliasing link is created or deleted, the log file is appended to with the current number of ICMP, TCP and UDP links. Mainly useful for debugging when the log file is viewed continuously with .Xr tail 1 . @@ -186,7 +182,7 @@ Response packets to connections or trans aliasing host or local network will be unaffected. This mode bit is useful for implementing a one-way firewall. .It Dv PKT_ALIAS_SAME_PORTS -If this mode bit is set, the packet aliasing engine will attempt to leave +If this mode bit is set, the packet-aliasing engine will attempt to leave the alias port numbers unchanged from the actual local port numbers. This can be done as long as the quintuple (proto, alias addr, alias port, remote addr, remote port) is unique. @@ -211,7 +207,7 @@ Standard Class A, B and C unregistered a 192.168.0.0 -> 192.168.255.255 (Class C subnets) .Ed .Pp -This option is useful in the case that packet aliasing host has both +This option is useful in the case that the packet aliasing host has both registered and unregistered subnets on different interfaces. The registered subnet is fully accessible to the outside world, so traffic from it does not need to be passed through the packet aliasing engine. @@ -229,8 +225,9 @@ of an address change. .It Dv PKT_ALIAS_PUNCH_FW This option makes .Nm -`punch holes' in an -.Xr ipfirewall 4 +.Dq punch holes +in an +.Xr ipfirewall 4 - based firewall for FTP/IRC DCC connections. The holes punched are bound by from/to IP address and port; it will not be possible to use a hole for another connection. @@ -240,9 +237,9 @@ To cater to unexpected death of a progra (e.g.\& kill -9), changing the state of the flag will clear the entire firewall range allocated for holes. -This will also happen on the initial call to -.Fn LibAliasSetFWBase . -This call must happen prior to setting this flag. +This clearing will also happen on the initial call to +.Fn LibAliasSetFWBase , +which must happen prior to setting this flag. .It Dv PKT_ALIAS_REVERSE This option makes .Nm @@ -263,10 +260,10 @@ below for details. .Ft void .Fn LibAliasSetFWBase "struct libalias *" "unsigned int base" "unsigned int num" .Bd -ragged -offset indent -Set firewall range allocated for punching firewall holes (with the +Set the firewall range allocated for punching firewall holes (with the .Dv PKT_ALIAS_PUNCH_FW flag). -The range will be cleared for all rules on initialization. +The range is cleared for all rules on initialization. .Ed .Pp .Ft void @@ -292,7 +289,7 @@ the two packet handling functions, .Fn LibAliasIn and .Fn LibAliasOut , -comprise minimal set of functions needed for a basic IP masquerading +comprise the minimal set of functions needed for a basic IP masquerading implementation. .Pp .Ft int @@ -313,11 +310,11 @@ Return codes: The packet aliasing process was successful. .It Dv PKT_ALIAS_IGNORED The packet was ignored and not de-aliased. -This can happen if the protocol is unrecognized, possibly an ICMP message -type is not handled or if incoming packets for new connections are being -ignored (if +This can happen if the protocol is unrecognized, as for an ICMP message +type that is not handled, or if incoming packets for new connections are being +ignored (if the .Dv PKT_ALIAS_DENY_INCOMING -mode bit was set by +mode bit was set using .Fn LibAliasSetMode ) . .It Dv PKT_ALIAS_UNRESOLVED_FRAGMENT This is returned when a fragment cannot be resolved because the header @@ -408,7 +405,7 @@ is called to change the address after .Fn LibAliasRedirectPort is called, a zero reference will track this change. .Pp -If the link is further set up to operate for a load sharing, then +If the link is further set up to operate with load sharing, then .Fa local_addr and .Fa local_port @@ -423,7 +420,7 @@ Likewise, if .Fa remote_port is zero, this indicates to redirect packets originating from any remote port number. -Almost always, the remote port specification will be zero, but non-zero +The remote port specification will almost always be zero, but non-zero remote addresses can sometimes be useful for firewalling. If two calls to .Fn LibAliasRedirectPort @@ -475,9 +472,10 @@ is called to change the address after .Fn LibAliasRedirectAddr is called, a zero reference will track this change. .Pp -If the link is further set up to operate for a load sharing, then +If the link is further set up to operate with load sharing, then the .Fa local_addr -is ignored, and is selected dynamically from the server pool, as described in +argument is ignored, and is selected dynamically from the server pool, +as described in .Fn LibAliasAddServer below. .Pp @@ -532,12 +530,12 @@ up for Load Sharing using IP Network Add LSNAT operates as follows. A client attempts to access a server by using the server virtual address. The LSNAT router transparently redirects the request to one of the hosts -in server pool, selected using a real-time load sharing algorithm. +in the server pool, using a real-time load sharing algorithm. Multiple sessions may be initiated from the same client, and each session -could be directed to a different host based on load balance across server -pool hosts at the time. -If load share is desired for just a few specific services, the configuration -on LSNAT could be defined to restrict load share for just the services +could be directed to a different host based on the load balance across server +pool hosts when the sessions are initiated. +If load sharing is desired for just a few specific services, the configuration +on LSNAT could be defined to restrict load sharing to just the services desired. .Pp Currently, only the simplest selection algorithm is implemented, where a @@ -596,8 +594,8 @@ The parameter is the pointer returned by either of the redirection functions. If an invalid pointer is passed to .Fn LibAliasRedirectDelete , -then a program crash or unpredictable operation could result, so it is -necessary to be careful using this function. +then a program crash or unpredictable operation could result, so +care is needed when using this function. .Ed .Pp .Ft int @@ -704,7 +702,7 @@ access, or to restrict access to certain .Bd -ragged -offset indent This function specifies that any IP packet with protocol number of .Fa proto -from a given remote address to an alias address be +from a given remote address to an alias address will be redirected to a specified local address. .Pp If @@ -1099,9 +1097,9 @@ SLIST_HEAD(dll_chain, dll) dll_chain ... .Ed .Pp .Va handler_chain -keep tracks of all the protocol handlers loaded, while +keeps track of all the protocol handlers loaded, while .Va ddl_chain -takes care of userland modules loaded. +tracks which userland modules are loaded. .Pp .Va handler_chain is composed of @@ -1123,12 +1121,12 @@ struct proto_handler { where: .Bl -inset .It Va pri -is the priority assigned to a protocol handler, lower +is the priority assigned to a protocol handler; lower priority is better. .It Va dir is the direction of packets: ingoing or outgoing. .It Va proto -says at which protocol this packet belongs: IP, TCP or UDP. +indicates to which protocol this packet belongs: IP, TCP or UDP. .It Va fingerprint points to the fingerprint function while protohandler points to the protocol handler function. @@ -1136,8 +1134,8 @@ to the protocol handler function. .Pp The .Va fingerprint -function has the double of scope of checking if the -incoming packet is found and if it belongs to any categories that this +function has the dual role of checking if the +incoming packet is found, and if it belongs to any categories that this module can handle. .Pp The @@ -1152,8 +1150,8 @@ When a packet enters if it meets a module hook, .Va handler_chain is searched to see if there is an handler that matches -this type of a packet (it checks protocol and direction of packet), then if -more than one handler is found, it starts with the module with +this type of a packet (it checks protocol and direction of packet). +Then, if more than one handler is found, it starts with the module with the lowest priority number: it calls the .Va fingerprint function and interprets the result. @@ -1191,8 +1189,8 @@ structure, then is called. The .Fn find_handler -function is responsible for walking out the handler -chain, it receives as input parameters: +function is responsible for walking the handler +chain; it receives as input parameters: .Bl -tag -width indent .It Fa IN direction @@ -1216,9 +1214,9 @@ supporting INcoming UDP packets. .Pp As was mentioned earlier, .Nm -in userland is a bit different, cause -care has to be taken of module handling too (avoiding duplicate load of -module, avoiding module with same name, etc.) so +in userland is a bit different, as +care must be taken in module handling as well (avoiding duplicate load of +modules, avoiding modules with same name, etc.) so .Va dll_chain was introduced. .Pp @@ -1232,9 +1230,8 @@ When an application calls .Nm first unloads all the loaded modules, then reloads all the modules listed in .Pa /etc/libalias.conf : -for every module loaded, a new entry to -.Va dll_chain -is added. +for every module loaded, a new entry is added to +.Va dll_chain . .Pp .Va dll_chain is composed of @@ -1271,8 +1268,8 @@ There is a module (called .Pa alias_dummy.[ch] ) in .Nm -that can be used as a skeleton for future work, here we analyse some parts of that -module. +that can be used as a skeleton for future work. +Here we analyse some parts of that module. From .Pa alias_dummy.c : .Bd -literal @@ -1285,7 +1282,7 @@ The variable is the .Dq "most important thing" in a module -cause it describes the handlers present and lets the outside world use +since it describes the handlers present and lets the outside world use it in an opaque way. .Pp It must ALWAYS be present in every module, and it MUST retain @@ -1328,7 +1325,7 @@ mod_handler(module_t mod, int type, void .Ed When running as KLD, .Fn mod_handler -register/deregister the module using +registers/deregisters the module using .Fn attach_handlers and .Fn detach_handlers , From owner-svn-src-stable@FreeBSD.ORG Tue Jul 26 19:06:00 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 06326106564A; Tue, 26 Jul 2011 19:06:00 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DFD708FC17; Tue, 26 Jul 2011 19:05:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6QJ5xdq022572; Tue, 26 Jul 2011 19:05:59 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6QJ5xom022570; Tue, 26 Jul 2011 19:05:59 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201107261905.p6QJ5xom022570@svn.freebsd.org> From: Glen Barber Date: Tue, 26 Jul 2011 19:05:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224460 - stable/7/sys/netinet/libalias X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jul 2011 19:06:00 -0000 Author: gjb (doc committer) Date: Tue Jul 26 19:05:59 2011 New Revision: 224460 URL: http://svn.freebsd.org/changeset/base/224460 Log: MFC 223773: - General grammar and mdoc(7) fixes. - While here, remove a paragraph about userspace operation that has been outdated for some time. PR: 158623 Modified: stable/7/sys/netinet/libalias/libalias.3 Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/netinet/libalias/libalias.3 ============================================================================== --- stable/7/sys/netinet/libalias/libalias.3 Tue Jul 26 19:05:10 2011 (r224459) +++ stable/7/sys/netinet/libalias/libalias.3 Tue Jul 26 19:05:59 2011 (r224460) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 1, 2006 +.Dd July 04, 2011 .Dt LIBALIAS 3 .Os .Sh NAME @@ -52,7 +52,7 @@ machine on the local network. .Pp A certain amount of flexibility is built into the packet aliasing engine. In the simplest mode of operation, a many-to-one address mapping takes -place between local network and the packet aliasing host. +place between the local network and the packet aliasing host. This is known as IP masquerading. In addition, one-to-one mappings between local and public addresses can also be implemented, which is known as static NAT. @@ -61,15 +61,11 @@ linked to different public addresses, co many-to-one mappings. Also, a given public address and port can be statically redirected to a private address/port. -.Pp -The packet aliasing engine was designed to operate in user space outside -of the kernel, without any access to private kernel data structure, but -the source code can also be ported to a kernel environment. .Sh INITIALIZATION AND CONTROL One special function, .Fn LibAliasInit , -must always be called before any packet handling may be performed and -the returned instance pointer passed to all the other functions. +must always be called before any packet handling may be performed, and +the returned instance pointer must be passed to all the other functions. Normally, the .Fn LibAliasSetAddress function is called afterwards, to set the default aliasing address. @@ -118,8 +114,8 @@ prior to any packet handling. This function has no return value and is used to clear any resources attached to internal data structures. .Pp -This functions should be called when a program stops using the aliasing -engine; it does, amongst other things, clear out any firewall holes. +This function should be called when a program stops using the aliasing +engine; amongst other things, it clears out any firewall holes. To provide backwards compatibility and extra security, it is added to the .Xr atexit 3 @@ -135,7 +131,7 @@ local area network are aliased. All outgoing packets are re-mapped to this address unless overridden by a static address mapping established by .Fn LibAliasRedirectAddr . -If this function is not called, and no static rules match, an outgoing +If this function has not been called, and no static rules match, an outgoing packet retains its source address. .Pp If the @@ -150,7 +146,7 @@ address may or may not change on success If the .Dv PKT_ALIAS_RESET_ON_ADDR_CHANGE mode bit is set to zero, this function can also be used to dynamically change -the aliasing address on a packet to packet basis (it is a low overhead call). +the aliasing address on a packet-to-packet basis (it is a low overhead call). .Pp It is mandatory that this function be called prior to any packet handling. .Ed @@ -170,7 +166,7 @@ The following mode bits are defined in .It Dv PKT_ALIAS_LOG Enables logging into .Pa /var/log/alias.log . -Each time an aliasing link is created or deleted, the log file is appended +Each time an aliasing link is created or deleted, the log file is appended to with the current number of ICMP, TCP and UDP links. Mainly useful for debugging when the log file is viewed continuously with .Xr tail 1 . @@ -186,7 +182,7 @@ Response packets to connections or trans aliasing host or local network will be unaffected. This mode bit is useful for implementing a one-way firewall. .It Dv PKT_ALIAS_SAME_PORTS -If this mode bit is set, the packet aliasing engine will attempt to leave +If this mode bit is set, the packet-aliasing engine will attempt to leave the alias port numbers unchanged from the actual local port numbers. This can be done as long as the quintuple (proto, alias addr, alias port, remote addr, remote port) is unique. @@ -211,7 +207,7 @@ Standard Class A, B and C unregistered a 192.168.0.0 -> 192.168.255.255 (Class C subnets) .Ed .Pp -This option is useful in the case that packet aliasing host has both +This option is useful in the case that the packet aliasing host has both registered and unregistered subnets on different interfaces. The registered subnet is fully accessible to the outside world, so traffic from it does not need to be passed through the packet aliasing engine. @@ -229,8 +225,9 @@ of an address change. .It Dv PKT_ALIAS_PUNCH_FW This option makes .Nm -`punch holes' in an -.Xr ipfirewall 4 +.Dq punch holes +in an +.Xr ipfirewall 4 - based firewall for FTP/IRC DCC connections. The holes punched are bound by from/to IP address and port; it will not be possible to use a hole for another connection. @@ -240,9 +237,9 @@ To cater to unexpected death of a progra (e.g.\& kill -9), changing the state of the flag will clear the entire firewall range allocated for holes. -This will also happen on the initial call to -.Fn LibAliasSetFWBase . -This call must happen prior to setting this flag. +This clearing will also happen on the initial call to +.Fn LibAliasSetFWBase , +which must happen prior to setting this flag. .It Dv PKT_ALIAS_REVERSE This option makes .Nm @@ -263,10 +260,10 @@ below for details. .Ft void .Fn LibAliasSetFWBase "struct libalias *" "unsigned int base" "unsigned int num" .Bd -ragged -offset indent -Set firewall range allocated for punching firewall holes (with the +Set the firewall range allocated for punching firewall holes (with the .Dv PKT_ALIAS_PUNCH_FW flag). -The range will be cleared for all rules on initialization. +The range is cleared for all rules on initialization. .Ed .Pp .Ft void @@ -292,7 +289,7 @@ the two packet handling functions, .Fn LibAliasIn and .Fn LibAliasOut , -comprise minimal set of functions needed for a basic IP masquerading +comprise the minimal set of functions needed for a basic IP masquerading implementation. .Pp .Ft int @@ -313,11 +310,11 @@ Return codes: The packet aliasing process was successful. .It Dv PKT_ALIAS_IGNORED The packet was ignored and not de-aliased. -This can happen if the protocol is unrecognized, possibly an ICMP message -type is not handled or if incoming packets for new connections are being -ignored (if +This can happen if the protocol is unrecognized, as for an ICMP message +type that is not handled, or if incoming packets for new connections are being +ignored (if the .Dv PKT_ALIAS_DENY_INCOMING -mode bit was set by +mode bit was set using .Fn LibAliasSetMode ) . .It Dv PKT_ALIAS_UNRESOLVED_FRAGMENT This is returned when a fragment cannot be resolved because the header @@ -408,7 +405,7 @@ is called to change the address after .Fn LibAliasRedirectPort is called, a zero reference will track this change. .Pp -If the link is further set up to operate for a load sharing, then +If the link is further set up to operate with load sharing, then .Fa local_addr and .Fa local_port @@ -423,7 +420,7 @@ Likewise, if .Fa remote_port is zero, this indicates to redirect packets originating from any remote port number. -Almost always, the remote port specification will be zero, but non-zero +The remote port specification will almost always be zero, but non-zero remote addresses can sometimes be useful for firewalling. If two calls to .Fn LibAliasRedirectPort @@ -475,9 +472,10 @@ is called to change the address after .Fn LibAliasRedirectAddr is called, a zero reference will track this change. .Pp -If the link is further set up to operate for a load sharing, then +If the link is further set up to operate with load sharing, then the .Fa local_addr -is ignored, and is selected dynamically from the server pool, as described in +argument is ignored, and is selected dynamically from the server pool, +as described in .Fn LibAliasAddServer below. .Pp @@ -532,12 +530,12 @@ up for Load Sharing using IP Network Add LSNAT operates as follows. A client attempts to access a server by using the server virtual address. The LSNAT router transparently redirects the request to one of the hosts -in server pool, selected using a real-time load sharing algorithm. +in the server pool, using a real-time load sharing algorithm. Multiple sessions may be initiated from the same client, and each session -could be directed to a different host based on load balance across server -pool hosts at the time. -If load share is desired for just a few specific services, the configuration -on LSNAT could be defined to restrict load share for just the services +could be directed to a different host based on the load balance across server +pool hosts when the sessions are initiated. +If load sharing is desired for just a few specific services, the configuration +on LSNAT could be defined to restrict load sharing to just the services desired. .Pp Currently, only the simplest selection algorithm is implemented, where a @@ -596,8 +594,8 @@ The parameter is the pointer returned by either of the redirection functions. If an invalid pointer is passed to .Fn LibAliasRedirectDelete , -then a program crash or unpredictable operation could result, so it is -necessary to be careful using this function. +then a program crash or unpredictable operation could result, so +care is needed when using this function. .Ed .Pp .Ft int @@ -704,7 +702,7 @@ access, or to restrict access to certain .Bd -ragged -offset indent This function specifies that any IP packet with protocol number of .Fa proto -from a given remote address to an alias address be +from a given remote address to an alias address will be redirected to a specified local address. .Pp If @@ -1099,9 +1097,9 @@ SLIST_HEAD(dll_chain, dll) dll_chain ... .Ed .Pp .Va handler_chain -keep tracks of all the protocol handlers loaded, while +keeps track of all the protocol handlers loaded, while .Va ddl_chain -takes care of userland modules loaded. +tracks which userland modules are loaded. .Pp .Va handler_chain is composed of @@ -1123,12 +1121,12 @@ struct proto_handler { where: .Bl -inset .It Va pri -is the priority assigned to a protocol handler, lower +is the priority assigned to a protocol handler; lower priority is better. .It Va dir is the direction of packets: ingoing or outgoing. .It Va proto -says at which protocol this packet belongs: IP, TCP or UDP. +indicates to which protocol this packet belongs: IP, TCP or UDP. .It Va fingerprint points to the fingerprint function while protohandler points to the protocol handler function. @@ -1136,8 +1134,8 @@ to the protocol handler function. .Pp The .Va fingerprint -function has the double of scope of checking if the -incoming packet is found and if it belongs to any categories that this +function has the dual role of checking if the +incoming packet is found, and if it belongs to any categories that this module can handle. .Pp The @@ -1152,8 +1150,8 @@ When a packet enters if it meets a module hook, .Va handler_chain is searched to see if there is an handler that matches -this type of a packet (it checks protocol and direction of packet), then if -more than one handler is found, it starts with the module with +this type of a packet (it checks protocol and direction of packet). +Then, if more than one handler is found, it starts with the module with the lowest priority number: it calls the .Va fingerprint function and interprets the result. @@ -1191,8 +1189,8 @@ structure, then is called. The .Fn find_handler -function is responsible for walking out the handler -chain, it receives as input parameters: +function is responsible for walking the handler +chain; it receives as input parameters: .Bl -tag -width indent .It Fa IN direction @@ -1216,9 +1214,9 @@ supporting INcoming UDP packets. .Pp As was mentioned earlier, .Nm -in userland is a bit different, cause -care has to be taken of module handling too (avoiding duplicate load of -module, avoiding module with same name, etc.) so +in userland is a bit different, as +care must be taken in module handling as well (avoiding duplicate load of +modules, avoiding modules with same name, etc.) so .Va dll_chain was introduced. .Pp @@ -1232,9 +1230,8 @@ When an application calls .Nm first unloads all the loaded modules, then reloads all the modules listed in .Pa /etc/libalias.conf : -for every module loaded, a new entry to -.Va dll_chain -is added. +for every module loaded, a new entry is added to +.Va dll_chain . .Pp .Va dll_chain is composed of @@ -1271,8 +1268,8 @@ There is a module (called .Pa alias_dummy.[ch] ) in .Nm -that can be used as a skeleton for future work, here we analyse some parts of that -module. +that can be used as a skeleton for future work. +Here we analyse some parts of that module. From .Pa alias_dummy.c : .Bd -literal @@ -1285,7 +1282,7 @@ The variable is the .Dq "most important thing" in a module -cause it describes the handlers present and lets the outside world use +since it describes the handlers present and lets the outside world use it in an opaque way. .Pp It must ALWAYS be present in every module, and it MUST retain @@ -1328,7 +1325,7 @@ mod_handler(module_t mod, int type, void .Ed When running as KLD, .Fn mod_handler -register/deregister the module using +registers/deregisters the module using .Fn attach_handlers and .Fn detach_handlers , From owner-svn-src-stable@FreeBSD.ORG Tue Jul 26 20:51:59 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 689531065670; Tue, 26 Jul 2011 20:51:59 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3DC1F8FC12; Tue, 26 Jul 2011 20:51:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6QKpx7R025930; Tue, 26 Jul 2011 20:51:59 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6QKpxm8025928; Tue, 26 Jul 2011 20:51:59 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201107262051.p6QKpxm8025928@svn.freebsd.org> From: Rick Macklem Date: Tue, 26 Jul 2011 20:51:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224461 - stable/8/usr.sbin/mountd X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jul 2011 20:51:59 -0000 Author: rmacklem Date: Tue Jul 26 20:51:58 2011 New Revision: 224461 URL: http://svn.freebsd.org/changeset/base/224461 Log: MFC: r223954 Try and fix the exports.5 man page so that it clarifies how NFSv4 exports are handled. Improved by comments from mckusick, kudak at mit.edu and bde. This is a content change. Modified: stable/8/usr.sbin/mountd/exports.5 Directory Properties: stable/8/usr.sbin/mountd/ (props changed) Modified: stable/8/usr.sbin/mountd/exports.5 ============================================================================== --- stable/8/usr.sbin/mountd/exports.5 Tue Jul 26 19:05:59 2011 (r224460) +++ stable/8/usr.sbin/mountd/exports.5 Tue Jul 26 20:51:58 2011 (r224461) @@ -28,7 +28,7 @@ .\" @(#)exports.5 8.3 (Berkeley) 3/29/95 .\" $FreeBSD$ .\" -.Dd June 30, 2008 +.Dd July 12, 2011 .Dt EXPORTS 5 .Os .Sh NAME @@ -72,6 +72,13 @@ that can be mounted on by the correspond There are three forms of this specification. The first is to list all mount points as absolute directory paths separated by whitespace. +This list of directory paths should be considered an +.Dq administrative control , +since it is only enforced by the +.Xr mountd 8 +daemon and not the kernel. +As such, it only applies to NFSv2 and NFSv3 mounts and only +with respect to the client's use of the mount protocol. The second is to specify the pathname of the root of the file system followed by the .Fl alldirs @@ -81,8 +88,21 @@ including regular files if the .Fl r option is used on .Xr mountd 8 . +Because NFSv4 does not use the mount protocol, +the +.Dq administrative controls +are not applied. +Thus, all the above export line(s) should be considered to have the +.Fl alldirs +flag, even if the line is specified without it. The third form has the string ``V4:'' followed by a single absolute path name, to specify the NFSv4 tree root. +This line does not export any file system, but simply marks where the root +of the server's directory tree is for NFSv4 clients. +The exported file systems for NFSv4 are specified via the other lines +in the +.Xr exports 5 +file in the same way as for NFSv2 and NFSv3. The pathnames must not have any symbolic links in them and should not have any .Dq Pa \&. From owner-svn-src-stable@FreeBSD.ORG Wed Jul 27 01:56:53 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0A60B106564A; Wed, 27 Jul 2011 01:56:53 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ED48B8FC12; Wed, 27 Jul 2011 01:56:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6R1uq38035837; Wed, 27 Jul 2011 01:56:52 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6R1uquD035835; Wed, 27 Jul 2011 01:56:52 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201107270156.p6R1uquD035835@svn.freebsd.org> From: Glen Barber Date: Wed, 27 Jul 2011 01:56:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224462 - stable/8/usr.sbin/jail X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jul 2011 01:56:53 -0000 Author: gjb (doc committer) Date: Wed Jul 27 01:56:52 2011 New Revision: 224462 URL: http://svn.freebsd.org/changeset/base/224462 Log: MFC 224286: Document the potential for jail escape. PR: 142341 Modified: stable/8/usr.sbin/jail/jail.8 Directory Properties: stable/8/usr.sbin/jail/ (props changed) Modified: stable/8/usr.sbin/jail/jail.8 ============================================================================== --- stable/8/usr.sbin/jail/jail.8 Tue Jul 26 20:51:58 2011 (r224461) +++ stable/8/usr.sbin/jail/jail.8 Wed Jul 27 01:56:52 2011 (r224462) @@ -34,7 +34,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 17, 2010 +.Dd July 23, 2011 .Dt JAIL 8 .Os .Sh NAME @@ -913,3 +913,10 @@ Currently, the simplest answer is to min offered on the host, possibly limiting it to services offered from .Xr inetd 8 which is easily configurable. +.Sh NOTES +Great care should be taken when managing directories visible within the jail. +For example, if a jailed process has its current working directory set to a +directory that is moved out of the jail's chroot, then the process may gain +access to the file space outside of the jail. +It is recommended that directories always be copied, rather than moved, out +of a jail. From owner-svn-src-stable@FreeBSD.ORG Wed Jul 27 01:57:24 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E5F51106568C; Wed, 27 Jul 2011 01:57:24 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D50518FC16; Wed, 27 Jul 2011 01:57:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6R1vOhW035895; Wed, 27 Jul 2011 01:57:24 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6R1vOwZ035893; Wed, 27 Jul 2011 01:57:24 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201107270157.p6R1vOwZ035893@svn.freebsd.org> From: Glen Barber Date: Wed, 27 Jul 2011 01:57:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224463 - stable/7/usr.sbin/jail X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jul 2011 01:57:25 -0000 Author: gjb (doc committer) Date: Wed Jul 27 01:57:24 2011 New Revision: 224463 URL: http://svn.freebsd.org/changeset/base/224463 Log: MFC 224286: Document the potential for jail escape. PR: 142341 Modified: stable/7/usr.sbin/jail/jail.8 Directory Properties: stable/7/usr.sbin/jail/ (props changed) Modified: stable/7/usr.sbin/jail/jail.8 ============================================================================== --- stable/7/usr.sbin/jail/jail.8 Wed Jul 27 01:56:52 2011 (r224462) +++ stable/7/usr.sbin/jail/jail.8 Wed Jul 27 01:57:24 2011 (r224463) @@ -33,7 +33,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 17, 2010 +.Dd July 23, 2011 .Dt JAIL 8 .Os .Sh NAME @@ -708,3 +708,10 @@ Currently, the simplest answer is to min offered on the host, possibly limiting it to services offered from .Xr inetd 8 which is easily configurable. +.Sh NOTES +Great care should be taken when managing directories visible within the jail. +For example, if a jailed process has its current working directory set to a +directory that is moved out of the jail's chroot, then the process may gain +access to the file space outside of the jail. +It is recommended that directories always be copied, rather than moved, out +of a jail. From owner-svn-src-stable@FreeBSD.ORG Wed Jul 27 04:10:33 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7BCAD106566C; Wed, 27 Jul 2011 04:10:33 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 50C0D8FC14; Wed, 27 Jul 2011 04:10:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6R4AXuD040345; Wed, 27 Jul 2011 04:10:33 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6R4AXc3040342; Wed, 27 Jul 2011 04:10:33 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201107270410.p6R4AXc3040342@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Wed, 27 Jul 2011 04:10:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224464 - in stable/8/sys: geom/part sys X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jul 2011 04:10:33 -0000 Author: ae Date: Wed Jul 27 04:10:32 2011 New Revision: 224464 URL: http://svn.freebsd.org/changeset/base/224464 Log: MFC r223587: MS Windows NT+ uses 4 bytes at offset 0x1b8 in the MBR to identify disk drive. The boot0cfg(8) utility preserves these 4 bytes when it is writing bootcode to keep a multiboot ability. Change gpart's bootcode method to keep DSN if it is not zero. Also do not allow writing bootcode with size not equal to MBRSIZE. PR: kern/157819 Modified: stable/8/sys/geom/part/g_part_mbr.c stable/8/sys/sys/diskmbr.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/geom/label/ (props changed) Modified: stable/8/sys/geom/part/g_part_mbr.c ============================================================================== --- stable/8/sys/geom/part/g_part_mbr.c Wed Jul 27 01:57:24 2011 (r224463) +++ stable/8/sys/geom/part/g_part_mbr.c Wed Jul 27 04:10:32 2011 (r224464) @@ -234,14 +234,16 @@ static int g_part_mbr_bootcode(struct g_part_table *basetable, struct g_part_parms *gpp) { struct g_part_mbr_table *table; - size_t codesz; + uint32_t dsn; + + if (gpp->gpp_codesize != MBRSIZE) + return (ENODEV); - codesz = DOSPARTOFF; table = (struct g_part_mbr_table *)basetable; - bzero(table->mbr, codesz); - codesz = MIN(codesz, gpp->gpp_codesize); - if (codesz > 0) - bcopy(gpp->gpp_codeptr, table->mbr, codesz); + dsn = *(uint32_t *)(table->mbr + DOSDSNOFF); + bcopy(gpp->gpp_codeptr, table->mbr, DOSPARTOFF); + if (dsn != 0) + *(uint32_t *)(table->mbr + DOSDSNOFF) = dsn; return (0); } Modified: stable/8/sys/sys/diskmbr.h ============================================================================== --- stable/8/sys/sys/diskmbr.h Wed Jul 27 01:57:24 2011 (r224463) +++ stable/8/sys/sys/diskmbr.h Wed Jul 27 04:10:32 2011 (r224464) @@ -36,6 +36,7 @@ #include #define DOSBBSECTOR 0 /* DOS boot block relative sector number */ +#define DOSDSNOFF 440 /* WinNT/2K/XP Drive Serial Number offset */ #define DOSPARTOFF 446 #define DOSPARTSIZE 16 #define NDOSPART 4 From owner-svn-src-stable@FreeBSD.ORG Wed Jul 27 04:23:27 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E288A1065672; Wed, 27 Jul 2011 04:23:26 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 845C38FC14; Wed, 27 Jul 2011 04:23:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6R4NQvT040775; Wed, 27 Jul 2011 04:23:26 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6R4NQE0040773; Wed, 27 Jul 2011 04:23:26 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201107270423.p6R4NQE0040773@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Wed, 27 Jul 2011 04:23:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224465 - stable/8/sys/geom/part X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jul 2011 04:23:27 -0000 Author: ae Date: Wed Jul 27 04:23:26 2011 New Revision: 224465 URL: http://svn.freebsd.org/changeset/base/224465 Log: MFC r216754: Make EBR probe method less strictly to be able detect EBRs with small non fatal inconsistency. EBR may contain boot loader and sometimes it just has some garbage data. Now this does not prevent FreeBSD to use extended partitions. But since we do not support bootcode for EBR we mark tables which have non empty boot area as corrupt. This does make them readonly and we can not damage this data. MFC r223594: EBR could contain an early stage of boot code. But we do not support it. Remove message about non empty bootcode, we can not break something while GEOM_PART_EBR_COMPAT is defined. But without GEOM_PART_EBR_COMPAT any changes in EBR are allowed and we can accidentally wipe the boot code. To do not break anything save the first EBR chunk and keep it untouched each time when we are changing EBR. Note that we are still not support boot code for EBR. PR: kern/141235 Modified: stable/8/sys/geom/part/g_part_ebr.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/geom/label/ (props changed) Modified: stable/8/sys/geom/part/g_part_ebr.c ============================================================================== --- stable/8/sys/geom/part/g_part_ebr.c Wed Jul 27 04:10:32 2011 (r224464) +++ stable/8/sys/geom/part/g_part_ebr.c Wed Jul 27 04:23:26 2011 (r224465) @@ -51,6 +51,9 @@ __FBSDID("$FreeBSD$"); struct g_part_ebr_table { struct g_part_table base; +#ifndef GEOM_PART_EBR_COMPAT + u_char ebr[EBRSIZE]; +#endif }; struct g_part_ebr_entry { @@ -395,7 +398,7 @@ g_part_ebr_probe(struct g_part_table *ta char psn[8]; struct g_provider *pp; u_char *buf, *p; - int error, index, res, sum; + int error, index, res; uint16_t magic; pp = cp->provider; @@ -427,29 +430,11 @@ g_part_ebr_probe(struct g_part_table *ta if (magic != DOSMAGIC) goto out; - /* - * The sector is all zeroes, except for the partition entries, - * pseudo boot code and some signatures or disk serial number. - * The latter can be found in the 9 bytes immediately in front - * of the partition table. - */ - sum = 0; - for (index = 96; index < DOSPARTOFF - 9; index++) - sum += buf[index]; - if (sum != 0) - goto out; - - for (index = 0; index < NDOSPART; index++) { + for (index = 0; index < 2; index++) { p = buf + DOSPARTOFF + index * DOSPARTSIZE; if (p[0] != 0 && p[0] != 0x80) goto out; - if (index < 2) - continue; - /* The 3rd & 4th entries are always zero. */ - if ((le64dec(p+0) + le64dec(p+8)) != 0) - goto out; } - res = G_PART_PROBE_PRI_NORM; out: @@ -483,6 +468,19 @@ g_part_ebr_read(struct g_part_table *bas ebr_entry_decode(buf + DOSPARTOFF + 0 * DOSPARTSIZE, ent + 0); ebr_entry_decode(buf + DOSPARTOFF + 1 * DOSPARTSIZE, ent + 1); + + /* The 3rd & 4th entries should be zeroes. */ + if (le64dec(buf + DOSPARTOFF + 2 * DOSPARTSIZE) + + le64dec(buf + DOSPARTOFF + 3 * DOSPARTSIZE) != 0) { + basetable->gpt_corrupt = 1; + printf("GEOM: %s: invalid entries in the EBR ignored.\n", + pp->name); + } +#ifndef GEOM_PART_EBR_COMPAT + /* Save the first EBR, it can contain a boot code */ + if (lba == 0) + bcopy(buf, table->ebr, sizeof(table->ebr)); +#endif g_free(buf); if (ent[0].dp_typ == 0) @@ -570,6 +568,9 @@ g_part_ebr_type(struct g_part_table *bas static int g_part_ebr_write(struct g_part_table *basetable, struct g_consumer *cp) { +#ifndef GEOM_PART_EBR_COMPAT + struct g_part_ebr_table *table; +#endif struct g_provider *pp; struct g_part_entry *baseentry, *next; struct g_part_ebr_entry *entry; @@ -579,6 +580,10 @@ g_part_ebr_write(struct g_part_table *ba pp = cp->provider; buf = g_malloc(pp->sectorsize, M_WAITOK | M_ZERO); +#ifndef GEOM_PART_EBR_COMPAT + table = (struct g_part_ebr_table *)basetable; + bcopy(table->ebr, buf, DOSPARTOFF); +#endif le16enc(buf + DOSMAGICOFFSET, DOSMAGIC); baseentry = LIST_FIRST(&basetable->gpt_entry); @@ -631,7 +636,10 @@ g_part_ebr_write(struct g_part_table *ba error = g_write_data(cp, baseentry->gpe_start * pp->sectorsize, buf, pp->sectorsize); - +#ifndef GEOM_PART_EBR_COMPAT + if (baseentry->gpe_start == 0) + bzero(buf, DOSPARTOFF); +#endif baseentry = next; } while (!error && baseentry != NULL); From owner-svn-src-stable@FreeBSD.ORG Wed Jul 27 07:02:33 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A5843106566B; Wed, 27 Jul 2011 07:02:33 +0000 (UTC) (envelope-from maxim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 947128FC13; Wed, 27 Jul 2011 07:02:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6R72XXd045472; Wed, 27 Jul 2011 07:02:33 GMT (envelope-from maxim@svn.freebsd.org) Received: (from maxim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6R72XC6045470; Wed, 27 Jul 2011 07:02:33 GMT (envelope-from maxim@svn.freebsd.org) Message-Id: <201107270702.p6R72XC6045470@svn.freebsd.org> From: Maxim Konovalov Date: Wed, 27 Jul 2011 07:02:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224466 - stable/8/sys/net X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jul 2011 07:02:33 -0000 Author: maxim Date: Wed Jul 27 07:02:33 2011 New Revision: 224466 URL: http://svn.freebsd.org/changeset/base/224466 Log: MFC r223846 by thompsa: grab the rlock before checking if our interface is enabled. Approved by: thompsa Modified: stable/8/sys/net/if_lagg.c Modified: stable/8/sys/net/if_lagg.c ============================================================================== --- stable/8/sys/net/if_lagg.c Wed Jul 27 04:23:26 2011 (r224465) +++ stable/8/sys/net/if_lagg.c Wed Jul 27 07:02:33 2011 (r224466) @@ -1213,14 +1213,15 @@ lagg_input(struct ifnet *ifp, struct mbu struct lagg_softc *sc = lp->lp_softc; struct ifnet *scifp = sc->sc_ifp; + LAGG_RLOCK(sc); if ((scifp->if_drv_flags & IFF_DRV_RUNNING) == 0 || (lp->lp_flags & LAGG_PORT_DISABLED) || sc->sc_proto == LAGG_PROTO_NONE) { + LAGG_RUNLOCK(sc); m_freem(m); return (NULL); } - LAGG_RLOCK(sc); ETHER_BPF_MTAP(scifp, m); m = (*sc->sc_input)(sc, lp, m); From owner-svn-src-stable@FreeBSD.ORG Wed Jul 27 11:21:50 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 47EDA1065674; Wed, 27 Jul 2011 11:21:50 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 361788FC0A; Wed, 27 Jul 2011 11:21:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6RBLoEU055176; Wed, 27 Jul 2011 11:21:50 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6RBLon3055171; Wed, 27 Jul 2011 11:21:50 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107271121.p6RBLon3055171@svn.freebsd.org> From: Marius Strobl Date: Wed, 27 Jul 2011 11:21:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224467 - in stable/8/lib/libthr/arch/sparc64: . include sparc64 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jul 2011 11:21:50 -0000 Author: marius Date: Wed Jul 27 11:21:49 2011 New Revision: 224467 URL: http://svn.freebsd.org/changeset/base/224467 Log: MFC: r223228 Merge from r161730: o Set TP using inline assembly to avoid dead code elimination. o Eliminate _tcb. Merge from r161840: Stylize: avoid using a global register variable. Merge from r157461: Simplify _get_curthread() and _tcb_ctor because libc and rtld now already allocate thread pointer space in tls block for initial thread. Merge from r177853: Replace function _umtx_op with _umtx_op_err, the later function directly returns errno, because errno can be mucked by user's signal handler and most of pthread api heavily depends on errno to be correct, this change should improve stability of the thread library. Added: stable/8/lib/libthr/arch/sparc64/sparc64/_umtx_op_err.S - copied unchanged from r223228, head/lib/libthr/arch/sparc64/sparc64/_umtx_op_err.S Modified: stable/8/lib/libthr/arch/sparc64/Makefile.inc stable/8/lib/libthr/arch/sparc64/include/pthread_md.h stable/8/lib/libthr/arch/sparc64/sparc64/pthread_md.c Directory Properties: stable/8/lib/libthr/ (props changed) Modified: stable/8/lib/libthr/arch/sparc64/Makefile.inc ============================================================================== --- stable/8/lib/libthr/arch/sparc64/Makefile.inc Wed Jul 27 07:02:33 2011 (r224466) +++ stable/8/lib/libthr/arch/sparc64/Makefile.inc Wed Jul 27 11:21:49 2011 (r224467) @@ -2,4 +2,4 @@ .PATH: ${.CURDIR}/arch/${MACHINE_ARCH}/${MACHINE_ARCH} -SRCS+= pthread_md.c +SRCS+= _umtx_op_err.S pthread_md.c Modified: stable/8/lib/libthr/arch/sparc64/include/pthread_md.h ============================================================================== --- stable/8/lib/libthr/arch/sparc64/include/pthread_md.h Wed Jul 27 07:02:33 2011 (r224466) +++ stable/8/lib/libthr/arch/sparc64/include/pthread_md.h Wed Jul 27 11:21:49 2011 (r224467) @@ -50,10 +50,6 @@ struct tcb { void *tcb_spare[1]; }; -register struct tcb *_tp __asm("%g7"); - -#define _tcb (_tp) - /* * The tcb constructors. */ @@ -64,26 +60,25 @@ void _tcb_dtor(struct tcb *); static __inline void _tcb_set(struct tcb *tcb) { - _tp = tcb; + + __asm __volatile("mov %0, %%g7" : : "r" (tcb)); } -/* - * Get the current tcb. - */ static __inline struct tcb * _tcb_get(void) { - return (_tcb); -} + register struct tcb *tp __asm("%g7"); -extern struct pthread *_thr_initial; + return (tp); +} static __inline struct pthread * _get_curthread(void) { - if (_thr_initial) - return (_tcb->tcb_thread); - return (NULL); + + return (_tcb_get()->tcb_thread); } +#define HAS__UMTX_OP_ERR 1 + #endif /* _PTHREAD_MD_H_ */ Copied: stable/8/lib/libthr/arch/sparc64/sparc64/_umtx_op_err.S (from r223228, head/lib/libthr/arch/sparc64/sparc64/_umtx_op_err.S) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/lib/libthr/arch/sparc64/sparc64/_umtx_op_err.S Wed Jul 27 11:21:49 2011 (r224467, copy of r223228, head/lib/libthr/arch/sparc64/sparc64/_umtx_op_err.S) @@ -0,0 +1,38 @@ +/*- + * Copyright (c) 2011 Marius Strobl + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include + +#include + +ENTRY(_umtx_op_err) + mov SYS__umtx_op, %g1 + retl + ta %xcc, ST_SYSCALL +END(_umtx_op_err) Modified: stable/8/lib/libthr/arch/sparc64/sparc64/pthread_md.c ============================================================================== --- stable/8/lib/libthr/arch/sparc64/sparc64/pthread_md.c Wed Jul 27 07:02:33 2011 (r224466) +++ stable/8/lib/libthr/arch/sparc64/sparc64/pthread_md.c Wed Jul 27 11:21:49 2011 (r224467) @@ -24,10 +24,11 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $FreeBSD$ */ +#include +__FBSDID("$FreeBSD$"); + #include #include @@ -37,13 +38,11 @@ struct tcb * _tcb_ctor(struct pthread *thread, int initial) { struct tcb *tcb; - void *oldtls; if (initial) - oldtls = _tp; + tcb = _tcb_get(); else - oldtls = NULL; - tcb = _rtld_allocate_tls(oldtls, sizeof(struct tcb), 16); + tcb = _rtld_allocate_tls(NULL, sizeof(struct tcb), 16); if (tcb) tcb->tcb_thread = thread; return (tcb); @@ -52,5 +51,6 @@ _tcb_ctor(struct pthread *thread, int in void _tcb_dtor(struct tcb *tcb) { + _rtld_free_tls(tcb, sizeof(struct tcb), 16); } From owner-svn-src-stable@FreeBSD.ORG Wed Jul 27 11:21:51 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 233F6106564A; Wed, 27 Jul 2011 11:21:51 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1181C8FC0C; Wed, 27 Jul 2011 11:21:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6RBLoq6055212; Wed, 27 Jul 2011 11:21:50 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6RBLokF055207; Wed, 27 Jul 2011 11:21:50 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107271121.p6RBLokF055207@svn.freebsd.org> From: Marius Strobl Date: Wed, 27 Jul 2011 11:21:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224468 - in stable/7/lib/libthr/arch/sparc64: . include sparc64 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jul 2011 11:21:51 -0000 Author: marius Date: Wed Jul 27 11:21:50 2011 New Revision: 224468 URL: http://svn.freebsd.org/changeset/base/224468 Log: MFC: r223228 Merge from r161730: o Set TP using inline assembly to avoid dead code elimination. o Eliminate _tcb. Merge from r161840: Stylize: avoid using a global register variable. Merge from r157461: Simplify _get_curthread() and _tcb_ctor because libc and rtld now already allocate thread pointer space in tls block for initial thread. Merge from r177853: Replace function _umtx_op with _umtx_op_err, the later function directly returns errno, because errno can be mucked by user's signal handler and most of pthread api heavily depends on errno to be correct, this change should improve stability of the thread library. Added: stable/7/lib/libthr/arch/sparc64/sparc64/_umtx_op_err.S - copied unchanged from r223228, head/lib/libthr/arch/sparc64/sparc64/_umtx_op_err.S Modified: stable/7/lib/libthr/arch/sparc64/Makefile.inc stable/7/lib/libthr/arch/sparc64/include/pthread_md.h stable/7/lib/libthr/arch/sparc64/sparc64/pthread_md.c Directory Properties: stable/7/lib/libthr/ (props changed) Modified: stable/7/lib/libthr/arch/sparc64/Makefile.inc ============================================================================== --- stable/7/lib/libthr/arch/sparc64/Makefile.inc Wed Jul 27 11:21:49 2011 (r224467) +++ stable/7/lib/libthr/arch/sparc64/Makefile.inc Wed Jul 27 11:21:50 2011 (r224468) @@ -2,4 +2,4 @@ .PATH: ${.CURDIR}/arch/${MACHINE_ARCH}/${MACHINE_ARCH} -SRCS+= pthread_md.c +SRCS+= _umtx_op_err.S pthread_md.c Modified: stable/7/lib/libthr/arch/sparc64/include/pthread_md.h ============================================================================== --- stable/7/lib/libthr/arch/sparc64/include/pthread_md.h Wed Jul 27 11:21:49 2011 (r224467) +++ stable/7/lib/libthr/arch/sparc64/include/pthread_md.h Wed Jul 27 11:21:50 2011 (r224468) @@ -50,10 +50,6 @@ struct tcb { void *tcb_spare[1]; }; -register struct tcb *_tp __asm("%g7"); - -#define _tcb (_tp) - /* * The tcb constructors. */ @@ -64,26 +60,25 @@ void _tcb_dtor(struct tcb *); static __inline void _tcb_set(struct tcb *tcb) { - _tp = tcb; + + __asm __volatile("mov %0, %%g7" : : "r" (tcb)); } -/* - * Get the current tcb. - */ static __inline struct tcb * _tcb_get(void) { - return (_tcb); -} + register struct tcb *tp __asm("%g7"); -extern struct pthread *_thr_initial; + return (tp); +} static __inline struct pthread * _get_curthread(void) { - if (_thr_initial) - return (_tcb->tcb_thread); - return (NULL); + + return (_tcb_get()->tcb_thread); } +#define HAS__UMTX_OP_ERR 1 + #endif /* _PTHREAD_MD_H_ */ Copied: stable/7/lib/libthr/arch/sparc64/sparc64/_umtx_op_err.S (from r223228, head/lib/libthr/arch/sparc64/sparc64/_umtx_op_err.S) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/lib/libthr/arch/sparc64/sparc64/_umtx_op_err.S Wed Jul 27 11:21:50 2011 (r224468, copy of r223228, head/lib/libthr/arch/sparc64/sparc64/_umtx_op_err.S) @@ -0,0 +1,38 @@ +/*- + * Copyright (c) 2011 Marius Strobl + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include + +#include + +ENTRY(_umtx_op_err) + mov SYS__umtx_op, %g1 + retl + ta %xcc, ST_SYSCALL +END(_umtx_op_err) Modified: stable/7/lib/libthr/arch/sparc64/sparc64/pthread_md.c ============================================================================== --- stable/7/lib/libthr/arch/sparc64/sparc64/pthread_md.c Wed Jul 27 11:21:49 2011 (r224467) +++ stable/7/lib/libthr/arch/sparc64/sparc64/pthread_md.c Wed Jul 27 11:21:50 2011 (r224468) @@ -24,10 +24,11 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $FreeBSD$ */ +#include +__FBSDID("$FreeBSD$"); + #include #include @@ -37,13 +38,11 @@ struct tcb * _tcb_ctor(struct pthread *thread, int initial) { struct tcb *tcb; - void *oldtls; if (initial) - oldtls = _tp; + tcb = _tcb_get(); else - oldtls = NULL; - tcb = _rtld_allocate_tls(oldtls, sizeof(struct tcb), 16); + tcb = _rtld_allocate_tls(NULL, sizeof(struct tcb), 16); if (tcb) tcb->tcb_thread = thread; return (tcb); @@ -52,5 +51,6 @@ _tcb_ctor(struct pthread *thread, int in void _tcb_dtor(struct tcb *tcb) { + _rtld_free_tls(tcb, sizeof(struct tcb), 16); } From owner-svn-src-stable@FreeBSD.ORG Thu Jul 28 02:40:17 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8E54A106566B; Thu, 28 Jul 2011 02:40:17 +0000 (UTC) (envelope-from jhellenthal@gmail.com) Received: from mail-iy0-f182.google.com (mail-iy0-f182.google.com [209.85.210.182]) by mx1.freebsd.org (Postfix) with ESMTP id 271AF8FC16; Thu, 28 Jul 2011 02:40:16 +0000 (UTC) Received: by iyb11 with SMTP id 11so3219695iyb.13 for ; Wed, 27 Jul 2011 19:40:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to; bh=p24sltxxJBcYDmMrJriF27NJE4b3KhbfS1pOpLVaI58=; b=dCTBbLibMCNTPcJ2AGAMluki8Z4liQwyHTHBYDZY0CAJ2cHXN928RkK2s4F632bcMT 88tNq9PE8OmWZisbYbDJGIwB9y9UWHIUu69FaJpsGsDDeqrRXJPsFwEkSz0OaJWq1ISe TfF1GEV6IjiYVvYNwwqHPyrc3q8RHDeiIrEBY= Received: by 10.42.134.2 with SMTP id j2mr365821ict.308.1311820815172; Wed, 27 Jul 2011 19:40:15 -0700 (PDT) Received: from DataIX.net (adsl-99-181-132-76.dsl.klmzmi.sbcglobal.net [99.181.132.76]) by mx.google.com with ESMTPS id e2sm339800ibb.23.2011.07.27.19.40.12 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 27 Jul 2011 19:40:13 -0700 (PDT) Sender: "J. Hellenthal" Received: from DataIX.net (localhost [127.0.0.1]) by DataIX.net (8.14.5/8.14.5) with ESMTP id p6S2e7Rq092373 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 27 Jul 2011 22:40:08 -0400 (EDT) (envelope-from jhell@DataIX.net) Received: (from jhell@localhost) by DataIX.net (8.14.5/8.14.5/Submit) id p6S2e77n092372; Wed, 27 Jul 2011 22:40:07 -0400 (EDT) (envelope-from jhell@DataIX.net) Date: Wed, 27 Jul 2011 22:40:07 -0400 From: Jason Hellenthal To: "Andrey V. Elsukov" Message-ID: <20110728024007.GB55550@DataIX.net> References: <201107270410.p6R4AXc3040342@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="jho1yZJdad60DJr+" Content-Disposition: inline In-Reply-To: <201107270410.p6R4AXc3040342@svn.freebsd.org> Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org Subject: Re: svn commit: r224464 - in stable/8/sys: geom/part sys X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jul 2011 02:40:17 -0000 --jho1yZJdad60DJr+ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jul 27, 2011 at 04:10:33AM +0000, Andrey V. Elsukov wrote: > Author: ae > Date: Wed Jul 27 04:10:32 2011 > New Revision: 224464 > URL: http://svn.freebsd.org/changeset/base/224464 >=20 > Log: > MFC r223587: > MS Windows NT+ uses 4 bytes at offset 0x1b8 in the MBR to identify > disk drive. The boot0cfg(8) utility preserves these 4 bytes when it is > writing bootcode to keep a multiboot ability. > Change gpart's bootcode method to keep DSN if it is not zero. Also > do not allow writing bootcode with size not equal to MBRSIZE. > =20 > PR: kern/157819 >=20 > Modified: > stable/8/sys/geom/part/g_part_mbr.c > stable/8/sys/sys/diskmbr.h > Directory Properties: > stable/8/sys/ (props changed) > stable/8/sys/amd64/include/xen/ (props changed) > stable/8/sys/cddl/contrib/opensolaris/ (props changed) > stable/8/sys/contrib/dev/acpica/ (props changed) > stable/8/sys/contrib/pf/ (props changed) > stable/8/sys/geom/label/ (props changed) >=20 > Modified: stable/8/sys/geom/part/g_part_mbr.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- stable/8/sys/geom/part/g_part_mbr.c Wed Jul 27 01:57:24 2011 (r224463) > +++ stable/8/sys/geom/part/g_part_mbr.c Wed Jul 27 04:10:32 2011 (r224464) > @@ -234,14 +234,16 @@ static int > g_part_mbr_bootcode(struct g_part_table *basetable, struct g_part_parms = *gpp) > { > struct g_part_mbr_table *table; > - size_t codesz; > + uint32_t dsn; > + > + if (gpp->gpp_codesize !=3D MBRSIZE) > + return (ENODEV); Is it known for an absolute fact that the size being written is always going to be the size of MBRSIZE ? never less ? wouldnt ">=3D" greater-than or equal make sense here ? though I would seriously doubt it needs to return on equal too as that could be written. > =20 > - codesz =3D DOSPARTOFF; > table =3D (struct g_part_mbr_table *)basetable; > - bzero(table->mbr, codesz); > - codesz =3D MIN(codesz, gpp->gpp_codesize); > - if (codesz > 0) > - bcopy(gpp->gpp_codeptr, table->mbr, codesz); > + dsn =3D *(uint32_t *)(table->mbr + DOSDSNOFF); > + bcopy(gpp->gpp_codeptr, table->mbr, DOSPARTOFF); > + if (dsn !=3D 0) Shit happens... any case that the product might return less than 0 causing this to still fall through and process... ? ">" ? > + *(uint32_t *)(table->mbr + DOSDSNOFF) =3D dsn; > return (0); > } > =20 >=20 > Modified: stable/8/sys/sys/diskmbr.h > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- stable/8/sys/sys/diskmbr.h Wed Jul 27 01:57:24 2011 (r224463) > +++ stable/8/sys/sys/diskmbr.h Wed Jul 27 04:10:32 2011 (r224464) > @@ -36,6 +36,7 @@ > #include > =20 > #define DOSBBSECTOR 0 /* DOS boot block relative sector number */ > +#define DOSDSNOFF 440 /* WinNT/2K/XP Drive Serial Number offset */ > #define DOSPARTOFF 446 > #define DOSPARTSIZE 16 > #define NDOSPART 4 > _______________________________________________ > svn-src-stable-8@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/svn-src-stable-8 > To unsubscribe, send any mail to "svn-src-stable-8-unsubscribe@freebsd.or= g" --jho1yZJdad60DJr+ Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.17 (FreeBSD) Comment: http://bit.ly/0x89D8547E iQEcBAEBAgAGBQJOMMwHAAoJEJBXh4mJ2FR+mCEH/11OPJqBMX9ueQRnMdHVvcM1 4gCv10qaHzKNaXhBqOzLAmg/kXQOs28kNXkhViBDnRr7NLGF7euFZCd7PyiK10Dy sB1+Ti2p9WEAk9JWBNKI34ttv5yKrOd67Cc3YojUs4Qt7vISYwMJ6PkvINM67YnY MDDFmQ45N7ry03jZQYl2mTW34Qdo1nBp4gT/VQ44M6mJSFECt+0QYXKtoG+DVi5y N0ZoFcg+b4g4zDwTlyCNDnpW0B3aRoCfhvoM87UZ6LBcuFS4xBF4j7jojaFCJsR2 hWnRMpUs+nnk5G8XlTaQ7K7rZlVKfPvi2zVRWU5QY5P4YMINsnBIitUv0ZhSZEM= =NqxT -----END PGP SIGNATURE----- --jho1yZJdad60DJr+-- From owner-svn-src-stable@FreeBSD.ORG Thu Jul 28 02:47:37 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AC2D81065675; Thu, 28 Jul 2011 02:47:37 +0000 (UTC) (envelope-from jhellenthal@gmail.com) Received: from mail-yi0-f54.google.com (mail-yi0-f54.google.com [209.85.218.54]) by mx1.freebsd.org (Postfix) with ESMTP id F11CB8FC0A; Thu, 28 Jul 2011 02:47:36 +0000 (UTC) Received: by yic13 with SMTP id 13so1942913yic.13 for ; Wed, 27 Jul 2011 19:47:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to; bh=0+ESv33P/Dx0OE0rDtj6WorplC+Dc+UbEmwC6GFG40g=; b=Nr5s2qOAGlf84i0yr5W/hl/6hbxbPp3w8LV9qrg0mvkFhpOf/EYGye00ws7/HvotBc O/vMQ7E9Tvu1VKNztzg1pab+FY/gkwsueZ3EIGC5Tm/Y5C6faG7eAXcDzJ1Yp1DWTlpX 2XJHHBoCU3b2ep9w2zWosDfeLsCtQN7WGK4VY= Received: by 10.42.28.194 with SMTP id o2mr434060icc.5.1311819561055; Wed, 27 Jul 2011 19:19:21 -0700 (PDT) Received: from DataIX.net (adsl-99-181-132-76.dsl.klmzmi.sbcglobal.net [99.181.132.76]) by mx.google.com with ESMTPS id v16sm326477ibf.42.2011.07.27.19.19.18 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 27 Jul 2011 19:19:19 -0700 (PDT) Sender: "J. Hellenthal" Received: from DataIX.net (localhost [127.0.0.1]) by DataIX.net (8.14.5/8.14.5) with ESMTP id p6S2JGXu091566 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 27 Jul 2011 22:19:16 -0400 (EDT) (envelope-from jhell@DataIX.net) Received: (from jhell@localhost) by DataIX.net (8.14.5/8.14.5/Submit) id p6S2JFdn091565; Wed, 27 Jul 2011 22:19:15 -0400 (EDT) (envelope-from jhell@DataIX.net) Date: Wed, 27 Jul 2011 22:19:14 -0400 From: Jason Hellenthal To: Glen Barber Message-ID: <20110728021914.GA55550@DataIX.net> References: <201107270156.p6R1uquD035835@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="OgqxwSJOaUobr8KG" Content-Disposition: inline In-Reply-To: <201107270156.p6R1uquD035835@svn.freebsd.org> Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org Subject: Re: svn commit: r224462 - stable/8/usr.sbin/jail X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jul 2011 02:47:37 -0000 --OgqxwSJOaUobr8KG Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jul 27, 2011 at 01:56:52AM +0000, Glen Barber wrote: > Author: gjb (doc committer) > Date: Wed Jul 27 01:56:52 2011 > New Revision: 224462 > URL: http://svn.freebsd.org/changeset/base/224462 >=20 > Log: > MFC 224286: > =20 > Document the potential for jail escape. > =20 > PR: 142341 >=20 > Modified: > stable/8/usr.sbin/jail/jail.8 > Directory Properties: > stable/8/usr.sbin/jail/ (props changed) >=20 > Modified: stable/8/usr.sbin/jail/jail.8 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- stable/8/usr.sbin/jail/jail.8 Tue Jul 26 20:51:58 2011 (r224461) > +++ stable/8/usr.sbin/jail/jail.8 Wed Jul 27 01:56:52 2011 (r224462) > @@ -34,7 +34,7 @@ > .\" > .\" $FreeBSD$ > .\" > -.Dd January 17, 2010 > +.Dd July 23, 2011 > .Dt JAIL 8 > .Os > .Sh NAME > @@ -913,3 +913,10 @@ Currently, the simplest answer is to min > offered on the host, possibly limiting it to services offered from > .Xr inetd 8 > which is easily configurable. > +.Sh NOTES > +Great care should be taken when managing directories visible within the = jail. > +For example, if a jailed process has its current working directory set t= o a > +directory that is moved out of the jail's chroot, then the process may g= ain > +access to the file space outside of the jail. > +It is recommended that directories always be copied, rather than moved, = out > +of a jail. How is either one of these different ? All mv(1) is doing is a cp(1) & rm(1). In either case the filehandle is still broken and a process is not going to just get up and move with it. On the other side though if you copied a pipe or socket or something similiar for example into a jail then it might make whatever is outside available to the jailed environment. Is there something I am misunderstanding about this ? has the way cp(1), rm(1) & mv(1) been changed recently ? or is this wording a little off ? --OgqxwSJOaUobr8KG Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.17 (FreeBSD) Comment: http://bit.ly/0x89D8547E iQEcBAEBAgAGBQJOMMcfAAoJEJBXh4mJ2FR+cJcH/A8lNW6rpTBgk7WgnOHO/grV kXcSIveh+MBkfoxt9F65Mt7RMroIXSpk2pvg9upNVjuMDNTfCkRuNnPK6NgwptDp BSq9bSzeQW08aQRwB0ARaaEyNpXJh0aqV4GkYHel9vBqNd6Jwc1dAtriIJIJQhgC rRRdtOJEJ2f1Xc5x1k0Ikg4vULxbvKlVhe1K92gHRJlf7I67TZstH1UsgsD9u/wh OvSj49Xh0ND0CzB5VY6imqvxLGCyc4a6F5vXdh/5uNfyWnkxXuT7MpFNmosoVCK4 qNHPzZuWHrhyqi4+bF8YjAm8ZfdtMNbaHRiH+u7QVp/xmjVA4G/JnuZtthIOeYY= =pela -----END PGP SIGNATURE----- --OgqxwSJOaUobr8KG-- From owner-svn-src-stable@FreeBSD.ORG Thu Jul 28 03:19:10 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E515A106566B for ; Thu, 28 Jul 2011 03:19:10 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from glenbarber.us (onyx.glenbarber.us [199.48.134.227]) by mx1.freebsd.org (Postfix) with SMTP id 719778FC12 for ; Thu, 28 Jul 2011 03:19:10 +0000 (UTC) Received: (qmail 80690 invoked by uid 0); 27 Jul 2011 22:52:28 -0400 Received: from unknown (HELO schism.local) (gjb@76.124.49.145) by 0 with SMTP; 27 Jul 2011 22:52:28 -0400 Message-ID: <4E30CEEB.107@FreeBSD.org> Date: Wed, 27 Jul 2011 22:52:27 -0400 From: Glen Barber User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:5.0) Gecko/20110624 Thunderbird/5.0 MIME-Version: 1.0 To: Jason Hellenthal References: <201107270156.p6R1uquD035835@svn.freebsd.org> <20110728021914.GA55550@DataIX.net> In-Reply-To: <20110728021914.GA55550@DataIX.net> X-Enigmail-Version: 1.2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Glen Barber , svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org, svn-src-stable@freebsd.org Subject: Re: svn commit: r224462 - stable/8/usr.sbin/jail X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jul 2011 03:19:11 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 On 7/27/11 10:19 PM, Jason Hellenthal wrote: >> +.Sh NOTES +Great care should be taken when managing directories >> visible within the jail. +For example, if a jailed process has its >> current working directory set to a +directory that is moved out of >> the jail's chroot, then the process may gain +access to the file >> space outside of the jail. +It is recommended that directories >> always be copied, rather than moved, out +of a jail. > > How is either one of these different ? > > All mv(1) is doing is a cp(1) & rm(1). In either case the filehandle > is still broken and a process is not going to just get up and move > with it. On the other side though if you copied a pipe or socket or > something similiar for example into a jail then it might make > whatever is outside available to the jailed environment. > > Is there something I am misunderstanding about this ? has the way > cp(1), rm(1) & mv(1) been changed recently ? or is this wording a > little off ? The text in the example is just an example of a situation where it may be possible for a process within a jail(8) to gain filesystem access outside of the jail(8). Regards, - -- Glen Barber | gjb@FreeBSD.org FreeBSD Documentation Project -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (Darwin) iQEcBAEBCAAGBQJOMM7rAAoJEFJPDDeguUajw7gIALesuCIHff5+p/a4v3gCYetF Su1RWFH/4Cc7iETC0sBR8vvJM9tUXuuKgSXCMswqmOQeJgwE5F+Xv4zAqofVyG6x b/C0WkmEe+nShOx1JLpmyvoSXlyh7b9QxV/41Kf/0Z1EoUZSNz1q5X58ZCvelaTr pqwftcCqGp0qHxVphCq8q42Z8hzS0V2SMco7gD/dqzyKjmST0zAhQfOgrT8kAqiH JHSU8ZSjVjQ5GPKi68fVCUBsivp/hyrXviSfFwh+anBembPrzMQNS7oYBtSJCrpf Ksy5SrT+JLNTSSZlhnqIvhwLfk01LR4alryZAlXYyUqO+DDjFX11vFqCW8qPrw8= =iXr5 -----END PGP SIGNATURE----- From owner-svn-src-stable@FreeBSD.ORG Thu Jul 28 03:36:36 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 294EF106575D; Thu, 28 Jul 2011 03:36:36 +0000 (UTC) (envelope-from minimarmot@gmail.com) Received: from mail-yi0-f54.google.com (mail-yi0-f54.google.com [209.85.218.54]) by mx1.freebsd.org (Postfix) with ESMTP id 9CC368FC14; Thu, 28 Jul 2011 03:36:35 +0000 (UTC) Received: by yic13 with SMTP id 13so1962849yic.13 for ; Wed, 27 Jul 2011 20:36:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=OYpEqejJsUTAWqSoI+FO3fyRWBUNqHUxcbNdcooKCi8=; b=a5qibZKtekbwM/Z4NmNWSPJ/QysoK1ghUAffFp2hkO/6a7txk3YKMTa1duDlgeZpKO rZ2l5ADS/+CcXZ4iB+QRdbX9go1Vk1QwYASt3EzfiLBpRkixhjonJkUpF/hCL57+6L7v MGOqJkbe4YC1bjo+Zta5aMA5RCl5s8SC0d9NM= MIME-Version: 1.0 Received: by 10.236.178.101 with SMTP id e65mr588097yhm.325.1311822511504; Wed, 27 Jul 2011 20:08:31 -0700 (PDT) Received: by 10.236.109.147 with HTTP; Wed, 27 Jul 2011 20:08:31 -0700 (PDT) In-Reply-To: <20110728021914.GA55550@DataIX.net> References: <201107270156.p6R1uquD035835@svn.freebsd.org> <20110728021914.GA55550@DataIX.net> Date: Wed, 27 Jul 2011 23:08:31 -0400 Message-ID: From: Ben Kaduk To: Jason Hellenthal Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: Glen Barber , svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org, svn-src-stable@freebsd.org Subject: Re: svn commit: r224462 - stable/8/usr.sbin/jail X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jul 2011 03:36:36 -0000 On Wed, Jul 27, 2011 at 10:19 PM, Jason Hellenthal wrote= : > > > On Wed, Jul 27, 2011 at 01:56:52AM +0000, Glen Barber wrote: >> Author: gjb (doc committer) >> Date: Wed Jul 27 01:56:52 2011 >> New Revision: 224462 >> URL: http://svn.freebsd.org/changeset/base/224462 >> >> Log: >> =A0 MFC 224286: >> >> =A0 Document the potential for jail escape. >> >> =A0 PR: =A0 =A0 =A0 =A0 142341 >> >> Modified: >> =A0 stable/8/usr.sbin/jail/jail.8 >> Directory Properties: >> =A0 stable/8/usr.sbin/jail/ =A0 (props changed) >> >> Modified: stable/8/usr.sbin/jail/jail.8 >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D >> --- stable/8/usr.sbin/jail/jail.8 =A0 =A0 Tue Jul 26 20:51:58 2011 =A0 = =A0 =A0 =A0(r224461) >> +++ stable/8/usr.sbin/jail/jail.8 =A0 =A0 Wed Jul 27 01:56:52 2011 =A0 = =A0 =A0 =A0(r224462) >> @@ -34,7 +34,7 @@ >> =A0.\" >> =A0.\" $FreeBSD$ >> =A0.\" >> -.Dd January 17, 2010 >> +.Dd July 23, 2011 >> =A0.Dt JAIL 8 >> =A0.Os >> =A0.Sh NAME >> @@ -913,3 +913,10 @@ Currently, the simplest answer is to min >> =A0offered on the host, possibly limiting it to services offered from >> =A0.Xr inetd 8 >> =A0which is easily configurable. >> +.Sh NOTES >> +Great care should be taken when managing directories visible within the= jail. >> +For example, if a jailed process has its current working directory set = to a >> +directory that is moved out of the jail's chroot, then the process may = gain >> +access to the file space outside of the jail. >> +It is recommended that directories always be copied, rather than moved,= out >> +of a jail. > > How is either one of these different ? > > All mv(1) is doing is a cp(1) & rm(1). In either case the filehandle is This is not always true when the source and destination live on the same filesystem. See rename(2). Via VOP_RENAME, individual filesystems can override this behavior if needed (e.g. for AFS where permissions are per-directory, so a cross-directory copy would return EXDEV). -Ben Kaduk > still broken and a process is not going to just get up and move with it. > On the other side though if you copied a pipe or socket or something > similiar for example into a jail then it might make whatever is outside > available to the jailed environment. > > Is there something I am misunderstanding about this ? has the way cp(1), > rm(1) & mv(1) been changed recently ? or is this wording a little off ? > From owner-svn-src-stable@FreeBSD.ORG Thu Jul 28 04:52:10 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 508EE1065673; Thu, 28 Jul 2011 04:52:10 +0000 (UTC) (envelope-from jhellenthal@gmail.com) Received: from mail-iy0-f182.google.com (mail-iy0-f182.google.com [209.85.210.182]) by mx1.freebsd.org (Postfix) with ESMTP id CD0678FC0A; Thu, 28 Jul 2011 04:52:09 +0000 (UTC) Received: by iyb11 with SMTP id 11so3352976iyb.13 for ; Wed, 27 Jul 2011 21:52:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to; bh=I01KlNVBr3UfsFZzDygYhxm3H0enAGiHTKyeMFaTS3A=; b=YSdIpvEdM32hwPWB0XuNCgLUGE4OQY1g7ix4J6nHT7RmFgy3SJ/2ow6G48D3qlj7Su EtAzOGqWX+lru8PfFUAo5lNt7UObYoIQw+Ga8joc4ltykSe7OZP1n/mBBd8zFy+eSO1H EicEdYnQLyKpNpscVuP+IHhzAsHcwlnGnVwog= Received: by 10.231.61.134 with SMTP id t6mr437638ibh.15.1311828729137; Wed, 27 Jul 2011 21:52:09 -0700 (PDT) Received: from DataIX.net ([99.181.132.76]) by mx.google.com with ESMTPS id y3sm403142ibc.54.2011.07.27.21.52.06 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 27 Jul 2011 21:52:07 -0700 (PDT) Sender: "J. Hellenthal" Received: from DataIX.net (localhost [127.0.0.1]) by DataIX.net (8.14.5/8.14.5) with ESMTP id p6S4q4cb027952 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 28 Jul 2011 00:52:04 -0400 (EDT) (envelope-from jhell@DataIX.net) Received: (from jhell@localhost) by DataIX.net (8.14.5/8.14.5/Submit) id p6S4q3po027951; Thu, 28 Jul 2011 00:52:03 -0400 (EDT) (envelope-from jhell@DataIX.net) Date: Thu, 28 Jul 2011 00:52:03 -0400 From: Jason Hellenthal To: Ben Kaduk Message-ID: <20110728045202.GC55550@DataIX.net> References: <201107270156.p6R1uquD035835@svn.freebsd.org> <20110728021914.GA55550@DataIX.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="bAmEntskrkuBymla" Content-Disposition: inline In-Reply-To: Cc: Glen Barber , svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org, svn-src-stable@freebsd.org Subject: Re: svn commit: r224462 - stable/8/usr.sbin/jail X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jul 2011 04:52:10 -0000 --bAmEntskrkuBymla Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jul 27, 2011 at 11:08:31PM -0400, Ben Kaduk wrote: > On Wed, Jul 27, 2011 at 10:19 PM, Jason Hellenthal wro= te: > > > > > > On Wed, Jul 27, 2011 at 01:56:52AM +0000, Glen Barber wrote: > >> Author: gjb (doc committer) > >> Date: Wed Jul 27 01:56:52 2011 > >> New Revision: 224462 > >> URL: http://svn.freebsd.org/changeset/base/224462 > >> > >> Log: > >> =A0 MFC 224286: > >> > >> =A0 Document the potential for jail escape. > >> > >> =A0 PR: =A0 =A0 =A0 =A0 142341 > >> > >> Modified: > >> =A0 stable/8/usr.sbin/jail/jail.8 > >> Directory Properties: > >> =A0 stable/8/usr.sbin/jail/ =A0 (props changed) > >> > >> Modified: stable/8/usr.sbin/jail/jail.8 > >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > >> --- stable/8/usr.sbin/jail/jail.8 =A0 =A0 Tue Jul 26 20:51:58 2011 =A0= =A0 =A0 =A0(r224461) > >> +++ stable/8/usr.sbin/jail/jail.8 =A0 =A0 Wed Jul 27 01:56:52 2011 =A0= =A0 =A0 =A0(r224462) > >> @@ -34,7 +34,7 @@ > >> =A0.\" > >> =A0.\" $FreeBSD$ > >> =A0.\" > >> -.Dd January 17, 2010 > >> +.Dd July 23, 2011 > >> =A0.Dt JAIL 8 > >> =A0.Os > >> =A0.Sh NAME > >> @@ -913,3 +913,10 @@ Currently, the simplest answer is to min > >> =A0offered on the host, possibly limiting it to services offered from > >> =A0.Xr inetd 8 > >> =A0which is easily configurable. > >> +.Sh NOTES > >> +Great care should be taken when managing directories visible within t= he jail. > >> +For example, if a jailed process has its current working directory se= t to a > >> +directory that is moved out of the jail's chroot, then the process ma= y gain > >> +access to the file space outside of the jail. > >> +It is recommended that directories always be copied, rather than move= d, out > >> +of a jail. > > > > How is either one of these different ? > > > > All mv(1) is doing is a cp(1) & rm(1). In either case the filehandle is >=20 > This is not always true when the source and destination live on the > same filesystem. See rename(2). > Via VOP_RENAME, individual filesystems can override this behavior if > needed (e.g. for AFS where permissions are per-directory, so a > cross-directory copy would return EXDEV). >=20 Ok so in the least words... be careful of poor administration techniques that is trying to be explained here. The only real example I could think of that relates to the example above would be in the case of a hardlink that rests on the same filesystem. Anyway just a nit-pick it just seems trying to explain these things in example throughout a manual page can lead a user in the direction of thought that everything has been explained or that is all the examples and seems would be better off in a security aware section of a handbook rather than mudding up the manual page. >=20 > > still broken and a process is not going to just get up and move with it. > > On the other side though if you copied a pipe or socket or something > > similiar for example into a jail then it might make whatever is outside > > available to the jailed environment. > > > > Is there something I am misunderstanding about this ? has the way cp(1), > > rm(1) & mv(1) been changed recently ? or is this wording a little off ? > > --bAmEntskrkuBymla Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.17 (FreeBSD) Comment: http://bit.ly/0x89D8547E iQEcBAEBAgAGBQJOMOryAAoJEJBXh4mJ2FR+Ym8H/jfJr9lBDFdRHxzovyWZvFV8 9xa0jPyAYwkGXPFBeX8H8pk3wj3zNAbIu1IUOv6xJ14LZz7afKPXpP5OFn7cBNHk OIIrSi3wOmmE1H367VBTISFxCvlGzyWegzJkGLGyJDIrCfT7wrDBgcuzXbPXz41I FTGTiJeA0WSRGvZbMRT/8mlt4UIA3MHcfbnYs1R1HmK1N1wd4+XIVpy+7cQFdKM7 1P02xrh0LoNESBZB3WYaINrU7ImcyOjkw04u0CvRq9/Q+3EVnhQhE5by/aBazuFY otU8LDJM9f2LMf76h8/dmvC69QjFzrY5al/O0Af+WEv2gWuxj4B1+7SvHakY2nM= =bTVA -----END PGP SIGNATURE----- --bAmEntskrkuBymla-- From owner-svn-src-stable@FreeBSD.ORG Thu Jul 28 04:56:36 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2C2B31065674 for ; Thu, 28 Jul 2011 04:56:36 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from glenbarber.us (onyx.glenbarber.us [199.48.134.227]) by mx1.freebsd.org (Postfix) with SMTP id E0D678FC15 for ; Thu, 28 Jul 2011 04:56:35 +0000 (UTC) Received: (qmail 82552 invoked by uid 0); 28 Jul 2011 00:56:35 -0400 Received: from unknown (HELO schism.local) (gjb@76.124.49.145) by 0 with SMTP; 28 Jul 2011 00:56:35 -0400 Message-ID: <4E30EBFA.5030505@FreeBSD.org> Date: Thu, 28 Jul 2011 00:56:26 -0400 From: Glen Barber User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:5.0) Gecko/20110624 Thunderbird/5.0 MIME-Version: 1.0 To: Jason Hellenthal References: <201107270156.p6R1uquD035835@svn.freebsd.org> <20110728021914.GA55550@DataIX.net> <20110728045202.GC55550@DataIX.net> In-Reply-To: <20110728045202.GC55550@DataIX.net> X-Enigmail-Version: 1.2 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------enig9DCD5FDE87F27B0C5E36E47F" Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org, Ben Kaduk Subject: Re: svn commit: r224462 - stable/8/usr.sbin/jail X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jul 2011 04:56:36 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig9DCD5FDE87F27B0C5E36E47F Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 7/28/11 12:52 AM, Jason Hellenthal wrote: >> This is not always true when the source and destination live on the >> same filesystem. See rename(2). >> Via VOP_RENAME, individual filesystems can override this behavior if >> needed (e.g. for AFS where permissions are per-directory, so a >> cross-directory copy would return EXDEV). >> >=20 > Ok so in the least words... be careful of poor administration > techniques that is trying to be explained here. The only real example I= > could think of that relates to the example above would be in the case o= f > a hardlink that rests on the same filesystem. >=20 > Anyway just a nit-pick it just seems trying to explain these things in > example throughout a manual page can lead a user in the direction of > thought that everything has been explained or that is all the examples > and seems would be better off in a security aware section of a handbook= > rather than mudding up the manual page. >=20 Hi, Feel free to submit patches to the original PR if you feel the explanation that has been committed is sub-par to what you expect. --=20 Glen Barber | gjb@FreeBSD.org FreeBSD Documentation Project --------------enig9DCD5FDE87F27B0C5E36E47F Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (Darwin) iQEcBAEBCAAGBQJOMOwBAAoJEFJPDDeguUajJFsH/iaOZglk5kZsMKkUZDKPMbcA 7aT+rLzeHxtRsboGKBcEqOBvUWfd2AXem9oQ0np/WgDn17zxzfvR9abg5Cn/hFe+ gL3kmbcnGz9KMxeWYhyBTyXy3gByzKVYIzeLio4dsJ1kQK4QB/G0aTouyVOIxiB+ LTmGTg1fSkxodhKZD0uDzXuwhEN7+nbcdf2y1DKRl4j8e+hqz3FtGb9N4m8TelJR kza/FCkMnBupgZTGknSgAUnmDt3JRhSbplKVQ98Z0KrPfFPJjmoedajFj5JMJrLn Z6aX+dAiuRbAP1YB4rd0JZIaiysGAuaV4MtrJTe6tngMZonPduydB3m413u2TmM= =dqQQ -----END PGP SIGNATURE----- --------------enig9DCD5FDE87F27B0C5E36E47F-- From owner-svn-src-stable@FreeBSD.ORG Thu Jul 28 09:37:03 2011 Return-Path: Delivered-To: svn-src-stable@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8835F1065672; Thu, 28 Jul 2011 09:37:03 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 50A288FC1D; Thu, 28 Jul 2011 09:37:01 +0000 (UTC) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id MAA19274; Thu, 28 Jul 2011 12:24:43 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1QmMpe-0000nv-Ut; Thu, 28 Jul 2011 12:24:42 +0300 Message-ID: <4E312AD9.3020703@FreeBSD.org> Date: Thu, 28 Jul 2011 12:24:41 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:5.0) Gecko/20110706 Thunderbird/5.0 MIME-Version: 1.0 To: Jason Hellenthal References: <201107270410.p6R4AXc3040342@svn.freebsd.org> <20110728024007.GB55550@DataIX.net> In-Reply-To: <20110728024007.GB55550@DataIX.net> X-Enigmail-Version: 1.2pre Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: "Andrey V. Elsukov" , svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, svn-src-stable-8@FreeBSD.org, svn-src-stable@FreeBSD.org Subject: Re: svn commit: r224464 - in stable/8/sys: geom/part sys X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jul 2011 09:37:03 -0000 on 28/07/2011 05:40 Jason Hellenthal said the following: > > > On Wed, Jul 27, 2011 at 04:10:33AM +0000, Andrey V. Elsukov wrote: >> Author: ae Date: Wed Jul 27 04:10:32 2011 New Revision: 224464 URL: >> http://svn.freebsd.org/changeset/base/224464 >> >> Log: MFC r223587: MS Windows NT+ uses 4 bytes at offset 0x1b8 in the MBR to >> identify disk drive. The boot0cfg(8) utility preserves these 4 bytes when >> it is writing bootcode to keep a multiboot ability. Change gpart's bootcode >> method to keep DSN if it is not zero. Also do not allow writing bootcode >> with size not equal to MBRSIZE. >> >> PR: kern/157819 >> >> Modified: stable/8/sys/geom/part/g_part_mbr.c stable/8/sys/sys/diskmbr.h >> Directory Properties: stable/8/sys/ (props changed) >> stable/8/sys/amd64/include/xen/ (props changed) >> stable/8/sys/cddl/contrib/opensolaris/ (props changed) >> stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ >> (props changed) stable/8/sys/geom/label/ (props changed) >> >> Modified: stable/8/sys/geom/part/g_part_mbr.c >> ============================================================================== >> >> --- stable/8/sys/geom/part/g_part_mbr.c Wed Jul 27 01:57:24 2011 (r224463) >> +++ stable/8/sys/geom/part/g_part_mbr.c Wed Jul 27 04:10:32 2011 (r224464) >> @@ -234,14 +234,16 @@ static int g_part_mbr_bootcode(struct g_part_table >> *basetable, struct g_part_parms *gpp) { struct g_part_mbr_table *table; - >> size_t codesz; + uint32_t dsn; + + if (gpp->gpp_codesize != MBRSIZE) + >> return (ENODEV); > > Is it known for an absolute fact that the size being written is always going > to be the size of MBRSIZE ? never less ? wouldnt ">=" greater-than or equal > make sense here ? though I would seriously doubt it needs to return on equal > too as that could be written. > >> >> - codesz = DOSPARTOFF; table = (struct g_part_mbr_table *)basetable; - >> bzero(table->mbr, codesz); - codesz = MIN(codesz, gpp->gpp_codesize); - if >> (codesz > 0) - bcopy(gpp->gpp_codeptr, table->mbr, codesz); + dsn = >> *(uint32_t *)(table->mbr + DOSDSNOFF); + bcopy(gpp->gpp_codeptr, >> table->mbr, DOSPARTOFF); + if (dsn != 0) > > Shit happens... any case that the product might return less than 0 causing > this to still fall through and process... ? ">" ? Not with unsigned types :-) >> + *(uint32_t *)(table->mbr + DOSDSNOFF) = dsn; return (0); } >> >> >> Modified: stable/8/sys/sys/diskmbr.h >> ============================================================================== >> >> --- stable/8/sys/sys/diskmbr.h Wed Jul 27 01:57:24 2011 (r224463) >> +++ stable/8/sys/sys/diskmbr.h Wed Jul 27 04:10:32 2011 (r224464) @@ -36,6 >> +36,7 @@ #include >> >> #define DOSBBSECTOR 0 /* DOS boot block relative sector number */ +#define >> DOSDSNOFF 440 /* WinNT/2K/XP Drive Serial Number offset */ #define >> DOSPARTOFF 446 #define DOSPARTSIZE 16 #define NDOSPART 4 -- Andriy Gapon From owner-svn-src-stable@FreeBSD.ORG Thu Jul 28 09:40:20 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A6B5A106564A; Thu, 28 Jul 2011 09:40:20 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 8173E8FC16; Thu, 28 Jul 2011 09:40:20 +0000 (UTC) Received: from fledge.watson.org (fledge.watson.org [65.122.17.41]) by cyrus.watson.org (Postfix) with ESMTPS id F151E46B2A; Thu, 28 Jul 2011 05:40:19 -0400 (EDT) Date: Thu, 28 Jul 2011 10:40:19 +0100 (BST) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Glen Barber In-Reply-To: <4E30CEEB.107@FreeBSD.org> Message-ID: References: <201107270156.p6R1uquD035835@svn.freebsd.org> <20110728021914.GA55550@DataIX.net> <4E30CEEB.107@FreeBSD.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: Jason Hellenthal , svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org, svn-src-stable@freebsd.org Subject: Re: svn commit: r224462 - stable/8/usr.sbin/jail X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jul 2011 09:40:20 -0000 On Wed, 27 Jul 2011, Glen Barber wrote: >> How is either one of these different ? >> >> All mv(1) is doing is a cp(1) & rm(1). In either case the filehandle is >> still broken and a process is not going to just get up and move with it. On >> the other side though if you copied a pipe or socket or something similiar >> for example into a jail then it might make whatever is outside available to >> the jailed environment. >> >> Is there something I am misunderstanding about this ? has the way cp(1), >> rm(1) & mv(1) been changed recently ? or is this wording a little off ? > > The text in the example is just an example of a situation where it may be > possible for a process within a jail(8) to gain filesystem access outside of > the jail(8). I wonder, if on these grounds, we should actually advise administrators that it is a more robust configuration, both in terms of managing free space and avoiding potential escape paths, to put each jail in its own file system. Lots of people do this anyway, and as recommendations go, it's not a bad one. We can then caution that if you *don't* do this, then you need to be careful about the mv issue. Robert From owner-svn-src-stable@FreeBSD.ORG Thu Jul 28 09:56:56 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8B05E1065675; Thu, 28 Jul 2011 09:56:56 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mail.kirov.so-cdu.ru (ns.kirov.so-ups.ru [178.74.170.1]) by mx1.freebsd.org (Postfix) with ESMTP id 320088FC17; Thu, 28 Jul 2011 09:56:55 +0000 (UTC) Received: from kas30pipe.localhost (localhost.kirov.so-cdu.ru [127.0.0.1]) by mail.kirov.so-cdu.ru (Postfix) with SMTP id 1F97FB801F; Thu, 28 Jul 2011 13:38:03 +0400 (MSD) Received: from kirov.so-cdu.ru (unknown [172.21.81.1]) by mail.kirov.so-cdu.ru (Postfix) with ESMTP id 19BA7B801B; Thu, 28 Jul 2011 13:38:03 +0400 (MSD) Received: by ns.kirov.so-cdu.ru (Postfix, from userid 1010) id 14308B8400; Thu, 28 Jul 2011 13:38:03 +0400 (MSD) Received: from [10.118.3.52] (elsukov.kirov.oduur.so [10.118.3.52]) by ns.kirov.so-cdu.ru (Postfix) with ESMTP id D29D8B83FD; Thu, 28 Jul 2011 13:38:02 +0400 (MSD) Message-ID: <4E312DF5.2050306@FreeBSD.org> Date: Thu, 28 Jul 2011 13:37:57 +0400 From: "Andrey V. Elsukov" User-Agent: Mozilla Thunderbird 1.5 (FreeBSD/20051231) MIME-Version: 1.0 To: Jason Hellenthal References: <201107270410.p6R4AXc3040342@svn.freebsd.org> <20110728024007.GB55550@DataIX.net> In-Reply-To: <20110728024007.GB55550@DataIX.net> X-Enigmail-Version: 1.1.1 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enigC86E7A483DB4FA181B6735A7" X-SpamTest-Version: SMTP-Filter Version 3.0.0 [0284], KAS30/Release X-SpamTest-Info: Not protected Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org Subject: Re: svn commit: r224464 - in stable/8/sys: geom/part sys X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jul 2011 09:56:56 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigC86E7A483DB4FA181B6735A7 Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: quoted-printable On 28.07.2011 6:40, Jason Hellenthal wrote: >> + uint32_t dsn; >> + >> + if (gpp->gpp_codesize !=3D MBRSIZE) >> + return (ENODEV); >=20 > Is it known for an absolute fact that the size being written is always > going to be the size of MBRSIZE ? never less ? wouldnt ">=3D" greater-t= han > or equal make sense here ? though I would seriously doubt it needs to > return on equal too as that could be written. Yes. Now the size of bootcode must be equal to MBRSIZE. We do not have any of bootcode images with size different than MBRSIZE. If you want to write bootcode with size less than MBRSIZE, then just fill up your image with zeroes to MBRSIZE. >> - codesz =3D DOSPARTOFF; >> table =3D (struct g_part_mbr_table *)basetable; >> - bzero(table->mbr, codesz); >> - codesz =3D MIN(codesz, gpp->gpp_codesize); >> - if (codesz > 0) >> - bcopy(gpp->gpp_codeptr, table->mbr, codesz); >> + dsn =3D *(uint32_t *)(table->mbr + DOSDSNOFF); >> + bcopy(gpp->gpp_codeptr, table->mbr, DOSPARTOFF); >> + if (dsn !=3D 0) >=20 > Shit happens... any case that the product might return less than 0 > causing this to still fall through and process... ? ">" ? Variable with type uint32_t could not be less than zero. This code only restores old DSN if it is not zero. In any other cases you can use boot0c= fg(8) to set or change it. --=20 WBR, Andrey V. Elsukov --------------enigC86E7A483DB4FA181B6735A7 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (MingW32) iQEcBAEBAgAGBQJOMS36AAoJEAHF6gQQyKF6OIcIAK4l/muhv/PMUMqhnQHVSAFj afLFgFAgul4ENbVD9k7o9WZoJy2Dk0285jKxang8m+O//7iATdCt9fHSle9VRh+e LuhH+kk541Lq6TXae/EtyBR1+tcSUXOUapioioRxjst+bgFqmh4uskGnTGyJL+vl TIhH3FhsPca+FTadlDI4cGGXOKmym6hiyi3pV/V1eZHbMkWUhCY7sNtmg718qlum y4LHUajOjC6+KF1Lomu2x5iHmkW7MUAlFGnp1BdSobEcVM5fQn7C8zodM3ar98cX bmvZNWV86hMWdyDJJM0C/SiQUkj94/C8TaTEcw37JvLl10UQHmPi4HVzXyhRc5M= =gDKy -----END PGP SIGNATURE----- --------------enigC86E7A483DB4FA181B6735A7-- From owner-svn-src-stable@FreeBSD.ORG Thu Jul 28 10:10:40 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 437F3106564A; Thu, 28 Jul 2011 10:10:40 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 321B18FC1A; Thu, 28 Jul 2011 10:10:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6SAAejO095605; Thu, 28 Jul 2011 10:10:40 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6SAAdV2095597; Thu, 28 Jul 2011 10:10:39 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201107281010.p6SAAdV2095597@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Thu, 28 Jul 2011 10:10:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224473 - in stable/8: sbin/ipfw sys/netinet/ipfw sys/netinet/libalias X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jul 2011 10:10:40 -0000 Author: ae Date: Thu Jul 28 10:10:39 2011 New Revision: 224473 URL: http://svn.freebsd.org/changeset/base/224473 Log: MFC r223080: Implement "global" mode for ipfw nat. It is similar to natd(8) "globalport" option for multiple NAT instances. If ipfw rule contains "global" keyword instead of nat_number, then for each outgoing packet ipfw_nat looks up translation state in all configured nat instances. If an entry is found, packet aliased according to that entry, otherwise packet is passed unchanged. User can specify "skip_global" option in NAT configuration to exclude an instance from the lookup in global mode. PR: kern/157867 Submitted by: Alexander V. Chernikov (previous version) Modified: stable/8/sbin/ipfw/ipfw.8 stable/8/sbin/ipfw/ipfw2.c stable/8/sbin/ipfw/ipfw2.h stable/8/sbin/ipfw/nat.c stable/8/sys/netinet/ipfw/ip_fw2.c stable/8/sys/netinet/ipfw/ip_fw_nat.c stable/8/sys/netinet/libalias/alias.h Directory Properties: stable/8/sbin/ipfw/ (props changed) stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/geom/label/ (props changed) Modified: stable/8/sbin/ipfw/ipfw.8 ============================================================================== --- stable/8/sbin/ipfw/ipfw.8 Thu Jul 28 09:27:01 2011 (r224472) +++ stable/8/sbin/ipfw/ipfw.8 Thu Jul 28 10:10:39 2011 (r224473) @@ -1,7 +1,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 30, 2011 +.Dd June 14, 2011 .Dt IPFW 8 .Os .Sh NAME @@ -2422,6 +2422,27 @@ Reset table of the packet aliasing engin Reverse the way libalias handles aliasing. .It Cm proxy_only Obey transparent proxy rules only, packet aliasing is not performed. +.It Cm skip_global +Skip instance in case of global state lookup (see below). +.El +.Pp +Some specials value can be supplied instead of +.Va nat_number: +.Bl -tag -width indent +.It Cm global +Looks up translation state in all configured nat instances. +If an entry is found, packet is aliased according to that entry. +If no entry was found in any of the instances, packet is passed unchanged, +and no new entry will be created. +See section +.Sx MULTIPLE INSTANCES +in +.Xr natd 8 +for more information. +.It Cm tablearg +Uses argument supplied in lookup table. See +.Sx LOOKUP TABLES +section below for more information on lookup tables. .El .Pp To let the packet continue after being (de)aliased, set the sysctl variable Modified: stable/8/sbin/ipfw/ipfw2.c ============================================================================== --- stable/8/sbin/ipfw/ipfw2.c Thu Jul 28 09:27:01 2011 (r224472) +++ stable/8/sbin/ipfw/ipfw2.c Thu Jul 28 10:10:39 2011 (r224473) @@ -1112,8 +1112,11 @@ show_ipfw(struct ip_fw *rule, int pcwidt break; case O_NAT: - PRINT_UINT_ARG("nat ", cmd->arg1); - break; + if (cmd->arg1 != 0) + PRINT_UINT_ARG("nat ", cmd->arg1); + else + printf("nat global"); + break; case O_SETFIB: PRINT_UINT_ARG("setfib ", cmd->arg1); @@ -2728,9 +2731,14 @@ ipfw_add(char *av[]) break; case TOK_NAT: - action->opcode = O_NAT; - action->len = F_INSN_SIZE(ipfw_insn_nat); - goto chkarg; + action->opcode = O_NAT; + action->len = F_INSN_SIZE(ipfw_insn_nat); + if (_substrcmp(*av, "global") == 0) { + action->arg1 = 0; + av++; + break; + } else + goto chkarg; case TOK_QUEUE: action->opcode = O_QUEUE; Modified: stable/8/sbin/ipfw/ipfw2.h ============================================================================== --- stable/8/sbin/ipfw/ipfw2.h Thu Jul 28 09:27:01 2011 (r224472) +++ stable/8/sbin/ipfw/ipfw2.h Thu Jul 28 10:10:39 2011 (r224473) @@ -178,6 +178,7 @@ enum tokens { TOK_DENY_INC, TOK_SAME_PORTS, TOK_UNREG_ONLY, + TOK_SKIP_GLOBAL, TOK_RESET_ADDR, TOK_ALIAS_REV, TOK_PROXY_ONLY, Modified: stable/8/sbin/ipfw/nat.c ============================================================================== --- stable/8/sbin/ipfw/nat.c Thu Jul 28 09:27:01 2011 (r224472) +++ stable/8/sbin/ipfw/nat.c Thu Jul 28 10:10:39 2011 (r224473) @@ -53,6 +53,7 @@ static struct _s_x nat_params[] = { { "deny_in", TOK_DENY_INC }, { "same_ports", TOK_SAME_PORTS }, { "unreg_only", TOK_UNREG_ONLY }, + { "skip_global", TOK_SKIP_GLOBAL }, { "reset", TOK_RESET_ADDR }, { "reverse", TOK_ALIAS_REV }, { "proxy_only", TOK_PROXY_ONLY }, @@ -638,6 +639,9 @@ print_nat_config(unsigned char *buf) } else if (n->mode & PKT_ALIAS_SAME_PORTS) { printf(" same_ports"); n->mode &= ~PKT_ALIAS_SAME_PORTS; + } else if (n->mode & PKT_ALIAS_SKIP_GLOBAL) { + printf(" skip_global"); + n->mode &= ~PKT_ALIAS_SKIP_GLOBAL; } else if (n->mode & PKT_ALIAS_UNREGISTERED_ONLY) { printf(" unreg_only"); n->mode &= ~PKT_ALIAS_UNREGISTERED_ONLY; @@ -760,10 +764,11 @@ ipfw_config_nat(int ac, char **av) case TOK_IF: ac1--; av1++; - break; + break; case TOK_ALOG: case TOK_DENY_INC: case TOK_SAME_PORTS: + case TOK_SKIP_GLOBAL: case TOK_UNREG_ONLY: case TOK_RESET_ADDR: case TOK_ALIAS_REV: @@ -856,6 +861,9 @@ ipfw_config_nat(int ac, char **av) case TOK_UNREG_ONLY: n->mode |= PKT_ALIAS_UNREGISTERED_ONLY; break; + case TOK_SKIP_GLOBAL: + n->mode |= PKT_ALIAS_SKIP_GLOBAL; + break; case TOK_RESET_ADDR: n->mode |= PKT_ALIAS_RESET_ON_ADDR_CHANGE; break; Modified: stable/8/sys/netinet/ipfw/ip_fw2.c ============================================================================== --- stable/8/sys/netinet/ipfw/ip_fw2.c Thu Jul 28 09:27:01 2011 (r224472) +++ stable/8/sys/netinet/ipfw/ip_fw2.c Thu Jul 28 10:10:39 2011 (r224473) @@ -2128,6 +2128,13 @@ do { \ int nat_id; set_match(args, f_pos, chain); + /* Check if this is 'global' nat rule */ + if (cmd->arg1 == 0) { + retval = ipfw_nat_ptr(args, NULL, m); + l = 0; + done = 1; + break; + } t = ((ipfw_insn_nat *)cmd)->nat; if (t == NULL) { nat_id = (cmd->arg1 == IP_FW_TABLEARG) ? Modified: stable/8/sys/netinet/ipfw/ip_fw_nat.c ============================================================================== --- stable/8/sys/netinet/ipfw/ip_fw_nat.c Thu Jul 28 09:27:01 2011 (r224472) +++ stable/8/sys/netinet/ipfw/ip_fw_nat.c Thu Jul 28 10:10:39 2011 (r224473) @@ -207,7 +207,8 @@ ipfw_nat(struct ip_fw_args *args, struct struct mbuf *mcl; struct ip *ip; /* XXX - libalias duct tape */ - int ldt, retval; + int ldt, retval, found; + struct ip_fw_chain *chain; char *c; ldt = 0; @@ -256,12 +257,44 @@ ipfw_nat(struct ip_fw_args *args, struct ldt = 1; c = mtod(mcl, char *); - if (args->oif == NULL) - retval = LibAliasIn(t->lib, c, - mcl->m_len + M_TRAILINGSPACE(mcl)); - else - retval = LibAliasOut(t->lib, c, - mcl->m_len + M_TRAILINGSPACE(mcl)); + + /* Check if this is 'global' instance */ + if (t == NULL) { + if (args->oif == NULL) { + /* Wrong direction, skip processing */ + args->m = mcl; + return (IP_FW_NAT); + } + + found = 0; + chain = &V_layer3_chain; + IPFW_RLOCK(chain); + /* Check every nat entry... */ + LIST_FOREACH(t, &chain->nat, _next) { + if ((t->mode & PKT_ALIAS_SKIP_GLOBAL) != 0) + continue; + retval = LibAliasOutTry(t->lib, c, + mcl->m_len + M_TRAILINGSPACE(mcl), 0); + if (retval == PKT_ALIAS_OK) { + /* Nat instance recognises state */ + found = 1; + break; + } + } + IPFW_RUNLOCK(chain); + if (found != 1) { + /* No instance found, return ignore */ + args->m = mcl; + return (IP_FW_NAT); + } + } else { + if (args->oif == NULL) + retval = LibAliasIn(t->lib, c, + mcl->m_len + M_TRAILINGSPACE(mcl)); + else + retval = LibAliasOut(t->lib, c, + mcl->m_len + M_TRAILINGSPACE(mcl)); + } /* * We drop packet when: @@ -274,7 +307,7 @@ ipfw_nat(struct ip_fw_args *args, struct if (retval == PKT_ALIAS_ERROR || (args->oif == NULL && (retval == PKT_ALIAS_UNRESOLVED_FRAGMENT || (retval == PKT_ALIAS_IGNORED && - (t->lib->packetAliasMode & PKT_ALIAS_DENY_INCOMING) != 0)))) { + (t->mode & PKT_ALIAS_DENY_INCOMING) != 0)))) { /* XXX - should i add some logging? */ m_free(mcl); args->m = NULL; Modified: stable/8/sys/netinet/libalias/alias.h ============================================================================== --- stable/8/sys/netinet/libalias/alias.h Thu Jul 28 09:27:01 2011 (r224472) +++ stable/8/sys/netinet/libalias/alias.h Thu Jul 28 10:10:39 2011 (r224473) @@ -220,6 +220,12 @@ struct mbuf *m_megapullup(struct mbuf */ #define PKT_ALIAS_REVERSE 0x80 +/* + * If PKT_ALIAS_SKIP_GLOBAL is set, nat instance is not checked for matching + * states in 'ipfw nat global' rule. + */ +#define PKT_ALIAS_SKIP_GLOBAL 0x200 + /* Function return codes. */ #define PKT_ALIAS_ERROR -1 #define PKT_ALIAS_OK 1 From owner-svn-src-stable@FreeBSD.ORG Thu Jul 28 10:16:31 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 68ABB106564A; Thu, 28 Jul 2011 10:16:31 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1F5F88FC0C; Thu, 28 Jul 2011 10:16:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6SAGVIU095838; Thu, 28 Jul 2011 10:16:31 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6SAGUN3095833; Thu, 28 Jul 2011 10:16:30 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201107281016.p6SAGUN3095833@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Thu, 28 Jul 2011 10:16:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224474 - stable/8/sys/netinet/libalias X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jul 2011 10:16:31 -0000 Author: ae Date: Thu Jul 28 10:16:30 2011 New Revision: 224474 URL: http://svn.freebsd.org/changeset/base/224474 Log: MFC r223437: Export AddLink() function from libalias. It can be used when custom alias address needs to be specified. Add inbound handler to the alias_ftp module. It helps handle active FTP transfer mode for the case with external clients and FTP server behind NAT. Fix passive FTP transfer case for server behind NAT using redirect with external IP address different from NAT ip address. PR: kern/157957 Submitted by: Alexander V. Chernikov Modified: stable/8/sys/netinet/libalias/alias_db.c stable/8/sys/netinet/libalias/alias_ftp.c stable/8/sys/netinet/libalias/alias_local.h stable/8/sys/netinet/libalias/libalias.3 Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/geom/label/ (props changed) Modified: stable/8/sys/netinet/libalias/alias_db.c ============================================================================== --- stable/8/sys/netinet/libalias/alias_db.c Thu Jul 28 10:10:39 2011 (r224473) +++ stable/8/sys/netinet/libalias/alias_db.c Thu Jul 28 10:16:30 2011 (r224474) @@ -552,10 +552,6 @@ static void IncrementalCleanup(struct li static void DeleteLink(struct alias_link *); static struct alias_link * -AddLink(struct libalias *, struct in_addr, struct in_addr, struct in_addr, - u_short, u_short, int, int); - -static struct alias_link * ReLink(struct alias_link *, struct in_addr, struct in_addr, struct in_addr, u_short, u_short, int, int); @@ -572,9 +568,6 @@ static struct alias_link * #define ALIAS_PORT_MASK_EVEN 0x07ffe #define GET_NEW_PORT_MAX_ATTEMPTS 20 -#define GET_ALIAS_PORT -1 -#define GET_ALIAS_ID GET_ALIAS_PORT - #define FIND_EVEN_ALIAS_BASE 1 /* GetNewPort() allocates port numbers. Note that if a port number @@ -937,17 +930,12 @@ DeleteLink(struct alias_link *lnk) } -static struct alias_link * -AddLink(struct libalias *la, struct in_addr src_addr, - struct in_addr dst_addr, - struct in_addr alias_addr, - u_short src_port, - u_short dst_port, - int alias_port_param, /* if less than zero, alias */ - int link_type) -{ /* port will be automatically *//* chosen. - * If greater than */ - u_int start_point; /* zero, equal to alias port */ +struct alias_link * +AddLink(struct libalias *la, struct in_addr src_addr, struct in_addr dst_addr, + struct in_addr alias_addr, u_short src_port, u_short dst_port, + int alias_port_param, int link_type) +{ + u_int start_point; struct alias_link *lnk; LIBALIAS_LOCK_ASSERT(la); Modified: stable/8/sys/netinet/libalias/alias_ftp.c ============================================================================== --- stable/8/sys/netinet/libalias/alias_ftp.c Thu Jul 28 10:10:39 2011 (r224473) +++ stable/8/sys/netinet/libalias/alias_ftp.c Thu Jul 28 10:16:30 2011 (r224474) @@ -100,38 +100,68 @@ __FBSDID("$FreeBSD$"); #define FTP_CONTROL_PORT_NUMBER 21 static void -AliasHandleFtpOut(struct libalias *, struct ip *, struct alias_link *, - int maxpacketsize); +AliasHandleFtpOut(struct libalias *, struct ip *, struct alias_link *, + int maxpacketsize); +static void +AliasHandleFtpIn(struct libalias *, struct ip *, struct alias_link *); -static int -fingerprint(struct libalias *la, struct alias_data *ah) +static int +fingerprint_out(struct libalias *la, struct alias_data *ah) { - if (ah->dport == NULL || ah->sport == NULL || ah->lnk == NULL || - ah->maxpktsize == 0) + if (ah->dport == NULL || ah->sport == NULL || ah->lnk == NULL || + ah->maxpktsize == 0) return (-1); - if (ntohs(*ah->dport) == FTP_CONTROL_PORT_NUMBER - || ntohs(*ah->sport) == FTP_CONTROL_PORT_NUMBER) + if (ntohs(*ah->dport) == FTP_CONTROL_PORT_NUMBER || + ntohs(*ah->sport) == FTP_CONTROL_PORT_NUMBER) return (0); return (-1); } -static int -protohandler(struct libalias *la, struct ip *pip, struct alias_data *ah) +static int +fingerprint_in(struct libalias *la, struct alias_data *ah) +{ + + if (ah->dport == NULL || ah->sport == NULL || ah->lnk == NULL) + return (-1); + if (ntohs(*ah->dport) == FTP_CONTROL_PORT_NUMBER || + ntohs(*ah->sport) == FTP_CONTROL_PORT_NUMBER) + return (0); + return (-1); +} + +static int +protohandler_out(struct libalias *la, struct ip *pip, struct alias_data *ah) { - + AliasHandleFtpOut(la, pip, ah->lnk, ah->maxpktsize); return (0); } + +static int +protohandler_in(struct libalias *la, struct ip *pip, struct alias_data *ah) +{ + + AliasHandleFtpIn(la, pip, ah->lnk); + return (0); +} + struct proto_handler handlers[] = { - { - .pri = 80, - .dir = OUT, - .proto = TCP, - .fingerprint = &fingerprint, - .protohandler = &protohandler - }, + { + .pri = 80, + .dir = OUT, + .proto = TCP, + .fingerprint = &fingerprint_out, + .protohandler = &protohandler_out + }, + { + .pri = 80, + .dir = IN, + .proto = TCP, + .fingerprint = &fingerprint_in, + .protohandler = &protohandler_in + }, { EOH } }; @@ -256,6 +286,57 @@ AliasHandleFtpOut( } } +static void +AliasHandleFtpIn(struct libalias *la, + struct ip *pip, /* IP packet to examine/patch */ + struct alias_link *lnk) /* The link to go through (aliased port) */ +{ + int hlen, tlen, dlen, pflags; + char *sptr; + struct tcphdr *tc; + + /* Calculate data length of TCP packet */ + tc = (struct tcphdr *)ip_next(pip); + hlen = (pip->ip_hl + tc->th_off) << 2; + tlen = ntohs(pip->ip_len); + dlen = tlen - hlen; + + /* Place string pointer and beginning of data */ + sptr = (char *)pip; + sptr += hlen; + + /* + * Check that data length is not too long and previous message was + * properly terminated with CRLF. + */ + pflags = GetProtocolFlags(lnk); + if (dlen <= MAX_MESSAGE_SIZE && (pflags & WAIT_CRLF) == 0 && + ntohs(tc->th_dport) == FTP_CONTROL_PORT_NUMBER && + (ParseFtpPortCommand(la, sptr, dlen) != 0 || + ParseFtpEprtCommand(la, sptr, dlen) != 0)) { + /* + * Alias active mode client requesting data from server + * behind NAT. We need to alias server->client connection + * to external address client is connecting to. + */ + AddLink(la, GetOriginalAddress(lnk), la->true_addr, + GetAliasAddress(lnk), htons(FTP_CONTROL_PORT_NUMBER - 1), + htons(la->true_port), GET_ALIAS_PORT, IPPROTO_TCP); + } + /* Track the msgs which are CRLF term'd for PORT/PASV FW breach */ + if (dlen) { + sptr = (char *)pip; /* start over at beginning */ + tlen = ntohs(pip->ip_len); /* recalc tlen, pkt may + * have grown. + */ + if (sptr[tlen - 2] == '\r' && sptr[tlen - 1] == '\n') + pflags &= ~WAIT_CRLF; + else + pflags |= WAIT_CRLF; + SetProtocolFlags(lnk, pflags); + } +} + static int ParseFtpPortCommand(struct libalias *la, char *sptr, int dlen) { @@ -576,9 +657,10 @@ NewFtpMessage(struct libalias *la, struc if (la->true_port < IPPORT_RESERVED) return; -/* Establish link to address and port found in FTP control message. */ - ftp_lnk = FindUdpTcpOut(la, la->true_addr, GetDestAddress(lnk), - htons(la->true_port), 0, IPPROTO_TCP, 1); + /* Establish link to address and port found in FTP control message. */ + ftp_lnk = AddLink(la, la->true_addr, GetDestAddress(lnk), + GetAliasAddress(lnk), htons(la->true_port), 0, GET_ALIAS_PORT, + IPPROTO_TCP); if (ftp_lnk != NULL) { int slen, hlen, tlen, dlen; Modified: stable/8/sys/netinet/libalias/alias_local.h ============================================================================== --- stable/8/sys/netinet/libalias/alias_local.h Thu Jul 28 10:10:39 2011 (r224473) +++ stable/8/sys/netinet/libalias/alias_local.h Thu Jul 28 10:16:30 2011 (r224474) @@ -67,6 +67,9 @@ #define LINK_TABLE_OUT_SIZE 4001 #define LINK_TABLE_IN_SIZE 4001 +#define GET_ALIAS_PORT -1 +#define GET_ALIAS_ID GET_ALIAS_PORT + struct proxy_entry; struct libalias { @@ -249,6 +252,10 @@ DifferentialChecksum(u_short * _cksum, v /* Internal data access */ struct alias_link * +AddLink(struct libalias *la, struct in_addr src_addr, struct in_addr dst_addr, + struct in_addr alias_addr, u_short src_port, u_short dst_port, + int alias_param, int link_type); +struct alias_link * FindIcmpIn(struct libalias *la, struct in_addr _dst_addr, struct in_addr _alias_addr, u_short _id_alias, int _create); struct alias_link * Modified: stable/8/sys/netinet/libalias/libalias.3 ============================================================================== --- stable/8/sys/netinet/libalias/libalias.3 Thu Jul 28 10:10:39 2011 (r224473) +++ stable/8/sys/netinet/libalias/libalias.3 Thu Jul 28 10:16:30 2011 (r224474) @@ -812,6 +812,17 @@ argument is the pointer to a header frag is the pointer to the packet to be de-aliased. .Ed .Sh MISCELLANEOUS FUNCTIONS +.Ft struct alias_link * +.Fn AddLink "struct libalias *" "struct in_addr src_addr" "struct in_addr dst_addr" \ +"struct in_addr alias_addr" "u_short src_port" "u_short dst_port" \ +"int alias_param" "int link_type" +.Bd -ragged -offset indent +This function adds new state to instance hash table. +Zero can be specified instead of dst_address and/or dst port. +This makes link partially specified dynamic. +However due to hashing method such links can be resolved on inbound (ext -> int) only. +.Ed +.Pp .Ft void .Fn LibAliasSetTarget "struct libalias *" "struct in_addr addr" .Bd -ragged -offset indent From owner-svn-src-stable@FreeBSD.ORG Thu Jul 28 21:00:47 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2E47E1065670; Thu, 28 Jul 2011 21:00:47 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1DC7D8FC12; Thu, 28 Jul 2011 21:00:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6SL0lcY018919; Thu, 28 Jul 2011 21:00:47 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6SL0kGl018917; Thu, 28 Jul 2011 21:00:46 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201107282100.p6SL0kGl018917@svn.freebsd.org> From: Rick Macklem Date: Thu, 28 Jul 2011 21:00:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224487 - stable/8/sys/fs/nfsclient X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jul 2011 21:00:47 -0000 Author: rmacklem Date: Thu Jul 28 21:00:46 2011 New Revision: 224487 URL: http://svn.freebsd.org/changeset/base/224487 Log: MFC: r223971 r222389 introduced a case where the NFSv4 client could loop in nfscl_getcl() when a forced dismount is in progress, because nfsv4_lock() will return 0 without sleeping when MNTK_UNMOUNTF is set. This patch fixes it so it won't loop calling nfsv4_lock() for this case. Modified: stable/8/sys/fs/nfsclient/nfs_clstate.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/geom/label/ (props changed) Modified: stable/8/sys/fs/nfsclient/nfs_clstate.c ============================================================================== --- stable/8/sys/fs/nfsclient/nfs_clstate.c Thu Jul 28 20:30:55 2011 (r224486) +++ stable/8/sys/fs/nfsclient/nfs_clstate.c Thu Jul 28 21:00:46 2011 (r224487) @@ -761,7 +761,8 @@ nfscl_getcl(vnode_t vp, struct ucred *cr FREE((caddr_t)newclp, M_NFSCLCLIENT); } NFSLOCKCLSTATE(); - while ((clp->nfsc_flags & NFSCLFLAGS_HASCLIENTID) == 0 && !igotlock) + while ((clp->nfsc_flags & NFSCLFLAGS_HASCLIENTID) == 0 && !igotlock && + (mp->mnt_kern_flag & MNTK_UNMOUNTF) == 0) igotlock = nfsv4_lock(&clp->nfsc_lock, 1, NULL, NFSCLSTATEMUTEXPTR, mp); if (!igotlock) From owner-svn-src-stable@FreeBSD.ORG Thu Jul 28 23:31:23 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B231B1065676; Thu, 28 Jul 2011 23:31:23 +0000 (UTC) (envelope-from jhellenthal@gmail.com) Received: from mail-iy0-f182.google.com (mail-iy0-f182.google.com [209.85.210.182]) by mx1.freebsd.org (Postfix) with ESMTP id 395CC8FC0C; Thu, 28 Jul 2011 23:31:22 +0000 (UTC) Received: by iyb11 with SMTP id 11so4564136iyb.13 for ; Thu, 28 Jul 2011 16:31:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to; bh=Vsj4srFaU8jprIwje3gIy890/UxlZtACGibSQhNUi0E=; b=Boso7uIxxMdj0z9CrMLZiBYhQLbi3AarzE0L2S+HUtARzS/PgMYAghQ2lXl2j9M4aF RJFt5sjZbzQOAS9nkRkwWjg73FFZxGG0zvYHuWvUBA4RNea2U8422tcnd7WH6KQdBMGx 3tBgPELp0lAmxfTdcZJljHUZOEeDQ4jYlTanA= Received: by 10.42.157.138 with SMTP id d10mr421476icx.490.1311895882520; Thu, 28 Jul 2011 16:31:22 -0700 (PDT) Received: from DataIX.net ([99.56.120.66]) by mx.google.com with ESMTPS id e2sm944285ibb.23.2011.07.28.16.31.19 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 28 Jul 2011 16:31:20 -0700 (PDT) Sender: "J. Hellenthal" Received: from DataIX.net (localhost [127.0.0.1]) by DataIX.net (8.14.5/8.14.5) with ESMTP id p6SNVGJL038296 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 28 Jul 2011 19:31:17 -0400 (EDT) (envelope-from jhell@DataIX.net) Received: (from jhell@localhost) by DataIX.net (8.14.5/8.14.5/Submit) id p6SNVE9b038295; Thu, 28 Jul 2011 19:31:14 -0400 (EDT) (envelope-from jhell@DataIX.net) Date: Thu, 28 Jul 2011 19:31:14 -0400 From: Jason Hellenthal To: Robert Watson Message-ID: <20110728233114.GA37774@DataIX.net> References: <201107270156.p6R1uquD035835@svn.freebsd.org> <20110728021914.GA55550@DataIX.net> <4E30CEEB.107@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="a8Wt8u1KmwUX3Y2C" Content-Disposition: inline In-Reply-To: Cc: Glen Barber , svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org, svn-src-stable@freebsd.org Subject: Re: svn commit: r224462 - stable/8/usr.sbin/jail X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jul 2011 23:31:23 -0000 --a8Wt8u1KmwUX3Y2C Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jul 28, 2011 at 10:40:19AM +0100, Robert Watson wrote: >=20 > On Wed, 27 Jul 2011, Glen Barber wrote: >=20 > >> How is either one of these different ? > >> > >> All mv(1) is doing is a cp(1) & rm(1). In either case the filehandle i= s=20 > >> still broken and a process is not going to just get up and move with i= t. On=20 > >> the other side though if you copied a pipe or socket or something simi= liar=20 > >> for example into a jail then it might make whatever is outside availab= le to=20 > >> the jailed environment. > >> > >> Is there something I am misunderstanding about this ? has the way cp(1= ),=20 > >> rm(1) & mv(1) been changed recently ? or is this wording a little off ? > > > > The text in the example is just an example of a situation where it may = be=20 > > possible for a process within a jail(8) to gain filesystem access outsi= de of=20 > > the jail(8). >=20 > I wonder, if on these grounds, we should actually advise administrators t= hat=20 > it is a more robust configuration, both in terms of managing free space a= nd=20 > avoiding potential escape paths, to put each jail in its own file system.= =20 > Lots of people do this anyway, and as recommendations go, it's not a bad = one.=20 > We can then caution that if you *don't* do this, then you need to be care= ful=20 > about the mv issue. >=20 That sounds like a perfectly sane idea. --a8Wt8u1KmwUX3Y2C Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.17 (FreeBSD) Comment: http://bit.ly/0x89D8547E iQEcBAEBAgAGBQJOMfFCAAoJEJBXh4mJ2FR+XXkH/im3tgkucIQrtuqd5DZbBIck q3qtWsT3fGyRoEKB3sGXLzxDpMeic9Rm5qES9FQFM/vW/sxoNu6k8jd/7LwoD5bG merDyuJCSuHIoaYDGssKUCt/z+sr5+7dwPQEhWsc2MdoDaX55JLiyDsdevbFZoeb 1q0XQVh6jUBHHVzam7ex4xSCZ3UjVwe8gaHbZd3J7uvXPowgHVDcgYbRMDKvQ9Km xgoWSpXfGR4SCsbzLKVNI4eVN2TvDo80DLqCDFkKr9rOqDB/l2IveZMgq5q8dTZ/ lBkAZEIZZHbANwsfFchGVbfOn6WoKSdjDyiDehwiKTNZYUnLUwJ5tUQI0cdgGqI= =OQAQ -----END PGP SIGNATURE----- --a8Wt8u1KmwUX3Y2C-- From owner-svn-src-stable@FreeBSD.ORG Fri Jul 29 06:15:19 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2277B106567F; Fri, 29 Jul 2011 06:15:19 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 07B418FC23; Fri, 29 Jul 2011 06:15:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6T6FICa035451; Fri, 29 Jul 2011 06:15:18 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6T6FITb035448; Fri, 29 Jul 2011 06:15:18 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201107290615.p6T6FITb035448@svn.freebsd.org> From: Xin LI Date: Fri, 29 Jul 2011 06:15:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224488 - stable/8/sbin/dumpfs X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jul 2011 06:15:19 -0000 Author: delphij Date: Fri Jul 29 06:15:18 2011 New Revision: 224488 URL: http://svn.freebsd.org/changeset/base/224488 Log: MFC rr224004,224025: Add a -l option to show file system's corresponding /dev/ufsid path. This is useful for scripts that converts existing system's fstab to use their /dev/ufsid devices. Modified: stable/8/sbin/dumpfs/dumpfs.8 stable/8/sbin/dumpfs/dumpfs.c Directory Properties: stable/8/sbin/dumpfs/ (props changed) Modified: stable/8/sbin/dumpfs/dumpfs.8 ============================================================================== --- stable/8/sbin/dumpfs/dumpfs.8 Thu Jul 28 21:00:46 2011 (r224487) +++ stable/8/sbin/dumpfs/dumpfs.8 Fri Jul 29 06:15:18 2011 (r224488) @@ -28,7 +28,7 @@ .\" @(#)dumpfs.8 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd January 28, 2009 +.Dd Jul 14, 2011 .Dt DUMPFS 8 .Os .Sh NAME @@ -37,6 +37,7 @@ .Sh SYNOPSIS .Nm .Op Fl f +.Op Fl l .Op Fl m .Ar filesys | device .Sh DESCRIPTION @@ -44,7 +45,8 @@ The .Nm utility prints out the super block and cylinder group information for the file system or special device specified, unless the -.Fl f +.Fl f , +.Fl l or .Fl m flag is specified. @@ -64,6 +66,11 @@ Fragment numbers may be converted to raw fragment size, which may be useful when recovering deleted data. .Pp If +.Fl l +is specified, the pathname to the file system's container derived from +its unique identifier is printed. +.Pp +If .Fl m is specified, a .Xr newfs 8 Modified: stable/8/sbin/dumpfs/dumpfs.c ============================================================================== --- stable/8/sbin/dumpfs/dumpfs.c Thu Jul 28 21:00:46 2011 (r224487) +++ stable/8/sbin/dumpfs/dumpfs.c Fri Jul 29 06:15:18 2011 (r224488) @@ -68,6 +68,7 @@ static const char rcsid[] = #include #include #include +#include #include #include #include @@ -79,6 +80,7 @@ static const char rcsid[] = struct uufsd disk; int dumpfs(const char *); +int dumpfsid(void); int dumpcg(void); int dumpfreespace(const char *, int); void dumpfreespacecg(int); @@ -92,11 +94,11 @@ int main(int argc, char *argv[]) { const char *name; - int ch, dofreespace, domarshal, eval; + int ch, dofreespace, domarshal, dolabel, eval; - dofreespace = domarshal = eval = 0; + dofreespace = domarshal = dolabel = eval = 0; - while ((ch = getopt(argc, argv, "fm")) != -1) { + while ((ch = getopt(argc, argv, "lfm")) != -1) { switch (ch) { case 'f': dofreespace++; @@ -104,6 +106,9 @@ main(int argc, char *argv[]) case 'm': domarshal = 1; break; + case 'l': + dolabel = 1; + break; case '?': default: usage(); @@ -129,6 +134,8 @@ main(int argc, char *argv[]) eval |= dumpfreespace(name, dofreespace); else if (domarshal) eval |= marshal(name); + else if (dolabel) + eval |= dumpfsid(); else eval |= dumpfs(name); ufs_disk_close(&disk); @@ -137,6 +144,14 @@ main(int argc, char *argv[]) } int +dumpfsid(void) +{ + + printf("%sufsid/%08x%08x\n", _PATH_DEV, afs.fs_id[0], afs.fs_id[1]); + return 0; +} + +int dumpfs(const char *name) { time_t fstime; From owner-svn-src-stable@FreeBSD.ORG Fri Jul 29 06:16:16 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E69F61065670; Fri, 29 Jul 2011 06:16:16 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D5BBC8FC1C; Fri, 29 Jul 2011 06:16:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6T6GG7I035524; Fri, 29 Jul 2011 06:16:16 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6T6GGq6035522; Fri, 29 Jul 2011 06:16:16 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201107290616.p6T6GGq6035522@svn.freebsd.org> From: Xin LI Date: Fri, 29 Jul 2011 06:16:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224489 - stable/8/usr.sbin/mountd X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jul 2011 06:16:17 -0000 Author: delphij Date: Fri Jul 29 06:16:16 2011 New Revision: 224489 URL: http://svn.freebsd.org/changeset/base/224489 Log: Use calloc() instead of an explicit memset. Modified: stable/8/usr.sbin/mountd/mountd.c Directory Properties: stable/8/usr.sbin/mountd/ (props changed) Modified: stable/8/usr.sbin/mountd/mountd.c ============================================================================== --- stable/8/usr.sbin/mountd/mountd.c Fri Jul 29 06:15:18 2011 (r224488) +++ stable/8/usr.sbin/mountd/mountd.c Fri Jul 29 06:16:16 2011 (r224489) @@ -1789,10 +1789,9 @@ get_exp(void) { struct exportlist *ep; - ep = (struct exportlist *)malloc(sizeof (struct exportlist)); + ep = (struct exportlist *)calloc(1, sizeof (struct exportlist)); if (ep == (struct exportlist *)NULL) out_of_mem(); - memset(ep, 0, sizeof(struct exportlist)); return (ep); } @@ -1804,10 +1803,9 @@ get_grp(void) { struct grouplist *gp; - gp = (struct grouplist *)malloc(sizeof (struct grouplist)); + gp = (struct grouplist *)calloc(1, sizeof (struct grouplist)); if (gp == (struct grouplist *)NULL) out_of_mem(); - memset(gp, 0, sizeof(struct grouplist)); return (gp); } From owner-svn-src-stable@FreeBSD.ORG Fri Jul 29 09:58:56 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E71B6106564A; Fri, 29 Jul 2011 09:58:56 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CCFBB8FC14; Fri, 29 Jul 2011 09:58:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6T9wuYQ042487; Fri, 29 Jul 2011 09:58:56 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6T9wum1042480; Fri, 29 Jul 2011 09:58:56 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201107290958.p6T9wum1042480@svn.freebsd.org> From: Alexander Motin Date: Fri, 29 Jul 2011 09:58:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224490 - in stable/8/sys/dev/ata: . chipsets X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jul 2011 09:58:57 -0000 Author: mav Date: Fri Jul 29 09:58:56 2011 New Revision: 224490 URL: http://svn.freebsd.org/changeset/base/224490 Log: MFC r224270: - Use mutex to serialize index/data register pair usage, when accessing SATA registers. Unserialized access under heavy load caused wrong speed reporting and potentially could cause device loss. - To free memory and other resources (including above), allocated during chipinit() method call on attach, add new chipdeinit() method, called during driver detach. Modified: stable/8/sys/dev/ata/ata-pci.c stable/8/sys/dev/ata/ata-pci.h stable/8/sys/dev/ata/chipsets/ata-acard.c stable/8/sys/dev/ata/chipsets/ata-acerlabs.c stable/8/sys/dev/ata/chipsets/ata-intel.c stable/8/sys/dev/ata/chipsets/ata-promise.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/geom/label/ (props changed) Modified: stable/8/sys/dev/ata/ata-pci.c ============================================================================== --- stable/8/sys/dev/ata/ata-pci.c Fri Jul 29 06:16:16 2011 (r224489) +++ stable/8/sys/dev/ata/ata-pci.c Fri Jul 29 09:58:56 2011 (r224490) @@ -49,8 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include -/* local vars */ -static MALLOC_DEFINE(M_ATAPCI, "ata_pci", "ATA driver PCI"); +MALLOC_DEFINE(M_ATAPCI, "ata_pci", "ATA driver PCI"); /* misc defines */ #define IOMASK 0xfffffffc @@ -146,13 +145,14 @@ ata_pci_detach(device_t dev) device_delete_child(dev, children[i]); free(children, M_TEMP); } - if (ctlr->r_irq) { bus_teardown_intr(dev, ctlr->r_irq, ctlr->handle); bus_release_resource(dev, SYS_RES_IRQ, ctlr->r_irq_rid, ctlr->r_irq); if (ctlr->r_irq_rid != ATA_IRQ_RID) pci_release_msi(dev); } + if (ctlr->chipdeinit != NULL) + ctlr->chipdeinit(dev); if (ctlr->r_res2) bus_release_resource(dev, ctlr->r_type2, ctlr->r_rid2, ctlr->r_res2); if (ctlr->r_res1) Modified: stable/8/sys/dev/ata/ata-pci.h ============================================================================== --- stable/8/sys/dev/ata/ata-pci.h Fri Jul 29 06:16:16 2011 (r224489) +++ stable/8/sys/dev/ata/ata-pci.h Fri Jul 29 09:58:56 2011 (r224490) @@ -55,6 +55,7 @@ struct ata_pci_controller { int channels; int ichannels; int (*chipinit)(device_t); + int (*chipdeinit)(device_t); int (*suspend)(device_t); int (*resume)(device_t); int (*ch_attach)(device_t); @@ -579,6 +580,8 @@ int ata_sii_chipinit(device_t); /* externs */ extern devclass_t ata_pci_devclass; +MALLOC_DECLARE(M_ATAPCI); + /* macro for easy definition of all driver module stuff */ #define ATA_DECLARE_DRIVER(dname) \ static device_method_t __CONCAT(dname,_methods)[] = { \ Modified: stable/8/sys/dev/ata/chipsets/ata-acard.c ============================================================================== --- stable/8/sys/dev/ata/chipsets/ata-acard.c Fri Jul 29 06:16:16 2011 (r224489) +++ stable/8/sys/dev/ata/chipsets/ata-acard.c Fri Jul 29 09:58:56 2011 (r224490) @@ -59,6 +59,7 @@ struct ata_serialize { /* local prototypes */ static int ata_acard_chipinit(device_t dev); +static int ata_acard_chipdeinit(device_t dev); static int ata_acard_ch_attach(device_t dev); static int ata_acard_status(device_t dev); static int ata_acard_850_setmode(device_t dev, int target, int mode); @@ -93,6 +94,7 @@ ata_acard_probe(device_t dev) ata_set_desc(dev); ctlr->chipinit = ata_acard_chipinit; + ctlr->chipdeinit = ata_acard_chipdeinit; return (BUS_PROBE_DEFAULT); } @@ -111,7 +113,7 @@ ata_acard_chipinit(device_t dev) ctlr->setmode = ata_acard_850_setmode; ctlr->locking = ata_serialize; serial = malloc(sizeof(struct ata_serialize), - M_TEMP, M_WAITOK | M_ZERO); + M_ATAPCI, M_WAITOK | M_ZERO); ata_serialize_init(serial); ctlr->chipset_data = serial; } @@ -121,6 +123,21 @@ ata_acard_chipinit(device_t dev) } static int +ata_acard_chipdeinit(device_t dev) +{ + struct ata_pci_controller *ctlr = device_get_softc(dev); + struct ata_serialize *serial; + + if (ctlr->chip->cfg1 == ATP_OLD) { + serial = ctlr->chipset_data; + mtx_destroy(&serial->locked_mtx); + free(serial, M_ATAPCI); + ctlr->chipset_data = NULL; + } + return (0); +} + +static int ata_acard_ch_attach(device_t dev) { struct ata_channel *ch = device_get_softc(dev); Modified: stable/8/sys/dev/ata/chipsets/ata-acerlabs.c ============================================================================== --- stable/8/sys/dev/ata/chipsets/ata-acerlabs.c Fri Jul 29 06:16:16 2011 (r224489) +++ stable/8/sys/dev/ata/chipsets/ata-acerlabs.c Fri Jul 29 09:58:56 2011 (r224490) @@ -53,6 +53,7 @@ __FBSDID("$FreeBSD$"); /* local prototypes */ static int ata_ali_chipinit(device_t dev); +static int ata_ali_chipdeinit(device_t dev); static int ata_ali_ch_attach(device_t dev); static int ata_ali_sata_ch_attach(device_t dev); static void ata_ali_reset(device_t dev); @@ -95,6 +96,7 @@ ata_ali_probe(device_t dev) ata_set_desc(dev); ctlr->chipinit = ata_ali_chipinit; + ctlr->chipdeinit = ata_ali_chipdeinit; return (BUS_PROBE_DEFAULT); } @@ -122,7 +124,7 @@ ata_ali_chipinit(device_t dev) return 0; /* Allocate resources for later use by channel attach routines. */ - res = malloc(sizeof(struct ali_sata_resources), M_TEMP, M_WAITOK); + res = malloc(sizeof(struct ali_sata_resources), M_ATAPCI, M_WAITOK); for (i = 0; i < 4; i++) { rid = PCIR_BAR(i); res->bars[i] = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &rid, @@ -173,6 +175,27 @@ ata_ali_chipinit(device_t dev) } static int +ata_ali_chipdeinit(device_t dev) +{ + struct ata_pci_controller *ctlr = device_get_softc(dev); + struct ali_sata_resources *res; + int i; + + if (ctlr->chip->cfg2 == ALI_SATA) { + res = ctlr->chipset_data; + for (i = 0; i < 4; i++) { + if (res->bars[i] != NULL) { + bus_release_resource(dev, SYS_RES_IOPORT, + PCIR_BAR(i), res->bars[i]); + } + } + free(res, M_ATAPCI); + ctlr->chipset_data = NULL; + } + return (0); +} + +static int ata_ali_ch_attach(device_t dev) { struct ata_pci_controller *ctlr = device_get_softc(device_get_parent(dev)); Modified: stable/8/sys/dev/ata/chipsets/ata-intel.c ============================================================================== --- stable/8/sys/dev/ata/chipsets/ata-intel.c Fri Jul 29 06:16:16 2011 (r224489) +++ stable/8/sys/dev/ata/chipsets/ata-intel.c Fri Jul 29 09:58:56 2011 (r224490) @@ -53,6 +53,7 @@ __FBSDID("$FreeBSD$"); /* local prototypes */ static int ata_intel_chipinit(device_t dev); +static int ata_intel_chipdeinit(device_t dev); static int ata_intel_ch_attach(device_t dev); static void ata_intel_reset(device_t dev); static int ata_intel_old_setmode(device_t dev, int target, int mode); @@ -85,6 +86,18 @@ static void ata_intel_31244_reset(device #define INTEL_6CH2 8 #define INTEL_ICH7 16 +struct ata_intel_data { + struct mtx lock; + u_char smap[4]; +}; + +#define ATA_INTEL_SMAP(ctlr, ch) \ + &((struct ata_intel_data *)((ctlr)->chipset_data))->smap[(ch)->unit * 2] +#define ATA_INTEL_LOCK(ctlr) \ + mtx_lock(&((struct ata_intel_data *)((ctlr)->chipset_data))->lock) +#define ATA_INTEL_UNLOCK(ctlr) \ + mtx_unlock(&((struct ata_intel_data *)((ctlr)->chipset_data))->lock) + /* * Intel chipset support functions */ @@ -206,6 +219,7 @@ ata_intel_probe(device_t dev) ata_set_desc(dev); ctlr->chipinit = ata_intel_chipinit; + ctlr->chipdeinit = ata_intel_chipdeinit; return (BUS_PROBE_DEFAULT); } @@ -213,11 +227,14 @@ static int ata_intel_chipinit(device_t dev) { struct ata_pci_controller *ctlr = device_get_softc(dev); + struct ata_intel_data *data; if (ata_setup_interrupt(dev, ata_generic_intr)) return ENXIO; - ctlr->chipset_data = NULL; + data = malloc(sizeof(struct ata_intel_data), M_ATAPCI, M_WAITOK | M_ZERO); + mtx_init(&data->lock, "Intel SATA lock", NULL, MTX_DEF); + ctlr->chipset_data = (void *)data; /* good old PIIX needs special treatment (not implemented) */ if (ctlr->chip->chipid == ATA_I82371FB) { @@ -305,6 +322,19 @@ ata_intel_chipinit(device_t dev) } static int +ata_intel_chipdeinit(device_t dev) +{ + struct ata_pci_controller *ctlr = device_get_softc(dev); + struct ata_intel_data *data; + + data = ctlr->chipset_data; + mtx_destroy(&data->lock); + free(data, M_ATAPCI); + ctlr->chipset_data = NULL; + return (0); +} + +static int ata_intel_ch_attach(device_t dev) { struct ata_pci_controller *ctlr; @@ -329,7 +359,7 @@ ata_intel_ch_attach(device_t dev) ch->flags |= ATA_ALWAYS_DMASTAT; if (ctlr->chip->max_dma >= ATA_SA150) { - smap = (u_char *)&ctlr->chipset_data + ch->unit * 2; + smap = ATA_INTEL_SMAP(ctlr, ch); map = pci_read_config(device_get_parent(dev), 0x90, 1); if (ctlr->chip->cfg1 & INTEL_ICH5) { map &= 0x07; @@ -415,7 +445,7 @@ ata_intel_reset(device_t dev) return (ata_generic_reset(dev)); /* Do hard-reset on respective SATA ports. */ - smap = (u_char *)&ctlr->chipset_data + ch->unit * 2; + smap = ATA_INTEL_SMAP(ctlr, ch); mask = 1 << smap[0]; if ((ch->flags & ATA_NO_SLAVE) == 0) mask |= (1 << smap[1]); @@ -605,7 +635,7 @@ ata_intel_sata_ahci_read(device_t dev, i ctlr = device_get_softc(parent); ch = device_get_softc(dev); port = (port == 1) ? 1 : 0; - smap = (u_char *)&ctlr->chipset_data + ch->unit * 2; + smap = ATA_INTEL_SMAP(ctlr, ch); offset = 0x100 + smap[port] * 0x80; switch (reg) { case ATA_SSTATUS: @@ -635,7 +665,7 @@ ata_intel_sata_cscr_read(device_t dev, i parent = device_get_parent(dev); ctlr = device_get_softc(parent); ch = device_get_softc(dev); - smap = (u_char *)&ctlr->chipset_data + ch->unit * 2; + smap = ATA_INTEL_SMAP(ctlr, ch); port = (port == 1) ? 1 : 0; switch (reg) { case ATA_SSTATUS: @@ -650,9 +680,11 @@ ata_intel_sata_cscr_read(device_t dev, i default: return (EINVAL); } + ATA_INTEL_LOCK(ctlr); pci_write_config(parent, 0xa0, 0x50 + smap[port] * 0x10 + reg * 4, 4); *result = pci_read_config(parent, 0xa4, 4); + ATA_INTEL_UNLOCK(ctlr); return (0); } @@ -680,8 +712,10 @@ ata_intel_sata_sidpr_read(device_t dev, default: return (EINVAL); } + ATA_INTEL_LOCK(ctlr); ATA_IDX_OUTL(ch, ATA_IDX_ADDR, ((ch->unit * 2 + port) << 8) + reg); *result = ATA_IDX_INL(ch, ATA_IDX_DATA); + ATA_INTEL_UNLOCK(ctlr); return (0); } @@ -698,7 +732,7 @@ ata_intel_sata_ahci_write(device_t dev, ctlr = device_get_softc(parent); ch = device_get_softc(dev); port = (port == 1) ? 1 : 0; - smap = (u_char *)&ctlr->chipset_data + ch->unit * 2; + smap = ATA_INTEL_SMAP(ctlr, ch); offset = 0x100 + smap[port] * 0x80; switch (reg) { case ATA_SSTATUS: @@ -728,7 +762,7 @@ ata_intel_sata_cscr_write(device_t dev, parent = device_get_parent(dev); ctlr = device_get_softc(parent); ch = device_get_softc(dev); - smap = (u_char *)&ctlr->chipset_data + ch->unit * 2; + smap = ATA_INTEL_SMAP(ctlr, ch); port = (port == 1) ? 1 : 0; switch (reg) { case ATA_SSTATUS: @@ -743,9 +777,11 @@ ata_intel_sata_cscr_write(device_t dev, default: return (EINVAL); } + ATA_INTEL_LOCK(ctlr); pci_write_config(parent, 0xa0, 0x50 + smap[port] * 0x10 + reg * 4, 4); pci_write_config(parent, 0xa4, value, 4); + ATA_INTEL_UNLOCK(ctlr); return (0); } @@ -773,8 +809,10 @@ ata_intel_sata_sidpr_write(device_t dev, default: return (EINVAL); } + ATA_INTEL_LOCK(ctlr); ATA_IDX_OUTL(ch, ATA_IDX_ADDR, ((ch->unit * 2 + port) << 8) + reg); ATA_IDX_OUTL(ch, ATA_IDX_DATA, value); + ATA_INTEL_UNLOCK(ctlr); return (0); } Modified: stable/8/sys/dev/ata/chipsets/ata-promise.c ============================================================================== --- stable/8/sys/dev/ata/chipsets/ata-promise.c Fri Jul 29 06:16:16 2011 (r224489) +++ stable/8/sys/dev/ata/chipsets/ata-promise.c Fri Jul 29 09:58:56 2011 (r224490) @@ -280,7 +280,7 @@ ata_promise_chipinit(device_t dev) /* setup host packet controls */ hpkt = malloc(sizeof(struct ata_promise_sx4), - M_TEMP, M_NOWAIT | M_ZERO); + M_ATAPCI, M_NOWAIT | M_ZERO); mtx_init(&hpkt->mtx, "ATA promise HPKT lock", NULL, MTX_DEF); TAILQ_INIT(&hpkt->queue); hpkt->busy = 0; From owner-svn-src-stable@FreeBSD.ORG Fri Jul 29 10:02:03 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D36A8106564A; Fri, 29 Jul 2011 10:02:03 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B9D9D8FC20; Fri, 29 Jul 2011 10:02:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6TA23W7042714; Fri, 29 Jul 2011 10:02:03 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6TA23Wg042712; Fri, 29 Jul 2011 10:02:03 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201107291002.p6TA23Wg042712@svn.freebsd.org> From: Alexander Motin Date: Fri, 29 Jul 2011 10:02:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224491 - stable/8/usr.sbin/diskinfo X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jul 2011 10:02:04 -0000 Author: mav Date: Fri Jul 29 10:02:03 2011 New Revision: 224491 URL: http://svn.freebsd.org/changeset/base/224491 Log: MFC r224250: Fix `diskinfo -t` operation for disks smaller then 8GB or bigger then 2TB. Tested to work with 1.44MB floppy, 4GB USB stick and 4TB disk array. Modified: stable/8/usr.sbin/diskinfo/diskinfo.c Directory Properties: stable/8/usr.sbin/diskinfo/ (props changed) Modified: stable/8/usr.sbin/diskinfo/diskinfo.c ============================================================================== --- stable/8/usr.sbin/diskinfo/diskinfo.c Fri Jul 29 09:58:56 2011 (r224490) +++ stable/8/usr.sbin/diskinfo/diskinfo.c Fri Jul 29 10:02:03 2011 (r224491) @@ -32,6 +32,7 @@ #include #include #include +#include #include #include #include @@ -168,7 +169,7 @@ static char sector[65536]; static char mega[1024 * 1024]; static void -rdsect(int fd, u_int blockno, u_int sectorsize) +rdsect(int fd, off_t blockno, u_int sectorsize) { int error; @@ -229,21 +230,27 @@ TR(double count) static void speeddisk(int fd, off_t mediasize, u_int sectorsize) { - int i; - uint b0, b1, sectorcount; + int bulk, i; + off_t b0, b1, sectorcount, step; sectorcount = mediasize / sectorsize; + step = 1ULL << (flsll(sectorcount / (4 * 200)) - 1); + if (step > 16384) + step = 16384; + bulk = mediasize / (1024 * 1024); + if (bulk > 100) + bulk = 100; printf("Seek times:\n"); printf("\tFull stroke:\t"); b0 = 0; - b1 = sectorcount - 1 - 16384; + b1 = sectorcount - step; T0(); for (i = 0; i < 125; i++) { rdsect(fd, b0, sectorsize); - b0 += 16384; + b0 += step; rdsect(fd, b1, sectorsize); - b1 -= 16384; + b1 -= step; } TN(250); @@ -253,9 +260,9 @@ speeddisk(int fd, off_t mediasize, u_int T0(); for (i = 0; i < 125; i++) { rdsect(fd, b0, sectorsize); - b0 += 16384; + b0 += step; rdsect(fd, b1, sectorsize); - b1 += 16384; + b1 += step; } TN(250); printf("\tQuarter stroke:\t"); @@ -264,9 +271,9 @@ speeddisk(int fd, off_t mediasize, u_int T0(); for (i = 0; i < 250; i++) { rdsect(fd, b0, sectorsize); - b0 += 16384; + b0 += step; rdsect(fd, b1, sectorsize); - b1 += 16384; + b1 += step; } TN(500); @@ -275,7 +282,7 @@ speeddisk(int fd, off_t mediasize, u_int T0(); for (i = 0; i < 400; i++) { rdsect(fd, b0, sectorsize); - b0 += 16384; + b0 += step; } TN(400); @@ -284,7 +291,7 @@ speeddisk(int fd, off_t mediasize, u_int T0(); for (i = 0; i < 400; i++) { rdsect(fd, b0, sectorsize); - b0 -= 16384; + b0 -= step; } TN(400); @@ -298,7 +305,7 @@ speeddisk(int fd, off_t mediasize, u_int TN(2048); printf("\tSeq inner:\t"); - b0 = sectorcount - 2048 - 1; + b0 = sectorcount - 2048; T0(); for (i = 0; i < 2048; i++) { rdsect(fd, b0, sectorsize); @@ -310,28 +317,28 @@ speeddisk(int fd, off_t mediasize, u_int printf("\toutside: "); rdsect(fd, 0, sectorsize); T0(); - for (i = 0; i < 100; i++) { + for (i = 0; i < bulk; i++) { rdmega(fd); } - TR(100 * 1024); + TR(bulk * 1024); printf("\tmiddle: "); - b0 = sectorcount / 2; + b0 = sectorcount / 2 - bulk * (1024*1024 / sectorsize) / 2 - 1; rdsect(fd, b0, sectorsize); T0(); - for (i = 0; i < 100; i++) { + for (i = 0; i < bulk; i++) { rdmega(fd); } - TR(100 * 1024); + TR(bulk * 1024); printf("\tinside: "); - b0 = sectorcount - 100 * (1024*1024 / sectorsize) - 1;; + b0 = sectorcount - bulk * (1024*1024 / sectorsize) - 1;; rdsect(fd, b0, sectorsize); T0(); - for (i = 0; i < 100; i++) { + for (i = 0; i < bulk; i++) { rdmega(fd); } - TR(100 * 1024); + TR(bulk * 1024); printf("\n"); return; From owner-svn-src-stable@FreeBSD.ORG Fri Jul 29 10:51:57 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F1F77106566B; Fri, 29 Jul 2011 10:51:56 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D8BCD8FC08; Fri, 29 Jul 2011 10:51:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6TApuhJ044242; Fri, 29 Jul 2011 10:51:56 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6TApuA0044240; Fri, 29 Jul 2011 10:51:56 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201107291051.p6TApuA0044240@svn.freebsd.org> From: Alexander Motin Date: Fri, 29 Jul 2011 10:51:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224492 - stable/7/usr.sbin/diskinfo X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jul 2011 10:51:57 -0000 Author: mav Date: Fri Jul 29 10:51:56 2011 New Revision: 224492 URL: http://svn.freebsd.org/changeset/base/224492 Log: MFC r224250: Fix `diskinfo -t` operation for disks smaller then 8GB or bigger then 2TB. Tested to work with 1.44MB floppy, 4GB USB stick and 4TB disk array. Modified: stable/7/usr.sbin/diskinfo/diskinfo.c Directory Properties: stable/7/usr.sbin/diskinfo/ (props changed) Modified: stable/7/usr.sbin/diskinfo/diskinfo.c ============================================================================== --- stable/7/usr.sbin/diskinfo/diskinfo.c Fri Jul 29 10:02:03 2011 (r224491) +++ stable/7/usr.sbin/diskinfo/diskinfo.c Fri Jul 29 10:51:56 2011 (r224492) @@ -32,6 +32,7 @@ #include #include #include +#include #include #include #include @@ -161,7 +162,7 @@ static char sector[65536]; static char mega[1024 * 1024]; static void -rdsect(int fd, u_int blockno, u_int sectorsize) +rdsect(int fd, off_t blockno, u_int sectorsize) { int error; @@ -222,21 +223,27 @@ TR(double count) static void speeddisk(int fd, off_t mediasize, u_int sectorsize) { - int i; - uint b0, b1, sectorcount; + int bulk, i; + off_t b0, b1, sectorcount, step; sectorcount = mediasize / sectorsize; + step = 1ULL << (flsll(sectorcount / (4 * 200)) - 1); + if (step > 16384) + step = 16384; + bulk = mediasize / (1024 * 1024); + if (bulk > 100) + bulk = 100; printf("Seek times:\n"); printf("\tFull stroke:\t"); b0 = 0; - b1 = sectorcount - 1 - 16384; + b1 = sectorcount - step; T0(); for (i = 0; i < 125; i++) { rdsect(fd, b0, sectorsize); - b0 += 16384; + b0 += step; rdsect(fd, b1, sectorsize); - b1 -= 16384; + b1 -= step; } TN(250); @@ -246,9 +253,9 @@ speeddisk(int fd, off_t mediasize, u_int T0(); for (i = 0; i < 125; i++) { rdsect(fd, b0, sectorsize); - b0 += 16384; + b0 += step; rdsect(fd, b1, sectorsize); - b1 += 16384; + b1 += step; } TN(250); printf("\tQuarter stroke:\t"); @@ -257,9 +264,9 @@ speeddisk(int fd, off_t mediasize, u_int T0(); for (i = 0; i < 250; i++) { rdsect(fd, b0, sectorsize); - b0 += 16384; + b0 += step; rdsect(fd, b1, sectorsize); - b1 += 16384; + b1 += step; } TN(500); @@ -268,7 +275,7 @@ speeddisk(int fd, off_t mediasize, u_int T0(); for (i = 0; i < 400; i++) { rdsect(fd, b0, sectorsize); - b0 += 16384; + b0 += step; } TN(400); @@ -277,7 +284,7 @@ speeddisk(int fd, off_t mediasize, u_int T0(); for (i = 0; i < 400; i++) { rdsect(fd, b0, sectorsize); - b0 -= 16384; + b0 -= step; } TN(400); @@ -291,7 +298,7 @@ speeddisk(int fd, off_t mediasize, u_int TN(2048); printf("\tSeq inner:\t"); - b0 = sectorcount - 2048 - 1; + b0 = sectorcount - 2048; T0(); for (i = 0; i < 2048; i++) { rdsect(fd, b0, sectorsize); @@ -303,28 +310,28 @@ speeddisk(int fd, off_t mediasize, u_int printf("\toutside: "); rdsect(fd, 0, sectorsize); T0(); - for (i = 0; i < 100; i++) { + for (i = 0; i < bulk; i++) { rdmega(fd); } - TR(100 * 1024); + TR(bulk * 1024); printf("\tmiddle: "); - b0 = sectorcount / 2; + b0 = sectorcount / 2 - bulk * (1024*1024 / sectorsize) / 2 - 1; rdsect(fd, b0, sectorsize); T0(); - for (i = 0; i < 100; i++) { + for (i = 0; i < bulk; i++) { rdmega(fd); } - TR(100 * 1024); + TR(bulk * 1024); printf("\tinside: "); - b0 = sectorcount - 100 * (1024*1024 / sectorsize) - 1;; + b0 = sectorcount - bulk * (1024*1024 / sectorsize) - 1;; rdsect(fd, b0, sectorsize); T0(); - for (i = 0; i < 100; i++) { + for (i = 0; i < bulk; i++) { rdmega(fd); } - TR(100 * 1024); + TR(bulk * 1024); printf("\n"); return; From owner-svn-src-stable@FreeBSD.ORG Fri Jul 29 21:58:20 2011 Return-Path: Delivered-To: svn-src-stable@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0CF53106566C; Fri, 29 Jul 2011 21:58:20 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id B58B98FC0A; Fri, 29 Jul 2011 21:58:18 +0000 (UTC) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id AAA17764; Sat, 30 Jul 2011 00:58:17 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1Qmv4S-0004V3-VO; Sat, 30 Jul 2011 00:58:16 +0300 Message-ID: <4E332CF8.6080002@FreeBSD.org> Date: Sat, 30 Jul 2011 00:58:16 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:5.0) Gecko/20110706 Thunderbird/5.0 MIME-Version: 1.0 To: src-committers@FreeBSD.org References: <201107290958.p6T9wum1042480@svn.freebsd.org> In-Reply-To: <201107290958.p6T9wum1042480@svn.freebsd.org> X-Enigmail-Version: 1.2pre Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-stable@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-stable-8@FreeBSD.org Subject: Re: svn commit: r224490 - in stable/8/sys/dev/ata: . chipsets X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jul 2011 21:58:20 -0000 Picking a random stable/8 sys commit: on 29/07/2011 12:58 Alexander Motin said the following: > Modified: > stable/8/sys/dev/ata/ata-pci.c > stable/8/sys/dev/ata/ata-pci.h > stable/8/sys/dev/ata/chipsets/ata-acard.c > stable/8/sys/dev/ata/chipsets/ata-acerlabs.c > stable/8/sys/dev/ata/chipsets/ata-intel.c > stable/8/sys/dev/ata/chipsets/ata-promise.c > Directory Properties: > stable/8/sys/ (props changed) > stable/8/sys/amd64/include/xen/ (props changed) > stable/8/sys/cddl/contrib/opensolaris/ (props changed) > stable/8/sys/contrib/dev/acpica/ (props changed) > stable/8/sys/contrib/pf/ (props changed) > stable/8/sys/geom/label/ (props changed) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Why do we have this now? -- Andriy Gapon From owner-svn-src-stable@FreeBSD.ORG Fri Jul 29 22:00:32 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9CF36106566C; Fri, 29 Jul 2011 22:00:32 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8C73E8FC0C; Fri, 29 Jul 2011 22:00:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6TM0Wls067768; Fri, 29 Jul 2011 22:00:32 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6TM0WAY067766; Fri, 29 Jul 2011 22:00:32 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201107292200.p6TM0WAY067766@svn.freebsd.org> From: Andriy Gapon Date: Fri, 29 Jul 2011 22:00:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224500 - stable/8/sys/sys X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jul 2011 22:00:32 -0000 Author: avg Date: Fri Jul 29 22:00:32 2011 New Revision: 224500 URL: http://svn.freebsd.org/changeset/base/224500 Log: MFC r223663: add SNDCTL_DSP_HALT specified by OSS PR: kern/156874 Modified: stable/8/sys/sys/soundcard.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/geom/label/ (props changed) Modified: stable/8/sys/sys/soundcard.h ============================================================================== --- stable/8/sys/sys/soundcard.h Fri Jul 29 20:38:06 2011 (r224499) +++ stable/8/sys/sys/soundcard.h Fri Jul 29 22:00:32 2011 (r224500) @@ -775,7 +775,8 @@ typedef struct { * IOCTL commands for /dev/dsp and /dev/audio */ -#define SNDCTL_DSP_RESET _IO ('P', 0) +#define SNDCTL_DSP_HALT _IO ('P', 0) +#define SNDCTL_DSP_RESET SNDCTL_DSP_HALT #define SNDCTL_DSP_SYNC _IO ('P', 1) #define SNDCTL_DSP_SPEED _IOWR('P', 2, int) #define SNDCTL_DSP_STEREO _IOWR('P', 3, int) From owner-svn-src-stable@FreeBSD.ORG Fri Jul 29 22:11:06 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3F54F1065670; Fri, 29 Jul 2011 22:11:06 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2EF378FC1E; Fri, 29 Jul 2011 22:11:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6TMB6ci068220; Fri, 29 Jul 2011 22:11:06 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6TMB6Rd068218; Fri, 29 Jul 2011 22:11:06 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201107292211.p6TMB6Rd068218@svn.freebsd.org> From: Andriy Gapon Date: Fri, 29 Jul 2011 22:11:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224501 - stable/7/sys/sys X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jul 2011 22:11:06 -0000 Author: avg Date: Fri Jul 29 22:11:05 2011 New Revision: 224501 URL: http://svn.freebsd.org/changeset/base/224501 Log: MFC r223663: add SNDCTL_DSP_HALT specified by OSS PR: kern/156874 Modified: stable/7/sys/sys/soundcard.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/sys/soundcard.h ============================================================================== --- stable/7/sys/sys/soundcard.h Fri Jul 29 22:00:32 2011 (r224500) +++ stable/7/sys/sys/soundcard.h Fri Jul 29 22:11:05 2011 (r224501) @@ -752,7 +752,8 @@ typedef struct { * IOCTL commands for /dev/dsp and /dev/audio */ -#define SNDCTL_DSP_RESET _IO ('P', 0) +#define SNDCTL_DSP_HALT _IO ('P', 0) +#define SNDCTL_DSP_RESET SNDCTL_DSP_HALT #define SNDCTL_DSP_SYNC _IO ('P', 1) #define SNDCTL_DSP_SPEED _IOWR('P', 2, int) #define SNDCTL_DSP_STEREO _IOWR('P', 3, int) From owner-svn-src-stable@FreeBSD.ORG Sat Jul 30 08:31:19 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 185FC1065673; Sat, 30 Jul 2011 08:31:19 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 07EF18FC08; Sat, 30 Jul 2011 08:31:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6U8VIWY087613; Sat, 30 Jul 2011 08:31:18 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6U8VIeu087611; Sat, 30 Jul 2011 08:31:18 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201107300831.p6U8VIeu087611@svn.freebsd.org> From: Jaakko Heinonen Date: Sat, 30 Jul 2011 08:31:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224507 - stable/8/usr.sbin/kbdmap X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jul 2011 08:31:19 -0000 Author: jh Date: Sat Jul 30 08:31:18 2011 New Revision: 224507 URL: http://svn.freebsd.org/changeset/base/224507 Log: MFC r216047 by kevlo: Fix fd leak in get_font MFC r222568: Don't try to close the stream if fopen(3) fails. PR: bin/155349 Modified: stable/8/usr.sbin/kbdmap/kbdmap.c Directory Properties: stable/8/usr.sbin/kbdmap/ (props changed) Modified: stable/8/usr.sbin/kbdmap/kbdmap.c ============================================================================== --- stable/8/usr.sbin/kbdmap/kbdmap.c Sat Jul 30 01:06:12 2011 (r224506) +++ stable/8/usr.sbin/kbdmap/kbdmap.c Sat Jul 30 08:31:18 2011 (r224507) @@ -226,6 +226,7 @@ get_font(void) } } } + fclose(fp); } else fprintf(stderr, "Could not open %s for reading\n", sysconfig); From owner-svn-src-stable@FreeBSD.ORG Sat Jul 30 09:38:52 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C0230106566B; Sat, 30 Jul 2011 09:38:52 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AFBCE8FC1B; Sat, 30 Jul 2011 09:38:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6U9cq2o089721; Sat, 30 Jul 2011 09:38:52 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6U9cqrD089719; Sat, 30 Jul 2011 09:38:52 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201107300938.p6U9cqrD089719@svn.freebsd.org> From: Alexander Motin Date: Sat, 30 Jul 2011 09:38:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224508 - stable/8/sys/cam/ata X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jul 2011 09:38:52 -0000 Author: mav Date: Sat Jul 30 09:38:52 2011 New Revision: 224508 URL: http://svn.freebsd.org/changeset/base/224508 Log: r224283: Do not try to execute FLUSHCACHE on close and print extra messages for invalidated (considered lost) ada device. Exactly same already done for the da devices. Modified: stable/8/sys/cam/ata/ata_da.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/geom/label/ (props changed) Modified: stable/8/sys/cam/ata/ata_da.c ============================================================================== --- stable/8/sys/cam/ata/ata_da.c Sat Jul 30 08:31:18 2011 (r224507) +++ stable/8/sys/cam/ata/ata_da.c Sat Jul 30 09:38:52 2011 (r224508) @@ -401,7 +401,8 @@ adaclose(struct disk *dp) softc = (struct ada_softc *)periph->softc; /* We only sync the cache if the drive is capable of it. */ - if (softc->flags & ADA_FLAG_CAN_FLUSHCACHE) { + if ((softc->flags & ADA_FLAG_CAN_FLUSHCACHE) != 0 && + (softc->flags & ADA_FLAG_PACK_INVALID) == 0) { ccb = cam_periph_getccb(periph, CAM_PRIORITY_NORMAL); cam_fill_ataio(&ccb->ataio, @@ -1272,7 +1273,8 @@ adadone(struct cam_periph *periph, union return; } if (error != 0) { - if (error == ENXIO) { + if (error == ENXIO && + (softc->flags & ADA_FLAG_PACK_INVALID) == 0) { /* * Catastrophic error. Mark our pack as * invalid. From owner-svn-src-stable@FreeBSD.ORG Sat Jul 30 14:42:41 2011 Return-Path: Delivered-To: svn-src-stable@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CFB011065672; Sat, 30 Jul 2011 14:42:41 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (cl-327.ede-01.nl.sixxs.net [IPv6:2001:7b8:2ff:146::2]) by mx1.freebsd.org (Postfix) with ESMTP id 9008B8FC0C; Sat, 30 Jul 2011 14:42:41 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7:0:d9fd:71cc:37a8:cf48] (unknown [IPv6:2001:7b8:3a7:0:d9fd:71cc:37a8:cf48]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id E40615C37; Sat, 30 Jul 2011 16:42:39 +0200 (CEST) Message-ID: <4E341862.9000805@FreeBSD.org> Date: Sat, 30 Jul 2011 16:42:42 +0200 From: Dimitry Andric Organization: The FreeBSD Project User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:5.0) Gecko/20110624 Thunderbird/5.0 MIME-Version: 1.0 To: Andriy Gapon References: <201107290958.p6T9wum1042480@svn.freebsd.org> <4E332CF8.6080002@FreeBSD.org> In-Reply-To: <4E332CF8.6080002@FreeBSD.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-stable@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, svn-src-stable-8@FreeBSD.org Subject: Re: svn commit: r224490 - in stable/8/sys/dev/ata: . chipsets X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jul 2011 14:42:41 -0000 On 2011-07-29 23:58, Andriy Gapon wrote: > Picking a random stable/8 sys commit: > > on 29/07/2011 12:58 Alexander Motin said the following: >> Modified: >> stable/8/sys/dev/ata/ata-pci.c >> stable/8/sys/dev/ata/ata-pci.h >> stable/8/sys/dev/ata/chipsets/ata-acard.c >> stable/8/sys/dev/ata/chipsets/ata-acerlabs.c >> stable/8/sys/dev/ata/chipsets/ata-intel.c >> stable/8/sys/dev/ata/chipsets/ata-promise.c >> Directory Properties: >> stable/8/sys/ (props changed) >> stable/8/sys/amd64/include/xen/ (props changed) >> stable/8/sys/cddl/contrib/opensolaris/ (props changed) >> stable/8/sys/contrib/dev/acpica/ (props changed) >> stable/8/sys/contrib/pf/ (props changed) >> stable/8/sys/geom/label/ (props changed) > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > Why do we have this now? Because the merging instructions say: "Changes to kernel code should be merged to sys. For instance, a change to the ichwd(4) driver should be merged to sys, not sys/dev/ichwd. Likewise, a change to the TCP/IP stack should be merged to sys, not sys/netinet." So any merge from head to stable/x will also update the directories that already have svn:mergeinfo properties, namely those listed above. From owner-svn-src-stable@FreeBSD.ORG Sat Jul 30 17:26:05 2011 Return-Path: Delivered-To: svn-src-stable@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 91547106566C; Sat, 30 Jul 2011 17:26:05 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 0F31A8FC08; Sat, 30 Jul 2011 17:26:03 +0000 (UTC) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id UAA28655; Sat, 30 Jul 2011 20:26:02 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1QnDIY-0008Gw-0I; Sat, 30 Jul 2011 20:26:02 +0300 Message-ID: <4E343EA8.6010609@FreeBSD.org> Date: Sat, 30 Jul 2011 20:26:00 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:5.0) Gecko/20110706 Thunderbird/5.0 MIME-Version: 1.0 To: Dimitry Andric References: <201107290958.p6T9wum1042480@svn.freebsd.org> <4E332CF8.6080002@FreeBSD.org> <4E341862.9000805@FreeBSD.org> In-Reply-To: <4E341862.9000805@FreeBSD.org> X-Enigmail-Version: 1.2pre Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-stable@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, svn-src-stable-8@FreeBSD.org Subject: Re: svn commit: r224490 - in stable/8/sys/dev/ata: . chipsets X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jul 2011 17:26:05 -0000 on 30/07/2011 17:42 Dimitry Andric said the following: > On 2011-07-29 23:58, Andriy Gapon wrote: >> Picking a random stable/8 sys commit: >> >> on 29/07/2011 12:58 Alexander Motin said the following: >>> Modified: >>> stable/8/sys/dev/ata/ata-pci.c >>> stable/8/sys/dev/ata/ata-pci.h >>> stable/8/sys/dev/ata/chipsets/ata-acard.c >>> stable/8/sys/dev/ata/chipsets/ata-acerlabs.c >>> stable/8/sys/dev/ata/chipsets/ata-intel.c >>> stable/8/sys/dev/ata/chipsets/ata-promise.c >>> Directory Properties: >>> stable/8/sys/ (props changed) >>> stable/8/sys/amd64/include/xen/ (props changed) >>> stable/8/sys/cddl/contrib/opensolaris/ (props changed) >>> stable/8/sys/contrib/dev/acpica/ (props changed) >>> stable/8/sys/contrib/pf/ (props changed) >>> stable/8/sys/geom/label/ (props changed) >> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >> Why do we have this now? > > Because the merging instructions say: > > "Changes to kernel code should be merged to sys. For instance, a change > to the ichwd(4) driver should be merged to sys, not sys/dev/ichwd. > Likewise, a change to the TCP/IP stack should be merged to sys, not > sys/netinet." > > So any merge from head to stable/x will also update the directories that > already have svn:mergeinfo properties, namely those listed above. Maybe my question was not clear enough, so I'll ask it differently. Why do we have mergeinfo on stable/8/sys/geom/label now? -- Andriy Gapon From owner-svn-src-stable@FreeBSD.ORG Sat Jul 30 19:26:54 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 028BA106566B; Sat, 30 Jul 2011 19:26:54 +0000 (UTC) (envelope-from rysto32@gmail.com) Received: from mail-ey0-f176.google.com (mail-ey0-f176.google.com [209.85.215.176]) by mx1.freebsd.org (Postfix) with ESMTP id D16878FC16; Sat, 30 Jul 2011 19:26:52 +0000 (UTC) Received: by eya28 with SMTP id 28so4788546eya.21 for ; Sat, 30 Jul 2011 12:26:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=AY0Y1XojJCoo4pVay1UJT4IiYbM0Qj1f1VXhWkBmzEQ=; b=KVZ84Wt7ha+LxblbciKea+zwgQovRIXIJiaUhMWrS1KkI6BImGjAGnzr1EAaAzNmOl wj1hkppOY0+hClGNK0v/cqdzNOKqjWflF9sTy8mmnXU7Xq2Cq8mId5vhSWJUjolEbqBQ 0eEbJLn1XuBvG7pFn3oy/zxs75F/RNdCJylrc= MIME-Version: 1.0 Received: by 10.213.13.19 with SMTP id z19mr1110980ebz.107.1312052295003; Sat, 30 Jul 2011 11:58:15 -0700 (PDT) Received: by 10.213.31.194 with HTTP; Sat, 30 Jul 2011 11:58:14 -0700 (PDT) In-Reply-To: <4E343EA8.6010609@FreeBSD.org> References: <201107290958.p6T9wum1042480@svn.freebsd.org> <4E332CF8.6080002@FreeBSD.org> <4E341862.9000805@FreeBSD.org> <4E343EA8.6010609@FreeBSD.org> Date: Sat, 30 Jul 2011 14:58:14 -0400 Message-ID: From: Ryan Stone To: Andriy Gapon Content-Type: text/plain; charset=ISO-8859-1 Cc: sobomax@freebsd.org, src-committers@freebsd.org, svn-src-stable@freebsd.org, svn-src-all@freebsd.org, Dimitry Andric , svn-src-stable-8@freebsd.org Subject: Re: svn commit: r224490 - in stable/8/sys/dev/ata: . chipsets X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jul 2011 19:26:54 -0000 On Sat, Jul 30, 2011 at 1:26 PM, Andriy Gapon wrote: > Maybe my question was not clear enough, so I'll ask it differently. > Why do we have mergeinfo on stable/8/sys/geom/label now? Looks like r224301 was improperly merged. http://svn.freebsd.org/changeset/base/224301 From owner-svn-src-stable@FreeBSD.ORG Sat Jul 30 21:28:34 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 95E2A106566B; Sat, 30 Jul 2011 21:28:34 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6BA218FC13; Sat, 30 Jul 2011 21:28:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6ULSYYB016188; Sat, 30 Jul 2011 21:28:34 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6ULSYb1016187; Sat, 30 Jul 2011 21:28:34 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201107302128.p6ULSYb1016187@svn.freebsd.org> From: John Baldwin Date: Sat, 30 Jul 2011 21:28:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224530 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf geom/label X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jul 2011 21:28:34 -0000 Author: jhb Date: Sat Jul 30 21:28:34 2011 New Revision: 224530 URL: http://svn.freebsd.org/changeset/base/224530 Log: Host mergeinfo for 219400 up to sys/ and out of sys/geom/label. Modified: Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/geom/label/ (props changed) From owner-svn-src-stable@FreeBSD.ORG Sat Jul 30 23:42:16 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 18597106566C; Sat, 30 Jul 2011 23:42:16 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 06E288FC0C; Sat, 30 Jul 2011 23:42:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6UNgFeg020329; Sat, 30 Jul 2011 23:42:15 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6UNgFoB020327; Sat, 30 Jul 2011 23:42:15 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201107302342.p6UNgFoB020327@svn.freebsd.org> From: Rick Macklem Date: Sat, 30 Jul 2011 23:42:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224534 - stable/8/sys/fs/nfs X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jul 2011 23:42:16 -0000 Author: rmacklem Date: Sat Jul 30 23:42:15 2011 New Revision: 224534 URL: http://svn.freebsd.org/changeset/base/224534 Log: MFC: r224117 The new NFSv4 client handled NFSERR_GRACE as a fatal error for the remove and rename operations. Some NFSv4 servers will report NFSERR_GRACE for these operations. This patch changes the behaviour of the client so that it handles NFSERR_GRACE like NFSERR_DELAY for non-state related operations like remove and rename. It also exempts the delegreturn operation from handling within newnfs_request() for NFSERR_DELAY/NFSERR_GRACE so that it can handle NFSERR_GRACE in the same manner as before. This problem was resolved thanks to discussion with bfields at fieldses.org. The problem was identified at the recent NFSv4 ineroperability bakeathon. Modified: stable/8/sys/fs/nfs/nfs_commonkrpc.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/fs/nfs/nfs_commonkrpc.c ============================================================================== --- stable/8/sys/fs/nfs/nfs_commonkrpc.c Sat Jul 30 23:09:52 2011 (r224533) +++ stable/8/sys/fs/nfs/nfs_commonkrpc.c Sat Jul 30 23:42:15 2011 (r224534) @@ -666,8 +666,10 @@ tryagain: NFSM_DISSECT(tl, u_int32_t *, NFSX_UNSIGNED); nd->nd_repstat = fxdr_unsigned(u_int32_t, *tl); if (nd->nd_repstat != 0) { - if ((nd->nd_repstat == NFSERR_DELAY && + if (((nd->nd_repstat == NFSERR_DELAY || + nd->nd_repstat == NFSERR_GRACE) && (nd->nd_flag & ND_NFSV4) && + nd->nd_procnum != NFSPROC_DELEGRETURN && nd->nd_procnum != NFSPROC_SETATTR && nd->nd_procnum != NFSPROC_READ && nd->nd_procnum != NFSPROC_WRITE &&