svn commit: r190315 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb nfsclient

2009-03-23 Thread Craig Rodrigues
Author: rodrigc
Date: Mon Mar 23 08:33:19 2009
New Revision: 190315
URL: http://svn.freebsd.org/changeset/base/190315

Log:
  MFC 183005, 187812:
  
  Add code to parse mount options passed as individual
  items of the nmount() iovec.

Modified:
  stable/7/sys/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)
  stable/7/sys/dev/ath/ath_hal/   (props changed)
  stable/7/sys/dev/cxgb/   (props changed)
  stable/7/sys/nfsclient/nfs_vfsops.c

Modified: stable/7/sys/nfsclient/nfs_vfsops.c
==
--- stable/7/sys/nfsclient/nfs_vfsops.c Mon Mar 23 05:46:28 2009
(r190314)
+++ stable/7/sys/nfsclient/nfs_vfsops.c Mon Mar 23 08:33:19 2009
(r190315)
@@ -717,7 +717,15 @@ nfs_decode_args(struct mount *mp, struct
}
 }
 
-static const char *nfs_opts[] = { "from", "nfs_args", NULL };
+static const char *nfs_opts[] = { "from", "nfs_args",
+"noatime", "noexec", "suiddir", "nosuid", "nosymfollow", "union",
+"noclusterr", "noclusterw", "multilabel", "acls", "force", "update",
+"async", "dumbtimer", "noconn", "nolockd", "intr", "rdirplus", "resvport",
+"readdirsize", "soft", "hard", "mntudp", "tcp", "udp", "wsize", "rsize",
+"retrans", "acregmin", "acregmax", "acdirmin", "acdirmax", 
+"deadthresh", "hostname", "timeout", "addr", "fh", "nfsv3",
+"maxgroups",
+NULL };
 
 /*
  * VFS Operations.
@@ -732,13 +740,20 @@ static const char *nfs_opts[] = { "from"
 static int
 nfs_mount(struct mount *mp, struct thread *td)
 {
-   int error;
+   int error, ret, has_nfs_args_opt;
+   int has_addr_opt, has_fh_opt, has_hostname_opt;
struct nfs_args args;
struct sockaddr *nam;
struct vnode *vp;
char hst[MNAMELEN];
size_t len;
u_char nfh[NFSX_V3FHMAX];
+   char *opt;
+
+   has_nfs_args_opt = 0;
+   has_addr_opt = 0;
+   has_fh_opt = 0;
+   has_hostname_opt = 0;
 
if (vfs_filteropt(mp->mnt_optnew, nfs_opts)) {
error = EINVAL;
@@ -750,12 +765,223 @@ nfs_mount(struct mount *mp, struct threa
goto out;
}
 
-   error = vfs_copyopt(mp->mnt_optnew, "nfs_args", &args, sizeof args);
-   if (error)
-   goto out;
+   /*
+* The old mount_nfs program passed the struct nfs_args
+* from userspace to kernel.  The new mount_nfs program
+* passes string options via nmount() from userspace to kernel
+* and we populate the struct nfs_args in the kernel.
+*/
+   if (vfs_getopt(mp->mnt_optnew, "nfs_args", NULL, NULL) == 0) {
+   error = vfs_copyopt(mp->mnt_optnew, "nfs_args", &args,
+   sizeof args);
+   if (error)
+   goto out;
+
+   if (args.version != NFS_ARGSVERSION) {
+   error = EPROGMISMATCH;
+   goto out;
+   }
+   has_nfs_args_opt = 1;
+   }
 
-   if (args.version != NFS_ARGSVERSION) {
-   error = EPROGMISMATCH;
+   if (vfs_getopt(mp->mnt_optnew, "dumbtimer", NULL, NULL) == 0)
+   args.flags |= NFSMNT_DUMBTIMR;
+   if (vfs_getopt(mp->mnt_optnew, "noconn", NULL, NULL) == 0)
+   args.flags |= NFSMNT_NOCONN;
+   if (vfs_getopt(mp->mnt_optnew, "conn", NULL, NULL) == 0)
+   args.flags |= NFSMNT_NOCONN;
+   if (vfs_getopt(mp->mnt_optnew, "nolockd", NULL, NULL) == 0)
+   args.flags |= NFSMNT_NOLOCKD;
+   if (vfs_getopt(mp->mnt_optnew, "lockd", NULL, NULL) == 0)
+   args.flags &= ~NFSMNT_NOLOCKD;
+   if (vfs_getopt(mp->mnt_optnew, "intr", NULL, NULL) == 0)
+   args.flags |= NFSMNT_INT;
+   if (vfs_getopt(mp->mnt_optnew, "rdirplus", NULL, NULL) == 0)
+   args.flags |= NFSMNT_RDIRPLUS;
+   if (vfs_getopt(mp->mnt_optnew, "resvport", NULL, NULL) == 0)
+   args.flags |= NFSMNT_RESVPORT;
+   if (vfs_getopt(mp->mnt_optnew, "noresvport", NULL, NULL) == 0)
+   args.flags &= ~NFSMNT_RESVPORT;
+   if (vfs_getopt(mp->mnt_optnew, "soft", NULL, NULL) == 0)
+   args.flags |= NFSMNT_SOFT;
+   if (vfs_getopt(mp->mnt_optnew, "hard", NULL, NULL) == 0)
+   args.flags &= ~NFSMNT_SOFT;
+   if (vfs_getopt(mp->mnt_optnew, "mntudp", NULL, NULL) == 0)
+   args.sotype = SOCK_DGRAM;
+   if (vfs_getopt(mp->mnt_optnew, "udp", NULL, NULL) == 0)
+   args.sotype = SOCK_DGRAM;
+   if (vfs_getopt(mp->mnt_optnew, "tcp", NULL, NULL) == 0)
+   args.sotype = SOCK_STREAM;
+   if (vfs_getopt(mp->mnt_optnew, "nfsv3", NULL, NULL) == 0)
+   args.flags |= NFSMNT_NFSV3;
+   if (vfs_getopt(mp->mnt_optnew, "readdirsize", (void **)&opt, NULL) == 
0) {
+   if (opt == NULL) { 
+   vfs_mount_error(mp, "illegal readdirsize");
+   error = EINVA

svn commit: r190316 - stable/7/usr.sbin/gstat

2009-03-23 Thread Maxim Konovalov
Author: maxim
Date: Mon Mar 23 09:00:33 2009
New Revision: 190316
URL: http://svn.freebsd.org/changeset/base/190316

Log:
  MFC r175118: when the ms/req fields exceed 1 second, drop the fractions
  to fit more digits.
  MFC r183665: batch mode.
  MFC r189738: fix man page sinopsys; remove BUG section.
  MFC r189739: turn the batch mode on if stdout is not tty.
  > Description of fields to fill in above: 76 columns --|
  > PR:If a GNATS PR is affected by the change.
  > Submitted by:  If someone else sent in the change.
  > Reviewed by:   If someone else reviewed your modification.
  > Approved by:   If you needed approval for this commit.
  > Obtained from: If the change is from a third party.
  > MFC after: N [day[s]|week[s]|month[s]].  Request a reminder email.
  > Security:  Vulnerability reference (one per line) or description.
  > Empty fields above will be automatically removed.
  
  _M   gstat
  Mgstat/gstat.c
  Mgstat/gstat.8

Modified:
  stable/7/usr.sbin/gstat/   (props changed)
  stable/7/usr.sbin/gstat/gstat.8
  stable/7/usr.sbin/gstat/gstat.c

Modified: stable/7/usr.sbin/gstat/gstat.8
==
--- stable/7/usr.sbin/gstat/gstat.8 Mon Mar 23 08:33:19 2009
(r190315)
+++ stable/7/usr.sbin/gstat/gstat.8 Mon Mar 23 09:00:33 2009
(r190316)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd May 20, 2006
+.Dd March 12, 2009
 .Dt GSTAT 8
 .Os
 .Sh NAME
@@ -32,7 +32,7 @@
 .Nd print statistics about GEOM disks
 .Sh SYNOPSIS
 .Nm
-.Op Fl acd
+.Op Fl abcd
 .Op Fl f Ar filter
 .Op Fl I Ar interval
 .Sh DESCRIPTION
@@ -46,6 +46,10 @@ The options are as follows:
 .Bl -tag -width indent
 .It Fl a
 Only display providers that are at least 0.1% busy.
+.It Fl b
+Batch mode.
+Collect numbers, print and exit.
+Default if stdout is not a tty.
 .It Fl c
 Enable display of
 .Xr geom 4
@@ -90,15 +94,3 @@ A
 .Nm
 utility appeared in
 .Fx 5.0 .
-.Sh BUGS
-The
-.Nm
-utility only works interactively.
-It should probably detect when it is run non-interactively and produce
-simple
-.Tn ASCII
-text output.
-Otherwise, this utility should probably be folded into
-.Xr systat 1
-which only works interactively and is the obvious utility to run for
-various other forms of system statistics.

Modified: stable/7/usr.sbin/gstat/gstat.c
==
--- stable/7/usr.sbin/gstat/gstat.c Mon Mar 23 08:33:19 2009
(r190315)
+++ stable/7/usr.sbin/gstat/gstat.c Mon Mar 23 09:00:33 2009
(r190316)
@@ -51,9 +51,16 @@
 #include 
 #include 
 
-static int flag_a, flag_c, flag_d;
+static int flag_a, flag_b, flag_c, flag_d;
 static int flag_I = 100;
 
+#define PRINTMSG(...) do { \
+   if (flag_b && !loop)\
+   printf(__VA_ARGS__);\
+   else if (!flag_b)   \
+   printw(__VA_ARGS__);\
+   } while(0)
+
 static void usage(void);
 
 static const char*
@@ -67,7 +74,7 @@ int
 main(int argc, char **argv)
 {
int error, i, quit;
-   int curx, cury, maxx, maxy, line_len, max_flen;
+   int curx, cury, maxx, maxy, line_len, loop, max_flen;
struct devstat *gsp, *gsq;
void *sp, *sq;
double dt;
@@ -87,12 +94,24 @@ main(int argc, char **argv)
History *hist;
HistEvent hist_ev;
 
+   hist = NULL;
+   el = NULL;
+   maxx = -1;
+   curx = -1;
+   loop = 1;
+   /* Turn on batch mode if output is not tty. */
+   if (!isatty(fileno(stdout)))
+   flag_b = 1;
+
f_s[0] = '\0';
-   while ((i = getopt(argc, argv, "adcf:I:")) != -1) {
+   while ((i = getopt(argc, argv, "adcf:I:b")) != -1) {
switch (i) {
case 'a':
flag_a = 1;
break;
+   case 'b':
+   flag_b = 1;
+   break;
case 'c':
flag_c = 1;
break;
@@ -141,34 +160,36 @@ main(int argc, char **argv)
sq = geom_stats_snapshot_get();
if (sq == NULL)
err(1, "geom_stats_snapshot()");
-   /* Setup curses */
-   initscr();
-   start_color();
-   use_default_colors();
-   pair_content(0, &cf, &cb);
-   init_pair(1, COLOR_GREEN, cb);
-   init_pair(2, COLOR_MAGENTA, cb);
-   init_pair(3, COLOR_RED, cb);
-   cbreak();
-   noecho();
-   nonl();
-   nodelay(stdscr, 1);
-   intrflush(stdscr, FALSE);
-   keypad(stdscr, TRUE);
-   /* Setup libedit */
-   hist = history_init();
-   if (hist == NULL)
-   err(EX_SOFTWARE, "history_init()");
-   history(hist, &hist_ev, 

svn commit: r190317 - head/sbin/recoverdisk

2009-03-23 Thread Poul-Henning Kamp
Author: phk
Date: Mon Mar 23 11:07:34 2009
New Revision: 190317
URL: http://svn.freebsd.org/changeset/base/190317

Log:
  Save (empty) worklist at successful completion

Modified:
  head/sbin/recoverdisk/recoverdisk.c

Modified: head/sbin/recoverdisk/recoverdisk.c
==
--- head/sbin/recoverdisk/recoverdisk.c Mon Mar 23 09:00:33 2009
(r190316)
+++ head/sbin/recoverdisk/recoverdisk.c Mon Mar 23 11:07:34 2009
(r190317)
@@ -306,6 +306,7 @@ main(int argc, char * const argv[])
free(lp);
}
PRINT_STATUS(start, i, len, state, d, t);
+   save_worklist();
printf("\nCompleted\n");
return (0);
 }
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r190318 - in stable/7: sbin/ifconfig sys sys/contrib/pf sys/dev/ath/ath_hal sys/dev/cxgb sys/net

2009-03-23 Thread Jamie Gritton
Author: jamie
Date: Mon Mar 23 12:07:29 2009
New Revision: 190318
URL: http://svn.freebsd.org/changeset/base/190318

Log:
  MFC:
  
   r189864:
 Default to AF_LOCAL instead of AF_INET sockets for non-family-specific
 operations.  This allows the query operations to work in non-IPv4 jails,
 and will be necessary in a future of possible non-INET networking.
 (reprise r189970)
  
   r190151:
 Call the interface's if_ioctl from ifioctl(), if the protocol didn't
 handle the ioctl.  There are other paths that already call it, but this
 allows for a non-interface socket (like AF_LOCAL which ifconfig now
 uses) to use a broader class of interface ioctls.
  
  Approved by:  bz (mentor)

Modified:
  stable/7/sbin/ifconfig/   (props changed)
  stable/7/sbin/ifconfig/ifclone.c
  stable/7/sbin/ifconfig/ifconfig.c
  stable/7/sbin/ifconfig/ifgroup.c
  stable/7/sys/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)
  stable/7/sys/dev/ath/ath_hal/   (props changed)
  stable/7/sys/dev/cxgb/   (props changed)
  stable/7/sys/net/if.c

Modified: stable/7/sbin/ifconfig/ifclone.c
==
--- stable/7/sbin/ifconfig/ifclone.cMon Mar 23 11:07:34 2009
(r190317)
+++ stable/7/sbin/ifconfig/ifclone.cMon Mar 23 12:07:29 2009
(r190318)
@@ -53,9 +53,9 @@ list_cloners(void)
int idx;
int s;
 
-   s = socket(AF_INET, SOCK_DGRAM, 0);
+   s = socket(AF_LOCAL, SOCK_DGRAM, 0);
if (s == -1)
-   err(1, "socket(AF_INET,SOCK_DGRAM)");
+   err(1, "socket(AF_LOCAL,SOCK_DGRAM)");
 
memset(&ifcr, 0, sizeof(ifcr));
 

Modified: stable/7/sbin/ifconfig/ifconfig.c
==
--- stable/7/sbin/ifconfig/ifconfig.c   Mon Mar 23 11:07:34 2009
(r190317)
+++ stable/7/sbin/ifconfig/ifconfig.c   Mon Mar 23 12:07:29 2009
(r190318)
@@ -434,21 +434,22 @@ static const struct cmd setifdstaddr_cmd
DEF_CMD("ifdstaddr", 0, setifdstaddr);
 
 static int
-ifconfig(int argc, char *const *argv, int iscreate, const struct afswtch *afp)
+ifconfig(int argc, char *const *argv, int iscreate, const struct afswtch *uafp)
 {
-   const struct afswtch *nafp;
+   const struct afswtch *afp, *nafp;
struct callback *cb;
int s;
 
strncpy(ifr.ifr_name, name, sizeof ifr.ifr_name);
+   afp = uafp != NULL ? uafp : af_getbyname("inet");
 top:
-   if (afp == NULL)
-   afp = af_getbyname("inet");
ifr.ifr_addr.sa_family =
afp->af_af == AF_LINK || afp->af_af == AF_UNSPEC ?
-   AF_INET : afp->af_af;
+   AF_LOCAL : afp->af_af;
 
-   if ((s = socket(ifr.ifr_addr.sa_family, SOCK_DGRAM, 0)) < 0)
+   if ((s = socket(ifr.ifr_addr.sa_family, SOCK_DGRAM, 0)) < 0 &&
+   (uafp != NULL || errno != EPROTONOSUPPORT ||
+(s = socket(AF_LOCAL, SOCK_DGRAM, 0)) < 0))
err(1, "socket(family %u,SOCK_DGRAM", ifr.ifr_addr.sa_family);
 
while (argc > 0) {
@@ -792,11 +793,12 @@ status(const struct afswtch *afp, const 
 
if (afp == NULL) {
allfamilies = 1;
-   afp = af_getbyname("inet");
-   } else
+   ifr.ifr_addr.sa_family = AF_LOCAL;
+   } else {
allfamilies = 0;
-
-   ifr.ifr_addr.sa_family = afp->af_af == AF_LINK ? AF_INET : afp->af_af;
+   ifr.ifr_addr.sa_family =
+   afp->af_af == AF_LINK ? AF_LOCAL : afp->af_af;
+   }
strncpy(ifr.ifr_name, name, sizeof(ifr.ifr_name));
 
s = socket(ifr.ifr_addr.sa_family, SOCK_DGRAM, 0);

Modified: stable/7/sbin/ifconfig/ifgroup.c
==
--- stable/7/sbin/ifconfig/ifgroup.cMon Mar 23 11:07:34 2009
(r190317)
+++ stable/7/sbin/ifconfig/ifgroup.cMon Mar 23 12:07:29 2009
(r190318)
@@ -131,9 +131,9 @@ printgroup(const char *groupname)
int  len, cnt = 0;
int  s;
 
-   s = socket(AF_INET, SOCK_DGRAM, 0);
+   s = socket(AF_LOCAL, SOCK_DGRAM, 0);
if (s == -1)
-   err(1, "socket(AF_INET,SOCK_DGRAM)");
+   err(1, "socket(AF_LOCAL,SOCK_DGRAM)");
bzero(&ifgr, sizeof(ifgr));
strlcpy(ifgr.ifgr_name, groupname, sizeof(ifgr.ifgr_name));
if (ioctl(s, SIOCGIFGMEMB, (caddr_t)&ifgr) == -1) {

Modified: stable/7/sys/net/if.c
==
--- stable/7/sys/net/if.c   Mon Mar 23 11:07:34 2009(r190317)
+++ stable/7/sys/net/if.c   Mon Mar 23 12:07:29 2009(r190318)
@@ -1968,6 +1968,8 @@ ifioctl(struct socket *so, u_long cmd, c
error = ((*so->so_proto->pr_usrreqs->pru_control)(so, cmd,
  

Re: svn commit: r190217 - in stable/7/etc: defaults rc.d

2009-03-23 Thread John Baldwin
On Saturday 21 March 2009 5:16:05 pm Craig Rodrigues wrote:
> Author: rodrigc
> Date: Sat Mar 21 21:16:05 2009
> New Revision: 190217
> URL: http://svn.freebsd.org/changeset/base/190217
> 
> Log:
>   MFC r182460:
>   
>   Add the ability to run /usr/sbin/crashinfo on a new core dump 
automatically
>   during boot.  Right now this is disabled by default, but it can be enabled
>   by setting 'crashinfo_enable=YES' in rc.conf.

This isn't quite right and is why I haven't merged it yet.  You only want to 
run crashinfo if savecore found an actual crash dump.

-- 
John Baldwin
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r190319 - head/sys/dev/bge

2009-03-23 Thread Marius Strobl
Author: marius
Date: Mon Mar 23 14:36:50 2009
New Revision: 190319
URL: http://svn.freebsd.org/changeset/base/190319

Log:
  - Ensure that INTx isn't disabled, as these chips apparently have a
quirk requiring it to be enabled even when using MSI. This makes
the latter work again after r189285.
  - Remove a comment which no longer applies since r190194.

Modified:
  head/sys/dev/bge/if_bge.c
  head/sys/dev/bge/if_bgereg.h

Modified: head/sys/dev/bge/if_bge.c
==
--- head/sys/dev/bge/if_bge.c   Mon Mar 23 12:07:29 2009(r190318)
+++ head/sys/dev/bge/if_bge.c   Mon Mar 23 14:36:50 2009(r190319)
@@ -1295,8 +1295,7 @@ bge_stop_fw(sc)
 }
 
 /*
- * Do endian, PCI and DMA initialization. Also check the on-board ROM
- * self-test results.
+ * Do endian, PCI and DMA initialization.
  */
 static int
 bge_chipinit(struct bge_softc *sc)
@@ -1404,9 +1403,11 @@ bge_chipinit(struct bge_softc *sc)
 
/*
 * Disable memory write invalidate.  Apparently it is not supported
-* properly by these devices.
+* properly by these devices.  Also ensure that INTx isn't disabled,
+* as these chips need it even when using MSI.
 */
-   PCI_CLRBIT(sc->bge_dev, BGE_PCI_CMD, PCIM_CMD_MWIEN, 4);
+   PCI_CLRBIT(sc->bge_dev, BGE_PCI_CMD,
+   PCIM_CMD_INTxDIS | PCIM_CMD_MWIEN, 4);
 
/* Set the timer prescaler (always 66Mhz) */
CSR_WRITE_4(sc, BGE_MISC_CFG, BGE_32BITTIME_66MHZ);

Modified: head/sys/dev/bge/if_bgereg.h
==
--- head/sys/dev/bge/if_bgereg.hMon Mar 23 12:07:29 2009
(r190318)
+++ head/sys/dev/bge/if_bgereg.hMon Mar 23 14:36:50 2009
(r190319)
@@ -404,6 +404,9 @@
 #ifndef PCIM_CMD_MWIEN
 #definePCIM_CMD_MWIEN  0x0010
 #endif
+#ifndef PCIM_CMD_INTxDIS
+#definePCIM_CMD_INTxDIS0x0400
+#endif
 
 /*
  * High priority mailbox registers
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r190320 - head/usr.sbin/mergemaster

2009-03-23 Thread Doug Barton
Author: dougb
Date: Mon Mar 23 14:42:41 2009
New Revision: 190320
URL: http://svn.freebsd.org/changeset/base/190320

Log:
  Don't tempt svn to expand the example $FreeBSD strings

Modified:
  head/usr.sbin/mergemaster/mergemaster.8
  head/usr.sbin/mergemaster/mergemaster.sh

Modified: head/usr.sbin/mergemaster/mergemaster.8
==
--- head/usr.sbin/mergemaster/mergemaster.8 Mon Mar 23 14:36:50 2009
(r190319)
+++ head/usr.sbin/mergemaster/mergemaster.8 Mon Mar 23 14:42:41 2009
(r190320)
@@ -82,7 +82,7 @@ merge by hand later.
 By default it creates the temporary root in
 .Pa /var/tmp/temproot
 and compares the
-Version Control System (VCS) Id strings ($FreeBSD$)
+Version Control System (VCS) Id strings ($FreeBSD)
 for files that have them, deleting
 the temporary file if the strings match.
 If there is
@@ -216,7 +216,7 @@ Compares only files known to be essentia
 including
 .Pa /etc/make.conf .
 .It Fl F
-If the files differ only by VCS Id ($FreeBSD$)
+If the files differ only by VCS Id ($FreeBSD)
 install the new file.
 .It Fl C
 After a standard
@@ -338,7 +338,7 @@ with all values commented out:
 # Type of diff, such as unified, context, etc.
 #DIFF_FLAG='-u'
 #
-# Install the new file if it differs only by VCS Id ($FreeBSD$)
+# Install the new file if it differs only by VCS Id ($FreeBSD)
 #FREEBSD_ID=
 #
 # Verbose mode includes more details and additional checks

Modified: head/usr.sbin/mergemaster/mergemaster.sh
==
--- head/usr.sbin/mergemaster/mergemaster.shMon Mar 23 14:36:50 2009
(r190319)
+++ head/usr.sbin/mergemaster/mergemaster.shMon Mar 23 14:42:41 2009
(r190320)
@@ -26,7 +26,7 @@ display_usage () {
   echo "  -h  Display more complete help"
   echo '  -i  Automatically install files that do not exist in destination 
directory'
   echo '  -p  Pre-buildworld mode, only compares crucial files'
-  echo '  -F  Install files that differ only by revision control Id 
($FreeBSD$)'
+  echo '  -F  Install files that differ only by revision control Id ($FreeBSD)'
   echo '  -C  Compare local rc.conf variables to the defaults'
   echo '  -P  Preserve files that are overwritten'
   echo "  -U  Attempt to auto upgrade files that have not been user modified"
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r190321 - stable/7/usr.sbin/mergemaster

2009-03-23 Thread Doug Barton
Author: dougb
Date: Mon Mar 23 14:53:21 2009
New Revision: 190321
URL: http://svn.freebsd.org/changeset/base/190321

Log:
  MFC 190320, don't expand example $FreeBSD strings

Modified:
  stable/7/usr.sbin/mergemaster/   (props changed)
  stable/7/usr.sbin/mergemaster/mergemaster.8
  stable/7/usr.sbin/mergemaster/mergemaster.sh

Modified: stable/7/usr.sbin/mergemaster/mergemaster.8
==
--- stable/7/usr.sbin/mergemaster/mergemaster.8 Mon Mar 23 14:42:41 2009
(r190320)
+++ stable/7/usr.sbin/mergemaster/mergemaster.8 Mon Mar 23 14:53:21 2009
(r190321)
@@ -82,7 +82,7 @@ merge by hand later.
 By default it creates the temporary root in
 .Pa /var/tmp/temproot
 and compares the
-Version Control System (VCS) Id strings ($FreeBSD$)
+Version Control System (VCS) Id strings ($FreeBSD)
 for files that have them, deleting
 the temporary file if the strings match.
 If there is
@@ -216,7 +216,7 @@ Compares only files known to be essentia
 including
 .Pa /etc/make.conf .
 .It Fl F
-If the files differ only by VCS Id ($FreeBSD$)
+If the files differ only by VCS Id ($FreeBSD)
 install the new file.
 .It Fl C
 After a standard
@@ -338,7 +338,7 @@ with all values commented out:
 # Type of diff, such as unified, context, etc.
 #DIFF_FLAG='-u'
 #
-# Install the new file if it differs only by VCS Id ($FreeBSD$)
+# Install the new file if it differs only by VCS Id ($FreeBSD)
 #FREEBSD_ID=
 #
 # Verbose mode includes more details and additional checks

Modified: stable/7/usr.sbin/mergemaster/mergemaster.sh
==
--- stable/7/usr.sbin/mergemaster/mergemaster.shMon Mar 23 14:42:41 
2009(r190320)
+++ stable/7/usr.sbin/mergemaster/mergemaster.shMon Mar 23 14:53:21 
2009(r190321)
@@ -26,7 +26,7 @@ display_usage () {
   echo "  -h  Display more complete help"
   echo '  -i  Automatically install files that do not exist in destination 
directory'
   echo '  -p  Pre-buildworld mode, only compares crucial files'
-  echo '  -F  Install files that differ only by revision control Id 
($FreeBSD$)'
+  echo '  -F  Install files that differ only by revision control Id ($FreeBSD)'
   echo '  -C  Compare local rc.conf variables to the defaults'
   echo '  -P  Preserve files that are overwritten'
   echo "  -U  Attempt to auto upgrade files that have not been user modified"
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r190322 - stable/6/usr.sbin/mergemaster

2009-03-23 Thread Doug Barton
Author: dougb
Date: Mon Mar 23 14:54:01 2009
New Revision: 190322
URL: http://svn.freebsd.org/changeset/base/190322

Log:
  MFC 190320, don't expand example $FreeBSD strings

Modified:
  stable/6/usr.sbin/mergemaster/   (props changed)
  stable/6/usr.sbin/mergemaster/mergemaster.8
  stable/6/usr.sbin/mergemaster/mergemaster.sh

Modified: stable/6/usr.sbin/mergemaster/mergemaster.8
==
--- stable/6/usr.sbin/mergemaster/mergemaster.8 Mon Mar 23 14:53:21 2009
(r190321)
+++ stable/6/usr.sbin/mergemaster/mergemaster.8 Mon Mar 23 14:54:01 2009
(r190322)
@@ -82,7 +82,7 @@ merge by hand later.
 By default it creates the temporary root in
 .Pa /var/tmp/temproot
 and compares the
-Version Control System (VCS) Id strings ($FreeBSD$)
+Version Control System (VCS) Id strings ($FreeBSD)
 for files that have them, deleting
 the temporary file if the strings match.
 If there is
@@ -216,7 +216,7 @@ Compares only files known to be essentia
 including
 .Pa /etc/make.conf .
 .It Fl F
-If the files differ only by VCS Id ($FreeBSD$)
+If the files differ only by VCS Id ($FreeBSD)
 install the new file.
 .It Fl C
 After a standard
@@ -338,7 +338,7 @@ with all values commented out:
 # Type of diff, such as unified, context, etc.
 #DIFF_FLAG='-u'
 #
-# Install the new file if it differs only by VCS Id ($FreeBSD$)
+# Install the new file if it differs only by VCS Id ($FreeBSD)
 #FREEBSD_ID=
 #
 # Verbose mode includes more details and additional checks

Modified: stable/6/usr.sbin/mergemaster/mergemaster.sh
==
--- stable/6/usr.sbin/mergemaster/mergemaster.shMon Mar 23 14:53:21 
2009(r190321)
+++ stable/6/usr.sbin/mergemaster/mergemaster.shMon Mar 23 14:54:01 
2009(r190322)
@@ -26,7 +26,7 @@ display_usage () {
   echo "  -h  Display more complete help"
   echo '  -i  Automatically install files that do not exist in destination 
directory'
   echo '  -p  Pre-buildworld mode, only compares crucial files'
-  echo '  -F  Install files that differ only by revision control Id 
($FreeBSD$)'
+  echo '  -F  Install files that differ only by revision control Id ($FreeBSD)'
   echo '  -C  Compare local rc.conf variables to the defaults'
   echo '  -P  Preserve files that are overwritten'
   echo "  -U  Attempt to auto upgrade files that have not been user modified"
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r190006 - in stable/7/usr.sbin: . makefs

2009-03-23 Thread Jaakko Heinonen
On 2009-03-19, Sam Leffler wrote:
> Log:
>   MFC makefs: a tool for creating a file system image from a directory tree

FYI, images created with sector size (-S option) other than 512 don't
work on FreeBSD. (PR 131341)

Sector size affects to the value of the fs_fsbtodb super block field.
Looks like FreeBSD ffs requires that it's always calculated with
DEV_BSIZE (512). newfs(8) sets the sector size to DEV_BSIZE before
calculating fs_fsbtodb (however the code is marked with XXX).

Here is a workaround to recalculate fs_fsbtodb at mount time if it's not
based on DEV_BSIZE:

http://www.saunalahti.fi/~jh3/patches/ffs-fs_fsbtodb.diff

-- 
Jaakko
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r190323 - head/sys/netipsec

2009-03-23 Thread VANHULLEBUS Yvan
Author: vanhu
Date: Mon Mar 23 16:20:39 2009
New Revision: 190323
URL: http://svn.freebsd.org/changeset/base/190323

Log:
  Fixed comments so it stays in 80 chars by line
  with hard tabs of 8 chars
  
  Approved by:  gnn(mentor)

Modified:
  head/sys/netipsec/key.c

Modified: head/sys/netipsec/key.c
==
--- head/sys/netipsec/key.c Mon Mar 23 14:54:01 2009(r190322)
+++ head/sys/netipsec/key.c Mon Mar 23 16:20:39 2009(r190323)
@@ -4162,11 +4162,15 @@ key_flush_sad(time_t now)
now - sav->created > sav->lft_s->addtime) {
key_sa_chgstate(sav, SADB_SASTATE_DYING);
/* 
-* Actually, only send expire message if SA has 
been used, as it
-* was done before, but should we always send 
such message, and let IKE
-* daemon decide if it should be renegotiated 
or not ?
-* XXX expire message will actually NOT be sent 
if SA is only used
-* after soft lifetime has been reached, see 
below (DYING state)
+* Actually, only send expire message if
+* SA has been used, as it was done before,
+* but should we always send such message,
+* and let IKE daemon decide if it should be
+* renegotiated or not ?
+* XXX expire message will actually NOT be
+* sent if SA is only used after soft
+* lifetime has been reached, see below
+* (DYING state)
 */
if (sav->lft_c->usetime != 0)
key_expire(sav);
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r190324 - head/libexec/rtld-elf

2009-03-23 Thread Xin LI
Author: delphij
Date: Mon Mar 23 16:49:00 2009
New Revision: 190324
URL: http://svn.freebsd.org/changeset/base/190324

Log:
  Support for a new environment variable, LD_ELF_HINTS_PATH for overriding
  the rtld hints file.  This environment variable would be unset if the
  process is considered as tainted with setuid/setgid.  This feature gives
  a convenient way of using a custom set of shared library that is not
  located in the default location and switch back.
  
  Feature requested by: iXsystems
  Original patch by:John Hixson
  MFC after:2 weeks

Modified:
  head/libexec/rtld-elf/rtld.1
  head/libexec/rtld-elf/rtld.c

Modified: head/libexec/rtld-elf/rtld.1
==
--- head/libexec/rtld-elf/rtld.1Mon Mar 23 16:20:39 2009
(r190323)
+++ head/libexec/rtld-elf/rtld.1Mon Mar 23 16:49:00 2009
(r190324)
@@ -28,7 +28,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd May 15, 2008
+.Dd March 23, 2009
 .Dt RTLD 1
 .Os
 .Sh NAME
@@ -116,6 +116,11 @@ If set, disables the use of
 and
 .Ev LD_LIBMAP .
 This variable is unset for set-user-ID and set-group-ID programs.
+.It Ev LD_ELF_HINTS_PATH
+This variable will override the default location of
+.Dq hints
+file.
+This variable is unset for set-user-ID and set-group-ID programs.
 .It Ev LD_LIBRARY_PATH
 A colon separated list of directories, overriding the default search path
 for shared libraries.

Modified: head/libexec/rtld-elf/rtld.c
==
--- head/libexec/rtld-elf/rtld.cMon Mar 23 16:20:39 2009
(r190323)
+++ head/libexec/rtld-elf/rtld.cMon Mar 23 16:49:00 2009
(r190324)
@@ -162,6 +162,7 @@ static char *ld_debug;  /* Environment v
 static char *ld_library_path;  /* Environment variable for search path */
 static char *ld_preload;   /* Environment variable for libraries to
   load first */
+static char *ld_elf_hints_path;/* Environment variable for alternative 
hints path */
 static char *ld_tracing;   /* Called from ldd to print libs */
 static char *ld_utrace;/* Use utrace() to log events. */
 static Obj_Entry *obj_list;/* Head of linked list of shared objects */
@@ -370,17 +371,23 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_
 unsetenv(LD_ "LIBRARY_PATH");
 unsetenv(LD_ "LIBMAP_DISABLE");
 unsetenv(LD_ "DEBUG");
+unsetenv(LD_ "ELF_HINTS_PATH");
 }
 ld_debug = getenv(LD_ "DEBUG");
 libmap_disable = getenv(LD_ "LIBMAP_DISABLE") != NULL;
 libmap_override = getenv(LD_ "LIBMAP");
 ld_library_path = getenv(LD_ "LIBRARY_PATH");
 ld_preload = getenv(LD_ "PRELOAD");
+ld_elf_hints_path = getenv(LD_ "ELF_HINTS_PATH");
 dangerous_ld_env = libmap_disable || (libmap_override != NULL) ||
-   (ld_library_path != NULL) || (ld_preload != NULL);
+   (ld_library_path != NULL) || (ld_preload != NULL) ||
+   (ld_elf_hints_path != NULL);
 ld_tracing = getenv(LD_ "TRACE_LOADED_OBJECTS");
 ld_utrace = getenv(LD_ "UTRACE");
 
+if ((ld_elf_hints_path == NULL) || strlen(ld_elf_hints_path) == 0)
+   ld_elf_hints_path = _PATH_ELF_HINTS;
+
 if (ld_debug != NULL && *ld_debug != '\0')
debug = 1;
 dbg("%s is initialized, base address = %p", __progname,
@@ -1240,7 +1247,7 @@ gethints(void)
/* Keep from trying again in case the hints file is bad. */
hints = "";
 
-   if ((fd = open(_PATH_ELF_HINTS, O_RDONLY)) == -1)
+   if ((fd = open(ld_elf_hints_path, O_RDONLY)) == -1)
return NULL;
if (read(fd, &hdr, sizeof hdr) != sizeof hdr ||
  hdr.magic != ELFHINTS_MAGIC ||
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r190325 - head/sys/dev/my

2009-03-23 Thread John Baldwin
Author: jhb
Date: Mon Mar 23 17:51:07 2009
New Revision: 190325
URL: http://svn.freebsd.org/changeset/base/190325

Log:
  Release driver lock at the end of the watchdog routine instead of trying to
  acquire it again.
  
  Submitted by: bland
  MFC after:3 days

Modified:
  head/sys/dev/my/if_my.c

Modified: head/sys/dev/my/if_my.c
==
--- head/sys/dev/my/if_my.c Mon Mar 23 16:49:00 2009(r190324)
+++ head/sys/dev/my/if_my.c Mon Mar 23 17:51:07 2009(r190325)
@@ -1700,7 +1700,7 @@ my_watchdog(struct ifnet * ifp)
my_init_locked(sc);
if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd))
my_start_locked(ifp);
-   MY_LOCK(sc);
+   MY_UNLOCK(sc);
return;
 }
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r190326 - in stable/7/etc: . periodic/weekly

2009-03-23 Thread John Baldwin
Author: jhb
Date: Mon Mar 23 18:04:22 2009
New Revision: 190326
URL: http://svn.freebsd.org/changeset/base/190326

Log:
  Merge 187210 to /etc to consolidate mergeinfo.

Modified:
  stable/7/etc/   (props changed)
  stable/7/etc/periodic/weekly/   (props changed)
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r190327 - stable/7/sys/dev/usb

2009-03-23 Thread Andrew Thompson
Author: thompsa
Date: Mon Mar 23 18:13:18 2009
New Revision: 190327
URL: http://svn.freebsd.org/changeset/base/190327

Log:
  MFC r189905
  
  Fix checking of the IGNORE_RESIDUE quirk.
  
  Submitted by: marius

Modified:
  stable/7/sys/dev/usb/umass.c

Modified: stable/7/sys/dev/usb/umass.c
==
--- stable/7/sys/dev/usb/umass.cMon Mar 23 18:04:22 2009
(r190326)
+++ stable/7/sys/dev/usb/umass.cMon Mar 23 18:13:18 2009
(r190327)
@@ -1872,6 +1872,7 @@ umass_bbb_state(usbd_xfer_handle xfer, u
 {
struct umass_softc *sc = (struct umass_softc *) priv;
usbd_xfer_handle next_xfer;
+   int Residue;
 
KASSERT(sc->proto & UMASS_PROTO_BBB,
("%s: umass_bbb_state: wrong sc->proto 0x%02x\n",
@@ -2056,10 +2057,8 @@ umass_bbb_state(usbd_xfer_handle xfer, u
USETDW(sc->csw.dCSWSignature, CSWSIGNATURE);
}
 
-   int Residue;
Residue = UGETDW(sc->csw.dCSWDataResidue);
-   if (Residue == 0 &&
-   sc->transfer_datalen - sc->transfer_actlen != 0)
+   if (Residue == 0 || (sc->quirks & IGNORE_RESIDUE))
Residue = sc->transfer_datalen - sc->transfer_actlen;
 
/* Check CSW and handle any error */
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r190328 - head/sys/dev/usb

2009-03-23 Thread Andrew Thompson
Author: thompsa
Date: Mon Mar 23 19:10:38 2009
New Revision: 190328
URL: http://svn.freebsd.org/changeset/base/190328

Log:
  Fix order of debug printf items, addr and config# were swapped.

Modified:
  head/sys/dev/usb/usb_device.c

Modified: head/sys/dev/usb/usb_device.c
==
--- head/sys/dev/usb/usb_device.c   Mon Mar 23 18:13:18 2009
(r190327)
+++ head/sys/dev/usb/usb_device.c   Mon Mar 23 19:10:38 2009
(r190328)
@@ -628,7 +628,7 @@ usb2_set_config_index(struct usb2_device
DPRINTF("udev=%p cdesc=%p (addr %d) cno=%d attr=0x%02x, "
"selfpowered=%d, power=%d\n",
udev, cdp,
-   cdp->bConfigurationValue, udev->address, cdp->bmAttributes,
+   udev->address, cdp->bConfigurationValue, cdp->bmAttributes,
selfpowered, cdp->bMaxPower * 2);
 
/* Check if we have enough power. */
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r190329 - head/sys/dev/twa

2009-03-23 Thread John Baldwin
Author: jhb
Date: Mon Mar 23 19:27:23 2009
New Revision: 190329
URL: http://svn.freebsd.org/changeset/base/190329

Log:
  Reenable 64-bit DMA for twa(4) controllers, but use a boundary of 4GB to
  prevent individual transactions from crossing a 4GB address boundary.  Due
  to bus_size_t type limitations, the driver uses a 2GB boundary in PAE
  kernels.
  
  Reviewed by:  scottl
  MFC after:1 week

Modified:
  head/sys/dev/twa/tw_cl_init.c
  head/sys/dev/twa/tw_osl.h
  head/sys/dev/twa/tw_osl_freebsd.c

Modified: head/sys/dev/twa/tw_cl_init.c
==
--- head/sys/dev/twa/tw_cl_init.c   Mon Mar 23 19:10:38 2009
(r190328)
+++ head/sys/dev/twa/tw_cl_init.c   Mon Mar 23 19:27:23 2009
(r190329)
@@ -692,7 +692,7 @@ tw_cli_init_connection(struct tw_cli_ctl
init_connect->message_credits = TW_CL_SWAP16(message_credits);
init_connect->features = TW_CL_SWAP32(set_features);
if (ctlr->flags & TW_CL_64BIT_ADDRESSES)
-   init_connect->features |= TWA_64BIT_SG_ADDRESSES;
+   init_connect->features |= TW_CL_SWAP32(TWA_64BIT_SG_ADDRESSES);
if (set_features & TWA_EXTENDED_INIT_CONNECT) {
/*
 * Fill in the extra fields needed for an extended

Modified: head/sys/dev/twa/tw_osl.h
==
--- head/sys/dev/twa/tw_osl.h   Mon Mar 23 19:10:38 2009(r190328)
+++ head/sys/dev/twa/tw_osl.h   Mon Mar 23 19:27:23 2009(r190329)
@@ -57,6 +57,12 @@
 #define TW_OSLI_DEFERRED_INTR_USED
 */
 
+#ifdef PAE
+#defineTW_OSLI_DMA_BOUNDARY(1u << 31)
+#else
+#defineTW_OSLI_DMA_BOUNDARY((bus_size_t)((uint64_t)1 << 
32))
+#endif
+
 /* Possible values of req->state. */
 #define TW_OSLI_REQ_STATE_INIT 0x0 /* being initialized */
 #define TW_OSLI_REQ_STATE_BUSY 0x1 /* submitted to CL */

Modified: head/sys/dev/twa/tw_osl_freebsd.c
==
--- head/sys/dev/twa/tw_osl_freebsd.c   Mon Mar 23 19:10:38 2009
(r190328)
+++ head/sys/dev/twa/tw_osl_freebsd.c   Mon Mar 23 19:27:23 2009
(r190329)
@@ -491,8 +491,8 @@ tw_osli_alloc_mem(struct twa_softc *sc)
/* Create the parent dma tag. */
if (bus_dma_tag_create(NULL,/* parent */
sc->alignment,  /* alignment */
-   0,  /* boundary */
-   BUS_SPACE_MAXADDR_32BIT,/* lowaddr */
+   TW_OSLI_DMA_BOUNDARY,   /* boundary */
+   BUS_SPACE_MAXADDR,  /* lowaddr */
BUS_SPACE_MAXADDR,  /* highaddr */
NULL, NULL, /* filter, filterarg */
TW_CL_MAX_IO_SIZE,  /* maxsize */
@@ -515,7 +515,7 @@ tw_osli_alloc_mem(struct twa_softc *sc)
if (bus_dma_tag_create(sc->parent_tag,  /* parent */
sc->alignment,  /* alignment */
0,  /* boundary */
-   BUS_SPACE_MAXADDR_32BIT,/* lowaddr */
+   BUS_SPACE_MAXADDR,  /* lowaddr */
BUS_SPACE_MAXADDR,  /* highaddr */
NULL, NULL, /* filter, filterarg */
dma_mem_size,   /* maxsize */
@@ -562,7 +562,7 @@ tw_osli_alloc_mem(struct twa_softc *sc)
if (bus_dma_tag_create(sc->parent_tag,  /* parent */
sc->alignment,  /* alignment */
0,  /* boundary */
-   BUS_SPACE_MAXADDR_32BIT,/* lowaddr */
+   BUS_SPACE_MAXADDR,  /* lowaddr */
BUS_SPACE_MAXADDR,  /* highaddr */
NULL, NULL, /* filter, filterarg */
TW_CL_MAX_IO_SIZE,  /* maxsize */
@@ -588,7 +588,7 @@ tw_osli_alloc_mem(struct twa_softc *sc)
if (bus_dma_tag_create(sc->parent_tag,  /* parent */
sc->alignment,  /* alignment */
0,  /* boundary */
-   BUS_SPACE_MAXADDR_32BIT,/* lowaddr */
+   BUS_SPACE_MAXADDR,  /* lowaddr */
BUS_SPACE_MAXADDR,  /* highaddr */
NULL, NULL, /* filter, filterarg */
TW_CL_MAX_IO_SIZE,  /* maxsize */
@@ -1347,7 +1347,7 @@ static TW_VOID
 twa_map_load_callback(TW

svn commit: r190330 - head/sys/dev/cxgb

2009-03-23 Thread George V. Neville-Neil
Author: gnn
Date: Mon Mar 23 19:58:26 2009
New Revision: 190330
URL: http://svn.freebsd.org/changeset/base/190330

Log:
  Minor updates to the Chelsio driver, including removing an LOR.
  
  Submitted by: Navdeep Parhar at Chelsio
  Reviewed by:  gnn
  MFC after:3 weeks

Modified:
  head/sys/dev/cxgb/cxgb_main.c
  head/sys/dev/cxgb/cxgb_offload.c

Modified: head/sys/dev/cxgb/cxgb_main.c
==
--- head/sys/dev/cxgb/cxgb_main.c   Mon Mar 23 19:27:23 2009
(r190329)
+++ head/sys/dev/cxgb/cxgb_main.c   Mon Mar 23 19:58:26 2009
(r190330)
@@ -365,8 +365,8 @@ cxgb_controller_probe(device_t dev)
 }
 
 #define FW_FNAME "cxgb_t3fw"
-#define TPEEPROM_NAME "t3%c_tp_eeprom"
-#define TPSRAM_NAME "t3%c_protocol_sram"
+#define TPEEPROM_NAME "cxgb_t3%c_tp_eeprom"
+#define TPSRAM_NAME "cxgb_t3%c_protocol_sram"
 
 static int
 upgrade_fw(adapter_t *sc)
@@ -1292,10 +1292,8 @@ void t3_os_link_fault_handler(struct ada
 {
struct port_info *pi = &sc->port[port_id];
 
-   ADAPTER_LOCK(sc);
pi->link_fault = 1;
taskqueue_enqueue(sc->tq, &pi->link_fault_task);
-   ADAPTER_UNLOCK(sc);
 }
 
 void
@@ -1595,8 +1593,9 @@ update_tpeeprom(struct adapter *adap)
 
tpeeprom = firmware_get(name);
if (tpeeprom == NULL) {
-   device_printf(adap->dev, "could not load TP EEPROM: unable to 
load %s\n",
-   TPEEPROM_NAME);
+   device_printf(adap->dev,
+ "could not load TP EEPROM: unable to load %s\n",
+ name);
return;
}
 
@@ -1607,7 +1606,9 @@ update_tpeeprom(struct adapter *adap)
goto release_tpeeprom;
 
if (len != TP_SRAM_LEN) {
-   device_printf(adap->dev, "%s length is wrong len=%d 
expected=%d\n", TPEEPROM_NAME, len, TP_SRAM_LEN);
+   device_printf(adap->dev,
+ "%s length is wrong len=%d expected=%d\n", name,
+ len, TP_SRAM_LEN);
return;
}

@@ -1619,7 +1620,8 @@ update_tpeeprom(struct adapter *adap)
"Protocol SRAM image updated in EEPROM to %d.%d.%d\n",
 TP_VERSION_MAJOR, TP_VERSION_MINOR, TP_VERSION_MICRO);
} else 
-   device_printf(adap->dev, "Protocol SRAM image update in EEPROM 
failed\n");
+   device_printf(adap->dev,
+ "Protocol SRAM image update in EEPROM failed\n");
 
 release_tpeeprom:
firmware_put(tpeeprom, FIRMWARE_UNLOAD);
@@ -2571,7 +2573,7 @@ cxgb_extension_ioctl(struct cdev *dev, u
mmd = mid->phy_id >> 8;
if (!mmd)
mmd = MDIO_DEV_PCS;
-   else if (mmd > MDIO_DEV_XGXS)
+   else if (mmd > MDIO_DEV_VEND2)
return (EINVAL);
 
error = phy->mdio_read(sc, mid->phy_id & 0x1f, mmd,
@@ -2593,7 +2595,7 @@ cxgb_extension_ioctl(struct cdev *dev, u
mmd = mid->phy_id >> 8;
if (!mmd)
mmd = MDIO_DEV_PCS;
-   else if (mmd > MDIO_DEV_XGXS)
+   else if (mmd > MDIO_DEV_VEND2)
return (EINVAL);

error = phy->mdio_write(sc, mid->phy_id & 0x1f,

Modified: head/sys/dev/cxgb/cxgb_offload.c
==
--- head/sys/dev/cxgb/cxgb_offload.cMon Mar 23 19:27:23 2009
(r190329)
+++ head/sys/dev/cxgb/cxgb_offload.cMon Mar 23 19:58:26 2009
(r190330)
@@ -94,6 +94,9 @@ register_tdev(struct t3cdev *tdev)
 static inline void
 unregister_tdev(struct t3cdev *tdev)
 {
+   if (!inited)
+   return;
+
mtx_lock(&cxgb_db_lock);
TAILQ_REMOVE(&ofld_dev_list, tdev, entry);
mtx_unlock(&cxgb_db_lock);  
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r190331 - head/sys/kern

2009-03-23 Thread John Baldwin
Author: jhb
Date: Mon Mar 23 20:18:06 2009
New Revision: 190331
URL: http://svn.freebsd.org/changeset/base/190331

Log:
  Improve the description of a few sysctls.
  
  Submitted by: bde (partially)
  MFC after:3 days

Modified:
  head/sys/kern/subr_param.c
  head/sys/kern/vfs_bio.c

Modified: head/sys/kern/subr_param.c
==
--- head/sys/kern/subr_param.c  Mon Mar 23 19:58:26 2009(r190330)
+++ head/sys/kern/subr_param.c  Mon Mar 23 20:18:06 2009(r190331)
@@ -100,29 +100,30 @@ u_longdflssiz;/* initial 
stack size 
 u_long maxssiz;/* max stack size */
 u_long sgrowsiz;   /* amount to grow stack */
 
-SYSCTL_INT(_kern, OID_AUTO, hz, CTLFLAG_RDTUN, &hz, 0, "ticks/second");
+SYSCTL_INT(_kern, OID_AUTO, hz, CTLFLAG_RDTUN, &hz, 0,
+"Number of clock ticks per second");
 SYSCTL_INT(_kern, OID_AUTO, ncallout, CTLFLAG_RDTUN, &ncallout, 0,
 "Number of pre-allocated timer events");
 SYSCTL_INT(_kern, OID_AUTO, nbuf, CTLFLAG_RDTUN, &nbuf, 0,
-"Number of buffer-cache I/O buffers");
+"Number of buffers in the buffer cache");
 SYSCTL_INT(_kern, OID_AUTO, nswbuf, CTLFLAG_RDTUN, &nswbuf, 0,
 "Number of swap buffers");
 SYSCTL_LONG(_kern, OID_AUTO, maxswzone, CTLFLAG_RDTUN, &maxswzone, 0,
-"max swmeta KVA storage");
+"Maximum memory for swap metadata");
 SYSCTL_LONG(_kern, OID_AUTO, maxbcache, CTLFLAG_RDTUN, &maxbcache, 0,
-"max buffer cache KVA storage");
+"Maximum value of vfs.maxbufspace");
 SYSCTL_ULONG(_kern, OID_AUTO, maxtsiz, CTLFLAG_RDTUN, &maxtsiz, 0,
-"max text size");
+"Maximum text size");
 SYSCTL_ULONG(_kern, OID_AUTO, dfldsiz, CTLFLAG_RDTUN, &dfldsiz, 0,
-"initial data size limit");
+"Initial data size limit");
 SYSCTL_ULONG(_kern, OID_AUTO, maxdsiz, CTLFLAG_RDTUN, &maxdsiz, 0,
-"max data size");
+"Maximum data size");
 SYSCTL_ULONG(_kern, OID_AUTO, dflssiz, CTLFLAG_RDTUN, &dflssiz, 0,
-"initial stack size limit");
+"Initial stack size limit");
 SYSCTL_ULONG(_kern, OID_AUTO, maxssiz, CTLFLAG_RDTUN, &maxssiz, 0,
-"max stack size");
+"Maximum stack size");
 SYSCTL_ULONG(_kern, OID_AUTO, sgrowsiz, CTLFLAG_RDTUN, &sgrowsiz, 0,
-"amount to grow stack");
+"Amount to grow stack on a stack fault");
 SYSCTL_PROC(_kern, OID_AUTO, vm_guest, CTLFLAG_RD | CTLTYPE_STRING,
 NULL, 0, sysctl_kern_vm_guest, "A",
 "Virtual machine detected? (none|generic|xen)");

Modified: head/sys/kern/vfs_bio.c
==
--- head/sys/kern/vfs_bio.c Mon Mar 23 19:58:26 2009(r190330)
+++ head/sys/kern/vfs_bio.c Mon Mar 23 20:18:06 2009(r190331)
@@ -125,10 +125,10 @@ static long bufspace;
 #if defined(COMPAT_FREEBSD4) || defined(COMPAT_FREEBSD5) || \
 defined(COMPAT_FREEBSD6) || defined(COMPAT_FREEBSD7)
 SYSCTL_PROC(_vfs, OID_AUTO, bufspace, CTLTYPE_LONG|CTLFLAG_MPSAFE|CTLFLAG_RD,
-&bufspace, 0, sysctl_bufspace, "L", "KVA memory used for bufs");
+&bufspace, 0, sysctl_bufspace, "L", "Virtual memory used for buffers");
 #else
 SYSCTL_LONG(_vfs, OID_AUTO, bufspace, CTLFLAG_RD, &bufspace, 0,
-"KVA memory used for bufs");
+"Virtual memory used for buffers");
 #endif
 static long maxbufspace;
 SYSCTL_LONG(_vfs, OID_AUTO, maxbufspace, CTLFLAG_RD, &maxbufspace, 0,
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r190332 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb kern

2009-03-23 Thread John Baldwin
Author: jhb
Date: Mon Mar 23 20:23:28 2009
New Revision: 190332
URL: http://svn.freebsd.org/changeset/base/190332

Log:
  MFC: Move the debug.hashstat sysctl tree under DIAGNOSTIC.

Modified:
  stable/7/sys/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)
  stable/7/sys/dev/ath/ath_hal/   (props changed)
  stable/7/sys/dev/cxgb/   (props changed)
  stable/7/sys/kern/vfs_cache.c

Modified: stable/7/sys/kern/vfs_cache.c
==
--- stable/7/sys/kern/vfs_cache.c   Mon Mar 23 20:18:06 2009
(r190331)
+++ stable/7/sys/kern/vfs_cache.c   Mon Mar 23 20:23:28 2009
(r190332)
@@ -179,6 +179,7 @@ static MALLOC_DEFINE(M_VFSCACHE, "vfscac
  */
 #define NCF_WHITE  1
 
+#ifdef DIAGNOSTIC
 /*
  * Grab an atomic snapshot of the name cache hash chain lengths
  */
@@ -259,6 +260,7 @@ sysctl_debug_hashstat_nchash(SYSCTL_HAND
 SYSCTL_PROC(_debug_hashstat, OID_AUTO, nchash, CTLTYPE_INT|CTLFLAG_RD|
CTLFLAG_MPSAFE, 0, 0, sysctl_debug_hashstat_nchash, "I",
"nchash chain lengths");
+#endif
 
 /*
  * cache_zap():
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r190333 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb kern

2009-03-23 Thread John Baldwin
Author: jhb
Date: Mon Mar 23 20:29:54 2009
New Revision: 190333
URL: http://svn.freebsd.org/changeset/base/190333

Log:
  MFC: Export the current values of nbuf, ncallout, and nswbuf via read-only
  sysctls that match the tunable names.

Modified:
  stable/7/sys/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)
  stable/7/sys/dev/ath/ath_hal/   (props changed)
  stable/7/sys/dev/cxgb/   (props changed)
  stable/7/sys/kern/subr_param.c

Modified: stable/7/sys/kern/subr_param.c
==
--- stable/7/sys/kern/subr_param.c  Mon Mar 23 20:23:28 2009
(r190332)
+++ stable/7/sys/kern/subr_param.c  Mon Mar 23 20:29:54 2009
(r190333)
@@ -87,6 +87,12 @@ u_long   maxssiz;/* max stack 
size */
 u_long sgrowsiz;   /* amount to grow stack */
 
 SYSCTL_INT(_kern, OID_AUTO, hz, CTLFLAG_RDTUN, &hz, 0, "ticks/second");
+SYSCTL_INT(_kern, OID_AUTO, ncallout, CTLFLAG_RDTUN, &ncallout, 0,
+"Number of pre-allocated timer events");
+SYSCTL_INT(_kern, OID_AUTO, nbuf, CTLFLAG_RDTUN, &nbuf, 0,
+"Number of buffer-cache I/O buffers");
+SYSCTL_INT(_kern, OID_AUTO, nswbuf, CTLFLAG_RDTUN, &nswbuf, 0,
+"Number of swap buffers");
 SYSCTL_INT(_kern, OID_AUTO, maxswzone, CTLFLAG_RDTUN, &maxswzone, 0,
 "max swmeta KVA storage");
 SYSCTL_INT(_kern, OID_AUTO, maxbcache, CTLFLAG_RDTUN, &maxbcache, 0,
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r190334 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb netipsec

2009-03-23 Thread VANHULLEBUS Yvan
Author: vanhu
Date: Mon Mar 23 20:37:37 2009
New Revision: 190334
URL: http://svn.freebsd.org/changeset/base/190334

Log:
  SAs are valid (but dying) when they reached soft lifetime,
  even if they have never been used.
  
  Approved by:  gnn(mentor)

Modified:
  stable/7/sys/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)
  stable/7/sys/dev/ath/ath_hal/   (props changed)
  stable/7/sys/dev/cxgb/   (props changed)
  stable/7/sys/netipsec/key.c

Modified: stable/7/sys/netipsec/key.c
==
--- stable/7/sys/netipsec/key.c Mon Mar 23 20:29:54 2009(r190333)
+++ stable/7/sys/netipsec/key.c Mon Mar 23 20:37:37 2009(r190334)
@@ -4109,22 +4109,20 @@ key_flush_sad(time_t now)
/* check SOFT lifetime */
if (sav->lft_s->addtime != 0 &&
now - sav->created > sav->lft_s->addtime) {
-   /*
-* check SA to be used whether or not.
-* when SA hasn't been used, delete it.
+   key_sa_chgstate(sav, SADB_SASTATE_DYING);
+   /* 
+* Actually, only send expire message if
+* SA has been used, as it was done before,
+* but should we always send such message,
+* and let IKE daemon decide if it should be
+* renegotiated or not ?
+* XXX expire message will actually NOT be
+* sent if SA is only used after soft
+* lifetime has been reached, see below
+* (DYING state)
 */
-   if (sav->lft_c->usetime == 0) {
-   key_sa_chgstate(sav, SADB_SASTATE_DEAD);
-   KEY_FREESAV(&sav);
-   } else {
-   key_sa_chgstate(sav, 
SADB_SASTATE_DYING);
-   /*
-* XXX If we keep to send expire
-* message in the status of
-* DYING. Do remove below code.
-*/
+   if (sav->lft_c->usetime != 0)
key_expire(sav);
-   }
}
/* check SOFT lifetime by bytes */
/*
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r190335 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/bge dev/cxgb

2009-03-23 Thread Marius Strobl
Author: marius
Date: Mon Mar 23 20:53:38 2009
New Revision: 190335
URL: http://svn.freebsd.org/changeset/base/190335

Log:
  MFC: r190194
  
  - In bge_ifmedia_upd_locked() take advantrage of LIST_FOREACH().
  - If boot verbose, print asicrev, chiprev and bus type on attach.
  - For PCI Express devices:
1) Adjust max read request size to 4Kbytes
2) Turn on FIFO_LONG_BURST in RDMA during bge_blockinit()
Though 1) does not seem to have much to do with the poor TX performance
observed on PCI Express bge(4), 2) does fix the problem. [1]
  - Nuke the RX CPU self-diag, which prevents working cards from working
(Linux tg3 does not have this diag neither does OpenBSD's bge(4)).
The increasing of the firmware handshaking timeout to 2 retries
done as part of the original commit isn't merged as way already have a
way higher BGE_TIMEOUT of 10.
  
  PR:   119361 [1]
  Obtained from:tg3 via DragonflyBSD [1], DragonflyBSD

Modified:
  stable/7/sys/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)
  stable/7/sys/dev/ath/ath_hal/   (props changed)
  stable/7/sys/dev/bge/if_bge.c
  stable/7/sys/dev/bge/if_bgereg.h
  stable/7/sys/dev/cxgb/   (props changed)

Modified: stable/7/sys/dev/bge/if_bge.c
==
--- stable/7/sys/dev/bge/if_bge.c   Mon Mar 23 20:37:37 2009
(r190334)
+++ stable/7/sys/dev/bge/if_bge.c   Mon Mar 23 20:53:38 2009
(r190335)
@@ -384,6 +384,7 @@ static uint32_t bge_readreg_ind(struct b
 #endif
 static void bge_writemem_direct(struct bge_softc *, int, int);
 static void bge_writereg_ind(struct bge_softc *, int, int);
+static void bge_set_max_readrq(struct bge_softc *, int);
 
 static int bge_miibus_readreg(device_t, int, int);
 static int bge_miibus_writereg(device_t, int, int, int);
@@ -523,6 +524,34 @@ bge_writemem_ind(struct bge_softc *sc, i
pci_write_config(dev, BGE_PCI_MEMWIN_BASEADDR, 0, 4);
 }
 
+/*
+ * PCI Express only
+ */
+static void
+bge_set_max_readrq(struct bge_softc *sc, int expr_ptr)
+{
+   device_t dev;
+   uint16_t val;
+
+   KASSERT((sc->bge_flags & BGE_FLAG_PCIE) && expr_ptr != 0,
+   ("%s: not applicable", __func__));
+
+   dev = sc->bge_dev;
+
+   val = pci_read_config(dev, expr_ptr + BGE_PCIE_DEVCTL, 2);
+   if ((val & BGE_PCIE_DEVCTL_MAX_READRQ_MASK) !=
+   BGE_PCIE_DEVCTL_MAX_READRQ_4096) {
+   if (bootverbose)
+   device_printf(dev, "adjust device control 0x%04x ",
+   val);
+   val &= ~BGE_PCIE_DEVCTL_MAX_READRQ_MASK;
+   val |= BGE_PCIE_DEVCTL_MAX_READRQ_4096;
+   pci_write_config(dev, expr_ptr + BGE_PCIE_DEVCTL, val, 2);
+   if (bootverbose)
+   printf("-> 0x%04x\n", val);
+   }
+}
+
 #ifdef notdef
 static uint32_t
 bge_readreg_ind(struct bge_softc *sc, int off)
@@ -1278,18 +1307,6 @@ bge_chipinit(struct bge_softc *sc)
/* Set endianness before we access any non-PCI registers. */
pci_write_config(sc->bge_dev, BGE_PCI_MISC_CTL, BGE_INIT, 4);
 
-   /*
-* Check the 'ROM failed' bit on the RX CPU to see if
-* self-tests passed. Skip this check when there's no
-* chip containing the Ethernet address fitted, since
-* in that case it will always fail.
-*/
-   if ((sc->bge_flags & BGE_FLAG_EADDR) &&
-   CSR_READ_4(sc, BGE_RXCPU_MODE) & BGE_RXCPUMODE_ROMFAIL) {
-   device_printf(sc->bge_dev, "RX CPU self-diagnostics failed!\n");
-   return (ENODEV);
-   }
-
/* Clear the MAC control register */
CSR_WRITE_4(sc, BGE_MAC_MODE, 0);
 
@@ -1742,14 +1759,18 @@ bge_blockinit(struct bge_softc *sc)
/* Enable host coalescing bug fix. */
if (sc->bge_asicrev == BGE_ASICREV_BCM5755 ||
sc->bge_asicrev == BGE_ASICREV_BCM5787)
-   val |= 1 << 29;
+   val |= 1 << 29;
 
/* Turn on write DMA state machine */
CSR_WRITE_4(sc, BGE_WDMA_MODE, val);
+   DELAY(40);
 
/* Turn on read DMA state machine */
-   CSR_WRITE_4(sc, BGE_RDMA_MODE,
-   BGE_RDMAMODE_ENABLE | BGE_RDMAMODE_ALL_ATTNS);
+   val = BGE_RDMAMODE_ENABLE | BGE_RDMAMODE_ALL_ATTNS;
+   if (sc->bge_flags & BGE_FLAG_PCIE)
+   val |= BGE_RDMAMODE_FIFO_LONG_BURST;
+   CSR_WRITE_4(sc, BGE_RDMA_MODE, val);
+   DELAY(40);
 
/* Turn on RX data completion state machine */
CSR_WRITE_4(sc, BGE_RDC_MODE, BGE_RDCMODE_ENABLE);
@@ -2387,7 +2408,7 @@ bge_attach(device_t dev)
goto fail;
}
 
-   /* Save ASIC rev. */
+   /* Save various chip information. */
sc->bge_chipid =
pci_read_config(dev, BGE_PCI_MISC_CTL, 4) &
BGE_PCIMISCCTL_ASICREV;
@@ -2470,14 +2491,17 @@ bge_attach(device_t dev)
 * Found a PCI E

svn commit: r190336 - in stable/6/sys: . contrib/pf dev/bge dev/cxgb

2009-03-23 Thread Marius Strobl
Author: marius
Date: Mon Mar 23 20:53:50 2009
New Revision: 190336
URL: http://svn.freebsd.org/changeset/base/190336

Log:
  MFC: r190194
  
  - In bge_ifmedia_upd_locked() take advantrage of LIST_FOREACH().
  - If boot verbose, print asicrev, chiprev and bus type on attach.
  - For PCI Express devices:
1) Adjust max read request size to 4Kbytes
2) Turn on FIFO_LONG_BURST in RDMA during bge_blockinit()
Though 1) does not seem to have much to do with the poor TX performance
observed on PCI Express bge(4), 2) does fix the problem. [1]
  - Nuke the RX CPU self-diag, which prevents working cards from working
(Linux tg3 does not have this diag neither does OpenBSD's bge(4)).
The increasing of the firmware handshaking timeout to 2 retries
done as part of the original commit isn't merged as way already have a
way higher BGE_TIMEOUT of 10.
  
  PR:   119361 [1]
  Obtained from:tg3 via DragonflyBSD [1], DragonflyBSD

Modified:
  stable/6/sys/   (props changed)
  stable/6/sys/contrib/pf/   (props changed)
  stable/6/sys/dev/bge/if_bge.c
  stable/6/sys/dev/bge/if_bgereg.h
  stable/6/sys/dev/cxgb/   (props changed)

Modified: stable/6/sys/dev/bge/if_bge.c
==
--- stable/6/sys/dev/bge/if_bge.c   Mon Mar 23 20:53:38 2009
(r190335)
+++ stable/6/sys/dev/bge/if_bge.c   Mon Mar 23 20:53:50 2009
(r190336)
@@ -383,6 +383,7 @@ static uint32_t bge_readreg_ind(struct b
 #endif
 static void bge_writemem_direct(struct bge_softc *, int, int);
 static void bge_writereg_ind(struct bge_softc *, int, int);
+static void bge_set_max_readrq(struct bge_softc *, int);
 
 static int bge_miibus_readreg(device_t, int, int);
 static int bge_miibus_writereg(device_t, int, int, int);
@@ -521,6 +522,34 @@ bge_writemem_ind(struct bge_softc *sc, i
pci_write_config(dev, BGE_PCI_MEMWIN_BASEADDR, 0, 4);
 }
 
+/*
+ * PCI Express only
+ */
+static void
+bge_set_max_readrq(struct bge_softc *sc, int expr_ptr)
+{
+   device_t dev;
+   uint16_t val;
+
+   KASSERT((sc->bge_flags & BGE_FLAG_PCIE) && expr_ptr != 0,
+   ("%s: not applicable", __func__));
+
+   dev = sc->bge_dev;
+
+   val = pci_read_config(dev, expr_ptr + BGE_PCIE_DEVCTL, 2);
+   if ((val & BGE_PCIE_DEVCTL_MAX_READRQ_MASK) !=
+   BGE_PCIE_DEVCTL_MAX_READRQ_4096) {
+   if (bootverbose)
+   device_printf(dev, "adjust device control 0x%04x ",
+   val);
+   val &= ~BGE_PCIE_DEVCTL_MAX_READRQ_MASK;
+   val |= BGE_PCIE_DEVCTL_MAX_READRQ_4096;
+   pci_write_config(dev, expr_ptr + BGE_PCIE_DEVCTL, val, 2);
+   if (bootverbose)
+   printf("-> 0x%04x\n", val);
+   }
+}
+
 #ifdef notdef
 static uint32_t
 bge_readreg_ind(struct bge_softc *sc, int off)
@@ -1261,18 +1290,6 @@ bge_chipinit(struct bge_softc *sc)
/* Set endianness before we access any non-PCI registers. */
pci_write_config(sc->bge_dev, BGE_PCI_MISC_CTL, BGE_INIT, 4);
 
-   /*
-* Check the 'ROM failed' bit on the RX CPU to see if
-* self-tests passed. Skip this check when there's no
-* chip containing the Ethernet address fitted, since
-* in that case it will always fail.
-*/
-   if ((sc->bge_flags & BGE_FLAG_EADDR) &&
-   CSR_READ_4(sc, BGE_RXCPU_MODE) & BGE_RXCPUMODE_ROMFAIL) {
-   device_printf(sc->bge_dev, "RX CPU self-diagnostics failed!\n");
-   return (ENODEV);
-   }
-
/* Clear the MAC control register */
CSR_WRITE_4(sc, BGE_MAC_MODE, 0);
 
@@ -1736,14 +1753,18 @@ bge_blockinit(struct bge_softc *sc)
/* Enable host coalescing bug fix. */
if (sc->bge_asicrev == BGE_ASICREV_BCM5755 ||
sc->bge_asicrev == BGE_ASICREV_BCM5787)
-   val |= 1 << 29;
+   val |= 1 << 29;
 
/* Turn on write DMA state machine */
CSR_WRITE_4(sc, BGE_WDMA_MODE, val);
+   DELAY(40);
 
/* Turn on read DMA state machine */
-   CSR_WRITE_4(sc, BGE_RDMA_MODE,
-   BGE_RDMAMODE_ENABLE | BGE_RDMAMODE_ALL_ATTNS);
+   val = BGE_RDMAMODE_ENABLE | BGE_RDMAMODE_ALL_ATTNS;
+   if (sc->bge_flags & BGE_FLAG_PCIE)
+   val |= BGE_RDMAMODE_FIFO_LONG_BURST;
+   CSR_WRITE_4(sc, BGE_RDMA_MODE, val);
+   DELAY(40);
 
/* Turn on RX data completion state machine */
CSR_WRITE_4(sc, BGE_RDC_MODE, BGE_RDCMODE_ENABLE);
@@ -2383,8 +2404,7 @@ bge_attach(device_t dev)
sc->bge_btag = rman_get_bustag(sc->bge_res);
sc->bge_bhandle = rman_get_bushandle(sc->bge_res);
 
-   /* Save ASIC rev. */
-
+   /* Save various chip information. */
sc->bge_chipid =
pci_read_config(dev, BGE_PCI_MISC_CTL, 4) &
BGE_PCIMISCCTL_ASICREV;
@@ -2457,14 +2477,17 @@ bge_attach(device_t dev)
 

svn commit: r190337 - head/sys/kern

2009-03-23 Thread Jung-uk Kim
Author: jkim
Date: Mon Mar 23 21:16:21 2009
New Revision: 190337
URL: http://svn.freebsd.org/changeset/base/190337

Log:
  Clean up MI inittodr(9) and kill noop code.
  
  It was derived from i386 version long ago but never resync'ed again.
  Originally, i386 version compared the current time from realtime clock
  with time_second (which was just `time' in the old days).  When this MI
  version was written, it was wrongly compared against `base' AND never
  used because of a bug (typo?) in the code.  This check was killed
  in i386 version when home-rolled calendaric calculation was removed.
  Now, we just remove the code here as well to make the code simpler.

Modified:
  head/sys/kern/subr_rtc.c

Modified: head/sys/kern/subr_rtc.c
==
--- head/sys/kern/subr_rtc.cMon Mar 23 20:53:50 2009(r190336)
+++ head/sys/kern/subr_rtc.cMon Mar 23 21:16:21 2009(r190337)
@@ -109,44 +109,36 @@ clock_register(device_t dev, long res)/
 void
 inittodr(time_t base)
 {
-   struct timespec diff, ref, ts;
+   struct timespec ref, ts;
int error;
 
-   if (base) {
-   ref.tv_sec = base;
-   ref.tv_nsec = 0;
-   tc_setclock(&ref);
-   }
-
if (clock_dev == NULL) {
printf("warning: no time-of-day clock registered, system time "
"will not be set accurately\n");
-   return;
+   goto wrong_time;
}
/* XXX: We should poll all registered RTCs in case of failure */
error = CLOCK_GETTIME(clock_dev, &ts);
if (error != 0 && error != EINVAL) {
printf("warning: clock_gettime failed (%d), the system time "
"will not be set accurately\n", error);
-   return;
+   goto wrong_time;
}
if (error == EINVAL || ts.tv_sec < 0) {
-   printf("Invalid time in real time clock.\n");
-   printf("Check and reset the date immediately!\n");
+   printf("Invalid time in real time clock.\n"
+   "Check and reset the date immediately!\n");
+   goto wrong_time;
}
 
ts.tv_sec += utc_offset();
+   tc_setclock(&ts);
+   return;
 
-   if (timespeccmp(&ref, &ts, >)) {
-   diff = ref;
-   timespecsub(&ref, &ts);
-   } else {
-   diff = ts;
-   timespecsub(&diff, &ref);
-   }
-   if (ts.tv_sec >= 2) {
-   /* badly off, adjust it */
-   tc_setclock(&ts);
+wrong_time:
+   if (base > 0) {
+   ref.tv_sec = base;
+   ref.tv_nsec = 0;
+   tc_setclock(&ref);
}
 }
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r190338 - stable/7/release/picobsd/build

2009-03-23 Thread Luigi Rizzo
Author: luigi
Date: Mon Mar 23 21:32:03 2009
New Revision: 190338
URL: http://svn.freebsd.org/changeset/base/190338

Log:
  MFC: add support for local config files and non-chroot
  copy of files from the host filesystem

Modified:
  stable/7/release/picobsd/build/picobsd

Modified: stable/7/release/picobsd/build/picobsd
==
--- stable/7/release/picobsd/build/picobsd  Mon Mar 23 21:16:21 2009
(r190337)
+++ stable/7/release/picobsd/build/picobsd  Mon Mar 23 21:32:03 2009
(r190338)
@@ -284,6 +284,9 @@ build_image() {
 if [ -f ${MY_TREE}/config ] ; then
. ${MY_TREE}/config
 fi
+if [ -f ${o_additional_config} ] ; then
+   . ${o_additional_config}
+fi
 
 # location of the object directory
 PICO_OBJ=${l_objtree}/picobsd/${THETYPE}
@@ -529,6 +532,32 @@ populate_floppy_fs() { # OK
 ) || true
 }
 
+# Copy the specified files to the destination filesystem.
+# Each file is specified as a pair "src dst", dst is assumed to be
+# a directory (and created with mkdir -p) if it has a trailing /
+# Be careful to escape metacharacters.
+# You can use ${CROSS} to point to the root of the cross build
+# (remember that it might be incomplete)
+
+do_copyfiles() {   # rootdir varname
+   log Copy files to $1
+   local root=$1
+   local srcs dst
+   local CROSS=${_SHLIBDIRPREFIX}
+   eval set "\${${2}}"
+srcs=""
+   for dst in $* ; do
+   [ x"$srcs" = x ] && srcs=$dst && continue
+   eval srcs="$srcs"   # expand wildcard and vars
+   case x"$dst" in
+   */ )mkdir -p ${root}/${dst} ;;
+   # * )   mkdir -p `dirname ${root}/${dst}` ;;
+   esac
+   cp -p ${srcs} ${root}/${dst} || true
+   srcs=""
+done
+}
+
 # Populate the memory filesystem with binaries and non-variable
 # configuration files.
 # First do an mtree pass, then create directory links and device entries,
@@ -537,7 +566,7 @@ populate_floppy_fs() {  # OK
 # Finally, if required, make a copy of the floppy.tree onto /fd
 
 populate_mfs_tree() {
-local a dst MFS_TREE
+local i j a dst MFS_TREE
 
 log "populate_mfs_tree()"
 dst=${BUILDDIR}/mfs.tree
@@ -552,12 +581,15 @@ populate_mfs_tree() {
 log "Running mtree using $a..."
 mtree -deU -f $a -p ${dst} > /dev/null || fail $? mtree
 
-# XXX create links
+# Create symlinks using relative pathnames, so it is possible
+# to follow them also when building the image.
+# Note that names in STAND_LINKS should not have a leading /
 for i in ${STAND_LINKS}; do
-   ln -s /stand ${dst}/$i
+   j=`echo $i | sed -E 's:^[^/]+::;s:/[^/]+:../:g'`
+   ln -s ${j}stand ${dst}/$i
 done
-ln -s /dev/null ${dst}/var/run/log
-ln -s /etc/termcap ${dst}/usr/share/misc/termcap
+ln -s ../../dev/null ${dst}/var/run/log
+ln -s ../../../etc/termcap ${dst}/usr/share/misc/termcap
 
 ### now build the crunched binaries ###
 (
@@ -629,6 +661,13 @@ populate_mfs_tree() {
(cd ${dst}; chown -R root . )
 fi
 
+if [ -n "${copy_files}" ] ; then
+   do_copyfiles ${dst} copy_files
+fi
+
+# The 'import_files' mechanism is deprecated, as it requires
+# root permissions to follow the symlinks, and also does
+# not let you rename the entries.
 if [ -n "${import_files}" ] ; then
log "importing ${import_files} into mfs"
# We do it in a chroot environment on the target so
@@ -641,6 +680,7 @@ populate_mfs_tree() {
rm -rf ${dst}/rescue
 fi
 
+# final step -- build the mfs image
 (cd ${BUILDDIR}
# override the owner
echo "/set uid=0 gid=0" > mtree.out
@@ -916,6 +956,11 @@ while [ true ]; do
generate_iso="YES"
;;
 
+--cfg) # read additional config from this file
+   o_additional_config=`realpath $2`
+   shift
+   ;;
+
 *)
break
;;
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r190339 - head/sys/dev/acpica

2009-03-23 Thread Jung-uk Kim
Author: jkim
Date: Mon Mar 23 22:06:09 2009
New Revision: 190339
URL: http://svn.freebsd.org/changeset/base/190339

Log:
  Check whether devd is running before calling resume notifier and
  reshuffle code to reduce unnecessary locking coverage.

Modified:
  head/sys/dev/acpica/acpi.c

Modified: head/sys/dev/acpica/acpi.c
==
--- head/sys/dev/acpica/acpi.c  Mon Mar 23 21:32:03 2009(r190338)
+++ head/sys/dev/acpica/acpi.c  Mon Mar 23 22:06:09 2009(r190339)
@@ -2336,7 +2336,7 @@ acpi_ReqSleepState(struct acpi_softc *sc
 #endif
 
 /* If devd(8) is not running, immediately enter the sleep state. */
-if (devctl_process_running() == FALSE) {
+if (!devctl_process_running()) {
ACPI_UNLOCK(acpi);
if (ACPI_SUCCESS(acpi_EnterSleepState(sc, sc->acpi_next_sstate))) {
return (0);
@@ -2345,9 +2345,6 @@ acpi_ReqSleepState(struct acpi_softc *sc
}
 }
 
-/* Now notify devd(8) also. */
-acpi_UserNotify("Suspend", ACPI_ROOT_OBJECT, state);
-
 /*
  * Set a timeout to fire if userland doesn't ack the suspend request
  * in time.  This way we still eventually go to sleep if we were
@@ -2357,6 +2354,10 @@ acpi_ReqSleepState(struct acpi_softc *sc
  */
 callout_reset(&sc->susp_force_to, 10 * hz, acpi_sleep_force, sc);
 ACPI_UNLOCK(acpi);
+
+/* Now notify devd(8) also. */
+acpi_UserNotify("Suspend", ACPI_ROOT_OBJECT, state);
+
 return (0);
 #else
 /* This platform does not support acpi suspend/resume. */
@@ -2432,8 +2433,24 @@ acpi_AckSleepState(struct apm_clone_data
 static void
 acpi_sleep_enable(void *arg)
 {
+struct acpi_softc  *sc = (struct acpi_softc *)arg;
 
-((struct acpi_softc *)arg)->acpi_sleep_disabled = 0;
+ACPI_LOCK(acpi);
+sc->acpi_sleep_disabled = 0;
+ACPI_UNLOCK(acpi);
+}
+
+static ACPI_STATUS
+acpi_sleep_disable(struct acpi_softc *sc)
+{
+ACPI_STATUSstatus;
+
+ACPI_LOCK(acpi);
+status = sc->acpi_sleep_disabled ? AE_ERROR : AE_OK;
+sc->acpi_sleep_disabled = 1;
+ACPI_UNLOCK(acpi);
+
+return (status);
 }
 
 enum acpi_sleep_state {
@@ -2460,15 +2477,11 @@ acpi_EnterSleepState(struct acpi_softc *
 ACPI_FUNCTION_TRACE_U32((char *)(uintptr_t)__func__, state);
 
 /* Re-entry once we're suspending is not allowed. */
-status = AE_OK;
-ACPI_LOCK(acpi);
-if (sc->acpi_sleep_disabled) {
-   ACPI_UNLOCK(acpi);
+status = acpi_sleep_disable(sc);
+if (ACPI_FAILURE(status)) {
printf("acpi: suspend request ignored (not ready yet)\n");
-   return (AE_ERROR);
+   return (status);
 }
-sc->acpi_sleep_disabled = 1;
-ACPI_UNLOCK(acpi);
 
 #ifdef SMP
 thread_lock(curthread);
@@ -2557,6 +2570,7 @@ acpi_EnterSleepState(struct acpi_softc *
 * shutdown handlers.
 */
shutdown_nice(RB_POWEROFF);
+   status = AE_OK;
break;
 case ACPI_STATE_S0:
 default:
@@ -2580,13 +2594,6 @@ acpi_EnterSleepState(struct acpi_softc *
 if (slp_state >= ACPI_SS_SLEPT)
acpi_enable_fixed_events(sc);
 
-/* Allow another sleep request after a while. */
-if (state != ACPI_STATE_S5)
-   timeout(acpi_sleep_enable, sc, hz * ACPI_MINIMUM_AWAKETIME);
-
-/* Run /etc/rc.resume after we are back. */
-acpi_UserNotify("Resume", ACPI_ROOT_OBJECT, state);
-
 mtx_unlock(&Giant);
 
 /* Warm up timecounter again */
@@ -2599,6 +2606,14 @@ acpi_EnterSleepState(struct acpi_softc *
 thread_unlock(curthread);
 #endif
 
+/* Allow another sleep request after a while. */
+if (state != ACPI_STATE_S5)
+   timeout(acpi_sleep_enable, sc, hz * ACPI_MINIMUM_AWAKETIME);
+
+/* Run /etc/rc.resume after we are back. */
+if (devctl_process_running())
+   acpi_UserNotify("Resume", ACPI_ROOT_OBJECT, state);
+
 return_ACPI_STATUS (status);
 }
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r190340 - head/sys/dev/acpica

2009-03-23 Thread Jung-uk Kim
Author: jkim
Date: Mon Mar 23 22:12:33 2009
New Revision: 190340
URL: http://svn.freebsd.org/changeset/base/190340

Log:
  Add a function to reset system time after resuming, which will be used
  by amd64 shortly.  It can be turned off by setting "debug.acpi.reset_clock"
  tunable to zero.

Modified:
  head/sys/dev/acpica/acpi.c
  head/sys/dev/acpica/acpivar.h

Modified: head/sys/dev/acpica/acpi.c
==
--- head/sys/dev/acpica/acpi.c  Mon Mar 23 22:06:09 2009(r190339)
+++ head/sys/dev/acpica/acpi.c  Mon Mar 23 22:12:33 2009(r190340)
@@ -254,6 +254,12 @@ TUNABLE_INT("debug.acpi.do_powerstate", 
 SYSCTL_INT(_debug_acpi, OID_AUTO, do_powerstate, CTLFLAG_RW,
 &acpi_do_powerstate, 1, "Turn off devices when suspending.");
 
+/* Reset system clock while resuming.  XXX Remove once tested. */
+static int acpi_reset_clock = 1;
+TUNABLE_INT("debug.acpi.reset_clock", &acpi_reset_clock);
+SYSCTL_INT(_debug_acpi, OID_AUTO, reset_clock, CTLFLAG_RW,
+&acpi_reset_clock, 1, "Reset system clock while resuming.");
+
 /* Allow users to override quirks. */
 TUNABLE_INT("debug.acpi.quirks", &acpi_quirks);
 
@@ -2596,10 +2602,6 @@ acpi_EnterSleepState(struct acpi_softc *
 
 mtx_unlock(&Giant);
 
-/* Warm up timecounter again */
-(void)timecounter->tc_get_timecount(timecounter);
-(void)timecounter->tc_get_timecount(timecounter);
-
 #ifdef SMP
 thread_lock(curthread);
 sched_unbind(curthread);
@@ -2617,6 +2619,21 @@ acpi_EnterSleepState(struct acpi_softc *
 return_ACPI_STATUS (status);
 }
 
+void
+acpi_resync_clock(struct acpi_softc *sc)
+{
+
+if (!acpi_reset_clock)
+   return;
+
+/*
+ * Warm up timecounter again and reset system clock.
+ */
+(void)timecounter->tc_get_timecount(timecounter);
+(void)timecounter->tc_get_timecount(timecounter);
+inittodr(time_second + sc->acpi_sleep_delay);
+}
+
 /* Initialize a device's wake GPE. */
 int
 acpi_wake_init(device_t dev, int type)

Modified: head/sys/dev/acpica/acpivar.h
==
--- head/sys/dev/acpica/acpivar.h   Mon Mar 23 22:06:09 2009
(r190339)
+++ head/sys/dev/acpica/acpivar.h   Mon Mar 23 22:12:33 2009
(r190340)
@@ -330,6 +330,7 @@ ACPI_STATUS acpi_SetIntrModel(int model)
 intacpi_ReqSleepState(struct acpi_softc *sc, int state);
 intacpi_AckSleepState(struct apm_clone_data *clone, int error);
 ACPI_STATUSacpi_SetSleepState(struct acpi_softc *sc, int state);
+void   acpi_resync_clock(struct acpi_softc *sc);
 intacpi_wake_init(device_t dev, int type);
 intacpi_wake_set_enable(device_t dev, int enable);
 intacpi_parse_prw(ACPI_HANDLE h, struct acpi_prw_data *prw);
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r190341 - head/sys/amd64/acpica

2009-03-23 Thread Jung-uk Kim
Author: jkim
Date: Mon Mar 23 22:35:30 2009
New Revision: 190341
URL: http://svn.freebsd.org/changeset/base/190341

Log:
  - Clean up suspend/resume code for amd64.
  - Call acpi_resync_clock() to reset system time before hardclock is ready
  to tick.  Note we assume the current timecounter hardware and RTC are
  already available for read operation.
  
  Tested by:mav

Modified:
  head/sys/amd64/acpica/acpi_machdep.c
  head/sys/amd64/acpica/acpi_wakecode.S
  head/sys/amd64/acpica/acpi_wakeup.c
  head/sys/amd64/acpica/genwakecode.sh

Modified: head/sys/amd64/acpica/acpi_machdep.c
==
--- head/sys/amd64/acpica/acpi_machdep.cMon Mar 23 22:12:33 2009
(r190340)
+++ head/sys/amd64/acpica/acpi_machdep.cMon Mar 23 22:35:30 2009
(r190341)
@@ -40,11 +40,12 @@ __FBSDID("$FreeBSD$");
 
 SYSCTL_DECL(_debug_acpi);
 
-uint32_t acpi_resume_beep;
+int acpi_resume_beep;
 TUNABLE_INT("debug.acpi.resume_beep", &acpi_resume_beep);
-SYSCTL_UINT(_debug_acpi, OID_AUTO, resume_beep, CTLFLAG_RW, &acpi_resume_beep,
+SYSCTL_INT(_debug_acpi, OID_AUTO, resume_beep, CTLFLAG_RW, &acpi_resume_beep,
 0, "Beep the PC speaker when resuming");
-uint32_t acpi_reset_video;
+
+int acpi_reset_video;
 TUNABLE_INT("hw.acpi.reset_video", &acpi_reset_video);
 
 static int intr_model = ACPI_INTR_PIC;

Modified: head/sys/amd64/acpica/acpi_wakecode.S
==
--- head/sys/amd64/acpica/acpi_wakecode.S   Mon Mar 23 22:12:33 2009
(r190340)
+++ head/sys/amd64/acpica/acpi_wakecode.S   Mon Mar 23 22:35:30 2009
(r190341)
@@ -2,7 +2,7 @@
  * Copyright (c) 2001 Takanori Watanabe 
  * Copyright (c) 2001 Mitsuru IWASAKI 
  * Copyright (c) 2003 Peter Wemm
- * Copyright (c) 2008 Jung-uk Kim 
+ * Copyright (c) 2008-2009 Jung-uk Kim 
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -66,12 +66,14 @@ wakeup_start:
mov %ax, %ds/* are offsets rather than selectors */
mov %ax, %ss
movw$PAGE_SIZE - 8, %sp
-   pushw   $0
+   xorw%ax, %ax
+   pushw   %ax
popfw
 
/* To debug resume hangs, beep the speaker if the user requested. */
-   cmpw$0, resume_beep - wakeup_start
-   je  1f
+   testb   $~0, resume_beep - wakeup_start
+   jz  1f
+   movb$0, resume_beep - wakeup_start
movb$0xc0, %al
outb%al, $0x42
movb$0x04, %al
@@ -79,22 +81,16 @@ wakeup_start:
inb $0x61, %al
orb $0x3, %al
outb%al, $0x61
-   movw$0, resume_beep - wakeup_start
 1:
 
/* Re-initialize video BIOS if the reset_video tunable is set. */
-   cmpw$0, reset_video - wakeup_start
-   je  1f
+   testb   $~0, reset_video - wakeup_start
+   jz  1f
+   movb$0, reset_video - wakeup_start
lcall   $0xc000, $3
-   movw$0, reset_video - wakeup_start
 
-   /*
-* Set up segment registers for real mode again in case the
-* previous BIOS call clobbers them.
-*/
-   mov %cs, %ax
-   mov %ax, %ds
-   mov %ax, %ss
+   /* Re-start in case the previous BIOS call clobbers them. */
+   jmp wakeup_start
 1:
 
/*
@@ -204,6 +200,7 @@ wakeup_sw64:
 * space. Remember that jmp is relative and that we've been relocated,
 * so use an indirect jump.
 */
+   ALIGN_TEXT
.code64
 wakeup_64:
mov $bootdata64 - bootgdt, %eax
@@ -215,6 +212,13 @@ wakeup_64:
movqwakeup_retaddr - wakeup_start(%rbx), %rax
jmp *%rax
 
+   .data
+
+resume_beep:
+   .byte   0
+reset_video:
+   .byte   0
+
ALIGN_DATA
 bootgdt:
.long   0x
@@ -245,10 +249,6 @@ bootgdtdesc:
.long   bootgdt - wakeup_start  /* Offset plus %ds << 4 */
 
ALIGN_DATA
-resume_beep:
-   .long   0
-reset_video:
-   .long   0
 wakeup_retaddr:
.quad   0
 wakeup_kpml4:

Modified: head/sys/amd64/acpica/acpi_wakeup.c
==
--- head/sys/amd64/acpica/acpi_wakeup.c Mon Mar 23 22:12:33 2009
(r190340)
+++ head/sys/amd64/acpica/acpi_wakeup.c Mon Mar 23 22:35:30 2009
(r190341)
@@ -37,7 +37,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
 #include 
 
 #include 
@@ -67,8 +66,8 @@ CTASSERT(sizeof(wakecode) < PAGE_SIZE - 
 #error this file needs sys/cdefs.h as a prerequisite
 #endif
 
-extern uint32_tacpi_resume_beep;
-extern uint32_tacpi_reset_video;
+extern int acpi_resume_beep;
+extern int acpi_reset_video;
 
 #ifdef SMP
 extern struct xpcb *stopxpcbs;
@@ -280,8 +279,8 @@ acpi_sleep_machdep(struct acpi_softc *sc
 

svn commit: r190342 - in head/lib/libc/db: btree mpool

2009-03-23 Thread Xin LI
Author: delphij
Date: Mon Mar 23 23:22:09 2009
New Revision: 190342
URL: http://svn.freebsd.org/changeset/base/190342

Log:
  use more proper format string.
  
  Obtained from:NetBSD via OpenBSD

Modified:
  head/lib/libc/db/btree/bt_debug.c
  head/lib/libc/db/mpool/mpool.c

Modified: head/lib/libc/db/btree/bt_debug.c
==
--- head/lib/libc/db/btree/bt_debug.c   Mon Mar 23 22:35:30 2009
(r190341)
+++ head/lib/libc/db/btree/bt_debug.c   Mon Mar 23 23:22:09 2009
(r190342)
@@ -61,7 +61,7 @@ __bt_dump(DB *dbp)
char *sep;
 
t = dbp->internal;
-   (void)fprintf(stderr, "%s: pgsz %d",
+   (void)fprintf(stderr, "%s: pgsz %u",
F_ISSET(t, B_INMEM) ? "memory" : "disk", t->bt_psize);
if (F_ISSET(t, R_RECNO))
(void)fprintf(stderr, " keys %u", t->bt_nrecs);
@@ -157,7 +157,7 @@ __bt_dpage(PAGE *h)
indx_t cur, top;
char *sep;
 
-   (void)fprintf(stderr, "page %d: (", h->pgno);
+   (void)fprintf(stderr, "page %u: (", h->pgno);
 #undef X
 #defineX(flag, name) \
if (h->flags & flag) { \
@@ -174,7 +174,7 @@ __bt_dpage(PAGE *h)
(void)fprintf(stderr, ")\n");
 #undef X
 
-   (void)fprintf(stderr, "\tprev %2d next %2d", h->prevpg, h->nextpg);
+   (void)fprintf(stderr, "\tprev %2u next %2u", h->prevpg, h->nextpg);
if (h->flags & P_OVERFLOW)
return;
 
@@ -292,27 +292,27 @@ __bt_stat(DB *dbp)
(void)mpool_put(t->bt_mp, h, 0);
}
 
-   (void)fprintf(stderr, "%d level%s with %ld keys",
+   (void)fprintf(stderr, "%d level%s with %lu keys",
levels, levels == 1 ? "" : "s", nkeys);
if (F_ISSET(t, R_RECNO))
-   (void)fprintf(stderr, " (%d header count)", t->bt_nrecs);
+   (void)fprintf(stderr, " (%u header count)", t->bt_nrecs);
(void)fprintf(stderr,
-   "\n%u pages (leaf %d, internal %d, overflow %d)\n",
+   "\n%u pages (leaf %u, internal %u, overflow %u)\n",
pinternal + pleaf + pcont, pleaf, pinternal, pcont);
-   (void)fprintf(stderr, "%ld cache hits, %ld cache misses\n",
+   (void)fprintf(stderr, "%lu cache hits, %lu cache misses\n",
bt_cache_hit, bt_cache_miss);
(void)fprintf(stderr, "%lu splits (%lu root splits, %lu sort splits)\n",
bt_split, bt_rootsplit, bt_sortsplit);
pleaf *= t->bt_psize - BTDATAOFF;
if (pleaf)
(void)fprintf(stderr,
-   "%.0f%% leaf fill (%ld bytes used, %ld bytes free)\n",
+   "%.0f%% leaf fill (%lu bytes used, %lu bytes free)\n",
((double)(pleaf - lfree) / pleaf) * 100,
pleaf - lfree, lfree);
pinternal *= t->bt_psize - BTDATAOFF;
if (pinternal)
(void)fprintf(stderr,
-   "%.0f%% internal fill (%ld bytes used, %ld bytes free\n",
+   "%.0f%% internal fill (%lu bytes used, %lu bytes free\n",
((double)(pinternal - ifree) / pinternal) * 100,
pinternal - ifree, ifree);
if (bt_pfxsaved)

Modified: head/lib/libc/db/mpool/mpool.c
==
--- head/lib/libc/db/mpool/mpool.c  Mon Mar 23 22:35:30 2009
(r190341)
+++ head/lib/libc/db/mpool/mpool.c  Mon Mar 23 23:22:09 2009
(r190342)
@@ -406,9 +406,9 @@ mpool_stat(MPOOL *mp)
int cnt;
char *sep;
 
-   (void)fprintf(stderr, "%u pages in the file\n", mp->npages);
+   (void)fprintf(stderr, "%lu pages in the file\n", mp->npages);
(void)fprintf(stderr,
-   "page size %lu, cacheing %u pages of %u page max cache\n",
+   "page size %lu, cacheing %lu pages of %lu page max cache\n",
mp->pagesize, mp->curcache, mp->maxcache);
(void)fprintf(stderr, "%lu page puts, %lu page gets, %lu page new\n",
mp->pageput, mp->pageget, mp->pagenew);
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r190343 - stable/7/lib/libelf

2009-03-23 Thread David E. O'Brien
Author: obrien
Date: Mon Mar 23 23:32:20 2009
New Revision: 190343
URL: http://svn.freebsd.org/changeset/base/190343

Log:
  MFC: r189721: don't need to set symbol, default value OK

Modified:
  stable/7/lib/libelf/Makefile

Modified: stable/7/lib/libelf/Makefile
==
--- stable/7/lib/libelf/MakefileMon Mar 23 23:22:09 2009
(r190342)
+++ stable/7/lib/libelf/MakefileMon Mar 23 23:32:20 2009
(r190343)
@@ -148,7 +148,7 @@ VERSION_MAP=${.CURDIR}/Version.map
 
 LIBELF_TEST_HOOKS?=1
 .if defined(LIBELF_TEST_HOOKS) && (${LIBELF_TEST_HOOKS} > 0)
-CFLAGS+=   -DLIBELF_TEST_HOOKS=1
+CFLAGS+= -DLIBELF_TEST_HOOKS
 .endif
 
 libelf_convert.c:  elf_types.m4 libelf_convert.m4
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r190345 - stable/7/usr.bin/make

2009-03-23 Thread David E. O'Brien
Author: obrien
Date: Tue Mar 24 00:07:17 2009
New Revision: 190345
URL: http://svn.freebsd.org/changeset/base/190345

Log:
  MFC:
  r187475: Remove inlining of functions that are used mostly in different
 object files.  This lets use to remove NO_WERROR.
  r186558: Consistently use Var_SetGlobal().
  r186713: Add the -Q be-quiet flag for parallel jobs.
  r186279: Exit with error code 2 when run with -k (continue if errors)
 and build failed.
  r186559: Add the ability to tweak the token output before targets in job mode.
  r181021: Add POSIX -p flag to make(1).
  r186502: Clarify the behaviour of conditionals when dealing with comparisons.

Modified:
  stable/7/usr.bin/make/Makefile
  stable/7/usr.bin/make/buf.c
  stable/7/usr.bin/make/for.c
  stable/7/usr.bin/make/globals.h
  stable/7/usr.bin/make/job.c
  stable/7/usr.bin/make/job.h
  stable/7/usr.bin/make/main.c
  stable/7/usr.bin/make/make.1
  stable/7/usr.bin/make/make.c
  stable/7/usr.bin/make/make.h
  stable/7/usr.bin/make/parse.c
  stable/7/usr.bin/make/suff.c
  stable/7/usr.bin/make/var.c

Modified: stable/7/usr.bin/make/Makefile
==
--- stable/7/usr.bin/make/Makefile  Mon Mar 23 23:43:07 2009
(r190344)
+++ stable/7/usr.bin/make/Makefile  Tue Mar 24 00:07:17 2009
(r190345)
@@ -8,7 +8,6 @@ SRCS=   arch.c buf.c cond.c dir.c for.c ha
lst.c main.c make.c parse.c proc.c shell.c str.c suff.c targ.c  \
util.c var.c
 
-NO_WERROR=
 WARNS?=6
 NO_SHARED?=YES
 
@@ -52,7 +51,7 @@ hash:
  echo ' * DO NOT EDIT' ;   \
  echo ' * $$''FreeBSD$$' ; \
  echo -n ' * auto-generated from ' ;   \
- sed -nEe '/\$$FreeBSD/s/^.*\$$(.*)\$$.*$$/\1/p'   \
+ sed -nEe '/\$$FreeBSD$/\1/p'  \
${.CURDIR}/parse.c ;\
  echo ' * DO NOT EDIT' ;   \
  echo ' */' ;  \

Modified: stable/7/usr.bin/make/buf.c
==
--- stable/7/usr.bin/make/buf.c Mon Mar 23 23:43:07 2009(r190344)
+++ stable/7/usr.bin/make/buf.c Tue Mar 24 00:07:17 2009(r190345)
@@ -58,7 +58,7 @@ __FBSDID("$FreeBSD$");
  * Returns the number of bytes in the buffer.  Doesn't include the
  * null-terminating byte.
  */
-inline size_t
+size_t
 Buf_Size(const Buffer *buf)
 {
 
@@ -70,7 +70,7 @@ Buf_Size(const Buffer *buf)
  *  
  * @note Adding data to the Buffer object may invalidate the reference.
  */
-inline char *
+char *
 Buf_Data(const Buffer *bp)
 {
 
@@ -98,7 +98,7 @@ BufExpand(Buffer *bp, size_t nb)
 /**
  * Add a single byte to the buffer.
  */
-inline void
+void
 Buf_AddByte(Buffer *bp, Byte byte)
 {
 

Modified: stable/7/usr.bin/make/for.c
==
--- stable/7/usr.bin/make/for.c Mon Mar 23 23:43:07 2009(r190344)
+++ stable/7/usr.bin/make/for.c Tue Mar 24 00:07:17 2009(r190345)
@@ -254,7 +254,7 @@ For_Run(int lineno)
 
LST_FOREACH(ln, &values) {
val = Lst_Datum(ln);
-   Var_Set(var, val, VAR_GLOBAL);
+   Var_SetGlobal(var, val);
 
DEBUGF(FOR, ("--- %s = %s\n", var, val));
str = Buf_Peel(Var_SubstOnly(var, Buf_Data(buf), FALSE));

Modified: stable/7/usr.bin/make/globals.h
==
--- stable/7/usr.bin/make/globals.h Mon Mar 23 23:43:07 2009
(r190344)
+++ stable/7/usr.bin/make/globals.h Tue Mar 24 00:07:17 2009
(r190345)
@@ -70,11 +70,13 @@ extern struct Path parseIncPath;
 extern struct Path sysIncPath;
 
 extern int jobLimit;   /* -j argument: maximum number of jobs */
+extern int makeErrors; /* Number of targets not remade due to errors */
 extern Boolean jobsRunning;/* True if jobs are running */
 extern Boolean compatMake; /* True if we are make compatible */
 extern Boolean ignoreErrors;   /* True if should ignore all errors */
 extern Boolean beSilent;   /* True if should print no commands */
 extern Boolean beVerbose;  /* True if should print extra cruft */
+extern Boolean beQuiet;/* True if want quiet headers with -j */
 extern Boolean noExecute;  /* True if should execute nothing */
 extern Boolean allPrecious;/* True if every target is precious */
 extern Boolean is_posix;   /* .POSIX target seen */

Modified: stable/7/usr.bin/make/job.c
==
--- stable/7/usr.bin/make/job.c Mon Mar 23 23:43:07 2009(r190344)
+++ stable/7/usr.bin/make/job.c Tue Mar 24 00:07:17 2009(r190345)
@@ -263,7 +2

svn commit: r190346 - head/sys/dev/iwn

2009-03-23 Thread Juli Mallett
Author: jmallett
Date: Tue Mar 24 00:08:58 2009
New Revision: 190346
URL: http://svn.freebsd.org/changeset/base/190346

Log:
  Remove gratuitous unlock in error case.
  
  Reviewed by:  sam

Modified:
  head/sys/dev/iwn/if_iwn.c

Modified: head/sys/dev/iwn/if_iwn.c
==
--- head/sys/dev/iwn/if_iwn.c   Tue Mar 24 00:07:17 2009(r190345)
+++ head/sys/dev/iwn/if_iwn.c   Tue Mar 24 00:08:58 2009(r190346)
@@ -2134,7 +2134,6 @@ iwn_start_locked(struct ifnet *ifp)
if (iwn_tx_data(sc, m, ni, txq) != 0) {
ifp->if_oerrors++;
ieee80211_free_node(ni);
-   IWN_UNLOCK(sc);
break;
}
}
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r190347 - head/sys/dev/ath

2009-03-23 Thread Sam Leffler
Author: sam
Date: Tue Mar 24 00:09:35 2009
New Revision: 190347
URL: http://svn.freebsd.org/changeset/base/190347

Log:
  fix build w/ AH_DEBUG

Modified:
  head/sys/dev/ath/ah_osdep.c

Modified: head/sys/dev/ath/ah_osdep.c
==
--- head/sys/dev/ath/ah_osdep.c Tue Mar 24 00:08:58 2009(r190346)
+++ head/sys/dev/ath/ah_osdep.c Tue Mar 24 00:09:35 2009(r190347)
@@ -71,12 +71,7 @@ extern   void ath_hal_assert_failed(const 
int lineno, const char* msg);
 #endif
 #ifdef AH_DEBUG
-#if HAL_ABI_VERSION >= 0x08090101
 extern void HALDEBUG(struct ath_hal *ah, u_int mask, const char* fmt, ...);
-#else
-extern void HALDEBUG(struct ath_hal *ah, const char* fmt, ...);
-extern void HALDEBUGn(struct ath_hal *ah, u_int level, const char* fmt, ...);
-#endif
 #endif /* AH_DEBUG */
 
 /* NB: put this here instead of the driver to avoid circular references */
@@ -140,7 +135,6 @@ ath_hal_ether_sprintf(const u_int8_t *ma
 }
 
 #ifdef AH_DEBUG
-#if HAL_ABI_VERSION >= 0x08090101
 void
 HALDEBUG(struct ath_hal *ah, u_int mask, const char* fmt, ...)
 {
@@ -151,29 +145,6 @@ HALDEBUG(struct ath_hal *ah, u_int mask,
va_end(ap);
}
 }
-#else
-void
-HALDEBUG(struct ath_hal *ah, const char* fmt, ...)
-{
-   if (ath_hal_debug) {
-   __va_list ap;
-   va_start(ap, fmt);
-   ath_hal_vprintf(ah, fmt, ap);
-   va_end(ap);
-   }
-}
-
-void
-HALDEBUGn(struct ath_hal *ah, u_int level, const char* fmt, ...)
-{
-   if (ath_hal_debug >= level) {
-   __va_list ap;
-   va_start(ap, fmt);
-   ath_hal_vprintf(ah, fmt, ap);
-   va_end(ap);
-   }
-}
-#endif
 #endif /* AH_DEBUG */
 
 #ifdef AH_DEBUG_ALQ
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r190344 - head/lib/libc/db/btree

2009-03-23 Thread Xin LI
Author: delphij
Date: Mon Mar 23 23:43:07 2009
New Revision: 190344
URL: http://svn.freebsd.org/changeset/base/190344

Log:
  Save errno before calling _close(), which may clear it.
  
  Obtained from:OpenBSD

Modified:
  head/lib/libc/db/btree/bt_open.c

Modified: head/lib/libc/db/btree/bt_open.c
==
--- head/lib/libc/db/btree/bt_open.cMon Mar 23 23:32:20 2009
(r190343)
+++ head/lib/libc/db/btree/bt_open.cMon Mar 23 23:43:07 2009
(r190344)
@@ -96,7 +96,7 @@ __bt_open(const char *fname, int flags, 
DB *dbp;
pgno_t ncache;
ssize_t nr;
-   int machine_lorder;
+   int machine_lorder, saved_errno;
 
t = NULL;
 
@@ -327,13 +327,15 @@ einval:   errno = EINVAL;
 eftype:errno = EFTYPE;
goto err;
 
-err:   if (t) {
+err:   saved_errno = errno;
+   if (t) {
if (t->bt_dbp)
free(t->bt_dbp);
if (t->bt_fd != -1)
(void)_close(t->bt_fd);
free(t);
}
+   errno = saved_errno;
return (NULL);
 }
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r190348 - stable/7/include

2009-03-23 Thread David E. O'Brien
Author: obrien
Date: Tue Mar 24 00:30:06 2009
New Revision: 190348
URL: http://svn.freebsd.org/changeset/base/190348

Log:
  MFC: r187724 / r187969: unsplit _PATH_SYSPATH & _PATH_STDPATH.

Modified:
  stable/7/include/paths.h

Modified: stable/7/include/paths.h
==
--- stable/7/include/paths.hTue Mar 24 00:09:35 2009(r190347)
+++ stable/7/include/paths.hTue Mar 24 00:30:06 2009(r190348)
@@ -42,11 +42,9 @@
 /* Default search path. */
 #define_PATH_DEFPATH   "/usr/bin:/bin"
 /* All standard utilities path. */
-#define_PATH_STDPATH \
-   "/usr/bin:/bin:/usr/sbin:/sbin:"
-/* Locate system binaries */
-#define _PATH_SYSPATH  \
-   "/sbin:/usr/sbin"
+#define_PATH_STDPATH   "/usr/bin:/bin:/usr/sbin:/sbin:"
+/* Locate system binaries. */
+#define_PATH_SYSPATH   "/sbin:/usr/sbin"
 
 #define_PATH_AUTHCONF  "/etc/auth.conf"
 #define_PATH_BSHELL"/bin/sh"
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r190349 - in stable/7/usr.sbin/crunch: crunchgen crunchide

2009-03-23 Thread David E. O'Brien
Author: obrien
Date: Tue Mar 24 00:34:55 2009
New Revision: 190349
URL: http://svn.freebsd.org/changeset/base/190349

Log:
  MFC:
  r173412: Cleanup of userland __P use.
  r187943: Run with -B and just .POSIX.
  r173067: Include  for the right prototype for exit(3).
  r173065: Set the program name if the crunched program is selected
 through argv[1] to mimic crt0 behaviour.

Modified:
  stable/7/usr.sbin/crunch/crunchgen/crunched_main.c
  stable/7/usr.sbin/crunch/crunchgen/crunchgen.c
  stable/7/usr.sbin/crunch/crunchide/crunchide.c

Modified: stable/7/usr.sbin/crunch/crunchgen/crunched_main.c
==
--- stable/7/usr.sbin/crunch/crunchgen/crunched_main.c  Tue Mar 24 00:30:06 
2009(r190348)
+++ stable/7/usr.sbin/crunch/crunchgen/crunched_main.c  Tue Mar 24 00:34:55 
2009(r190349)
@@ -34,6 +34,7 @@
  * the crunched binary without creating all the links.
  */
 #include 
+#include 
 #include 
 
 struct stub {
@@ -41,6 +42,7 @@ struct stub {
 int (*f)();
 };
 
+extern char *__progname;
 extern struct stub entry_points[];
 
 int main(int argc, char **argv, char **envp)
@@ -83,12 +85,16 @@ int crunched_here(char *path)
 
 int crunched_main(int argc, char **argv, char **envp)
 {
+char *slash;
 struct stub *ep;
 int columns, len;
 
 if(argc <= 1)
crunched_usage();
 
+slash = strrchr(argv[1], '/');
+__progname = slash? slash+1 : argv[1];
+
 return main(--argc, ++argv, envp);
 }
 

Modified: stable/7/usr.sbin/crunch/crunchgen/crunchgen.c
==
--- stable/7/usr.sbin/crunch/crunchgen/crunchgen.c  Tue Mar 24 00:30:06 
2009(r190348)
+++ stable/7/usr.sbin/crunch/crunchgen/crunchgen.c  Tue Mar 24 00:34:55 
2009(r190349)
@@ -709,12 +709,13 @@ void fillin_program_objs(prog_t *p, char
if (outhdrname[0] != '\0')
fprintf(f, ".include \"%s\"\n", outhdrname);
fprintf(f, ".include \"%s\"\n", path);
+   fprintf(f, ".POSIX:\n");
if (buildopts) {
fprintf(f, "BUILDOPTS+=");
output_strlst(f, buildopts);
}
-   fprintf(f, ".if defined(PROG) && !defined(%s)\n", objvar);
-   fprintf(f, "%s=${PROG}.o\n", objvar);
+   fprintf(f, ".if defined(PROG)\n");
+   fprintf(f, "%s?=${PROG}.o\n", objvar);
fprintf(f, ".endif\n");
fprintf(f, "loop:\...@echo 'OBJS= '${%s}\n", objvar);
 
@@ -727,7 +728,7 @@ void fillin_program_objs(prog_t *p, char
 
fclose(f);
 
-   snprintf(line, MAXLINELEN, "cd %s && make -f %s crunchgen_objs",
+   snprintf(line, MAXLINELEN, "cd %s && make -f %s -B crunchgen_objs",
p->srcdir, tempfname);
if ((f = popen(line, "r")) == NULL) {
warn("submake pipe");

Modified: stable/7/usr.sbin/crunch/crunchide/crunchide.c
==
--- stable/7/usr.sbin/crunch/crunchide/crunchide.c  Tue Mar 24 00:30:06 
2009(r190348)
+++ stable/7/usr.sbin/crunch/crunchide/crunchide.c  Tue Mar 24 00:34:55 
2009(r190349)
@@ -87,7 +87,7 @@ int hide_syms(const char *filename);
 
 int verbose;
 
-int main __P((int, char *[]));
+int main(int, char *[]);
 
 int main(argc, argv)
 int argc;
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r190350 - in stable/7/sbin: fsck fsck_ffs

2009-03-23 Thread David E. O'Brien
Author: obrien
Date: Tue Mar 24 00:43:12 2009
New Revision: 190350
URL: http://svn.freebsd.org/changeset/base/190350

Log:
  MFC: r187931: Add the '-C' "check clean" flag.

Modified:
  stable/7/sbin/fsck/fsck.8
  stable/7/sbin/fsck/fsck.c
  stable/7/sbin/fsck/fsutil.h
  stable/7/sbin/fsck_ffs/fsck.h
  stable/7/sbin/fsck_ffs/fsck_ffs.8
  stable/7/sbin/fsck_ffs/main.c
  stable/7/sbin/fsck_ffs/setup.c

Modified: stable/7/sbin/fsck/fsck.8
==
--- stable/7/sbin/fsck/fsck.8   Tue Mar 24 00:34:55 2009(r190349)
+++ stable/7/sbin/fsck/fsck.8   Tue Mar 24 00:43:12 2009(r190350)
@@ -29,7 +29,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd April 25, 2001
+.Dd January 25, 2009
 .Dt FSCK 8
 .Os
 .Sh NAME
@@ -37,7 +37,7 @@
 .Nd file system consistency check and interactive repair
 .Sh SYNOPSIS
 .Nm
-.Op Fl dfnpvy
+.Op Fl Cdfnpvy
 .Op Fl B | F
 .Op Fl T Ar fstype : Ns Ar fsoptions
 .Op Fl t Ar fstype
@@ -112,6 +112,11 @@ to be the partition and slice designator
 .Pp
 The options are as follows:
 .Bl -tag -width indent
+.It Fl C
+Check if the
+.Dq clean
+flag is set in the superblock and skip file system checks if file system was
+properly dismounted and marked clean.
 .It Fl d
 Debugging mode.
 Just print the commands without executing them.

Modified: stable/7/sbin/fsck/fsck.c
==
--- stable/7/sbin/fsck/fsck.c   Tue Mar 24 00:34:55 2009(r190349)
+++ stable/7/sbin/fsck/fsck.c   Tue Mar 24 00:43:12 2009(r190350)
@@ -103,7 +103,7 @@ main(int argc, char *argv[])
TAILQ_INIT(&selhead);
TAILQ_INIT(&opthead);
 
-   while ((i = getopt(argc, argv, "BdvpfFnyl:t:T:")) != -1)
+   while ((i = getopt(argc, argv, "BCdvpfFnyl:t:T:")) != -1)
switch (i) {
case 'B':
if (flags & CHECK_BACKGRD)
@@ -128,6 +128,9 @@ main(int argc, char *argv[])
case 'p':
flags |= CHECK_PREEN;
/*FALLTHROUGH*/
+   case 'C':
+   flags |= CHECK_CLEAN;
+   /*FALLTHROUGH*/
case 'n':
case 'y':
globopt[1] = i;
@@ -566,7 +569,7 @@ static void
 usage(void)
 {
static const char common[] =
-   "[-dfnpvy] [-B | -F] [-T fstype:fsoptions] [-t fstype]";
+   "[-Cdfnpvy] [-B | -F] [-T fstype:fsoptions] [-t fstype]";
 
(void)fprintf(stderr, "usage: %s %s [special | node] ...\n",
getprogname(), common);

Modified: stable/7/sbin/fsck/fsutil.h
==
--- stable/7/sbin/fsck/fsutil.h Tue Mar 24 00:34:55 2009(r190349)
+++ stable/7/sbin/fsck/fsutil.h Tue Mar 24 00:43:12 2009(r190350)
@@ -48,6 +48,7 @@ char *estrdup(const char *);
 #defineCHECK_DEBUG 0x0004
 #defineCHECK_BACKGRD   0x0008
 #defineDO_BACKGRD  0x0010
+#defineCHECK_CLEAN 0x0020
 
 struct fstab;
 int checkfstab(int, int (*)(struct fstab *), 

Modified: stable/7/sbin/fsck_ffs/fsck.h
==
--- stable/7/sbin/fsck_ffs/fsck.h   Tue Mar 24 00:34:55 2009
(r190349)
+++ stable/7/sbin/fsck_ffs/fsck.h   Tue Mar 24 00:43:12 2009
(r190350)
@@ -271,6 +271,7 @@ int bkgrdflag;  /* use a snapshot to run
 intbflag;  /* location of alternate super block */
 intdebug;  /* output debugging info */
 char   damagedflag;/* run in damaged mode */
+char   ckclean;/* only do work if not cleanly unmounted */
 intcvtlevel;   /* convert to newer file system format */
 intbkgrdcheck; /* determine if background check is possible */
 intbkgrdsumadj;/* whether the kernel have ability to adjust 
superblock summary */

Modified: stable/7/sbin/fsck_ffs/fsck_ffs.8
==
--- stable/7/sbin/fsck_ffs/fsck_ffs.8   Tue Mar 24 00:34:55 2009
(r190349)
+++ stable/7/sbin/fsck_ffs/fsck_ffs.8   Tue Mar 24 00:43:12 2009
(r190350)
@@ -29,7 +29,7 @@
 .\"@(#)fsck.8  8.4 (Berkeley) 5/9/95
 .\" $FreeBSD$
 .\"
-.Dd January 20, 2009
+.Dd January 25, 2009
 .Dt FSCK_FFS 8
 .Os
 .Sh NAME
@@ -46,9 +46,9 @@
 .Ar ...
 .Sh DESCRIPTION
 The specified disk partitions and/or file systems are checked.
-In "preen" mode the clean flag of each file system's superblock is examined
-and only those file systems that
-are not marked clean are checked.
+In "preen" or "check clean" mode the clean flag of each file system's
+superblock is examined and only those file systems that are not marked clean
+are checked.
 File systems are marked clean when they are unmounted,
 when they have been mounted read

svn commit: r190351 - stable/7/gnu/usr.bin/grep

2009-03-23 Thread David E. O'Brien
Author: obrien
Date: Tue Mar 24 00:44:30 2009
New Revision: 190351
URL: http://svn.freebsd.org/changeset/base/190351

Log:
  MFC: r187907: For files not named on the command line, only the basename is
  compared to the exclude pattern.

Modified:
  stable/7/gnu/usr.bin/grep/savedir.c

Modified: stable/7/gnu/usr.bin/grep/savedir.c
==
--- stable/7/gnu/usr.bin/grep/savedir.c Tue Mar 24 00:43:12 2009
(r190350)
+++ stable/7/gnu/usr.bin/grep/savedir.c Tue Mar 24 00:44:30 2009
(r190351)
@@ -17,6 +17,9 @@
 
 /* Written by David MacKenzie . */
 
+#include 
+__FBSDID("$FreeBSD$");
+
 #if HAVE_CONFIG_H
 # include 
 #endif
@@ -137,10 +140,10 @@ savedir (const char *dir, off_t name_siz
  && !isdir1 (dir, dp->d_name))
{
  if (included_patterns
- && !excluded_filename (included_patterns, dp->d_name, 0))
+ && !excluded_filename (included_patterns, path, 0))
continue;
  if (excluded_patterns
- && excluded_filename (excluded_patterns, dp->d_name, 0))
+ && excluded_filename (excluded_patterns, path, 0))
continue;
}
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r190352 - stable/7/usr.bin/gprof

2009-03-23 Thread David E. O'Brien
Author: obrien
Date: Tue Mar 24 00:46:44 2009
New Revision: 190352
URL: http://svn.freebsd.org/changeset/base/190352

Log:
  MFC: r187116: If running with "-K" really do not information about symbols
  from the a.out argument.

Modified:
  stable/7/usr.bin/gprof/gprof.c

Modified: stable/7/usr.bin/gprof/gprof.c
==
--- stable/7/usr.bin/gprof/gprof.c  Tue Mar 24 00:44:30 2009
(r190351)
+++ stable/7/usr.bin/gprof/gprof.c  Tue Mar 24 00:46:44 2009
(r190352)
@@ -165,7 +165,7 @@ main(argc, argv)
 *  get information from the executable file.
 */
 if ((Kflag && kernel_getnfile(a_outname, &defaultEs) == -1) ||
-  (elf_getnfile(a_outname, &defaultEs) == -1 &&
+  (!Kflag && elf_getnfile(a_outname, &defaultEs) == -1 &&
   aout_getnfile(a_outname, &defaultEs) == -1))
errx(1, "%s: bad format", a_outname);
/*
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r190353 - stable/7/tools/tools/usb

2009-03-23 Thread David E. O'Brien
Author: obrien
Date: Tue Mar 24 01:18:35 2009
New Revision: 190353
URL: http://svn.freebsd.org/changeset/base/190353

Log:
  MFC: r187102 / r187107: Update fech URL.

Modified:
  stable/7/tools/tools/usb/   (props changed)
  stable/7/tools/tools/usb/print-usb-if-vids.sh

Modified: stable/7/tools/tools/usb/print-usb-if-vids.sh
==
--- stable/7/tools/tools/usb/print-usb-if-vids.sh   Tue Mar 24 00:46:44 
2009(r190352)
+++ stable/7/tools/tools/usb/print-usb-if-vids.sh   Tue Mar 24 01:18:35 
2009(r190353)
@@ -27,5 +27,5 @@
 # $FreeBSD$
 
 
-fetch -o /tmp/usb.if http://www.usb.org/app/pub/dump/comp_dump/
+fetch -o /tmp/usb.if http://www.usb.org/developers/tools/comp_dump/
 awk -F '|' '{ printf "%#06x\t%s\n", $1, $2 }' < /tmp/usb.if | sort
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r190354 - head/sys/netinet

2009-03-23 Thread Bruce M Simpson
Author: bms
Date: Tue Mar 24 01:22:12 2009
New Revision: 190354
URL: http://svn.freebsd.org/changeset/base/190354

Log:
  Don't call m_freem() after ip_output(), as it always consumes
  the mbuf chain provided to it.
  
  Found by: Pierre Guinoiseau

Modified:
  head/sys/netinet/igmp.c

Modified: head/sys/netinet/igmp.c
==
--- head/sys/netinet/igmp.c Tue Mar 24 01:18:35 2009(r190353)
+++ head/sys/netinet/igmp.c Tue Mar 24 01:22:12 2009(r190354)
@@ -3451,7 +3451,6 @@ igmp_intr(struct mbuf *m)
error = ip_output(m0, ipopts, NULL, 0, &imo, NULL);
if (error) {
CTR3(KTR_IGMPV3, "%s: ip_output(%p) = %d", __func__, m0, error);
-   m_freem(m0);
goto out;
}
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r190355 - stable/7/sbin/mount

2009-03-23 Thread David E. O'Brien
Author: obrien
Date: Tue Mar 24 01:31:42 2009
New Revision: 190355
URL: http://svn.freebsd.org/changeset/base/190355

Log:
  MFC:
  r189397: Add a -o mountprog parameter to mount which explicitly allows an
 alternative program to be used for mounting a file system.
  r187035/r187093/r187130: Don't overflow buffers when processing -o options.

Modified:
  stable/7/sbin/mount/   (props changed)
  stable/7/sbin/mount/mount.8
  stable/7/sbin/mount/mount.c

Modified: stable/7/sbin/mount/mount.8
==
--- stable/7/sbin/mount/mount.8 Tue Mar 24 01:22:12 2009(r190354)
+++ stable/7/sbin/mount/mount.8 Tue Mar 24 01:31:42 2009(r190355)
@@ -28,7 +28,7 @@
 .\" @(#)mount.88.8 (Berkeley) 6/16/94
 .\" $FreeBSD$
 .\"
-.Dd July 12, 2006
+.Dd March 11, 2008
 .Dt MOUNT 8
 .Os
 .Sh NAME
@@ -163,6 +163,15 @@ is run with the
 flag but without the
 .Fl l
 flag.
+.It Cm mountprog Ns = Ns Aq Ar program
+Force
+.Nm
+to use the specified program to mount the file system, instead of calling
+.Xr nmount 2
+directly.  For example:
+.Bd -literal
+mount -t foofs -o mountprog=/mydir/fooprog /dev/acd0 /mnt
+.Ed
 .It Cm multilabel
 Enable multi-label Mandatory Access Control, or MAC, on the specified file
 system.
@@ -335,14 +344,14 @@ For example, the
 .Nm
 command:
 .Bd -literal -offset indent
-mount -t unionfs -o -b /sys $HOME/sys
+mount -t cd9660 -o -e /dev/cd0 /cdrom
 .Ed
 .Pp
 causes
 .Nm
 to execute the equivalent of:
 .Bd -literal -offset indent
-/sbin/mount_unionfs -b /sys $HOME/sys
+/sbin/mount_cd9660 -e /dev/cd0 /cdrom
 .Ed
 .Pp
 Additional options specific to file system types
@@ -510,7 +519,6 @@ support for a particular file system mig
 .Xr mount_nwfs 8 ,
 .Xr mount_portalfs 8 ,
 .Xr mount_smbfs 8 ,
-.Xr mount_std 8 ,
 .Xr mount_udf 8 ,
 .Xr mount_unionfs 8 ,
 .Xr umount 8

Modified: stable/7/sbin/mount/mount.c
==
--- stable/7/sbin/mount/mount.c Tue Mar 24 01:22:12 2009(r190354)
+++ stable/7/sbin/mount/mount.c Tue Mar 24 01:31:42 2009(r190355)
@@ -31,16 +31,14 @@
 static const char copyright[] =
 "@(#) Copyright (c) 1980, 1989, 1993, 1994\n\
The Regents of the University of California.  All rights reserved.\n";
-#endif /* not lint */
-
-#ifndef lint
 #if 0
 static char sccsid[] = "@(#)mount.c8.25 (Berkeley) 5/8/95";
 #endif
-static const char rcsid[] =
-  "$FreeBSD$";
 #endif /* not lint */
 
+#include 
+__FBSDID("$FreeBSD$");
+
 #include 
 #include 
 #include 
@@ -70,12 +68,18 @@ static const char rcsid[] =
 
 int debug, fstab_style, verbose;
 
+struct cpa {
+   char**a;
+   ssize_t sz;
+   int c;
+};
+
 char   *catopt(char *, const char *);
 struct statfs *getmntpt(const char *);
 inthasopt(const char *, const char *);
 intismounted(struct fstab *, struct statfs *, int);
 intisremountable(const char *);
-void   mangle(char *, int *, char *[]);
+void   mangle(char *, struct cpa *);
 char   *update_options(char *, char *, int);
 intmountfs(const char *, const char *, const char *,
int, const char *, const char *);
@@ -125,6 +129,8 @@ remountable_fs_names[] = {
 static const char userquotaeq[] = "userquota=";
 static const char groupquotaeq[] = "groupquota=";
 
+static char *mountprog = NULL;
+
 static int
 use_mountprog(const char *vfstype)
 {
@@ -139,11 +145,14 @@ use_mountprog(const char *vfstype)
NULL
};
 
+   if (mountprog != NULL)
+   return (1);
+
for (i = 0; fs[i] != NULL; ++i) {
if (strcmp(vfstype, fs[i]) == 0)
return (1);
}
-   
+
return (0);
 }
 
@@ -161,8 +170,10 @@ exec_mountprog(const char *name, const c
/* Go find an executable. */
execvP(execname, _PATH_SYSPATH, argv);
if (errno == ENOENT) {
-   warn("exec %s not found in %s", execname,
-   _PATH_SYSPATH);
+   warn("exec %s not found", execname);
+   if (execname[0] != '/') {
+   warnx("in path: %s", _PATH_SYSPATH);
+   }
}
exit(1);
default:/* Parent. */
@@ -208,7 +219,7 @@ static void
 restart_mountd(void)
 {
struct pidfh *pfh;
-   pid_t mountdpid; 
+   pid_t mountdpid;
 
pfh = pidfile_open(_PATH_MOUNTDPID, 0600, &mountdpid);
if (pfh != NULL) {
@@ -300,7 +311,7 @@ main(int argc, char *argv[])
 
if ((init_flags & MNT_UPDATE) && (ro == 0))
options = catopt(options, "noro");
- 
+
rval = 0;
switch (argc) {
case 0:
@@ -497,14 +508,26 @@ hasopt(const char *mntopts, const char *
return (found);
 }
 
+static void
+append_arg(struct cpa *sa, char *arg)
+{
+   if (sa->c + 1

Re: svn commit: r190098 - in head/sys/sparc64: fhc sparc64

2009-03-23 Thread David O'Brien
On Sun, Mar 22, 2009 at 09:54:34AM +0100, Christoph Mallon wrote:
> I'm ok with 80 columns. But at the same time having tab stops every 8 
> spaces - I consider this silly.

You may be missing the beauty of KNF's statement continuations.  e.g.:

if (foo || bar || baz || other_really_long_variable ||
quix) {
panic("blah");
}

___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r190356 - stable/7/usr.sbin/burncd

2009-03-23 Thread David E. O'Brien
Author: obrien
Date: Tue Mar 24 01:35:58 2009
New Revision: 190356
URL: http://svn.freebsd.org/changeset/base/190356

Log:
  MFC: r186337/r186444/186784: burncd(8) doesn't handle signals and interrupting
  burncd during operation.  Add signal handling by doing a CDRIOCFLUSH ioctl
  to attempt to leave burner in a sane state when burning is interrupted with
  SIGHUP, SIGINT, SIGTERM, or in case an I/O error occurs during write.

Modified:
  stable/7/usr.sbin/burncd/   (props changed)
  stable/7/usr.sbin/burncd/Makefile
  stable/7/usr.sbin/burncd/burncd.c

Modified: stable/7/usr.sbin/burncd/Makefile
==
--- stable/7/usr.sbin/burncd/Makefile   Tue Mar 24 01:31:42 2009
(r190355)
+++ stable/7/usr.sbin/burncd/Makefile   Tue Mar 24 01:35:58 2009
(r190356)
@@ -3,6 +3,6 @@
 PROG=  burncd
 MAN=   burncd.8
 
-WARNS?=5
+WARNS?=6
 
 .include 

Modified: stable/7/usr.sbin/burncd/burncd.c
==
--- stable/7/usr.sbin/burncd/burncd.c   Tue Mar 24 01:31:42 2009
(r190355)
+++ stable/7/usr.sbin/burncd/burncd.c   Tue Mar 24 01:35:58 2009
(r190356)
@@ -29,6 +29,7 @@
  */
 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -57,7 +58,8 @@ struct track_info {
int addr;
 };
 static struct track_info tracks[100];
-static int global_fd_for_cleanup, quiet, verbose, saved_block_size, notracks;
+static int quiet, verbose, saved_block_size, notracks;
+static volatile sig_atomic_t global_fd_for_cleanup;
 
 void add_track(char *, int, int, int);
 void do_DAO(int fd, int, int);
@@ -67,6 +69,8 @@ int write_file(int fd, struct track_info
 int roundup_blocks(struct track_info *);
 void cue_ent(struct cdr_cue_entry *, int, int, int, int, int, int, int);
 void cleanup(int);
+void cleanup_flush(void);
+void cleanup_signal(int);
 void usage(void);
 
 int
@@ -157,6 +161,9 @@ main(int argc, char **argv)
 
global_fd_for_cleanup = fd;
err_set_exit(cleanup);
+   signal(SIGHUP, cleanup_signal);
+   signal(SIGINT, cleanup_signal);
+   signal(SIGTERM, cleanup_signal);
 
for (arg = 0; arg < argc; arg++) {
if (!strcasecmp(argv[arg], "fixate")) {
@@ -319,6 +326,10 @@ main(int argc, char **argv)
if (eject)
if (ioctl(fd, CDIOCEJECT) < 0)
err(EX_IOERR, "ioctl(CDIOCEJECT)");
+
+   signal(SIGHUP, SIG_DFL);
+   signal(SIGINT, SIG_DFL);
+   signal(SIGTERM, SIG_DFL);
close(fd);
exit(EX_OK);
 }
@@ -469,8 +480,10 @@ do_DAO(int fd, int test_write, int multi
err(EX_IOERR, "ioctl(CDRIOCSENDCUE)");
 
for (i = 0; i < notracks; i++) {
-   if (write_file(fd, &tracks[i]))
+   if (write_file(fd, &tracks[i])) {
+   cleanup_flush();
err(EX_IOERR, "write_file");
+   }
}
 
ioctl(fd, CDRIOCFLUSH);
@@ -499,8 +512,10 @@ do_TAO(int fd, int test_write, int preem
if (!quiet)
fprintf(stderr, "next writeable LBA %d\n",
tracks[i].addr);
-   if (write_file(fd, &tracks[i]))
+   if (write_file(fd, &tracks[i])) {
+   cleanup_flush();
err(EX_IOERR, "write_file");
+   }
if (ioctl(fd, CDRIOCFLUSH) < 0)
err(EX_IOERR, "ioctl(CDRIOCFLUSH)");
}
@@ -630,9 +645,11 @@ write_file(int fd, struct track_info *tr
track_info->block_size;
}
if ((res = write(fd, buf, count)) != count) {
-   if (res == -1)
-   fprintf(stderr, "\n%s\n", strerror(errno));
-   else
+   if (res == -1) {
+   fprintf(stderr, "\n");
+   close(track_info->file);
+   return errno;
+   } else
fprintf(stderr, "\nonly wrote %d of %jd"
" bytes\n", res, (intmax_t)count);
break;
@@ -693,6 +710,22 @@ cleanup(int dummy __unused)
 }
 
 void
+cleanup_flush(void)
+{
+   if (ioctl(global_fd_for_cleanup, CDRIOCFLUSH) < 0)
+   err(EX_IOERR, "ioctl(CDRIOCFLUSH)");
+}
+
+void
+cleanup_signal(int sig)
+{
+   signal(sig, SIG_IGN);
+   ioctl(global_fd_for_cleanup, CDRIOCFLUSH);
+   write(STDERR_FILENO, "\nAborted\n", 10);
+   _exit(EXIT_FAILURE);
+}
+
+void
 usage(void)
 {
fprintf(stderr,
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r189903 - in head/sys: amd64/acpica amd64/amd64 amd64/include conf dev/acpica i386/i386 kern sys

2009-03-23 Thread Ganbold

Jung-uk Kim wrote:

Author: jkim
Date: Tue Mar 17 00:48:11 2009
New Revision: 189903
URL: http://svn.freebsd.org/changeset/base/189903

Log:
  Initial suspend/resume support for amd64.
  
  This code is heavily inspired by Takanori Watanabe's experimental SMP patch

  for i386 and large portion was shamelessly cut and pasted from Peter Wemm's
  AP boot code.
  

Sorry for responding late, but is there any chance that
similar support can be committed for i386?

thanks,

Ganbold
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r190357 - in stable/7: gnu/usr.bin/grep include lib/libelf sbin/fsck sbin/fsck_ffs sbin/mount usr.bin/gprof usr.bin/make usr.sbin/crunch usr.sbin/sade usr.sbin/sysinstall

2009-03-23 Thread David E. O'Brien
Author: obrien
Date: Tue Mar 24 01:51:42 2009
New Revision: 190357
URL: http://svn.freebsd.org/changeset/base/190357

Log:
  MFC: r186581: Sound less scary about errorousous disk geometry.

Modified:
  stable/7/gnu/usr.bin/grep/   (props changed)
  stable/7/include/   (props changed)
  stable/7/lib/libelf/   (props changed)
  stable/7/sbin/fsck/   (props changed)
  stable/7/sbin/fsck/fsck.8
  stable/7/sbin/fsck/fsck.c
  stable/7/sbin/fsck/fsutil.h
  stable/7/sbin/fsck_ffs/   (props changed)
  stable/7/sbin/fsck_ffs/fsck.h
  stable/7/sbin/fsck_ffs/fsck_ffs.8
  stable/7/sbin/fsck_ffs/main.c
  stable/7/sbin/fsck_ffs/setup.c
  stable/7/sbin/mount/   (props changed)
  stable/7/usr.bin/gprof/   (props changed)
  stable/7/usr.bin/make/   (props changed)
  stable/7/usr.sbin/crunch/   (props changed)
  stable/7/usr.sbin/sade/   (props changed)
  stable/7/usr.sbin/sade/disks.c
  stable/7/usr.sbin/sysinstall/   (props changed)
  stable/7/usr.sbin/sysinstall/disks.c
  stable/7/usr.sbin/sysinstall/sysinstall.8

Modified: stable/7/sbin/fsck/fsck.8
==
--- stable/7/sbin/fsck/fsck.8   Tue Mar 24 01:35:58 2009(r190356)
+++ stable/7/sbin/fsck/fsck.8   Tue Mar 24 01:51:42 2009(r190357)
@@ -29,7 +29,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd January 25, 2009
+.Dd April 25, 2001
 .Dt FSCK 8
 .Os
 .Sh NAME
@@ -37,7 +37,7 @@
 .Nd file system consistency check and interactive repair
 .Sh SYNOPSIS
 .Nm
-.Op Fl Cdfnpvy
+.Op Fl dfnpvy
 .Op Fl B | F
 .Op Fl T Ar fstype : Ns Ar fsoptions
 .Op Fl t Ar fstype
@@ -112,11 +112,6 @@ to be the partition and slice designator
 .Pp
 The options are as follows:
 .Bl -tag -width indent
-.It Fl C
-Check if the
-.Dq clean
-flag is set in the superblock and skip file system checks if file system was
-properly dismounted and marked clean.
 .It Fl d
 Debugging mode.
 Just print the commands without executing them.

Modified: stable/7/sbin/fsck/fsck.c
==
--- stable/7/sbin/fsck/fsck.c   Tue Mar 24 01:35:58 2009(r190356)
+++ stable/7/sbin/fsck/fsck.c   Tue Mar 24 01:51:42 2009(r190357)
@@ -103,7 +103,7 @@ main(int argc, char *argv[])
TAILQ_INIT(&selhead);
TAILQ_INIT(&opthead);
 
-   while ((i = getopt(argc, argv, "BCdvpfFnyl:t:T:")) != -1)
+   while ((i = getopt(argc, argv, "BdvpfFnyl:t:T:")) != -1)
switch (i) {
case 'B':
if (flags & CHECK_BACKGRD)
@@ -128,9 +128,6 @@ main(int argc, char *argv[])
case 'p':
flags |= CHECK_PREEN;
/*FALLTHROUGH*/
-   case 'C':
-   flags |= CHECK_CLEAN;
-   /*FALLTHROUGH*/
case 'n':
case 'y':
globopt[1] = i;
@@ -569,7 +566,7 @@ static void
 usage(void)
 {
static const char common[] =
-   "[-Cdfnpvy] [-B | -F] [-T fstype:fsoptions] [-t fstype]";
+   "[-dfnpvy] [-B | -F] [-T fstype:fsoptions] [-t fstype]";
 
(void)fprintf(stderr, "usage: %s %s [special | node] ...\n",
getprogname(), common);

Modified: stable/7/sbin/fsck/fsutil.h
==
--- stable/7/sbin/fsck/fsutil.h Tue Mar 24 01:35:58 2009(r190356)
+++ stable/7/sbin/fsck/fsutil.h Tue Mar 24 01:51:42 2009(r190357)
@@ -48,7 +48,6 @@ char *estrdup(const char *);
 #defineCHECK_DEBUG 0x0004
 #defineCHECK_BACKGRD   0x0008
 #defineDO_BACKGRD  0x0010
-#defineCHECK_CLEAN 0x0020
 
 struct fstab;
 int checkfstab(int, int (*)(struct fstab *), 

Modified: stable/7/sbin/fsck_ffs/fsck.h
==
--- stable/7/sbin/fsck_ffs/fsck.h   Tue Mar 24 01:35:58 2009
(r190356)
+++ stable/7/sbin/fsck_ffs/fsck.h   Tue Mar 24 01:51:42 2009
(r190357)
@@ -271,7 +271,6 @@ int bkgrdflag;  /* use a snapshot to run
 intbflag;  /* location of alternate super block */
 intdebug;  /* output debugging info */
 char   damagedflag;/* run in damaged mode */
-char   ckclean;/* only do work if not cleanly unmounted */
 intcvtlevel;   /* convert to newer file system format */
 intbkgrdcheck; /* determine if background check is possible */
 intbkgrdsumadj;/* whether the kernel have ability to adjust 
superblock summary */

Modified: stable/7/sbin/fsck_ffs/fsck_ffs.8
==
--- stable/7/sbin/fsck_ffs/fsck_ffs.8   Tue Mar 24 01:35:58 2009
(r190356)
+++ stable/7/sbin/fsck_ffs/fsck_ffs.8   Tue Mar 24 01:51:42 2009
(r190357)
@@ -29,7 +29,7 @@
 .\"@(#)fsck.8  8.4 (Berkele

svn commit: r190358 - stable/7/sbin/mount

2009-03-23 Thread David E. O'Brien
Author: obrien
Date: Tue Mar 24 01:54:17 2009
New Revision: 190358
URL: http://svn.freebsd.org/changeset/base/190358

Log:
  MFC: 186291: Use strlcpy().

Modified:
  stable/7/sbin/mount/   (props changed)
  stable/7/sbin/mount/mount_fs.c   (contents, props changed)

Modified: stable/7/sbin/mount/mount_fs.c
==
--- stable/7/sbin/mount/mount_fs.c  Tue Mar 24 01:51:42 2009
(r190357)
+++ stable/7/sbin/mount/mount_fs.c  Tue Mar 24 01:54:17 2009
(r190358)
@@ -88,7 +88,7 @@ mount_fs(const char *vfstype, int argc, 
char *p, *val;
int ret;
 
-   strncpy(fstype, vfstype, sizeof(fstype));
+   strlcpy(fstype, vfstype, sizeof(fstype));
memset(errmsg, 0, sizeof(errmsg));
 
getmnt_silent = 1;
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r190359 - stable/7/usr.sbin/syslogd

2009-03-23 Thread David E. O'Brien
Author: obrien
Date: Tue Mar 24 01:56:16 2009
New Revision: 190359
URL: http://svn.freebsd.org/changeset/base/190359

Log:
  MFC: r186234/r186236: Use passed parameter rather than a hard coded value.
  Bump WARNS to 3.

Modified:
  stable/7/usr.sbin/syslogd/   (props changed)
  stable/7/usr.sbin/syslogd/Makefile
  stable/7/usr.sbin/syslogd/syslogd.c

Modified: stable/7/usr.sbin/syslogd/Makefile
==
--- stable/7/usr.sbin/syslogd/Makefile  Tue Mar 24 01:54:17 2009
(r190358)
+++ stable/7/usr.sbin/syslogd/Makefile  Tue Mar 24 01:56:16 2009
(r190359)
@@ -12,7 +12,7 @@ SRCS= syslogd.c ttymsg.c
 DPADD= ${LIBUTIL}
 LDADD= -lutil
 
-WARNS?=1
+WARNS?=3
 
 .if ${MK_INET6_SUPPORT} != "no"
 CFLAGS+= -DINET6

Modified: stable/7/usr.sbin/syslogd/syslogd.c
==
--- stable/7/usr.sbin/syslogd/syslogd.c Tue Mar 24 01:54:17 2009
(r190358)
+++ stable/7/usr.sbin/syslogd/syslogd.c Tue Mar 24 01:56:16 2009
(r190359)
@@ -330,7 +330,7 @@ static void reapchild(int);
 static voidusage(void);
 static int validate(struct sockaddr *, const char *);
 static voidunmapped(struct sockaddr *);
-static voidwallmsg(struct filed *, struct iovec *);
+static voidwallmsg(struct filed *, struct iovec *, const int iovlen);
 static int waitdaemon(int, int, int);
 static voidtimedout(int);
 static voiddouble_rbuf(int);
@@ -1060,10 +1060,11 @@ dofsync(void)
}
 }
 
+#define IOV_SIZE 7
 static void
 fprintlog(struct filed *f, int flags, const char *msg)
 {
-   struct iovec iov[7];
+   struct iovec iov[IOV_SIZE];
struct iovec *v;
struct addrinfo *r;
int i, l, lsent = 0;
@@ -1248,7 +1249,7 @@ fprintlog(struct filed *f, int flags, co
dprintf(" %s\n", f->f_un.f_fname);
v->iov_base = lf;
v->iov_len = 1;
-   if (writev(f->f_file, iov, 7) < 0) {
+   if (writev(f->f_file, iov, IOV_SIZE) < 0) {
/*
 * If writev(2) fails for potentially transient errors
 * like the filesystem being full, ignore it.
@@ -1279,7 +1280,7 @@ fprintlog(struct filed *f, int flags, co
break;
}
}
-   if (writev(f->f_file, iov, 7) < 0) {
+   if (writev(f->f_file, iov, IOV_SIZE) < 0) {
int e = errno;
(void)close(f->f_file);
if (f->f_un.f_pipe.f_pid > 0)
@@ -1304,7 +1305,7 @@ fprintlog(struct filed *f, int flags, co
v->iov_len = 2;
 
errno = 0;  /* ttymsg() only sometimes returns an errno */
-   if ((msgret = ttymsg(iov, 7, f->f_un.f_fname, 10))) {
+   if ((msgret = ttymsg(iov, IOV_SIZE, f->f_un.f_fname, 10))) {
f->f_type = F_UNUSED;
logerror(msgret);
}
@@ -1315,7 +1316,7 @@ fprintlog(struct filed *f, int flags, co
dprintf("\n");
v->iov_base = crlf;
v->iov_len = 2;
-   wallmsg(f, iov);
+   wallmsg(f, iov, IOV_SIZE);
break;
}
f->f_prevcount = 0;
@@ -1329,7 +1330,7 @@ fprintlog(struct filed *f, int flags, co
  * world, or a list of approved users.
  */
 static void
-wallmsg(struct filed *f, struct iovec *iov)
+wallmsg(struct filed *f, struct iovec *iov, const int iovlen)
 {
static int reenter; /* avoid calling ourselves */
FILE *uf;
@@ -1353,7 +1354,8 @@ wallmsg(struct filed *f, struct iovec *i
strncpy(line, ut.ut_line, sizeof(line) - 1);
line[sizeof(line) - 1] = '\0';
if (f->f_type == F_WALL) {
-   if ((p = ttymsg(iov, 7, line, TTYMSGTIME)) != NULL) {
+   if ((p = ttymsg(iov, iovlen, line, TTYMSGTIME)) !=
+   NULL) {
errno = 0;  /* already in msg */
logerror(p);
}
@@ -1365,8 +1367,8 @@ wallmsg(struct filed *f, struct iovec *i
break;
if (!strncmp(f->f_un.f_uname[i], ut.ut_name,
UT_NAMESIZE)) {
-   if ((p = ttymsg(iov, 7, line, TTYMSGTIME))
-   != NULL) {
+   if ((p = ttymsg(iov, iovlen, line, TTYMSGTIME))
+   != NULL) {
errno = 0;  /* already in msg */
logerror(p);
}
___
svn-src

svn commit: r190360 - in stable/7/sys: . amd64/linux32 contrib/pf dev/ath/ath_hal dev/cxgb

2009-03-23 Thread David E. O'Brien
Author: obrien
Date: Tue Mar 24 02:09:48 2009
New Revision: 190360
URL: http://svn.freebsd.org/changeset/base/190360

Log:
  MFC: r187964: Fix the inconsistent tabbing.

Modified:
  stable/7/sys/   (props changed)
  stable/7/sys/amd64/linux32/linux32_sysvec.c
  stable/7/sys/contrib/pf/   (props changed)
  stable/7/sys/dev/ath/ath_hal/   (props changed)
  stable/7/sys/dev/cxgb/   (props changed)

Modified: stable/7/sys/amd64/linux32/linux32_sysvec.c
==
--- stable/7/sys/amd64/linux32/linux32_sysvec.c Tue Mar 24 01:56:16 2009
(r190359)
+++ stable/7/sys/amd64/linux32/linux32_sysvec.c Tue Mar 24 02:09:48 2009
(r190360)
@@ -353,11 +353,11 @@ linux_rt_sendsig(sig_t catcher, ksiginfo
bsd_to_linux_sigset(mask, &frame.sf_sc.uc_sigmask);
 
frame.sf_sc.uc_mcontext.sc_mask   = frame.sf_sc.uc_sigmask.__bits[0];
-frame.sf_sc.uc_mcontext.sc_gs = rgs();
-frame.sf_sc.uc_mcontext.sc_fs = rfs();
-__asm __volatile("movl %%es,%0" :
+   frame.sf_sc.uc_mcontext.sc_gs = rgs();
+   frame.sf_sc.uc_mcontext.sc_fs = rfs();
+   __asm __volatile("movl %%es,%0" :
"=rm" (frame.sf_sc.uc_mcontext.sc_es));
-__asm __volatile("movl %%ds,%0" :
+   __asm __volatile("movl %%ds,%0" :
"=rm" (frame.sf_sc.uc_mcontext.sc_ds));
frame.sf_sc.uc_mcontext.sc_edi= regs->tf_rdi;
frame.sf_sc.uc_mcontext.sc_esi= regs->tf_rsi;
@@ -487,10 +487,10 @@ linux_sendsig(sig_t catcher, ksiginfo_t 
 * Build the signal context to be used by sigreturn.
 */
frame.sf_sc.sc_mask   = lmask.__bits[0];
-frame.sf_sc.sc_gs = rgs();
-frame.sf_sc.sc_fs = rfs();
-__asm __volatile("movl %%es,%0" : "=rm" (frame.sf_sc.sc_es));
-__asm __volatile("movl %%ds,%0" : "=rm" (frame.sf_sc.sc_ds));
+   frame.sf_sc.sc_gs = rgs();
+   frame.sf_sc.sc_fs = rfs();
+   __asm __volatile("movl %%es,%0" : "=rm" (frame.sf_sc.sc_es));
+   __asm __volatile("movl %%ds,%0" : "=rm" (frame.sf_sc.sc_ds));
frame.sf_sc.sc_edi= regs->tf_rdi;
frame.sf_sc.sc_esi= regs->tf_rsi;
frame.sf_sc.sc_ebp= regs->tf_rbp;
@@ -772,35 +772,36 @@ static intexec_linux_imgact_try(struct 
 static int
 exec_linux_imgact_try(struct image_params *imgp)
 {
-const char *head = (const char *)imgp->image_header;
-char *rpath;
-int error = -1, len;
-
-/*
- * The interpreter for shell scripts run from a linux binary needs
- * to be located in /compat/linux if possible in order to recursively
- * maintain linux path emulation.
- */
-if (((const short *)head)[0] == SHELLMAGIC) {
-   /*
-* Run our normal shell image activator.  If it succeeds attempt
-* to use the alternate path for the interpreter.  If an alternate
-* path is found, use our stringspace to store it.
-*/
-   if ((error = exec_shell_imgact(imgp)) == 0) {
-   linux_emul_convpath(FIRST_THREAD_IN_PROC(imgp->proc),
-   imgp->interpreter_name, UIO_SYSSPACE, &rpath, 0);
-   if (rpath != NULL) {
-   len = strlen(rpath) + 1;
-
-   if (len <= MAXSHELLCMDLEN) {
-   memcpy(imgp->interpreter_name, rpath, len);
-   }
-   free(rpath, M_TEMP);
-   }
-   }
-}
-return(error);
+   const char *head = (const char *)imgp->image_header;
+   char *rpath;
+   int error = -1, len;
+
+   /*
+* The interpreter for shell scripts run from a linux binary needs
+* to be located in /compat/linux if possible in order to recursively
+* maintain linux path emulation.
+*/
+   if (((const short *)head)[0] == SHELLMAGIC) {
+   /*
+* Run our normal shell image activator.  If it succeeds
+* attempt to use the alternate path for the interpreter.  If
+* an alternate path is found, use our stringspace to store it.
+*/
+   if ((error = exec_shell_imgact(imgp)) == 0) {
+   linux_emul_convpath(FIRST_THREAD_IN_PROC(imgp->proc),
+   imgp->interpreter_name, UIO_SYSSPACE, &rpath, 0);
+   if (rpath != NULL) {
+   len = strlen(rpath) + 1;
+
+   if (len <= MAXSHELLCMDLEN) {
+   memcpy(imgp->interpreter_name, rpath,
+   len);
+   }
+   free(rpath, M_TEMP);
+   }
+   }
+   }
+   return(error);
 }
 
 /*
@@ -868,7 +869,7 @@ linux_copyout_strings(struct image_param

Re: svn commit: r190357 - in stable/7: gnu/usr.bin/grep include lib/libelf sbin/fsck sbin/fsck_ffs sbin/mount usr.bin/gprof usr.bin/make usr.sbin/crunch usr.sbin/sade usr.sbin/sysinstall

2009-03-23 Thread Sam Leffler

David E. O'Brien wrote:

Author: obrien
Date: Tue Mar 24 01:51:42 2009
New Revision: 190357
URL: http://svn.freebsd.org/changeset/base/190357

Log:
  MFC: r186581: Sound less scary about errorousous disk geometry.

Modified:
  stable/7/gnu/usr.bin/grep/   (props changed)
  stable/7/include/   (props changed)
  stable/7/lib/libelf/   (props changed)
  stable/7/sbin/fsck/   (props changed)
  stable/7/sbin/fsck/fsck.8
  stable/7/sbin/fsck/fsck.c
  stable/7/sbin/fsck/fsutil.h
  stable/7/sbin/fsck_ffs/   (props changed)
  stable/7/sbin/fsck_ffs/fsck.h
  stable/7/sbin/fsck_ffs/fsck_ffs.8
  stable/7/sbin/fsck_ffs/main.c
  stable/7/sbin/fsck_ffs/setup.c
  stable/7/sbin/mount/   (props changed)
  stable/7/usr.bin/gprof/   (props changed)
  stable/7/usr.bin/make/   (props changed)
  stable/7/usr.sbin/crunch/   (props changed)
  stable/7/usr.sbin/sade/   (props changed)
  stable/7/usr.sbin/sade/disks.c
  stable/7/usr.sbin/sysinstall/   (props changed)
  stable/7/usr.sbin/sysinstall/disks.c
  stable/7/usr.sbin/sysinstall/sysinstall.8

  


This looks to have many changes unrelated to r186581.  For example you 
just removed the -C option to fsck.


   Sam

___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r190361 - stable/7/sbin/fsck

2009-03-23 Thread David E. O'Brien
Author: obrien
Date: Tue Mar 24 02:28:46 2009
New Revision: 190361
URL: http://svn.freebsd.org/changeset/base/190361

Log:
  Revert r190357, in which I was just trying to get the merge info set at
  the src level.
  (turns out svn+ssh://obr...@svn.freebsd.org/base/head and
  svn+ssh://svn.freebsd.org/base/stable/7 are seen as two totally different
  repositories... Jeez subversion can be dumb...)

Modified:
  stable/7/sbin/fsck/fsck.8
  stable/7/sbin/fsck/fsck.c
  stable/7/sbin/fsck/fsutil.h

Modified: stable/7/sbin/fsck/fsck.8
==
--- stable/7/sbin/fsck/fsck.8   Tue Mar 24 02:09:48 2009(r190360)
+++ stable/7/sbin/fsck/fsck.8   Tue Mar 24 02:28:46 2009(r190361)
@@ -29,7 +29,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd April 25, 2001
+.Dd January 25, 2009
 .Dt FSCK 8
 .Os
 .Sh NAME
@@ -37,7 +37,7 @@
 .Nd file system consistency check and interactive repair
 .Sh SYNOPSIS
 .Nm
-.Op Fl dfnpvy
+.Op Fl Cdfnpvy
 .Op Fl B | F
 .Op Fl T Ar fstype : Ns Ar fsoptions
 .Op Fl t Ar fstype
@@ -112,6 +112,11 @@ to be the partition and slice designator
 .Pp
 The options are as follows:
 .Bl -tag -width indent
+.It Fl C
+Check if the
+.Dq clean
+flag is set in the superblock and skip file system checks if file system was
+properly dismounted and marked clean.
 .It Fl d
 Debugging mode.
 Just print the commands without executing them.

Modified: stable/7/sbin/fsck/fsck.c
==
--- stable/7/sbin/fsck/fsck.c   Tue Mar 24 02:09:48 2009(r190360)
+++ stable/7/sbin/fsck/fsck.c   Tue Mar 24 02:28:46 2009(r190361)
@@ -103,7 +103,7 @@ main(int argc, char *argv[])
TAILQ_INIT(&selhead);
TAILQ_INIT(&opthead);
 
-   while ((i = getopt(argc, argv, "BdvpfFnyl:t:T:")) != -1)
+   while ((i = getopt(argc, argv, "BCdvpfFnyl:t:T:")) != -1)
switch (i) {
case 'B':
if (flags & CHECK_BACKGRD)
@@ -128,6 +128,9 @@ main(int argc, char *argv[])
case 'p':
flags |= CHECK_PREEN;
/*FALLTHROUGH*/
+   case 'C':
+   flags |= CHECK_CLEAN;
+   /*FALLTHROUGH*/
case 'n':
case 'y':
globopt[1] = i;
@@ -566,7 +569,7 @@ static void
 usage(void)
 {
static const char common[] =
-   "[-dfnpvy] [-B | -F] [-T fstype:fsoptions] [-t fstype]";
+   "[-Cdfnpvy] [-B | -F] [-T fstype:fsoptions] [-t fstype]";
 
(void)fprintf(stderr, "usage: %s %s [special | node] ...\n",
getprogname(), common);

Modified: stable/7/sbin/fsck/fsutil.h
==
--- stable/7/sbin/fsck/fsutil.h Tue Mar 24 02:09:48 2009(r190360)
+++ stable/7/sbin/fsck/fsutil.h Tue Mar 24 02:28:46 2009(r190361)
@@ -48,6 +48,7 @@ char *estrdup(const char *);
 #defineCHECK_DEBUG 0x0004
 #defineCHECK_BACKGRD   0x0008
 #defineDO_BACKGRD  0x0010
+#defineCHECK_CLEAN 0x0020
 
 struct fstab;
 int checkfstab(int, int (*)(struct fstab *), 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r190345 - stable/7/usr.bin/make

2009-03-23 Thread Sam Leffler

David E. O'Brien wrote:

Author: obrien
Date: Tue Mar 24 00:07:17 2009
New Revision: 190345
URL: http://svn.freebsd.org/changeset/base/190345

Log:
  MFC:
  r187475: Remove inlining of functions that are used mostly in different
 object files.  This lets use to remove NO_WERROR.
  r186558: Consistently use Var_SetGlobal().
  r186713: Add the -Q be-quiet flag for parallel jobs.
  r186279: Exit with error code 2 when run with -k (continue if errors)
 and build failed.
  r186559: Add the ability to tweak the token output before targets in job mode.
  r181021: Add POSIX -p flag to make(1).
  r186502: Clarify the behaviour of conditionals when dealing with comparisons.

  


I find this combination of unrelated changes worrisome; especially the 
day the tree is supposed to freeze for release.  Please make changes 
separately so any problems can be cross-referenced against limited commits.


Sam

___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r190362 - in stable/7/etc: . rc.d

2009-03-23 Thread Doug Barton
Author: dougb
Date: Tue Mar 24 02:48:54 2009
New Revision: 190362
URL: http://svn.freebsd.org/changeset/base/190362

Log:
  MFC r180564, addition of the SHUTDOWN keyword to those scripts that
  start persistent services.

Modified:
  stable/7/etc/   (props changed)
  stable/7/etc/rc.d/amd
  stable/7/etc/rc.d/apmd
  stable/7/etc/rc.d/bsnmpd
  stable/7/etc/rc.d/bthidd
  stable/7/etc/rc.d/devd
  stable/7/etc/rc.d/ftp-proxy
  stable/7/etc/rc.d/ftpd
  stable/7/etc/rc.d/hcsecd
  stable/7/etc/rc.d/idmapd
  stable/7/etc/rc.d/keyserv
  stable/7/etc/rc.d/lockd
  stable/7/etc/rc.d/lpd
  stable/7/etc/rc.d/mountd
  stable/7/etc/rc.d/moused
  stable/7/etc/rc.d/nfsd
  stable/7/etc/rc.d/nscd
  stable/7/etc/rc.d/ntpd
  stable/7/etc/rc.d/powerd
  stable/7/etc/rc.d/rpcbind
  stable/7/etc/rc.d/rtadvd
  stable/7/etc/rc.d/rwho
  stable/7/etc/rc.d/sdpd
  stable/7/etc/rc.d/sendmail
  stable/7/etc/rc.d/sshd
  stable/7/etc/rc.d/statd
  stable/7/etc/rc.d/timed
  stable/7/etc/rc.d/ugidfw
  stable/7/etc/rc.d/watchdogd
  stable/7/etc/rc.d/ypbind
  stable/7/etc/rc.d/yppasswdd
  stable/7/etc/rc.d/ypserv
  stable/7/etc/rc.d/ypset
  stable/7/etc/rc.d/ypupdated
  stable/7/etc/rc.d/ypxfrd

Modified: stable/7/etc/rc.d/amd
==
--- stable/7/etc/rc.d/amd   Tue Mar 24 02:28:46 2009(r190361)
+++ stable/7/etc/rc.d/amd   Tue Mar 24 02:48:54 2009(r190362)
@@ -6,7 +6,7 @@
 # PROVIDE: amd
 # REQUIRE: rpcbind ypbind nfsclient cleanvar ldconfig
 # BEFORE: DAEMON
-# KEYWORD: nojail
+# KEYWORD: nojail shutdown
 
 . /etc/rc.subr
 

Modified: stable/7/etc/rc.d/apmd
==
--- stable/7/etc/rc.d/apmd  Tue Mar 24 02:28:46 2009(r190361)
+++ stable/7/etc/rc.d/apmd  Tue Mar 24 02:48:54 2009(r190362)
@@ -6,7 +6,7 @@
 # PROVIDE: apmd
 # REQUIRE: DAEMON apm
 # BEFORE:  LOGIN
-# KEYWORD: nojail
+# KEYWORD: nojail shutdown
 
 . /etc/rc.subr
 

Modified: stable/7/etc/rc.d/bsnmpd
==
--- stable/7/etc/rc.d/bsnmpdTue Mar 24 02:28:46 2009(r190361)
+++ stable/7/etc/rc.d/bsnmpdTue Mar 24 02:48:54 2009(r190362)
@@ -5,7 +5,7 @@
 
 # PROVIDE: bsnmpd
 # REQUIRE: NETWORKING syslogd
-# KEYWORD: nojail
+# KEYWORD: nojail shutdown
 
 . /etc/rc.subr
 

Modified: stable/7/etc/rc.d/bthidd
==
--- stable/7/etc/rc.d/bthiddTue Mar 24 02:28:46 2009(r190361)
+++ stable/7/etc/rc.d/bthiddTue Mar 24 02:48:54 2009(r190362)
@@ -6,7 +6,7 @@
 # PROVIDE: bthidd
 # REQUIRE: DAEMON hcsecd
 # BEFORE: LOGIN
-# KEYWORD: nojail
+# KEYWORD: nojail shutdown
 
 . /etc/rc.subr
 

Modified: stable/7/etc/rc.d/devd
==
--- stable/7/etc/rc.d/devd  Tue Mar 24 02:28:46 2009(r190361)
+++ stable/7/etc/rc.d/devd  Tue Mar 24 02:48:54 2009(r190362)
@@ -6,7 +6,7 @@
 # PROVIDE: devd
 # REQUIRE: netif network_ipv6
 # BEFORE: NETWORKING mountcritremote
-# KEYWORD: nojail
+# KEYWORD: nojail shutdown
 
 . /etc/rc.subr
 

Modified: stable/7/etc/rc.d/ftp-proxy
==
--- stable/7/etc/rc.d/ftp-proxy Tue Mar 24 02:28:46 2009(r190361)
+++ stable/7/etc/rc.d/ftp-proxy Tue Mar 24 02:48:54 2009(r190362)
@@ -5,6 +5,7 @@
 
 # PROVIDE: ftp-proxy
 # REQUIRE: DAEMON pf
+# KEYWORD: shutdown
 
 . /etc/rc.subr
 

Modified: stable/7/etc/rc.d/ftpd
==
--- stable/7/etc/rc.d/ftpd  Tue Mar 24 02:28:46 2009(r190361)
+++ stable/7/etc/rc.d/ftpd  Tue Mar 24 02:48:54 2009(r190362)
@@ -5,6 +5,7 @@
 
 # PROVIDE: ftpd
 # REQUIRE: LOGIN cleanvar
+# KEYWORD: shutdown
 
 . /etc/rc.subr
 

Modified: stable/7/etc/rc.d/hcsecd
==
--- stable/7/etc/rc.d/hcsecdTue Mar 24 02:28:46 2009(r190361)
+++ stable/7/etc/rc.d/hcsecdTue Mar 24 02:48:54 2009(r190362)
@@ -6,7 +6,7 @@
 # PROVIDE: hcsecd
 # REQUIRE: DAEMON
 # BEFORE: LOGIN
-# KEYWORD: nojail
+# KEYWORD: nojail shutdown
 
 . /etc/rc.subr
 

Modified: stable/7/etc/rc.d/idmapd
==
--- stable/7/etc/rc.d/idmapdTue Mar 24 02:28:46 2009(r190361)
+++ stable/7/etc/rc.d/idmapdTue Mar 24 02:48:54 2009(r190362)
@@ -5,7 +5,7 @@
 
 # PROVIDE: idmapd
 # REQUIRE: rpcbind
-# KEYWORD: nojail
+# KEYWORD: nojail shutdown
 
 . /etc/rc.subr
 

Modified: stable/7/etc/rc.d/keyserv
==
--- stable/7/etc/rc.d/keyserv   Tue Mar 24 02:28:46 2009(r190361)
+++ stable/7/etc/rc.d/keyserv   Tue Mar 24 02:

svn commit: r190363 - in stable/7/etc: . rc.d

2009-03-23 Thread Doug Barton
Author: dougb
Date: Tue Mar 24 02:54:15 2009
New Revision: 190363
URL: http://svn.freebsd.org/changeset/base/190363

Log:
  MFC r181114, make sure services and protocols are in the chroot /etc
  MFC r188293, improve handling of chroot inside of a jail

Modified:
  stable/7/etc/   (props changed)
  stable/7/etc/rc.d/named

Modified: stable/7/etc/rc.d/named
==
--- stable/7/etc/rc.d/named Tue Mar 24 02:48:54 2009(r190362)
+++ stable/7/etc/rc.d/named Tue Mar 24 02:54:15 2009(r190363)
@@ -32,6 +32,8 @@ stop_postcmd="named_poststop"
 #
 chroot_autoupdate()
 {
+   local file
+
# Create (or update) the chroot directory structure
#
if [ -r /etc/mtree/BIND.chroot.dist ]; then
@@ -59,17 +61,32 @@ chroot_autoupdate()
 
# Mount a devfs in the chroot directory if needed
#
-   umount ${named_chrootdir}/dev 2>/dev/null
-   devfs_domount ${named_chrootdir}/dev devfsrules_hide_all
-   devfs -m ${named_chrootdir}/dev rule apply path null unhide
-   devfs -m ${named_chrootdir}/dev rule apply path random unhide
-
-   # Copy local timezone information if it is not up to date.
-   #
-   if [ -r /etc/localtime ]; then
-   cmp -s /etc/localtime "${named_chrootdir}/etc/localtime" ||
-   cp -p /etc/localtime "${named_chrootdir}/etc/localtime"
+   if [ `${SYSCTL_N} security.jail.jailed` -eq 0 ]; then
+   umount ${named_chrootdir}/dev 2>/dev/null
+   devfs_domount ${named_chrootdir}/dev devfsrules_hide_all
+   devfs -m ${named_chrootdir}/dev rule apply path null unhide
+   devfs -m ${named_chrootdir}/dev rule apply path random unhide
+   else
+   if [ -c ${named_chrootdir}/dev/null -a \
+   -c ${named_chrootdir}/dev/random ]; then
+   info "named chroot: using pre-mounted devfs."
+   else
+   err 1 "named chroot: devfs cannot be mounted from" \
+   "within a jail. Thus a chrooted named cannot" \
+   "be run from within a jail." \
+   "To run named without chrooting it, set" \
+   "named_chrootdir=\"\" in /etc/rc.conf."
+   fi
fi
+
+   # Copy and/or update key files to the chroot /etc 
+   #
+   for file in localtime protocols services; do
+   if [ -r /etc/$file ]; then
+   cmp -s /etc/$file "${named_chrootdir}/etc/$file" ||
+   cp -p /etc/$file "${named_chrootdir}/etc/$file"
+   fi
+   done
 }
 
 # Make symlinks to the correct pid file
@@ -109,7 +126,12 @@ named_stop()
 named_poststop()
 {
if [ -n "${named_chrootdir}" -a -c ${named_chrootdir}/dev/null ]; then
-   umount ${named_chrootdir}/dev 2>/dev/null || true
+   if [ `${SYSCTL_N} security.jail.jailed` -eq 0 ]; then
+   umount ${named_chrootdir}/dev 2>/dev/null || true
+   else
+   warn "named chroot:" \
+   "cannot unmount devfs from inside jail!"
+   fi
fi
 }
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r190364 - in stable/7/etc: . defaults

2009-03-23 Thread Doug Barton
Author: dougb
Date: Tue Mar 24 02:56:50 2009
New Revision: 190364
URL: http://svn.freebsd.org/changeset/base/190364

Log:
  MFC r181113, -c named_flags example and capitalization fix

Modified:
  stable/7/etc/   (props changed)
  stable/7/etc/defaults/rc.conf

Modified: stable/7/etc/defaults/rc.conf
==
--- stable/7/etc/defaults/rc.conf   Tue Mar 24 02:54:15 2009
(r190363)
+++ stable/7/etc/defaults/rc.conf   Tue Mar 24 02:56:50 2009
(r190364)
@@ -239,8 +239,8 @@ inetd_flags="-wW -C 60" # Optional flag
 # details.
 #
 named_enable="NO"  # Run named, the DNS server (or NO).
-named_program="/usr/sbin/named"# path to named, if you want a 
different one.
-#named_flags=""# Flags for named
+named_program="/usr/sbin/named" # Path to named, if you want a different one.
+#named_flags="-c /etc/namedb/named.conf" # Uncomment for named not in /usr/sbin
 named_pidfile="/var/run/named/pid" # Must set this in named.conf as well
 named_uid="bind"   # User to run named as
 named_chrootdir="/var/named"   # Chroot directory (or "" not to auto-chroot it)
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r190365 - in stable/6/etc: . rc.d

2009-03-23 Thread Doug Barton
Author: dougb
Date: Tue Mar 24 03:05:41 2009
New Revision: 190365
URL: http://svn.freebsd.org/changeset/base/190365

Log:
  MFC r181114, make sure services and protocols are in the chroot /etc
  MFC r188293, improve handling of chroot inside of a jail

Modified:
  stable/6/etc/   (props changed)
  stable/6/etc/rc.d/named

Modified: stable/6/etc/rc.d/named
==
--- stable/6/etc/rc.d/named Tue Mar 24 02:56:50 2009(r190364)
+++ stable/6/etc/rc.d/named Tue Mar 24 03:05:41 2009(r190365)
@@ -32,6 +32,8 @@ stop_postcmd="named_poststop"
 #
 chroot_autoupdate()
 {
+   local file
+
# Create (or update) the chroot directory structure
#
if [ -r /etc/mtree/BIND.chroot.dist ]; then
@@ -59,17 +61,32 @@ chroot_autoupdate()
 
# Mount a devfs in the chroot directory if needed
#
-   umount ${named_chrootdir}/dev 2>/dev/null
-   devfs_domount ${named_chrootdir}/dev devfsrules_hide_all
-   devfs -m ${named_chrootdir}/dev rule apply path null unhide
-   devfs -m ${named_chrootdir}/dev rule apply path random unhide
-
-   # Copy local timezone information if it is not up to date.
-   #
-   if [ -r /etc/localtime ]; then
-   cmp -s /etc/localtime "${named_chrootdir}/etc/localtime" ||
-   cp -p /etc/localtime "${named_chrootdir}/etc/localtime"
+   if [ `${SYSCTL_N} security.jail.jailed` -eq 0 ]; then
+   umount ${named_chrootdir}/dev 2>/dev/null
+   devfs_domount ${named_chrootdir}/dev devfsrules_hide_all
+   devfs -m ${named_chrootdir}/dev rule apply path null unhide
+   devfs -m ${named_chrootdir}/dev rule apply path random unhide
+   else
+   if [ -c ${named_chrootdir}/dev/null -a \
+   -c ${named_chrootdir}/dev/random ]; then
+   info "named chroot: using pre-mounted devfs."
+   else
+   err 1 "named chroot: devfs cannot be mounted from" \
+   "within a jail. Thus a chrooted named cannot" \
+   "be run from within a jail." \
+   "To run named without chrooting it, set" \
+   "named_chrootdir=\"\" in /etc/rc.conf."
+   fi
fi
+
+   # Copy and/or update key files to the chroot /etc 
+   #
+   for file in localtime protocols services; do
+   if [ -r /etc/$file ]; then
+   cmp -s /etc/$file "${named_chrootdir}/etc/$file" ||
+   cp -p /etc/$file "${named_chrootdir}/etc/$file"
+   fi
+   done
 }
 
 # Make symlinks to the correct pid file
@@ -109,7 +126,12 @@ named_stop()
 named_poststop()
 {
if [ -n "${named_chrootdir}" -a -c ${named_chrootdir}/dev/null ]; then
-   umount ${named_chrootdir}/dev 2>/dev/null || true
+   if [ `${SYSCTL_N} security.jail.jailed` -eq 0 ]; then
+   umount ${named_chrootdir}/dev 2>/dev/null || true
+   else
+   warn "named chroot:" \
+   "cannot unmount devfs from inside jail!"
+   fi
fi
 }
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r190366 - in stable/6/etc: . defaults

2009-03-23 Thread Doug Barton
Author: dougb
Date: Tue Mar 24 03:08:09 2009
New Revision: 190366
URL: http://svn.freebsd.org/changeset/base/190366

Log:
  MFC r181113, -c named_flags example and capitalization fix

Modified:
  stable/6/etc/   (props changed)
  stable/6/etc/defaults/rc.conf

Modified: stable/6/etc/defaults/rc.conf
==
--- stable/6/etc/defaults/rc.conf   Tue Mar 24 03:05:41 2009
(r190365)
+++ stable/6/etc/defaults/rc.conf   Tue Mar 24 03:08:09 2009
(r190366)
@@ -220,8 +220,8 @@ inetd_flags="-wW -C 60" # Optional flag
 # details.
 #
 named_enable="NO"  # Run named, the DNS server (or NO).
-named_program="/usr/sbin/named"# path to named, if you want a 
different one.
-#named_flags=""# Flags for named
+named_program="/usr/sbin/named" # Path to named, if you want a different one.
+#named_flags="-c /etc/namedb/named.conf" # Uncomment for named not in /usr/sbin
 named_pidfile="/var/run/named/pid" # Must set this in named.conf as well
 named_uid="bind"   # User to run named as
 named_chrootdir="/var/named"   # Chroot directory (or "" not to auto-chroot it)
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r190367 - head/sys/dev/if_ndis

2009-03-23 Thread Weongyo Jeong
Author: weongyo
Date: Tue Mar 24 04:20:17 2009
New Revision: 190367
URL: http://svn.freebsd.org/changeset/base/190367

Log:
  set NULL after free to avoid duplicate free.
  
  Tested by:Ganbold 

Modified:
  head/sys/dev/if_ndis/if_ndis.c

Modified: head/sys/dev/if_ndis/if_ndis.c
==
--- head/sys/dev/if_ndis/if_ndis.c  Tue Mar 24 03:08:09 2009
(r190366)
+++ head/sys/dev/if_ndis/if_ndis.c  Tue Mar 24 04:20:17 2009
(r190367)
@@ -3250,8 +3250,10 @@ ndis_stop(sc)
 
NDIS_LOCK(sc);
for (i = 0; i < NDIS_EVENTS; i++) {
-   if (sc->ndis_evt[i].ne_sts && sc->ndis_evt[i].ne_buf != NULL)
+   if (sc->ndis_evt[i].ne_sts && sc->ndis_evt[i].ne_buf != NULL) {
free(sc->ndis_evt[i].ne_buf, M_TEMP);
+   sc->ndis_evt[i].ne_buf = NULL;
+   }
sc->ndis_evt[i].ne_sts = 0;
sc->ndis_evt[i].ne_len = 0;
}
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r190357 - in stable/7: gnu/usr.bin/grep include lib/libelf sbin/fsck sbin/fsck_ffs sbin/mount usr.bin/gprof usr.bin/make usr.sbin/crunch usr.sbin/sade usr.sbin/sysinstall

2009-03-23 Thread David O'Brien
On Mon, Mar 23, 2009 at 07:25:41PM -0700, Sam Leffler wrote:
> David E. O'Brien wrote:
>> Author: obrien
>> Date: Tue Mar 24 01:51:42 2009
>> New Revision: 190357
>> URL: http://svn.freebsd.org/changeset/base/190357
>> 
>> Log:
>>   MFC: r186581: Sound less scary about errorousous disk geometry.
..
> This looks to have many changes unrelated to r186581.  For example you
> just removed the -C option to fsck.

I found out that Subversion wasn't getting the mergeinfo right.
It considers svn+ssh://obr...@svn.freebsd.org/base/ and
svn+ssh://svn.freebsd.org/base/ to be two totally seperate repositories.

So I did some 'merge -c ... --record-only' to get the earlier merges.
I fat fingered the ones for fsck, forgetting the --record-only the
first time.  Not sure where 'svn revert -R sbin/fsck*' went wrong when I
did that before doing the merge again with '--record-only'.

Subversions merge handling seems to be one of its warts.

-- 
-- David  (obr...@freebsd.org)
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r190368 - svnadmin/conf

2009-03-23 Thread Ken Smith
Author: kensmith
Date: Tue Mar 24 05:05:53 2009
New Revision: 190368
URL: http://svn.freebsd.org/changeset/base/190368

Log:
  Enter stable/7 code freeze for the upcoming 7.2-RELEASE.  While here
  switch 7.0/7.1 entries to match the others.
  
  Approved by:  core (implicit)

Modified:
  svnadmin/conf/approvers

Modified: svnadmin/conf/approvers
==
--- svnadmin/conf/approvers Tue Mar 24 04:20:17 2009(r190367)
+++ svnadmin/conf/approvers Tue Mar 24 05:05:53 2009(r190368)
@@ -17,10 +17,9 @@
 # $FreeBSD$
 #
 #^head/re
-#^stable/7/re
+^stable/7/ re
 #^stable/6/re
-^releng/7.1/   (security-officer|so)
-^releng/7.0/   (security-officer|so)
+^releng/7.[0-1]/   (security-officer|so)
 ^releng/6.[0-4]/   (security-officer|so)
 ^releng/5.[0-5]/   (security-officer|so)
 ^releng/4.[3-9]/   (security-officer|so)
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"