svn commit: r202185 - head/lib/libc/gen

2010-01-13 Thread David Xu
Author: davidxu
Date: Wed Jan 13 08:53:23 2010
New Revision: 202185
URL: http://svn.freebsd.org/changeset/base/202185

Log:
  Return SEM_FAILED instead of NULL, though there are same, but the
  SEM_FAILED is more suitable name.
  In function, sem_close(), always set errno on error.

Modified:
  head/lib/libc/gen/sem_new.c

Modified: head/lib/libc/gen/sem_new.c
==
--- head/lib/libc/gen/sem_new.c Wed Jan 13 08:21:19 2010(r202184)
+++ head/lib/libc/gen/sem_new.c Wed Jan 13 08:53:23 2010(r202185)
@@ -147,13 +147,13 @@ _sem_open(const char *name, int flags, .
 
if (name[0] != '/') {
errno = EINVAL;
-   return (NULL);
+   return (SEM_FAILED);
}
name++;
 
if (flags & ~(O_CREAT|O_EXCL)) {
errno = EINVAL;
-   return (NULL);
+   return (SEM_FAILED);
}
 
_pthread_once(&once, sem_module_init);
@@ -275,6 +275,7 @@ _sem_close(sem_t *sem)
return (0);
}
_pthread_mutex_unlock(&sem_llock);
+   errno = EINVAL;
return (-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: r202187 - head/sys/fs/tmpfs

2010-01-13 Thread Jaakko Heinonen
Author: jh
Date: Wed Jan 13 14:17:21 2010
New Revision: 202187
URL: http://svn.freebsd.org/changeset/base/202187

Log:
  - Fix some style bugs in tmpfs_mount(). [1]
  - Remove a stale comment about tmpfs_mem_info() 'total' argument.
  
  Reported by:  bde [1]

Modified:
  head/sys/fs/tmpfs/tmpfs.h
  head/sys/fs/tmpfs/tmpfs_vfsops.c

Modified: head/sys/fs/tmpfs/tmpfs.h
==
--- head/sys/fs/tmpfs/tmpfs.h   Wed Jan 13 12:21:58 2010(r202186)
+++ head/sys/fs/tmpfs/tmpfs.h   Wed Jan 13 14:17:21 2010(r202187)
@@ -493,10 +493,6 @@ inttmpfs_truncate(struct vnode *, off_t
  * Returns information about the number of available memory pages,
  * including physical and virtual ones.
  *
- * If 'total' is TRUE, the value returned is the total amount of memory
- * pages configured for the system (either in use or free).
- * If it is FALSE, the value returned is the amount of free memory pages.
- *
  * Remember to remove TMPFS_PAGES_RESERVED from the returned value to avoid
  * excessive memory usage.
  *

Modified: head/sys/fs/tmpfs/tmpfs_vfsops.c
==
--- head/sys/fs/tmpfs/tmpfs_vfsops.cWed Jan 13 12:21:58 2010
(r202186)
+++ head/sys/fs/tmpfs/tmpfs_vfsops.cWed Jan 13 14:17:21 2010
(r202187)
@@ -185,15 +185,15 @@ tmpfs_mount(struct mount *mp)
ino_t nodes;
int error;
/* Size counters. */
-   ino_t   nodes_max;
-   u_quad_tsize_max;
+   ino_t nodes_max;
+   u_quad_t size_max;
 
/* Root node attributes. */
-   uid_t   root_uid;
-   gid_t   root_gid;
-   mode_t  root_mode;
+   uid_t root_uid;
+   gid_t root_gid;
+   mode_t root_mode;
 
-   struct vattrva;
+   struct vattr va;
 
if (vfs_filteropt(mp->mnt_optnew, tmpfs_opts))
return (EINVAL);
@@ -239,7 +239,7 @@ tmpfs_mount(struct mount *mp)
 * allowed to use, based on the maximum size the user passed in
 * the mount structure.  A value of zero is treated as if the
 * maximum available space was requested. */
-   if (size_max < PAGE_SIZE || size_max > (SIZE_MAX - PAGE_SIZE))
+   if (size_max < PAGE_SIZE || size_max > SIZE_MAX - PAGE_SIZE)
pages = SIZE_MAX;
else
pages = howmany(size_max, PAGE_SIZE);
___
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: r202187 - head/sys/fs/tmpfs

2010-01-13 Thread Jaakko Heinonen
On 2010-01-13, Jaakko Heinonen wrote:
> Author: jh
> Date: Wed Jan 13 14:17:21 2010
> New Revision: 202187
> URL: http://svn.freebsd.org/changeset/base/202187
> 
> Log:
>   - Fix some style bugs in tmpfs_mount(). [1]
>   - Remove a stale comment about tmpfs_mem_info() 'total' argument.
>   
>   Reported by:bde [1]

Approved by:trasz (mentor)

-- 
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"


Re: INCLUDE_CONFIG_FILE in GENERIC

2010-01-13 Thread John Baldwin
On Tuesday 12 January 2010 7:15:22 pm Doug Barton wrote:
> On 1/10/2010 8:02 PM, M. Warner Losh wrote:
> > In message: 
> > Doug Barton  writes:
> > : On Sun, 10 Jan 2010, Warner Losh wrote:
> > : 
> > : > Author: imp
> > : > Date: Sun Jan 10 17:44:22 2010
> > : > New Revision: 202019
> > : > URL: http://svn.freebsd.org/changeset/base/202019
> > : >
> > : > Log:
> > : >  Add INCLUDE_CONFIG_FILE in GENERIC on all non-embedded platforms.
> > : 
> > : Thanks for doing this, however the comment about how to include the
> > : whole file (including the comments) were not included. Do I need to do
> > : this part of it myself? No problem if so, I just want to be sure to
> > : get it done in time to MFC it before the freeze for 7.3-release.
> > 
> > In general, we don't put big comments like that in the config files,
> > preferring to leave them to NOTES.  I was just following that
> > convention...
> 
> Understood, however given that there is plenty of room for confusion on
> this point because the default is NOT to include the comments I think
> that some explanation is justified. My original text was:
> 
> # Store the plain version of the configuration file in the kernel itself.
> # To store the entire file, including comments, put this in /etc/src.conf:
> # CONFIGARGS= -C
> # See config(8) for more details.

Just put this in sys/conf/NOTES.  Users already know to look in NOTES for 
further details about kernel options.

-- 
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"


Re: INCLUDE_CONFIG_FILE in GENERIC

2010-01-13 Thread M. Warner Losh
In message: <201001130844.21241@freebsd.org>
John Baldwin  writes:
: On Tuesday 12 January 2010 7:15:22 pm Doug Barton wrote:
: > On 1/10/2010 8:02 PM, M. Warner Losh wrote:
: > > In message: 
: > > Doug Barton  writes:
: > > : On Sun, 10 Jan 2010, Warner Losh wrote:
: > > : 
: > > : > Author: imp
: > > : > Date: Sun Jan 10 17:44:22 2010
: > > : > New Revision: 202019
: > > : > URL: http://svn.freebsd.org/changeset/base/202019
: > > : >
: > > : > Log:
: > > : >  Add INCLUDE_CONFIG_FILE in GENERIC on all non-embedded platforms.
: > > : 
: > > : Thanks for doing this, however the comment about how to include the
: > > : whole file (including the comments) were not included. Do I need to do
: > > : this part of it myself? No problem if so, I just want to be sure to
: > > : get it done in time to MFC it before the freeze for 7.3-release.
: > > 
: > > In general, we don't put big comments like that in the config files,
: > > preferring to leave them to NOTES.  I was just following that
: > > convention...
: > 
: > Understood, however given that there is plenty of room for confusion on
: > this point because the default is NOT to include the comments I think
: > that some explanation is justified. My original text was:
: > 
: > # Store the plain version of the configuration file in the kernel itself.
: > # To store the entire file, including comments, put this in /etc/src.conf:
: > # CONFIGARGS=   -C
: > # See config(8) for more details.
: 
: Just put this in sys/conf/NOTES.  Users already know to look in NOTES for 
: further details about kernel options.

This exact comment already is in NOTES.

Warner
___
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: r202188 - in head: include lib/libc/gen lib/libulog

2010-01-13 Thread Ed Schouten
Author: ed
Date: Wed Jan 13 17:29:55 2010
New Revision: 202188
URL: http://svn.freebsd.org/changeset/base/202188

Log:
  Implement .
  
  The utmpx interface is the standardized interface of the user accounting
  database. The standard only defines a subset of the functions that were
  present in System V-like systems.
  
  I'd like to highlight some of the traits my implementation has:
  
  - The standard allows the on-disk format to be different than the
in-memory representation (struct utmpx). Most operating systems don't
do this, but we do. This allows us to keep our ABI more stable, while
giving us the opportunity to modify the on-disk format. It also allows
us to use a common file format across different architectures (i.e.
byte ordering).
  
  - Our implementation of pututxline() also updates wtmp and lastlog (now
called utx.log and utx.lastlogin). This means the databases are more
likely to be in sync.
  
  - Care must be taken that our implementation discard any fields that are
not applicable. For example, our DEAD_PROCESS records do not hold a
TTY name. Just a time stamp, a record identifier and a process
identifier. It also guarantees that strings (ut_host, ut_line and
ut_user) are null terminated. ut_id is obviously not null terminated,
because it's not a string.
  
  - The API and its behaviour should be conformant to POSIX, but there may
be things that slightly deviate from the standard. This implementation
uses separate file descriptors when writing to the log files. It also
doesn't use getutxid() to search for a field to overwrite. It uses an
allocation strategy similar to getutxid(), but prevents DEAD_PROCESS
records from accumulating.
  
  Make sure libulog doesn't overwrite the manpages shipped with our C
  library. Also keep the symbol list in Symbol.map sorted.
  
  I'll bump __FreeBSD_version later this evening. I first want to convert
  everything to  and get rid of .

Added:
  head/include/utmpx.h   (contents, props changed)
  head/lib/libc/gen/getutxent.3   (contents, props changed)
  head/lib/libc/gen/getutxent.c   (contents, props changed)
  head/lib/libc/gen/pututxline.c   (contents, props changed)
  head/lib/libc/gen/utxdb.c   (contents, props changed)
  head/lib/libc/gen/utxdb.h   (contents, props changed)
Modified:
  head/include/Makefile
  head/lib/libc/gen/Makefile.inc
  head/lib/libc/gen/Symbol.map
  head/lib/libulog/Makefile

Modified: head/include/Makefile
==
--- head/include/Makefile   Wed Jan 13 14:17:21 2010(r202187)
+++ head/include/Makefile   Wed Jan 13 17:29:55 2010(r202188)
@@ -23,8 +23,8 @@ INCS= a.out.h ar.h assert.h bitstring.h 
stdbool.h stddef.h stdio.h stdlib.h string.h stringlist.h \
strings.h sysexits.h tar.h termios.h tgmath.h \
time.h timeconv.h timers.h ttyent.h \
-   ulimit.h unistd.h utime.h utmp.h uuid.h varargs.h vis.h wchar.h \
-   wctype.h wordexp.h
+   ulimit.h unistd.h utime.h utmp.h utmpx.h uuid.h varargs.h vis.h \
+   wchar.h wctype.h wordexp.h
 
 MHDRS= float.h floatingpoint.h stdarg.h
 

Added: head/include/utmpx.h
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/include/utmpx.hWed Jan 13 17:29:55 2010(r202188)
@@ -0,0 +1,88 @@
+/*-
+ * Copyright (c) 2010 Ed Schouten 
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#ifndef _UTMPX_H_
+#define_UTMPX_H_
+
+#include 
+#include 
+#include 
+
+#ifndef _PID_T_DECLARED
+typedef   

svn commit: r202190 - head/bin/csh

2010-01-13 Thread Ed Schouten
Author: ed
Date: Wed Jan 13 17:49:35 2010
New Revision: 202190
URL: http://svn.freebsd.org/changeset/base/202190

Log:
  Let csh(1) use utmpx instead of utmp.
  
  csh allows you to monitor the utmp(x) file to monitor certain user
  logins. Unfortunately it needs to directly stat() this file. I don't
  want to break this module , but eventually it shouldn't do that. The
  idea of the getutxent(3) API is to hide file access.
  
  Approved by:  mp

Modified:
  head/bin/csh/config.h
  head/bin/csh/config_p.h

Modified: head/bin/csh/config.h
==
--- head/bin/csh/config.h   Wed Jan 13 17:45:39 2010(r202189)
+++ head/bin/csh/config.h   Wed Jan 13 17:49:35 2010(r202190)
@@ -54,7 +54,7 @@
 #define HAVE_GETPWENT 1
 
 /* Define to 1 if you have the `getutent' function. */
-/* #undef HAVE_GETUTENT */
+#define HAVE_GETUTENT 1
 
 /* Define if you have the iconv() function. */
 /* #undef HAVE_ICONV */
@@ -130,10 +130,10 @@
 #define HAVE_STRUCT_UTMP_UT_HOST 1
 
 /* Define to 1 if `ut_tv' is member of `struct utmp'. */
-/* #undef HAVE_STRUCT_UTMP_UT_TV */
+#define HAVE_STRUCT_UTMP_UT_TV 1
 
 /* Define to 1 if `ut_user' is member of `struct utmp'. */
-/* #undef HAVE_STRUCT_UTMP_UT_USER */
+#define HAVE_STRUCT_UTMP_UT_USER 1
 
 /* Define to 1 if `ut_xtime' is member of `struct utmp'. */
 /* #undef HAVE_STRUCT_UTMP_UT_XTIME */
@@ -159,10 +159,10 @@
 #define HAVE_UNISTD_H 1
 
 /* Define to 1 if you have the  header file. */
-/* #undef HAVE_UTMPX_H */
+#define HAVE_UTMPX_H 1
 
 /* Define to 1 if you have the  header file. */
-#define HAVE_UTMP_H 1
+/* #undef HAVE_UTMP_H */
 
 /* Define to 1 if you have the  header file. */
 #define HAVE_WCHAR_H 1

Modified: head/bin/csh/config_p.h
==
--- head/bin/csh/config_p.h Wed Jan 13 17:45:39 2010(r202189)
+++ head/bin/csh/config_p.h Wed Jan 13 17:49:35 2010(r202190)
@@ -85,6 +85,7 @@
 /* Use LC_MESSAGES locale category to open the message catalog */
 #define MCLoadBySet NL_CAT_LOCALE
 #define BUFSIZE 8192
+#define UTMPX_FILE "/var/run/utx.active"
 #endif
 
 #if defined(__bsdi__)
___
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: r202191 - head/usr.bin/finger

2010-01-13 Thread Ed Schouten
Author: ed
Date: Wed Jan 13 17:50:58 2010
New Revision: 202191
URL: http://svn.freebsd.org/changeset/base/202191

Log:
  Migrate finger(1) towards utmpx.
  
  It was already ported to use libulog, which makes it simpler now. Be
  sure to catch the error returned by setutxdb(). Otherwise it may perform
  a lookup on the utx.active database.

Modified:
  head/usr.bin/finger/Makefile
  head/usr.bin/finger/finger.c
  head/usr.bin/finger/lprint.c
  head/usr.bin/finger/net.c
  head/usr.bin/finger/sprint.c
  head/usr.bin/finger/util.c

Modified: head/usr.bin/finger/Makefile
==
--- head/usr.bin/finger/MakefileWed Jan 13 17:49:35 2010
(r202190)
+++ head/usr.bin/finger/MakefileWed Jan 13 17:50:58 2010
(r202191)
@@ -7,7 +7,4 @@ MAN=finger.1 finger.conf.5
 
 WARNS?=2
 
-DPADD= ${LIBULOG}
-LDADD= -lulog
-
 .include 

Modified: head/usr.bin/finger/finger.c
==
--- head/usr.bin/finger/finger.cWed Jan 13 17:49:35 2010
(r202190)
+++ head/usr.bin/finger/finger.cWed Jan 13 17:50:58 2010
(r202191)
@@ -82,9 +82,8 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#define_ULOG_POSIX_NAMES
-#include 
 #include 
+#include 
 #include 
 
 #include "finger.h"

Modified: head/usr.bin/finger/lprint.c
==
--- head/usr.bin/finger/lprint.cWed Jan 13 17:49:35 2010
(r202190)
+++ head/usr.bin/finger/lprint.cWed Jan 13 17:50:58 2010
(r202191)
@@ -56,9 +56,8 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#define_ULOG_POSIX_NAMES
-#include 
 #include 
+#include 
 #include "finger.h"
 #include "pathnames.h"
 

Modified: head/usr.bin/finger/net.c
==
--- head/usr.bin/finger/net.c   Wed Jan 13 17:49:35 2010(r202190)
+++ head/usr.bin/finger/net.c   Wed Jan 13 17:50:58 2010(r202191)
@@ -54,9 +54,8 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#define_ULOG_POSIX_NAMES
-#include 
 #include 
+#include 
 #include "finger.h"
 
 static void cleanup(int sig);

Modified: head/usr.bin/finger/sprint.c
==
--- head/usr.bin/finger/sprint.cWed Jan 13 17:49:35 2010
(r202190)
+++ head/usr.bin/finger/sprint.cWed Jan 13 17:50:58 2010
(r202191)
@@ -53,8 +53,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#define_ULOG_POSIX_NAMES
-#include 
+#include 
 #include "finger.h"
 
 static void  stimeprint(WHERE *);

Modified: head/usr.bin/finger/util.c
==
--- head/usr.bin/finger/util.c  Wed Jan 13 17:49:35 2010(r202190)
+++ head/usr.bin/finger/util.c  Wed Jan 13 17:50:58 2010(r202191)
@@ -56,9 +56,8 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#define_ULOG_POSIX_NAMES
-#include 
 #include 
+#include 
 #include "finger.h"
 #include "pathnames.h"
 
@@ -110,11 +109,11 @@ void
 enter_lastlog(PERSON *pn)
 {
WHERE *w;
-   struct ulog_utmpx *ut;
+   struct utmpx *ut = NULL;
char doit = 0;
 
-   ulog_setutxfile(UTXI_USER, NULL);
-   ut = ulog_getutxuser(pn->name);
+   if (setutxdb(UTXDB_LASTLOGIN, NULL) == 0)
+   ut = getutxuser(pn->name);
if ((w = pn->whead) == NULL)
doit = 1;
else if (ut != NULL && ut->ut_type == USER_PROCESS) {
@@ -140,7 +139,7 @@ enter_lastlog(PERSON *pn)
strcpy(w->host, ut->ut_host);
w->loginat = ut->ut_tv.tv_sec;
}
-   ulog_endutxent();
+   endutxent();
 }
 
 void
___
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: r202192 - head/usr.sbin/ppp

2010-01-13 Thread Ed Schouten
Author: ed
Date: Wed Jan 13 17:54:32 2010
New Revision: 202192
URL: http://svn.freebsd.org/changeset/base/202192

Log:
  Port ppp(8) to utmpx.
  
  A nice thing about utmpx is that it makes it very easy to log sessions
  that don't use TTYs. This is because the file is not indexed by TTY
  slots anymore.
  
  Silence from: brian

Modified:
  head/usr.sbin/ppp/id.c
  head/usr.sbin/ppp/id.h
  head/usr.sbin/ppp/physical.c
  head/usr.sbin/ppp/physical.h

Modified: head/usr.sbin/ppp/id.c
==
--- head/usr.sbin/ppp/id.c  Wed Jan 13 17:50:58 2010(r202191)
+++ head/usr.sbin/ppp/id.c  Wed Jan 13 17:54:32 2010(r202192)
@@ -49,7 +49,7 @@
 #else
 #include 
 #endif
-#include 
+#include 
 
 #include "log.h"
 #include "main.h"
@@ -202,36 +202,25 @@ ID0uu_unlock(const char *basettyname)
 }
 
 void
-ID0login(struct utmp *ut)
+ID0login(const struct utmpx *ut)
 {
   ID0set0();
-  if (logout(ut->ut_line)) {
-log_Printf(LogID0, "logout(\"%s\")\n", ut->ut_line);
-logwtmp(ut->ut_line, "", "");
-log_Printf(LogID0, "logwtmp(\"%s\", \"\", \"\")\n", ut->ut_line);
-  }
-  login(ut);
-  log_Printf(LogID0, "login(\"%s\", \"%.*s\")\n",
-ut->ut_line, (int)(sizeof ut->ut_name), ut->ut_name);
+  pututxline(ut);
+  log_Printf(LogID0, "pututxline(\"%.*s\", \"%.*s\", \"%.*s\", \"%.*s\")\n",
+  (int)sizeof ut->ut_id, ut->ut_id,
+  (int)sizeof ut->ut_user, ut->ut_user,
+  (int)sizeof ut->ut_line, ut->ut_line,
+  (int)sizeof ut->ut_host, ut->ut_host);
   ID0setuser();
 }
 
 void
-ID0logout(const char *device, int nologout)
+ID0logout(const struct utmpx *ut)
 {
-  struct utmp ut;
-  char ut_line[sizeof ut.ut_line + 1];
-
-  strncpy(ut_line, device, sizeof ut_line - 1);
-  ut_line[sizeof ut_line - 1] = '\0';
-
   ID0set0();
-  if (nologout || logout(ut_line)) {
-log_Printf(LogID0, "logout(\"%s\")\n", ut_line);
-logwtmp(ut_line, "", "");
-log_Printf(LogID0, "logwtmp(\"%s\", \"\", \"\")\n", ut_line);
-  } else
-log_Printf(LogERROR, "ID0logout: No longer logged in on %s\n", ut_line);
+  pututxline(ut);
+  log_Printf(LogID0, "pututxline(\"%.*s\")\n",
+  (int)sizeof ut->ut_id, ut->ut_id);
   ID0setuser();
 }
 

Modified: head/usr.sbin/ppp/id.h
==
--- head/usr.sbin/ppp/id.h  Wed Jan 13 17:50:58 2010(r202191)
+++ head/usr.sbin/ppp/id.h  Wed Jan 13 17:54:32 2010(r202192)
@@ -27,7 +27,7 @@
  */
 
 #ifndef NOSUID
-struct utmp;
+struct utmpx;
 struct sockaddr_un;
 
 extern void ID0init(void);
@@ -41,8 +41,8 @@ extern int ID0write(int, const void *, s
 extern int ID0uu_lock(const char *);
 extern int ID0uu_lock_txfr(const char *, pid_t);
 extern int ID0uu_unlock(const char *);
-extern void ID0login(struct utmp *);
-extern void ID0logout(const char *, int);
+extern void ID0login(const struct utmpx *);
+extern void ID0logout(const struct utmpx *);
 extern int ID0bind_un(int, const struct sockaddr_un *);
 extern int ID0connect_un(int, const struct sockaddr_un *);
 extern int ID0kill(pid_t, int);
@@ -64,20 +64,8 @@ extern int ID0NgMkSockNode(const char *,
 #define ID0uu_lock uu_lock
 #define ID0uu_lock_txfr uu_lock_txfr
 #define ID0uu_unlock uu_unlock
-#define ID0login(u)\
-  do { \
-if (logout((u)->ut_line))  \
-  logwtmp((u)->ut_line, "", "");   \
-login(u);  \
-  } while (0)
-#define ID0logout(dev, no) \
-  do { \
-struct utmp ut;\
-strncpy(ut.ut_line, dev, sizeof ut.ut_line - 1);   \
-ut.ut_line[sizeof ut.ut_line - 1] = '\0';  \
-if (no || logout(ut.ut_line))  \
-  logwtmp(ut.ut_line, "", ""); \
-  } while (0)
+#define ID0login pututxline
+#define ID0logout pututxline
 #define ID0bind_un(s, n) bind(s, (const struct sockaddr *)(n), sizeof *(n))
 #define ID0connect_un(s, n) \
connect(s, (const struct sockaddr *)(n), sizeof *(n))

Modified: head/usr.sbin/ppp/physical.c
==
--- head/usr.sbin/ppp/physical.cWed Jan 13 17:50:58 2010
(r202191)
+++ head/usr.sbin/ppp/physical.cWed Jan 13 17:54:32 2010
(r202192)
@@ -25,6 +25,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #include 
@@ -42,7 +43,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #if defined(__OpenBSD__) || defined(__NetBSD__)
 #include 
 #include 
@@ -106,8 +107,6 @@
 #endif
 #include "tcpmss.h"
 
-#define PPPOTCPLINE "ppp"
-
 static int physical_DescriptorWrite(struct fdescriptor *, struct bundle *,
 const fd_set *);
 
@@ -333,6 +332,7 @@ physical_Close(struct physical *p)
 {
   int newsid;
   char fn[PATH_

svn commit: r202193 - in head/bin: date pax

2010-01-13 Thread Ed Schouten
Author: ed
Date: Wed Jan 13 17:56:54 2010
New Revision: 202193
URL: http://svn.freebsd.org/changeset/base/202193

Log:
  Port everything in bin/ from utmp to utmpx.
  
  date: use libc utmpx routines instead of the ones provided by libulog.
  pax:  don't depend on 

Modified:
  head/bin/date/Makefile
  head/bin/date/date.c
  head/bin/pax/gen_subs.c

Modified: head/bin/date/Makefile
==
--- head/bin/date/Makefile  Wed Jan 13 17:54:32 2010(r202192)
+++ head/bin/date/Makefile  Wed Jan 13 17:56:54 2010(r202193)
@@ -3,7 +3,5 @@
 
 PROG=  date
 SRCS=  date.c netdate.c vary.c
-DPADD= ${LIBULOG}
-LDADD= -lulog
 
 .include 

Modified: head/bin/date/date.c
==
--- head/bin/date/date.cWed Jan 13 17:54:32 2010(r202192)
+++ head/bin/date/date.cWed Jan 13 17:56:54 2010(r202193)
@@ -52,9 +52,8 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#define_ULOG_POSIX_NAMES
-#include 
 #include 
+#include 
 
 #include "extern.h"
 #include "vary.h"

Modified: head/bin/pax/gen_subs.c
==
--- head/bin/pax/gen_subs.c Wed Jan 13 17:54:32 2010(r202192)
+++ head/bin/pax/gen_subs.c Wed Jan 13 17:56:54 2010(r202193)
@@ -45,7 +45,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -66,10 +65,6 @@ __FBSDID("$FreeBSD$");
 #define OLDFRMTM   "%b %e  %Y"
 #define CURFRMTD   "%e %b %H:%M"
 #define OLDFRMTD   "%e %b  %Y"
-#ifndef UT_NAMESIZE
-#define UT_NAMESIZE8
-#endif
-#define UT_GRPSIZE 6
 
 static int d_first = -1;
 
@@ -116,9 +111,8 @@ ls_list(ARCHD *arcn, time_t now, FILE *f
 */
if (strftime(f_date,DATELEN,timefrmt,localtime(&(sbp->st_mtime))) == 0)
f_date[0] = '\0';
-   (void)fprintf(fp, "%s%2u %-*s %-*s ", f_mode, sbp->st_nlink,
-   UT_NAMESIZE, name_uid(sbp->st_uid, 1), UT_GRPSIZE,
-   name_gid(sbp->st_gid, 1));
+   (void)fprintf(fp, "%s%2u %-12s %-12s ", f_mode, sbp->st_nlink,
+   name_uid(sbp->st_uid, 1), name_gid(sbp->st_gid, 1));
 
/*
 * print device id's for devices, or sizes for other nodes
___
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: r202194 - head/sbin/init

2010-01-13 Thread Ed Schouten
Author: ed
Date: Wed Jan 13 17:58:49 2010
New Revision: 202194
URL: http://svn.freebsd.org/changeset/base/202194

Log:
  Migrate init(8) towards utmpx.
  
  According to a comment, we cannot safely remove utmpx entries here
  anymore. This is because the libc routines may block on file locking. In
  an ideal world login(1) should just remove the entries, which is why I'm
  disabling this code for now. If it turns out we get lots of stale
  entries here, we should figure out a way to deal with that.

Modified:
  head/sbin/init/Makefile
  head/sbin/init/init.c

Modified: head/sbin/init/Makefile
==
--- head/sbin/init/Makefile Wed Jan 13 17:56:54 2010(r202193)
+++ head/sbin/init/Makefile Wed Jan 13 17:58:49 2010(r202194)
@@ -6,8 +6,8 @@ MAN=init.8
 PRECIOUSPROG=
 INSTALLFLAGS=-b -B.bak
 CFLAGS+=-DDEBUGSHELL -DSECURE -DLOGIN_CAP -DCOMPAT_SYSV_INIT
-DPADD= ${LIBUTIL} ${LIBULOG} ${LIBCRYPT}
-LDADD= -lutil -lulog -lcrypt
+DPADD= ${LIBUTIL} ${LIBCRYPT}
+LDADD= -lutil -lcrypt
 
 NO_SHARED?=YES
 

Modified: head/sbin/init/init.c
==
--- head/sbin/init/init.c   Wed Jan 13 17:56:54 2010(r202193)
+++ head/sbin/init/init.c   Wed Jan 13 17:58:49 2010(r202194)
@@ -65,9 +65,9 @@ static const char rcsid[] =
 #include 
 #include 
 #include 
-#define_ULOG_POSIX_NAMES
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -569,10 +569,13 @@ transition(state_t s)
  * NB: should send a message to the session logger to avoid blocking.
  */
 static void
-clear_session_logs(session_t *sp)
+clear_session_logs(session_t *sp __unused)
 {
 
-   ulog_logout(sp->se_device);
+   /*
+* XXX: Use getutxline() and call pututxline() for each entry.
+* Is this safe to do this here?  Is it really required anyway?
+*/
 }
 
 /*
___
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: r202195 - head/sbin/reboot

2010-01-13 Thread Ed Schouten
Author: ed
Date: Wed Jan 13 17:59:23 2010
New Revision: 202195
URL: http://svn.freebsd.org/changeset/base/202195

Log:
  Port the remaining apps in sbin/ to utmpx; only reboot(8).

Modified:
  head/sbin/reboot/Makefile
  head/sbin/reboot/reboot.c

Modified: head/sbin/reboot/Makefile
==
--- head/sbin/reboot/Makefile   Wed Jan 13 17:58:49 2010(r202194)
+++ head/sbin/reboot/Makefile   Wed Jan 13 17:59:23 2010(r202195)
@@ -2,8 +2,6 @@
 # $FreeBSD$
 
 PROG=  reboot
-DPADD= ${LIBULOG}
-LDADD= -lulog
 MAN=   reboot.8 nextboot.8
 MLINKS=reboot.8 halt.8 reboot.8 fastboot.8 reboot.8 fasthalt.8
 

Modified: head/sbin/reboot/reboot.c
==
--- head/sbin/reboot/reboot.c   Wed Jan 13 17:58:49 2010(r202194)
+++ head/sbin/reboot/reboot.c   Wed Jan 13 17:59:23 2010(r202195)
@@ -54,9 +54,8 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#define _ULOG_POSIX_NAMES
-#include 
 #include 
+#include 
 
 static void usage(void);
 static u_int get_pageins(void);
___
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: r202196 - head/lib/libopie

2010-01-13 Thread Ed Schouten
Author: ed
Date: Wed Jan 13 18:02:30 2010
New Revision: 202196
URL: http://svn.freebsd.org/changeset/base/202196

Log:
  Let libopie use utmpx instead of utmp.

Modified:
  head/lib/libopie/Makefile
  head/lib/libopie/config.h

Modified: head/lib/libopie/Makefile
==
--- head/lib/libopie/Makefile   Wed Jan 13 17:59:23 2010(r202195)
+++ head/lib/libopie/Makefile   Wed Jan 13 18:02:30 2010(r202196)
@@ -8,15 +8,14 @@ SHLIB_MAJOR=6
 
 KEYFILE?=  \"/etc/opiekeys\"
 
-.PATH: ${DIST_DIR} ${OPIE_DIST}/libmissing
+.PATH: ${DIST_DIR}
 
 LIB=   opie
 SRCS=  atob8.c btoa8.c btoh.c challenge.c getsequence.c hash.c hashlen.c \
keycrunch.c lock.c lookup.c newseed.c parsechallenge.c passcheck.c \
passwd.c randomchallenge.c readpass.c unlock.c verify.c version.c \
btoe.c accessfile.c generator.c insecure.c getutmpentry.c \
-   readrec.c writerec.c open.c \
-   getutline.c pututline.c endutent.c setutent.c # from libmissing
+   readrec.c writerec.c open.c
 SRCS+= opieextra.c
 INCS=  ${OPIE_DIST}/opie.h
 

Modified: head/lib/libopie/config.h
==
--- head/lib/libopie/config.h   Wed Jan 13 17:59:23 2010(r202195)
+++ head/lib/libopie/config.h   Wed Jan 13 18:02:30 2010(r202196)
@@ -216,7 +216,7 @@
 #define HAVE_GETUSERSHELL 1
 
 /* Define if you have the getutxline function.  */
-/* #undef HAVE_GETUTXLINE */
+#define HAVE_GETUTXLINE 1
 
 /* Define if you have the getwd function.  */
 /* #undef HAVE_GETWD */
@@ -231,7 +231,7 @@
 /* #undef HAVE_ON_EXIT */
 
 /* Define if you have the pututxline function.  */
-/* #undef HAVE_PUTUTXLINE */
+#define HAVE_PUTUTXLINE 1
 
 /* Define if you have the rindex function.  */
 /* #undef HAVE_RINDEX */
@@ -366,7 +366,7 @@
 #define HAVE_UNISTD_H 1
 
 /* Define if you have the  header file.  */
-/* #undef HAVE_UTMPX_H */
+#define HAVE_UTMPX_H 1
 
 /* Define if you have the crypt library (-lcrypt).  */
 #define HAVE_LIBCRYPT 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: r202197 - head/usr.bin/last

2010-01-13 Thread Ed Schouten
Author: ed
Date: Wed Jan 13 18:06:31 2010
New Revision: 202197
URL: http://svn.freebsd.org/changeset/base/202197

Log:
  Port last(1) to use utmpx.
  
  Basically there are three major things I changed about last(1):
  
  - It should use ut_type instead of determining by hand what type of
record was given.
  - It should now keep track of ut_id's instead of TTYs. This means the
ttylist has been renamed to the idlist, storing all the ut_id's it has
processed until the next reboot.
  - I've removed the signal handler. Because our wtmp is rotated so often,
it makes little sense. Even on a simple piece of hardware it should be
capable of grinding through megabytes of logs in a second.

Modified:
  head/usr.bin/last/last.c

Modified: head/usr.bin/last/last.c
==
--- head/usr.bin/last/last.cWed Jan 13 18:02:30 2010(r202196)
+++ head/usr.bin/last/last.cWed Jan 13 18:06:31 2010(r202197)
@@ -59,15 +59,13 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 
 #defineNO  0   /* false/no */
 #defineYES 1   /* true/yes */
 #defineATOI2(ar)   ((ar)[0] - '0') * 10 + ((ar)[1] - '0'); (ar) += 
2;
 
-static struct utmp buf[1024];  /* utmp read buffer */
-
 typedef struct arg {
char*name;  /* argument */
 #defineHOST_TYPE   -2
@@ -78,18 +76,18 @@ typedef struct arg {
 } ARG;
 ARG*arglist;   /* head of linked list */
 
-LIST_HEAD(ttylisthead, ttytab) ttylist;
+LIST_HEAD(idlisthead, idtab) idlist;
 
-struct ttytab {
+struct idtab {
time_t  logout; /* log out time */
-   chartty[UT_LINESIZE + 1];   /* terminal name */
-   LIST_ENTRY(ttytab) list;
+   charid[sizeof ((struct utmpx *)0)->ut_id]; /* identifier */
+   LIST_ENTRY(idtab) list;
 };
 
 static const   char *crmsg;/* cause of last reboot */
-static longcurrentout, /* current logout value */
-   maxrec; /* records to display */
-static const   char *file = _PATH_WTMP;/* wtmp file */
+static time_t  currentout; /* current logout value */
+static longmaxrec; /* records to display */
+static const   char *file = NULL;  /* wtmp file */
 static int sflag = 0;  /* show delta in seconds */
 static int width = 5;  /* show seconds in delta */
 static int yflag;  /* show year */
@@ -102,12 +100,11 @@ static time_t snaptime;   /* if 
!= 0, we
 
 voidaddarg(int, char *);
 time_t  dateconv(char *);
-voiddoentry(struct utmp *);
+voiddoentry(struct utmpx *);
 voidhostconv(char *);
-voidonintr(int);
-voidprintentry(struct utmp *, struct ttytab *);
+voidprintentry(struct utmpx *, struct idtab *);
 char   *ttyconv(char *);
-int want(struct utmp *);
+int want(struct utmpx *);
 voidusage(void);
 voidwtmp(void);
 
@@ -199,6 +196,8 @@ main(int argc, char *argv[])
exit(0);
 }
 
+#defineMAXUTXENTRIES   1024
+
 /*
  * wtmp --
  * read through the wtmp file
@@ -206,33 +205,34 @@ main(int argc, char *argv[])
 void
 wtmp(void)
 {
-   struct utmp *bp;/* current structure */
-   struct stat stb;/* stat of file for size */
-   longbl;
-   int bytes, wfd;
+   struct utmpx buf[MAXUTXENTRIES];
+   struct utmpx *ut;
+   static unsigned int first = 0, amount = 0;
+   time_t t;
char ct[80];
struct tm *tm;
-   time_t  t;
 
-   LIST_INIT(&ttylist);
+   LIST_INIT(&idlist);
+   (void)time(&t);
 
-   if ((wfd = open(file, O_RDONLY, 0)) < 0 || fstat(wfd, &stb) == -1)
+   /* Load the last entries from the file. */
+   if (setutxdb(UTXDB_LOG, file) != 0)
err(1, "%s", file);
-   bl = (stb.st_size + sizeof(buf) - 1) / sizeof(buf);
+   while ((ut = getutxent()) != NULL) {
+   memcpy(&buf[(first + amount) % MAXUTXENTRIES], ut, sizeof *ut);
+   if (amount == MAXUTXENTRIES)
+   first++;
+   else
+   amount++;
+   if (t > ut->ut_tv.tv_sec)
+   t = ut->ut_tv.tv_sec;
+   }
+   endutxent();
+
+   /* Display them in reverse order. */
+   while (amount > 0)
+   doentry(&buf[(first + amount--) % MAXUTXENTRIES]);
 
-   (void)time(&t);
-   buf[0].ut_time = _time_to_int(t);
-   (void)signal(SIGINT, onintr);
-   (void)signal(SIGQUIT, onintr);
-
-   while (--bl >= 0) {
-   if (lseek(wfd, (off_t)(bl * 

svn commit: r202198 - head/usr.bin/getent

2010-01-13 Thread Ed Schouten
Author: ed
Date: Wed Jan 13 18:08:00 2010
New Revision: 202198
URL: http://svn.freebsd.org/changeset/base/202198

Log:
  Allow getent(1) to display utmpx entries as well.
  
  Because getutxent also matches the typical get*ent format of library
  routines, I thought it would be a good idea to teach it how to read
  utmpx databases. getent(1) just gives a raw dump, which is very useful
  when debugging problems related to parsing/logging.

Modified:
  head/usr.bin/getent/getent.1
  head/usr.bin/getent/getent.c

Modified: head/usr.bin/getent/getent.1
==
--- head/usr.bin/getent/getent.1Wed Jan 13 18:06:31 2010
(r202197)
+++ head/usr.bin/getent/getent.1Wed Jan 13 18:08:00 2010
(r202198)
@@ -75,6 +75,7 @@ argument may be one of:
 .It Li rpc Ta name number [alias ...]
 .It Li services Ta name port/protocol [alias ...]
 .It Li shells Ta /path/to/shell
+.It Li utmpx Ta [time] type: properties
 .El
 .Pp
 If one or more
@@ -109,6 +110,7 @@ utility exits 0 on success,
 or 3 if there is no support for enumeration on
 .Ar database .
 .Sh SEE ALSO
+.Xr getutxent 3 ,
 .Xr ethers 5 ,
 .Xr group 5 ,
 .Xr hosts 5 ,

Modified: head/usr.bin/getent/getent.c
==
--- head/usr.bin/getent/getent.cWed Jan 13 18:06:31 2010
(r202197)
+++ head/usr.bin/getent/getent.cWed Jan 13 18:08:00 2010
(r202198)
@@ -60,6 +60,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 
 static int usage(void);
 static int parsenum(const char *, unsigned long *);
@@ -72,6 +73,7 @@ static intprotocols(int, char *[]);
 static int rpc(int, char *[]);
 static int services(int, char *[]);
 static int shells(int, char *[]);
+static int utmpx(int, char *[]);
 
 enum {
RV_OK   = 0,
@@ -93,6 +95,7 @@ static struct getentdb {
{   "rpc",  rpc,},
{   "services", services,   },
{   "shells",   shells, },
+   {   "utmpx",utmpx,  },
 
{   NULL,   NULL,   },
 };
@@ -562,3 +565,89 @@ shells(int argc, char *argv[])
endusershell();
return rv;
 }
+
+/*
+ * utmpx
+ */
+
+#defineUTMPXPRINTID do {   \
+   size_t i;   \
+   for (i = 0; i < sizeof ut->ut_id; i++)  \
+   printf("%02hhx", ut->ut_id[i]); \
+} while (0)
+
+static void
+utmpxprint(const struct utmpx *ut)
+{
+
+   if (ut->ut_type == EMPTY)
+   return;
+   
+   printf("[%.24s] ", ctime(&ut->ut_tv.tv_sec));
+
+   switch (ut->ut_type) {
+   case BOOT_TIME:
+   printf("system boot\n");
+   return;
+   case SHUTDOWN_TIME:
+   printf("system shutdown\n");
+   return;
+   case OLD_TIME:
+   printf("old system time\n");
+   return;
+   case NEW_TIME:
+   printf("new system time\n");
+   return;
+   case USER_PROCESS:
+   printf("user process: id=\"");
+   UTMPXPRINTID;
+   printf("\" user=\"%s\" line=\"%s\" host=\"%s\"\n",
+   ut->ut_user, ut->ut_line, ut->ut_host);
+   break;
+   case DEAD_PROCESS:
+   printf("dead process: id=\"");
+   UTMPXPRINTID;
+   printf("\"\n");
+   break;
+   default:
+   printf("unknown record type\n");
+   break;
+   }
+}
+
+static int
+utmpx(int argc, char *argv[])
+{
+   const struct utmpx *ut;
+   int rv = RV_OK, db;
+
+   assert(argc > 1);
+   assert(argv != NULL);
+
+   if (argc == 2) {
+   db = UTXDB_ACTIVE;
+   } else if (argc == 3) {
+   if (strcmp(argv[2], "active") == 0)
+   db = UTXDB_ACTIVE;
+   else if (strcmp(argv[2], "lastlogin") == 0)
+   db = UTXDB_LASTLOGIN;
+   else if (strcmp(argv[2], "log") == 0)
+   db = UTXDB_LOG;
+   else
+   rv = RV_USAGE;
+   } else {
+   rv = RV_USAGE;
+   }
+
+   if (rv == RV_USAGE) {
+   fprintf(stderr, "Usage: %s utmpx [active | lastlogin | log]\n",
+   getprogname());
+   } else if (rv == RV_OK) {
+   if (setutxdb(db, NULL) != 0)
+   return (RV_NOTFOUND);
+   while ((ut = getutxent()) != NULL)
+   utmpxprint(ut);
+   endutxent();
+   }
+   return (rv);
+}
___
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: r202199 - head/usr.bin/w

2010-01-13 Thread Ed Schouten
Author: ed
Date: Wed Jan 13 18:09:21 2010
New Revision: 202199
URL: http://svn.freebsd.org/changeset/base/202199

Log:
  Port w(1) to utmpx.
  
  Let it print "-" when the TTY string is empty. In this case, it must
  also make sure it doesn't match processes who also have no controlling
  TTY. Otherwise it will print random kernel processes when trying to pick
  the best matching process.
  
  Eventually it should look at the value of ut_pid as well.

Modified:
  head/usr.bin/w/Makefile
  head/usr.bin/w/w.c

Modified: head/usr.bin/w/Makefile
==
--- head/usr.bin/w/Makefile Wed Jan 13 18:08:00 2010(r202198)
+++ head/usr.bin/w/Makefile Wed Jan 13 18:09:21 2010(r202199)
@@ -4,8 +4,8 @@
 PROG=  w
 SRCS=  fmt.c pr_time.c proc_compare.c w.c
 MAN=   w.1 uptime.1
-DPADD= ${LIBKVM} ${LIBULOG} ${LIBUTIL}
-LDADD= -lkvm -lulog -lutil
+DPADD= ${LIBKVM} ${LIBUTIL}
+LDADD= -lkvm -lutil
 #BINGRP= kmem
 #BINMODE=2555
 LINKS= ${BINDIR}/w ${BINDIR}/uptime

Modified: head/usr.bin/w/w.c
==
--- head/usr.bin/w/w.c  Wed Jan 13 18:08:00 2010(r202198)
+++ head/usr.bin/w/w.c  Wed Jan 13 18:09:21 2010(r202199)
@@ -83,9 +83,8 @@ static const char sccsid[] = "@(#)w.c 8.
 #include 
 #include 
 #include 
-#define_ULOG_POSIX_NAMES
-#include 
 #include 
+#include 
 #include 
 
 #include "extern.h"
@@ -283,7 +282,8 @@ main(int argc, char *argv[])
if ((kp = kvm_getprocs(kd, KERN_PROC_ALL, 0, &nentries)) == NULL)
err(1, "%s", kvm_geterr(kd));
for (i = 0; i < nentries; i++, kp++) {
-   if (kp->ki_stat == SIDL || kp->ki_stat == SZOMB)
+   if (kp->ki_stat == SIDL || kp->ki_stat == SZOMB ||
+   kp->ki_tdev == NODEV)
continue;
for (ep = ehead; ep != NULL; ep = ep->next) {
if (ep->tdev == kp->ki_tdev) {
@@ -418,9 +418,10 @@ main(int argc, char *argv[])
(void)printf("%-*.*s %-*.*s %-*.*s ",
W_DISPUSERSIZE, W_DISPUSERSIZE, ep->utmp.ut_user,
W_DISPLINESIZE, W_DISPLINESIZE,
-   strncmp(ep->utmp.ut_line, "tty", 3) &&
+   *ep->utmp.ut_line ?
+   (strncmp(ep->utmp.ut_line, "tty", 3) &&
strncmp(ep->utmp.ut_line, "cua", 3) ?
-   ep->utmp.ut_line : ep->utmp.ut_line + 3,
+   ep->utmp.ut_line : ep->utmp.ut_line + 3) : "-",
W_DISPHOSTSIZE, W_DISPHOSTSIZE, *p ? p : "-");
t = ep->utmp.ut_tv.tv_sec;
longattime = pr_attime(&t, &now);
___
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: r202200 - in head/usr.bin: systat users wall who write

2010-01-13 Thread Ed Schouten
Author: ed
Date: Wed Jan 13 18:09:54 2010
New Revision: 202200
URL: http://svn.freebsd.org/changeset/base/202200

Log:
  Perform all trivial ports to utmpx for usr.bin/.
  
  They were already converted to use libulog, so it's easy to convert them
  to utmpx.

Modified:
  head/usr.bin/systat/Makefile
  head/usr.bin/systat/vmstat.c
  head/usr.bin/users/Makefile
  head/usr.bin/users/users.c
  head/usr.bin/wall/Makefile
  head/usr.bin/wall/wall.c
  head/usr.bin/who/Makefile
  head/usr.bin/who/who.c
  head/usr.bin/write/Makefile
  head/usr.bin/write/write.c

Modified: head/usr.bin/systat/Makefile
==
--- head/usr.bin/systat/MakefileWed Jan 13 18:09:21 2010
(r202199)
+++ head/usr.bin/systat/MakefileWed Jan 13 18:09:54 2010
(r202200)
@@ -16,7 +16,7 @@ CFLAGS+= -DINET6
 
 WARNS?=0
 
-DPADD= ${LIBCURSES} ${LIBM} ${LIBDEVSTAT} ${LIBKVM} ${LIBULOG}
-LDADD= -lcursesw -lm -ldevstat -lkvm -lulog
+DPADD= ${LIBCURSES} ${LIBM} ${LIBDEVSTAT} ${LIBKVM}
+LDADD= -lcursesw -lm -ldevstat -lkvm
 
 .include 

Modified: head/usr.bin/systat/vmstat.c
==
--- head/usr.bin/systat/vmstat.cWed Jan 13 18:09:21 2010
(r202199)
+++ head/usr.bin/systat/vmstat.cWed Jan 13 18:09:54 2010
(r202200)
@@ -65,9 +65,8 @@ static const char sccsid[] = "@(#)vmstat
 #include 
 #include 
 #include 
-#define_ULOG_POSIX_NAMES
-#include 
 #include 
+#include 
 #include 
 #include "systat.h"
 #include "extern.h"

Modified: head/usr.bin/users/Makefile
==
--- head/usr.bin/users/Makefile Wed Jan 13 18:09:21 2010(r202199)
+++ head/usr.bin/users/Makefile Wed Jan 13 18:09:54 2010(r202200)
@@ -3,7 +3,4 @@
 
 PROG=  users
 
-DPADD= ${LIBULOG}
-LDADD= -lulog
-
 .include 

Modified: head/usr.bin/users/users.c
==
--- head/usr.bin/users/users.c  Wed Jan 13 18:09:21 2010(r202199)
+++ head/usr.bin/users/users.c  Wed Jan 13 18:09:54 2010(r202200)
@@ -51,9 +51,8 @@ static const char rcsid[] =
 #include 
 #include 
 #include 
-#define_ULOG_POSIX_NAMES
-#include 
 #include 
+#include 
 
 typedef char   namebuf[MAXLOGNAME];
 

Modified: head/usr.bin/wall/Makefile
==
--- head/usr.bin/wall/Makefile  Wed Jan 13 18:09:21 2010(r202199)
+++ head/usr.bin/wall/Makefile  Wed Jan 13 18:09:54 2010(r202200)
@@ -6,7 +6,4 @@ SRCS=   ttymsg.c wall.c
 BINGRP=tty
 BINMODE=2555
 
-DPADD= ${LIBULOG}
-LDADD= -lulog
-
 .include 

Modified: head/usr.bin/wall/wall.c
==
--- head/usr.bin/wall/wall.cWed Jan 13 18:09:21 2010(r202199)
+++ head/usr.bin/wall/wall.cWed Jan 13 18:09:54 2010(r202200)
@@ -64,9 +64,8 @@ static const char sccsid[] = "@(#)wall.c
 #include 
 #include 
 #include 
-#define_ULOG_POSIX_NAMES
-#include 
 #include 
+#include 
 
 #include "ttymsg.h"
 

Modified: head/usr.bin/who/Makefile
==
--- head/usr.bin/who/Makefile   Wed Jan 13 18:09:21 2010(r202199)
+++ head/usr.bin/who/Makefile   Wed Jan 13 18:09:54 2010(r202200)
@@ -3,7 +3,4 @@
 
 PROG=  who
 
-DPADD= ${LIBULOG}
-LDADD= -lulog
-
 .include 

Modified: head/usr.bin/who/who.c
==
--- head/usr.bin/who/who.c  Wed Jan 13 18:09:21 2010(r202199)
+++ head/usr.bin/who/who.c  Wed Jan 13 18:09:54 2010(r202200)
@@ -44,9 +44,8 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#define _ULOG_POSIX_NAMES
-#include 
 #include 
+#include 
 
 static voidheading(void);
 static voidprocess_utmp(void);
@@ -109,7 +108,7 @@ main(int argc, char *argv[])
usage();
 
if (*argv != NULL) {
-   if (ulog_setutxfile(UTXI_TTY, *argv) != 0)
+   if (setutxdb(UTXDB_ACTIVE, *argv) != 0)
err(1, "%s", *argv);
}
 

Modified: head/usr.bin/write/Makefile
==
--- head/usr.bin/write/Makefile Wed Jan 13 18:09:21 2010(r202199)
+++ head/usr.bin/write/Makefile Wed Jan 13 18:09:54 2010(r202200)
@@ -5,7 +5,4 @@ PROG=   write
 BINMODE=2555
 BINGRP=tty
 
-DPADD= ${LIBULOG}
-LDADD= -lulog
-
 .include 

Modified: head/usr.bin/write/write.c
==
--- head/usr.bin/write/write.c  Wed Jan 13 18:09:21 2010(r202199)
+++ head/usr.bin/write/write.c  Wed Jan 13 18:09:54 2010(r202200)
@@ -62,9 +62,8 @@ __FBSDI

svn commit: r202201 - stable/8/lib/libc/stdtime

2010-01-13 Thread John Baldwin
Author: jhb
Date: Wed Jan 13 18:12:21 2010
New Revision: 202201
URL: http://svn.freebsd.org/changeset/base/202201

Log:
  MFC 199607, 200797, 201270, 201669:
  Use pthread_once() to initialize the thread-local storage for localtime()
  and gmtime() and _once() to initialize gmt state rather than home-rolled
  versions using pthread mutex locks.

Modified:
  stable/8/lib/libc/stdtime/localtime.c
Directory Properties:
  stable/8/lib/libc/   (props changed)
  stable/8/lib/libc/stdtime/   (props changed)

Modified: stable/8/lib/libc/stdtime/localtime.c
==
--- stable/8/lib/libc/stdtime/localtime.c   Wed Jan 13 18:09:54 2010
(r202200)
+++ stable/8/lib/libc/stdtime/localtime.c   Wed Jan 13 18:12:21 2010
(r202201)
@@ -235,9 +235,14 @@ static struct stategmtmem;
 
 static charlcl_TZname[TZ_STRLEN_MAX + 1];
 static int lcl_is_set;
-static int gmt_is_set;
+static pthread_once_t  gmt_once = PTHREAD_ONCE_INIT;
 static pthread_rwlock_tlcl_rwlock = PTHREAD_RWLOCK_INITIALIZER;
-static pthread_mutex_t gmt_mutex = PTHREAD_MUTEX_INITIALIZER;
+static pthread_once_t  gmtime_once = PTHREAD_ONCE_INIT;
+static pthread_key_t   gmtime_key;
+static int gmtime_key_error;
+static pthread_once_t  localtime_once = PTHREAD_ONCE_INIT;
+static pthread_key_t   localtime_key;
+static int localtime_key_error;
 
 char * tzname[2] = {
wildabbr,
@@ -1407,27 +1412,24 @@ struct tm * const   tmp;
return result;
 }
 
+static void
+localtime_key_init(void)
+{
+
+   localtime_key_error = _pthread_key_create(&localtime_key, free);
+}
+
 struct tm *
 localtime(timep)
 const time_t * const   timep;
 {
-   static pthread_mutex_t localtime_mutex = PTHREAD_MUTEX_INITIALIZER;
-   static pthread_key_t localtime_key = -1;
struct tm *p_tm;
-   int r;
 
if (__isthreaded != 0) {
-   if (localtime_key < 0) {
-   _pthread_mutex_lock(&localtime_mutex);
-   if (localtime_key < 0) {
-   if ((r = _pthread_key_create(&localtime_key,
-   free)) != 0) {
-   _pthread_mutex_unlock(&localtime_mutex);
-   errno = r;
-   return(NULL);
-   }
-   }
-   _pthread_mutex_unlock(&localtime_mutex);
+   _pthread_once(&localtime_once, localtime_key_init);
+   if (localtime_key_error != 0) {
+   errno = localtime_key_error;
+   return(NULL);
}
p_tm = _pthread_getspecific(localtime_key);
if (p_tm == NULL) {
@@ -1464,6 +1466,17 @@ struct tm *  tmp;
return tmp;
 }
 
+static void
+gmt_init(void)
+{
+
+#ifdef ALL_STATE
+   gmtptr = (struct state *) malloc(sizeof *gmtptr);
+   if (gmtptr != NULL)
+#endif /* defined ALL_STATE */
+   gmtload(gmtptr);
+}
+
 /*
 ** gmtsub is to gmtime as localsub is to localtime.
 */
@@ -1476,16 +1489,7 @@ struct tm * consttmp;
 {
register struct tm *result;
 
-   _MUTEX_LOCK(&gmt_mutex);
-   if (!gmt_is_set) {
-#ifdef ALL_STATE
-   gmtptr = (struct state *) malloc(sizeof *gmtptr);
-   if (gmtptr != NULL)
-#endif /* defined ALL_STATE */
-   gmtload(gmtptr);
-   gmt_is_set = TRUE;
-   }
-   _MUTEX_UNLOCK(&gmt_mutex);
+   _once(&gmt_once, gmt_init);
result = timesub(timep, offset, gmtptr, tmp);
 #ifdef TM_ZONE
/*
@@ -1509,27 +1513,24 @@ struct tm * const   tmp;
return result;
 }
 
+static void
+gmtime_key_init(void)
+{
+
+   gmtime_key_error = _pthread_key_create(&gmtime_key, free);
+}
+
 struct tm *
 gmtime(timep)
 const time_t * const   timep;
 {
-   static pthread_mutex_t gmtime_mutex = PTHREAD_MUTEX_INITIALIZER;
-   static pthread_key_t gmtime_key = -1;
struct tm *p_tm;
-   int r;
 
if (__isthreaded != 0) {
-   if (gmtime_key < 0) {
-   _pthread_mutex_lock(&gmtime_mutex);
-   if (gmtime_key < 0) {
-   if ((r = _pthread_key_create(&gmtime_key,
-   free)) != 0) {
-   _pthread_mutex_unlock(&gmtime_mutex);
-   errno = r;
-   return(NULL);
-   }
-   }
-   _pthread_mutex_unlock(&gmtime_mutex);
+   _pthread_once(&gmtime_once, gmtime_key_init);
+   if (gmtime_key_error != 0) {
+   errno = gmtime_key_error;
+ 

svn commit: r202202 - stable/7/lib/libc/stdtime

2010-01-13 Thread John Baldwin
Author: jhb
Date: Wed Jan 13 18:12:37 2010
New Revision: 202202
URL: http://svn.freebsd.org/changeset/base/202202

Log:
  MFC 199607, 200797, 201270, 201669:
  Use pthread_once() to initialize the thread-local storage for localtime()
  and gmtime() and _once() to initialize gmt state rather than home-rolled
  versions using pthread mutex locks.

Modified:
  stable/7/lib/libc/stdtime/localtime.c
Directory Properties:
  stable/7/lib/libc/   (props changed)
  stable/7/lib/libc/stdtime/   (props changed)

Modified: stable/7/lib/libc/stdtime/localtime.c
==
--- stable/7/lib/libc/stdtime/localtime.c   Wed Jan 13 18:12:21 2010
(r202201)
+++ stable/7/lib/libc/stdtime/localtime.c   Wed Jan 13 18:12:37 2010
(r202202)
@@ -235,9 +235,14 @@ static struct stategmtmem;
 
 static charlcl_TZname[TZ_STRLEN_MAX + 1];
 static int lcl_is_set;
-static int gmt_is_set;
+static pthread_once_t  gmt_once = PTHREAD_ONCE_INIT;
 static pthread_rwlock_tlcl_rwlock = PTHREAD_RWLOCK_INITIALIZER;
-static pthread_mutex_t gmt_mutex = PTHREAD_MUTEX_INITIALIZER;
+static pthread_once_t  gmtime_once = PTHREAD_ONCE_INIT;
+static pthread_key_t   gmtime_key;
+static int gmtime_key_error;
+static pthread_once_t  localtime_once = PTHREAD_ONCE_INIT;
+static pthread_key_t   localtime_key;
+static int localtime_key_error;
 
 char * tzname[2] = {
wildabbr,
@@ -1407,26 +1412,25 @@ struct tm * const   tmp;
return result;
 }
 
+static void
+localtime_key_init(void)
+{
+
+   localtime_key_error = _pthread_key_create(&localtime_key, free);
+}
+
 struct tm *
 localtime(timep)
 const time_t * const   timep;
 {
-   static pthread_mutex_t localtime_mutex = PTHREAD_MUTEX_INITIALIZER;
-   static pthread_key_t localtime_key = -1;
struct tm *p_tm;
-   int r;
 
if (__isthreaded != 0) {
-   _pthread_mutex_lock(&localtime_mutex);
-   if (localtime_key < 0) {
-   if ((r = _pthread_key_create(&localtime_key, free))
-   != 0) {
-   _pthread_mutex_unlock(&localtime_mutex);
-   errno = r;
-   return(NULL);
-   }
+   _pthread_once(&localtime_once, localtime_key_init);
+   if (localtime_key_error != 0) {
+   errno = localtime_key_error;
+   return(NULL);
}
-   _pthread_mutex_unlock(&localtime_mutex);
p_tm = _pthread_getspecific(localtime_key);
if (p_tm == NULL) {
if ((p_tm = (struct tm *)malloc(sizeof(struct tm)))
@@ -1462,6 +1466,17 @@ struct tm *  tmp;
return tmp;
 }
 
+static void
+gmt_init(void)
+{
+
+#ifdef ALL_STATE
+   gmtptr = (struct state *) malloc(sizeof *gmtptr);
+   if (gmtptr != NULL)
+#endif /* defined ALL_STATE */
+   gmtload(gmtptr);
+}
+
 /*
 ** gmtsub is to gmtime as localsub is to localtime.
 */
@@ -1474,16 +1489,7 @@ struct tm * consttmp;
 {
register struct tm *result;
 
-   _MUTEX_LOCK(&gmt_mutex);
-   if (!gmt_is_set) {
-   gmt_is_set = TRUE;
-#ifdef ALL_STATE
-   gmtptr = (struct state *) malloc(sizeof *gmtptr);
-   if (gmtptr != NULL)
-#endif /* defined ALL_STATE */
-   gmtload(gmtptr);
-   }
-   _MUTEX_UNLOCK(&gmt_mutex);
+   _once(&gmt_once, gmt_init);
result = timesub(timep, offset, gmtptr, tmp);
 #ifdef TM_ZONE
/*
@@ -1507,25 +1513,25 @@ struct tm * const   tmp;
return result;
 }
 
+static void
+gmtime_key_init(void)
+{
+
+   gmtime_key_error = _pthread_key_create(&gmtime_key, free);
+}
+
 struct tm *
 gmtime(timep)
 const time_t * const   timep;
 {
-   static pthread_mutex_t gmtime_mutex = PTHREAD_MUTEX_INITIALIZER;
-   static pthread_key_t gmtime_key = -1;
struct tm *p_tm;
-   int r;
 
if (__isthreaded != 0) {
-   _pthread_mutex_lock(&gmtime_mutex);
-   if (gmtime_key < 0) {
-   if ((r = _pthread_key_create(&gmtime_key, free)) != 0) {
-   _pthread_mutex_unlock(&gmtime_mutex);
-   errno = r;
-   return(NULL);
-   }
+   _pthread_once(&gmtime_once, gmtime_key_init);
+   if (gmtime_key_error != 0) {
+   errno = gmtime_key_error;
+   return(NULL);
}
-   _pthread_mutex_unlock(&gmtime_mutex);
/*
 * Changed to follow POSIX.1 threads standard, which
 * is what BSD currently has.
___
svn

svn commit: r202203 - head/usr.sbin/ac

2010-01-13 Thread Ed Schouten
Author: ed
Date: Wed Jan 13 18:14:59 2010
New Revision: 202203
URL: http://svn.freebsd.org/changeset/base/202203

Log:
  Port ac(8) to utmpx.
  
  Similar to last(1), it must compare ut_id's instead of TTYs to determine
  whether a session has been terminated. It must also use ut_type to
  determine the type of the login record instead figuring it out by
  itself.

Modified:
  head/usr.sbin/ac/ac.c

Modified: head/usr.sbin/ac/ac.c
==
--- head/usr.sbin/ac/ac.c   Wed Jan 13 18:12:37 2010(r202202)
+++ head/usr.sbin/ac/ac.c   Wed Jan 13 18:14:59 2010(r202203)
@@ -27,14 +27,14 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
+#include 
 
 /*
  * this is for our list of currently logged in sessions
  */
 struct utmp_list {
struct utmp_list *next;
-   struct utmp usr;
+   struct utmpx usr;
 };
 
 /*
@@ -42,7 +42,7 @@ struct utmp_list {
  */
 struct user_list {
struct user_list *next;
-   charname[UT_NAMESIZE+1];
+   charname[sizeof(((struct utmpx *)0)->ut_user)];
time_t  secs;
 };
 
@@ -51,7 +51,7 @@ struct user_list {
  */
 struct tty_list {
struct tty_list *next;
-   charname[UT_LINESIZE+3];
+   charname[sizeof(((struct utmpx *)0)->ut_host) + 2];
size_t  len;
int ret;
 };
@@ -81,15 +81,14 @@ static int Debug = 0;
 #endif
 
 intmain(int, char **);
-intac(FILE *);
+intac(const char *);
 struct tty_list*add_tty(char *);
 #ifdef DEBUG
-const char *debug_pfx(const struct utmp *, const struct utmp *);
+const char *debug_pfx(const struct utmpx *, const struct utmpx *);
 #endif
 intdo_tty(char *);
-FILE   *file(const char *);
-struct utmp_list   *log_in(struct utmp_list *, struct utmp *);
-struct utmp_list   *log_out(struct utmp_list *, struct utmp *);
+struct utmp_list   *log_in(struct utmp_list *, struct utmpx *);
+struct utmp_list   *log_out(struct utmp_list *, struct utmpx *);
 inton_console(struct utmp_list *);
 void   show(const char *, time_t);
 void   show_today(struct user_list *, struct utmp_list *,
@@ -98,22 +97,6 @@ void show_users(struct user_list *);
 struct user_list   *update_user(struct user_list *, char *, time_t);
 void   usage(void);
 
-/*
- * open wtmp or die
- */
-FILE *
-file(const char *name)
-{
-   FILE *fp;
-
-   if ((fp = fopen(name, "r")) == NULL)
-   err(1, "%s", name);
-   /* in case we want to discriminate */
-   if (strcmp(_PATH_WTMP, name))
-   Flags |= AC_W;
-   return fp;
-}
-
 struct tty_list *
 add_tty(char *name)
 {
@@ -173,8 +156,7 @@ on_console(struct utmp_list *head)
struct utmp_list *up;
 
for (up = head; up; up = up->next) {
-   if (strncmp(up->usr.ut_line, Console,
-   sizeof (up->usr.ut_line)) == 0)
+   if (strcmp(up->usr.ut_line, Console) == 0)
return 1;
}
return 0;
@@ -190,7 +172,7 @@ update_user(struct user_list *head, char
struct user_list *up;
 
for (up = head; up != NULL; up = up->next) {
-   if (strncmp(up->name, name, UT_NAMESIZE) == 0) {
+   if (strcmp(up->name, name) == 0) {
up->secs += secs;
Total += secs;
return head;
@@ -217,9 +199,10 @@ update_user(struct user_list *head, char
  * includes a timestamp (perhaps with year), device-name, and user-name.
  */
 const char *
-debug_pfx(const struct utmp *event_up, const struct utmp *userinf_up)
+debug_pfx(const struct utmpx *event_up, const struct utmpx *userinf_up)
 {
-   static char str_result[40+UT_LINESIZE+UT_NAMESIZE];
+   static char str_result[40 + sizeof(userinf_up->ut_line) +
+   sizeof(userinf_up->ut_user)];
static char thisyear[5];
size_t maxcopy;
time_t ut_timecopy;
@@ -231,15 +214,10 @@ debug_pfx(const struct utmp *event_up, c
strlcpy(thisyear, &str_result[20], sizeof(thisyear));
}
 
-   if (event_up->ut_time == 0)
+   if (event_up->ut_tv.tv_sec == 0)
strlcpy(str_result, "*ZeroTime* --:--:-- ", sizeof(str_result));
else {
-   /*
-   * The type of utmp.ut_time is not necessary type time_t, as
-   * it is explicitly defined as type int32_t.  Copy the value
-   * for platforms where sizeof(time_t) != sizeof(int32_t).
-   */
-   ut_timecopy = _time32_to_time(event_up->ut_time);
+   ut_timecopy = event_up->ut_tv.tv_sec;
strlcpy(str_result, ctime(&ut_timecopy), sizeof(str_result));
/*
 * Include 

svn commit: r202204 - head/usr.sbin/timed/timed

2010-01-13 Thread Ed Schouten
Author: ed
Date: Wed Jan 13 18:15:46 2010
New Revision: 202204
URL: http://svn.freebsd.org/changeset/base/202204

Log:
  Port timed away from logwtmp(3). Let it use utmpx.

Modified:
  head/usr.sbin/timed/timed/master.c
  head/usr.sbin/timed/timed/slave.c

Modified: head/usr.sbin/timed/timed/master.c
==
--- head/usr.sbin/timed/timed/master.c  Wed Jan 13 18:14:59 2010
(r202203)
+++ head/usr.sbin/timed/timed/master.c  Wed Jan 13 18:15:46 2010
(r202204)
@@ -44,6 +44,7 @@ static const char rcsid[] =
 #include 
 #include 
 #include 
+#include 
 #include "pathnames.h"
 
 extern int measure_delta;
@@ -56,8 +57,6 @@ static int slvcount;  /* slaves listeni
 
 static void mchgdate(struct tsp *);
 
-extern void logwtmp(char *, char *, char *);
-
 /*
  * The main function of `master' is to periodically compute the differences
  * (deltas) between its clock and the clocks of the slaves, to compute the
@@ -350,6 +349,7 @@ mchgdate(msg)
char tname[MAXHOSTNAMELEN];
char olddate[32];
struct timeval otime, ntime, tmptv;
+   struct utmpx utx;
 
(void)strcpy(tname, msg->tsp_name);
 
@@ -371,9 +371,13 @@ mchgdate(msg)
dictate = 3;
synch(tvtomsround(ntime));
} else {
-   logwtmp("|", "date", "");
+   utx.ut_type = OLD_TIME;
+   gettimeofday(&utx.ut_tv, NULL);
+   pututxline(&utx);
(void)settimeofday(&tmptv, 0);
-   logwtmp("{", "date", "");
+   utx.ut_type = NEW_TIME;
+   gettimeofday(&utx.ut_tv, NULL);
+   pututxline(&utx);
spreadtime();
}
 

Modified: head/usr.sbin/timed/timed/slave.c
==
--- head/usr.sbin/timed/timed/slave.c   Wed Jan 13 18:14:59 2010
(r202203)
+++ head/usr.sbin/timed/timed/slave.c   Wed Jan 13 18:15:46 2010
(r202204)
@@ -41,6 +41,7 @@ static const char rcsid[] =
 
 #include "globals.h"
 #include 
+#include 
 #include "pathnames.h"
 
 extern jmp_buf jmpenv;
@@ -57,8 +58,6 @@ static void schgdate(struct tsp *, char 
 static void setmaster(struct tsp *);
 static void answerdelay(void);
 
-extern void logwtmp(char *, char *, char *);
-
 int
 slave()
 {
@@ -80,6 +79,7 @@ slave()
char newdate[32];
struct netinfo *ntp;
struct hosttbl *htp;
+   struct utmpx utx;
 
 
old_slavenet = 0;
@@ -280,9 +280,13 @@ loop:
 */
synch(tvtomsround(ntime));
} else {
-   logwtmp("|", "date", "");
-   (void)settimeofday(&tmptv, 0);
-   logwtmp("{", "date", "");
+   utx.ut_type = OLD_TIME;
+   gettimeofday(&utx.ut_tv, NULL);
+   pututxline(&utx);
+   (void)settimeofday(&tmptv, 0);
+   utx.ut_type = NEW_TIME;
+   gettimeofday(&utx.ut_tv, NULL);
+   pututxline(&utx);
syslog(LOG_NOTICE,
   "date changed by %s from %s",
msg->tsp_name, olddate);
___
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: r202205 - head/usr.sbin/lastlogin

2010-01-13 Thread Ed Schouten
Author: ed
Date: Wed Jan 13 18:17:12 2010
New Revision: 202205
URL: http://svn.freebsd.org/changeset/base/202205

Log:
  Port lastlogin(8) to utmpx.
  
  While there, fix a bug I introduced previously. We must reopen the
  database for each username passed on the command line. We must rewind
  the database and search from the beginning.

Modified:
  head/usr.sbin/lastlogin/Makefile
  head/usr.sbin/lastlogin/lastlogin.c

Modified: head/usr.sbin/lastlogin/Makefile
==
--- head/usr.sbin/lastlogin/MakefileWed Jan 13 18:15:46 2010
(r202204)
+++ head/usr.sbin/lastlogin/MakefileWed Jan 13 18:17:12 2010
(r202205)
@@ -3,7 +3,4 @@
 PROG=  lastlogin
 MAN=   lastlogin.8
 
-DPADD= ${LIBULOG}
-LDADD= -lulog
-
 .include 

Modified: head/usr.sbin/lastlogin/lastlogin.c
==
--- head/usr.sbin/lastlogin/lastlogin.c Wed Jan 13 18:15:46 2010
(r202204)
+++ head/usr.sbin/lastlogin/lastlogin.c Wed Jan 13 18:17:12 2010
(r202205)
@@ -41,62 +41,62 @@ __RCSID("$NetBSD: lastlogin.c,v 1.4 1998
 #include 
 #include 
 #include 
-#include 
 #include 
+#include 
 
int main(int, char **);
-static voidoutput(struct ulog_utmpx *);
+static voidoutput(struct utmpx *);
 static voidusage(void);
 
 int
 main(int argc, char *argv[])
 {
int ch, i;
-   struct ulog_utmpx *u;
+   struct utmpx *u;
 
while ((ch = getopt(argc, argv, "")) != -1) {
usage();
}
 
-   if (ulog_setutxfile(UTXI_USER, NULL) != 0)
-   errx(1, "failed to open lastlog database");
-
setpassent(1);  /* Keep passwd file pointers open */
 
/* Process usernames given on the command line. */
if (argc > 1) {
for (i = 1; i < argc; ++i) {
-   if ((u = ulog_getutxuser(argv[i])) == NULL) {
+   if (setutxdb(UTXDB_LASTLOGIN, NULL) != 0)
+   errx(1, "failed to open lastlog database");
+   if ((u = getutxuser(argv[i])) == NULL) {
warnx("user '%s' not found", argv[i]);
continue;
}
output(u);
+   endutxent();
}
}
/* Read all lastlog entries, looking for active ones */
else {
-   while ((u = ulog_getutxent()) != NULL) {
+   if (setutxdb(UTXDB_LASTLOGIN, NULL) != 0)
+   errx(1, "failed to open lastlog database");
+   while ((u = getutxent()) != NULL) {
if (u->ut_type != USER_PROCESS)
continue;
output(u);
}
+   endutxent();
}
 
setpassent(0);  /* Close passwd file pointers */
-
-   ulog_endutxent();
exit(0);
 }
 
 /* Duplicate the output of last(1) */
 static void
-output(struct ulog_utmpx *u)
+output(struct utmpx *u)
 {
time_t t = u->ut_tv.tv_sec;
 
-   printf("%-16s  %-8s %-16s   %s",
-   u->ut_user, u->ut_line, u->ut_host,
-   (u->ut_type == USER_PROCESS) ? ctime(&t) : "Never logged in\n");
+   printf("%-10s %-8s %-22s %s",
+   u->ut_user, u->ut_line, u->ut_host, ctime(&t));
 }
 
 static void
___
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: r202206 - in head/usr.sbin: bsnmpd/modules/snmp_hostres rwhod syslogd

2010-01-13 Thread Ed Schouten
Author: ed
Date: Wed Jan 13 18:17:53 2010
New Revision: 202206
URL: http://svn.freebsd.org/changeset/base/202206

Log:
  Port all applications in usr.sbin/ from libulog to utmpx.

Modified:
  head/usr.sbin/bsnmpd/modules/snmp_hostres/Makefile
  head/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_scalars.c
  head/usr.sbin/rwhod/Makefile
  head/usr.sbin/rwhod/rwhod.c
  head/usr.sbin/syslogd/Makefile
  head/usr.sbin/syslogd/syslogd.c

Modified: head/usr.sbin/bsnmpd/modules/snmp_hostres/Makefile
==
--- head/usr.sbin/bsnmpd/modules/snmp_hostres/Makefile  Wed Jan 13 18:17:12 
2010(r202205)
+++ head/usr.sbin/bsnmpd/modules/snmp_hostres/Makefile  Wed Jan 13 18:17:53 
2010(r202206)
@@ -69,8 +69,8 @@ MAN=  snmp_hostres.3
 DEFS=  ${MOD}_tree.def
 BMIBS= BEGEMOT-HOSTRES-MIB.txt
 
-DPADD= ${LIBKVM} ${LIBDEVINFO} ${LIBM} ${LIBGEOM} ${LIBMEMSTAT} ${LIBULOG}
-LDADD= -lkvm -ldevinfo -lm -lgeom -lmemstat -lulog
+DPADD= ${LIBKVM} ${LIBDEVINFO} ${LIBM} ${LIBGEOM} ${LIBMEMSTAT}
+LDADD= -lkvm -ldevinfo -lm -lgeom -lmemstat
 
 .include 
 

Modified: head/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_scalars.c
==
--- head/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_scalars.c Wed Jan 13 
18:17:12 2010(r202205)
+++ head/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_scalars.c Wed Jan 13 
18:17:53 2010(r202206)
@@ -41,8 +41,7 @@
 #include 
 #include 
 #include 
-#define_ULOG_POSIX_NAMES
-#include 
+#include 
 
 #include "hostres_snmp.h"
 #include "hostres_oid.h"

Modified: head/usr.sbin/rwhod/Makefile
==
--- head/usr.sbin/rwhod/MakefileWed Jan 13 18:17:12 2010
(r202205)
+++ head/usr.sbin/rwhod/MakefileWed Jan 13 18:17:53 2010
(r202206)
@@ -6,7 +6,4 @@ MAN=rwhod.8
 
 WARNS?=3
 
-DPADD= ${LIBULOG}
-LDADD= -lulog
-
 .include 

Modified: head/usr.sbin/rwhod/rwhod.c
==
--- head/usr.sbin/rwhod/rwhod.c Wed Jan 13 18:17:12 2010(r202205)
+++ head/usr.sbin/rwhod/rwhod.c Wed Jan 13 18:17:53 2010(r202206)
@@ -67,9 +67,8 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#define_ULOG_POSIX_NAMES
-#include 
 #include 
+#include 
 #include 
 #include 
 

Modified: head/usr.sbin/syslogd/Makefile
==
--- head/usr.sbin/syslogd/Makefile  Wed Jan 13 18:17:12 2010
(r202205)
+++ head/usr.sbin/syslogd/Makefile  Wed Jan 13 18:17:53 2010
(r202206)
@@ -9,8 +9,8 @@ PROG=   syslogd
 MAN=   syslog.conf.5 syslogd.8
 SRCS=  syslogd.c ttymsg.c
 
-DPADD= ${LIBULOG} ${LIBUTIL}
-LDADD= -lulog -lutil
+DPADD= ${LIBUTIL}
+LDADD= -lutil
 
 WARNS?=3
 

Modified: head/usr.sbin/syslogd/syslogd.c
==
--- head/usr.sbin/syslogd/syslogd.c Wed Jan 13 18:17:12 2010
(r202205)
+++ head/usr.sbin/syslogd/syslogd.c Wed Jan 13 18:17:53 2010
(r202206)
@@ -105,9 +105,8 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#define_ULOG_POSIX_NAMES
-#include 
 #include 
+#include 
 
 #include "pathnames.h"
 #include "ttymsg.h"
___
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: r202207 - head/libexec/rlogind

2010-01-13 Thread Ed Schouten
Author: ed
Date: Wed Jan 13 18:24:04 2010
New Revision: 202207
URL: http://svn.freebsd.org/changeset/base/202207

Log:
  Remove `dead code' from rlogind.
  
  - It shouldn't call logwtmp(). Applications like login(1) already make
sure both login and logout entries are written to the storage.
  - There's no need to restore permissions on the pseudo-terminal, since
it should be garbage collected by the kernel.

Modified:
  head/libexec/rlogind/rlogind.c

Modified: head/libexec/rlogind/rlogind.c
==
--- head/libexec/rlogind/rlogind.c  Wed Jan 13 18:17:53 2010
(r202206)
+++ head/libexec/rlogind/rlogind.c  Wed Jan 13 18:24:04 2010
(r202207)
@@ -479,18 +479,7 @@ protocol(int f, int p)
 void
 cleanup(int signo)
 {
-   char *p;
 
-   p = line + sizeof(_PATH_DEV) - 1;
-   if (logout(p))
-   logwtmp(p, "", "");
-   (void)chflags(line, 0);
-   (void)chmod(line, 0666);
-   (void)chown(line, 0, 0);
-   *p = 'p';
-   (void)chflags(line, 0);
-   (void)chmod(line, 0666);
-   (void)chown(line, 0, 0);
shutdown(netf, SHUT_RDWR);
exit(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: r202208 - head/libexec/comsat

2010-01-13 Thread Ed Schouten
Author: ed
Date: Wed Jan 13 18:25:43 2010
New Revision: 202208
URL: http://svn.freebsd.org/changeset/base/202208

Log:
  Port comsat to utmpx.
  
  It seems comsat stats the utmpx database each 15 seconds to see whether
  it has been changed. I am changing this behaviour to look at the utmpx
  database upon processing. I don't want to allow direct interference with
  the database files. I also wonder whether this optimization has any
  measurable performance benefit nowadays.

Modified:
  head/libexec/comsat/comsat.c

Modified: head/libexec/comsat/comsat.c
==
--- head/libexec/comsat/comsat.cWed Jan 13 18:24:04 2010
(r202207)
+++ head/libexec/comsat/comsat.cWed Jan 13 18:25:43 2010
(r202208)
@@ -66,7 +66,7 @@ static const char rcsid[] =
 #include 
 #include 
 #include 
-#include 
+#include 
 
 intdebug = 0;
 #definedsyslog if (debug) syslog
@@ -74,14 +74,10 @@ int debug = 0;
 #define MAXIDLE120
 
 char   hostname[MAXHOSTNAMELEN];
-struct utmp *utmp = NULL;
-time_t lastmsgtime;
-intnutmp, uf;
 
 void jkfprintf(FILE *, char[], char[], off_t);
 void mailfor(char *);
-void notify(struct utmp *, char[], off_t, int);
-void onalrm(int);
+void notify(struct utmpx *, char[], off_t, int);
 void reapchildren(int);
 
 int
@@ -102,15 +98,7 @@ main(int argc __unused, char *argv[] __u
(void) recv(0, msgbuf, sizeof(msgbuf) - 1, 0);
exit(1);
}
-   if ((uf = open(_PATH_UTMP, O_RDONLY, 0)) < 0) {
-   syslog(LOG_ERR, "open: %s: %m", _PATH_UTMP);
-   (void) recv(0, msgbuf, sizeof(msgbuf) - 1, 0);
-   exit(1);
-   }
-   (void)time(&lastmsgtime);
(void)gethostname(hostname, sizeof(hostname));
-   onalrm(0);
-   (void)signal(SIGALRM, onalrm);
(void)signal(SIGTTOU, SIG_IGN);
(void)signal(SIGCHLD, reapchildren);
for (;;) {
@@ -121,11 +109,7 @@ main(int argc __unused, char *argv[] __u
errno = 0;
continue;
}
-   if (!nutmp) /* no one has logged in yet */
-   continue;
-   sigblock(sigmask(SIGALRM));
msgbuf[cc] = '\0';
-   (void)time(&lastmsgtime);
mailfor(msgbuf);
sigsetmask(0L);
}
@@ -138,40 +122,15 @@ reapchildren(int signo __unused)
 }
 
 void
-onalrm(int signo __unused)
-{
-   static off_t utmpsize;  /* last malloced size for utmp */
-   static time_t utmpmtime;/* last modification time for utmp */
-   struct stat statbf;
-
-   if (time(NULL) - lastmsgtime >= MAXIDLE)
-   exit(0);
-   (void)alarm((u_int)15);
-   (void)fstat(uf, &statbf);
-   if (statbf.st_mtime > utmpmtime) {
-   utmpmtime = statbf.st_mtime;
-   if (statbf.st_size > utmpsize) {
-   utmpsize = statbf.st_size + 10 * sizeof(struct utmp);
-   if ((utmp = realloc(utmp, utmpsize)) == NULL) {
-   syslog(LOG_ERR, "%s", strerror(errno));
-   exit(1);
-   }
-   }
-   (void)lseek(uf, (off_t)0, SEEK_SET);
-   nutmp = read(uf, utmp, (size_t)statbf.st_size)/sizeof(struct 
utmp);
-   }
-}
-
-void
 mailfor(char *name)
 {
-   struct utmp *utp = &utmp[nutmp];
+   struct utmpx *utp;
char *cp;
char *file;
off_t offset;
int folder;
-   char buf[sizeof(_PATH_MAILDIR) + sizeof(utmp[0].ut_name) + 1];
-   char buf2[sizeof(_PATH_MAILDIR) + sizeof(utmp[0].ut_name) + 1];
+   char buf[sizeof(_PATH_MAILDIR) + sizeof(utp->ut_user) + 1];
+   char buf2[sizeof(_PATH_MAILDIR) + sizeof(utp->ut_user) + 1];
 
if (!(cp = strchr(name, '@')))
return;
@@ -181,33 +140,35 @@ mailfor(char *name)
file = name;
else
file = cp + 1;
-   sprintf(buf, "%s/%.*s", _PATH_MAILDIR, (int)sizeof(utmp[0].ut_name),
+   sprintf(buf, "%s/%.*s", _PATH_MAILDIR, (int)sizeof(utp->ut_user),
name);
if (*file != '/') {
sprintf(buf2, "%s/%.*s", _PATH_MAILDIR,
-   (int)sizeof(utmp[0].ut_name), file);
+   (int)sizeof(utp->ut_user), file);
file = buf2;
}
folder = strcmp(buf, file);
-   while (--utp >= utmp)
-   if (!strncmp(utp->ut_name, name, sizeof(utmp[0].ut_name)))
+   setutxent();
+   while ((utp = getutxent()) != NULL)
+   if (utp->ut_type == USER_PROCESS && !strcmp(utp->ut_user, name))
notify(utp, file, offset, folder);
+   endutxent();
 }
 
 static const char *cr;
 
 void
-notify(struct utmp *utp, char file[], off_t offset, int folder)
+notify(struct utmpx *utp, char file

svn commit: r202209 - head/libexec/ftpd

2010-01-13 Thread Ed Schouten
Author: ed
Date: Wed Jan 13 18:28:41 2010
New Revision: 202209
URL: http://svn.freebsd.org/changeset/base/202209

Log:
  Port ftpd to utmpx.
  
  Unfortunately I have to partially wreck its functionality, though. ftpd
  used to keep a file descriptor to the wtmp, which allowed it to work
  from within a chroot. The current utmpx implementation doesn't offer a
  way to do this. Maybe we can address this in the future, if it turns out
  to be a real issue.

Modified:
  head/libexec/ftpd/ftpd.c
  head/libexec/ftpd/logwtmp.c

Modified: head/libexec/ftpd/ftpd.c
==
--- head/libexec/ftpd/ftpd.cWed Jan 13 18:25:43 2010(r202208)
+++ head/libexec/ftpd/ftpd.cWed Jan 13 18:28:41 2010(r202209)
@@ -173,8 +173,7 @@ static struct ftphost {
 char   remotehost[NI_MAXHOST];
 char   *ident = NULL;
 
-static charttyline[20];
-char   *tty = ttyline; /* for klogin */
+static charwtmpid[20];
 
 #ifdef USE_PAM
 static int auth_pam(struct passwd**, const char*);
@@ -584,8 +583,7 @@ gotchild:
 
data_source.su_port = htons(ntohs(ctrl_addr.su_port) - 1);
 
-   /* set this here so klogin can use it... */
-   (void)snprintf(ttyline, sizeof(ttyline), "ftp%d", getpid());
+   (void)snprintf(wtmpid, sizeof(wtmpid), "%xftpd", getpid());
 
/* Try to handle urgent data inline */
 #ifdef SO_OOBINLINE
@@ -1180,8 +1178,8 @@ end_login(void)
 #endif
 
(void) seteuid(0);
-   if (logged_in && dowtmp)
-   ftpd_logwtmp(ttyline, "", NULL);
+   if (logged_in && dowtmp && !dochroot)
+   ftpd_logwtmp(wtmpid, "", NULL);
pw = NULL;
 #ifdef LOGIN_CAP
setusercontext(NULL, getpwuid(0), 0,
@@ -1476,9 +1474,16 @@ skip:
}
 #endif
 
-   /* open wtmp before chroot */
-   if (dowtmp)
-   ftpd_logwtmp(ttyline, pw->pw_name,
+   dochroot =
+   checkuser(_PATH_FTPCHROOT, pw->pw_name, 1, &residue)
+#ifdef LOGIN_CAP   /* Allow login.conf configuration as well */
+   || login_getcapbool(lc, "ftp-chroot", 0)
+#endif
+   ;
+   chrootdir = NULL;
+
+   if (dowtmp && !dochroot)
+   ftpd_logwtmp(wtmpid, pw->pw_name,
(struct sockaddr *)&his_addr);
logged_in = 1;
 
@@ -1491,13 +1496,6 @@ skip:
if (statfd < 0)
stats = 0;
 
-   dochroot =
-   checkuser(_PATH_FTPCHROOT, pw->pw_name, 1, &residue)
-#ifdef LOGIN_CAP   /* Allow login.conf configuration as well */
-   || login_getcapbool(lc, "ftp-chroot", 0)
-#endif
-   ;
-   chrootdir = NULL;
/*
 * For a chrooted local user,
 * a) see whether ftpchroot(5) specifies a chroot directory,
@@ -2732,9 +2730,9 @@ void
 dologout(int status)
 {
 
-   if (logged_in && dowtmp) {
+   if (logged_in && dowtmp && !dochroot) {
(void) seteuid(0);
-   ftpd_logwtmp(ttyline, "", NULL);
+   ftpd_logwtmp(wtmpid, "", NULL);
}
/* beware of flushing buffers after a SIGPIPE */
_exit(status);

Modified: head/libexec/ftpd/logwtmp.c
==
--- head/libexec/ftpd/logwtmp.c Wed Jan 13 18:25:43 2010(r202208)
+++ head/libexec/ftpd/logwtmp.c Wed Jan 13 18:28:41 2010(r202209)
@@ -46,47 +46,35 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
+#include 
 #include 
 #include 
-#include 
+#include 
+#include 
 #include "extern.h"
 
-static int fd = -1;
-
-/*
- * Modified version of logwtmp that holds wtmp file open
- * after first call, for use with ftp (which may chroot
- * after login, but before logout).
- */
 void
-ftpd_logwtmp(line, name, addr)
-   char *line, *name;
-   struct sockaddr *addr;
+ftpd_logwtmp(char *id, char *user, struct sockaddr *addr)
 {
-   struct utmp ut;
-   struct stat buf;
-   char host[UT_HOSTSIZE];
-
-   if (addr == NULL)
-   host[0] = '\0';
-   else
-   realhostname_sa(host, sizeof(host), addr, addr->sa_len);
-
-   if (fd < 0 && (fd = open(_PATH_WTMP, O_WRONLY|O_APPEND, 0)) < 0)
-   return;
-   if (fstat(fd, &buf) == 0) {
-   (void)strncpy(ut.ut_line, line, sizeof(ut.ut_line));
-   (void)strncpy(ut.ut_name, name, sizeof(ut.ut_name));
-   (void)strncpy(ut.ut_host, host, sizeof(ut.ut_host));
-   ut.ut_time = _time_to_time32(time(NULL));
-   if (write(fd, &ut, sizeof(struct utmp)) !=
-   sizeof(struct utmp))
-   (void)ftruncate(fd, buf.st_size);
+   struct utmpx ut;
+
+   memset(&ut, 0, sizeof(ut));
+
+   if (*user != '\0') {
+   /* Log in. */
+   ut.ut_type = USER_PROCESS;
+   (void)strncpy(ut.ut

svn commit: r202210 - in head/libexec: rpc.rusersd talkd

2010-01-13 Thread Ed Schouten
Author: ed
Date: Wed Jan 13 18:28:58 2010
New Revision: 202210
URL: http://svn.freebsd.org/changeset/base/202210

Log:
  Port all apps in libexec/ from libulog to utmpx.

Modified:
  head/libexec/rpc.rusersd/Makefile
  head/libexec/rpc.rusersd/rusers_proc.c
  head/libexec/talkd/Makefile
  head/libexec/talkd/process.c

Modified: head/libexec/rpc.rusersd/Makefile
==
--- head/libexec/rpc.rusersd/Makefile   Wed Jan 13 18:28:41 2010
(r202209)
+++ head/libexec/rpc.rusersd/Makefile   Wed Jan 13 18:28:58 2010
(r202210)
@@ -4,8 +4,8 @@ PROG =  rpc.rusersd
 SRCS = rusersd.c rusers_proc.c
 MAN =  rpc.rusersd.8
 
-DPADD= ${LIBRPCSVC} ${LIBULOG} ${LIBUTIL}
-LDADD= -lrpcsvc -lulog -lutil
+DPADD= ${LIBRPCSVC} ${LIBUTIL}
+LDADD= -lrpcsvc -lutil
 
 #.if exists(/usr/X11R6/include/X11/extensions/xidle.h)
 #CFLAGS+= -DXIDLE

Modified: head/libexec/rpc.rusersd/rusers_proc.c
==
--- head/libexec/rpc.rusersd/rusers_proc.c  Wed Jan 13 18:28:41 2010
(r202209)
+++ head/libexec/rpc.rusersd/rusers_proc.c  Wed Jan 13 18:28:58 2010
(r202210)
@@ -45,8 +45,7 @@ static const char rcsid[] =
 #include 
 #include 
 #include 
-#define_ULOG_POSIX_NAMES
-#include 
+#include 
 #ifdef XIDLE
 #include 
 #include 

Modified: head/libexec/talkd/Makefile
==
--- head/libexec/talkd/Makefile Wed Jan 13 18:28:41 2010(r202209)
+++ head/libexec/talkd/Makefile Wed Jan 13 18:28:58 2010(r202210)
@@ -7,8 +7,4 @@ SRCS=   talkd.c announce.c process.c table
 MAN=   talkd.8
 CFLAGS+=-I${.CURDIR}/../../usr.bin/wall
 
-
-DPADD= ${LIBULOG}
-LDADD= -lulog
-
 .include 

Modified: head/libexec/talkd/process.c
==
--- head/libexec/talkd/process.cWed Jan 13 18:28:41 2010
(r202209)
+++ head/libexec/talkd/process.cWed Jan 13 18:28:58 2010
(r202210)
@@ -59,8 +59,7 @@ static const char rcsid[] =
 #include 
 #include 
 #include 
-#define_ULOG_POSIX_NAMES
-#include 
+#include 
 
 #include "extern.h"
 
___
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: r202211 - head/lib/libpam/modules/pam_lastlog

2010-01-13 Thread Ed Schouten
Author: ed
Date: Wed Jan 13 18:32:31 2010
New Revision: 202211
URL: http://svn.freebsd.org/changeset/base/202211

Log:
  Let pam_lastlog use utmpx instead of libulog's utmpx interface.
  
  It will still use ulog_login(3) and ulog_logout(3), which will remain
  present.

Modified:
  head/lib/libpam/modules/pam_lastlog/pam_lastlog.c

Modified: head/lib/libpam/modules/pam_lastlog/pam_lastlog.c
==
--- head/lib/libpam/modules/pam_lastlog/pam_lastlog.c   Wed Jan 13 18:28:58 
2010(r202210)
+++ head/lib/libpam/modules/pam_lastlog/pam_lastlog.c   Wed Jan 13 18:32:31 
2010(r202211)
@@ -49,6 +49,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 
 #define PAM_SM_SESSION
 
@@ -61,7 +62,7 @@ pam_sm_open_session(pam_handle_t *pamh, 
 int argc __unused, const char *argv[] __unused)
 {
struct passwd *pwd;
-   struct ulog_utmpx *utx;
+   struct utmpx *utx;
time_t t;
const char *user;
const void *rhost, *tty;
@@ -91,10 +92,10 @@ pam_sm_open_session(pam_handle_t *pamh, 
}
 
if ((flags & PAM_SILENT) == 0) {
-   if (ulog_setutxfile(UTXI_USER, NULL) != 0) {
-   PAM_LOG("Failed to open lastlog database");
+   if (setutxdb(UTXDB_LASTLOGIN, NULL) != 0) {
+   PAM_LOG("Failed to open lastlogin database");
} else {
-   utx = ulog_getutxuser(user);
+   utx = getutxuser(user);
if (utx != NULL && utx->ut_type == USER_PROCESS) {
t = utx->ut_tv.tv_sec;
if (*utx->ut_host != '\0')
@@ -104,7 +105,7 @@ pam_sm_open_session(pam_handle_t *pamh, 
pam_info(pamh, "Last login: %.*s on %s",
24 - 5, ctime(&t), utx->ut_line);
}
-   ulog_endutxent();
+   endutxent();
}
}
 
___
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: r202212 - head/contrib/telnet/telnetd

2010-01-13 Thread Ed Schouten
Author: ed
Date: Wed Jan 13 18:37:42 2010
New Revision: 202212
URL: http://svn.freebsd.org/changeset/base/202212

Log:
  Let telnetd build without utmp and logwtmp(3).
  
  Just like rlogind, there is no need to change the ownership of the
  terminal during shutdown anymore. Also don't call logwtmp, because the
  login(1)/PAM is responsible for doing this. Also use SHUT_RDWR instead
  of 2.

Modified:
  head/contrib/telnet/telnetd/sys_term.c
  head/contrib/telnet/telnetd/telnetd.c

Modified: head/contrib/telnet/telnetd/sys_term.c
==
--- head/contrib/telnet/telnetd/sys_term.c  Wed Jan 13 18:32:31 2010
(r202211)
+++ head/contrib/telnet/telnetd/sys_term.c  Wed Jan 13 18:37:42 2010
(r202212)
@@ -1303,24 +1303,7 @@ scrub_env(void)
 void
 cleanup(int sig __unused)
 {
-   char *p;
-   sigset_t mask;
 
-   p = line + sizeof(_PATH_DEV) - 1;
-   /*
-* Block all signals before clearing the utmp entry.  We don't want to
-* be called again after calling logout() and then not add the wtmp
-* entry because of not finding the corresponding entry in utmp.
-*/
-   sigfillset(&mask);
-   sigprocmask(SIG_SETMASK, &mask, NULL);
-   if (logout(p))
-   logwtmp(p, "", "");
-   (void)chmod(line, 0666);
-   (void)chown(line, 0, 0);
-   *p = 'p';
-   (void)chmod(line, 0666);
-   (void)chown(line, 0, 0);
-   (void) shutdown(net, 2);
+   (void) shutdown(net, SHUT_RDWR);
_exit(1);
 }

Modified: head/contrib/telnet/telnetd/telnetd.c
==
--- head/contrib/telnet/telnetd/telnetd.c   Wed Jan 13 18:32:31 2010
(r202211)
+++ head/contrib/telnet/telnetd/telnetd.c   Wed Jan 13 18:37:42 2010
(r202212)
@@ -47,7 +47,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
 
 #include 
 
___
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: r202213 - head/crypto/openssh

2010-01-13 Thread Ed Schouten
Author: ed
Date: Wed Jan 13 18:43:32 2010
New Revision: 202213
URL: http://svn.freebsd.org/changeset/base/202213

Log:
  Make OpenSSH work with utmpx.
  
  - Partially revert r184122 (sshd.c). Our ut_host is now big enough to
fit proper hostnames.
  
  - Change config.h to match reality.
  
  - defines.h requires UTMPX_FILE to be set by  before it allows
the utmpx code to work. This makes no sense to me. I've already
mentioned this upstream.
  
  - Add our own platform-specific handling of lastlog. The version I will
send to the OpenSSH folks will use proper autoconf generated
definitions instead of `#if 1'.

Modified:
  head/crypto/openssh/config.h
  head/crypto/openssh/defines.h
  head/crypto/openssh/loginrec.c
  head/crypto/openssh/sshd.c

Modified: head/crypto/openssh/config.h
==
--- head/crypto/openssh/config.hWed Jan 13 18:37:42 2010
(r202212)
+++ head/crypto/openssh/config.hWed Jan 13 18:43:32 2010
(r202213)
@@ -85,13 +85,13 @@
 /* #undef CONF_UTMPX_FILE */
 
 /* Define if you want to specify the path to your utmp file */
-#define CONF_UTMP_FILE "/var/run/utmp"
+/* #undef CONF_UTMP_FILE */
 
 /* Define if you want to specify the path to your wtmpx file */
 /* #undef CONF_WTMPX_FILE */
 
 /* Define if you want to specify the path to your wtmp file */
-#define CONF_WTMP_FILE "/var/log/wtmp"
+/* #undef CONF_WTMP_FILE */
 
 /* Define if your platform needs to skip post auth file descriptor passing */
 /* #undef DISABLE_FD_PASSING */
@@ -112,13 +112,13 @@
 /* #undef DISABLE_SHADOW */
 
 /* Define if you don't want to use utmp */
-/* #undef DISABLE_UTMP */
+#define DISABLE_UTMP 1
 
 /* Define if you don't want to use utmpx */
-#define DISABLE_UTMPX 1
+/* #undef DISABLE_UTMPX */
 
 /* Define if you don't want to use wtmp */
-/* #undef DISABLE_WTMP */
+#define DISABLE_WTMP 1
 
 /* Define if you don't want to use wtmpx */
 #define DISABLE_WTMPX 1
@@ -319,7 +319,7 @@
 /* #undef HAVE_ENDUTENT */
 
 /* Define to 1 if you have the `endutxent' function. */
-/* #undef HAVE_ENDUTXENT */
+#define HAVE_ENDUTXENT 1
 
 /* Define if your system has /etc/default/login */
 /* #undef HAVE_ETC_DEFAULT_LOGIN */
@@ -445,13 +445,13 @@
 /* #undef HAVE_GETUTLINE */
 
 /* Define to 1 if you have the `getutxent' function. */
-/* #undef HAVE_GETUTXENT */
+#define HAVE_GETUTXENT 1
 
 /* Define to 1 if you have the `getutxid' function. */
-/* #undef HAVE_GETUTXID */
+#define HAVE_GETUTXID 1
 
 /* Define to 1 if you have the `getutxline' function. */
-/* #undef HAVE_GETUTXLINE */
+#define HAVE_GETUTXLINE 1
 
 /* Define to 1 if you have the `get_default_context_with_level' function. */
 /* #undef HAVE_GET_DEFAULT_CONTEXT_WITH_LEVEL */
@@ -484,10 +484,10 @@
 #define HAVE_HEADER_AD 1
 
 /* Define if you have ut_host in utmp.h */
-#define HAVE_HOST_IN_UTMP 1
+/* #undef HAVE_HOST_IN_UTMP */
 
 /* Define if you have ut_host in utmpx.h */
-/* #undef HAVE_HOST_IN_UTMPX */
+#define HAVE_HOST_IN_UTMPX 1
 
 /* Define to 1 if you have the  header file. */
 /* #undef HAVE_IAF_H */
@@ -499,7 +499,7 @@
 /* #undef HAVE_ID_IN_UTMP */
 
 /* Define if you have ut_id in utmpx.h */
-/* #undef HAVE_ID_IN_UTMPX */
+#define HAVE_ID_IN_UTMPX 1
 
 /* Define to 1 if you have the `inet_aton' function. */
 #define HAVE_INET_ATON 1
@@ -574,7 +574,7 @@
 /* #undef HAVE_LINUX_IF_TUN_H */
 
 /* Define if your libraries define login() */
-#define HAVE_LOGIN 1
+/* #undef HAVE_LOGIN */
 
 /* Define to 1 if you have the  header file. */
 #define HAVE_LOGIN_CAP_H 1
@@ -586,10 +586,10 @@
 /* #undef HAVE_LOGIN_H */
 
 /* Define to 1 if you have the `logout' function. */
-#define HAVE_LOGOUT 1
+/* #undef HAVE_LOGOUT */
 
 /* Define to 1 if you have the `logwtmp' function. */
-#define HAVE_LOGWTMP 1
+/* #undef HAVE_LOGWTMP */
 
 /* Define to 1 if the system has the type `long double'. */
 #define HAVE_LONG_DOUBLE 1
@@ -704,7 +704,7 @@
 /* #undef HAVE_PUTUTLINE */
 
 /* Define to 1 if you have the `pututxline' function. */
-/* #undef HAVE_PUTUTXLINE */
+#define HAVE_PUTUTXLINE 1
 
 /* Define if your password has a pw_change field */
 #define HAVE_PW_CHANGE_IN_PASSWD 1
@@ -800,7 +800,7 @@
 /* #undef HAVE_SETUTENT */
 
 /* Define to 1 if you have the `setutxent' function. */
-/* #undef HAVE_SETUTXENT */
+#define HAVE_SETUTXENT 1
 
 /* Define to 1 if you have the `setvbuf' function. */
 #define HAVE_SETVBUF 1
@@ -1025,7 +1025,7 @@
 #define HAVE_TIME_H 1
 
 /* Define if you have ut_time in utmp.h */
-#define HAVE_TIME_IN_UTMP 1
+/* #undef HAVE_TIME_IN_UTMP */
 
 /* Define if you have ut_time in utmpx.h */
 /* #undef HAVE_TIME_IN_UTMPX */
@@ -1043,13 +1043,13 @@
 /* #undef HAVE_TV_IN_UTMP */
 
 /* Define if you have ut_tv in utmpx.h */
-/* #undef HAVE_TV_IN_UTMPX */
+#define HAVE_TV_IN_UTMPX 1
 
 /* Define if you have ut_type in utmp.h */
 /* #undef HAVE_TYPE_IN_UTMP */
 
 /* Define if you have ut_type in utmpx.h */
-/* #undef HAVE_TYPE_IN_UTMPX */
+#define

svn commit: r202214 - head/contrib/telnet/telnetd

2010-01-13 Thread Ed Schouten
Author: ed
Date: Wed Jan 13 18:46:50 2010
New Revision: 202214
URL: http://svn.freebsd.org/changeset/base/202214

Log:
  Forgot a part that was missing in the previous commit.
  
  There is no need to call trimdomain() anymore now that ut_host is big
  enough to fit decent hostnames.

Modified:
  head/contrib/telnet/telnetd/telnetd.c

Modified: head/contrib/telnet/telnetd/telnetd.c
==
--- head/contrib/telnet/telnetd/telnetd.c   Wed Jan 13 18:43:32 2010
(r202213)
+++ head/contrib/telnet/telnetd/telnetd.c   Wed Jan 13 18:46:50 2010
(r202214)
@@ -692,7 +692,6 @@ doit(struct sockaddr *who)
Please contact your net administrator");
remote_hostname[sizeof(remote_hostname) - 1] = '\0';
 
-   trimdomain(remote_hostname, UT_HOSTSIZE);
if (!isdigit(remote_hostname[0]) && strlen(remote_hostname) > utmp_len)
err_ = getnameinfo(who, who->sa_len, remote_hostname,
  sizeof(remote_hostname), NULL, 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: INCLUDE_CONFIG_FILE in GENERIC

2010-01-13 Thread Doug Barton
On 01/12/10 16:43, M. Warner Losh wrote:
> In message: <4b4d109a.5060...@freebsd.org>
> Doug Barton  writes:
> : On 1/10/2010 8:02 PM, M. Warner Losh wrote:
> : > In message: 
> : > Doug Barton  writes:
> : > : On Sun, 10 Jan 2010, Warner Losh wrote:
> : > : 
> : > : > Author: imp
> : > : > Date: Sun Jan 10 17:44:22 2010
> : > : > New Revision: 202019
> : > : > URL: http://svn.freebsd.org/changeset/base/202019
> : > : >
> : > : > Log:
> : > : >  Add INCLUDE_CONFIG_FILE in GENERIC on all non-embedded platforms.
> : > : 
> : > : Thanks for doing this, however the comment about how to include the
> : > : whole file (including the comments) were not included. Do I need to do
> : > : this part of it myself? No problem if so, I just want to be sure to
> : > : get it done in time to MFC it before the freeze for 7.3-release.
> : > 
> : > In general, we don't put big comments like that in the config files,
> : > preferring to leave them to NOTES.  I was just following that
> : > convention...
> : 
> : Understood, however given that there is plenty of room for confusion on
> : this point because the default is NOT to include the comments I think
> : that some explanation is justified. My original text was:
> : 
> : # Store the plain version of the configuration file in the kernel itself.
> : # To store the entire file, including comments, put this in /etc/src.conf:
> : # CONFIGARGS=   -C
> : # See config(8) for more details.
> : 
> : I'm open to suggestions on shrinking it, but I do think some sort of
> : explanation is warranted.
> 
> I'm not sure I see where there's confusion possible here, let alone
> plenty of room for it.  Do you think you can describe what confusion
> is possible here?

I think that most users would expect that the actual config file is
included, with the comments; as opposed to the stripped down version
with just the actual lines of configuration information that is actually
stored by default. Not only do I think it's obvious that this is what
users would think, this exact issue came up in the discussion on
-current in December.

To address the other responses, Tom, sorry, your suggested text doesn't
address my concern. John, I don't think that users would somehow
magically know to look in NOTES for more information about an option
that is already in GENERIC.

In the interests of bringing this to a close:
# Store the plain version of the configuration file in the kernel itself.
# For information on extraction, and storing the comments also, see
config(8).

There are plenty of comments in GENERIC that are longer/more substantial
than that, and let's be serious for a minute, IT DOESN'T MATTER ANYWAY.
I'm sorry if adding a comment that is slightly larger than usual to a
kernel config file defiles someone's view of the purity of all things
kernel, but let's try to take a step back and realize that NOT making
things so cryptic might actually benefit the users.

And yes, if you can't already tell, my patience is at an end for this. I
"get" why it needs to move to GENERIC instead of DEFAULTS, especially
since that's where I wanted to put it in the first place. But
specifically to Warner, if you had in mind to do something other than to
just move what I did to GENERIC you should have said that, and we could
have avoided this whole stupid discussion. And generally, let's forget
for a second that y'all are annoying the crap out of me, how many other
people are you discouraging from participation because an issue as
simple as this one is generating such an overwhelmingly out of
proportion response?

Unless someone objects to the TEXT of the comment I proposed in the next
24 hours I'll be committing it after that.


Doug

-- 

Improve the effectiveness of your Internet presence with
a domain name makeover!http://SupersetSolutions.com/

Computers are useless. They can only give you answers.
-- Pablo Picasso

___
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: r202215 - in head: . lib/libulog

2010-01-13 Thread Ed Schouten
Author: ed
Date: Wed Jan 13 18:53:06 2010
New Revision: 202215
URL: http://svn.freebsd.org/changeset/base/202215

Log:
  Remove utmpx stub from libulog.
  
  I'm not increasing the shlib major version for this, because not a
  single application outside the base system should have used these
  functions in such a short timespan.
  
  Rewrite ulog_login(3) and ulog_logout(3) to build on top of the utmpx
  implementation in libc.

Deleted:
  head/lib/libulog/ulog_getutxent.3
  head/lib/libulog/ulog_getutxent.c
  head/lib/libulog/ulog_internal.h
  head/lib/libulog/ulog_pututxline.c
  head/lib/libulog/ulog_setutxfile.3
  head/lib/libulog/ulog_util.c
Modified:
  head/ObsoleteFiles.inc
  head/lib/libulog/Makefile
  head/lib/libulog/Symbol.map
  head/lib/libulog/ulog.h
  head/lib/libulog/ulog_login.3
  head/lib/libulog/ulog_login.c
  head/lib/libulog/ulog_login_pseudo.c
  head/lib/libulog/utempter.c
  head/lib/libulog/utempter_add_record.3

Modified: head/ObsoleteFiles.inc
==
--- head/ObsoleteFiles.inc  Wed Jan 13 18:46:50 2010(r202214)
+++ head/ObsoleteFiles.inc  Wed Jan 13 18:53:06 2010(r202215)
@@ -14,6 +14,14 @@
 # The file is partitioned: OLD_FILES first, then OLD_LIBS and OLD_DIRS last.
 #
 
+# 20100113: remove utmp.h, replace it by utmpx.h
+OLD_FILES+=usr/share/man/man3/ulog_endutxent.3.gz
+OLD_FILES+=usr/share/man/man3/ulog_getutxent.3.gz
+OLD_FILES+=usr/share/man/man3/ulog_getutxline.3.gz
+OLD_FILES+=usr/share/man/man3/ulog_getutxuser.3.gz
+OLD_FILES+=usr/share/man/man3/ulog_pututxline.3.gz
+OLD_FILES+=usr/share/man/man3/ulog_setutxent.3.gz
+OLD_FILES+=usr/share/man/man3/ulog_setutxfile.3.gz
 # 20100105: new userland semaphore implementation
 OLD_FILES+=usr/include/sys/semaphore.h
 # 20100103: ntptrace(8) removed

Modified: head/lib/libulog/Makefile
==
--- head/lib/libulog/Makefile   Wed Jan 13 18:46:50 2010(r202214)
+++ head/lib/libulog/Makefile   Wed Jan 13 18:53:06 2010(r202215)
@@ -7,25 +7,21 @@ SHLIBDIR?=/lib
 LIB=   ulog
 SHLIB_MAJOR= 0
 INCS=  ulog.h utempter.h
-SRCS=  ulog.h ulog_getutxent.c ulog_internal.h ulog_login.c \
-   ulog_login_pseudo.c ulog_pututxline.c ulog_util.c utempter.c
+SRCS=  ulog.h ulog_login.c ulog_login_pseudo.c utempter.c
 
-MAN=   ulog_getutxent.3 ulog_login.3 ulog_setutxfile.3 \
-   utempter_add_record.3
-MLINKS+=ulog_getutxent.3 ulog_endutxent.3 \
-   ulog_getutxent.3 ulog_getutxline.3 \
-   ulog_getutxent.3 ulog_pututxline.3 \
-   ulog_getutxent.3 ulog_setutxent.3 \
-   ulog_login.3 ulog_login_pseudo.3 \
+MAN=   ulog_login.3 utempter_add_record.3
+MLINKS+=ulog_login.3 ulog_login_pseudo.3 \
ulog_login.3 ulog_logout.3 \
ulog_login.3 ulog_logout_pseudo.3 \
-   ulog_setutxfile.3 ulog_getutxuser.3 \
utempter_add_record.3 utempter_remove_added_record.3 \
utempter_add_record.3 utempter_remove_record.3 \
utempter_add_record.3 addToUtmp.3 \
utempter_remove_added_record.3 removeFromUtmp.3 \
utempter_remove_record.3 removeLineFromUtmp.3
 
+DPADD= ${LIBMD}
+LDADD= -lmd
+
 VERSION_DEF= ${.CURDIR}/../libc/Versions.def
 SYMBOL_MAPS= ${.CURDIR}/Symbol.map
 

Modified: head/lib/libulog/Symbol.map
==
--- head/lib/libulog/Symbol.map Wed Jan 13 18:46:50 2010(r202214)
+++ head/lib/libulog/Symbol.map Wed Jan 13 18:53:06 2010(r202215)
@@ -3,17 +3,10 @@
  */
 
 FBSD_1.2 {
-   ulog_endutxent;
-   ulog_getutxent;
-   ulog_getutxline;
-   ulog_getutxuser;
ulog_login;
ulog_login_pseudo;
ulog_logout;
ulog_logout_pseudo;
-   ulog_pututxline;
-   ulog_setutxent;
-   ulog_setutxfile;
 
addToUtmp;
removeFromUtmp;

Modified: head/lib/libulog/ulog.h
==
--- head/lib/libulog/ulog.h Wed Jan 13 18:46:50 2010(r202214)
+++ head/lib/libulog/ulog.h Wed Jan 13 18:53:06 2010(r202215)
@@ -30,79 +30,12 @@
 #define_ULOG_H_
 
 #include 
-#include 
-#include 
-
-#ifndef _PID_T_DECLARED
-typedef__pid_t pid_t;
-#define_PID_T_DECLARED
-#endif
-
-/*
- * libulog.
- *
- * This library is provided as a migratory tool towards .  We
- * cannot yet implement , because our on-disk file format lacks
- * various fields.   also has some shortcomings.  Ideally we
- * want to allow logging of user login records generated by unprivileged
- * processes as well, provided that they hold a file descriptor to a
- * pseudo-terminal master device.
- *
- * This library (or at least parts of it) will hopefully deprecate over
- * time, when we provide the  API.
- */
-
-struct ulog_utmpx {
-   charut_user[32];
-   charut_id[8];   /

svn commit: r202216 - in head: . lib/libutil

2010-01-13 Thread Ed Schouten
Author: ed
Date: Wed Jan 13 18:59:51 2010
New Revision: 202216
URL: http://svn.freebsd.org/changeset/base/202216

Log:
  Remove login(3), logout(3) and logwtmp(3) from libutil.
  
  These functions only apply to utmp(5). They cannot be kept intact when
  moving towards utmpx. The login(3) function would break, because its
  argument is an utmp structure. The logout(3) and logwtmp(3) functions
  cannot be used, since they provide a functionality which partially
  overlaps.
  
  Increment SHLIB_MAJOR to 9 to indicate the removal.

Deleted:
  head/lib/libutil/login.3
  head/lib/libutil/login.c
  head/lib/libutil/logout.3
  head/lib/libutil/logout.c
  head/lib/libutil/logwtmp.3
  head/lib/libutil/logwtmp.c
Modified:
  head/ObsoleteFiles.inc
  head/lib/libutil/Makefile
  head/lib/libutil/libutil.h

Modified: head/ObsoleteFiles.inc
==
--- head/ObsoleteFiles.inc  Wed Jan 13 18:53:06 2010(r202215)
+++ head/ObsoleteFiles.inc  Wed Jan 13 18:59:51 2010(r202216)
@@ -15,6 +15,9 @@
 #
 
 # 20100113: remove utmp.h, replace it by utmpx.h
+OLD_FILES+=usr/share/man/man3/login.3.gz
+OLD_FILES+=usr/share/man/man3/logout.3.gz
+OLD_FILES+=usr/share/man/man3/logwtmp.3.gz
 OLD_FILES+=usr/share/man/man3/ulog_endutxent.3.gz
 OLD_FILES+=usr/share/man/man3/ulog_getutxent.3.gz
 OLD_FILES+=usr/share/man/man3/ulog_getutxline.3.gz
@@ -22,6 +25,7 @@ OLD_FILES+=usr/share/man/man3/ulog_getut
 OLD_FILES+=usr/share/man/man3/ulog_pututxline.3.gz
 OLD_FILES+=usr/share/man/man3/ulog_setutxent.3.gz
 OLD_FILES+=usr/share/man/man3/ulog_setutxfile.3.gz
+OLD_LIBS+=lib/libutil.so.8
 # 20100105: new userland semaphore implementation
 OLD_FILES+=usr/include/sys/semaphore.h
 # 20100103: ntptrace(8) removed

Modified: head/lib/libutil/Makefile
==
--- head/lib/libutil/Makefile   Wed Jan 13 18:53:06 2010(r202215)
+++ head/lib/libutil/Makefile   Wed Jan 13 18:59:51 2010(r202216)
@@ -6,13 +6,13 @@ SHLIBDIR?= /lib
 .include 
 
 LIB=   util
-SHLIB_MAJOR= 8
+SHLIB_MAJOR= 9
 
 SRCS=  _secure_path.c auth.c expand_number.c flopen.c fparseln.c gr_util.c \
hexdump.c humanize_number.c kinfo_getfile.c kinfo_getvmmap.c kld.c \
-   login.c login_auth.c login_cap.c \
+   login_auth.c login_cap.c \
login_class.c login_crypt.c login_ok.c login_times.c login_tty.c \
-   logout.c logwtmp.c pidfile.c property.c pty.c pw_util.c realhostname.c \
+   pidfile.c property.c pty.c pw_util.c realhostname.c \
stub.c trimdomain.c uucplock.c
 INCS=  libutil.h login_cap.h
 
@@ -24,7 +24,7 @@ CFLAGS+= -DINET6
 
 CFLAGS+= -I${.CURDIR} -I${.CURDIR}/../libc/gen/
 
-MAN+=  kld.3 login.3 login_auth.3 login_tty.3 logout.3 logwtmp.3 pty.3 \
+MAN+=  kld.3 login_auth.3 login_tty.3 pty.3 \
login_cap.3 login_class.3 login_times.3 login_ok.3 \
_secure_path.3 uucplock.3 property.3 auth.3 realhostname.3 \
realhostname_sa.3 trimdomain.3 fparseln.3 humanize_number.3 \

Modified: head/lib/libutil/libutil.h
==
--- head/lib/libutil/libutil.h  Wed Jan 13 18:53:06 2010(r202215)
+++ head/lib/libutil/libutil.h  Wed Jan 13 18:59:51 2010(r202216)
@@ -90,7 +90,6 @@ struct pidfh {
 /* Avoid pulling in all the include files for no need */
 struct termios;
 struct winsize;
-struct utmp;
 struct in_addr;
 struct kinfo_file;
 struct kinfo_vmentry;
@@ -102,10 +101,7 @@ intextattr_namespace_to_string(int _att
 intextattr_string_to_namespace(const char *_string, int *_attrnamespace);
 intflopen(const char *_path, int _flags, ...);
 void   hexdump(const void *ptr, int length, const char *hdr, int flags);
-void   login(struct utmp *_ut);
 intlogin_tty(int _fd);
-intlogout(const char *_line);
-void   logwtmp(const char *_line, const char *_name, const char *_host);
 void   trimdomain(char *_fullhost, int _hostsize);
 intopenpty(int *_amaster, int *_aslave, char *_name,
 struct termios *_termp, struct winsize *_winp);
___
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: r202217 - in head: . include share/man/man5

2010-01-13 Thread Ed Schouten
Author: ed
Date: Wed Jan 13 19:03:48 2010
New Revision: 202217
URL: http://svn.freebsd.org/changeset/base/202217

Log:
  Remove  and its corresponding manual page.

Deleted:
  head/share/man/man5/utmp.5
Modified:
  head/ObsoleteFiles.inc
  head/include/utmp.h
  head/share/man/man5/Makefile

Modified: head/ObsoleteFiles.inc
==
--- head/ObsoleteFiles.inc  Wed Jan 13 18:59:51 2010(r202216)
+++ head/ObsoleteFiles.inc  Wed Jan 13 19:03:48 2010(r202217)
@@ -25,6 +25,9 @@ OLD_FILES+=usr/share/man/man3/ulog_getut
 OLD_FILES+=usr/share/man/man3/ulog_pututxline.3.gz
 OLD_FILES+=usr/share/man/man3/ulog_setutxent.3.gz
 OLD_FILES+=usr/share/man/man3/ulog_setutxfile.3.gz
+OLD_FILES+=usr/share/man/man5/lastlog.5.gz
+OLD_FILES+=usr/share/man/man5/utmp.5.gz
+OLD_FILES+=usr/share/man/man5/wtmp.5.gz
 OLD_LIBS+=lib/libutil.so.8
 # 20100105: new userland semaphore implementation
 OLD_FILES+=usr/include/sys/semaphore.h

Modified: head/include/utmp.h
==
--- head/include/utmp.h Wed Jan 13 18:59:51 2010(r202216)
+++ head/include/utmp.h Wed Jan 13 19:03:48 2010(r202217)
@@ -1,73 +1,2 @@
-/*
- * Copyright (c) 1988, 1993
- * The Regents of the University of California.  All rights reserved.
- * (c) UNIX System Laboratories, Inc.
- * All or some portions of this file are derived from material licensed
- * to the University of California by American Telephone and Telegraph
- * Co. or Unix System Laboratories, Inc. and are reproduced herein with
- * the permission of UNIX System Laboratories, Inc.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *notice, this list of conditions and the following disclaimer in the
- *documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- *may be used to endorse or promote products derived from this software
- *without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * @(#)utmp.h  8.2 (Berkeley) 1/21/94
- * $FreeBSD$
- */
-
-#ifndef_UTMP_H_
-#define_UTMP_H_
-
-#define_PATH_UTMP  "/var/run/utmp"
-#define_PATH_WTMP  "/var/log/wtmp"
-#define_PATH_LASTLOG   "/var/log/lastlog"
-
-/*
- * XXX: These values are too low, but cannot be changed without breaking
- * the file format.  Right now pts(4) is limited to 1000 instances,
- * because /dev/pts/1000 would require UT_LINESIZE to be bigger.
- * UT_HOSTSIZE is also too small to hold most common hostnames or IPv6
- * addresses.
- */
-#defineUT_NAMESIZE 16  /* see MAXLOGNAME in  */
-#defineUT_LINESIZE 8
-#defineUT_HOSTSIZE 16
-
-struct lastlog {
-   int32_t ll_time;
-   charll_line[UT_LINESIZE];
-   charll_host[UT_HOSTSIZE];
-};
-
-struct utmp {
-   charut_line[UT_LINESIZE];
-   charut_name[UT_NAMESIZE];
-   charut_host[UT_HOSTSIZE];
-   int32_t ut_time;
-};
-
-#endif /* !_UTMP_H_ */
+/* $FreeBSD$ */
+#error " has been replaced by "

Modified: head/share/man/man5/Makefile
==
--- head/share/man/man5/MakefileWed Jan 13 18:59:51 2010
(r202216)
+++ head/share/man/man5/MakefileWed Jan 13 19:03:48 2010
(r202217)
@@ -68,7 +68,6 @@ MAN=  acct.5 \
style.Makefile.5 \
sysctl.conf.5 \
tmpfs.5 \
-   utmp.5 \
xfs.5
 
 MLINKS=dir.5 dirent.5
@@ -79,7 +78,6 @@ MLINKS+

svn commit: r202218 - in head/etc: . periodic/monthly rc.d

2010-01-13 Thread Ed Schouten
Author: ed
Date: Wed Jan 13 19:07:48 2010
New Revision: 202218
URL: http://svn.freebsd.org/changeset/base/202218

Log:
  Let rc and periodic infrastructure and newsyslog use the utmpx files.

Modified:
  head/etc/newsyslog.conf
  head/etc/periodic/monthly/200.accounting
  head/etc/rc.d/cleanvar
  head/etc/rc.d/var

Modified: head/etc/newsyslog.conf
==
--- head/etc/newsyslog.conf Wed Jan 13 19:03:48 2010(r202217)
+++ head/etc/newsyslog.conf Wed Jan 13 19:07:48 2010(r202218)
@@ -33,6 +33,6 @@
 /var/log/ppp.log   root:network640  3 100  * JC
 /var/log/security  600  10100  * JC
 /var/log/sendmail.st   640  10*168   B
+/var/log/utx.log   644  3 *@01T05 B
 /var/log/weekly.log640  5 1$W6D0 JN
-/var/log/wtmp  644  3 *@01T05 B
 /var/log/xferlog   600  7 100  * JC

Modified: head/etc/periodic/monthly/200.accounting
==
--- head/etc/periodic/monthly/200.accountingWed Jan 13 19:03:48 2010
(r202217)
+++ head/etc/periodic/monthly/200.accountingWed Jan 13 19:07:48 2010
(r202218)
@@ -15,7 +15,7 @@ oldmask=$(umask)
 umask 066
 case "$monthly_accounting_enable" in
 [Yy][Ee][Ss])
-   W=/var/log/wtmp
+   W=/var/log/utx.log
rc=0
remove=NO
if [ ! -f $W.0 ]

Modified: head/etc/rc.d/cleanvar
==
--- head/etc/rc.d/cleanvar  Wed Jan 13 19:03:48 2010(r202217)
+++ head/etc/rc.d/cleanvar  Wed Jan 13 19:07:48 2010(r202218)
@@ -58,8 +58,8 @@ cleanvar_start () 
 {
if [ -d /var/run -a ! -f /var/run/clean_var ]; then
purgedir /var/run
-   # And an initial utmp file
-   (cd /var/run && cp /dev/null utmp && chmod 644 utmp)
+   # And an initial utmpx active session file
+   (cd /var/run && cp /dev/null utx.active && chmod 644 utx.active)
>/var/run/clean_var
fi
if [ -d /var/spool/lock -a ! -f /var/spool/lock/clean_var ]; then

Modified: head/etc/rc.d/var
==
--- head/etc/rc.d/var   Wed Jan 13 19:03:48 2010(r202217)
+++ head/etc/rc.d/var   Wed Jan 13 19:07:48 2010(r202218)
@@ -98,12 +98,12 @@ case "${populate_var}" in
;;
 esac
 
-# Make sure we have /var/log/lastlog and /var/log/wtmp files
-if [ ! -f /var/log/lastlog ]; then
-   cp /dev/null /var/log/lastlog
-   chmod 644 /var/log/lastlog
+# Make sure we have /var/log/utx.lastlogin and /var/log/utx.log files
+if [ ! -f /var/log/utx.lastlogin ]; then
+   cp /dev/null /var/log/utx.lastlogin
+   chmod 644 /var/log/utx.lastlogin
 fi
-if [ ! -f /var/log/wtmp ]; then
-   cp /dev/null /var/log/wtmp
-   chmod 644 /var/log/wtmp
+if [ ! -f /var/log/utx.log ]; then
+   cp /dev/null /var/log/utx.log
+   chmod 644 /var/log/utx.log
 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: r202219 - in head: . sys/sys

2010-01-13 Thread Ed Schouten
Author: ed
Date: Wed Jan 13 19:25:03 2010
New Revision: 202219
URL: http://svn.freebsd.org/changeset/base/202219

Log:
  Complete the migration towards utmpx.
  
  - Add a notice to UPDATING, explaining users may need to recompile
applications that use the old database.
  - Bump __FreeBSD_version.

Modified:
  head/UPDATING
  head/sys/sys/param.h

Modified: head/UPDATING
==
--- head/UPDATING   Wed Jan 13 19:07:48 2010(r202218)
+++ head/UPDATING   Wed Jan 13 19:25:03 2010(r202219)
@@ -22,6 +22,23 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 9.
machines to maximize performance.  (To disable malloc debugging, run
ln -s aj /etc/malloc.conf.)
 
+20100113:
+   The utmp user accounting database has been replaced with utmpx,
+   the user accounting interface standardized by POSIX.
+   Unfortunately the semantics of utmp and utmpx don't match,
+   making it practically impossible to support both interfaces.
+   The user accounting database is used by tools like finger(1),
+   last(1), talk(1), w(1) and ac(8).
+
+   All applications in the base system use utmpx.  This means only
+   local binaries (e.g. from the ports tree) may still use these
+   utmp database files.  These applications must be rebuilt to make
+   use of utmpx.
+
+   After the system has been upgraded, it is safe to remove the old
+   log files (/var/run/utmp, /var/log/lastlog and /var/log/wtmp*),
+   assuming their contents is of no importance anymore.
+
 20100108:
Introduce the kernel thread "deadlock resolver" (which can be enabled
via the DEADLKRES option, see NOTES for more details) and the

Modified: head/sys/sys/param.h
==
--- head/sys/sys/param.hWed Jan 13 19:07:48 2010(r202218)
+++ head/sys/sys/param.hWed Jan 13 19:25:03 2010(r202219)
@@ -58,7 +58,7 @@
  * in the range 5 to 9.
  */
 #undef __FreeBSD_version
-#define __FreeBSD_version 96   /* Master, propagated to newvers */
+#define __FreeBSD_version 97   /* Master, propagated to newvers */
 
 #ifndef LOCORE
 #include 
___
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: r202221 - in stable/8/sys/sparc64: pci sparc64

2010-01-13 Thread Marius Strobl
Author: marius
Date: Wed Jan 13 19:55:51 2010
New Revision: 202221
URL: http://svn.freebsd.org/changeset/base/202221

Log:
  MFC: 197164
  
  Factor out the duplicated macro for the device type used in the
  OFW device tree for PCI bridges and add a new one for PCI Express.
  While at it, take advantage of the former for the rman(9) work-
  around in jbusppm(4).

Modified:
  stable/8/sys/sparc64/pci/ofw_pci.h
  stable/8/sys/sparc64/pci/psycho.c
  stable/8/sys/sparc64/pci/schizo.c
  stable/8/sys/sparc64/sparc64/jbusppm.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/sparc64/pci/ofw_pci.h
==
--- stable/8/sys/sparc64/pci/ofw_pci.h  Wed Jan 13 19:46:53 2010
(r202220)
+++ stable/8/sys/sparc64/pci/ofw_pci.h  Wed Jan 13 19:55:51 2010
(r202221)
@@ -44,6 +44,10 @@ typedef uint32_t ofw_pci_intr_t;
 #defineOFW_PCI_CS_MEM320x02
 #defineOFW_PCI_CS_MEM640x03
 
+/* OFW device types */
+#defineOFW_TYPE_PCI"pci"
+#defineOFW_TYPE_PCIE   "pciex"
+
 struct ofw_pci_ranges {
uint32_tcspace;
uint32_tchild_hi;

Modified: stable/8/sys/sparc64/pci/psycho.c
==
--- stable/8/sys/sparc64/pci/psycho.c   Wed Jan 13 19:46:53 2010
(r202220)
+++ stable/8/sys/sparc64/pci/psycho.c   Wed Jan 13 19:55:51 2010
(r202221)
@@ -224,8 +224,6 @@ struct psycho_dma_sync {
  * providing two PCI buses.
  */
 
-#defineOFW_PCI_TYPE"pci"
-
 struct psycho_desc {
const char  *pd_string;
int pd_mode;
@@ -275,7 +273,7 @@ psycho_probe(device_t dev)
const char *dtype;
 
dtype = ofw_bus_get_type(dev);
-   if (dtype != NULL && strcmp(dtype, OFW_PCI_TYPE) == 0 &&
+   if (dtype != NULL && strcmp(dtype, OFW_TYPE_PCI) == 0 &&
psycho_get_desc(dev) != NULL) {
device_set_desc(dev, "U2P UPA-PCI bridge");
return (0);

Modified: stable/8/sys/sparc64/pci/schizo.c
==
--- stable/8/sys/sparc64/pci/schizo.c   Wed Jan 13 19:46:53 2010
(r202220)
+++ stable/8/sys/sparc64/pci/schizo.c   Wed Jan 13 19:55:51 2010
(r202221)
@@ -209,8 +209,6 @@ struct schizo_dma_sync {
 #defineSCHIZO_ICON_WRITE_8(sc, offs, v) \
SCHIZO_SPC_WRITE_8(STX_ICON, (sc), (offs), (v))
 
-#defineOFW_PCI_TYPE"pci"
-
 struct schizo_desc {
const char  *sd_string;
int sd_mode;
@@ -244,7 +242,7 @@ schizo_probe(device_t dev)
const char *dtype;
 
dtype = ofw_bus_get_type(dev);
-   if (dtype != NULL && strcmp(dtype, OFW_PCI_TYPE) == 0 &&
+   if (dtype != NULL && strcmp(dtype, OFW_TYPE_PCI) == 0 &&
schizo_get_desc(dev) != NULL) {
device_set_desc(dev, "Sun Host-PCI bridge");
return (0);

Modified: stable/8/sys/sparc64/sparc64/jbusppm.c
==
--- stable/8/sys/sparc64/sparc64/jbusppm.c  Wed Jan 13 19:46:53 2010
(r202220)
+++ stable/8/sys/sparc64/sparc64/jbusppm.c  Wed Jan 13 19:55:51 2010
(r202221)
@@ -40,6 +40,10 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
+#if 1
+#include 
+#endif
+
 #defineJBUSPPM_NREG2
 
 #defineJBUSPPM_DEVID   0
@@ -150,7 +154,7 @@ jbusppm_attach(device_t dev)
for (j = 0; j < nchildren; j++) {
if (ofw_bus_get_type(children[j]) != NULL &&
strcmp(ofw_bus_get_type(children[j]),
-   "pci") == 0 &&
+   OFW_TYPE_PCI) == 0 &&
ofw_bus_get_compat(children[j]) != NULL &&
strcmp(ofw_bus_get_compat(children[j]),
"pci108e,a801") == 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: r202222 - in stable/7/sys/sparc64: pci sparc64

2010-01-13 Thread Marius Strobl
Author: marius
Date: Wed Jan 13 19:56:02 2010
New Revision: 20
URL: http://svn.freebsd.org/changeset/base/20

Log:
  MFC: 197164
  
  Factor out the duplicated macro for the device type used in the
  OFW device tree for PCI bridges and add a new one for PCI Express.
  While at it, take advantage of the former for the rman(9) work-
  around in jbusppm(4).

Modified:
  stable/7/sys/sparc64/pci/ofw_pci.h
  stable/7/sys/sparc64/pci/psycho.c
  stable/7/sys/sparc64/pci/schizo.c
  stable/7/sys/sparc64/sparc64/jbusppm.c
Directory Properties:
  stable/7/sys/   (props changed)
  stable/7/sys/cddl/contrib/opensolaris/   (props changed)
  stable/7/sys/contrib/dev/acpica/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)

Modified: stable/7/sys/sparc64/pci/ofw_pci.h
==
--- stable/7/sys/sparc64/pci/ofw_pci.h  Wed Jan 13 19:55:51 2010
(r202221)
+++ stable/7/sys/sparc64/pci/ofw_pci.h  Wed Jan 13 19:56:02 2010
(r20)
@@ -44,6 +44,10 @@ typedef uint32_t ofw_pci_intr_t;
 #defineOFW_PCI_CS_MEM320x02
 #defineOFW_PCI_CS_MEM640x03
 
+/* OFW device types */
+#defineOFW_TYPE_PCI"pci"
+#defineOFW_TYPE_PCIE   "pciex"
+
 struct ofw_pci_ranges {
uint32_tcspace;
uint32_tchild_hi;

Modified: stable/7/sys/sparc64/pci/psycho.c
==
--- stable/7/sys/sparc64/pci/psycho.c   Wed Jan 13 19:55:51 2010
(r202221)
+++ stable/7/sys/sparc64/pci/psycho.c   Wed Jan 13 19:56:02 2010
(r20)
@@ -225,8 +225,6 @@ struct psycho_dma_sync {
  * providing two PCI buses.
  */
 
-#defineOFW_PCI_TYPE"pci"
-
 struct psycho_desc {
const char  *pd_string;
int pd_mode;
@@ -276,7 +274,7 @@ psycho_probe(device_t dev)
const char *dtype;
 
dtype = ofw_bus_get_type(dev);
-   if (dtype != NULL && strcmp(dtype, OFW_PCI_TYPE) == 0 &&
+   if (dtype != NULL && strcmp(dtype, OFW_TYPE_PCI) == 0 &&
psycho_get_desc(dev) != NULL) {
device_set_desc(dev, "U2P UPA-PCI bridge");
return (0);

Modified: stable/7/sys/sparc64/pci/schizo.c
==
--- stable/7/sys/sparc64/pci/schizo.c   Wed Jan 13 19:55:51 2010
(r202221)
+++ stable/7/sys/sparc64/pci/schizo.c   Wed Jan 13 19:56:02 2010
(r20)
@@ -210,8 +210,6 @@ struct schizo_dma_sync {
 #defineSCHIZO_ICON_WRITE_8(sc, offs, v) \
SCHIZO_SPC_WRITE_8(STX_ICON, (sc), (offs), (v))
 
-#defineOFW_PCI_TYPE"pci"
-
 struct schizo_desc {
const char  *sd_string;
int sd_mode;
@@ -245,7 +243,7 @@ schizo_probe(device_t dev)
const char *dtype;
 
dtype = ofw_bus_get_type(dev);
-   if (dtype != NULL && strcmp(dtype, OFW_PCI_TYPE) == 0 &&
+   if (dtype != NULL && strcmp(dtype, OFW_TYPE_PCI) == 0 &&
schizo_get_desc(dev) != NULL) {
device_set_desc(dev, "Sun Host-PCI bridge");
return (0);

Modified: stable/7/sys/sparc64/sparc64/jbusppm.c
==
--- stable/7/sys/sparc64/sparc64/jbusppm.c  Wed Jan 13 19:55:51 2010
(r202221)
+++ stable/7/sys/sparc64/sparc64/jbusppm.c  Wed Jan 13 19:56:02 2010
(r20)
@@ -40,6 +40,10 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
+#if 1
+#include 
+#endif
+
 #defineJBUSPPM_NREG2
 
 #defineJBUSPPM_DEVID   0
@@ -150,7 +154,7 @@ jbusppm_attach(device_t dev)
for (j = 0; j < nchildren; j++) {
if (ofw_bus_get_type(children[j]) != NULL &&
strcmp(ofw_bus_get_type(children[j]),
-   "pci") == 0 &&
+   OFW_TYPE_PCI) == 0 &&
ofw_bus_get_compat(children[j]) != NULL &&
strcmp(ofw_bus_get_compat(children[j]),
"pci108e,a801") == 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: r202223 - in stable/8/sys: dev/auxio sparc64/central sparc64/fhc sparc64/pci sparc64/sbus sparc64/sparc64

2010-01-13 Thread Marius Strobl
Author: marius
Date: Wed Jan 13 19:59:13 2010
New Revision: 202223
URL: http://svn.freebsd.org/changeset/base/202223

Log:
  MFC: r200815, r200816
  
  Provide and consume missing module dependency information.

Modified:
  stable/8/sys/dev/auxio/auxio.c
  stable/8/sys/sparc64/central/central.c
  stable/8/sys/sparc64/fhc/fhc.c
  stable/8/sys/sparc64/pci/apb.c
  stable/8/sys/sparc64/pci/ofw_pcib.c
  stable/8/sys/sparc64/sbus/sbus.c
  stable/8/sys/sparc64/sparc64/nexus.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/dev/auxio/auxio.c
==
--- stable/8/sys/dev/auxio/auxio.c  Wed Jan 13 19:56:02 2010
(r20)
+++ stable/8/sys/dev/auxio/auxio.c  Wed Jan 13 19:59:13 2010
(r202223)
@@ -56,7 +56,7 @@
  */
 
 /*
- * AUXIO registers support on the sbus & ebus2, used for the floppy driver
+ * AUXIO registers support on the SBus & EBus2, used for the floppy driver
  * and to control the system LED, for the BLINK option.
  */
 
@@ -85,8 +85,8 @@ __FBSDID("$FreeBSD$");
 #include 
 
 /*
- * on sun4u, auxio exists with one register (LED) on the sbus, and 5
- * registers on the ebus2 (pci) (LED, PCIMODE, FREQUENCY, SCSI
+ * On sun4u, auxio exists with one register (LED) on the SBus, and 5
+ * registers on the EBus2 (pci) (LED, PCIMODE, FREQUENCY, SCSI
  * OSCILLATOR, and TEMP SENSE.
  */
 
@@ -142,6 +142,7 @@ static driver_t auxio_sbus_driver = {
 
 static devclass_t  auxio_devclass;
 DRIVER_MODULE(auxio, sbus, auxio_sbus_driver, auxio_devclass, 0, 0);
+MODULE_DEPEND(auxio, sbus, 1, 1, 1);
 
 /* EBus */
 static device_method_t auxio_ebus_methods[] = {
@@ -158,6 +159,7 @@ static driver_t auxio_ebus_driver = {
 };
 
 DRIVER_MODULE(auxio, ebus, auxio_ebus_driver, auxio_devclass, 0, 0);
+MODULE_DEPEND(auxio, ebus, 1, 1, 1);
 MODULE_VERSION(auxio, 1);
 
 #define AUXIO_LOCK_INIT(sc)\

Modified: stable/8/sys/sparc64/central/central.c
==
--- stable/8/sys/sparc64/central/central.c  Wed Jan 13 19:56:02 2010
(r20)
+++ stable/8/sys/sparc64/central/central.c  Wed Jan 13 19:59:13 2010
(r202223)
@@ -106,6 +106,7 @@ static driver_t central_driver = {
 static devclass_t central_devclass;
 
 DRIVER_MODULE(central, nexus, central_driver, central_devclass, 0, 0);
+MODULE_DEPEND(fhc, nexus, 1, 1, 1);
 MODULE_VERSION(central, 1);
 
 static int

Modified: stable/8/sys/sparc64/fhc/fhc.c
==
--- stable/8/sys/sparc64/fhc/fhc.c  Wed Jan 13 19:56:02 2010
(r20)
+++ stable/8/sys/sparc64/fhc/fhc.c  Wed Jan 13 19:59:13 2010
(r202223)
@@ -120,8 +120,9 @@ static driver_t fhc_driver = {
 static devclass_t fhc_devclass;
 
 DRIVER_MODULE(fhc, central, fhc_driver, fhc_devclass, 0, 0);
-DRIVER_MODULE(fhc, nexus, fhc_driver, fhc_devclass, 0, 0);
 MODULE_DEPEND(fhc, central, 1, 1, 1);
+DRIVER_MODULE(fhc, nexus, fhc_driver, fhc_devclass, 0, 0);
+MODULE_DEPEND(fhc, nexus, 1, 1, 1);
 MODULE_VERSION(fhc, 1);
 
 static const struct intr_controller fhc_ic = {

Modified: stable/8/sys/sparc64/pci/apb.c
==
--- stable/8/sys/sparc64/pci/apb.c  Wed Jan 13 19:56:02 2010
(r20)
+++ stable/8/sys/sparc64/pci/apb.c  Wed Jan 13 19:59:13 2010
(r202223)
@@ -112,6 +112,7 @@ static devclass_t pcib_devclass;
 
 DEFINE_CLASS_0(pcib, apb_driver, apb_methods, sizeof(struct apb_softc));
 DRIVER_MODULE(apb, pci, apb_driver, pcib_devclass, 0, 0);
+MODULE_DEPEND(apb, pci, 1, 1, 1);
 
 /* APB specific registers */
 #defineAPBR_IOMAP  0xde

Modified: stable/8/sys/sparc64/pci/ofw_pcib.c
==
--- stable/8/sys/sparc64/pci/ofw_pcib.c Wed Jan 13 19:56:02 2010
(r20)
+++ stable/8/sys/sparc64/pci/ofw_pcib.c Wed Jan 13 19:59:13 2010
(r202223)
@@ -94,6 +94,7 @@ static devclass_t pcib_devclass;
 DEFINE_CLASS_0(pcib, ofw_pcib_driver, ofw_pcib_methods,
 sizeof(struct ofw_pcib_gen_softc));
 DRIVER_MODULE(ofw_pcib, pci, ofw_pcib_driver, pcib_devclass, 0, 0);
+MODULE_DEPEND(ofw_pcib, pci, 1, 1, 1);
 
 static int
 ofw_pcib_probe(device_t dev)

Modified: stable/8/sys/sparc64/sbus/sbus.c
==
--- stable/8/sys/sparc64/sbus/sbus.cWed Jan 13 19:56:02 2010
(r20)
+++ stable/8/sys/sparc64/sbus/sbus.cWed Jan 13 19:59:13 2010
(r202223)
@@ -248,6 +248,7 @@ static driver_t sbus_driver = {
 static devclass_t sbus_devclas

svn commit: r202224 - in stable/7/sys: dev/auxio sparc64/central sparc64/fhc sparc64/pci sparc64/sbus sparc64/sparc64

2010-01-13 Thread Marius Strobl
Author: marius
Date: Wed Jan 13 19:59:19 2010
New Revision: 202224
URL: http://svn.freebsd.org/changeset/base/202224

Log:
  MFC: r200815, r200816
  
  Provide and consume missing module dependency information.

Modified:
  stable/7/sys/dev/auxio/auxio.c
  stable/7/sys/sparc64/central/central.c
  stable/7/sys/sparc64/fhc/fhc.c
  stable/7/sys/sparc64/pci/apb.c
  stable/7/sys/sparc64/pci/ofw_pcib.c
  stable/7/sys/sparc64/sbus/sbus.c
  stable/7/sys/sparc64/sparc64/nexus.c
Directory Properties:
  stable/7/sys/   (props changed)
  stable/7/sys/cddl/contrib/opensolaris/   (props changed)
  stable/7/sys/contrib/dev/acpica/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)

Modified: stable/7/sys/dev/auxio/auxio.c
==
--- stable/7/sys/dev/auxio/auxio.c  Wed Jan 13 19:59:13 2010
(r202223)
+++ stable/7/sys/dev/auxio/auxio.c  Wed Jan 13 19:59:19 2010
(r202224)
@@ -56,7 +56,7 @@
  */
 
 /*
- * AUXIO registers support on the sbus & ebus2, used for the floppy driver
+ * AUXIO registers support on the SBus & EBus2, used for the floppy driver
  * and to control the system LED, for the BLINK option.
  */
 
@@ -85,8 +85,8 @@ __FBSDID("$FreeBSD$");
 #include 
 
 /*
- * on sun4u, auxio exists with one register (LED) on the sbus, and 5
- * registers on the ebus2 (pci) (LED, PCIMODE, FREQUENCY, SCSI
+ * On sun4u, auxio exists with one register (LED) on the SBus, and 5
+ * registers on the EBus2 (pci) (LED, PCIMODE, FREQUENCY, SCSI
  * OSCILLATOR, and TEMP SENSE.
  */
 
@@ -142,6 +142,7 @@ static driver_t auxio_sbus_driver = {
 
 static devclass_t  auxio_devclass;
 DRIVER_MODULE(auxio, sbus, auxio_sbus_driver, auxio_devclass, 0, 0);
+MODULE_DEPEND(auxio, sbus, 1, 1, 1);
 
 /* EBus */
 static device_method_t auxio_ebus_methods[] = {
@@ -158,6 +159,7 @@ static driver_t auxio_ebus_driver = {
 };
 
 DRIVER_MODULE(auxio, ebus, auxio_ebus_driver, auxio_devclass, 0, 0);
+MODULE_DEPEND(auxio, ebus, 1, 1, 1);
 MODULE_VERSION(auxio, 1);
 
 #define AUXIO_LOCK_INIT(sc)\

Modified: stable/7/sys/sparc64/central/central.c
==
--- stable/7/sys/sparc64/central/central.c  Wed Jan 13 19:59:13 2010
(r202223)
+++ stable/7/sys/sparc64/central/central.c  Wed Jan 13 19:59:19 2010
(r202224)
@@ -105,6 +105,7 @@ static driver_t central_driver = {
 static devclass_t central_devclass;
 
 DRIVER_MODULE(central, nexus, central_driver, central_devclass, 0, 0);
+MODULE_DEPEND(fhc, nexus, 1, 1, 1);
 MODULE_VERSION(central, 1);
 
 static int

Modified: stable/7/sys/sparc64/fhc/fhc.c
==
--- stable/7/sys/sparc64/fhc/fhc.c  Wed Jan 13 19:59:13 2010
(r202223)
+++ stable/7/sys/sparc64/fhc/fhc.c  Wed Jan 13 19:59:19 2010
(r202224)
@@ -119,8 +119,9 @@ static driver_t fhc_driver = {
 static devclass_t fhc_devclass;
 
 DRIVER_MODULE(fhc, central, fhc_driver, fhc_devclass, 0, 0);
-DRIVER_MODULE(fhc, nexus, fhc_driver, fhc_devclass, 0, 0);
 MODULE_DEPEND(fhc, central, 1, 1, 1);
+DRIVER_MODULE(fhc, nexus, fhc_driver, fhc_devclass, 0, 0);
+MODULE_DEPEND(fhc, nexus, 1, 1, 1);
 MODULE_VERSION(fhc, 1);
 
 static const struct intr_controller fhc_ic = {

Modified: stable/7/sys/sparc64/pci/apb.c
==
--- stable/7/sys/sparc64/pci/apb.c  Wed Jan 13 19:59:13 2010
(r202223)
+++ stable/7/sys/sparc64/pci/apb.c  Wed Jan 13 19:59:19 2010
(r202224)
@@ -113,6 +113,7 @@ static devclass_t pcib_devclass;
 
 DEFINE_CLASS_0(pcib, apb_driver, apb_methods, sizeof(struct apb_softc));
 DRIVER_MODULE(apb, pci, apb_driver, pcib_devclass, 0, 0);
+MODULE_DEPEND(apb, pci, 1, 1, 1);
 
 /* APB specific registers */
 #defineAPBR_IOMAP  0xde

Modified: stable/7/sys/sparc64/pci/ofw_pcib.c
==
--- stable/7/sys/sparc64/pci/ofw_pcib.c Wed Jan 13 19:59:13 2010
(r202223)
+++ stable/7/sys/sparc64/pci/ofw_pcib.c Wed Jan 13 19:59:19 2010
(r202224)
@@ -95,6 +95,7 @@ static devclass_t pcib_devclass;
 DEFINE_CLASS_0(pcib, ofw_pcib_driver, ofw_pcib_methods,
 sizeof(struct ofw_pcib_gen_softc));
 DRIVER_MODULE(ofw_pcib, pci, ofw_pcib_driver, pcib_devclass, 0, 0);
+MODULE_DEPEND(ofw_pcib, pci, 1, 1, 1);
 
 static int
 ofw_pcib_probe(device_t dev)

Modified: stable/7/sys/sparc64/sbus/sbus.c
==
--- stable/7/sys/sparc64/sbus/sbus.cWed Jan 13 19:59:13 2010
(r202223)
+++ stable/7/sys/sparc64/sbus/sbus.cWed Jan 13 19:59:19 2010
(r202224)
@@ -247,6 +247,7 @@ static driver_t sbus_driver = {
 static devclass_t sbus_devclass;
 
 DRIVER_MODULE(sbus, nexus, sbus_driver, sbus_devclass, 0, 0);
+MODULE_DEPEND(sbus, nexus, 1, 1,

svn commit: r202225 - in stable/8/sys: dev/auxio sparc64/central sparc64/ebus sparc64/fhc sparc64/pci sparc64/sbus sparc64/sparc64

2010-01-13 Thread Marius Strobl
Author: marius
Date: Wed Jan 13 20:03:24 2010
New Revision: 202225
URL: http://svn.freebsd.org/changeset/base/202225

Log:
  MFC: r200874
  
  Enroll these drivers in multipass probing. The motivation behind this
  is that the JBus to EBus bridges share the interrupt controller of a
  sibling JBus to PCIe bridge (at least as far as the OFW device tree
  is concerned, in reality they are part of the same chip) so we have to
  probe and attach the latter first. That happens to be also the case
  due to the fact that the JBus to PCIe bridges appear first in the OFW
  device tree but it doesn't hurt to ensure the right order.

Modified:
  stable/8/sys/dev/auxio/auxio.c
  stable/8/sys/sparc64/central/central.c
  stable/8/sys/sparc64/ebus/ebus.c
  stable/8/sys/sparc64/fhc/fhc.c
  stable/8/sys/sparc64/pci/apb.c
  stable/8/sys/sparc64/pci/ofw_pcib.c
  stable/8/sys/sparc64/pci/ofw_pcibus.c
  stable/8/sys/sparc64/sbus/dma_sbus.c
  stable/8/sys/sparc64/sbus/sbus.c
  stable/8/sys/sparc64/sparc64/nexus.c
  stable/8/sys/sparc64/sparc64/upa.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/dev/auxio/auxio.c
==
--- stable/8/sys/dev/auxio/auxio.c  Wed Jan 13 19:59:19 2010
(r202224)
+++ stable/8/sys/dev/auxio/auxio.c  Wed Jan 13 20:03:24 2010
(r202225)
@@ -141,7 +141,9 @@ static driver_t auxio_sbus_driver = {
 };
 
 static devclass_t  auxio_devclass;
-DRIVER_MODULE(auxio, sbus, auxio_sbus_driver, auxio_devclass, 0, 0);
+/* The probe order is handled by sbus(4). */
+EARLY_DRIVER_MODULE(auxio, sbus, auxio_sbus_driver, auxio_devclass, 0, 0,
+BUS_PASS_DEFAULT);
 MODULE_DEPEND(auxio, sbus, 1, 1, 1);
 
 /* EBus */
@@ -158,7 +160,8 @@ static driver_t auxio_ebus_driver = {
sizeof(struct auxio_softc)
 };
 
-DRIVER_MODULE(auxio, ebus, auxio_ebus_driver, auxio_devclass, 0, 0);
+EARLY_DRIVER_MODULE(auxio, ebus, auxio_ebus_driver, auxio_devclass, 0, 0,
+BUS_PASS_DEFAULT);
 MODULE_DEPEND(auxio, ebus, 1, 1, 1);
 MODULE_VERSION(auxio, 1);
 

Modified: stable/8/sys/sparc64/central/central.c
==
--- stable/8/sys/sparc64/central/central.c  Wed Jan 13 19:59:19 2010
(r202224)
+++ stable/8/sys/sparc64/central/central.c  Wed Jan 13 20:03:24 2010
(r202225)
@@ -105,7 +105,8 @@ static driver_t central_driver = {
 
 static devclass_t central_devclass;
 
-DRIVER_MODULE(central, nexus, central_driver, central_devclass, 0, 0);
+EARLY_DRIVER_MODULE(central, nexus, central_driver, central_devclass, 0, 0,
+BUS_PASS_BUS);
 MODULE_DEPEND(fhc, nexus, 1, 1, 1);
 MODULE_VERSION(central, 1);
 

Modified: stable/8/sys/sparc64/ebus/ebus.c
==
--- stable/8/sys/sparc64/ebus/ebus.cWed Jan 13 19:59:19 2010
(r202224)
+++ stable/8/sys/sparc64/ebus/ebus.cWed Jan 13 20:03:24 2010
(r202225)
@@ -138,7 +138,8 @@ static driver_t ebus_driver = {
 
 static devclass_t ebus_devclass;
 
-DRIVER_MODULE(ebus, pci, ebus_driver, ebus_devclass, 0, 0);
+EARLY_DRIVER_MODULE(ebus, pci, ebus_driver, ebus_devclass, 0, 0,
+BUS_PASS_BUS);
 MODULE_DEPEND(ebus, pci, 1, 1, 1);
 MODULE_VERSION(ebus, 1);
 

Modified: stable/8/sys/sparc64/fhc/fhc.c
==
--- stable/8/sys/sparc64/fhc/fhc.c  Wed Jan 13 19:59:19 2010
(r202224)
+++ stable/8/sys/sparc64/fhc/fhc.c  Wed Jan 13 20:03:24 2010
(r202225)
@@ -119,9 +119,11 @@ static driver_t fhc_driver = {
 
 static devclass_t fhc_devclass;
 
-DRIVER_MODULE(fhc, central, fhc_driver, fhc_devclass, 0, 0);
+EARLY_DRIVER_MODULE(fhc, central, fhc_driver, fhc_devclass, 0, 0,
+BUS_PASS_BUS);
 MODULE_DEPEND(fhc, central, 1, 1, 1);
-DRIVER_MODULE(fhc, nexus, fhc_driver, fhc_devclass, 0, 0);
+EARLY_DRIVER_MODULE(fhc, nexus, fhc_driver, fhc_devclass, 0, 0,
+BUS_PASS_BUS);
 MODULE_DEPEND(fhc, nexus, 1, 1, 1);
 MODULE_VERSION(fhc, 1);
 

Modified: stable/8/sys/sparc64/pci/apb.c
==
--- stable/8/sys/sparc64/pci/apb.c  Wed Jan 13 19:59:19 2010
(r202224)
+++ stable/8/sys/sparc64/pci/apb.c  Wed Jan 13 20:03:24 2010
(r202225)
@@ -111,7 +111,7 @@ static device_method_t apb_methods[] = {
 static devclass_t pcib_devclass;
 
 DEFINE_CLASS_0(pcib, apb_driver, apb_methods, sizeof(struct apb_softc));
-DRIVER_MODULE(apb, pci, apb_driver, pcib_devclass, 0, 0);
+EARLY_DRIVER_MODULE(apb, pci, apb_driver, pcib_devclass, 0, 0, BUS_PASS_BUS);
 MODULE_DEPEND(apb, pci, 1, 1, 1);
 
 /* APB 

svn commit: r202226 - stable/8/sys/sparc64/include

2010-01-13 Thread Marius Strobl
Author: marius
Date: Wed Jan 13 20:05:32 2010
New Revision: 202226
URL: http://svn.freebsd.org/changeset/base/202226

Log:
  MFC: r200876
  
  Make these constants unsigned which is more appropriate.

Modified:
  stable/8/sys/sparc64/include/bus_common.h
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/sparc64/include/bus_common.h
==
--- stable/8/sys/sparc64/include/bus_common.h   Wed Jan 13 20:03:24 2010
(r202225)
+++ stable/8/sys/sparc64/include/bus_common.h   Wed Jan 13 20:05:32 2010
(r202226)
@@ -39,18 +39,18 @@
 #ifndef _MACHINE_BUS_COMMON_H_
 #define_MACHINE_BUS_COMMON_H_
 
-#defineINTMAP_V0x08000LL   /* Interrupt valid 
(enabled) */
-#defineINTMAP_TID_MASK 0x07c00LL   /* UPA target ID */
+#defineINTMAP_V0x08000ULL  /* Interrupt valid 
(enabled) */
+#defineINTMAP_TID_MASK 0x07c00ULL  /* UPA target ID */
 #defineINTMAP_TID_SHIFT26
-#defineINTMAP_IGN_MASK 0x007c0LL   /* Interrupt group no. 
*/
+#defineINTMAP_IGN_MASK 0x007c0ULL  /* Interrupt group no. 
*/
 #defineINTMAP_IGN_SHIFT6
-#defineINTMAP_INO_MASK 0x0003fLL   /* Interrupt number */
+#defineINTMAP_INO_MASK 0x0003fULL  /* Interrupt number */
 #defineINTMAP_INR_MASK (INTMAP_IGN_MASK | INTMAP_INO_MASK)
-#defineINTMAP_SBUSSLOT_MASK0x00018LL   /* SBus slot # */
-#defineINTMAP_PCIBUS_MASK  0x00010LL   /* PCI bus number (A or 
B) */
-#defineINTMAP_PCISLOT_MASK 0xcLL   /* PCI slot # */
-#defineINTMAP_PCIINT_MASK  0x3LL   /* PCI interrupt 
#A,#B,#C,#D */
-#defineINTMAP_OBIO_MASK0x00020LL   /* Onboard device */
+#defineINTMAP_SBUSSLOT_MASK0x00018ULL  /* SBus slot # */
+#defineINTMAP_PCIBUS_MASK  0x00010ULL  /* PCI bus number (A or 
B) */
+#defineINTMAP_PCISLOT_MASK 0xcULL  /* PCI slot # */
+#defineINTMAP_PCIINT_MASK  0x3ULL  /* PCI interrupt 
#A,#B,#C,#D */
+#defineINTMAP_OBIO_MASK0x00020ULL  /* Onboard device */
 #defineINTIGN(x)   (((x) & INTMAP_IGN_MASK) >> 
INTMAP_IGN_SHIFT)
 #defineINTVEC(x)   ((x) & INTMAP_INR_MASK)
 #defineINTSLOT(x)  (((x) >> 3) & 0x7)
___
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: r202227 - stable/7/sys/sparc64/include

2010-01-13 Thread Marius Strobl
Author: marius
Date: Wed Jan 13 20:05:35 2010
New Revision: 202227
URL: http://svn.freebsd.org/changeset/base/202227

Log:
  MFC: r200876
  
  Make these constants unsigned which is more appropriate.

Modified:
  stable/7/sys/sparc64/include/bus_common.h
Directory Properties:
  stable/7/sys/   (props changed)
  stable/7/sys/cddl/contrib/opensolaris/   (props changed)
  stable/7/sys/contrib/dev/acpica/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)

Modified: stable/7/sys/sparc64/include/bus_common.h
==
--- stable/7/sys/sparc64/include/bus_common.h   Wed Jan 13 20:05:32 2010
(r202226)
+++ stable/7/sys/sparc64/include/bus_common.h   Wed Jan 13 20:05:35 2010
(r202227)
@@ -39,18 +39,18 @@
 #ifndef _MACHINE_BUS_COMMON_H_
 #define_MACHINE_BUS_COMMON_H_
 
-#defineINTMAP_V0x08000LL   /* Interrupt valid 
(enabled) */
-#defineINTMAP_TID_MASK 0x07c00LL   /* UPA target ID */
+#defineINTMAP_V0x08000ULL  /* Interrupt valid 
(enabled) */
+#defineINTMAP_TID_MASK 0x07c00ULL  /* UPA target ID */
 #defineINTMAP_TID_SHIFT26
-#defineINTMAP_IGN_MASK 0x007c0LL   /* Interrupt group no. 
*/
+#defineINTMAP_IGN_MASK 0x007c0ULL  /* Interrupt group no. 
*/
 #defineINTMAP_IGN_SHIFT6
-#defineINTMAP_INO_MASK 0x0003fLL   /* Interrupt number */
+#defineINTMAP_INO_MASK 0x0003fULL  /* Interrupt number */
 #defineINTMAP_INR_MASK (INTMAP_IGN_MASK | INTMAP_INO_MASK)
-#defineINTMAP_SBUSSLOT_MASK0x00018LL   /* SBus slot # */
-#defineINTMAP_PCIBUS_MASK  0x00010LL   /* PCI bus number (A or 
B) */
-#defineINTMAP_PCISLOT_MASK 0xcLL   /* PCI slot # */
-#defineINTMAP_PCIINT_MASK  0x3LL   /* PCI interrupt 
#A,#B,#C,#D */
-#defineINTMAP_OBIO_MASK0x00020LL   /* Onboard device */
+#defineINTMAP_SBUSSLOT_MASK0x00018ULL  /* SBus slot # */
+#defineINTMAP_PCIBUS_MASK  0x00010ULL  /* PCI bus number (A or 
B) */
+#defineINTMAP_PCISLOT_MASK 0xcULL  /* PCI slot # */
+#defineINTMAP_PCIINT_MASK  0x3ULL  /* PCI interrupt 
#A,#B,#C,#D */
+#defineINTMAP_OBIO_MASK0x00020ULL  /* Onboard device */
 #defineINTIGN(x)   (((x) & INTMAP_IGN_MASK) >> 
INTMAP_IGN_SHIFT)
 #defineINTVEC(x)   ((x) & INTMAP_INR_MASK)
 #defineINTSLOT(x)  (((x) >> 3) & 0x7)
___
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: r202228 - stable/8/sys/sparc64/include

2010-01-13 Thread Marius Strobl
Author: marius
Date: Wed Jan 13 20:07:45 2010
New Revision: 202228
URL: http://svn.freebsd.org/changeset/base/202228

Log:
  MFC: r200878
  
  - Add macros for the states of the interrupt clear registers.
  - Change INTMAP_VEC() to take an INO as its second argument rather
than an INR. The former is what I actually intended with this
macro and how it's currently used.

Modified:
  stable/8/sys/sparc64/include/bus_common.h
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/sparc64/include/bus_common.h
==
--- stable/8/sys/sparc64/include/bus_common.h   Wed Jan 13 20:05:35 2010
(r202227)
+++ stable/8/sys/sparc64/include/bus_common.h   Wed Jan 13 20:07:45 2010
(r202228)
@@ -39,6 +39,10 @@
 #ifndef _MACHINE_BUS_COMMON_H_
 #define_MACHINE_BUS_COMMON_H_
 
+#defineINTCLR_PENDING  0x3ULL  /* Interrupt queued to 
CPU */
+#defineINTCLR_RECEIVED 0x1ULL  /* Interrupt received */
+#defineINTCLR_IDLE 0x0ULL  /* Interrupt idle */
+
 #defineINTMAP_V0x08000ULL  /* Interrupt valid 
(enabled) */
 #defineINTMAP_TID_MASK 0x07c00ULL  /* UPA target ID */
 #defineINTMAP_TID_SHIFT26
@@ -60,9 +64,9 @@
(INTMAP_TID((mr), (mid)) | INTMAP_V)
 #defineINTMAP_TID(mr, mid) 
\
(((mr) & ~INTMAP_TID_MASK) | ((mid) << INTMAP_TID_SHIFT))
-#defineINTMAP_VEC(ign, inr)
\
+#defineINTMAP_VEC(ign, ino)
\
ign) << INTMAP_IGN_SHIFT) & INTMAP_IGN_MASK) |  \
-   ((inr) & INTMAP_INR_MASK))
+   ((ino) & INTMAP_INO_MASK))
 
 /* counter-timer support. */
 void sparc64_counter_init(const char *name, bus_space_tag_t tag,
___
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: r202229 - stable/7/sys/sparc64/include

2010-01-13 Thread Marius Strobl
Author: marius
Date: Wed Jan 13 20:07:46 2010
New Revision: 202229
URL: http://svn.freebsd.org/changeset/base/202229

Log:
  MFC: r200878
  
  - Add macros for the states of the interrupt clear registers.
  - Change INTMAP_VEC() to take an INO as its second argument rather
than an INR. The former is what I actually intended with this
macro and how it's currently used.

Modified:
  stable/7/sys/sparc64/include/bus_common.h
Directory Properties:
  stable/7/sys/   (props changed)
  stable/7/sys/cddl/contrib/opensolaris/   (props changed)
  stable/7/sys/contrib/dev/acpica/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)

Modified: stable/7/sys/sparc64/include/bus_common.h
==
--- stable/7/sys/sparc64/include/bus_common.h   Wed Jan 13 20:07:45 2010
(r202228)
+++ stable/7/sys/sparc64/include/bus_common.h   Wed Jan 13 20:07:46 2010
(r202229)
@@ -39,6 +39,10 @@
 #ifndef _MACHINE_BUS_COMMON_H_
 #define_MACHINE_BUS_COMMON_H_
 
+#defineINTCLR_PENDING  0x3ULL  /* Interrupt queued to 
CPU */
+#defineINTCLR_RECEIVED 0x1ULL  /* Interrupt received */
+#defineINTCLR_IDLE 0x0ULL  /* Interrupt idle */
+
 #defineINTMAP_V0x08000ULL  /* Interrupt valid 
(enabled) */
 #defineINTMAP_TID_MASK 0x07c00ULL  /* UPA target ID */
 #defineINTMAP_TID_SHIFT26
@@ -60,9 +64,9 @@
(INTMAP_TID((mr), (mid)) | INTMAP_V)
 #defineINTMAP_TID(mr, mid) 
\
(((mr) & ~INTMAP_TID_MASK) | ((mid) << INTMAP_TID_SHIFT))
-#defineINTMAP_VEC(ign, inr)
\
+#defineINTMAP_VEC(ign, ino)
\
ign) << INTMAP_IGN_SHIFT) & INTMAP_IGN_MASK) |  \
-   ((inr) & INTMAP_INR_MASK))
+   ((ino) & INTMAP_INO_MASK))
 
 /* counter-timer support. */
 void sparc64_counter_init(const char *name, bus_space_tag_t tag,
___
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: INCLUDE_CONFIG_FILE in GENERIC

2010-01-13 Thread John Baldwin
On Wednesday 13 January 2010 1:48:38 pm Doug Barton wrote:
> To address the other responses, Tom, sorry, your suggested text doesn't
> address my concern. John, I don't think that users would somehow
> magically know to look in NOTES for more information about an option
> that is already in GENERIC.

You really think users do not already know to look in manpages or NOTES to 
find out more details about kernel options?  Why bother having those documents 
if our users aren't going to look at them?  Seriously, have you actually 
looked at GENERIC and NOTES and compared their contents.  There are _many_ 
options and devices in GENERIC that have expanded descriptions in NOTES.  This 
is the norm for documenting kernel options and has been for well over a 
decade.

> In the interests of bringing this to a close:
> # Store the plain version of the configuration file in the kernel itself.
> # For information on extraction, and storing the comments also, see
> config(8).
> 
> There are plenty of comments in GENERIC that are longer/more substantial
> than that, and let's be serious for a minute, IT DOESN'T MATTER ANYWAY.
> I'm sorry if adding a comment that is slightly larger than usual to a
> kernel config file defiles someone's view of the purity of all things
> kernel, but let's try to take a step back and realize that NOT making
> things so cryptic might actually benefit the users.

So why not add a 3-line comment to GENERIC for every other kernel option?  Put 
another way, what makes 'INCLUDE_CONFIG_FILE' sufficiently special that it 
deserves special treatment relative to other kernel options?

-- 
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: r202231 - head/crypto/openssh

2010-01-13 Thread Ed Schouten
Author: ed
Date: Wed Jan 13 20:30:16 2010
New Revision: 202231
URL: http://svn.freebsd.org/changeset/base/202231

Log:
  Add a missing $FreeBSD$ string.
  
  I was requested to add this string to any file that was modified by my
  commit, which I forgot to do so.
  
  Requested by: des

Modified:
  head/crypto/openssh/loginrec.c

Modified: head/crypto/openssh/loginrec.c
==
--- head/crypto/openssh/loginrec.c  Wed Jan 13 20:25:45 2010
(r202230)
+++ head/crypto/openssh/loginrec.c  Wed Jan 13 20:30:16 2010
(r202231)
@@ -146,6 +146,7 @@
  */
 
 #include "includes.h"
+__RCSID("$FreeBSD$");
 
 #include 
 #include 
___
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: r202232 - stable/8/sys/sparc64/ebus

2010-01-13 Thread Marius Strobl
Author: marius
Date: Wed Jan 13 20:32:54 2010
New Revision: 202232
URL: http://svn.freebsd.org/changeset/base/202232

Log:
  MFC: r200879
  
  - Add support for the JBus to EBus bridges which hang off of nexus(4)
and are found in sun4u and sun4v machines based on the Fire ASIC.
  - Initialize the configuration space of the PCI to EBus variant the
same way as OpenSolaris does.

Modified:
  stable/8/sys/sparc64/ebus/ebus.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/sparc64/ebus/ebus.c
==
--- stable/8/sys/sparc64/ebus/ebus.cWed Jan 13 20:30:16 2010
(r202231)
+++ stable/8/sys/sparc64/ebus/ebus.cWed Jan 13 20:32:54 2010
(r202232)
@@ -1,6 +1,7 @@
 /*-
  * Copyright (c) 1999, 2000 Matthew R. Green
  * Copyright (c) 2001 Thomas Moestl 
+ * Copyright (c) 2009 by Marius Strobl 
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -33,7 +34,7 @@
 __FBSDID("$FreeBSD$");
 
 /*
- * UltraSPARC 5 and beyond EBus support
+ * Driver for JBus to EBus and PCI to EBus bridges
  */
 
 #include 
@@ -43,14 +44,17 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
-#include 
-
 #include 
 
 #include 
 #include 
 #include 
 
+#include 
+#ifndef SUN4V
+#include 
+#endif
+#include 
 #include 
 
 #include 
@@ -59,11 +63,19 @@ __FBSDID("$FreeBSD$");
 #include 
 
 /*
- * The register, ranges and interrupt map properties are identical to the ISA
- * ones.
+ * The register, interrupt map and for the PCI variant also the ranges
+ * properties are identical to the ISA ones.
  */
 #include 
 
+struct ebus_nexus_ranges {
+   uint32_tchild_hi;
+   uint32_tchild_lo;
+   uint32_tphys_hi;
+   uint32_tphys_lo;
+   uint32_tsize;
+};
+
 struct ebus_devinfo {
struct ofw_bus_devinfo  edi_obdinfo;
struct resource_listedi_rl;
@@ -76,32 +88,45 @@ struct ebus_rinfo {
 };
 
 struct ebus_softc {
-   struct isa_ranges   *sc_range;
+   void*sc_range;
struct ebus_rinfo   *sc_rinfo;
 
+   u_int   sc_flags;
+#defineEBUS_PCI(1 << 0)
+
int sc_nrange;
 
struct ofw_bus_iinfosc_iinfo;
+
+#ifndef SUN4V
+   uint32_tsc_ign;
+#endif
 };
 
-static device_probe_t ebus_probe;
-static device_attach_t ebus_attach;
+static device_probe_t ebus_nexus_probe;
+static device_attach_t ebus_nexus_attach;
+static device_probe_t ebus_pci_probe;
+static device_attach_t ebus_pci_attach;
 static bus_print_child_t ebus_print_child;
 static bus_probe_nomatch_t ebus_probe_nomatch;
 static bus_alloc_resource_t ebus_alloc_resource;
 static bus_release_resource_t ebus_release_resource;
+static bus_setup_intr_t ebus_setup_intr;
 static bus_get_resource_list_t ebus_get_resource_list;
 static ofw_bus_get_devinfo_t ebus_get_devinfo;
 
-static struct ebus_devinfo *ebus_setup_dinfo(device_t, struct ebus_softc *,
-phandle_t);
-static void ebus_destroy_dinfo(struct ebus_devinfo *);
-static int ebus_print_res(struct ebus_devinfo *);
+static int ebus_attach(device_t dev, struct ebus_softc *sc, phandle_t node);
+static struct ebus_devinfo *ebus_setup_dinfo(device_t dev,
+struct ebus_softc *sc, phandle_t node);
+static void ebus_destroy_dinfo(struct ebus_devinfo *edi);
+static int ebus_print_res(struct ebus_devinfo *edi);
+
+static devclass_t ebus_devclass;
 
-static device_method_t ebus_methods[] = {
+static device_method_t ebus_nexus_methods[] = {
/* Device interface */
-   DEVMETHOD(device_probe, ebus_probe),
-   DEVMETHOD(device_attach,ebus_attach),
+   DEVMETHOD(device_probe, ebus_nexus_probe),
+   DEVMETHOD(device_attach,ebus_nexus_attach),
DEVMETHOD(device_shutdown,  bus_generic_shutdown),
DEVMETHOD(device_suspend,   bus_generic_suspend),
DEVMETHOD(device_resume,bus_generic_resume),
@@ -113,7 +138,7 @@ static device_method_t ebus_methods[] = 
DEVMETHOD(bus_activate_resource, bus_generic_activate_resource),
DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource),
DEVMETHOD(bus_release_resource, ebus_release_resource),
-   DEVMETHOD(bus_setup_intr,   bus_generic_setup_intr),
+   DEVMETHOD(bus_setup_intr,   ebus_setup_intr),
DEVMETHOD(bus_teardown_intr,bus_generic_teardown_intr),
DEVMETHOD(bus_get_resource, bus_generic_rl_get_resource),
DEVMETHOD(bus_get_resource_list, ebus_get_resource_list),
@@ -130,21 +155,80 @@ static device_method_t ebus_methods[

svn commit: r202233 - stable/7/sys/sparc64/ebus

2010-01-13 Thread Marius Strobl
Author: marius
Date: Wed Jan 13 20:33:00 2010
New Revision: 202233
URL: http://svn.freebsd.org/changeset/base/202233

Log:
  MFC: r200879
  
  - Add support for the JBus to EBus bridges which hang off of nexus(4)
and are found in sun4u and sun4v machines based on the Fire ASIC.
  - Initialize the configuration space of the PCI to EBus variant the
same way as OpenSolaris does.

Modified:
  stable/7/sys/sparc64/ebus/ebus.c
Directory Properties:
  stable/7/sys/   (props changed)
  stable/7/sys/cddl/contrib/opensolaris/   (props changed)
  stable/7/sys/contrib/dev/acpica/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)

Modified: stable/7/sys/sparc64/ebus/ebus.c
==
--- stable/7/sys/sparc64/ebus/ebus.cWed Jan 13 20:32:54 2010
(r202232)
+++ stable/7/sys/sparc64/ebus/ebus.cWed Jan 13 20:33:00 2010
(r202233)
@@ -1,6 +1,7 @@
 /*-
  * Copyright (c) 1999, 2000 Matthew R. Green
  * Copyright (c) 2001 Thomas Moestl 
+ * Copyright (c) 2009 by Marius Strobl 
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -33,7 +34,7 @@
 __FBSDID("$FreeBSD$");
 
 /*
- * UltraSPARC 5 and beyond EBus support
+ * Driver for JBus to EBus and PCI to EBus bridges
  */
 
 #include 
@@ -43,14 +44,17 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
-#include 
-
 #include 
 
 #include 
 #include 
 #include 
 
+#include 
+#ifndef SUN4V
+#include 
+#endif
+#include 
 #include 
 #include 
 
@@ -60,11 +64,19 @@ __FBSDID("$FreeBSD$");
 #include 
 
 /*
- * The register, ranges and interrupt map properties are identical to the ISA
- * ones.
+ * The register, interrupt map and for the PCI variant also the ranges
+ * properties are identical to the ISA ones.
  */
 #include 
 
+struct ebus_nexus_ranges {
+   uint32_tchild_hi;
+   uint32_tchild_lo;
+   uint32_tphys_hi;
+   uint32_tphys_lo;
+   uint32_tsize;
+};
+
 struct ebus_devinfo {
struct ofw_bus_devinfo  edi_obdinfo;
struct resource_listedi_rl;
@@ -77,32 +89,45 @@ struct ebus_rinfo {
 };
 
 struct ebus_softc {
-   struct isa_ranges   *sc_range;
+   void*sc_range;
struct ebus_rinfo   *sc_rinfo;
 
+   u_int   sc_flags;
+#defineEBUS_PCI(1 << 0)
+
int sc_nrange;
 
struct ofw_bus_iinfosc_iinfo;
+
+#ifndef SUN4V
+   uint32_tsc_ign;
+#endif
 };
 
-static device_probe_t ebus_probe;
-static device_attach_t ebus_attach;
+static device_probe_t ebus_nexus_probe;
+static device_attach_t ebus_nexus_attach;
+static device_probe_t ebus_pci_probe;
+static device_attach_t ebus_pci_attach;
 static bus_print_child_t ebus_print_child;
 static bus_probe_nomatch_t ebus_probe_nomatch;
 static bus_alloc_resource_t ebus_alloc_resource;
 static bus_release_resource_t ebus_release_resource;
+static bus_setup_intr_t ebus_setup_intr;
 static bus_get_resource_list_t ebus_get_resource_list;
 static ofw_bus_get_devinfo_t ebus_get_devinfo;
 
-static struct ebus_devinfo *ebus_setup_dinfo(device_t, struct ebus_softc *,
-phandle_t);
-static void ebus_destroy_dinfo(struct ebus_devinfo *);
-static int ebus_print_res(struct ebus_devinfo *);
+static int ebus_attach(device_t dev, struct ebus_softc *sc, phandle_t node);
+static struct ebus_devinfo *ebus_setup_dinfo(device_t dev,
+struct ebus_softc *sc, phandle_t node);
+static void ebus_destroy_dinfo(struct ebus_devinfo *edi);
+static int ebus_print_res(struct ebus_devinfo *edi);
+
+static devclass_t ebus_devclass;
 
-static device_method_t ebus_methods[] = {
+static device_method_t ebus_nexus_methods[] = {
/* Device interface */
-   DEVMETHOD(device_probe, ebus_probe),
-   DEVMETHOD(device_attach,ebus_attach),
+   DEVMETHOD(device_probe, ebus_nexus_probe),
+   DEVMETHOD(device_attach,ebus_nexus_attach),
DEVMETHOD(device_shutdown,  bus_generic_shutdown),
DEVMETHOD(device_suspend,   bus_generic_suspend),
DEVMETHOD(device_resume,bus_generic_resume),
@@ -114,7 +139,7 @@ static device_method_t ebus_methods[] = 
DEVMETHOD(bus_activate_resource, bus_generic_activate_resource),
DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource),
DEVMETHOD(bus_release_resource, ebus_release_resource),
-   DEVMETHOD(bus_setup_intr,   bus_generic_setup_intr),
+   DEVMETHOD(bus_setup_intr,   ebus_setup_intr),
DEVMETHOD(bus_teardown_intr,bus_generic_teardown_intr),
DEVMETHOD(bus_get_resource, bus_generic_rl_get_resource),
DEVMETHOD(bus_get_resource_list, ebus_get_resource_list),
@@ -130,20 +155,79 @@ static device_method_t ebus_methods[] = 
KOBJMETHOD_END
 };
 
-static driver_t ebus_driver = {
+static driver_t ebus_nexus_driver

svn commit: r202234 - stable/8/sys/sparc64/isa

2010-01-13 Thread Marius Strobl
Author: marius
Date: Wed Jan 13 20:35:27 2010
New Revision: 202234
URL: http://svn.freebsd.org/changeset/base/202234

Log:
  MFC: r200880
  
  - Correct an off-by-one error when calculating the end of a child
range.
  - Spell the PCI TLA in uppercase.

Modified:
  stable/8/sys/sparc64/isa/ofw_isa.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/sparc64/isa/ofw_isa.c
==
--- stable/8/sys/sparc64/isa/ofw_isa.c  Wed Jan 13 20:33:00 2010
(r202233)
+++ stable/8/sys/sparc64/isa/ofw_isa.c  Wed Jan 13 20:35:27 2010
(r202234)
@@ -79,11 +79,11 @@ ofw_isa_range_map(struct isa_ranges *ran
for (i = 0; i < nrange; i++) {
r = &range[i];
cstart = ISA_RANGE_CHILD(r);
-   cend = cstart + r->size;
+   cend = cstart + r->size - 1;
if (*start < cstart || *start > cend)
continue;
if (*end < cstart || *end > cend) {
-   panic("ofw_isa_map_iorange: iorange crosses pci "
+   panic("ofw_isa_map_iorange: iorange crosses PCI "
"ranges (%#lx not in %#lx - %#lx)", *end, cstart,
cend);
}
___
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: r202235 - stable/7/sys/sparc64/isa

2010-01-13 Thread Marius Strobl
Author: marius
Date: Wed Jan 13 20:35:37 2010
New Revision: 202235
URL: http://svn.freebsd.org/changeset/base/202235

Log:
  MFC: r200880
  
  - Correct an off-by-one error when calculating the end of a child
range.
  - Spell the PCI TLA in uppercase.

Modified:
  stable/7/sys/sparc64/isa/ofw_isa.c
Directory Properties:
  stable/7/sys/   (props changed)
  stable/7/sys/cddl/contrib/opensolaris/   (props changed)
  stable/7/sys/contrib/dev/acpica/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)

Modified: stable/7/sys/sparc64/isa/ofw_isa.c
==
--- stable/7/sys/sparc64/isa/ofw_isa.c  Wed Jan 13 20:35:27 2010
(r202234)
+++ stable/7/sys/sparc64/isa/ofw_isa.c  Wed Jan 13 20:35:37 2010
(r202235)
@@ -79,11 +79,11 @@ ofw_isa_range_map(struct isa_ranges *ran
for (i = 0; i < nrange; i++) {
r = &range[i];
cstart = ISA_RANGE_CHILD(r);
-   cend = cstart + r->size;
+   cend = cstart + r->size - 1;
if (*start < cstart || *start > cend)
continue;
if (*end < cstart || *end > cend) {
-   panic("ofw_isa_map_iorange: iorange crosses pci "
+   panic("ofw_isa_map_iorange: iorange crosses PCI "
"ranges (%#lx not in %#lx - %#lx)", *end, cstart,
cend);
}
___
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: r202236 - stable/6/sys/sparc64/isa

2010-01-13 Thread Marius Strobl
Author: marius
Date: Wed Jan 13 20:35:43 2010
New Revision: 202236
URL: http://svn.freebsd.org/changeset/base/202236

Log:
  MFC: r200880
  
  - Correct an off-by-one error when calculating the end of a child
range.
  - Spell the PCI TLA in uppercase.

Modified:
  stable/6/sys/sparc64/isa/ofw_isa.c
Directory Properties:
  stable/6/sys/   (props changed)
  stable/6/sys/contrib/pf/   (props changed)
  stable/6/sys/dev/cxgb/   (props changed)

Modified: stable/6/sys/sparc64/isa/ofw_isa.c
==
--- stable/6/sys/sparc64/isa/ofw_isa.c  Wed Jan 13 20:35:37 2010
(r202235)
+++ stable/6/sys/sparc64/isa/ofw_isa.c  Wed Jan 13 20:35:43 2010
(r202236)
@@ -79,11 +79,11 @@ ofw_isa_range_map(struct isa_ranges *ran
for (i = 0; i < nrange; i++) {
r = &range[i];
cstart = ISA_RANGE_CHILD(r);
-   cend = cstart + r->size;
+   cend = cstart + r->size - 1;
if (*start < cstart || *start > cend)
continue;
if (*end < cstart || *end > cend) {
-   panic("ofw_isa_map_iorange: iorange crosses pci "
+   panic("ofw_isa_map_iorange: iorange crosses PCI "
"ranges (%#lx not in %#lx - %#lx)", *end, cstart,
cend);
}
___
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: INCLUDE_CONFIG_FILE in GENERIC

2010-01-13 Thread Doug Barton
On 1/13/2010 12:15 PM, John Baldwin wrote:
> On Wednesday 13 January 2010 1:48:38 pm Doug Barton wrote:
>> To address the other responses, Tom, sorry, your suggested text doesn't
>> address my concern. John, I don't think that users would somehow
>> magically know to look in NOTES for more information about an option
>> that is already in GENERIC.
> 
> You really think users do not already know to look in manpages or NOTES to 
> find out more details about kernel options? 

That's not what I said.

> Put 
> another way, what makes 'INCLUDE_CONFIG_FILE' sufficiently special that it 
> deserves special treatment relative to other kernel options?

Because the default behavior (not including the actual file) for the
option is contrary to user' reasonable expectation of how the option
should work  and now I'm repeating myself.

Seriously, don't you have anything better to do than argue against
including a comment in a config file? I know I do. What is the
overwhelming horror that will arise here if there are more comments
GENERIC than you deem to be absolutely necessary?

And yes, I read the part of your message that I snipped about "why do we
have these documents if users don't read them?" The answer is, that's
why I'm suggesting a comment that tells users what man page to read.


Doug

-- 

Improve the effectiveness of your Internet presence with
a domain name makeover!http://SupersetSolutions.com/

Computers are useless. They can only give you answers.
-- Pablo Picasso

___
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: r202237 - stable/8/sys/sparc64/sparc64

2010-01-13 Thread Marius Strobl
Author: marius
Date: Wed Jan 13 20:40:49 2010
New Revision: 202237
URL: http://svn.freebsd.org/changeset/base/202237

Log:
  MFC: r200914
  
  Don't use an out register to hold the vector number across the call
  of the interrupt handler in intr_fast() as the handler might clobber
  it (no in-tree handler currently does but an upcoming one will).
  While at it, tidy the register usage in the interrupt counting code.

Modified:
  stable/8/sys/sparc64/sparc64/interrupt.S
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/sparc64/sparc64/interrupt.S
==
--- stable/8/sys/sparc64/sparc64/interrupt.SWed Jan 13 20:35:43 2010
(r202236)
+++ stable/8/sys/sparc64/sparc64/interrupt.SWed Jan 13 20:40:49 2010
(r202237)
@@ -176,7 +176,7 @@ ENTRY(intr_fast)
 
 3: ldx [%l0 + IR_FUNC], %o0
ldx [%l0 + IR_ARG], %o1
-   lduw[%l0 + IR_VEC], %o2
+   lduw[%l0 + IR_VEC], %l2
 
ldx [PCPU(IRFREE)], %l1
stx %l1, [%l0 + IR_NEXT]
@@ -188,17 +188,17 @@ ENTRY(intr_fast)
call%o0
 mov%o1, %o0
 
-   /* intrcnt[intr_countp[%o2]]++ */
-   SET(intrcnt, %l7, %l2)  /* %l2 = intrcnt */
-   prefetcha [%l2] ASI_N, 1
-   SET(intr_countp, %l7, %l3)  /* %l3 = intr_countp */
-   sllx%o2, 1, %l4 /* %l4 = vec << 1 */
-   lduh[%l4 + %l3], %l5/* %l5 = intr_countp[%o2] */
-   sllx%l5, 3, %l6 /* %l6 = intr_countp[%o2] << 3 */
-   add %l6, %l2, %l7   /* %l7 = intrcnt[intr_countp[%o2]] */
-   ldx [%l7], %l2
+   /* intrcnt[intr_countp[%l2]]++ */
+   SET(intrcnt, %l7, %l3)  /* %l3 = intrcnt */
+   prefetcha [%l3] ASI_N, 1
+   SET(intr_countp, %l7, %l4)  /* %l4 = intr_countp */
+   sllx%l2, 1, %l2 /* %l2 = vec << 1 */
+   lduh[%l4 + %l2], %l4/* %l4 = intr_countp[%l2] */
+   sllx%l4, 3, %l4 /* %l4 = intr_countp[%l2] << 3 */
+   add %l4, %l3, %l4   /* %l4 = intrcnt[intr_countp[%l2]] */
+   ldx [%l4], %l2
inc %l2
-   stx %l2, [%l7]
+   stx %l2, [%l4]
 
ba,a%xcc, 1b
 nop
___
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: r202238 - stable/7/sys/sparc64/sparc64

2010-01-13 Thread Marius Strobl
Author: marius
Date: Wed Jan 13 20:40:51 2010
New Revision: 202238
URL: http://svn.freebsd.org/changeset/base/202238

Log:
  MFC: r200914
  
  Don't use an out register to hold the vector number across the call
  of the interrupt handler in intr_fast() as the handler might clobber
  it (no in-tree handler currently does but an upcoming one will).
  While at it, tidy the register usage in the interrupt counting code.

Modified:
  stable/7/sys/sparc64/sparc64/interrupt.S
Directory Properties:
  stable/7/sys/   (props changed)
  stable/7/sys/cddl/contrib/opensolaris/   (props changed)
  stable/7/sys/contrib/dev/acpica/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)

Modified: stable/7/sys/sparc64/sparc64/interrupt.S
==
--- stable/7/sys/sparc64/sparc64/interrupt.SWed Jan 13 20:40:49 2010
(r202237)
+++ stable/7/sys/sparc64/sparc64/interrupt.SWed Jan 13 20:40:51 2010
(r202238)
@@ -176,7 +176,7 @@ ENTRY(intr_fast)
 
 3: ldx [%l0 + IR_FUNC], %o0
ldx [%l0 + IR_ARG], %o1
-   lduw[%l0 + IR_VEC], %o2
+   lduw[%l0 + IR_VEC], %l2
 
ldx [PCPU(IRFREE)], %l1
stx %l1, [%l0 + IR_NEXT]
@@ -188,17 +188,17 @@ ENTRY(intr_fast)
call%o0
 mov%o1, %o0
 
-   /* intrcnt[intr_countp[%o2]]++ */
-   SET(intrcnt, %l7, %l2)  /* %l2 = intrcnt */
-   prefetcha [%l2] ASI_N, 1
-   SET(intr_countp, %l7, %l3)  /* %l3 = intr_countp */
-   sllx%o2, 1, %l4 /* %l4 = vec << 1 */
-   lduh[%l4 + %l3], %l5/* %l5 = intr_countp[%o2] */
-   sllx%l5, 3, %l6 /* %l6 = intr_countp[%o2] << 3 */
-   add %l6, %l2, %l7   /* %l7 = intrcnt[intr_countp[%o2]] */
-   ldx [%l7], %l2
+   /* intrcnt[intr_countp[%l2]]++ */
+   SET(intrcnt, %l7, %l3)  /* %l3 = intrcnt */
+   prefetcha [%l3] ASI_N, 1
+   SET(intr_countp, %l7, %l4)  /* %l4 = intr_countp */
+   sllx%l2, 1, %l2 /* %l2 = vec << 1 */
+   lduh[%l4 + %l2], %l4/* %l4 = intr_countp[%l2] */
+   sllx%l4, 3, %l4 /* %l4 = intr_countp[%l2] << 3 */
+   add %l4, %l3, %l4   /* %l4 = intrcnt[intr_countp[%l2]] */
+   ldx [%l4], %l2
inc %l2
-   stx %l2, [%l7]
+   stx %l2, [%l4]
 
ba,a%xcc, 1b
 nop
___
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: r202239 - stable/6/sys/sparc64/sparc64

2010-01-13 Thread Marius Strobl
Author: marius
Date: Wed Jan 13 20:41:27 2010
New Revision: 202239
URL: http://svn.freebsd.org/changeset/base/202239

Log:
  MFC: r200914
  
  Don't use an out register to hold the vector number across the call
  of the interrupt handler in intr_fast() as the handler might clobber
  it (no in-tree handler currently does but an upcoming one will).
  While at it, tidy the register usage in the interrupt counting code.

Modified:
  stable/6/sys/sparc64/sparc64/interrupt.S
Directory Properties:
  stable/6/sys/   (props changed)
  stable/6/sys/contrib/pf/   (props changed)
  stable/6/sys/dev/cxgb/   (props changed)

Modified: stable/6/sys/sparc64/sparc64/interrupt.S
==
--- stable/6/sys/sparc64/sparc64/interrupt.SWed Jan 13 20:40:51 2010
(r202238)
+++ stable/6/sys/sparc64/sparc64/interrupt.SWed Jan 13 20:41:27 2010
(r202239)
@@ -175,7 +175,7 @@ ENTRY(intr_fast)
 
 3: ldx [%l0 + IR_FUNC], %o0
ldx [%l0 + IR_ARG], %o1
-   lduw[%l0 + IR_VEC], %o2
+   lduw[%l0 + IR_VEC], %l2
 
ldx [PCPU(IRFREE)], %l1
stx %l1, [%l0 + IR_NEXT]
@@ -187,17 +187,17 @@ ENTRY(intr_fast)
call%o0
 mov%o1, %o0
 
-   /* intrcnt[intr_countp[%o2]]++ */
-   SET(intrcnt, %l7, %l2)  /* %l2 = intrcnt */
-   prefetcha [%l2] ASI_N, 1
-   SET(intr_countp, %l7, %l3)  /* %l3 = intr_countp */
-   sllx%o2, 1, %l4 /* %l4 = vec << 1 */
-   lduh[%l4 + %l3], %l5/* %l5 = intr_countp[%o2] */
-   sllx%l5, 3, %l6 /* %l6 = intr_countp[%o2] << 3 */
-   add %l6, %l2, %l7   /* %l7 = intrcnt[intr_countp[%o2]] */
-   ldx [%l7], %l2
+   /* intrcnt[intr_countp[%l2]]++ */
+   SET(intrcnt, %l7, %l3)  /* %l3 = intrcnt */
+   prefetcha [%l3] ASI_N, 1
+   SET(intr_countp, %l7, %l4)  /* %l4 = intr_countp */
+   sllx%l2, 1, %l2 /* %l2 = vec << 1 */
+   lduh[%l4 + %l2], %l4/* %l4 = intr_countp[%l2] */
+   sllx%l4, 3, %l4 /* %l4 = intr_countp[%l2] << 3 */
+   add %l4, %l3, %l4   /* %l4 = intrcnt[intr_countp[%l2]] */
+   ldx [%l4], %l2
inc %l2
-   stx %l2, [%l7]
+   stx %l2, [%l4]
 
ba,a%xcc, 1b
 nop
___
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: r202240 - in stable/6/sys: dev/auxio sparc64/central sparc64/fhc sparc64/pci sparc64/sbus sparc64/sparc64

2010-01-13 Thread Marius Strobl
Author: marius
Date: Wed Jan 13 20:48:42 2010
New Revision: 202240
URL: http://svn.freebsd.org/changeset/base/202240

Log:
  MFC: r200815, r200816
  
  Provide and consume missing module dependency information.

Modified:
  stable/6/sys/dev/auxio/auxio.c
  stable/6/sys/sparc64/central/central.c
  stable/6/sys/sparc64/fhc/fhc_nexus.c
  stable/6/sys/sparc64/pci/apb.c
  stable/6/sys/sparc64/pci/ofw_pcib.c
  stable/6/sys/sparc64/sbus/sbus.c
  stable/6/sys/sparc64/sparc64/nexus.c
Directory Properties:
  stable/6/sys/   (props changed)
  stable/6/sys/contrib/pf/   (props changed)
  stable/6/sys/dev/cxgb/   (props changed)

Modified: stable/6/sys/dev/auxio/auxio.c
==
--- stable/6/sys/dev/auxio/auxio.c  Wed Jan 13 20:41:27 2010
(r202239)
+++ stable/6/sys/dev/auxio/auxio.c  Wed Jan 13 20:48:42 2010
(r202240)
@@ -56,7 +56,7 @@
  */
 
 /*
- * AUXIO registers support on the sbus & ebus2, used for the floppy driver
+ * AUXIO registers support on the SBus & EBus2, used for the floppy driver
  * and to control the system LED, for the BLINK option.
  */
 
@@ -85,8 +85,8 @@ __FBSDID("$FreeBSD$");
 #include 
 
 /*
- * on sun4u, auxio exists with one register (LED) on the sbus, and 5
- * registers on the ebus2 (pci) (LED, PCIMODE, FREQUENCY, SCSI
+ * On sun4u, auxio exists with one register (LED) on the SBus, and 5
+ * registers on the EBus2 (pci) (LED, PCIMODE, FREQUENCY, SCSI
  * OSCILLATOR, and TEMP SENSE.
  */
 
@@ -142,6 +142,7 @@ static driver_t auxio_sbus_driver = {
 
 static devclass_t  auxio_devclass;
 DRIVER_MODULE(auxio, sbus, auxio_sbus_driver, auxio_devclass, 0, 0);
+MODULE_DEPEND(auxio, sbus, 1, 1, 1);
 
 /* EBus */
 static device_method_t auxio_ebus_methods[] = {
@@ -158,6 +159,7 @@ static driver_t auxio_ebus_driver = {
 };
 
 DRIVER_MODULE(auxio, ebus, auxio_ebus_driver, auxio_devclass, 0, 0);
+MODULE_DEPEND(auxio, ebus, 1, 1, 1);
 MODULE_VERSION(auxio, 1);
 
 #define AUXIO_LOCK_INIT(sc)\

Modified: stable/6/sys/sparc64/central/central.c
==
--- stable/6/sys/sparc64/central/central.c  Wed Jan 13 20:41:27 2010
(r202239)
+++ stable/6/sys/sparc64/central/central.c  Wed Jan 13 20:48:42 2010
(r202240)
@@ -112,6 +112,7 @@ static driver_t central_driver = {
 static devclass_t central_devclass;
 
 DRIVER_MODULE(central, nexus, central_driver, central_devclass, 0, 0);
+MODULE_DEPEND(fhc, nexus, 1, 1, 1);
 MODULE_VERSION(central, 1);
 
 static int

Modified: stable/6/sys/sparc64/fhc/fhc_nexus.c
==
--- stable/6/sys/sparc64/fhc/fhc_nexus.cWed Jan 13 20:41:27 2010
(r202239)
+++ stable/6/sys/sparc64/fhc/fhc_nexus.cWed Jan 13 20:48:42 2010
(r202240)
@@ -89,6 +89,7 @@ static driver_t fhc_nexus_driver = {
 static devclass_t fhc_nexus_devclass;
 
 DRIVER_MODULE(fhc, nexus, fhc_nexus_driver, fhc_nexus_devclass, 0, 0);
+MODULE_DEPEND(fhc, nexus, 1, 1, 1);
 
 static int
 fhc_nexus_probe(device_t dev)

Modified: stable/6/sys/sparc64/pci/apb.c
==
--- stable/6/sys/sparc64/pci/apb.c  Wed Jan 13 20:41:27 2010
(r202239)
+++ stable/6/sys/sparc64/pci/apb.c  Wed Jan 13 20:48:42 2010
(r202240)
@@ -116,6 +116,7 @@ static devclass_t pcib_devclass;
 
 DEFINE_CLASS_0(pcib, apb_driver, apb_methods, sizeof(struct apb_softc));
 DRIVER_MODULE(apb, pci, apb_driver, pcib_devclass, 0, 0);
+MODULE_DEPEND(apb, pci, 1, 1, 1);
 
 /* APB specific registers */
 #defineAPBR_IOMAP  0xde

Modified: stable/6/sys/sparc64/pci/ofw_pcib.c
==
--- stable/6/sys/sparc64/pci/ofw_pcib.c Wed Jan 13 20:41:27 2010
(r202239)
+++ stable/6/sys/sparc64/pci/ofw_pcib.c Wed Jan 13 20:48:42 2010
(r202240)
@@ -97,6 +97,7 @@ static devclass_t pcib_devclass;
 DEFINE_CLASS_0(pcib, ofw_pcib_driver, ofw_pcib_methods,
 sizeof(struct ofw_pcib_gen_softc));
 DRIVER_MODULE(ofw_pcib, pci, ofw_pcib_driver, pcib_devclass, 0, 0);
+MODULE_DEPEND(ofw_pcib, pci, 1, 1, 1);
 
 static int
 ofw_pcib_probe(device_t dev)

Modified: stable/6/sys/sparc64/sbus/sbus.c
==
--- stable/6/sys/sparc64/sbus/sbus.cWed Jan 13 20:41:27 2010
(r202239)
+++ stable/6/sys/sparc64/sbus/sbus.cWed Jan 13 20:48:42 2010
(r202240)
@@ -261,6 +261,7 @@ static driver_t sbus_driver = {
 static devclass_t sbus_devclass;
 
 DRIVER_MODULE(sbus, nexus, sbus_driver, sbus_devclass, 0, 0);
+MODULE_DEPEND(sbus, nexus, 1, 1, 1);
 MODULE_VERSION(sbus, 1);
 
 #defineOFW_SBUS_TYPE   "sbus"

Modified: stable/6/sys/sparc64/sparc64/nexus.c
==
--- stable/

svn commit: r202241 - stable/8/sys/sparc64/sparc64

2010-01-13 Thread Marius Strobl
Author: marius
Date: Wed Jan 13 20:51:21 2010
New Revision: 202241
URL: http://svn.freebsd.org/changeset/base/202241

Log:
  MFC: r200915
  
  Don't probe the bq4802 variant found in Ultra 25 and 45 for now as
  this chip isn't MC146818 compatible and requires different handlers
  (but which I can't test due to lack of such hardware).

Modified:
  stable/8/sys/sparc64/sparc64/rtc.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/sparc64/sparc64/rtc.c
==
--- stable/8/sys/sparc64/sparc64/rtc.c  Wed Jan 13 20:48:42 2010
(r202240)
+++ stable/8/sys/sparc64/sparc64/rtc.c  Wed Jan 13 20:51:21 2010
(r202241)
@@ -28,10 +28,11 @@
 __FBSDID("$FreeBSD$");
 
 /*
- * The `rtc' device is a MC146818 compatible clock found on the ISA
- * bus and EBus. The EBus variant actually is the Real-Time Clock
- * function of a National Semiconductor PC87317/PC97317 which also
- * provides Advanced Power Control functionality.
+ * The `rtc' device is found on the ISA bus and the EBus.  The ISA version
+ * always is a MC146818 compatible clock while the EBus variant either is the
+ * MC146818 compatible Real-Time Clock function of a National Semiconductor
+ * PC87317/PC97317 which also provides Advanced Power Control functionality
+ * or a Texas Instruments bq4802.
  */
 
 #include "opt_isa.h"
@@ -130,6 +131,10 @@ rtc_ebus_probe(device_t dev)
 {
 
if (strcmp(ofw_bus_get_name(dev), "rtc") == 0) {
+   /* The bq4802 is not supported, yet. */
+   if (ofw_bus_get_compat(dev) != NULL &&
+   strcmp(ofw_bus_get_compat(dev), "bq4802") == 0)
+   return (ENXIO);
device_set_desc(dev, RTC_DESC);
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: r202242 - stable/7/sys/sparc64/sparc64

2010-01-13 Thread Marius Strobl
Author: marius
Date: Wed Jan 13 20:51:23 2010
New Revision: 202242
URL: http://svn.freebsd.org/changeset/base/202242

Log:
  MFC: r200915
  
  Don't probe the bq4802 variant found in Ultra 25 and 45 for now as
  this chip isn't MC146818 compatible and requires different handlers
  (but which I can't test due to lack of such hardware).

Modified:
  stable/7/sys/sparc64/sparc64/rtc.c
Directory Properties:
  stable/7/sys/   (props changed)
  stable/7/sys/cddl/contrib/opensolaris/   (props changed)
  stable/7/sys/contrib/dev/acpica/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)

Modified: stable/7/sys/sparc64/sparc64/rtc.c
==
--- stable/7/sys/sparc64/sparc64/rtc.c  Wed Jan 13 20:51:21 2010
(r202241)
+++ stable/7/sys/sparc64/sparc64/rtc.c  Wed Jan 13 20:51:23 2010
(r202242)
@@ -28,10 +28,11 @@
 __FBSDID("$FreeBSD$");
 
 /*
- * The `rtc' device is a MC146818 compatible clock found on the ISA
- * bus and EBus. The EBus variant actually is the Real-Time Clock
- * function of a National Semiconductor PC87317/PC97317 which also
- * provides Advanced Power Control functionality.
+ * The `rtc' device is found on the ISA bus and the EBus.  The ISA version
+ * always is a MC146818 compatible clock while the EBus variant either is the
+ * MC146818 compatible Real-Time Clock function of a National Semiconductor
+ * PC87317/PC97317 which also provides Advanced Power Control functionality
+ * or a Texas Instruments bq4802.
  */
 
 #include "opt_isa.h"
@@ -130,6 +131,10 @@ rtc_ebus_probe(device_t dev)
 {
 
if (strcmp(ofw_bus_get_name(dev), "rtc") == 0) {
+   /* The bq4802 is not supported, yet. */
+   if (ofw_bus_get_compat(dev) != NULL &&
+   strcmp(ofw_bus_get_compat(dev), "bq4802") == 0)
+   return (ENXIO);
device_set_desc(dev, RTC_DESC);
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: r202243 - in head: share/man/man4 sys/dev/usb sys/dev/usb/net

2010-01-13 Thread Andrew Thompson
Author: thompsa
Date: Wed Jan 13 20:54:18 2010
New Revision: 202243
URL: http://svn.freebsd.org/changeset/base/202243

Log:
  Update to Fredrik's latest uhso driver. This changes port detection, adds
  comments and other code nits.
  
  Submitted by: Fredrik Lindberg 

Modified:
  head/share/man/man4/uhso.4
  head/sys/dev/usb/net/uhso.c
  head/sys/dev/usb/usbdevs

Modified: head/share/man/man4/uhso.4
==
--- head/share/man/man4/uhso.4  Wed Jan 13 20:51:23 2010(r202242)
+++ head/share/man/man4/uhso.4  Wed Jan 13 20:54:18 2010(r202243)
@@ -23,11 +23,11 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd Aug 12, 2009
+.Dd January 14, 2010
 .Os
 .Dt UHSO 4
 .Sh NAME
-.Nm hso
+.Nm uhso
 .Nd support for several HSxPA devices from Option N.V.
 .Sh SYNOPSIS
 The module can be loaded at boot time by placing the following line in
@@ -47,12 +47,12 @@ driver which makes them behave like a
 .Xr tty 4 .
 The packet interface is exposed as a network interface.
 .Pp
-To establish a connection on the packet interface the use of the proprietary
+Connection of the packet interface is achieved by using the proprietary
 AT commands
 .Dq Li AT_OWANCALL
 and
 .Dq Li AT_OWANDATA
-are required on any of the serial ports.
+on any of the available serial ports.
 .Pp
 The network interface must be configured manually using the data obtain from
 these calls.
@@ -70,12 +70,23 @@ driver supports at least the following c
 Option GlobeSurfer iCON 7.2 (new firmware)
 .It
 Option iCON 225
+.It
+Option iCON 505
 .El
 .Pp
 The device features a mass storage device referred to as
 .Dq Zero-CD
-which contains drivers for Microsoft Windows.
-The driver automatically switches the device to modem mode.
+which contains drivers for Microsoft Windows, this is the default
+mode for the device.
+The
+.Nm
+driver automatically switches the device from
+.Dq Zero-CD
+mode to modem mode.
+This behavior can be disabled by setting
+.Va hw.usb.uhso.auto_switch
+to 0 using
+.Xr sysctl 8
 .Sh EXAMPLES
 Establishing a packet interface connection
 .Bd -literal -offset indent

Modified: head/sys/dev/usb/net/uhso.c
==
--- head/sys/dev/usb/net/uhso.c Wed Jan 13 20:51:23 2010(r202242)
+++ head/sys/dev/usb/net/uhso.c Wed Jan 13 20:54:18 2010(r202243)
@@ -1,5 +1,5 @@
 /*-
- * Copyright (c) 2009 Fredrik Lindberg
+ * Copyright (c) 2009 Fredrik Lindberg 
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -63,13 +63,15 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
+#include 
 #include 
 #include 
 
 struct uhso_tty {
struct uhso_softc *ht_sc;
struct usb_xfer *ht_xfer[3];
-   int ht_muxport;
+   int ht_muxport; /* Mux. port no */
int ht_open;
charht_name[32];
 };
@@ -78,7 +80,7 @@ struct uhso_softc {
device_tsc_dev;
struct usb_device   *sc_udev;
struct mtx  sc_mtx;
-   uint32_tsc_type;
+   uint32_tsc_type;/* Interface definition */
 
struct usb_xfer *sc_xfer[3];
uint8_t sc_iface_no;
@@ -91,14 +93,14 @@ struct uhso_softc {
/* Network */
struct usb_xfer *sc_if_xfer[2];
struct ifnet*sc_ifp;
-   struct mbuf *sc_mwait;  /* partial packet */
-   size_t  sc_waitlen; /* no. of outstanding bytes */
+   struct mbuf *sc_mwait;  /* Partial packet */
+   size_t  sc_waitlen; /* No. of outstanding bytes */
struct ifqueue  sc_rxq;
struct callout  sc_c;
 
/* TTY related structures */
struct ucom_super_softc sc_super_ucom;
-   int sc_ttys;
+   int sc_ttys;
struct uhso_tty *sc_tty;
struct ucom_softc   *sc_ucom;
int sc_msr;
@@ -106,7 +108,6 @@ struct uhso_softc {
int sc_line;
 };
 
-
 #define UHSO_MAX_MTU   2048
 
 /*
@@ -135,7 +136,7 @@ struct uhso_softc {
  * Port types
  */
 #define UHSO_PORT_UNKNOWN  0x00
-#define UHSO_PORT_SERIAL   0x01/* Serial port */
+#define UHSO_PORT_SERIAL   0x01/* Serial port */
 #define UHSO_PORT_NETWORK  0x02/* Network packet interface */
 
 /*
@@ -145,12 +146,14 @@ struct uhso_softc {
 #define UHSO_MPORT_TYPE_APP0x01/* Application */
 #define UHSO_MPORT_TYPE_PCSC   0x02
 #define UHSO_MPORT_TYPE_GPS0x03
-#define UHSO_MPORT_TYPE_APP2   0x04
+#define UHSO_MPORT_TYPE_APP2   0x04/* Secondary application */
 #define UHSO_MPORT_TYPE_MAXUHSO_MPORT_TYPE_APP2
 #define UHSO_MPORT_TYPE_NOMAX  8   /* Max number of mux ports */
 
 /*
  * Po

svn commit: r202244 - stable/8/sys/sun4v/conf

2010-01-13 Thread Marius Strobl
Author: marius
Date: Wed Jan 13 20:59:36 2010
New Revision: 202244
URL: http://svn.freebsd.org/changeset/base/202244

Log:
  MFC: r200916
  
  Remove devices which are/were only relevant for sun4u.

Modified:
  stable/8/sys/sun4v/conf/NOTES
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/sun4v/conf/NOTES
==
--- stable/8/sys/sun4v/conf/NOTES   Wed Jan 13 20:54:18 2010
(r202243)
+++ stable/8/sys/sun4v/conf/NOTES   Wed Jan 13 20:59:36 2010
(r202244)
@@ -21,37 +21,18 @@ cpu SUN4V
 device ebus
 #deviceisa
 device pci
-device sbus
-#devicecentral
-device fhc
 
 
 #
 # HARDWARE DEVICE CONFIGURATION
 
 #
-# Mandatory devices:
-#
-
-#deviceeeprom  # eeprom (really a front-end for the 
MK48Txx)
-device mk48txx # Mostek MK48Txx clocks
-#devicertc # rtc (really a front-end for the 
MC146818)
-device mc146818# Motorola MC146818 and compatible clocks
-
-#
 # Optional devices:
 #
 
-#deviceauxio   # auxiliary I/O device
-#deviceclkbrd  # Clock Board (blinkenlight on Sun 
Exx00)
-#devicecreator # Creator, Creator3D and Elite3D 
framebuffers
-#devicemachfb  # ATI Mach64 framebuffers
-
 device ofw_console # Open Firmware console device
 option OFWCONS_POLL_HZ=4 # 20 or more works best on Ultra2
 
-#devicesab # Siemens SAB82532 based serial ports
-
 
 #
 # Devices we don't want to deal with
___
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: r202245 - stable/7/sys/sun4v/conf

2010-01-13 Thread Marius Strobl
Author: marius
Date: Wed Jan 13 20:59:42 2010
New Revision: 202245
URL: http://svn.freebsd.org/changeset/base/202245

Log:
  MFC: r200916
  
  Remove devices which are/were only relevant for sun4u.

Modified:
  stable/7/sys/sun4v/conf/NOTES
Directory Properties:
  stable/7/sys/   (props changed)
  stable/7/sys/cddl/contrib/opensolaris/   (props changed)
  stable/7/sys/contrib/dev/acpica/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)

Modified: stable/7/sys/sun4v/conf/NOTES
==
--- stable/7/sys/sun4v/conf/NOTES   Wed Jan 13 20:59:36 2010
(r202244)
+++ stable/7/sys/sun4v/conf/NOTES   Wed Jan 13 20:59:42 2010
(r202245)
@@ -21,9 +21,6 @@ cpu   SUN4V
 device ebus
 #deviceisa
 device pci
-device sbus
-#devicecentral
-device fhc
 
 
 #
@@ -34,25 +31,14 @@ device  fhc
 #
 
 device genclock# Generic clock interface
-#deviceeeprom  # eeprom (really a front-end for the 
MK48Txx)
-device mk48txx # Mostek MK48Txx clocks
-#devicertc # rtc (really a front-end for the 
MC146818)
-device mc146818# Motorola MC146818 and compatible clocks
 
 #
 # Optional devices:
 #
 
-#deviceauxio   # auxiliary I/O device
-#deviceclkbrd  # Clock Board (blinkenlight on Sun 
Exx00)
-#devicecreator # Creator, Creator3D and Elite3D 
framebuffers
-#devicemachfb  # ATI Mach64 framebuffers
-
 device ofw_console # Open Firmware console device
 option OFWCONS_POLL_HZ=4 # 20 or more works best on Ultra2
 
-#devicesab # Siemens SAB82532 based serial ports
-
 
 #
 # Devices we don't want to deal with
___
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: r202246 - in stable/8/sys: conf sun4v/conf

2010-01-13 Thread Marius Strobl
Author: marius
Date: Wed Jan 13 21:03:04 2010
New Revision: 202246
URL: http://svn.freebsd.org/changeset/base/202246

Log:
  MFC: r200917
  
  Hook ebus(4) and isa(4) up to the sun4v LINT build in order to
  ensure that their compilation doesn't break as they are expected
  to work as-is now (but aren't actually run-time tested).

Modified:
  stable/8/sys/conf/files.sun4v
  stable/8/sys/sun4v/conf/NOTES
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/conf/files.sun4v
==
--- stable/8/sys/conf/files.sun4v   Wed Jan 13 20:59:42 2010
(r202245)
+++ stable/8/sys/conf/files.sun4v   Wed Jan 13 21:03:04 2010
(r202246)
@@ -35,6 +35,10 @@ libkern/ffsl.c   standard
 libkern/fls.c  standard
 libkern/flsl.c standard
 libkern/memmove.c  standard
+sparc64/ebus/ebus.coptionalebus
+sparc64/isa/isa.c  optionalisa
+sparc64/isa/isa_dma.c  optionalisa
+sparc64/isa/ofw_isa.c  optionalebus | isa
 sparc64/sparc64/autoconf.c standard
 sun4v/sun4v/bus_machdep.c  standard
 sun4v/sun4v/clock.cstandard

Modified: stable/8/sys/sun4v/conf/NOTES
==
--- stable/8/sys/sun4v/conf/NOTES   Wed Jan 13 20:59:42 2010
(r202245)
+++ stable/8/sys/sun4v/conf/NOTES   Wed Jan 13 21:03:04 2010
(r202246)
@@ -19,7 +19,7 @@ cpu   SUN4V
 # HARDWARE BUS CONFIGURATION
 
 device ebus
-#deviceisa
+device isa
 device pci
 
 
___
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: r202247 - in stable/7/sys: conf sun4v/conf

2010-01-13 Thread Marius Strobl
Author: marius
Date: Wed Jan 13 21:03:06 2010
New Revision: 202247
URL: http://svn.freebsd.org/changeset/base/202247

Log:
  MFC: r200917
  
  Hook ebus(4) and isa(4) up to the sun4v LINT build in order to
  ensure that their compilation doesn't break as they are expected
  to work as-is now (but aren't actually run-time tested).

Modified:
  stable/7/sys/conf/files.sun4v
  stable/7/sys/sun4v/conf/NOTES
Directory Properties:
  stable/7/sys/   (props changed)
  stable/7/sys/cddl/contrib/opensolaris/   (props changed)
  stable/7/sys/contrib/dev/acpica/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)

Modified: stable/7/sys/conf/files.sun4v
==
--- stable/7/sys/conf/files.sun4v   Wed Jan 13 21:03:04 2010
(r202246)
+++ stable/7/sys/conf/files.sun4v   Wed Jan 13 21:03:06 2010
(r202247)
@@ -32,6 +32,10 @@ libkern/ffs.cstandard
 libkern/ffsl.c standard
 libkern/fls.c  standard
 libkern/flsl.c standard
+sparc64/ebus/ebus.coptionalebus
+sparc64/isa/isa.c  optionalisa
+sparc64/isa/isa_dma.c  optionalisa
+sparc64/isa/ofw_isa.c  optionalebus | isa
 sparc64/sparc64/autoconf.c standard
 sun4v/sun4v/bus_machdep.c  standard
 sun4v/sun4v/clock.cstandard

Modified: stable/7/sys/sun4v/conf/NOTES
==
--- stable/7/sys/sun4v/conf/NOTES   Wed Jan 13 21:03:04 2010
(r202246)
+++ stable/7/sys/sun4v/conf/NOTES   Wed Jan 13 21:03:06 2010
(r202247)
@@ -19,7 +19,7 @@ cpu   SUN4V
 # HARDWARE BUS CONFIGURATION
 
 device ebus
-#deviceisa
+device isa
 device pci
 
 
___
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: r202248 - stable/8/sys/sparc64/pci

2010-01-13 Thread Marius Strobl
Author: marius
Date: Wed Jan 13 21:04:56 2010
New Revision: 202248
URL: http://svn.freebsd.org/changeset/base/202248

Log:
  MFC: r200918
  
  Add structures for OFW MSI/MSI-X support. These are identical for
  both sun4u and sun4v.

Modified:
  stable/8/sys/sparc64/pci/ofw_pci.h
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/sparc64/pci/ofw_pci.h
==
--- stable/8/sys/sparc64/pci/ofw_pci.h  Wed Jan 13 21:03:06 2010
(r202247)
+++ stable/8/sys/sparc64/pci/ofw_pci.h  Wed Jan 13 21:04:56 2010
(r202248)
@@ -48,6 +48,31 @@ typedef uint32_t ofw_pci_intr_t;
 #defineOFW_TYPE_PCI"pci"
 #defineOFW_TYPE_PCIE   "pciex"
 
+struct ofw_pci_msi_addr_ranges {
+   uint32_taddr32_hi;
+   uint32_taddr32_lo;
+   uint32_taddr32_sz;
+   uint32_taddr64_hi;
+   uint32_taddr64_lo;
+   uint32_taddr64_sz;
+};
+
+#defineOFW_PCI_MSI_ADDR_RANGE_32(r) \
+   (((uint64_t)(r)->addr32_hi << 32) | (uint64_t)(r)->addr32_lo)
+#defineOFW_PCI_MSI_ADDR_RANGE_64(r) \
+   (((uint64_t)(r)->addr64_hi << 32) | (uint64_t)(r)->addr64_lo)
+
+struct ofw_pci_msi_eq_to_devino {
+   uint32_teq_first;
+   uint32_teq_count;
+   uint32_tdevino_first;
+};
+
+struct ofw_pci_msi_ranges {
+   uint32_tfirst;
+   uint32_tcount;
+};
+
 struct ofw_pci_ranges {
uint32_tcspace;
uint32_tchild_hi;
___
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: r202249 - stable/7/sys/sparc64/pci

2010-01-13 Thread Marius Strobl
Author: marius
Date: Wed Jan 13 21:05:01 2010
New Revision: 202249
URL: http://svn.freebsd.org/changeset/base/202249

Log:
  MFC: r200918
  
  Add structures for OFW MSI/MSI-X support. These are identical for
  both sun4u and sun4v.

Modified:
  stable/7/sys/sparc64/pci/ofw_pci.h
Directory Properties:
  stable/7/sys/   (props changed)
  stable/7/sys/cddl/contrib/opensolaris/   (props changed)
  stable/7/sys/contrib/dev/acpica/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)

Modified: stable/7/sys/sparc64/pci/ofw_pci.h
==
--- stable/7/sys/sparc64/pci/ofw_pci.h  Wed Jan 13 21:04:56 2010
(r202248)
+++ stable/7/sys/sparc64/pci/ofw_pci.h  Wed Jan 13 21:05:01 2010
(r202249)
@@ -48,6 +48,31 @@ typedef uint32_t ofw_pci_intr_t;
 #defineOFW_TYPE_PCI"pci"
 #defineOFW_TYPE_PCIE   "pciex"
 
+struct ofw_pci_msi_addr_ranges {
+   uint32_taddr32_hi;
+   uint32_taddr32_lo;
+   uint32_taddr32_sz;
+   uint32_taddr64_hi;
+   uint32_taddr64_lo;
+   uint32_taddr64_sz;
+};
+
+#defineOFW_PCI_MSI_ADDR_RANGE_32(r) \
+   (((uint64_t)(r)->addr32_hi << 32) | (uint64_t)(r)->addr32_lo)
+#defineOFW_PCI_MSI_ADDR_RANGE_64(r) \
+   (((uint64_t)(r)->addr64_hi << 32) | (uint64_t)(r)->addr64_lo)
+
+struct ofw_pci_msi_eq_to_devino {
+   uint32_teq_first;
+   uint32_teq_count;
+   uint32_tdevino_first;
+};
+
+struct ofw_pci_msi_ranges {
+   uint32_tfirst;
+   uint32_tcount;
+};
+
 struct ofw_pci_ranges {
uint32_tcspace;
uint32_tchild_hi;
___
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: r202250 - stable/7/sys/sparc64/pci

2010-01-13 Thread Marius Strobl
Author: marius
Date: Wed Jan 13 21:08:57 2010
New Revision: 202250
URL: http://svn.freebsd.org/changeset/base/202250

Log:
  MFC: r200920
  
  - Sort the prototypes.
  - Add macros to ease the access of device configuration space in
ofw_pcibus_setup_device().

Modified:
  stable/7/sys/sparc64/pci/ofw_pcibus.c
Directory Properties:
  stable/7/sys/   (props changed)
  stable/7/sys/cddl/contrib/opensolaris/   (props changed)
  stable/7/sys/contrib/dev/acpica/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)

Modified: stable/7/sys/sparc64/pci/ofw_pcibus.c
==
--- stable/7/sys/sparc64/pci/ofw_pcibus.c   Wed Jan 13 21:05:01 2010
(r202249)
+++ stable/7/sys/sparc64/pci/ofw_pcibus.c   Wed Jan 13 21:08:57 2010
(r202250)
@@ -65,10 +65,10 @@ static void ofw_pcibus_setup_device(devi
 u_int busno, u_int slot, u_int func);
 
 /* Methods */
-static device_probe_t ofw_pcibus_probe;
 static device_attach_t ofw_pcibus_attach;
-static pci_assign_interrupt_t ofw_pcibus_assign_interrupt;
+static device_probe_t ofw_pcibus_probe;
 static ofw_bus_get_devinfo_t ofw_pcibus_get_devinfo;
+static pci_assign_interrupt_t ofw_pcibus_assign_interrupt;
 
 static device_method_t ofw_pcibus_methods[] = {
/* Device interface */
@@ -122,6 +122,11 @@ static void
 ofw_pcibus_setup_device(device_t bridge, uint32_t clock, u_int busno,
 u_int slot, u_int func)
 {
+#defineCS_READ(n, w)   
\
+   PCIB_READ_CONFIG(bridge, busno, slot, func, (n), (w))
+#defineCS_WRITE(n, v, w)   
\
+   PCIB_WRITE_CONFIG(bridge, busno, slot, func, (n), (v), (w))
+
 #ifndef SUN4V
uint32_t reg;
 
@@ -136,10 +141,9 @@ ofw_pcibus_setup_device(device_t bridge,
 * For bridges, we additionally set up the bridge control and the
 * secondary latency registers.
 */
-   if ((PCIB_READ_CONFIG(bridge, busno, slot, func, PCIR_HDRTYPE, 1) &
-   PCIM_HDRTYPE) == PCIM_HDRTYPE_BRIDGE) {
-   reg = PCIB_READ_CONFIG(bridge, busno, slot, func,
-   PCIR_BRIDGECTL_1, 1);
+   if ((CS_READ(PCIR_HDRTYPE, 1) & PCIM_HDRTYPE) ==
+   PCIM_HDRTYPE_BRIDGE) {
+   reg = CS_READ(PCIR_BRIDGECTL_1, 1);
 #if 0
reg |= PCIB_BCR_MASTER_ABORT_MODE | PCIB_BCR_SERR_ENABLE |
 #else
@@ -149,24 +153,19 @@ ofw_pcibus_setup_device(device_t bridge,
 #ifdef OFW_PCI_DEBUG
device_printf(bridge,
"bridge %d/%d/%d: control 0x%x -> 0x%x\n",
-   busno, slot, func, PCIB_READ_CONFIG(bridge, busno, slot,
-   func, PCIR_BRIDGECTL_1, 1), reg);
+   busno, slot, func, CS_READ(PCIR_BRIDGECTL_1, 1), reg);
 #endif /* OFW_PCI_DEBUG */
-   PCIB_WRITE_CONFIG(bridge, busno, slot, func, PCIR_BRIDGECTL_1,
-   reg, 1);
+   CS_WRITE(PCIR_BRIDGECTL_1, reg, 1);
 
reg = OFW_PCI_LATENCY;
 #ifdef OFW_PCI_DEBUG
device_printf(bridge,
"bridge %d/%d/%d: latency timer %d -> %d\n",
-   busno, slot, func, PCIB_READ_CONFIG(bridge, busno, slot,
-   func, PCIR_SECLAT_1, 1), reg);
+   busno, slot, func, CS_READ(PCIR_SECLAT_1, 1), reg);
 #endif /* OFW_PCI_DEBUG */
-   PCIB_WRITE_CONFIG(bridge, busno, slot, func, PCIR_SECLAT_1,
-   reg, 1);
+   CS_WRITE(PCIR_SECLAT_1, reg, 1);
} else {
-   reg = PCIB_READ_CONFIG(bridge, busno, slot, func,
-   PCIR_MINGNT, 1);
+   reg = CS_READ(PCIR_MINGNT, 1);
if (reg != 0) {
switch (clock) {
case 3300:
@@ -182,10 +181,9 @@ ofw_pcibus_setup_device(device_t bridge,
}
 #ifdef OFW_PCI_DEBUG
device_printf(bridge, "device %d/%d/%d: latency timer %d -> %d\n",
-   busno, slot, func, PCIB_READ_CONFIG(bridge, busno, slot, func,
-   PCIR_LATTIMER, 1), reg);
+   busno, slot, func, CS_READ(PCIR_LATTIMER, 1), reg);
 #endif /* OFW_PCI_DEBUG */
-   PCIB_WRITE_CONFIG(bridge, busno, slot, func, PCIR_LATTIMER, reg, 1);
+   CS_WRITE(PCIR_LATTIMER, reg, 1);
 
/*
 * Compute a value to write into the cache line size register.
@@ -194,8 +192,7 @@ ofw_pcibus_setup_device(device_t bridge,
 * reached.  Generally, the cache line size is fixed at 64 bytes
 * by Fireplane/Safari, JBus and UPA.
 */
-   PCIB_WRITE_CONFIG(bridge, busno, slot, func, PCIR_CACHELNSZ,
-   STRBUF_LINESZ / sizeof(uint32_t), 1);
+   CS_WRITE(PCIR_CACHELNSZ, STRBUF_LINESZ / sizeof(uint32_t), 1);
 #endif
 
/*
@@ -203,8 +200,10 @@ ofw_pcibus_setup_device(device_t bridge,
 * it to 255, so that the PCI code will reroute the interrupt if
 

svn commit: r202251 - stable/8/sys/sparc64/pci

2010-01-13 Thread Marius Strobl
Author: marius
Date: Wed Jan 13 21:08:57 2010
New Revision: 202251
URL: http://svn.freebsd.org/changeset/base/202251

Log:
  MFC: r200920
  
  - Sort the prototypes.
  - Add macros to ease the access of device configuration space in
ofw_pcibus_setup_device().

Modified:
  stable/8/sys/sparc64/pci/ofw_pcibus.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/sparc64/pci/ofw_pcibus.c
==
--- stable/8/sys/sparc64/pci/ofw_pcibus.c   Wed Jan 13 21:08:57 2010
(r202250)
+++ stable/8/sys/sparc64/pci/ofw_pcibus.c   Wed Jan 13 21:08:57 2010
(r202251)
@@ -64,11 +64,11 @@ static void ofw_pcibus_setup_device(devi
 u_int busno, u_int slot, u_int func);
 
 /* Methods */
-static device_probe_t ofw_pcibus_probe;
+static bus_child_pnpinfo_str_t ofw_pcibus_pnpinfo_str;
 static device_attach_t ofw_pcibus_attach;
-static pci_assign_interrupt_t ofw_pcibus_assign_interrupt;
+static device_probe_t ofw_pcibus_probe;
 static ofw_bus_get_devinfo_t ofw_pcibus_get_devinfo;
-static bus_child_pnpinfo_str_t ofw_pcibus_pnpinfo_str;
+static pci_assign_interrupt_t ofw_pcibus_assign_interrupt;
 
 static device_method_t ofw_pcibus_methods[] = {
/* Device interface */
@@ -124,6 +124,11 @@ static void
 ofw_pcibus_setup_device(device_t bridge, uint32_t clock, u_int busno,
 u_int slot, u_int func)
 {
+#defineCS_READ(n, w)   
\
+   PCIB_READ_CONFIG(bridge, busno, slot, func, (n), (w))
+#defineCS_WRITE(n, v, w)   
\
+   PCIB_WRITE_CONFIG(bridge, busno, slot, func, (n), (v), (w))
+
 #ifndef SUN4V
uint32_t reg;
 
@@ -138,33 +143,27 @@ ofw_pcibus_setup_device(device_t bridge,
 * For bridges, we additionally set up the bridge control and the
 * secondary latency registers.
 */
-   if ((PCIB_READ_CONFIG(bridge, busno, slot, func, PCIR_HDRTYPE, 1) &
-   PCIM_HDRTYPE) == PCIM_HDRTYPE_BRIDGE) {
-   reg = PCIB_READ_CONFIG(bridge, busno, slot, func,
-   PCIR_BRIDGECTL_1, 1);
+   if ((CS_READ(PCIR_HDRTYPE, 1) & PCIM_HDRTYPE) ==
+   PCIM_HDRTYPE_BRIDGE) {
+   reg = CS_READ(PCIR_BRIDGECTL_1, 1);
reg |= PCIB_BCR_MASTER_ABORT_MODE | PCIB_BCR_SERR_ENABLE |
PCIB_BCR_PERR_ENABLE;
 #ifdef OFW_PCI_DEBUG
device_printf(bridge,
"bridge %d/%d/%d: control 0x%x -> 0x%x\n",
-   busno, slot, func, PCIB_READ_CONFIG(bridge, busno, slot,
-   func, PCIR_BRIDGECTL_1, 1), reg);
+   busno, slot, func, CS_READ(PCIR_BRIDGECTL_1, 1), reg);
 #endif /* OFW_PCI_DEBUG */
-   PCIB_WRITE_CONFIG(bridge, busno, slot, func, PCIR_BRIDGECTL_1,
-   reg, 1);
+   CS_WRITE(PCIR_BRIDGECTL_1, reg, 1);
 
reg = OFW_PCI_LATENCY;
 #ifdef OFW_PCI_DEBUG
device_printf(bridge,
"bridge %d/%d/%d: latency timer %d -> %d\n",
-   busno, slot, func, PCIB_READ_CONFIG(bridge, busno, slot,
-   func, PCIR_SECLAT_1, 1), reg);
+   busno, slot, func, CS_READ(PCIR_SECLAT_1, 1), reg);
 #endif /* OFW_PCI_DEBUG */
-   PCIB_WRITE_CONFIG(bridge, busno, slot, func, PCIR_SECLAT_1,
-   reg, 1);
+   CS_WRITE(PCIR_SECLAT_1, reg, 1);
} else {
-   reg = PCIB_READ_CONFIG(bridge, busno, slot, func,
-   PCIR_MINGNT, 1);
+   reg = CS_READ(PCIR_MINGNT, 1);
if (reg != 0) {
switch (clock) {
case 3300:
@@ -180,10 +179,9 @@ ofw_pcibus_setup_device(device_t bridge,
}
 #ifdef OFW_PCI_DEBUG
device_printf(bridge, "device %d/%d/%d: latency timer %d -> %d\n",
-   busno, slot, func, PCIB_READ_CONFIG(bridge, busno, slot, func,
-   PCIR_LATTIMER, 1), reg);
+   busno, slot, func, CS_READ(PCIR_LATTIMER, 1), reg);
 #endif /* OFW_PCI_DEBUG */
-   PCIB_WRITE_CONFIG(bridge, busno, slot, func, PCIR_LATTIMER, reg, 1);
+   CS_WRITE(PCIR_LATTIMER, reg, 1);
 
/*
 * Compute a value to write into the cache line size register.
@@ -192,8 +190,7 @@ ofw_pcibus_setup_device(device_t bridge,
 * reached.  Generally, the cache line size is fixed at 64 bytes
 * by Fireplane/Safari, JBus and UPA.
 */
-   PCIB_WRITE_CONFIG(bridge, busno, slot, func, PCIR_CACHELNSZ,
-   STRBUF_LINESZ / sizeof(uint32_t), 1);
+   CS_WRITE(PCIR_CACHELNSZ, STRBUF_LINESZ / sizeof(u

svn commit: r202252 - stable/8/sys/sparc64/pci

2010-01-13 Thread Marius Strobl
Author: marius
Date: Wed Jan 13 21:12:27 2010
New Revision: 202252
URL: http://svn.freebsd.org/changeset/base/202252

Log:
  MFC: r200921
  
  - Add quirk handling for ALi M5229, mainly setting the magic "force
enable IDE I/O" bit which prevents data access traps with revision
0xc8 in Fire-based machines when pci(4) enables PCIM_CMD_PORTEN.
  - Like for sun4v also don't add the PCI side of host-PCIe bridges to
the bus on sun4u as they don't have configuration space implement
there either.

Modified:
  stable/8/sys/sparc64/pci/ofw_pcibus.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/sparc64/pci/ofw_pcibus.c
==
--- stable/8/sys/sparc64/pci/ofw_pcibus.c   Wed Jan 13 21:08:57 2010
(r202251)
+++ stable/8/sys/sparc64/pci/ofw_pcibus.c   Wed Jan 13 21:12:27 2010
(r202252)
@@ -3,6 +3,7 @@
  * Copyright (c) 2000, Michael Smith 
  * Copyright (c) 2000, BSDi
  * Copyright (c) 2003, Thomas Moestl 
+ * Copyright (c) 2005 - 2009 Marius Strobl 
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -194,6 +195,22 @@ ofw_pcibus_setup_device(device_t bridge,
 #endif
 
/*
+* Ensure that ALi M5229 report the actual content of PCIR_PROGIF
+* and that IDE I/O is force enabled.  The former is done in order
+* to have unique behavior across revisions as some default to
+* hiding bits 4-6 for compliance with PCI 2.3.  The latter is done
+* as at least revision 0xc8 requires the PCIM_CMD_PORTEN bypass
+* to be always enabled as otherwise even enabling PCIM_CMD_PORTEN
+* results in an instant data access trap on Fire-based machines.
+* Thus these quirks have to be handled before pci(4) adds the maps.
+* Note that for older revisions bit 0 of register 0x50 enables the
+* internal IDE function instead of force enabling IDE I/O.
+*/
+   if ((CS_READ(PCIR_VENDOR, 2) == 0x10b9 &&
+   CS_READ(PCIR_DEVICE, 2) == 0x5229))
+   CS_WRITE(0x50, CS_READ(0x50, 1) | 0x3, 1);
+
+   /*
 * The preset in the intline register is usually wrong.  Reset
 * it to 255, so that the PCI code will reroute the interrupt if
 * needed.
@@ -222,9 +239,14 @@ ofw_pcibus_attach(device_t dev)
domain, busno);
node = ofw_bus_get_node(dev);
 
-#ifndef SUN4V
-   /* Add the PCI side of the HOST-PCI bridge itself to the bus. */
+   /*
+* Add the PCI side of the host-PCI bridge itself to the bus.
+* Note that we exclude the host-PCIe bridges here as these
+* have no configuration space implemented themselves.
+*/
if (strcmp(device_get_name(device_get_parent(pcib)), "nexus") == 0 &&
+   ofw_bus_get_type(pcib) != NULL &&
+   strcmp(ofw_bus_get_type(pcib), OFW_TYPE_PCIE) != 0 &&
(dinfo = (struct ofw_pcibus_devinfo *)pci_read_device(pcib,
domain, busno, 0, 0, sizeof(*dinfo))) != NULL) {
if (ofw_bus_gen_setup_devinfo(&dinfo->opd_obdinfo, node) != 0)
@@ -232,7 +254,6 @@ ofw_pcibus_attach(device_t dev)
else
pci_add_child(dev, (struct pci_devinfo *)dinfo);
}
-#endif
 
if (OF_getprop(ofw_bus_get_node(pcib), "clock-frequency", &clock,
sizeof(clock)) == -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: r202253 - stable/7/sys/sparc64/pci

2010-01-13 Thread Marius Strobl
Author: marius
Date: Wed Jan 13 21:12:31 2010
New Revision: 202253
URL: http://svn.freebsd.org/changeset/base/202253

Log:
  MFC: r200921
  
  - Add quirk handling for ALi M5229, mainly setting the magic "force
enable IDE I/O" bit which prevents data access traps with revision
0xc8 in Fire-based machines when pci(4) enables PCIM_CMD_PORTEN.
  - Like for sun4v also don't add the PCI side of host-PCIe bridges to
the bus on sun4u as they don't have configuration space implement
there either.

Modified:
  stable/7/sys/sparc64/pci/ofw_pcibus.c
Directory Properties:
  stable/7/sys/   (props changed)
  stable/7/sys/cddl/contrib/opensolaris/   (props changed)
  stable/7/sys/contrib/dev/acpica/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)

Modified: stable/7/sys/sparc64/pci/ofw_pcibus.c
==
--- stable/7/sys/sparc64/pci/ofw_pcibus.c   Wed Jan 13 21:12:27 2010
(r202252)
+++ stable/7/sys/sparc64/pci/ofw_pcibus.c   Wed Jan 13 21:12:31 2010
(r202253)
@@ -3,6 +3,7 @@
  * Copyright (c) 2000, Michael Smith 
  * Copyright (c) 2000, BSDi
  * Copyright (c) 2003, Thomas Moestl 
+ * Copyright (c) 2005 - 2009 Marius Strobl 
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -196,6 +197,22 @@ ofw_pcibus_setup_device(device_t bridge,
 #endif
 
/*
+* Ensure that ALi M5229 report the actual content of PCIR_PROGIF
+* and that IDE I/O is force enabled.  The former is done in order
+* to have unique behavior across revisions as some default to
+* hiding bits 4-6 for compliance with PCI 2.3.  The latter is done
+* as at least revision 0xc8 requires the PCIM_CMD_PORTEN bypass
+* to be always enabled as otherwise even enabling PCIM_CMD_PORTEN
+* results in an instant data access trap on Fire-based machines.
+* Thus these quirks have to be handled before pci(4) adds the maps.
+* Note that for older revisions bit 0 of register 0x50 enables the
+* internal IDE function instead of force enabling IDE I/O.
+*/
+   if ((CS_READ(PCIR_VENDOR, 2) == 0x10b9 &&
+   CS_READ(PCIR_DEVICE, 2) == 0x5229))
+   CS_WRITE(0x50, CS_READ(0x50, 1) | 0x3, 1);
+
+   /*
 * The preset in the intline register is usually wrong.  Reset
 * it to 255, so that the PCI code will reroute the interrupt if
 * needed.
@@ -224,9 +241,14 @@ ofw_pcibus_attach(device_t dev)
domain, busno);
node = ofw_bus_get_node(dev);
 
-#ifndef SUN4V
-   /* Add the PCI side of the HOST-PCI bridge itself to the bus. */
+   /*
+* Add the PCI side of the host-PCI bridge itself to the bus.
+* Note that we exclude the host-PCIe bridges here as these
+* have no configuration space implemented themselves.
+*/
if (strcmp(device_get_name(device_get_parent(pcib)), "nexus") == 0 &&
+   ofw_bus_get_type(pcib) != NULL &&
+   strcmp(ofw_bus_get_type(pcib), OFW_TYPE_PCIE) != 0 &&
(dinfo = (struct ofw_pcibus_devinfo *)pci_read_device(pcib,
domain, busno, 0, 0, sizeof(*dinfo))) != NULL) {
if (ofw_bus_gen_setup_devinfo(&dinfo->opd_obdinfo, node) != 0)
@@ -234,7 +256,6 @@ ofw_pcibus_attach(device_t dev)
else
pci_add_child(dev, (struct pci_devinfo *)dinfo);
}
-#endif
 
if (OF_getprop(ofw_bus_get_node(pcib), "clock-frequency", &clock,
sizeof(clock)) == -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: r202254 - stable/8/sys/sparc64/include

2010-01-13 Thread Marius Strobl
Author: marius
Date: Wed Jan 13 21:13:50 2010
New Revision: 202254
URL: http://svn.freebsd.org/changeset/base/202254

Log:
  MFC: r200922
  
  Fix whitespace according to style(9).

Modified:
  stable/8/sys/sparc64/include/iommureg.h
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/sparc64/include/iommureg.h
==
--- stable/8/sys/sparc64/include/iommureg.h Wed Jan 13 21:12:31 2010
(r202253)
+++ stable/8/sys/sparc64/include/iommureg.h Wed Jan 13 21:13:50 2010
(r202254)
@@ -37,7 +37,7 @@
  */
 
 #ifndef _MACHINE_IOMMUREG_H_
-#define _MACHINE_IOMMUREG_H_
+#define_MACHINE_IOMMUREG_H_
 
 /*
  * UltraSPARC IOMMU registers, common to both the PCI and SBus
@@ -61,9 +61,9 @@
 #defineISD_LN_TAG_DIAG 0x0900  /* streaming buffer line tag diag 0..15 
*/
 
 /* streaming buffer control register */
-#define STRBUF_EN  0x0001UL
-#define STRBUF_D   0x0002UL
-#define STRBUF_RR_DIS  0x0004UL
+#defineSTRBUF_EN   0x0001UL
+#defineSTRBUF_D0x0002UL
+#defineSTRBUF_RR_DIS   0x0004UL
 
 #defineIOMMU_MAXADDR(bits) ((1UL << (bits)) - 1)
 
@@ -72,24 +72,24 @@
  */
 /* Nummber of entries in IOTSB */
 #defineIOMMUCR_TSBSZ_SHIFT 16
-#define IOMMUCR_TSB1K  0xUL
-#define IOMMUCR_TSB2K  0x0001UL
-#define IOMMUCR_TSB4K  0x0002UL
-#define IOMMUCR_TSB8K  0x0003UL
-#define IOMMUCR_TSB16K 0x0004UL
-#define IOMMUCR_TSB32K 0x0005UL
-#define IOMMUCR_TSB64K 0x0006UL
-#define IOMMUCR_TSB128K0x0007UL
+#defineIOMMUCR_TSB1K   0xUL
+#defineIOMMUCR_TSB2K   0x0001UL
+#defineIOMMUCR_TSB4K   0x0002UL
+#defineIOMMUCR_TSB8K   0x0003UL
+#defineIOMMUCR_TSB16K  0x0004UL
+#defineIOMMUCR_TSB32K  0x0005UL
+#defineIOMMUCR_TSB64K  0x0006UL
+#defineIOMMUCR_TSB128K 0x0007UL
 /* Mask for above */
-#define IOMMUCR_TSBMASK0xfff8UL
+#defineIOMMUCR_TSBMASK 0xfff8UL
 /* 8K iommu page size */
-#define IOMMUCR_8KPG   0xUL
+#defineIOMMUCR_8KPG0xUL
 /* 64K iommu page size */
-#define IOMMUCR_64KPG  0x0004UL
+#defineIOMMUCR_64KPG   0x0004UL
 /* Diag enable */
-#define IOMMUCR_DE 0x0002UL
+#defineIOMMUCR_DE  0x0002UL
 /* Enable IOMMU */
-#define IOMMUCR_EN 0x0001UL
+#defineIOMMUCR_EN  0x0001UL
 
 /*
  * Diagnostic register definitions
@@ -97,9 +97,9 @@
 #defineIOMMU_DTAG_VPNBITS  19
 #defineIOMMU_DTAG_VPNMASK  ((1 << IOMMU_DTAG_VPNBITS) - 1)
 #defineIOMMU_DTAG_VPNSHIFT 13
-#define IOMMU_DTAG_ERRBITS 3
+#defineIOMMU_DTAG_ERRBITS  3
 #defineIOMMU_DTAG_ERRSHIFT 22
-#defineIOMMU_DTAG_ERRMASK \
+#defineIOMMU_DTAG_ERRMASK  
\
(((1 << IOMMU_DTAG_ERRBITS) - 1) << IOMMU_DTAG_ERRSHIFT)
 
 #defineIOMMU_DDATA_PGBITS  21
@@ -114,18 +114,18 @@
 /* Entry valid */
 #defineIOTTE_V 0x8000UL
 /* 8K or 64K page? */
-#define IOTTE_64K  0x2000UL
-#define IOTTE_8K   0xUL
+#defineIOTTE_64K   0x2000UL
+#defineIOTTE_8K0xUL
 /* Is page streamable? */
-#define IOTTE_STREAM   0x1000UL
+#defineIOTTE_STREAM0x1000UL
 /* Accesses to same bus segment? */
 #defineIOTTE_LOCAL 0x0800UL
 /* Let's assume this is correct */
-#define IOTTE_PAMASK   0x07ffe000UL
+#defineIOTTE_PAMASK0x07ffe000UL
 /* Accesses to cacheable space */
-#define IOTTE_C0x0010UL
+#defineIOTTE_C 0x0010UL
 /* Writeable */
-#define IOTTE_W0x0002UL
+#defineIOTTE_W 0x0002UL
 
 /* log2 of the IOMMU TTE size */
 #defineIOTTE_SHIFT   

svn commit: r202255 - stable/7/sys/sparc64/include

2010-01-13 Thread Marius Strobl
Author: marius
Date: Wed Jan 13 21:13:51 2010
New Revision: 202255
URL: http://svn.freebsd.org/changeset/base/202255

Log:
  MFC: r200922
  
  Fix whitespace according to style(9).

Modified:
  stable/7/sys/sparc64/include/iommureg.h
Directory Properties:
  stable/7/sys/   (props changed)
  stable/7/sys/cddl/contrib/opensolaris/   (props changed)
  stable/7/sys/contrib/dev/acpica/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)

Modified: stable/7/sys/sparc64/include/iommureg.h
==
--- stable/7/sys/sparc64/include/iommureg.h Wed Jan 13 21:13:50 2010
(r202254)
+++ stable/7/sys/sparc64/include/iommureg.h Wed Jan 13 21:13:51 2010
(r202255)
@@ -37,7 +37,7 @@
  */
 
 #ifndef _MACHINE_IOMMUREG_H_
-#define _MACHINE_IOMMUREG_H_
+#define_MACHINE_IOMMUREG_H_
 
 /*
  * UltraSPARC IOMMU registers, common to both the PCI and SBus
@@ -61,9 +61,9 @@
 #defineISD_LN_TAG_DIAG 0x0900  /* streaming buffer line tag diag 0..15 
*/
 
 /* streaming buffer control register */
-#define STRBUF_EN  0x0001UL
-#define STRBUF_D   0x0002UL
-#define STRBUF_RR_DIS  0x0004UL
+#defineSTRBUF_EN   0x0001UL
+#defineSTRBUF_D0x0002UL
+#defineSTRBUF_RR_DIS   0x0004UL
 
 #defineIOMMU_MAXADDR(bits) ((1UL << (bits)) - 1)
 
@@ -72,24 +72,24 @@
  */
 /* Nummber of entries in IOTSB */
 #defineIOMMUCR_TSBSZ_SHIFT 16
-#define IOMMUCR_TSB1K  0xUL
-#define IOMMUCR_TSB2K  0x0001UL
-#define IOMMUCR_TSB4K  0x0002UL
-#define IOMMUCR_TSB8K  0x0003UL
-#define IOMMUCR_TSB16K 0x0004UL
-#define IOMMUCR_TSB32K 0x0005UL
-#define IOMMUCR_TSB64K 0x0006UL
-#define IOMMUCR_TSB128K0x0007UL
+#defineIOMMUCR_TSB1K   0xUL
+#defineIOMMUCR_TSB2K   0x0001UL
+#defineIOMMUCR_TSB4K   0x0002UL
+#defineIOMMUCR_TSB8K   0x0003UL
+#defineIOMMUCR_TSB16K  0x0004UL
+#defineIOMMUCR_TSB32K  0x0005UL
+#defineIOMMUCR_TSB64K  0x0006UL
+#defineIOMMUCR_TSB128K 0x0007UL
 /* Mask for above */
-#define IOMMUCR_TSBMASK0xfff8UL
+#defineIOMMUCR_TSBMASK 0xfff8UL
 /* 8K iommu page size */
-#define IOMMUCR_8KPG   0xUL
+#defineIOMMUCR_8KPG0xUL
 /* 64K iommu page size */
-#define IOMMUCR_64KPG  0x0004UL
+#defineIOMMUCR_64KPG   0x0004UL
 /* Diag enable */
-#define IOMMUCR_DE 0x0002UL
+#defineIOMMUCR_DE  0x0002UL
 /* Enable IOMMU */
-#define IOMMUCR_EN 0x0001UL
+#defineIOMMUCR_EN  0x0001UL
 
 /*
  * Diagnostic register definitions
@@ -97,9 +97,9 @@
 #defineIOMMU_DTAG_VPNBITS  19
 #defineIOMMU_DTAG_VPNMASK  ((1 << IOMMU_DTAG_VPNBITS) - 1)
 #defineIOMMU_DTAG_VPNSHIFT 13
-#define IOMMU_DTAG_ERRBITS 3
+#defineIOMMU_DTAG_ERRBITS  3
 #defineIOMMU_DTAG_ERRSHIFT 22
-#defineIOMMU_DTAG_ERRMASK \
+#defineIOMMU_DTAG_ERRMASK  
\
(((1 << IOMMU_DTAG_ERRBITS) - 1) << IOMMU_DTAG_ERRSHIFT)
 
 #defineIOMMU_DDATA_PGBITS  21
@@ -114,18 +114,18 @@
 /* Entry valid */
 #defineIOTTE_V 0x8000UL
 /* 8K or 64K page? */
-#define IOTTE_64K  0x2000UL
-#define IOTTE_8K   0xUL
+#defineIOTTE_64K   0x2000UL
+#defineIOTTE_8K0xUL
 /* Is page streamable? */
-#define IOTTE_STREAM   0x1000UL
+#defineIOTTE_STREAM0x1000UL
 /* Accesses to same bus segment? */
 #defineIOTTE_LOCAL 0x0800UL
 /* Let's assume this is correct */
-#define IOTTE_PAMASK   0x07ffe000UL
+#defineIOTTE_PAMASK0x07ffe000UL
 /* Accesses to cacheable space */
-#define IOTTE_C0x0010UL
+#defineIOTTE_C 0x0010UL
 /* Writeable */
-#define IOTTE_W0x0002UL
+#defineIOTTE_W 0x0002UL
 
 /* log2 of the IOMMU TTE size */
 #defineIOTTE_SHIFT 3
@@ -167,14 +167,14 @@
  */
 
 #defineIOTSB_BASESZ(1024 << IOTTE_SHIFT)
-#defi

svn commit: r202256 - in stable/8/sys/sparc64: include sparc64

2010-01-13 Thread Marius Strobl
Author: marius
Date: Wed Jan 13 21:16:07 2010
New Revision: 202256
URL: http://svn.freebsd.org/changeset/base/202256

Log:
  MFC: r200923
  
  - Add support for the IOMMUs of Fire JBus to PCIe and Oberon Uranus
to PCIe bridges.
  - Add support for talking the PROM mappings over to the kernel IOTSB
just like we do with the kernel TSB in order to allow OFW drivers
to continue to work.
  - Change some members, parameters and variables to unsigned where
more appropriate.

Modified:
  stable/8/sys/sparc64/include/iommureg.h
  stable/8/sys/sparc64/include/iommuvar.h
  stable/8/sys/sparc64/sparc64/iommu.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/sparc64/include/iommureg.h
==
--- stable/8/sys/sparc64/include/iommureg.h Wed Jan 13 21:13:51 2010
(r202255)
+++ stable/8/sys/sparc64/include/iommureg.h Wed Jan 13 21:16:07 2010
(r202256)
@@ -44,10 +44,13 @@
  * controllers.
  */
 
-/* iommmu registers */
+/* IOMMU registers */
 #defineIMR_CTL 0x  /* IOMMU control register */
 #defineIMR_TSB 0x0008  /* IOMMU TSB base register */
 #defineIMR_FLUSH   0x0010  /* IOMMU flush register */
+/* The TTE Cache is Fire and Oberon only. */
+#defineIMR_CACHE_FLUSH 0x0100  /* IOMMU TTE cache flush address 
register */
+#defineIMR_CACHE_INVAL 0x0108  /* IOMMU TTE cache invalidate register 
*/
 
 /* streaming buffer registers */
 #defineISR_CTL 0x  /* streaming buffer control reg */
@@ -70,28 +73,57 @@
 /*
  * control register bits
  */
-/* Nummber of entries in IOTSB */
+/* Nummber of entries in the IOTSB - pre-Fire only */
+#defineIOMMUCR_TSBSZ_MASK  0x0007UL
 #defineIOMMUCR_TSBSZ_SHIFT 16
-#defineIOMMUCR_TSB1K   0xUL
-#defineIOMMUCR_TSB2K   0x0001UL
-#defineIOMMUCR_TSB4K   0x0002UL
-#defineIOMMUCR_TSB8K   0x0003UL
-#defineIOMMUCR_TSB16K  0x0004UL
-#defineIOMMUCR_TSB32K  0x0005UL
-#defineIOMMUCR_TSB64K  0x0006UL
-#defineIOMMUCR_TSB128K 0x0007UL
-/* Mask for above */
-#defineIOMMUCR_TSBMASK 0xfff8UL
-/* 8K iommu page size */
+/* TSB cache snoop enable */
+#defineIOMMUCR_SE  0x0400UL
+/* Cache modes - Fire and Oberon */
+#defineIOMMUCR_CM_NC_TLB_TBW   0xUL
+#defineIOMMUCR_CM_LC_NTLB_NTBW 0x0100UL
+#defineIOMMUCR_CM_LC_TLB_TBW   0x0200UL
+#defineIOMMUCR_CM_C_TLB_TBW0x0300UL
+/* IOMMU page size - pre-Fire only */
 #defineIOMMUCR_8KPG0xUL
-/* 64K iommu page size */
 #defineIOMMUCR_64KPG   0x0004UL
-/* Diag enable */
+/* Bypass enable - Fire and Oberon */
+#defineIOMMUCR_BE  0x0002UL
+/* Diagnostic mode enable - pre-Fire only */
 #defineIOMMUCR_DE  0x0002UL
-/* Enable IOMMU */
+/* IOMMU/translation enable */
 #defineIOMMUCR_EN  0x0001UL
 
 /*
+ * TSB base register bits
+ */
+ /* TSB base address */
+#defineIOMMUTB_TB_MASK 0x07ffe000UL
+#defineIOMMUTB_TB_SHIFT13
+/* IOMMU page size - Fire and Oberon */
+#defineIOMMUTB_8KPG0xUL
+#defineIOMMUTB_64KPG   0x0100UL
+/* Nummber of entries in the IOTSB - Fire and Oberon */
+#defineIOMMUTB_TSBSZ_MASK  0x0004UL
+#defineIOMMUTB_TSBSZ_SHIFT 0
+
+/*
+ * TSB size definitions for both control and TSB base register */
+#defineIOMMU_TSB1K 0
+#defineIOMMU_TSB2K 1
+#defineIOMMU_TSB4K 2
+#defineIOMMU_TSB8K 3
+#defineIOMMU_TSB16K4
+#defineIOMMU_TSB32K5
+#defineIOMMU_TSB64K6
+#defineIOMMU_TSB128K   7
+/* Fire and Oberon */
+#defineIOMMU_TSB256K   8
+/* Fire and Oberon */
+#defineIOMMU_TSB512K   9
+#defineIOMMU_TSBENTRIES(tsbsz) 
\
+   ((1 << (tsbsz)) << (IO_PAGE_SHIFT - IOTTE_SHIFT))
+
+/*
  * Diagnostic register definitions
  */
 #defineIOMMU_DTAG_VPNBITS  19
@@ -113,16 +145,16 @@
  */
 /* Entry valid */
 #defineIOTTE_V 0x8000UL
-/* 8K or 64K pa

svn commit: r202257 - in stable/7/sys/sparc64: include sparc64

2010-01-13 Thread Marius Strobl
Author: marius
Date: Wed Jan 13 21:16:13 2010
New Revision: 202257
URL: http://svn.freebsd.org/changeset/base/202257

Log:
  MFC: r200923
  
  - Add support for the IOMMUs of Fire JBus to PCIe and Oberon Uranus
to PCIe bridges.
  - Add support for talking the PROM mappings over to the kernel IOTSB
just like we do with the kernel TSB in order to allow OFW drivers
to continue to work.
  - Change some members, parameters and variables to unsigned where
more appropriate.

Modified:
  stable/7/sys/sparc64/include/iommureg.h
  stable/7/sys/sparc64/include/iommuvar.h
  stable/7/sys/sparc64/sparc64/iommu.c
Directory Properties:
  stable/7/sys/   (props changed)
  stable/7/sys/cddl/contrib/opensolaris/   (props changed)
  stable/7/sys/contrib/dev/acpica/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)

Modified: stable/7/sys/sparc64/include/iommureg.h
==
--- stable/7/sys/sparc64/include/iommureg.h Wed Jan 13 21:16:07 2010
(r202256)
+++ stable/7/sys/sparc64/include/iommureg.h Wed Jan 13 21:16:13 2010
(r202257)
@@ -44,10 +44,13 @@
  * controllers.
  */
 
-/* iommmu registers */
+/* IOMMU registers */
 #defineIMR_CTL 0x  /* IOMMU control register */
 #defineIMR_TSB 0x0008  /* IOMMU TSB base register */
 #defineIMR_FLUSH   0x0010  /* IOMMU flush register */
+/* The TTE Cache is Fire and Oberon only. */
+#defineIMR_CACHE_FLUSH 0x0100  /* IOMMU TTE cache flush address 
register */
+#defineIMR_CACHE_INVAL 0x0108  /* IOMMU TTE cache invalidate register 
*/
 
 /* streaming buffer registers */
 #defineISR_CTL 0x  /* streaming buffer control reg */
@@ -70,28 +73,57 @@
 /*
  * control register bits
  */
-/* Nummber of entries in IOTSB */
+/* Nummber of entries in the IOTSB - pre-Fire only */
+#defineIOMMUCR_TSBSZ_MASK  0x0007UL
 #defineIOMMUCR_TSBSZ_SHIFT 16
-#defineIOMMUCR_TSB1K   0xUL
-#defineIOMMUCR_TSB2K   0x0001UL
-#defineIOMMUCR_TSB4K   0x0002UL
-#defineIOMMUCR_TSB8K   0x0003UL
-#defineIOMMUCR_TSB16K  0x0004UL
-#defineIOMMUCR_TSB32K  0x0005UL
-#defineIOMMUCR_TSB64K  0x0006UL
-#defineIOMMUCR_TSB128K 0x0007UL
-/* Mask for above */
-#defineIOMMUCR_TSBMASK 0xfff8UL
-/* 8K iommu page size */
+/* TSB cache snoop enable */
+#defineIOMMUCR_SE  0x0400UL
+/* Cache modes - Fire and Oberon */
+#defineIOMMUCR_CM_NC_TLB_TBW   0xUL
+#defineIOMMUCR_CM_LC_NTLB_NTBW 0x0100UL
+#defineIOMMUCR_CM_LC_TLB_TBW   0x0200UL
+#defineIOMMUCR_CM_C_TLB_TBW0x0300UL
+/* IOMMU page size - pre-Fire only */
 #defineIOMMUCR_8KPG0xUL
-/* 64K iommu page size */
 #defineIOMMUCR_64KPG   0x0004UL
-/* Diag enable */
+/* Bypass enable - Fire and Oberon */
+#defineIOMMUCR_BE  0x0002UL
+/* Diagnostic mode enable - pre-Fire only */
 #defineIOMMUCR_DE  0x0002UL
-/* Enable IOMMU */
+/* IOMMU/translation enable */
 #defineIOMMUCR_EN  0x0001UL
 
 /*
+ * TSB base register bits
+ */
+ /* TSB base address */
+#defineIOMMUTB_TB_MASK 0x07ffe000UL
+#defineIOMMUTB_TB_SHIFT13
+/* IOMMU page size - Fire and Oberon */
+#defineIOMMUTB_8KPG0xUL
+#defineIOMMUTB_64KPG   0x0100UL
+/* Nummber of entries in the IOTSB - Fire and Oberon */
+#defineIOMMUTB_TSBSZ_MASK  0x0004UL
+#defineIOMMUTB_TSBSZ_SHIFT 0
+
+/*
+ * TSB size definitions for both control and TSB base register */
+#defineIOMMU_TSB1K 0
+#defineIOMMU_TSB2K 1
+#defineIOMMU_TSB4K 2
+#defineIOMMU_TSB8K 3
+#defineIOMMU_TSB16K4
+#defineIOMMU_TSB32K5
+#defineIOMMU_TSB64K6
+#defineIOMMU_TSB128K   7
+/* Fire and Oberon */
+#defineIOMMU_TSB256K   8
+/* Fire and Oberon */
+#defineIOMMU_TSB512K   9
+#defineIOMMU_TSBENTRIES(tsbsz) 
\
+   ((1 << (tsbsz)) << (IO_PAGE_SHIFT - IOTTE_SHIFT))
+
+/*
  * Diagnostic register definitions
  */
 #defineIOMMU_DTAG_VPNBITS  19
@@ -113,16 +145,16 @@
  */
 /* Entry valid */
 #defineIOTTE_V 0x8000UL
-/* 8K or 64K page? */
+/* Page size - pre-Fire only */
 #defineIOTTE_64K   0x2000UL

svn commit: r202258 - stable/8/sys/sparc64/sparc64

2010-01-13 Thread Marius Strobl
Author: marius
Date: Wed Jan 13 21:17:45 2010
New Revision: 202258
URL: http://svn.freebsd.org/changeset/base/202258

Log:
  MFC: r200924
  
  Style changes.

Modified:
  stable/8/sys/sparc64/sparc64/ofw_machdep.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/sparc64/sparc64/ofw_machdep.c
==
--- stable/8/sys/sparc64/sparc64/ofw_machdep.c  Wed Jan 13 21:16:13 2010
(r202257)
+++ stable/8/sys/sparc64/sparc64/ofw_machdep.c  Wed Jan 13 21:17:45 2010
(r202258)
@@ -23,7 +23,7 @@
  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
  * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
- 
+
 #include 
 __FBSDID("$FreeBSD$");
 
@@ -64,34 +64,32 @@ OF_getetheraddr(device_t dev, u_char *ad
 
node = OF_peer(0);
if (node <= 0 || OF_getprop(node, "idprom", &idp, sizeof(idp)) == -1)
-   panic("Could not determine the machine ethernet address");
+   panic("Could not determine the machine Ethernet address");
bcopy(&idp.id_ether, addr, ETHER_ADDR_LEN);
 }
 
 static __inline uint32_t
 phys_hi_mask_space(const char *bus, uint32_t phys_hi)
 {
-   uint32_t space;
 
-   space = phys_hi;
if (strcmp(bus, "ebus") == 0 || strcmp(bus, "isa") == 0)
-   space &= 0x1;
+   phys_hi &= 0x1;
else if (strcmp(bus, "pci") == 0)
-   space &= OFW_PCI_PHYS_HI_SPACEMASK;
+   phys_hi &= OFW_PCI_PHYS_HI_SPACEMASK;
/* The phys.hi cells of the other busses only contain space bits. */
-   return (space);
+   return (phys_hi);
 }
 
 /*
  * Return the physical address and the bus space to use for a node
  * referenced by its package handle and the index of the register bank
- * to decode. Intended to be used to together with sparc64_fake_bustag()
+ * to decode.  Intended to be used to together with sparc64_fake_bustag()
  * by console drivers in early boot only.
  * Works by mapping the address of the node's bank given in the address
  * space of its parent upward in the device tree at each bridge along the
  * path.
  * Currently only really deals with max. 64-bit addresses, i.e. addresses
- * consisting of max. 2 phys cells (phys.hi and phys.lo). If we encounter
+ * consisting of max. 2 phys cells (phys.hi and phys.lo).  If we encounter
  * a 3 phys cells address (as with PCI addresses) we assume phys.hi can
  * be ignored except for the space bits (generally contained in phys.hi)
  * and treat phys.mid as phys.hi.
@@ -109,17 +107,17 @@ OF_decode_addr(phandle_t node, int bank,
 
/*
 * In general the addresses are contained in the "reg" property
-* of a node. The first address in the "reg" property of a PCI
+* of a node.  The first address in the "reg" property of a PCI
 * node however is the address of its configuration registers in
-* the configuration space of the host bridge. Additional entries
-* denote the memory and I/O addresses. For relocatable addresses
+* the configuration space of the host bridge.  Additional entries
+* denote the memory and I/O addresses.  For relocatable addresses
 * the "reg" property contains the BAR, for non-relocatable
-* addresses it contains the absolute PCI address. The PCI-only
+* addresses it contains the absolute PCI address.  The PCI-only
 * "assigned-addresses" property however always contains the
 * absolute PCI addresses.
 * The "assigned-addresses" and "reg" properties are arrays of
 * address structures consisting of #address-cells 32-bit phys
-* cells and #size-cells 32-bit size cells. If a parent lacks
+* cells and #size-cells 32-bit size cells.  If a parent lacks
 * the "#address-cells" or "#size-cells" property the default
 * for #address-cells to use is 2 and for #size-cells 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: r202259 - stable/7/sys/sparc64/sparc64

2010-01-13 Thread Marius Strobl
Author: marius
Date: Wed Jan 13 21:17:48 2010
New Revision: 202259
URL: http://svn.freebsd.org/changeset/base/202259

Log:
  MFC: r200924
  
  Style changes.

Modified:
  stable/7/sys/sparc64/sparc64/ofw_machdep.c
Directory Properties:
  stable/7/sys/   (props changed)
  stable/7/sys/cddl/contrib/opensolaris/   (props changed)
  stable/7/sys/contrib/dev/acpica/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)

Modified: stable/7/sys/sparc64/sparc64/ofw_machdep.c
==
--- stable/7/sys/sparc64/sparc64/ofw_machdep.c  Wed Jan 13 21:17:45 2010
(r202258)
+++ stable/7/sys/sparc64/sparc64/ofw_machdep.c  Wed Jan 13 21:17:48 2010
(r202259)
@@ -23,7 +23,7 @@
  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
  * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
- 
+
 #include 
 __FBSDID("$FreeBSD$");
 
@@ -65,34 +65,32 @@ OF_getetheraddr(device_t dev, u_char *ad
 
node = OF_peer(0);
if (node <= 0 || OF_getprop(node, "idprom", &idp, sizeof(idp)) == -1)
-   panic("Could not determine the machine ethernet address");
+   panic("Could not determine the machine Ethernet address");
bcopy(&idp.id_ether, addr, ETHER_ADDR_LEN);
 }
 
 static __inline uint32_t
 phys_hi_mask_space(const char *bus, uint32_t phys_hi)
 {
-   uint32_t space;
 
-   space = phys_hi;
if (strcmp(bus, "ebus") == 0 || strcmp(bus, "isa") == 0)
-   space &= 0x1;
+   phys_hi &= 0x1;
else if (strcmp(bus, "pci") == 0)
-   space &= OFW_PCI_PHYS_HI_SPACEMASK;
+   phys_hi &= OFW_PCI_PHYS_HI_SPACEMASK;
/* The phys.hi cells of the other busses only contain space bits. */
-   return (space);
+   return (phys_hi);
 }
 
 /*
  * Return the physical address and the bus space to use for a node
  * referenced by its package handle and the index of the register bank
- * to decode. Intended to be used to together with sparc64_fake_bustag()
+ * to decode.  Intended to be used to together with sparc64_fake_bustag()
  * by console drivers in early boot only.
  * Works by mapping the address of the node's bank given in the address
  * space of its parent upward in the device tree at each bridge along the
  * path.
  * Currently only really deals with max. 64-bit addresses, i.e. addresses
- * consisting of max. 2 phys cells (phys.hi and phys.lo). If we encounter
+ * consisting of max. 2 phys cells (phys.hi and phys.lo).  If we encounter
  * a 3 phys cells address (as with PCI addresses) we assume phys.hi can
  * be ignored except for the space bits (generally contained in phys.hi)
  * and treat phys.mid as phys.hi.
@@ -110,17 +108,17 @@ OF_decode_addr(phandle_t node, int bank,
 
/*
 * In general the addresses are contained in the "reg" property
-* of a node. The first address in the "reg" property of a PCI
+* of a node.  The first address in the "reg" property of a PCI
 * node however is the address of its configuration registers in
-* the configuration space of the host bridge. Additional entries
-* denote the memory and I/O addresses. For relocatable addresses
+* the configuration space of the host bridge.  Additional entries
+* denote the memory and I/O addresses.  For relocatable addresses
 * the "reg" property contains the BAR, for non-relocatable
-* addresses it contains the absolute PCI address. The PCI-only
+* addresses it contains the absolute PCI address.  The PCI-only
 * "assigned-addresses" property however always contains the
 * absolute PCI addresses.
 * The "assigned-addresses" and "reg" properties are arrays of
 * address structures consisting of #address-cells 32-bit phys
-* cells and #size-cells 32-bit size cells. If a parent lacks
+* cells and #size-cells 32-bit size cells.  If a parent lacks
 * the "#address-cells" or "#size-cells" property the default
 * for #address-cells to use is 2 and for #size-cells 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: r202260 - stable/8/sys/sparc64/sparc64

2010-01-13 Thread Marius Strobl
Author: marius
Date: Wed Jan 13 21:19:46 2010
New Revision: 202260
URL: http://svn.freebsd.org/changeset/base/202260

Log:
  MFC: r200925
  
  - By re-arranging the code in OF_decode_addr() somewhat and accepting
a bit of a detour we can just iterate through the banks array instead
of having to calculate every offset. This change is inspired by the
powerpc version of this function.
  - Add support for the JBus to EBus bridges which hang off of nexus(4).

Modified:
  stable/8/sys/sparc64/sparc64/ofw_machdep.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/sparc64/sparc64/ofw_machdep.c
==
--- stable/8/sys/sparc64/sparc64/ofw_machdep.c  Wed Jan 13 21:17:48 2010
(r202259)
+++ stable/8/sys/sparc64/sparc64/ofw_machdep.c  Wed Jan 13 21:19:46 2010
(r202260)
@@ -1,6 +1,6 @@
 /*-
  * Copyright (c) 2001 by Thomas Moestl .
- * Copyright (c) 2005 by Marius Strobl .
+ * Copyright (c) 2005 - 2009 by Marius Strobl .
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -98,11 +98,11 @@ int
 OF_decode_addr(phandle_t node, int bank, int *space, bus_addr_t *addr)
 {
char name[32];
-   uint64_t cend, cstart, end, phys, sz, start;
+   uint64_t cend, cstart, end, phys, pphys, sz, start;
pcell_t addrc, szc, paddrc;
phandle_t bus, lbus, pbus;
uint32_t banks[10 * 5]; /* 10 PCI banks */
-   uint32_t cspace, spc;
+   uint32_t cspc, pspc, spc;
int i, j, nbank;
 
/*
@@ -148,17 +148,18 @@ OF_decode_addr(phandle_t node, int bank,
nbank /= sizeof(banks[0]) * (addrc + szc);
if (bank < 0 || bank > nbank - 1)
return (ENXIO);
+   bank *= addrc + szc;
+   spc = phys_hi_mask_space(name, banks[bank]);
+   /* Skip the high cell for 3-cell addresses. */
+   bank += addrc - 2;
phys = 0;
for (i = 0; i < MIN(2, addrc); i++)
-   phys |= (uint64_t)banks[(addrc + szc) * bank + addrc - 2 + i] <<
-   32 * (MIN(2, addrc) - i - 1);
+   phys = ((uint64_t)phys << 32) | banks[bank++];
sz = 0;
for (i = 0; i < szc; i++)
-   sz |= (uint64_t)banks[(addrc + szc) * bank + addrc + i] <<
-   32 * (szc - i - 1);
+   sz = ((uint64_t)sz << 32) | banks[bank++];
start = phys;
end = phys + sz - 1;
-   spc = phys_hi_mask_space(name, banks[(addrc + szc) * bank]);
 
/*
 * Map upward in the device tree at every bridge we encounter
@@ -170,7 +171,7 @@ OF_decode_addr(phandle_t node, int bank,
 * If a bridge doesn't have a "ranges" property no mapping is
 * necessary at that bridge.
 */
-   cspace = 0;
+   cspc = 0;
lbus = bus;
while ((pbus = OF_parent(bus)) != 0) {
if (OF_getprop(pbus, "#address-cells", &paddrc,
@@ -193,42 +194,40 @@ OF_decode_addr(phandle_t node, int bank,
return (ENXIO);
}
nbank /= sizeof(banks[0]) * (addrc + paddrc + szc);
+   bank = 0;
for (i = 0; i < nbank; i++) {
-   cspace = phys_hi_mask_space(name,
-   banks[(addrc + paddrc + szc) * i]);
-   if (cspace != spc)
+   cspc = phys_hi_mask_space(name, banks[bank]);
+   if (cspc != spc) {
+   bank += addrc + paddrc + szc;
continue;
+   }
+   /* Skip the high cell for 3-cell addresses. */
+   bank += addrc - 2;
phys = 0;
for (j = 0; j < MIN(2, addrc); j++)
-   phys |= (uint64_t)banks[
-   (addrc + paddrc + szc) * i +
-   addrc - 2 + j] <<
-   32 * (MIN(2, addrc) - j - 1);
+   phys = ((uint64_t)phys << 32) | banks[bank++];
+   pspc = banks[bank];
+   /* Skip the high cell for 3-cell addresses. */
+   bank += paddrc - 2;
+   pphys = 0;
+   for (j = 0; j < MIN(2, paddrc); j++)
+   pphys =
+   ((uint64_t)pphys << 32) | banks[bank++];
sz = 0;
for (j = 0; j < szc; j++)
-   sz |= (uint64_t)banks[
-   

svn commit: r202261 - stable/7/sys/sparc64/sparc64

2010-01-13 Thread Marius Strobl
Author: marius
Date: Wed Jan 13 21:19:46 2010
New Revision: 202261
URL: http://svn.freebsd.org/changeset/base/202261

Log:
  MFC: r200925
  
  - By re-arranging the code in OF_decode_addr() somewhat and accepting
a bit of a detour we can just iterate through the banks array instead
of having to calculate every offset. This change is inspired by the
powerpc version of this function.
  - Add support for the JBus to EBus bridges which hang off of nexus(4).

Modified:
  stable/7/sys/sparc64/sparc64/ofw_machdep.c
Directory Properties:
  stable/7/sys/   (props changed)
  stable/7/sys/cddl/contrib/opensolaris/   (props changed)
  stable/7/sys/contrib/dev/acpica/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)

Modified: stable/7/sys/sparc64/sparc64/ofw_machdep.c
==
--- stable/7/sys/sparc64/sparc64/ofw_machdep.c  Wed Jan 13 21:19:46 2010
(r202260)
+++ stable/7/sys/sparc64/sparc64/ofw_machdep.c  Wed Jan 13 21:19:46 2010
(r202261)
@@ -1,6 +1,6 @@
 /*-
  * Copyright (c) 2001 by Thomas Moestl .
- * Copyright (c) 2005 by Marius Strobl .
+ * Copyright (c) 2005 - 2009 by Marius Strobl .
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -99,11 +99,11 @@ int
 OF_decode_addr(phandle_t node, int bank, int *space, bus_addr_t *addr)
 {
char name[32];
-   uint64_t cend, cstart, end, phys, sz, start;
+   uint64_t cend, cstart, end, phys, pphys, sz, start;
pcell_t addrc, szc, paddrc;
phandle_t bus, lbus, pbus;
uint32_t banks[10 * 5]; /* 10 PCI banks */
-   uint32_t cspace, spc;
+   uint32_t cspc, pspc, spc;
int i, j, nbank;
 
/*
@@ -149,17 +149,18 @@ OF_decode_addr(phandle_t node, int bank,
nbank /= sizeof(banks[0]) * (addrc + szc);
if (bank < 0 || bank > nbank - 1)
return (ENXIO);
+   bank *= addrc + szc;
+   spc = phys_hi_mask_space(name, banks[bank]);
+   /* Skip the high cell for 3-cell addresses. */
+   bank += addrc - 2;
phys = 0;
for (i = 0; i < MIN(2, addrc); i++)
-   phys |= (uint64_t)banks[(addrc + szc) * bank + addrc - 2 + i] <<
-   32 * (MIN(2, addrc) - i - 1);
+   phys = ((uint64_t)phys << 32) | banks[bank++];
sz = 0;
for (i = 0; i < szc; i++)
-   sz |= (uint64_t)banks[(addrc + szc) * bank + addrc + i] <<
-   32 * (szc - i - 1);
+   sz = ((uint64_t)sz << 32) | banks[bank++];
start = phys;
end = phys + sz - 1;
-   spc = phys_hi_mask_space(name, banks[(addrc + szc) * bank]);
 
/*
 * Map upward in the device tree at every bridge we encounter
@@ -171,7 +172,7 @@ OF_decode_addr(phandle_t node, int bank,
 * If a bridge doesn't have a "ranges" property no mapping is
 * necessary at that bridge.
 */
-   cspace = 0;
+   cspc = 0;
lbus = bus;
while ((pbus = OF_parent(bus)) != 0) {
if (OF_getprop(pbus, "#address-cells", &paddrc,
@@ -194,42 +195,40 @@ OF_decode_addr(phandle_t node, int bank,
return (ENXIO);
}
nbank /= sizeof(banks[0]) * (addrc + paddrc + szc);
+   bank = 0;
for (i = 0; i < nbank; i++) {
-   cspace = phys_hi_mask_space(name,
-   banks[(addrc + paddrc + szc) * i]);
-   if (cspace != spc)
+   cspc = phys_hi_mask_space(name, banks[bank]);
+   if (cspc != spc) {
+   bank += addrc + paddrc + szc;
continue;
+   }
+   /* Skip the high cell for 3-cell addresses. */
+   bank += addrc - 2;
phys = 0;
for (j = 0; j < MIN(2, addrc); j++)
-   phys |= (uint64_t)banks[
-   (addrc + paddrc + szc) * i +
-   addrc - 2 + j] <<
-   32 * (MIN(2, addrc) - j - 1);
+   phys = ((uint64_t)phys << 32) | banks[bank++];
+   pspc = banks[bank];
+   /* Skip the high cell for 3-cell addresses. */
+   bank += paddrc - 2;
+   pphys = 0;
+   for (j = 0; j < MIN(2, paddrc); j++)
+   pphys =
+   ((uint64_t)pphys << 32) | banks[bank++];
sz = 0;
for (j = 0; j < szc; j++)
-   sz |= (uint64_t)banks[
-   (addrc + paddrc + szc) * i + addrc +
-   paddrc + j] <<
-

svn commit: r202262 - stable/8/sys/dev/uart

2010-01-13 Thread Marius Strobl
Author: marius
Date: Wed Jan 13 21:21:29 2010
New Revision: 202262
URL: http://svn.freebsd.org/changeset/base/202262

Log:
  MFC: r200926
  
  Recognize the NS16552 found in PCIe-based sun4u machines.

Modified:
  stable/8/sys/dev/uart/uart_bus_ebus.c
  stable/8/sys/dev/uart/uart_cpu_sparc64.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/dev/uart/uart_bus_ebus.c
==
--- stable/8/sys/dev/uart/uart_bus_ebus.c   Wed Jan 13 21:19:46 2010
(r202261)
+++ stable/8/sys/dev/uart/uart_bus_ebus.c   Wed Jan 13 21:21:29 2010
(r202262)
@@ -77,7 +77,7 @@ uart_ebus_probe(device_t dev)
if (!strcmp(nm, "lom-console") || !strcmp(nm, "su") ||
!strcmp(nm, "su_pnp") || !strcmp(cmpt, "rsc-console") ||
!strcmp(cmpt, "rsc-control") || !strcmp(cmpt, "su") ||
-   !strcmp(cmpt, "su16550")) {
+   !strcmp(cmpt, "su16550") || !strcmp(cmpt, "su16552")) {
/*
 * On AXi and AXmp boards the NS16550 (used to connect
 * keyboard/mouse) share their IRQ lines with the i8042.

Modified: stable/8/sys/dev/uart/uart_cpu_sparc64.c
==
--- stable/8/sys/dev/uart/uart_cpu_sparc64.cWed Jan 13 21:19:46 2010
(r202261)
+++ stable/8/sys/dev/uart/uart_cpu_sparc64.cWed Jan 13 21:21:29 2010
(r202262)
@@ -254,7 +254,8 @@ uart_cpu_getdev(int devtype, struct uart
addr += range - range * (di->bas.chan - 1);
} else if (!strcmp(buf, "lom-console") || !strcmp(buf, "su") ||
!strcmp(buf, "su_pnp") || !strcmp(compat, "rsc-console") ||
-   !strcmp(compat, "su") || !strcmp(compat, "su16550")) {
+   !strcmp(compat, "su") || !strcmp(compat, "su16550") ||
+   !strcmp(compat, "su16552")) {
class = &uart_ns8250_class;
di->bas.chan = 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: r202263 - stable/7/sys/dev/uart

2010-01-13 Thread Marius Strobl
Author: marius
Date: Wed Jan 13 21:21:32 2010
New Revision: 202263
URL: http://svn.freebsd.org/changeset/base/202263

Log:
  MFC: r200926
  
  Recognize the NS16552 found in PCIe-based sun4u machines.

Modified:
  stable/7/sys/dev/uart/uart_bus_ebus.c
  stable/7/sys/dev/uart/uart_cpu_sparc64.c
Directory Properties:
  stable/7/sys/   (props changed)
  stable/7/sys/cddl/contrib/opensolaris/   (props changed)
  stable/7/sys/contrib/dev/acpica/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)

Modified: stable/7/sys/dev/uart/uart_bus_ebus.c
==
--- stable/7/sys/dev/uart/uart_bus_ebus.c   Wed Jan 13 21:21:29 2010
(r202262)
+++ stable/7/sys/dev/uart/uart_bus_ebus.c   Wed Jan 13 21:21:32 2010
(r202263)
@@ -77,7 +77,7 @@ uart_ebus_probe(device_t dev)
if (!strcmp(nm, "lom-console") || !strcmp(nm, "su") ||
!strcmp(nm, "su_pnp") || !strcmp(cmpt, "rsc-console") ||
!strcmp(cmpt, "rsc-control") || !strcmp(cmpt, "su") ||
-   !strcmp(cmpt, "su16550")) {
+   !strcmp(cmpt, "su16550") || !strcmp(cmpt, "su16552")) {
/*
 * On AXi and AXmp boards the NS16550 (used to connect
 * keyboard/mouse) share their IRQ lines with the i8042.

Modified: stable/7/sys/dev/uart/uart_cpu_sparc64.c
==
--- stable/7/sys/dev/uart/uart_cpu_sparc64.cWed Jan 13 21:21:29 2010
(r202262)
+++ stable/7/sys/dev/uart/uart_cpu_sparc64.cWed Jan 13 21:21:32 2010
(r202263)
@@ -254,7 +254,8 @@ uart_cpu_getdev(int devtype, struct uart
addr += range - range * (di->bas.chan - 1);
} else if (!strcmp(buf, "lom-console") || !strcmp(buf, "su") ||
!strcmp(buf, "su_pnp") || !strcmp(compat, "rsc-console") ||
-   !strcmp(compat, "su") || !strcmp(compat, "su16550")) {
+   !strcmp(compat, "su") || !strcmp(compat, "su16550") ||
+   !strcmp(compat, "su16552")) {
class = &uart_ns8250_class;
di->bas.chan = 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: r202264 - in head: share/man/man4 sys/kern

2010-01-13 Thread Ed Schouten
Author: ed
Date: Wed Jan 13 21:22:23 2010
New Revision: 202264
URL: http://svn.freebsd.org/changeset/base/202264

Log:
  Remove the 1000 pseudo terminal limit from pts(4).
  
  Even with the old utmp format, we could in fact go to pts/, because
  ut_line wasn't guaranteed to be null terminated there.

Modified:
  head/share/man/man4/pts.4
  head/sys/kern/tty_pts.c

Modified: head/share/man/man4/pts.4
==
--- head/share/man/man4/pts.4   Wed Jan 13 21:21:32 2010(r202263)
+++ head/share/man/man4/pts.4   Wed Jan 13 21:22:23 2010(r202264)
@@ -136,12 +136,6 @@ This 
 should not be used directly. It is used to implement routines like
 .Xr grantpt 3 .
 .El
-.Pp
-The maximum number of pseudo-terminals is limited to 1000.
-It is not possible to use more than 1000 pseudo-terminals, as all software
-which use
-.Xr utmp 5
-will not be able to handle pseudo-terminals with number superior to 999.
 .Sh FILES
 The files used by this
 pseudo-terminals implementation are:
@@ -150,26 +144,6 @@ pseudo-terminals implementation are:
 .It Pa /dev/pts/[num]
 Pseudo-terminal slave devices.
 .El
-.Sh SYSCTL VARIABLES
-The following
-.Xr sysctl 8
-variables can be used to modify or monitor
-.Nm
-behavior.
-.Bl -tag -width indent
-.It Va kern.pts_maxdev
-Highest pseudo-terminal unit number to be allocated.
-Because
-.Xr utmp 5
-is restricted to an 8-byte line name size,
-.Nm
-will not create any pseudo-terminals with a unit number above 999 by
-default.
-After increasing
-.Dv UT_LINESIZE ,
-this variable can be changed to allow more than 1000 pseudo-terminals to
-be allocated simultaneously.
-.El
 .Sh DIAGNOSTICS
 None.
 .Sh SEE ALSO

Modified: head/sys/kern/tty_pts.c
==
--- head/sys/kern/tty_pts.c Wed Jan 13 21:21:32 2010(r202263)
+++ head/sys/kern/tty_pts.c Wed Jan 13 21:22:23 2010(r202264)
@@ -71,9 +71,6 @@ __FBSDID("$FreeBSD$");
  * UT_LINESIZE.
  */
 static struct unrhdr *pts_pool;
-static unsigned int pts_maxdev = 999;
-SYSCTL_UINT(_kern, OID_AUTO, pts_maxdev, CTLFLAG_RW, &pts_maxdev, 0,
-"Maximum amount of pts(4) pseudo-terminals");
 
 static MALLOC_DEFINE(M_PTS, "pts", "pseudo tty device");
 
@@ -725,11 +722,6 @@ pts_alloc(int fflags, struct thread *td,
chgptscnt(uid, -1, 0);
return (EAGAIN);
}
-   if (unit > pts_maxdev) {
-   free_unr(pts_pool, unit);
-   chgptscnt(uid, -1, 0);
-   return (EAGAIN);
-   }
 
/* Allocate TTY and softc. */
psc = malloc(sizeof(struct pts_softc), M_PTS, M_WAITOK|M_ZERO);
___
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: r202265 - stable/8/sys/sparc64/sparc64

2010-01-13 Thread Marius Strobl
Author: marius
Date: Wed Jan 13 21:23:27 2010
New Revision: 202265
URL: http://svn.freebsd.org/changeset/base/202265

Log:
  MFC: r200938
  
  - Don't check for a valid interrupt controller on every interrupt
in intr_execute_handlers(). If we managed to get here without an
associated interrupt controller we have way bigger problems.
While at it predict stray vector interrupts as false as they are
rather unlikely.
  - Don't blindly call the clear function of an interrupt controller
when adding a handler in inthand_add() as interrupt controllers
like the one driven by upa(4) are auto-clearing and thus provide
NULL instead.

Modified:
  stable/8/sys/sparc64/sparc64/intr_machdep.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/sparc64/sparc64/intr_machdep.c
==
--- stable/8/sys/sparc64/sparc64/intr_machdep.c Wed Jan 13 21:22:23 2010
(r202264)
+++ stable/8/sys/sparc64/sparc64/intr_machdep.c Wed Jan 13 21:23:27 2010
(r202265)
@@ -276,7 +276,7 @@ intr_execute_handlers(void *cookie)
struct intr_vector *iv;
 
iv = cookie;
-   if (iv->iv_ic == NULL || intr_event_handle(iv->iv_event, NULL) != 0)
+   if (__predict_false(intr_event_handle(iv->iv_event, NULL) != 0))
intr_stray_vector(iv);
 }
 
@@ -377,7 +377,8 @@ inthand_add(const char *name, int vec, d
 #endif
ic->ic_enable(iv);
/* Ensure the interrupt is cleared, it might have triggered before. */
-   ic->ic_clear(iv);
+   if (ic->ic_clear != NULL)
+   ic->ic_clear(iv);
sx_xunlock(&intr_table_lock);
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: r202266 - stable/7/sys/sparc64/sparc64

2010-01-13 Thread Marius Strobl
Author: marius
Date: Wed Jan 13 21:23:29 2010
New Revision: 202266
URL: http://svn.freebsd.org/changeset/base/202266

Log:
  MFC: r200938
  
  - Don't check for a valid interrupt controller on every interrupt
in intr_execute_handlers(). If we managed to get here without an
associated interrupt controller we have way bigger problems.
While at it predict stray vector interrupts as false as they are
rather unlikely.
  - Don't blindly call the clear function of an interrupt controller
when adding a handler in inthand_add() as interrupt controllers
like the one driven by upa(4) are auto-clearing and thus provide
NULL instead.

Modified:
  stable/7/sys/sparc64/sparc64/intr_machdep.c
Directory Properties:
  stable/7/sys/   (props changed)
  stable/7/sys/cddl/contrib/opensolaris/   (props changed)
  stable/7/sys/contrib/dev/acpica/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)

Modified: stable/7/sys/sparc64/sparc64/intr_machdep.c
==
--- stable/7/sys/sparc64/sparc64/intr_machdep.c Wed Jan 13 21:23:27 2010
(r202265)
+++ stable/7/sys/sparc64/sparc64/intr_machdep.c Wed Jan 13 21:23:29 2010
(r202266)
@@ -277,7 +277,7 @@ intr_execute_handlers(void *cookie)
struct intr_vector *iv;
 
iv = cookie;
-   if (iv->iv_ic == NULL || intr_event_handle(iv->iv_event, NULL) != 0)
+   if (__predict_false(intr_event_handle(iv->iv_event, NULL) != 0))
intr_stray_vector(iv);
 }
 
@@ -378,7 +378,8 @@ inthand_add(const char *name, int vec, d
 #endif
ic->ic_enable(iv);
/* Ensure the interrupt is cleared, it might have triggered before. */
-   ic->ic_clear(iv);
+   if (ic->ic_clear != NULL)
+   ic->ic_clear(iv);
sx_xunlock(&intr_table_lock);
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"


Re: svn commit: r202243 - in head: share/man/man4 sys/dev/usb sys/dev/usb/net

2010-01-13 Thread Ben Kaduk
Lots of grammar nits.  See below.

On Wed, Jan 13, 2010 at 3:54 PM, Andrew Thompson  wrote:
> Author: thompsa
> Date: Wed Jan 13 20:54:18 2010
> New Revision: 202243
> URL: http://svn.freebsd.org/changeset/base/202243
>
> Log:
>  Update to Fredrik's latest uhso driver. This changes port detection, adds
>  comments and other code nits.
>
>  Submitted by: Fredrik Lindberg 
>
> Modified:
>  head/share/man/man4/uhso.4
>  head/sys/dev/usb/net/uhso.c
>  head/sys/dev/usb/usbdevs
>
> Modified: head/share/man/man4/uhso.4
> ==
> --- head/share/man/man4/uhso.4  Wed Jan 13 20:51:23 2010(r202242)
> +++ head/share/man/man4/uhso.4  Wed Jan 13 20:54:18 2010(r202243)
> @@ -23,11 +23,11 @@
>  .\"
>  .\" $FreeBSD$
>  .\"
> -.Dd Aug 12, 2009
> +.Dd January 14, 2010
>  .Os
>  .Dt UHSO 4
>  .Sh NAME
> -.Nm hso
> +.Nm uhso
>  .Nd support for several HSxPA devices from Option N.V.
>  .Sh SYNOPSIS
>  The module can be loaded at boot time by placing the following line in
> @@ -47,12 +47,12 @@ driver which makes them behave like a
>  .Xr tty 4 .
>  The packet interface is exposed as a network interface.
>  .Pp
> -To establish a connection on the packet interface the use of the proprietary
> +Connection of the packet interface is achieved by using the proprietary

This sentence sounds subtly wrong to me.  I think that just saying
"connection to"
instead of "of" will make it grammatically correct, but I worry that
it may no longer
be factually correct, then.  Perhaps "A connection on [...]", instead?

>  AT commands
>  .Dq Li AT_OWANCALL
>  and
>  .Dq Li AT_OWANDATA
> -are required on any of the serial ports.
> +on any of the available serial ports.
>  .Pp
>  The network interface must be configured manually using the data obtain from
>  these calls.
> @@ -70,12 +70,23 @@ driver supports at least the following c
>  Option GlobeSurfer iCON 7.2 (new firmware)
>  .It
>  Option iCON 225
> +.It
> +Option iCON 505
>  .El
>  .Pp
>  The device features a mass storage device referred to as
>  .Dq Zero-CD
> -which contains drivers for Microsoft Windows.
> -The driver automatically switches the device to modem mode.
> +which contains drivers for Microsoft Windows, this is the default

Comma splice.  I would put a semicolon, but a full stop is acceptable, too.

> +mode for the device.
> +The
> +.Nm
> +driver automatically switches the device from
> +.Dq Zero-CD
> +mode to modem mode.
> +This behavior can be disabled by setting
> +.Va hw.usb.uhso.auto_switch
> +to 0 using
> +.Xr sysctl 8
>  .Sh EXAMPLES
>  Establishing a packet interface connection
>  .Bd -literal -offset indent
>
> Modified: head/sys/dev/usb/net/uhso.c
> ==
> --- head/sys/dev/usb/net/uhso.c Wed Jan 13 20:51:23 2010(r202242)
> +++ head/sys/dev/usb/net/uhso.c Wed Jan 13 20:54:18 2010(r202243)
> @@ -145,12 +146,14 @@ struct uhso_softc {
>  #define UHSO_MPORT_TYPE_APP0x01/* Application */
>  #define UHSO_MPORT_TYPE_PCSC   0x02
>  #define UHSO_MPORT_TYPE_GPS0x03
> -#define UHSO_MPORT_TYPE_APP2   0x04
> +#define UHSO_MPORT_TYPE_APP2   0x04/* Secondary application */
>  #define UHSO_MPORT_TYPE_MAXUHSO_MPORT_TYPE_APP2
>  #define UHSO_MPORT_TYPE_NOMAX  8   /* Max number of mux ports */
>
>  /*
>  * Port definitions
> + * Note that these definitions are arbitray and doesn't match
> + * values returned by the auto config descriptor.

"arbitrary"; "don't"; "the values"

>  */
>  #define UHSO_PORT_TYPE_CTL 0x01
>  #define UHSO_PORT_TYPE_APP 0x02
> @@ -560,6 +567,18 @@ uhso_attach(device_t self)
>CTLFLAG_RD, uhso_port[UHSO_IFACE_PORT(sc->sc_type)], 0,
>"Port available at this interface");
>
> +   /*
> +* The default interface description on most Option devices aren't

"isn't"

> +* very helpful. So we skip device_set_usb_desc and set the
> +* device description manually.
> +*/
> +   device_set_desc_copy(self, 
> uhso_port_type[UHSO_IFACE_PORT_TYPE(sc->sc_type)]);
> +   /* Announce device */
> +   device_printf(self, "<%s port> at <%s %s> on %s\n",
> +   uhso_port_type[UHSO_IFACE_PORT_TYPE(sc->sc_type)],
> +   uaa->device->manufacturer, uaa->device->product,
> +   device_get_nameunit(uaa->device->bus->bdev));
> +
>if (sc->sc_ttys > 0) {
>SYSCTL_ADD_INT(sctx, SYSCTL_CHILDREN(soid), OID_AUTO, "ports",
>CTLFLAG_RD, &sc->sc_ttys, 0, "Number of attached serial 
> ports");
> @@ -798,27 +832,41 @@ uhso_probe_iface(struct uhso_softc *sc,
>sc->sc_type = type;
>iface = usbd_get_iface(sc->sc_udev, index);
>
> -   if (UHSO_IFACE_USB_TYPE(type) & (UHSO_IF_MUX | UHSO_IF_NET)) {
> -   error0 = uhso_attach_muxserial(sc, iface, type);
> +   if (UHSO_IFACE_PORT_TYPE(type) == UHSO_PORT_TYPE_NETWORK) {
>error = uh

Re: INCLUDE_CONFIG_FILE in GENERIC

2010-01-13 Thread John Baldwin
On Wednesday 13 January 2010 3:36:26 pm Doug Barton wrote:
> On 1/13/2010 12:15 PM, John Baldwin wrote:
> > On Wednesday 13 January 2010 1:48:38 pm Doug Barton wrote:
> >> To address the other responses, Tom, sorry, your suggested text doesn't
> >> address my concern. John, I don't think that users would somehow
> >> magically know to look in NOTES for more information about an option
> >> that is already in GENERIC.
> > 
> > You really think users do not already know to look in manpages or NOTES to 
> > find out more details about kernel options? 
> 
> That's not what I said.


I don't think that users would [..] know to look in NOTES for more information 
about an option that is [...] in GENERIC.


That seems really straight forward to me, or my English isn't good.  I do 
think users "would know to look in NOTES for more information about an option 
that is in GENERIC".

> > Put 
> > another way, what makes 'INCLUDE_CONFIG_FILE' sufficiently special that it 
> > deserves special treatment relative to other kernel options?
> 
> Because the default behavior (not including the actual file) for the
> option is contrary to user' reasonable expectation of how the option
> should work  and now I'm repeating myself.

I think a better change would be to just change the default behavior of 
config(8) to do the reasonable thing.

> Seriously, don't you have anything better to do than argue against
> including a comment in a config file? I know I do. What is the
> overwhelming horror that will arise here if there are more comments
> GENERIC than you deem to be absolutely necessary?

What is the overwhelming horror about keeping a file readable and allowing 
users to find extended documentation for INCLUDE_CONFIG_FILE in the same place 
that they find extended documentation about every other kernel option?

> And yes, I read the part of your message that I snipped about "why do we
> have these documents if users don't read them?" The answer is, that's
> why I'm suggesting a comment that tells users what man page to read.

I think adding comments that merely redirect the users to further 
documentation only serves to obfuscate.  Left unchecked this approach will 
render files such as GENERIC with a very low signal-to-noise ratio making it 
harder to parse in a "big picture" way.

-- 
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"


Re: INCLUDE_CONFIG_FILE in GENERIC

2010-01-13 Thread Julian Elischer

John Baldwin wrote:

On Wednesday 13 January 2010 1:48:38 pm Doug Barton wrote:

To address the other responses, Tom, sorry, your suggested text doesn't
address my concern. John, I don't think that users would somehow
magically know to look in NOTES for more information about an option
that is already in GENERIC.


You really think users do not already know to look in manpages or NOTES to 
find out more details about kernel options? 


how about a one line comment in GENERIC suggesting that people look at 
NOTES for more info.



___
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: INCLUDE_CONFIG_FILE in GENERIC

2010-01-13 Thread John Baldwin
On Wednesday 13 January 2010 3:28:31 pm Julian Elischer wrote:
> John Baldwin wrote:
> > On Wednesday 13 January 2010 1:48:38 pm Doug Barton wrote:
> >> To address the other responses, Tom, sorry, your suggested text doesn't
> >> address my concern. John, I don't think that users would somehow
> >> magically know to look in NOTES for more information about an option
> >> that is already in GENERIC.
> > 
> > You really think users do not already know to look in manpages or NOTES to 
> > find out more details about kernel options? 
> 
> how about a one line comment in GENERIC suggesting that people look at 
> NOTES for more info.

There is already a large block comment at the top of GENERIC that gives people
several other places to look for more detailed info on kernel options as a
general rule:

#
# GENERIC -- Generic kernel configuration file for FreeBSD/amd64
#
# For more information on this file, please read the config(5) manual page,
# and/or the handbook section on Kernel Configuration Files:
#
#
http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html
#
# The handbook is also available locally in /usr/share/doc/handbook
# if you've installed the doc distribution, otherwise always see the
# FreeBSD World Wide Web server (http://www.FreeBSD.org/) for the
# latest information.
#
# An exhaustive list of options and more detailed explanations of the
# device lines is also present in the ../../conf/NOTES and NOTES files.
# If you are in doubt as to the purpose or necessity of a line, check first
# in NOTES.
#
# $FreeBSD: head/sys/amd64/conf/GENERIC 202019 2010-01-10 17:44:22Z imp $

I think the existing paragraph about NOTES in particular is sufficient
without requiring additional detailed documentation for each option.

-- 
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"


Re: INCLUDE_CONFIG_FILE in GENERIC

2010-01-13 Thread M. Warner Losh
In message: <201001131633.09669@freebsd.org>
John Baldwin  writes:
: On Wednesday 13 January 2010 3:36:26 pm Doug Barton wrote:
: > On 1/13/2010 12:15 PM, John Baldwin wrote:
: > > On Wednesday 13 January 2010 1:48:38 pm Doug Barton wrote:
: > >> To address the other responses, Tom, sorry, your suggested text doesn't
: > >> address my concern. John, I don't think that users would somehow
: > >> magically know to look in NOTES for more information about an option
: > >> that is already in GENERIC.
: > > 
: > > You really think users do not already know to look in manpages or NOTES 
to 
: > > find out more details about kernel options? 
: > 
: > That's not what I said.
: 
: 
: I don't think that users would [..] know to look in NOTES for more 
information 
: about an option that is [...] in GENERIC.
: 
: 
: That seems really straight forward to me, or my English isn't good.  I do 
: think users "would know to look in NOTES for more information about an option 
: that is in GENERIC".

Agreed.  That's why I did what I did: I conformed to the usual practice.

: > > Put 
: > > another way, what makes 'INCLUDE_CONFIG_FILE' sufficiently special that 
it 
: > > deserves special treatment relative to other kernel options?
: > 
: > Because the default behavior (not including the actual file) for the
: > option is contrary to user' reasonable expectation of how the option
: > should work  and now I'm repeating myself.
: 
: I think a better change would be to just change the default behavior of 
: config(8) to do the reasonable thing.

-C should be the default, and we should invent a new
 '--smaller-saved-config' option.

: > Seriously, don't you have anything better to do than argue against
: > including a comment in a config file? I know I do. What is the
: > overwhelming horror that will arise here if there are more comments
: > GENERIC than you deem to be absolutely necessary?
: 
: What is the overwhelming horror about keeping a file readable and allowing 
: users to find extended documentation for INCLUDE_CONFIG_FILE in the same 
place 
: that they find extended documentation about every other kernel option?

Yes.  That's why I did what I did: to keep things readable.

: > And yes, I read the part of your message that I snipped about "why do we
: > have these documents if users don't read them?" The answer is, that's
: > why I'm suggesting a comment that tells users what man page to read.
: 
: I think adding comments that merely redirect the users to further 
: documentation only serves to obfuscate.  Left unchecked this approach will 
: render files such as GENERIC with a very low signal-to-noise ratio making it 
: harder to parse in a "big picture" way.

Yes.

Basically, I'm annoyed too: Our users aren't idiots, and we shouldn't
be treating them as such at every turn.  If there are surprises with
how INCLUDE_CONFIG_FILE behaves, we should work to make it better, not
paper over it with a comment.

Warner
___
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: r202267 - head/sys/dev/sound/pcm

2010-01-13 Thread Alexander Motin
Author: mav
Date: Wed Jan 13 22:22:16 2010
New Revision: 202267
URL: http://svn.freebsd.org/changeset/base/202267

Log:
  Hide from default sndstat some information not used on daily basis,
  to make it readable by average user with average screen size.

Modified:
  head/sys/dev/sound/pcm/sndstat.c
  head/sys/dev/sound/pcm/sndstat.h

Modified: head/sys/dev/sound/pcm/sndstat.c
==
--- head/sys/dev/sound/pcm/sndstat.cWed Jan 13 21:23:29 2010
(r202266)
+++ head/sys/dev/sound/pcm/sndstat.cWed Jan 13 22:22:16 2010
(r202267)
@@ -81,7 +81,7 @@ static int sndstat_files = 0;
 
 static SLIST_HEAD(, sndstat_entry) sndstat_devlist = 
SLIST_HEAD_INITIALIZER(sndstat_devlist);
 
-int snd_verbose = 1;
+int snd_verbose = 0;
 TUNABLE_INT("hw.snd.verbose", &snd_verbose);
 
 #ifdef SND_DEBUG
@@ -372,12 +372,10 @@ sndstat_prepare(struct sbuf *s)
PCM_ACQUIRE_QUICK(d);
sbuf_printf(s, "%s:", device_get_nameunit(ent->dev));
sbuf_printf(s, " <%s>", device_get_desc(ent->dev));
-   sbuf_printf(s, " %s [%s]", ent->str,
-   (d->flags & SD_F_MPSAFE) ? "MPSAFE" : "GIANT");
+   if (snd_verbose > 0)
+   sbuf_printf(s, " %s", ent->str);
if (ent->handler)
ent->handler(s, ent->dev, snd_verbose);
-   else
-   sbuf_printf(s, " [no handler]");
sbuf_printf(s, "\n");
PCM_RELEASE_QUICK(d);
}

Modified: head/sys/dev/sound/pcm/sndstat.h
==
--- head/sys/dev/sound/pcm/sndstat.hWed Jan 13 21:23:29 2010
(r202266)
+++ head/sys/dev/sound/pcm/sndstat.hWed Jan 13 22:22:16 2010
(r202267)
@@ -37,9 +37,6 @@
struct pcm_channel *c;  \
struct pcm_feeder *f;   \
\
-   if (verbose < 1)\
-   return (0); \
-   \
d = device_get_softc(dev);  \
PCM_BUSYASSERT(d);  \
\
@@ -48,9 +45,19 @@
return (0); \
}   \
\
-   sbuf_printf(s, " (%dp:%dv/%dr:%dv channels %splex%s)",  \
-   d->playcount, d->pvchancount, d->reccount, d->rvchancount,  \
-   (d->flags & SD_F_SIMPLEX) ? "sim" : "du",   \
+   if (verbose < 1) {  \
+   sbuf_printf(s, " (%s%s%s",  \
+   d->playcount ? "play" : "", \
+   (d->playcount && d->reccount) ? "/" : "",   \
+   d->reccount ? "rec" : "");  \
+   } else {\
+   sbuf_printf(s, " (%dp:%dv/%dr:%dv", \
+   d->playcount, d->pvchancount,   \
+   d->reccount, d->rvchancount);   \
+   }   \
+   sbuf_printf(s, "%s)%s", \
+   ((d->playcount != 0 && d->reccount != 0) && \
+   (d->flags & SD_F_SIMPLEX)) ? " simplex" : "",   \
(device_get_unit(dev) == snd_unit) ? " default" : "")
 
 
___
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: r202268 - head/sys/dev/bge

2010-01-13 Thread Xin LI
Author: delphij
Date: Wed Jan 13 22:39:39 2010
New Revision: 202268
URL: http://svn.freebsd.org/changeset/base/202268

Log:
   o Add PCI ID for BCM 5756.
   o Don't enable BGE_FLAG_BER_BUG on both 5722 and 5756, and based
 on their PCI IDs rather than their chip IDs.
  
  Reported by:  several PC-BSD users via kmoore
  Reviewed by:  yongari, imp, jhb, davidch
  Sponsored by: iXsystems, Inc.
  MFC after:2 weeks

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   Wed Jan 13 22:22:16 2010(r202267)
+++ head/sys/dev/bge/if_bge.c   Wed Jan 13 22:39:39 2010(r202268)
@@ -187,6 +187,7 @@ static const struct bge_type {
{ BCOM_VENDORID,BCOM_DEVICEID_BCM5754M },
{ BCOM_VENDORID,BCOM_DEVICEID_BCM5755 },
{ BCOM_VENDORID,BCOM_DEVICEID_BCM5755M },
+   { BCOM_VENDORID,BCOM_DEVICEID_BCM5756 },
{ BCOM_VENDORID,BCOM_DEVICEID_BCM5761 },
{ BCOM_VENDORID,BCOM_DEVICEID_BCM5761E },
{ BCOM_VENDORID,BCOM_DEVICEID_BCM5761S },
@@ -2604,7 +2605,8 @@ bge_attach(device_t dev)
sc->bge_asicrev == BGE_ASICREV_BCM5761 ||
sc->bge_asicrev == BGE_ASICREV_BCM5784 ||
sc->bge_asicrev == BGE_ASICREV_BCM5787) {
-   if (sc->bge_chipid != BGE_CHIPID_BCM5722_A0)
+   if (pci_get_device(dev) != BCOM_DEVICEID_BCM5722 &&
+   pci_get_device(dev) != BCOM_DEVICEID_BCM5756)
sc->bge_flags |= BGE_FLAG_JITTER_BUG;
} else if (sc->bge_asicrev != BGE_ASICREV_BCM5906)
sc->bge_flags |= BGE_FLAG_BER_BUG;

Modified: head/sys/dev/bge/if_bgereg.h
==
--- head/sys/dev/bge/if_bgereg.hWed Jan 13 22:22:16 2010
(r202267)
+++ head/sys/dev/bge/if_bgereg.hWed Jan 13 22:39:39 2010
(r202268)
@@ -2138,6 +2138,7 @@ struct bge_status_block {
 #defineBCOM_DEVICEID_BCM5754M  0x1672
 #defineBCOM_DEVICEID_BCM5755   0x167B
 #defineBCOM_DEVICEID_BCM5755M  0x1673
+#defineBCOM_DEVICEID_BCM5756   0x1674
 #defineBCOM_DEVICEID_BCM5761   0x1681
 #defineBCOM_DEVICEID_BCM5761E  0x1680
 #defineBCOM_DEVICEID_BCM5761S  0x1688
___
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: r202269 - head/sys/dev/mii

2010-01-13 Thread Pyun YongHyeon
Author: yongari
Date: Thu Jan 14 00:36:49 2010
New Revision: 202269
URL: http://svn.freebsd.org/changeset/base/202269

Log:
  Add BCM5754 PHY id that is found on Dell Studio XPS 16.
  
  Tested by:scf
  MFC after:1 week

Modified:
  head/sys/dev/mii/brgphy.c
  head/sys/dev/mii/miidevs

Modified: head/sys/dev/mii/brgphy.c
==
--- head/sys/dev/mii/brgphy.c   Wed Jan 13 22:39:39 2010(r202268)
+++ head/sys/dev/mii/brgphy.c   Thu Jan 14 00:36:49 2010(r202269)
@@ -133,6 +133,7 @@ static const struct mii_phydesc brgphys[
MII_PHY_DESC(xxBROADCOM_ALT1, BCM5708S),
MII_PHY_DESC(xxBROADCOM_ALT1, BCM5709CAX),
MII_PHY_DESC(xxBROADCOM_ALT1, BCM5722),
+   MII_PHY_DESC(xxBROADCOM_ALT1, BCM5784),
MII_PHY_DESC(xxBROADCOM_ALT1, BCM5709C),
MII_PHY_DESC(xxBROADCOM_ALT1, BCM5761),
MII_PHY_DESC(BROADCOM2, BCM5906),

Modified: head/sys/dev/mii/miidevs
==
--- head/sys/dev/mii/miidevsWed Jan 13 22:39:39 2010(r202268)
+++ head/sys/dev/mii/miidevsThu Jan 14 00:36:49 2010(r202269)
@@ -153,6 +153,7 @@ model xxBROADCOM_ALT1 BCM5787   0x000e BCM
 model xxBROADCOM_ALT1 BCM5708S 0x0015 BCM5708S 1000/2500BaseSX PHY
 model xxBROADCOM_ALT1 BCM5709CAX   0x002c BCM5709C(AX) 10/100/1000baseTX 
PHY
 model xxBROADCOM_ALT1 BCM5722  0x002d BCM5722 10/100/1000baseTX PHY
+model xxBROADCOM_ALT1 BCM5784  0x003a BCM5784 10/100/1000baseTX PHY
 model xxBROADCOM_ALT1 BCM5709C 0x003c BCM5709C 10/100/1000baseTX PHY
 model xxBROADCOM_ALT1 BCM5761  0x003d BCM5761 10/100/1000baseTX PHY
 model BROADCOM2 BCM59060x0004 BCM5906 10/100baseTX PHY
___
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: r202270 - in head: share/man/man4 sys/dev/usb/net

2010-01-13 Thread Andrew Thompson
Author: thompsa
Date: Thu Jan 14 01:16:20 2010
New Revision: 202270
URL: http://svn.freebsd.org/changeset/base/202270

Log:
  Grammar nits.
  
  Submitted by: Ben Kaduk

Modified:
  head/share/man/man4/uhso.4
  head/sys/dev/usb/net/uhso.c

Modified: head/share/man/man4/uhso.4
==
--- head/share/man/man4/uhso.4  Thu Jan 14 00:36:49 2010(r202269)
+++ head/share/man/man4/uhso.4  Thu Jan 14 01:16:20 2010(r202270)
@@ -47,8 +47,8 @@ driver which makes them behave like a
 .Xr tty 4 .
 The packet interface is exposed as a network interface.
 .Pp
-Connection of the packet interface is achieved by using the proprietary
-AT commands
+Establishing a connection on the packet interface is achieved by using the
+proprietary AT commands
 .Dq Li AT_OWANCALL
 and
 .Dq Li AT_OWANDATA
@@ -76,7 +76,7 @@ Option iCON 505
 .Pp
 The device features a mass storage device referred to as
 .Dq Zero-CD
-which contains drivers for Microsoft Windows, this is the default
+which contains drivers for Microsoft Windows; this is the default
 mode for the device.
 The
 .Nm

Modified: head/sys/dev/usb/net/uhso.c
==
--- head/sys/dev/usb/net/uhso.c Thu Jan 14 00:36:49 2010(r202269)
+++ head/sys/dev/usb/net/uhso.c Thu Jan 14 01:16:20 2010(r202270)
@@ -152,8 +152,8 @@ struct uhso_softc {
 
 /*
  * Port definitions
- * Note that these definitions are arbitray and doesn't match
- * values returned by the auto config descriptor.
+ * Note that these definitions are arbitrary and do not match the values
+ * returned by the auto config descriptor.
  */
 #define UHSO_PORT_TYPE_CTL 0x01
 #define UHSO_PORT_TYPE_APP 0x02
@@ -568,7 +568,7 @@ uhso_attach(device_t self)
"Port available at this interface");
 
/*
-* The default interface description on most Option devices aren't
+* The default interface description on most Option devices isn't
 * very helpful. So we skip device_set_usb_desc and set the
 * device description manually.
 */
@@ -841,7 +841,7 @@ uhso_probe_iface(struct uhso_softc *sc, 
 
/*
 * If there is an additional interrupt endpoint on this
-* interface we most likley have a multiplexed serial port
+* interface then we most likely have a multiplexed serial port
 * available.
 */
if (iface->idesc->bNumEndpoints < 3) {
@@ -979,7 +979,7 @@ uhso_attach_muxserial(struct uhso_softc 
 
 /*
  * Interrupt callback for the multiplexed serial port. Indicates
- * which serial port that has data waiting.
+ * which serial port has data waiting.
  */
 static void
 uhso_mux_intr_callback(struct usb_xfer *xfer, usb_error_t error)
@@ -1531,7 +1531,7 @@ tr_setup:
 /*
  * Deferred RX processing, called with mutex locked.
  *
- * Each frame we receive might contain several small ip-packets aswell
+ * Each frame we receive might contain several small ip-packets as well
  * as partial ip-packets. We need to separate/assemble them into individual
  * packets before sending them to the ip-layer.
  */
___
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: r202243 - in head: share/man/man4 sys/dev/usb sys/dev/usb/net

2010-01-13 Thread Andrew Thompson
On Wed, Jan 13, 2010 at 04:27:24PM -0500, Ben Kaduk wrote:
> Lots of grammar nits.  See below.
> 
...

Thanks, commmitted.
___
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: r202271 - in head/sys/ia64: ia64 include

2010-01-13 Thread Marcel Moolenaar
Author: marcel
Date: Thu Jan 14 02:14:21 2010
New Revision: 202271
URL: http://svn.freebsd.org/changeset/base/202271

Log:
  Add wrappers for the RT Variable Services. While here, translate the
  EFI status into a standard errno value and change efi_set_time() to
  return a standard error.
  
  MFC after:1 week

Modified:
  head/sys/ia64/ia64/efi.c
  head/sys/ia64/include/efi.h

Modified: head/sys/ia64/ia64/efi.c
==
--- head/sys/ia64/ia64/efi.cThu Jan 14 01:16:20 2010(r202270)
+++ head/sys/ia64/ia64/efi.cThu Jan 14 02:14:21 2010(r202271)
@@ -41,6 +41,45 @@ static struct efi_systbl *efi_systbl;
 static struct efi_cfgtbl *efi_cfgtbl;
 static struct efi_rt *efi_runtime;
 
+static int efi_status2err[25] = {
+   0,  /* EFI_SUCCESS */
+   ENOEXEC,/* EFI_LOAD_ERROR */
+   EINVAL, /* EFI_INVALID_PARAMETER */
+   ENOSYS, /* EFI_UNSUPPORTED */
+   EMSGSIZE,   /* EFI_BAD_BUFFER_SIZE */
+   EOVERFLOW,  /* EFI_BUFFER_TOO_SMALL */
+   EBUSY,  /* EFI_NOT_READY */
+   EIO,/* EFI_DEVICE_ERROR */
+   EROFS,  /* EFI_WRITE_PROTECTED */
+   EAGAIN, /* EFI_OUT_OF_RESOURCES */
+   EIO,/* EFI_VOLUME_CORRUPTED */
+   ENOSPC, /* EFI_VOLUME_FULL */
+   ENXIO,  /* EFI_NO_MEDIA */
+   ESTALE, /* EFI_MEDIA_CHANGED */
+   ENOENT, /* EFI_NOT_FOUND */
+   EACCES, /* EFI_ACCESS_DENIED */
+   ETIMEDOUT,  /* EFI_NO_RESPONSE */
+   EADDRNOTAVAIL,  /* EFI_NO_MAPPING */
+   ETIMEDOUT,  /* EFI_TIMEOUT */
+   EDOOFUS,/* EFI_NOT_STARTED */
+   EALREADY,   /* EFI_ALREADY_STARTED */
+   ECANCELED,  /* EFI_ABORTED */
+   EPROTO, /* EFI_ICMP_ERROR */
+   EPROTO, /* EFI_TFTP_ERROR */
+   EPROTO  /* EFI_PROTOCOL_ERROR */
+};
+
+static int
+efi_status_to_errno(efi_status status)
+{
+   u_long code;
+   int error;
+
+   code = status & 0x3ffful;
+   error = (code < 25) ? efi_status2err[code] : EDOOFUS;
+   return (error);
+}
+
 void
 efi_boot_finish(void)
 {
@@ -148,9 +187,38 @@ efi_reset_system(void)
panic("%s: unable to reset the machine", __func__);
 }
 
-efi_status
+int
 efi_set_time(struct efi_tm *tm)
 {
 
-   return (efi_runtime->rt_settime(tm));
+   return (efi_status_to_errno(efi_runtime->rt_settime(tm)));
+}
+
+int
+efi_var_get(efi_char *name, struct uuid *vendor, uint32_t *attrib,
+size_t *datasize, void *data)
+{
+   efi_status status;
+
+   status = efi_runtime->rt_getvar(name, vendor, attrib, datasize, data);
+   return (efi_status_to_errno(status));
+}
+
+int
+efi_var_nextname(size_t *namesize, efi_char *name, struct uuid *vendor)
+{
+   efi_status status;
+
+   status = efi_runtime->rt_scanvar(namesize, name, vendor);
+   return (efi_status_to_errno(status));
+}
+ 
+int
+efi_var_set(efi_char *name, struct uuid *vendor, uint32_t *attrib,
+size_t *datasize, void *data)
+{
+   efi_status status;
+ 
+   status = efi_runtime->rt_getvar(name, vendor, attrib, datasize, data);
+   return (efi_status_to_errno(status));
 }

Modified: head/sys/ia64/include/efi.h
==
--- head/sys/ia64/include/efi.h Thu Jan 14 01:16:20 2010(r202270)
+++ head/sys/ia64/include/efi.h Thu Jan 14 02:14:21 2010(r202271)
@@ -158,6 +158,9 @@ void efi_get_time(struct efi_tm *);
 struct efi_md *efi_md_first(void);
 struct efi_md *efi_md_next(struct efi_md *);
 void efi_reset_system(void);
-efi_status efi_set_time(struct efi_tm *);
+int efi_set_time(struct efi_tm *);
+int efi_var_get(efi_char *, struct uuid *, uint32_t *, size_t *, void *);
+int efi_var_nextname(size_t *, efi_char *, struct uuid *);
+int efi_var_set(efi_char *, struct uuid *, uint32_t *, size_t *, void *);
 
 #endif /* _MACHINE_EFI_H_ */
___
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: r202272 - in head/sys/ia64: ia64 include

2010-01-13 Thread Marcel Moolenaar
Author: marcel
Date: Thu Jan 14 02:38:46 2010
New Revision: 202272
URL: http://svn.freebsd.org/changeset/base/202272

Log:
  Fix previous commitr:. efi_var_set() was copied from efi_var_get(),
  but wasn't actually changed.

Modified:
  head/sys/ia64/ia64/efi.c
  head/sys/ia64/include/efi.h

Modified: head/sys/ia64/ia64/efi.c
==
--- head/sys/ia64/ia64/efi.cThu Jan 14 02:14:21 2010(r202271)
+++ head/sys/ia64/ia64/efi.cThu Jan 14 02:38:46 2010(r202272)
@@ -214,11 +214,11 @@ efi_var_nextname(size_t *namesize, efi_c
 }
  
 int
-efi_var_set(efi_char *name, struct uuid *vendor, uint32_t *attrib,
-size_t *datasize, void *data)
+efi_var_set(efi_char *name, struct uuid *vendor, uint32_t attrib,
+size_t datasize, void *data)
 {
efi_status status;
  
-   status = efi_runtime->rt_getvar(name, vendor, attrib, datasize, data);
+   status = efi_runtime->rt_setvar(name, vendor, attrib, datasize, data);
return (efi_status_to_errno(status));
 }

Modified: head/sys/ia64/include/efi.h
==
--- head/sys/ia64/include/efi.h Thu Jan 14 02:14:21 2010(r202271)
+++ head/sys/ia64/include/efi.h Thu Jan 14 02:38:46 2010(r202272)
@@ -161,6 +161,6 @@ void efi_reset_system(void);
 int efi_set_time(struct efi_tm *);
 int efi_var_get(efi_char *, struct uuid *, uint32_t *, size_t *, void *);
 int efi_var_nextname(size_t *, efi_char *, struct uuid *);
-int efi_var_set(efi_char *, struct uuid *, uint32_t *, size_t *, void *);
+int efi_var_set(efi_char *, struct uuid *, uint32_t, size_t, void *);
 
 #endif /* _MACHINE_EFI_H_ */
___
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: r202273 - in head/sys/ia64: ia64 include

2010-01-13 Thread Marcel Moolenaar
Author: marcel
Date: Thu Jan 14 02:48:39 2010
New Revision: 202273
URL: http://svn.freebsd.org/changeset/base/202273

Log:
  Add ioctl requests to /dev/io on ia64 for reading and writing
  EFI variables. The primary reason for this is that it allows
  sysinstall(8) to add a boot menu item for the newly installed
  FreeBSD image.

Modified:
  head/sys/ia64/ia64/iodev_machdep.c
  head/sys/ia64/include/iodev.h

Modified: head/sys/ia64/ia64/iodev_machdep.c
==
--- head/sys/ia64/ia64/iodev_machdep.c  Thu Jan 14 02:38:46 2010
(r202272)
+++ head/sys/ia64/ia64/iodev_machdep.c  Thu Jan 14 02:48:39 2010
(r202273)
@@ -31,16 +31,22 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
 
 #include 
+#include 
 #include 
 
 static int iodev_pio_read(struct iodev_pio_req *req);
 static int iodev_pio_write(struct iodev_pio_req *req);
 
+static int iodev_efivar_getvar(struct iodev_efivar_req *req);
+static int iodev_efivar_nextname(struct iodev_efivar_req *req);
+static int iodev_efivar_setvar(struct iodev_efivar_req *req);
+
 /* ARGSUSED */
 int
 ioopen(struct cdev *dev __unused, int flags __unused, int fmt __unused,
@@ -69,6 +75,7 @@ int
 ioioctl(struct cdev *dev __unused, u_long cmd, caddr_t data,
 int fflag __unused, struct thread *td __unused)
 {
+   struct iodev_efivar_req *efivar_req;
struct iodev_pio_req *pio_req;
int error;
 
@@ -88,6 +95,24 @@ ioioctl(struct cdev *dev __unused, u_lon
break;
}
break;
+   case IODEV_EFIVAR:
+   efivar_req = (struct iodev_efivar_req *)data;
+   efivar_req->result = 0; /* So it's well-defined */
+   switch (efivar_req->access) {
+   case IODEV_EFIVAR_GETVAR:
+   error = iodev_efivar_getvar(efivar_req);
+   break;
+   case IODEV_EFIVAR_NEXTNAME:
+   error = iodev_efivar_nextname(efivar_req);
+   break;
+   case IODEV_EFIVAR_SETVAR:
+   error = iodev_efivar_setvar(efivar_req);
+   break;
+   default:
+   error = EINVAL;
+   break;
+   }
+   break;
}
 
return (error);
@@ -158,3 +183,118 @@ iodev_pio_write(struct iodev_pio_req *re
 
return (0);
 }
+
+static int
+iodev_efivar_getvar(struct iodev_efivar_req *req)
+{
+   void *data;
+   efi_char *name;
+   int error;
+
+   if ((req->namesize & 1) != 0 || req->namesize < 4)
+   return (EINVAL);
+   if (req->datasize == 0)
+   return (EINVAL);
+
+   /*
+* Pre-zero the allocated memory and don't copy the last 2 bytes
+* of the name. That should be the closing nul character (ucs-2)
+* and if not, then we ensured a nul-terminating string. This is
+* to protect the firmware and thus ourselves.
+*/
+   name = malloc(req->namesize, M_TEMP, M_WAITOK | M_ZERO);
+   error = copyin(req->name, name, req->namesize - 2);
+   if (error) {
+   free(name, M_TEMP);
+   return (error);
+   }
+
+   data = malloc(req->datasize, M_TEMP, M_WAITOK);
+   error = efi_var_get(name, &req->vendor, &req->attrib, &req->datasize,
+   data);
+   if (error == EOVERFLOW || error == ENOENT) {
+   req->result = error;
+   error = 0;
+   }
+   if (!error && !req->result)
+   error = copyout(data, req->data, req->datasize);
+
+   free(data, M_TEMP);
+   free(name, M_TEMP);
+   return (error);
+}
+
+static int 
+iodev_efivar_nextname(struct iodev_efivar_req *req) 
+{
+   efi_char *name;
+   int error;
+
+   /* Enforce a reasonable minimum size of the name buffer. */
+   if (req->namesize < 4)
+   return (EINVAL);
+
+   name = malloc(req->namesize, M_TEMP, M_WAITOK);
+   error = copyin(req->name, name, req->namesize);
+   if (error) {
+   free(name, M_TEMP);
+   return (error);
+   }
+
+   error = efi_var_nextname(&req->namesize, name, &req->vendor);
+   if (error == EOVERFLOW || error == ENOENT) {
+   req->result = error;
+   error = 0;
+   }
+   if (!error && !req->result)
+   error = copyout(name, req->name, req->namesize);
+
+   free(name, M_TEMP);
+   return (error);
+}
+
+static int 
+iodev_efivar_setvar(struct iodev_efivar_req *req) 
+{
+   void *data;
+   efi_char *name;
+   int error;
+
+   if ((req->namesize & 1) != 0 || req->namesize < 4)
+   return (EINVAL);
+
+   /*
+* Pre-zero the allocated memory and don't copy the last 2 bytes
+* of the name. That should be the closing nul charac

svn commit: r202274 - in head: . include lib/libc/gen libexec/getty

2010-01-13 Thread Ed Schouten
Author: ed
Date: Thu Jan 14 05:35:32 2010
New Revision: 202274
URL: http://svn.freebsd.org/changeset/base/202274

Log:
  Phase out ttyslot(3).
  
  The ttyslot() function was originally part for SUSv1, marked LEGACY in
  SUSv2 and removed later on. This function only makes sense when using
  utmp(5), because it was used to determine the offset of the record for
  the controlling TTY. It makes little sense to keep it here, because the
  new utmpx file format doesn't index based on TTY slots.

Modified:
  head/ObsoleteFiles.inc
  head/include/unistd.h
  head/lib/libc/gen/Symbol.map
  head/lib/libc/gen/ttyname.3
  head/lib/libc/gen/ttyslot.c
  head/libexec/getty/ttys.5

Modified: head/ObsoleteFiles.inc
==
--- head/ObsoleteFiles.inc  Thu Jan 14 02:48:39 2010(r202273)
+++ head/ObsoleteFiles.inc  Thu Jan 14 05:35:32 2010(r202274)
@@ -14,6 +14,8 @@
 # The file is partitioned: OLD_FILES first, then OLD_LIBS and OLD_DIRS last.
 #
 
+# 20100114: removal of ttyslot(3)
+OLD_FILES+=usr/share/man/man3/ttyslot.3.gz
 # 20100113: remove utmp.h, replace it by utmpx.h
 OLD_FILES+=usr/share/man/man3/login.3.gz
 OLD_FILES+=usr/share/man/man3/logout.3.gz

Modified: head/include/unistd.h
==
--- head/include/unistd.h   Thu Jan 14 02:48:39 2010(r202273)
+++ head/include/unistd.h   Thu Jan 14 05:35:32 2010(r202274)
@@ -574,7 +574,6 @@ int  swapon(const char *);
 int swapoff(const char *);
 int syscall(int, ...);
 off_t   __syscall(quad_t, ...);
-int ttyslot(void);
 int undelete(const char *);
 int unwhiteout(const char *);
 void   *valloc(size_t);/* obsoleted by malloc() */

Modified: head/lib/libc/gen/Symbol.map
==
--- head/lib/libc/gen/Symbol.mapThu Jan 14 02:48:39 2010
(r202273)
+++ head/lib/libc/gen/Symbol.mapThu Jan 14 05:35:32 2010
(r202274)
@@ -272,7 +272,6 @@ FBSD_1.0 {
openlog;
closelog;
setlogmask;
-   ttyslot;
ttyname_r;
ttyname;
timezone;

Modified: head/lib/libc/gen/ttyname.3
==
--- head/lib/libc/gen/ttyname.3 Thu Jan 14 02:48:39 2010(r202273)
+++ head/lib/libc/gen/ttyname.3 Thu Jan 14 05:35:32 2010(r202274)
@@ -34,8 +34,7 @@
 .Sh NAME
 .Nm ttyname ,
 .Nm ttyname_r ,
-.Nm isatty ,
-.Nm ttyslot
+.Nm isatty
 .Nd get name of associated terminal (tty) from file descriptor
 .Sh LIBRARY
 .Lb libc
@@ -47,8 +46,6 @@
 .Fn ttyname_r "int fd" "char *buf" "size_t len"
 .Ft int
 .Fn isatty "int fd"
-.Ft int
-.Fn ttyslot void
 .Sh DESCRIPTION
 These functions operate on the system file descriptors for terminal
 type devices.
@@ -89,13 +86,6 @@ The
 .Fn ttyname_r
 function
 takes a buffer and length as arguments to avoid this problem.
-.Pp
-The
-.Fn ttyslot
-function
-fetches the current process' control terminal number from the
-.Xr ttys 5
-file entry.
 .Sh RETURN VALUES
 The
 .Fn ttyname
@@ -110,12 +100,6 @@ The
 .Fn ttyname_r
 function returns 0 if successful.
 Otherwise an error number is returned.
-.Pp
-The
-.Fn ttyslot
-function
-returns the unit number of the device file if found; otherwise
-the value zero is returned.
 .Sh FILES
 .Bl -tag -width ".Pa /etc/ttys" -compact
 .It Pa /dev/\(**
@@ -142,10 +126,9 @@ is smaller than the length of the string
 .Xr ttys 5
 .Sh HISTORY
 The
-.Fn isatty ,
-.Fn ttyname ,
+.Fn isatty
 and
-.Fn ttyslot
+.Fn ttyname
 functions
 appeared in
 .At v7 .

Modified: head/lib/libc/gen/ttyslot.c
==
--- head/lib/libc/gen/ttyslot.c Thu Jan 14 02:48:39 2010(r202273)
+++ head/lib/libc/gen/ttyslot.c Thu Jan 14 05:35:32 2010(r202274)
@@ -40,7 +40,7 @@ __FBSDID("$FreeBSD$");
 #include 
 
 int
-ttyslot()
+__ttyslot(void)
 {
struct ttyent *ttyp;
int slot;
@@ -63,3 +63,5 @@ ttyslot()
endttyent();
return(0);
 }
+
+__sym_compat(ttyslot, __ttyslot, FBSD_1.0);

Modified: head/libexec/getty/ttys.5
==
--- head/libexec/getty/ttys.5   Thu Jan 14 02:48:39 2010(r202273)
+++ head/libexec/getty/ttys.5   Thu Jan 14 05:35:32 2010(r202274)
@@ -158,7 +158,6 @@ ttyp1   nonenetwork off group=pty
 .Sh SEE ALSO
 .Xr login 1 ,
 .Xr getttyent 3 ,
-.Xr ttyslot 3 ,
 .Xr gettytab 5 ,
 .Xr login.conf 5 ,
 .Xr termcap 5 ,
___
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: r202275 - head/lib/libc/gen

2010-01-13 Thread Ed Schouten
Author: ed
Date: Thu Jan 14 05:37:43 2010
New Revision: 202275
URL: http://svn.freebsd.org/changeset/base/202275

Log:
  Add two changes that should have gone into commit r202274.
  
Phase out ttyslot(3).
  
The ttyslot() function was originally part for SUSv1, marked LEGACY in
SUSv2 and removed later on. This function only makes sense when using
utmp(5), because it was used to determine the offset of the record for
the controlling TTY. It makes little sense to keep it here, because the
new utmpx file format doesn't index based on TTY slots.

Modified:
  head/lib/libc/gen/Makefile.inc
  head/lib/libc/gen/getttyent.3

Modified: head/lib/libc/gen/Makefile.inc
==
--- head/lib/libc/gen/Makefile.inc  Thu Jan 14 05:35:32 2010
(r202274)
+++ head/lib/libc/gen/Makefile.inc  Thu Jan 14 05:37:43 2010
(r202275)
@@ -177,7 +177,7 @@ MLINKS+=tcsetattr.3 cfgetispeed.3 tcseta
tcsetattr.3 cfmakeraw.3 tcsetattr.3 cfsetispeed.3 \
tcsetattr.3 cfsetospeed.3 tcsetattr.3 cfsetspeed.3 \
tcsetattr.3 tcgetattr.3
-MLINKS+=ttyname.3 isatty.3 ttyname.3 ttyname_r.3 ttyname.3 ttyslot.3
+MLINKS+=ttyname.3 isatty.3 ttyname.3 ttyname_r.3
 MLINKS+=tzset.3 tzsetwall.3
 MLINKS+=unvis.3 strunvis.3 unvis.3 strunvisx.3
 MLINKS+=vis.3 strvis.3 vis.3 strvisx.3

Modified: head/lib/libc/gen/getttyent.3
==
--- head/lib/libc/gen/getttyent.3   Thu Jan 14 05:35:32 2010
(r202274)
+++ head/lib/libc/gen/getttyent.3   Thu Jan 14 05:37:43 2010
(r202275)
@@ -188,7 +188,6 @@ zero otherwise.
 .El
 .Sh SEE ALSO
 .Xr login 1 ,
-.Xr ttyslot 3 ,
 .Xr gettytab 5 ,
 .Xr termcap 5 ,
 .Xr ttys 5 ,
___
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: INCLUDE_CONFIG_FILE in GENERIC

2010-01-13 Thread Nikolay Denev
On 14 Jan, 2010, at 24:04 , M. Warner Losh wrote:

> In message: <201001131633.09669@freebsd.org>
>John Baldwin  writes:
> : On Wednesday 13 January 2010 3:36:26 pm Doug Barton wrote:
> : > On 1/13/2010 12:15 PM, John Baldwin wrote:
> : > > On Wednesday 13 January 2010 1:48:38 pm Doug Barton wrote:
> : > >> To address the other responses, Tom, sorry, your suggested text doesn't
> : > >> address my concern. John, I don't think that users would somehow
> : > >> magically know to look in NOTES for more information about an option
> : > >> that is already in GENERIC.
> : > > 
> : > > You really think users do not already know to look in manpages or NOTES 
> to 
> : > > find out more details about kernel options? 
> : > 
> : > That's not what I said.
> : 
> : 
> : I don't think that users would [..] know to look in NOTES for more 
> information 
> : about an option that is [...] in GENERIC.
> : 
> : 
> : That seems really straight forward to me, or my English isn't good.  I do 
> : think users "would know to look in NOTES for more information about an 
> option 
> : that is in GENERIC".
> 
> Agreed.  That's why I did what I did: I conformed to the usual practice.
> 
> : > > Put 
> : > > another way, what makes 'INCLUDE_CONFIG_FILE' sufficiently special that 
> it 
> : > > deserves special treatment relative to other kernel options?
> : > 
> : > Because the default behavior (not including the actual file) for the
> : > option is contrary to user' reasonable expectation of how the option
> : > should work  and now I'm repeating myself.
> : 
> : I think a better change would be to just change the default behavior of 
> : config(8) to do the reasonable thing.
> 
> -C should be the default, and we should invent a new
> '--smaller-saved-config' option.
> 
> : > Seriously, don't you have anything better to do than argue against
> : > including a comment in a config file? I know I do. What is the
> : > overwhelming horror that will arise here if there are more comments
> : > GENERIC than you deem to be absolutely necessary?
> : 
> : What is the overwhelming horror about keeping a file readable and allowing 
> : users to find extended documentation for INCLUDE_CONFIG_FILE in the same 
> place 
> : that they find extended documentation about every other kernel option?
> 
> Yes.  That's why I did what I did: to keep things readable.
> 
> : > And yes, I read the part of your message that I snipped about "why do we
> : > have these documents if users don't read them?" The answer is, that's
> : > why I'm suggesting a comment that tells users what man page to read.
> : 
> : I think adding comments that merely redirect the users to further 
> : documentation only serves to obfuscate.  Left unchecked this approach will 
> : render files such as GENERIC with a very low signal-to-noise ratio making 
> it 
> : harder to parse in a "big picture" way.
> 
> Yes.
> 
> Basically, I'm annoyed too: Our users aren't idiots, and we shouldn't
> be treating them as such at every turn.  If there are surprises with
> how INCLUDE_CONFIG_FILE behaves, we should work to make it better, not
> paper over it with a comment.
> 
> Warner


Hello,

I just want to add a user's point of view :
To me INCLUDE_CONFIG_FILE sounds like the
whole config file will be included,
not just the output after preprocessing.

So I was thinking about something like two
different options, one "INCLUDE_CONFIG_FILE"
which includes the whole file with comments,
and the other to be just "INCLUDE_CONFIG".
I think these would be pretty self-explanatory.
Yes, it adds another kernel option, but having options
to kernel options looks even more cryptic :)

--
Regards,
Niki___
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"


  1   2   >