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

2010-11-03 Thread Hans Petter Selasky
Author: hselasky
Date: Wed Nov  3 07:51:33 2010
New Revision: 214726
URL: http://svn.freebsd.org/changeset/base/214726

Log:
  Clean up leftover USB device ID after r213856. This fixes:
  options USB_VERBOSE
  
  Submitted by: Lucius Windschuh
  Approved by:  thompsa (mentor)

Modified:
  head/sys/dev/usb/usbdevs

Modified: head/sys/dev/usb/usbdevs
==
--- head/sys/dev/usb/usbdevsWed Nov  3 01:32:50 2010(r214725)
+++ head/sys/dev/usb/usbdevsWed Nov  3 07:51:33 2010(r214726)
@@ -3270,9 +3270,6 @@ product UMEDIA AR5523_2_NF0x3206  AR5523
 /* Universal Access products */
 product UNIACCESS PANACHE  0x0101  Panache Surf USB ISDN Adapter
 
-/* Unknown vendors */
-product UNKNOWN5 USB2IDEBRIDGE 0x00ff  USB 2.0 ATA/SATA Bridge
-
 /* USI products */
 product USI MC60   0x10c5  MC60 Serial
 
___
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: r214727 - stable/8/sys/nfsserver

2010-11-03 Thread Konstantin Belousov
Author: kib
Date: Wed Nov  3 08:34:00 2010
New Revision: 214727
URL: http://svn.freebsd.org/changeset/base/214727

Log:
  MFC r214049:
  When readdirplus() is handled on the exported filesystem that does
  not support VFS_VGET, like msdosfs, do not call VOP_LOOKUP() for
  dotdot on the root directory. Our filesystems expect that VFS handles
  dotdot lookups on root on its own.

Modified:
  stable/8/sys/nfsserver/nfs_serv.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/nfsserver/nfs_serv.c
==
--- stable/8/sys/nfsserver/nfs_serv.c   Wed Nov  3 07:51:33 2010
(r214726)
+++ stable/8/sys/nfsserver/nfs_serv.c   Wed Nov  3 08:34:00 2010
(r214727)
@@ -3036,7 +3036,7 @@ nfsrv_readdirplus(struct nfsrv_descript 
struct iovec iv;
struct vattr va, at, *vap = va;
struct nfs_fattr *fp;
-   int len, nlen, rem, xfer, tsiz, i, error = 0, getret = 1;
+   int len, nlen, rem, xfer, tsiz, i, error = 0, error1, getret = 1;
int siz, cnt, fullsiz, eofflag, rdonly, dirlen, ncookies;
u_quad_t off, toff, verf;
u_long *cookies = NULL, *cookiep; /* needs to be int64_t or off_t */
@@ -3240,24 +3240,25 @@ again:
}
if (!VOP_ISLOCKED(vp))
vn_lock(vp, LK_SHARED | LK_RETRY);
-   if (VOP_LOOKUP(vp, nvp, cn) != 0)
+   if ((vp-v_vflag  VV_ROOT) != 0 
+   (cn.cn_flags  ISDOTDOT) != 0) {
+   vref(vp);
+   nvp = vp;
+   } else if (VOP_LOOKUP(vp, nvp, cn) != 0)
goto invalid;
}
 
bzero((caddr_t)nfhp, NFSX_V3FH);
nfhp-fh_fsid = nvp-v_mount-mnt_stat.f_fsid;
-   if (VOP_VPTOFH(nvp, nfhp-fh_fid)) {
+   if ((error1 = VOP_VPTOFH(nvp, nfhp-fh_fid)) == 0)
+   error1 = VOP_GETATTR(nvp, vap, cred);
+   if (vp == nvp)
+   vunref(nvp);
+   else
vput(nvp);
-   nvp = NULL;
-   goto invalid;
-   }
-   if (VOP_GETATTR(nvp, vap, cred)) {
-   vput(nvp);
-   nvp = NULL;
-   goto invalid;
-   }
-   vput(nvp);
nvp = NULL;
+   if (error1 != 0)
+   goto invalid;
 
/*
 * If either the dircount or maxcount will be
___
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: r214728 - head/libexec/rtld-elf

2010-11-03 Thread Konstantin Belousov
Author: kib
Date: Wed Nov  3 09:23:08 2010
New Revision: 214728
URL: http://svn.freebsd.org/changeset/base/214728

Log:
  If dlopen() is called for the dso that has been already loaded as a
  dependency, then the dso never has its DAG initialized. Empty DAG
  makes ref_dag() call in dlopen() a nop, and the dso refcount is off
  by one.
  
  Initialize the DAG on the first dlopen() call, using a boolean flag
  to prevent double initialization.
  
  From the PR (edited):
  Assume we have a library liba.so, containing a function a(), and a
  library libb.so, containing function b(). liba.so needs functionality
  from libb.so, so liba.so links in libb.so.
  
  An application doesn't know about the relation between these libraries,
  but needs to call a() and b(). It dlopen()s liba.so and obtains a
  pointer to a(), then it dlopen()s libb.so and obtains a pointer to b().
  
  As soon as the application doesn't need a() anymore, it dlclose()s liba.so.
  
  Expected result: the pointer to b() is still valid and can be called
  Actual result: the pointer to b() has become invalid, even though the
  application did not dlclose() the handle to libb.so. On calling b(), the
  application crashes with a segmentation fault.
  
  PR:   misc/151861
  Based on patch by:jh
  Reviewed by:  kan
  Tested by:Arjan van Leeuwen freebsd-maintainer opera com
  MFC after:1 week

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

Modified: head/libexec/rtld-elf/rtld.c
==
--- head/libexec/rtld-elf/rtld.cWed Nov  3 08:34:00 2010
(r214727)
+++ head/libexec/rtld-elf/rtld.cWed Nov  3 09:23:08 2010
(r214728)
@@ -1275,8 +1275,11 @@ init_dag(Obj_Entry *root)
 {
 DoneList donelist;
 
+if (root-dag_inited)
+   return;
 donelist_init(donelist);
 init_dag1(root, root, donelist);
+root-dag_inited = true;
 }
 
 static void
@@ -2045,8 +2048,16 @@ dlopen(const char *name, int mode)
}
} else {
 
-   /* Bump the reference counts for objects on this DAG. */
-   ref_dag(obj);
+   /*
+* Bump the reference counts for objects on this DAG.  If
+* this is the first dlopen() call for the object that was
+* already loaded as a dependency, initialize the dag
+* starting at it.
+*/
+   if (obj-dl_refcount == 1)
+   init_dag(obj);
+   else
+   ref_dag(obj);
 
if (ld_tracing)
goto trace;

Modified: head/libexec/rtld-elf/rtld.h
==
--- head/libexec/rtld-elf/rtld.hWed Nov  3 08:34:00 2010
(r214727)
+++ head/libexec/rtld-elf/rtld.hWed Nov  3 09:23:08 2010
(r214728)
@@ -222,6 +222,7 @@ typedef struct Struct_Obj_Entry {
 bool ref_nodel : 1;/* Refcount increased to prevent 
dlclose */
 bool init_scanned: 1;  /* Object is already on init list. */
 bool on_fini_list: 1;  /* Object is already on fini list. */
+bool dag_inited : 1;   /* Object has its DAG initialized. */
 
 struct link_map linkmap;   /* For GDB and dlinfo() */
 Objlist dldags;/* Object belongs to these dlopened DAGs (%) */
___
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: r214729 - stable/8/usr.bin/uudecode

2010-11-03 Thread Edwin Groothuis
Author: edwin
Date: Wed Nov  3 10:10:34 2010
New Revision: 214729
URL: http://svn.freebsd.org/changeset/base/214729

Log:
  MFC of r214002, r214010
  
  - Stylify of uudecode(1)
Part of PR bin/124739.
  
  - b64decode -r did not handle arbitary breaks in base64 encoded
data. White space should be accepted anywhere in a base64 encoded
stream, not just after every chunk (4 characters).
  
Test-scenario:
  
VmVsb2NpdHkgUmV3YXJkcw==
  
and
  
VmVsb2NpdHkgUmV3YXJkcw
==
  
should both produce Velocity Rewards
  
  PR:   bin/124739
  Submitted by: Mark Andrews ma...@isc.org

Modified:
  stable/8/usr.bin/uudecode/uudecode.c
Directory Properties:
  stable/8/usr.bin/uudecode/   (props changed)

Modified: stable/8/usr.bin/uudecode/uudecode.c
==
--- stable/8/usr.bin/uudecode/uudecode.cWed Nov  3 09:23:08 2010
(r214728)
+++ stable/8/usr.bin/uudecode/uudecode.cWed Nov  3 10:10:34 2010
(r214729)
@@ -57,6 +57,7 @@ __FBSDID($FreeBSD$);
 
 #include netinet/in.h
 
+#include ctype.h
 #include err.h
 #include errno.h
 #include fcntl.h
@@ -87,7 +88,7 @@ main(int argc, char *argv[])
base64 = 1;
 
while ((ch = getopt(argc, argv, cimo:prs)) != -1) {
-   switch(ch) {
+   switch (ch) {
case 'c':
if (oflag || rflag)
usage();
@@ -125,10 +126,10 @@ main(int argc, char *argv[])
usage();
}
}
-argc -= optind;
-argv += optind;
+   argc -= optind;
+   argv += optind;
 
-   if (*argv) {
+   if (*argv != NULL) {
rval = 0;
do {
infp = fopen(infile = *argv, r);
@@ -184,7 +185,7 @@ decode2(void)
void *handle;
struct passwd *pw;
struct stat st;
-   char buf[MAXPATHLEN+1];
+   char buf[MAXPATHLEN + 1];
 
base64 = 0;
/* search for header line */
@@ -259,7 +260,7 @@ decode2(void)
if (pflag || strcmp(outfile, /dev/stdout) == 0)
outfp = stdout;
else {
-   flags = O_WRONLY|O_CREAT|O_EXCL;
+   flags = O_WRONLY | O_CREAT | O_EXCL;
if (lstat(outfile, st) == 0) {
if (iflag) {
warnc(EEXIST, %s: %s, infile, outfile);
@@ -305,6 +306,7 @@ decode2(void)
 static int
 getline(char *buf, size_t size)
 {
+
if (fgets(buf, size, infp) != NULL)
return (2);
if (rflag)
@@ -341,17 +343,19 @@ uu_decode(void)
/* for each input line */
for (;;) {
switch (getline(buf, sizeof(buf))) {
-   case 0: return (0);
-   case 1: return (1);
+   case 0:
+   return (0);
+   case 1:
+   return (1);
}
 
-#defineDEC(c)  (((c) - ' ')  077) /* single character 
decode */
-#define IS_DEC(c) ( (((c) - ' ') = 0)  (((c) - ' ') = 077 + 1) )
+#defineDEC(c)  (((c) - ' ')  077) /* single character 
decode */
+#define IS_DEC(c)   ( (((c) - ' ') = 0)  (((c) - ' ') = 077 + 1) )
 
 #define OUT_OF_RANGE do {  \
warnx(%s: %s: character out of range: [%d-%d],\
infile, outfile, 1 + ' ', 077 + ' ' + 1);   \
-return (1);\
+   return (1); \
 } while (0)
 
/*
@@ -364,8 +368,8 @@ uu_decode(void)
for (++p; i  0; p += 4, i -= 3)
if (i = 3) {
if (!(IS_DEC(*p)  IS_DEC(*(p + 1)) 
-IS_DEC(*(p + 2))  IS_DEC(*(p + 3
-   OUT_OF_RANGE;
+   IS_DEC(*(p + 2))  IS_DEC(*(p + 3
+   OUT_OF_RANGE;
 
ch = DEC(p[0])  2 | DEC(p[1])  4;
putc(ch, outfp);
@@ -373,8 +377,7 @@ uu_decode(void)
putc(ch, outfp);
ch = DEC(p[2])  6 | DEC(p[3]);
putc(ch, outfp);
-   }
-   else {
+   } else {
if (i = 1) {
if (!(IS_DEC(*p)  IS_DEC(*(p + 1
OUT_OF_RANGE;
@@ -383,56 +386,85 @@ uu_decode(void)
}
if (i = 2) {
if (!(IS_DEC(*(p + 1)) 
-   IS_DEC(*(p 

svn commit: r214730 - stable/7/usr.bin/uudecode

2010-11-03 Thread Edwin Groothuis
Author: edwin
Date: Wed Nov  3 10:12:13 2010
New Revision: 214730
URL: http://svn.freebsd.org/changeset/base/214730

Log:
  MFC of r214002, r214010
  
  - Stylify of uudecode(1)
Part of PR bin/124739.
  
  - b64decode -r did not handle arbitary breaks in base64 encoded
data. White space should be accepted anywhere in a base64 encoded
stream, not just after every chunk (4 characters).
  
Test-scenario:
  
VmVsb2NpdHkgUmV3YXJkcw==
  
and
  
VmVsb2NpdHkgUmV3YXJkcw
==
  
should both produce Velocity Rewards
  
  PR: bin/124739
  Submitted by:   Mark Andrews ma...@isc.org

Modified:
  stable/7/usr.bin/uudecode/uudecode.c
Directory Properties:
  stable/7/usr.bin/uudecode/   (props changed)

Modified: stable/7/usr.bin/uudecode/uudecode.c
==
--- stable/7/usr.bin/uudecode/uudecode.cWed Nov  3 10:10:34 2010
(r214729)
+++ stable/7/usr.bin/uudecode/uudecode.cWed Nov  3 10:12:13 2010
(r214730)
@@ -57,6 +57,7 @@ __FBSDID($FreeBSD$);
 
 #include netinet/in.h
 
+#include ctype.h
 #include err.h
 #include errno.h
 #include fcntl.h
@@ -87,7 +88,7 @@ main(int argc, char *argv[])
base64 = 1;
 
while ((ch = getopt(argc, argv, cimo:prs)) != -1) {
-   switch(ch) {
+   switch (ch) {
case 'c':
if (oflag || rflag)
usage();
@@ -125,10 +126,10 @@ main(int argc, char *argv[])
usage();
}
}
-argc -= optind;
-argv += optind;
+   argc -= optind;
+   argv += optind;
 
-   if (*argv) {
+   if (*argv != NULL) {
rval = 0;
do {
infp = fopen(infile = *argv, r);
@@ -184,7 +185,7 @@ decode2(void)
void *handle;
struct passwd *pw;
struct stat st;
-   char buf[MAXPATHLEN+1];
+   char buf[MAXPATHLEN + 1];
 
base64 = 0;
/* search for header line */
@@ -259,7 +260,7 @@ decode2(void)
if (pflag || strcmp(outfile, /dev/stdout) == 0)
outfp = stdout;
else {
-   flags = O_WRONLY|O_CREAT|O_EXCL;
+   flags = O_WRONLY | O_CREAT | O_EXCL;
if (lstat(outfile, st) == 0) {
if (iflag) {
warnc(EEXIST, %s: %s, infile, outfile);
@@ -305,6 +306,7 @@ decode2(void)
 static int
 getline(char *buf, size_t size)
 {
+
if (fgets(buf, size, infp) != NULL)
return (2);
if (rflag)
@@ -341,17 +343,19 @@ uu_decode(void)
/* for each input line */
for (;;) {
switch (getline(buf, sizeof(buf))) {
-   case 0: return (0);
-   case 1: return (1);
+   case 0:
+   return (0);
+   case 1:
+   return (1);
}
 
-#defineDEC(c)  (((c) - ' ')  077) /* single character 
decode */
-#define IS_DEC(c) ( (((c) - ' ') = 0)  (((c) - ' ') = 077 + 1) )
+#defineDEC(c)  (((c) - ' ')  077) /* single character 
decode */
+#define IS_DEC(c)   ( (((c) - ' ') = 0)  (((c) - ' ') = 077 + 1) )
 
 #define OUT_OF_RANGE do {  \
warnx(%s: %s: character out of range: [%d-%d],\
infile, outfile, 1 + ' ', 077 + ' ' + 1);   \
-return (1);\
+   return (1); \
 } while (0)
 
/*
@@ -364,8 +368,8 @@ uu_decode(void)
for (++p; i  0; p += 4, i -= 3)
if (i = 3) {
if (!(IS_DEC(*p)  IS_DEC(*(p + 1)) 
-IS_DEC(*(p + 2))  IS_DEC(*(p + 3
-   OUT_OF_RANGE;
+   IS_DEC(*(p + 2))  IS_DEC(*(p + 3
+   OUT_OF_RANGE;
 
ch = DEC(p[0])  2 | DEC(p[1])  4;
putc(ch, outfp);
@@ -373,8 +377,7 @@ uu_decode(void)
putc(ch, outfp);
ch = DEC(p[2])  6 | DEC(p[3]);
putc(ch, outfp);
-   }
-   else {
+   } else {
if (i = 1) {
if (!(IS_DEC(*p)  IS_DEC(*(p + 1
OUT_OF_RANGE;
@@ -383,56 +386,85 @@ uu_decode(void)
}
if (i = 2) {
if (!(IS_DEC(*(p + 1)) 
-   

svn commit: r214731 - stable/8/usr.bin/truss

2010-11-03 Thread Ed Schouten
Author: ed
Date: Wed Nov  3 10:23:06 2010
New Revision: 214731
URL: http://svn.freebsd.org/changeset/base/214731

Log:
  MFC r214105:
  
Remove setpgid() call before executing child process.
  
Using a separate process group here is bad, since (for example) job
control in the TTY layer prevents interaction with the TTY, causing the
child process to hang.

Modified:
  stable/8/usr.bin/truss/setup.c
Directory Properties:
  stable/8/usr.bin/truss/   (props changed)

Modified: stable/8/usr.bin/truss/setup.c
==
--- stable/8/usr.bin/truss/setup.c  Wed Nov  3 10:12:13 2010
(r214730)
+++ stable/8/usr.bin/truss/setup.c  Wed Nov  3 10:23:06 2010
(r214731)
@@ -78,7 +78,6 @@ setup_and_wait(char *command[])
}
if (pid == 0) { /* Child */
ptrace(PT_TRACE_ME, 0, 0, 0);
-   setpgid (0, 0); 
execvp(command[0], command);
err(1, execvp %s, command[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: r214732 - stable/7/usr.bin/truss

2010-11-03 Thread Ed Schouten
Author: ed
Date: Wed Nov  3 10:24:57 2010
New Revision: 214732
URL: http://svn.freebsd.org/changeset/base/214732

Log:
  MFC r214105:
  
Remove setpgid() call before executing child process.
  
Using a separate process group here is bad, since (for example) job
control in the TTY layer prevents interaction with the TTY, causing the
child process to hang.

Modified:
  stable/7/usr.bin/truss/setup.c
Directory Properties:
  stable/7/usr.bin/truss/   (props changed)

Modified: stable/7/usr.bin/truss/setup.c
==
--- stable/7/usr.bin/truss/setup.c  Wed Nov  3 10:23:06 2010
(r214731)
+++ stable/7/usr.bin/truss/setup.c  Wed Nov  3 10:24:57 2010
(r214732)
@@ -78,7 +78,6 @@ setup_and_wait(char *command[])
}
if (pid == 0) { /* Child */
ptrace(PT_TRACE_ME, 0, 0, 0);
-   setpgid (0, 0); 
execvp(command[0], command);
err(1, execvp %s, command[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: r214735 - in head/usr.sbin/wpa: hostapd wpa_passphrase wpa_supplicant

2010-11-03 Thread Rui Paulo
Author: rpaulo
Date: Wed Nov  3 10:44:25 2010
New Revision: 214735
URL: http://svn.freebsd.org/changeset/base/214735

Log:
  Adapt for wpa_supplicant / hostapd 0.7.3.

Modified:
  head/usr.sbin/wpa/hostapd/Makefile
  head/usr.sbin/wpa/hostapd/driver_freebsd.c
  head/usr.sbin/wpa/wpa_passphrase/Makefile
  head/usr.sbin/wpa/wpa_supplicant/Makefile
  head/usr.sbin/wpa/wpa_supplicant/driver_freebsd.c

Modified: head/usr.sbin/wpa/hostapd/Makefile
==
--- head/usr.sbin/wpa/hostapd/Makefile  Wed Nov  3 10:43:38 2010
(r214734)
+++ head/usr.sbin/wpa/hostapd/Makefile  Wed Nov  3 10:44:25 2010
(r214735)
@@ -3,17 +3,31 @@
 .include ${.CURDIR}/../Makefile.inc
 
 .PATH.c:${HOSTAPD_DISTDIR} \
+   ${WPA_DISTDIR}/src/ap \
${WPA_DISTDIR}/src/eap_server \
+   ${WPA_DISTDIR}/src/eap_common \
+   ${WPA_DISTDIR}/src/eapol_auth \
+   ${WPA_DISTDIR}/src/drivers \
${WPA_DISTDIR}/src/radius \
+   ${WPA_DISTDIR}
 
 PROG=  hostapd
-SRCS=  accounting.c aes.c aes_wrap.c ap_list.c beacon.c common.c \
-   config.c ctrl_iface.c drivers.c eapol_sm.c eap.c eap_common.c \
-   eap_identity.c eap_methods.c eloop.c hostapd.c \
-   hw_features.c ieee802_11.c ieee802_11_common.c ieee802_11_auth.c \
-   ieee802_1x.c ip_addr.c md5.c mlme.c pmksa_cache.c radius.c \
-   radius_client.c rc4.c sha1.c sta_info.c vlan_init.c wme.c \
-   wpa.c wpa_auth_ie.c wpa_common.c wpa_debug.c wpabuf.c
+SRCS=  accounting.c aes-wrap.c ap_config.c \
+   ap_drv_ops.c ap_mlme.c authsrv.c \
+   chap.c common.c config_file.c ctrl_iface.c crypto_openssl.c \
+   ctrl_iface_ap.c drivers.c drv_callbacks.c dump_state.c \
+   eap_common.c eap_peap_common.c eap_register.c eap_server.c \
+   eap_server_gtc.c eap_server_identity.c eap_server_md5.c \
+   eap_server_methods.c eap_server_mschapv2.c eap_server_peap.c \
+   eap_server_tls.c eap_server_tls_common.c eap_server_ttls.c \
+   eapol_auth_dump.c eapol_auth_sm.c eloop.c hostapd.c ieee802_11_auth.c \
+   ieee802_11_common.c ieee802_11_ht.c ieee802_1x.c ip_addr.c \
+   md5.c main.c ms_funcs.c peerkey_auth.c pmksa_cache_auth.c \
+   preauth_auth.c radius.c radius_client.c sta_info.c \
+   sha1-pbkdf2.c sha1-tlsprf.c sha1-tprf.c sha1.c \
+   tkip_countermeasures.c utils.c \
+   vlan_init.c wpa_auth.c wpa_auth_glue.c wpa_auth_ie.c wpa_common.c \
+   wpa_debug.c wpabuf.c
 SRCS+= l2_packet_freebsd.c driver_freebsd.c os_unix.c
 
 MAN=   hostapd.8 hostapd.conf.5
@@ -24,16 +38,16 @@ FILESDIR= ${SHAREDIR}/examples/hostapd
 FILES= hostapd.conf hostapd.eap_user hostapd.wpa_psk
 .endif
 
-CFLAGS+= -I${HOSTAPD_DISTDIR}
+CFLAGS+= -I${HOSTAPD_DISTDIR} -I${WPA_DISTDIR}/src/drivers
 
-CFLAGS+= -DCONFIG_DRIVER_BSD
+CFLAGS+= -DCONFIG_DRIVER_BSD -DHOSTAPD
 CFLAGS+= -DCONFIG_DRIVER_RADIUS_ACL
 .if ${MK_INET6} != no
 CFLAGS+= -DCONFIG_IPV6
 .endif
-CFLAGS+= -g
-DPADD+=${LIBPCAP}
-LDADD+=-lpcap
+#CFLAGS+= -g
+DPADD+=${LIBPCAP} ${LIBSSL}
+LDADD+=-lpcap -lssl
 
 # User customizations for wpa_supplicant/hostapd build environment
 CFLAGS+=${HOSTAPD_CFLAGS}

Modified: head/usr.sbin/wpa/hostapd/driver_freebsd.c
==
--- head/usr.sbin/wpa/hostapd/driver_freebsd.c  Wed Nov  3 10:43:38 2010
(r214734)
+++ head/usr.sbin/wpa/hostapd/driver_freebsd.c  Wed Nov  3 10:44:25 2010
(r214735)
@@ -14,12 +14,13 @@
  *
  * $FreeBSD$
  */
-#include stdlib.h
-#include stdio.h
-#include unistd.h
-#include string.h
+#include includes.h
 #include sys/ioctl.h
-#include errno.h
+
+#include common.h
+#include driver.h
+#include eloop.h
+#include common/ieee802_11_defs.h
 
 #include sys/socket.h
 #include net/if.h
@@ -32,34 +33,29 @@
 #undef WPA_OUI_TYPE
 #undef WME_OUI_TYPE
 
-#include hostapd.h
-#include driver.h
-#include ieee802_1x.h
-#include ieee802_11_auth.h
-#include eloop.h
-#include sta_info.h
 #include l2_packet/l2_packet.h
 
-#include eapol_sm.h
-#include wpa.h
-#include radius/radius.h
-#include ieee802_11.h
-#include common.h
-#include hostap_common.h
-
 struct bsd_driver_data {
-   struct hostapd_data *hapd;  /* back pointer */
+   struct hostapd_data *hapd;  /* back pointer */
 
-   chariface[IFNAMSIZ + 1];
-   unsigned int ifindex;   /* interface index */
-   struct l2_packet_data *sock_xmit;   /* raw packet xmit socket */
-   int ioctl_sock; /* socket for ioctl() use */
-   int wext_sock;  /* socket for wireless events */
+   int ioctl_sock;  /* open socket for 802.11 ioctls */
+   int wext_sock;
+   struct l2_packet_data *sock_xmit;/* raw packet xmit socket */
+   int route;  /* routing socket for events */
+   chariface[IFNAMSIZ+1]; /* interface name 

svn commit: r214736 - in head/contrib/wpa: src/drivers wpa_supplicant/xcode

2010-11-03 Thread Rui Paulo
Author: rpaulo
Date: Wed Nov  3 10:46:39 2010
New Revision: 214736
URL: http://svn.freebsd.org/changeset/base/214736

Log:
  Remove unused files.

Deleted:
  head/contrib/wpa/src/drivers/driver_atheros.c
  head/contrib/wpa/src/drivers/driver_none.c
  head/contrib/wpa/src/drivers/linux_ioctl.c
  head/contrib/wpa/src/drivers/linux_ioctl.h
  head/contrib/wpa/src/drivers/netlink.c
  head/contrib/wpa/src/drivers/netlink.h
  head/contrib/wpa/src/drivers/nl80211_copy.h
  head/contrib/wpa/src/drivers/wireless_copy.h
  head/contrib/wpa/wpa_supplicant/xcode/
___
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: r214738 - head

2010-11-03 Thread John Baldwin
Author: jhb
Date: Wed Nov  3 13:42:59 2010
New Revision: 214738
URL: http://svn.freebsd.org/changeset/base/214738

Log:
  Delete machine/foo.h headers moved to x86/.  I forgot to commit this
  earlier.

Modified:
  head/ObsoleteFiles.inc

Modified: head/ObsoleteFiles.inc
==
--- head/ObsoleteFiles.inc  Wed Nov  3 12:12:29 2010(r214737)
+++ head/ObsoleteFiles.inc  Wed Nov  3 13:42:59 2010(r214738)
@@ -14,6 +14,11 @@
 # The file is partitioned: OLD_FILES first, then OLD_LIBS and OLD_DIRS last.
 #
 
+# 20101101: headers moved to machine/ to x86/
+.if ${TARGET_ARCH} == amd64 || ${TARGET_ARCH} == i386
+OLD_FILES+=usr/include/machine/apicreg.h
+OLD_FILES+=usr/include/machine/mca.h
+.endif
 # 20101020: catch up with vm_page_sleep_if_busy rename
 OLD_FILES+=usr/share/man/man9/vm_page_sleep_busy.9.gz
 # 20101011: removed subblock.h from liblzma
___
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: r214739 - head/sys/powerpc/aim

2010-11-03 Thread Nathan Whitehorn
Author: nwhitehorn
Date: Wed Nov  3 15:15:48 2010
New Revision: 214739
URL: http://svn.freebsd.org/changeset/base/214739

Log:
  Clean up the user segment handling code a little more. Now that
  set_user_sr() itself caches the user segment VSID, there is no need for
  cpu_switch() to do it again. This change also unifies the 32 and 64-bit
  code paths for kernel faults on user pages and remaps the user SLB slot
  on 64-bit systems when taking a syscall to avoid some unnecessary segment
  exception traps.

Modified:
  head/sys/powerpc/aim/copyinout.c
  head/sys/powerpc/aim/swtch32.S
  head/sys/powerpc/aim/swtch64.S
  head/sys/powerpc/aim/trap.c

Modified: head/sys/powerpc/aim/copyinout.c
==
--- head/sys/powerpc/aim/copyinout.cWed Nov  3 13:42:59 2010
(r214738)
+++ head/sys/powerpc/aim/copyinout.cWed Nov  3 15:15:48 2010
(r214739)
@@ -102,11 +102,12 @@ set_user_sr(pmap_t pm, const void *addr)
if (curthread-td_pcb-pcb_cpu.aim.usr_vsid == slbv) 
return;
 
-   __asm __volatile (isync; slbie %0; slbmte %1, %2; isync ::
-   r(USER_ADDR), r(slbv), r(USER_SLB_SLBE));
+   __asm __volatile(isync);
curthread-td_pcb-pcb_cpu.aim.usr_segm =
(uintptr_t)addr  ADDR_SR_SHFT;
curthread-td_pcb-pcb_cpu.aim.usr_vsid = slbv;
+   __asm __volatile (slbie %0; slbmte %1, %2; isync ::
+   r(USER_ADDR), r(slbv), r(USER_SLB_SLBE));
 }
 #else
 static __inline void
@@ -124,6 +125,8 @@ set_user_sr(pmap_t pm, const void *addr)
vsid |= SR_N;
 
__asm __volatile(isync);
+   curthread-td_pcb-pcb_cpu.aim.usr_segm =
+   (uintptr_t)addr  ADDR_SR_SHFT;
curthread-td_pcb-pcb_cpu.aim.usr_vsid = vsid;
__asm __volatile(mtsr %0,%1; isync :: n(USER_SR), r(vsid));
 }

Modified: head/sys/powerpc/aim/swtch32.S
==
--- head/sys/powerpc/aim/swtch32.S  Wed Nov  3 13:42:59 2010
(r214738)
+++ head/sys/powerpc/aim/swtch32.S  Wed Nov  3 15:15:48 2010
(r214739)
@@ -88,8 +88,6 @@ ENTRY(cpu_switch)
stw %r16,PCB_CR(%r6)
mflr%r16/* Save the link register */
stw %r16,PCB_LR(%r6)
-   mfsr%r16,USER_SR/* Save USER_SR for copyin/out */
-   stw %r16,PCB_AIM_USR_VSID(%r6)
stw %r1,PCB_SP(%r6) /* Save the stack pointer */
stw %r2,PCB_TOC(%r6)/* Save the TOC pointer */
 

Modified: head/sys/powerpc/aim/swtch64.S
==
--- head/sys/powerpc/aim/swtch64.S  Wed Nov  3 13:42:59 2010
(r214738)
+++ head/sys/powerpc/aim/swtch64.S  Wed Nov  3 15:15:48 2010
(r214739)
@@ -110,11 +110,6 @@ ENTRY(cpu_switch)
std %r1,PCB_SP(%r6) /* Save the stack pointer */
std %r2,PCB_TOC(%r6)/* Save the TOC pointer */

-   li  %r15,0  /* Save user segment for copyin/out */
-   li  %r16,USER_SLB_SLOT
-   slbmfev %r15, %r16
-   std %r15,PCB_AIM_USR_VSID(%r6)
-
mr  %r14,%r3/* Copy the old thread ptr... */
mr  %r15,%r4/* and the new thread ptr in scratch */
mr  %r16,%r5/* and the new lock */

Modified: head/sys/powerpc/aim/trap.c
==
--- head/sys/powerpc/aim/trap.c Wed Nov  3 13:42:59 2010(r214738)
+++ head/sys/powerpc/aim/trap.c Wed Nov  3 15:15:48 2010(r214739)
@@ -455,6 +455,13 @@ syscall(struct trapframe *frame)
td = PCPU_GET(curthread);
td-td_frame = frame;
 
+   /*
+* Speculatively restore last user SLB segment, which we know is
+* invalid already, since we are likely to do copyin()/copyout().
+*/
+   __asm __volatile (slbmte %0, %1; isync ::
+r(td-td_pcb-pcb_cpu.aim.usr_vsid), r(USER_SLB_SLBE));
+
error = syscallenter(td, sa);
syscallret(td, error, sa);
 }
@@ -532,13 +539,7 @@ trap_pfault(struct trapframe *frame, int
 
map = p-p_vmspace-vm_map;
 
-   #ifdef __powerpc64__
user_sr = td-td_pcb-pcb_cpu.aim.usr_segm;
-   #else
-   __asm (mfsr %0, %1
-   : =r(user_sr)
-   : K(USER_SR));
-   #endif
eva = ADDR_PIDX | ADDR_POFF;
eva |= user_sr  ADDR_SR_SHFT;
} else {
___
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: r214741 - stable/8/sys/powerpc/aim

2010-11-03 Thread Nathan Whitehorn
Author: nwhitehorn
Date: Wed Nov  3 15:24:25 2010
New Revision: 214741
URL: http://svn.freebsd.org/changeset/base/214741

Log:
  MFC r214601:
  Add some missing parentheses so that moea_bat_mapped() actually works.
  
  Submitted by: alc

Modified:
  stable/8/sys/powerpc/aim/mmu_oea.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/powerpc/aim/mmu_oea.c
==
--- stable/8/sys/powerpc/aim/mmu_oea.c  Wed Nov  3 15:22:09 2010
(r214740)
+++ stable/8/sys/powerpc/aim/mmu_oea.c  Wed Nov  3 15:24:25 2010
(r214741)
@@ -2381,7 +2381,7 @@ moea_bat_mapped(int idx, vm_offset_t pa,
/*
 * Return immediately if not a valid mapping
 */
-   if (!battable[idx].batu  BAT_Vs)
+   if (!(battable[idx].batu  BAT_Vs))
return (EINVAL);
 
/*
___
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: r214742 - stable/8/usr.sbin/mfiutil

2010-11-03 Thread John Baldwin
Author: jhb
Date: Wed Nov  3 15:25:30 2010
New Revision: 214742
URL: http://svn.freebsd.org/changeset/base/214742

Log:
  MFC 213672,213674,214396:
  - Report subcommand handler errors in mfiutil so that tools that
invoke the utilities can robustly report errors.
  - Fix compile with -DDEBUG by using the correct mfi_pd_ref union definition
in mfireg.h.
  - Save errno values before calling warn(3) so that errors are correctly
reported.
  - Use powerof2() from sys/param.h rather than a copy and paste version.

Modified:
  stable/8/usr.sbin/mfiutil/mfi_config.c
  stable/8/usr.sbin/mfiutil/mfi_drive.c
  stable/8/usr.sbin/mfiutil/mfi_evt.c
  stable/8/usr.sbin/mfiutil/mfi_flash.c
  stable/8/usr.sbin/mfiutil/mfi_patrol.c
  stable/8/usr.sbin/mfiutil/mfi_show.c
  stable/8/usr.sbin/mfiutil/mfi_volume.c
  stable/8/usr.sbin/mfiutil/mfiutil.c
Directory Properties:
  stable/8/usr.sbin/mfiutil/   (props changed)
  stable/8/usr.sbin/mfiutil/mfiutil.8   (props changed)

Modified: stable/8/usr.sbin/mfiutil/mfi_config.c
==
--- stable/8/usr.sbin/mfiutil/mfi_config.c  Wed Nov  3 15:24:25 2010
(r214741)
+++ stable/8/usr.sbin/mfiutil/mfi_config.c  Wed Nov  3 15:25:30 2010
(r214742)
@@ -29,12 +29,12 @@
  * $FreeBSD$
  */
 
-#include sys/types.h
+#include sys/param.h
 #ifdef DEBUG
 #include sys/sysctl.h
 #endif
-#include sys/errno.h
 #include err.h
+#include errno.h
 #include libutil.h
 #ifdef DEBUG
 #include stdint.h
@@ -52,8 +52,6 @@ static void   dump_config(int fd, struct m
 static int add_spare(int ac, char **av);
 static int remove_spare(int ac, char **av);
 
-#define powerof2(x)x)-1)(x))==0)
-
 static long
 dehumanize(const char *value)
 {
@@ -151,13 +149,14 @@ static int
 clear_config(int ac, char **av)
 {
struct mfi_ld_list list;
-   int ch, fd;
+   int ch, error, fd;
u_int i;
 
fd = mfi_open(mfi_unit);
if (fd  0) {
+   error = errno;
warn(mfi_open);
-   return (errno);
+   return (error);
}
 
if (!mfi_reconfig_supported()) {
@@ -167,8 +166,9 @@ clear_config(int ac, char **av)
}
 
if (mfi_ld_get_list(fd, list, NULL)  0) {
+   error = errno;
warn(Failed to get volume list);
-   return (errno);
+   return (error);
}
 
for (i = 0; i  list.ld_count; i++) {
@@ -189,8 +189,9 @@ clear_config(int ac, char **av)
}
 
if (mfi_dcmd_command(fd, MFI_DCMD_CFG_CLEAR, NULL, 0, NULL, 0, NULL)  
0) {
+   error = errno;
warn(Failed to clear configuration);
-   return (errno);
+   return (error);
}
 
printf(mfi%d: Configuration cleared\n, mfi_unit);
@@ -335,8 +336,9 @@ parse_array(int fd, int raid_type, char 
return (error);
 
if (mfi_pd_get_info(fd, device_id, pinfo, NULL)  0) {
+   error = errno;
warn(Failed to fetch drive info for drive %s, cp);
-   return (errno);
+   return (error);
}
 
if (pinfo-fw_state != MFI_PD_STATE_UNCONFIGURED_GOOD) {
@@ -548,8 +550,9 @@ create_volume(int ac, char **av)

fd = mfi_open(mfi_unit);
if (fd  0) {
+   error = errno;
warn(mfi_open);
-   return (errno);
+   return (error);
}
 
if (!mfi_reconfig_supported()) {
@@ -660,8 +663,9 @@ create_volume(int ac, char **av)
 * array and volume identifiers.
 */
if (mfi_config_read(fd, config)  0) {
+   error = errno;
warn(Failed to read configuration);
-   return (errno);
+   return (error);
}
p = (char *)config-array;
state.array_ref = 0x;
@@ -745,14 +749,14 @@ create_volume(int ac, char **av)
 #ifdef DEBUG
if (dump)
dump_config(fd, config);
-   else
 #endif
 
/* Send the new config to the controller. */
if (mfi_dcmd_command(fd, MFI_DCMD_CFG_ADD, config, config_size,
NULL, 0, NULL)  0) {
+   error = errno;
warn(Failed to add volume);
-   return (errno);
+   return (error);
}
 
/* Clean up. */
@@ -774,7 +778,7 @@ static int
 delete_volume(int ac, char **av)
 {
struct mfi_ld_info info;
-   int fd;
+   int error, fd;
uint8_t target_id, mbox[4];
 
/*
@@ -799,8 +803,9 @@ delete_volume(int ac, char **av)
 
fd = mfi_open(mfi_unit);
if (fd  0) {
+   error = errno;
warn(mfi_open);
-   return (errno);
+   return (error);
}
 
if (!mfi_reconfig_supported()) {
@@ -810,13 +815,15 @@ delete_volume(int ac, 

svn commit: r214743 - stable/7/usr.sbin/mfiutil

2010-11-03 Thread John Baldwin
Author: jhb
Date: Wed Nov  3 15:25:40 2010
New Revision: 214743
URL: http://svn.freebsd.org/changeset/base/214743

Log:
  MFC 213672,213674,214396:
  - Report subcommand handler errors in mfiutil so that tools that
invoke the utilities can robustly report errors.
  - Fix compile with -DDEBUG by using the correct mfi_pd_ref union definition
in mfireg.h.
  - Save errno values before calling warn(3) so that errors are correctly
reported.
  - Use powerof2() from sys/param.h rather than a copy and paste version.

Modified:
  stable/7/usr.sbin/mfiutil/mfi_config.c
  stable/7/usr.sbin/mfiutil/mfi_drive.c
  stable/7/usr.sbin/mfiutil/mfi_evt.c
  stable/7/usr.sbin/mfiutil/mfi_flash.c
  stable/7/usr.sbin/mfiutil/mfi_patrol.c
  stable/7/usr.sbin/mfiutil/mfi_show.c
  stable/7/usr.sbin/mfiutil/mfi_volume.c
  stable/7/usr.sbin/mfiutil/mfiutil.c
Directory Properties:
  stable/7/usr.sbin/mfiutil/   (props changed)
  stable/7/usr.sbin/mfiutil/mfiutil.8   (props changed)

Modified: stable/7/usr.sbin/mfiutil/mfi_config.c
==
--- stable/7/usr.sbin/mfiutil/mfi_config.c  Wed Nov  3 15:25:30 2010
(r214742)
+++ stable/7/usr.sbin/mfiutil/mfi_config.c  Wed Nov  3 15:25:40 2010
(r214743)
@@ -29,12 +29,12 @@
  * $FreeBSD$
  */
 
-#include sys/types.h
+#include sys/param.h
 #ifdef DEBUG
 #include sys/sysctl.h
 #endif
-#include sys/errno.h
 #include err.h
+#include errno.h
 #include libutil.h
 #ifdef DEBUG
 #include stdint.h
@@ -52,8 +52,6 @@ static void   dump_config(int fd, struct m
 static int add_spare(int ac, char **av);
 static int remove_spare(int ac, char **av);
 
-#define powerof2(x)x)-1)(x))==0)
-
 static long
 dehumanize(const char *value)
 {
@@ -151,13 +149,14 @@ static int
 clear_config(int ac, char **av)
 {
struct mfi_ld_list list;
-   int ch, fd;
+   int ch, error, fd;
u_int i;
 
fd = mfi_open(mfi_unit);
if (fd  0) {
+   error = errno;
warn(mfi_open);
-   return (errno);
+   return (error);
}
 
if (!mfi_reconfig_supported()) {
@@ -167,8 +166,9 @@ clear_config(int ac, char **av)
}
 
if (mfi_ld_get_list(fd, list, NULL)  0) {
+   error = errno;
warn(Failed to get volume list);
-   return (errno);
+   return (error);
}
 
for (i = 0; i  list.ld_count; i++) {
@@ -189,8 +189,9 @@ clear_config(int ac, char **av)
}
 
if (mfi_dcmd_command(fd, MFI_DCMD_CFG_CLEAR, NULL, 0, NULL, 0, NULL)  
0) {
+   error = errno;
warn(Failed to clear configuration);
-   return (errno);
+   return (error);
}
 
printf(mfi%d: Configuration cleared\n, mfi_unit);
@@ -335,8 +336,9 @@ parse_array(int fd, int raid_type, char 
return (error);
 
if (mfi_pd_get_info(fd, device_id, pinfo, NULL)  0) {
+   error = errno;
warn(Failed to fetch drive info for drive %s, cp);
-   return (errno);
+   return (error);
}
 
if (pinfo-fw_state != MFI_PD_STATE_UNCONFIGURED_GOOD) {
@@ -548,8 +550,9 @@ create_volume(int ac, char **av)

fd = mfi_open(mfi_unit);
if (fd  0) {
+   error = errno;
warn(mfi_open);
-   return (errno);
+   return (error);
}
 
if (!mfi_reconfig_supported()) {
@@ -660,8 +663,9 @@ create_volume(int ac, char **av)
 * array and volume identifiers.
 */
if (mfi_config_read(fd, config)  0) {
+   error = errno;
warn(Failed to read configuration);
-   return (errno);
+   return (error);
}
p = (char *)config-array;
state.array_ref = 0x;
@@ -745,14 +749,14 @@ create_volume(int ac, char **av)
 #ifdef DEBUG
if (dump)
dump_config(fd, config);
-   else
 #endif
 
/* Send the new config to the controller. */
if (mfi_dcmd_command(fd, MFI_DCMD_CFG_ADD, config, config_size,
NULL, 0, NULL)  0) {
+   error = errno;
warn(Failed to add volume);
-   return (errno);
+   return (error);
}
 
/* Clean up. */
@@ -774,7 +778,7 @@ static int
 delete_volume(int ac, char **av)
 {
struct mfi_ld_info info;
-   int fd;
+   int error, fd;
uint8_t target_id, mbox[4];
 
/*
@@ -799,8 +803,9 @@ delete_volume(int ac, char **av)
 
fd = mfi_open(mfi_unit);
if (fd  0) {
+   error = errno;
warn(mfi_open);
-   return (errno);
+   return (error);
}
 
if (!mfi_reconfig_supported()) {
@@ -810,13 +815,15 @@ delete_volume(int ac, 

svn commit: r214744 - in stable: 7/usr.sbin/mfiutil 8/usr.sbin/mfiutil

2010-11-03 Thread John Baldwin
Author: jhb
Date: Wed Nov  3 15:31:10 2010
New Revision: 214744
URL: http://svn.freebsd.org/changeset/base/214744

Log:
  Trim unneeded mergeinfo from a file.

Modified:
Directory Properties:
  stable/7/usr.sbin/mfiutil/mfiutil.8   (props changed)

Changes in other areas also in this revision:
Modified:
Directory Properties:
  stable/8/usr.sbin/mfiutil/mfiutil.8   (props changed)
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r214744 - in stable: 7/usr.sbin/mfiutil 8/usr.sbin/mfiutil

2010-11-03 Thread John Baldwin
Author: jhb
Date: Wed Nov  3 15:31:10 2010
New Revision: 214744
URL: http://svn.freebsd.org/changeset/base/214744

Log:
  Trim unneeded mergeinfo from a file.

Modified:
Directory Properties:
  stable/8/usr.sbin/mfiutil/mfiutil.8   (props changed)

Changes in other areas also in this revision:
Modified:
Directory Properties:
  stable/7/usr.sbin/mfiutil/mfiutil.8   (props changed)
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r214745 - in stable/8/sys/dev: pci usb/controller

2010-11-03 Thread Nathan Whitehorn
Author: nwhitehorn
Date: Wed Nov  3 15:31:37 2010
New Revision: 214745
URL: http://svn.freebsd.org/changeset/base/214745

Log:
  MFC r214349:
  The EHCI_CAPLENGTH and EHCI_HCIVERSION registers are actually sub-registers
  within the first 4 bytes of the EHCI memory space. For controllers that
  use big-endian MMIO, reading them with 1- and 2-byte reads would then
  return the wrong values. Instead, read the combined register with a
  4-byte read and mask out the interesting quantities.
  
  Requested by: marius

Modified:
  stable/8/sys/dev/pci/pci.c
  stable/8/sys/dev/usb/controller/ehci.c
  stable/8/sys/dev/usb/controller/ehcireg.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/dev/pci/pci.c
==
--- stable/8/sys/dev/pci/pci.c  Wed Nov  3 15:31:10 2010(r214744)
+++ stable/8/sys/dev/pci/pci.c  Wed Nov  3 15:31:37 2010(r214745)
@@ -2729,7 +2729,7 @@ ehci_early_takeover(device_t self)
SMM does not respond\n);
}
/* Disable interrupts */
-   offs = bus_read_1(res, EHCI_CAPLENGTH);
+   offs = EHCI_CAPLENGTH(bus_read_4(res, EHCI_CAPLEN_HCIVERSION));
bus_write_4(res, offs + EHCI_USBINTR, 0);
}
bus_release_resource(self, SYS_RES_MEMORY, rid, res);

Modified: stable/8/sys/dev/usb/controller/ehci.c
==
--- stable/8/sys/dev/usb/controller/ehci.c  Wed Nov  3 15:31:10 2010
(r214744)
+++ stable/8/sys/dev/usb/controller/ehci.c  Wed Nov  3 15:31:37 2010
(r214745)
@@ -268,9 +268,9 @@ ehci_init(ehci_softc_t *sc)
}
 #endif
 
-   sc-sc_offs = EREAD1(sc, EHCI_CAPLENGTH);
+   sc-sc_offs = EHCI_CAPLENGTH(EREAD4(sc, EHCI_CAPLEN_HCIVERSION));
 
-   version = EREAD2(sc, EHCI_HCIVERSION);
+   version = EHCI_HCIVERSION(EREAD4(sc, EHCI_CAPLEN_HCIVERSION));
device_printf(sc-sc_bus.bdev, EHCI version %x.%x\n,
version  8, version  0xff);
 

Modified: stable/8/sys/dev/usb/controller/ehcireg.h
==
--- stable/8/sys/dev/usb/controller/ehcireg.h   Wed Nov  3 15:31:10 2010
(r214744)
+++ stable/8/sys/dev/usb/controller/ehcireg.h   Wed Nov  3 15:31:37 2010
(r214745)
@@ -61,9 +61,13 @@
 #defineEHCI_LEGSUP_USBLEGCTLSTS0x04
 
 /* EHCI capability registers */
-#defineEHCI_CAPLENGTH  0x00/* RO Capability register 
length field */
-/* reserved0x01 */
-#defineEHCI_HCIVERSION 0x02/* RO Interface version number 
*/
+#defineEHCI_CAPLEN_HCIVERSION  0x00/* RO Capability register length
+* (least-significant byte) and 
+* interface version number (two
+* most significant)
+*/
+#define EHCI_CAPLENGTH(x)  ((x)  0xff)
+#define EHCI_HCIVERSION(x) (((x)  16)  0x)
 #defineEHCI_HCSPARAMS  0x04/* RO Structural parameters */
 #defineEHCI_HCS_DEBUGPORT(x)   (((x)  20)  0xf)
 #defineEHCI_HCS_P_INDICATOR(x) ((x)  0x1)
___
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: r214746 - in head/sys: kern sys

2010-11-03 Thread John Baldwin
Author: jhb
Date: Wed Nov  3 15:38:52 2010
New Revision: 214746
URL: http://svn.freebsd.org/changeset/base/214746

Log:
  Remove 'softclock_ih' as it is no longer used.

Modified:
  head/sys/kern/kern_timeout.c
  head/sys/sys/interrupt.h

Modified: head/sys/kern/kern_timeout.c
==
--- head/sys/kern/kern_timeout.cWed Nov  3 15:31:37 2010
(r214745)
+++ head/sys/kern/kern_timeout.cWed Nov  3 15:38:52 2010
(r214746)
@@ -214,8 +214,6 @@ kern_timeout_callwheel_init(void)
 /*
  * Start standard softclock thread.
  */
-void*softclock_ih;
-
 static void
 start_softclock(void *dummy)
 {
@@ -226,9 +224,8 @@ start_softclock(void *dummy)
 
cc = CC_CPU(timeout_cpu);
if (swi_add(clk_intr_event, clock, softclock, cc, SWI_CLOCK,
-   INTR_MPSAFE, softclock_ih))
+   INTR_MPSAFE, cc-cc_cookie))
panic(died while creating standard software ithreads);
-   cc-cc_cookie = softclock_ih;
 #ifdef SMP
CPU_FOREACH(cpu) {
if (cpu == timeout_cpu)

Modified: head/sys/sys/interrupt.h
==
--- head/sys/sys/interrupt.hWed Nov  3 15:31:37 2010(r214745)
+++ head/sys/sys/interrupt.hWed Nov  3 15:38:52 2010(r214746)
@@ -146,7 +146,6 @@ struct proc;
 
 extern struct  intr_event *tty_intr_event;
 extern struct  intr_event *clk_intr_event;
-extern void*softclock_ih;
 extern void*vm_ih;
 
 /* Counts and names for statistics (defined in MD code). */
___
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: r214747 - stable/8/lib/libjail

2010-11-03 Thread Jamie Gritton
Author: jamie
Date: Wed Nov  3 15:54:50 2010
New Revision: 214747
URL: http://svn.freebsd.org/changeset/base/214747

Log:
  MFC 214434:
  
Find a jail's type as part of jailparam_init rather than waiting until
it's absolutely necessary.

Modified:
  stable/8/lib/libjail/jail.c
Directory Properties:
  stable/8/lib/libjail/   (props changed)

Modified: stable/8/lib/libjail/jail.c
==
--- stable/8/lib/libjail/jail.c Wed Nov  3 15:38:52 2010(r214746)
+++ stable/8/lib/libjail/jail.c Wed Nov  3 15:54:50 2010(r214747)
@@ -250,10 +250,6 @@ jailparam_all(struct jailparam **jpp)
}
if (jailparam_init(jp + njp, buf + sizeof(SJPARAM))  0)
goto error;
-   if (jailparam_type(jp + njp)  0) {
-   njp++;
-   goto error;
-   }
mib1[1] = 2;
}
jp = realloc(jp, njp * sizeof(*jp));
@@ -279,6 +275,10 @@ jailparam_init(struct jailparam *jp, con
strerror_r(errno, jail_errmsg, JAIL_ERRMSGLEN);
return (-1);
}
+   if (jailparam_type(jp)  0) {
+   jailparam_free(jp, 1);
+   return (-1);
+   }
return (0);
 }
 
@@ -293,8 +293,6 @@ jailparam_import(struct jailparam *jp, c
const char *avalue;
int i, nval, fw;
 
-   if (!jp-jp_ctltype  jailparam_type(jp)  0)
-   return (-1);
if (value == NULL)
return (0);
if ((jp-jp_ctltype  CTLTYPE) == CTLTYPE_STRING) {
@@ -563,8 +561,6 @@ jailparam_get(struct jailparam *jp, unsi
jp_lastjid = jp_jid = jp_name = NULL;
arrays = 0;
for (ai = j = 0; j  njp; j++) {
-   if (!jp[j].jp_ctltype  jailparam_type(jp + j)  0)
-   return (-1);
if (!strcmp(jp[j].jp_name, lastjid))
jp_lastjid = jp + j;
else if (!strcmp(jp[j].jp_name, jid))
@@ -725,8 +721,6 @@ jailparam_export(struct jailparam *jp)
int i, nval, ival;
char valbuf[INET6_ADDRSTRLEN];
 
-   if (!jp-jp_ctltype  jailparam_type(jp)  0)
-   return (NULL);
if ((jp-jp_ctltype  CTLTYPE) == CTLTYPE_STRING) {
value = strdup(jp-jp_value);
if (value == NULL)
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r214748 - head/sys/geom

2010-11-03 Thread Jaakko Heinonen
Author: jh
Date: Wed Nov  3 16:19:35 2010
New Revision: 214748
URL: http://svn.freebsd.org/changeset/base/214748

Log:
  Extend the g_eventlock mutex coverage in one_event() to include setting
  of the EV_DONE flag and use the mutex to protect against losing wakeups
  in g_waitfor_event().
  
  Reported by:  davidxu
  Tested by:davidxu
  Discussed on: freebsd-current

Modified:
  head/sys/geom/geom_event.c

Modified: head/sys/geom/geom_event.c
==
--- head/sys/geom/geom_event.c  Wed Nov  3 15:54:50 2010(r214747)
+++ head/sys/geom/geom_event.c  Wed Nov  3 16:19:35 2010(r214748)
@@ -220,11 +220,12 @@ one_event(void)
mtx_lock(g_eventlock);
TAILQ_REMOVE(g_events, ep, events);
ep-flag = ~EV_INPROGRESS;
-   mtx_unlock(g_eventlock);
if (ep-flag  EV_WAKEUP) {
ep-flag |= EV_DONE;
+   mtx_unlock(g_eventlock);
wakeup(ep);
} else {
+   mtx_unlock(g_eventlock);
g_free(ep);
}
g_topology_unlock();
@@ -365,11 +366,14 @@ g_waitfor_event(g_event_t *func, void *a
va_end(ap);
if (error)
return (error);
-   do 
-   tsleep(ep, PRIBIO, g_waitfor_event, hz);
-   while (!(ep-flag  EV_DONE));
+
+   mtx_lock(g_eventlock);
+   while (!(ep-flag  EV_DONE))
+   msleep(ep, g_eventlock, PRIBIO, g_waitfor_event, hz);
if (ep-flag  EV_CANCELED)
error = EAGAIN;
+   mtx_unlock(g_eventlock);
+
g_free(ep);
return (error);
 }
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r214749 - head/sys/powerpc/aim

2010-11-03 Thread Nathan Whitehorn
Author: nwhitehorn
Date: Wed Nov  3 16:21:47 2010
New Revision: 214749
URL: http://svn.freebsd.org/changeset/base/214749

Log:
  Fix two mistakes on 32-bit systems. The slbmte code in syscall() is 64-bit
  only, and should be protected with an ifdef, and the no-execute bit in
  32-bit set_user_sr() should be set before the comparison, not after, or
  it will never match.

Modified:
  head/sys/powerpc/aim/copyinout.c
  head/sys/powerpc/aim/trap.c

Modified: head/sys/powerpc/aim/copyinout.c
==
--- head/sys/powerpc/aim/copyinout.cWed Nov  3 16:19:35 2010
(r214748)
+++ head/sys/powerpc/aim/copyinout.cWed Nov  3 16:21:47 2010
(r214749)
@@ -117,13 +117,13 @@ set_user_sr(pmap_t pm, const void *addr)
 
vsid = va_to_vsid(pm, (vm_offset_t)addr);
 
+   /* Mark segment no-execute */
+   vsid |= SR_N;
+
/* If we have already set this VSID, we can just return */
if (curthread-td_pcb-pcb_cpu.aim.usr_vsid == vsid)
return;
 
-   /* Mark segment no-execute */
-   vsid |= SR_N;
-
__asm __volatile(isync);
curthread-td_pcb-pcb_cpu.aim.usr_segm =
(uintptr_t)addr  ADDR_SR_SHFT;

Modified: head/sys/powerpc/aim/trap.c
==
--- head/sys/powerpc/aim/trap.c Wed Nov  3 16:19:35 2010(r214748)
+++ head/sys/powerpc/aim/trap.c Wed Nov  3 16:21:47 2010(r214749)
@@ -455,12 +455,14 @@ syscall(struct trapframe *frame)
td = PCPU_GET(curthread);
td-td_frame = frame;
 
+#ifdef __powerpc64__
/*
 * Speculatively restore last user SLB segment, which we know is
 * invalid already, since we are likely to do copyin()/copyout().
 */
__asm __volatile (slbmte %0, %1; isync ::
 r(td-td_pcb-pcb_cpu.aim.usr_vsid), r(USER_SLB_SLBE));
+#endif
 
error = syscallenter(td, sa);
syscallret(td, error, sa);
___
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: r214752 - head/share/man/man9

2010-11-03 Thread Edward Tomasz Napierala
Author: trasz
Date: Wed Nov  3 18:49:50 2010
New Revision: 214752
URL: http://svn.freebsd.org/changeset/base/214752

Log:
  Xref BUS_SETUP_INTR(9) and locking(9).

Modified:
  head/share/man/man9/BUS_SETUP_INTR.9
  head/share/man/man9/locking.9

Modified: head/share/man/man9/BUS_SETUP_INTR.9
==
--- head/share/man/man9/BUS_SETUP_INTR.9Wed Nov  3 16:46:05 2010
(r214751)
+++ head/share/man/man9/BUS_SETUP_INTR.9Wed Nov  3 18:49:50 2010
(r214752)
@@ -24,7 +24,7 @@
 .\
 .\ $FreeBSD$
 .\
-.Dd December 18, 2007
+.Dd November 3, 2010
 .Dt BUS_SETUP_INTR 9
 .Os
 .Sh NAME
@@ -205,8 +205,7 @@ otherwise an appropriate error is return
 .Xr random 4 ,
 .Xr device 9 ,
 .Xr driver 9 ,
-.Xr mtx_init 9 ,
-.Xr wakeup 9
+.Xr locking 9
 .Sh AUTHORS
 .An -nosplit
 This manual page was written by

Modified: head/share/man/man9/locking.9
==
--- head/share/man/man9/locking.9   Wed Nov  3 16:46:05 2010
(r214751)
+++ head/share/man/man9/locking.9   Wed Nov  3 18:49:50 2010
(r214752)
@@ -24,7 +24,7 @@
 .\
 .\ $FreeBSD$
 .\
-.Dd August 24, 2010
+.Dd November 3, 2010
 .Dt LOCKING 9
 .Os
 .Sh NAME
@@ -356,6 +356,7 @@ At this time this is a rather easy to re
 .Xr sema 9 ,
 .Xr sleep 9 ,
 .Xr sx 9 ,
+.Xr BUS_SETUP_INTR 9 ,
 .Xr LOCK_PROFILING 9
 .Sh HISTORY
 These
___
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: r214754 - head/sys/netinet/libalias

2010-11-03 Thread Nick Hibma
Author: n_hibma
Date: Wed Nov  3 21:10:12 2010
New Revision: 214754
URL: http://svn.freebsd.org/changeset/base/214754

Log:
  Don't spam the console with loaded modules during boot and/or during
  startup of ppp.
  
  Note: This cannot be hidden behind bootverbose as this file is included
  from lib/libalias as well.

Modified:
  head/sys/netinet/libalias/alias.c

Modified: head/sys/netinet/libalias/alias.c
==
--- head/sys/netinet/libalias/alias.c   Wed Nov  3 20:50:41 2010
(r214753)
+++ head/sys/netinet/libalias/alias.c   Wed Nov  3 21:10:12 2010
(r214754)
@@ -1665,7 +1665,6 @@ LibAliasRefreshModules(void)
if (buf[i] == '#')
continue;
buf[len - 1] = '\0';
-   printf(Loading %s\n, buf);
LibAliasLoadModule(buf);
}
}
___
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: r214755 - in stable/8/sys: amd64/amd64 amd64/conf amd64/ia32 amd64/include amd64/linux32 arm/arm cddl/dev/systrace compat/ia32 compat/svr4 conf i386/conf i386/i386 i386/ibcs2 i386/inclu...

2010-11-03 Thread Konstantin Belousov
Author: kib
Date: Wed Nov  3 21:21:12 2010
New Revision: 214755
URL: http://svn.freebsd.org/changeset/base/214755

Log:
  MFC r208453:
  Reorganize syscall entry and leave handling.
  Implement ptrace_lwpinfo pl_flags PL_FLAG_SCE, PL_FLAG_SCX and
  PL_FLAG_EXEC.
  
  The i386, amd64, sparc64, sun4v, powerpc and ia64 syscall()s are
  changed to use syscallenter()/syscallret(). MIPS and arm are not
  converted and use the mostly unchanged syscall() implementation.
  
  MFC r208514:
  Change ia64' struct syscall_args definition so that args is a pointer to
  the arguments array instead of array itself.
  
  MFC r208566:
  Allow to use syscallname(9) outside subr_trap.c.
  
  MFC r209258 (by rpaulo):
  Make DTrace syscall provider work again by including opt_kdtrace.h here.
  
  MFC r209313:
  Only enable kdtrace hook in the LINT on the architectures that implement it.
  
  MFC r209697:
  Obey sv_syscallnames bounds in syscallname().
  
  NOTE: The KBI of the struct sysentvec is changed, new required members
  sv_set_syscall_retval, sv_fetch_syscall_args and sv_syscallnames are
  added. The sv_prepsyscall field is now ignored. Third-party modules
  using the struct sysentvec must be modified and recompiled, we believe
  that only ABI emulators are affected. No such out-of-tree modules are
  known. In-tree modules that are affected by the change were converted
  to depend on exact version of the kernel, see r214421.

Modified:
  stable/8/sys/amd64/amd64/elf_machdep.c
  stable/8/sys/amd64/amd64/trap.c
  stable/8/sys/amd64/conf/NOTES
  stable/8/sys/amd64/ia32/ia32_syscall.c
  stable/8/sys/amd64/include/proc.h
  stable/8/sys/amd64/linux32/linux32_sysvec.c
  stable/8/sys/arm/arm/elf_machdep.c
  stable/8/sys/arm/arm/trap.c
  stable/8/sys/cddl/dev/systrace/systrace.c
  stable/8/sys/compat/ia32/ia32_sysvec.c
  stable/8/sys/compat/ia32/ia32_util.h
  stable/8/sys/compat/svr4/svr4_sysvec.c
  stable/8/sys/conf/NOTES
  stable/8/sys/conf/files
  stable/8/sys/i386/conf/NOTES
  stable/8/sys/i386/i386/elf_machdep.c
  stable/8/sys/i386/i386/trap.c
  stable/8/sys/i386/ibcs2/ibcs2_sysvec.c
  stable/8/sys/i386/include/proc.h
  stable/8/sys/i386/linux/linux_sysvec.c
  stable/8/sys/ia64/ia32/ia32_trap.c
  stable/8/sys/ia64/ia64/elf_machdep.c
  stable/8/sys/ia64/ia64/trap.c
  stable/8/sys/ia64/include/proc.h
  stable/8/sys/kern/imgact_aout.c
  stable/8/sys/kern/init_main.c
  stable/8/sys/kern/kern_exec.c
  stable/8/sys/kern/kern_sig.c
  stable/8/sys/kern/subr_trap.c
  stable/8/sys/kern/sys_process.c
  stable/8/sys/mips/mips/elf64_machdep.c
  stable/8/sys/mips/mips/elf_machdep.c
  stable/8/sys/mips/mips/trap.c
  stable/8/sys/powerpc/aim/trap.c
  stable/8/sys/powerpc/booke/trap.c
  stable/8/sys/powerpc/include/proc.h
  stable/8/sys/powerpc/powerpc/elf_machdep.c
  stable/8/sys/sparc64/include/proc.h
  stable/8/sys/sparc64/sparc64/elf_machdep.c
  stable/8/sys/sparc64/sparc64/trap.c
  stable/8/sys/sun4v/include/proc.h
  stable/8/sys/sun4v/sun4v/trap.c
  stable/8/sys/sys/proc.h
  stable/8/sys/sys/ptrace.h
  stable/8/sys/sys/sysent.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/amd64/amd64/elf_machdep.c
==
--- stable/8/sys/amd64/amd64/elf_machdep.c  Wed Nov  3 21:10:12 2010
(r214754)
+++ stable/8/sys/amd64/amd64/elf_machdep.c  Wed Nov  3 21:21:12 2010
(r214755)
@@ -32,6 +32,7 @@ __FBSDID($FreeBSD$);
 #include sys/exec.h
 #include sys/imgact.h
 #include sys/linker.h
+#include sys/proc.h
 #include sys/sysent.h
 #include sys/imgact_elf.h
 #include sys/syscall.h
@@ -74,7 +75,10 @@ struct sysentvec elf64_freebsd_sysvec = 
.sv_setregs = exec_setregs,
.sv_fixlimit= NULL,
.sv_maxssiz = NULL,
-   .sv_flags   = SV_ABI_FREEBSD | SV_LP64
+   .sv_flags   = SV_ABI_FREEBSD | SV_LP64,
+   .sv_set_syscall_retval = cpu_set_syscall_retval,
+   .sv_fetch_syscall_args = cpu_fetch_syscall_args,
+   .sv_syscallnames = syscallnames,
 };
 
 static Elf64_Brandinfo freebsd_brand_info = {

Modified: stable/8/sys/amd64/amd64/trap.c
==
--- stable/8/sys/amd64/amd64/trap.c Wed Nov  3 21:10:12 2010
(r214754)
+++ stable/8/sys/amd64/amd64/trap.c Wed Nov  3 21:21:12 2010
(r214755)
@@ -76,7 +76,6 @@ __FBSDID($FreeBSD$);
 #ifdef HWPMC_HOOKS
 #include sys/pmckern.h
 #endif
-#include security/audit/audit.h
 
 #include vm/vm.h
 #include vm/vm_param.h
@@ -170,8 +169,6 @@ static int prot_fault_translation = 0;
 SYSCTL_INT(_machdep, OID_AUTO, prot_fault_translation, CTLFLAG_RW,
prot_fault_translation, 0, Select signal to deliver 

svn commit: r214756 - in stable/8/sys: kern sys

2010-11-03 Thread Konstantin Belousov
Author: kib
Date: Wed Nov  3 21:24:21 2010
New Revision: 214756
URL: http://svn.freebsd.org/changeset/base/214756

Log:
  MFC r209688:
  Extend ptrace(PT_LWPINFO) to report siginfo for the signal that caused
  debugee stop.

Modified:
  stable/8/sys/kern/kern_sig.c
  stable/8/sys/kern/sys_process.c
  stable/8/sys/sys/proc.h
  stable/8/sys/sys/ptrace.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/kern/kern_sig.c
==
--- stable/8/sys/kern/kern_sig.cWed Nov  3 21:21:12 2010
(r214755)
+++ stable/8/sys/kern/kern_sig.cWed Nov  3 21:24:21 2010
(r214756)
@@ -2517,7 +2517,6 @@ issignal(struct thread *td, int stop_all
struct sigacts *ps;
struct sigqueue *queue;
sigset_t sigpending;
-   ksiginfo_t ksi;
int sig, prop, newsig;
 
p = td-td_proc;
@@ -2560,10 +2559,10 @@ issignal(struct thread *td, int stop_all
 * be thrown away.
 */
queue = td-td_sigqueue;
-   ksi.ksi_signo = 0;
-   if (sigqueue_get(queue, sig, ksi) == 0) {
+   td-td_dbgksi.ksi_signo = 0;
+   if (sigqueue_get(queue, sig, td-td_dbgksi) == 0) {
queue = p-p_sigqueue;
-   sigqueue_get(queue, sig, ksi);
+   sigqueue_get(queue, sig, td-td_dbgksi);
}
 
mtx_unlock(ps-ps_mtx);
@@ -2590,13 +2589,13 @@ issignal(struct thread *td, int stop_all
continue;
signotify(td);
} else {
-   if (ksi.ksi_signo != 0) {
-   ksi.ksi_flags |= KSI_HEAD;
+   if (td-td_dbgksi.ksi_signo != 0) {
+   td-td_dbgksi.ksi_flags |= KSI_HEAD;
if (sigqueue_add(td-td_sigqueue, sig,
-   ksi) != 0)
-   ksi.ksi_signo = 0;
+   td-td_dbgksi) != 0)
+   td-td_dbgksi.ksi_signo = 0;
}
-   if (ksi.ksi_signo == 0)
+   if (td-td_dbgksi.ksi_signo == 0)
sigqueue_add(td-td_sigqueue, sig,
NULL);
}

Modified: stable/8/sys/kern/sys_process.c
==
--- stable/8/sys/kern/sys_process.c Wed Nov  3 21:21:12 2010
(r214755)
+++ stable/8/sys/kern/sys_process.c Wed Nov  3 21:24:21 2010
(r214756)
@@ -63,6 +63,7 @@ __FBSDID($FreeBSD$);
 
 #ifdef COMPAT_FREEBSD32
 #include sys/procfs.h
+#include compat/freebsd32/freebsd32_signal.h
 
 struct ptrace_io_desc32 {
int piod_op;
@@ -84,6 +85,15 @@ struct ptrace_vm_entry32 {
uint32_tpve_path;
 };
 
+struct ptrace_lwpinfo32 {
+   lwpid_t pl_lwpid;   /* LWP described. */
+   int pl_event;   /* Event that stopped the LWP. */
+   int pl_flags;   /* LWP flags. */
+   sigset_tpl_sigmask; /* LWP signal mask */
+   sigset_tpl_siglist; /* LWP pending signal */
+   struct siginfo32 pl_siginfo;/* siginfo for signal */
+};
+
 #endif
 
 /*
@@ -495,6 +505,19 @@ ptrace_vm_entry32(struct thread *td, str
pve32-pve_pathlen = pve.pve_pathlen;
return (error);
 }
+
+static void
+ptrace_lwpinfo_to32(const struct ptrace_lwpinfo *pl,
+struct ptrace_lwpinfo32 *pl32)
+{
+
+   pl32-pl_lwpid = pl-pl_lwpid;
+   pl32-pl_event = pl-pl_event;
+   pl32-pl_flags = pl-pl_flags;
+   pl32-pl_sigmask = pl-pl_sigmask;
+   pl32-pl_siglist = pl-pl_siglist;
+   siginfo_to_siginfo32(pl-pl_siginfo, pl32-pl_siginfo);
+}
 #endif /* COMPAT_FREEBSD32 */
 
 /*
@@ -549,6 +572,7 @@ ptrace(struct thread *td, struct ptrace_
struct fpreg32 fpreg32;
struct reg32 reg32;
struct ptrace_io_desc32 piod32;
+   struct ptrace_lwpinfo32 pl32;
struct ptrace_vm_entry32 pve32;
 #endif
} r;
@@ -659,6 +683,8 @@ kern_ptrace(struct thread *td, int req, 
 #ifdef COMPAT_FREEBSD32
int wrap32 = 0, safe = 0;
struct ptrace_io_desc32 *piod32 = NULL;
+   struct ptrace_lwpinfo32 

svn commit: r214757 - stable/8/lib/libc/sys

2010-11-03 Thread Konstantin Belousov
Author: kib
Date: Wed Nov  3 21:31:03 2010
New Revision: 214757
URL: http://svn.freebsd.org/changeset/base/214757

Log:
  MFC r208513:
  Improve the documentation for PT_LWPINFO. Note that some features are
  not implemented on MIPS and ARM.

Modified:
  stable/8/lib/libc/sys/ptrace.2
Directory Properties:
  stable/8/lib/libc/   (props changed)
  stable/8/lib/libc/locale/   (props changed)
  stable/8/lib/libc/stdtime/   (props changed)
  stable/8/lib/libc/sys/   (props changed)

Modified: stable/8/lib/libc/sys/ptrace.2
==
--- stable/8/lib/libc/sys/ptrace.2  Wed Nov  3 21:24:21 2010
(r214756)
+++ stable/8/lib/libc/sys/ptrace.2  Wed Nov  3 21:31:03 2010
(r214757)
@@ -2,7 +2,7 @@
 .\$NetBSD: ptrace.2,v 1.2 1995/02/27 12:35:37 cgd Exp $
 .\
 .\ This file is in the public domain.
-.Dd February 11, 2010
+.Dd May 24, 2010
 .Dt PTRACE 2
 .Os
 .Sh NAME
@@ -289,8 +289,11 @@ argument specifies a pointer to a
 which is defined as follows:
 .Bd -literal
 struct ptrace_lwpinfo {
-   lwpid_t pl_lwpid;   /* LWP described. */
-   int pl_event;   /* Event received. */
+   lwpid_t pl_lwpid;
+   int pl_event;
+   int pl_flags;
+   sigset_t pl_sigmask;
+   sigset_t pl_siglist;
 };
 .Ed
 .Pp
@@ -298,6 +301,51 @@ The
 .Fa data
 argument is to be set to the size of the structure known to the caller.
 This allows the structure to grow without affecting older programs.
+.Pp
+The fields in the
+.Vt struct ptrace_lwpinfo
+have the following meaning:
+.Bl -tag -width indent -compact
+.It pl_lwpid
+LWP id of the thread
+.It pl_event
+Event that caused the stop.
+Currently defined events are
+.Bl -tag -width indent -compact
+.It PL_EVENT_NONE
+No reason given
+.It PL_EVENT_SIGNAL
+Thread stopped due to the pending signal
+.El
+.It pl_flags
+Flags that specify additional details about observed stop.
+Currently defined flags are:
+.Bl -tag -width indent -compact
+.It PL_FLAG_SCE
+The thread stopped due to system call entry, right after the kernel is entered.
+The debugger may examine syscall arguments that are stored in memory and
+registers according to the ABI of the current process, and modify them,
+if needed.
+.It PL_FLAG_SCX
+The thread is stopped immediately before syscall is returning to the usermode.
+The debugger may examine system call return values in the ABI-defined registers
+and/or memory.
+.It PL_FLAG_EXEC
+When
+.Dv PL_FLAG_SCX
+is set, this flag may be additionally specified to inform that the
+program being executed by debuggee process has been changed by succesful
+execution of a system call from the
+.Fn execve 2
+family.
+.El
+.It pl_sigmask
+The current signal mask of the LWP
+.It pl_siglist
+The current pending set of signals for the LWP. Note that signals that
+are delivered to the process would not appear on an LWP siglist until
+the thread is selected for delivery.
+.El
 .It PT_GETNUMLWPS
 This request returns the number of kernel threads associated with the
 traced process.
@@ -501,3 +549,10 @@ The
 .Fn ptrace
 function appeared in
 .At v7 .
+.Sh BUGS
+The
+.Dv PL_FLAG_SCE ,
+.Dv PL_FLAG_SCX
+and
+.Dv PL_FLAG_EXEC
+are not implemented for MIPS and ARM architectures.
___
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: r214758 - stable/8/lib/libc/sys

2010-11-03 Thread Konstantin Belousov
Author: kib
Date: Wed Nov  3 21:32:31 2010
New Revision: 214758
URL: http://svn.freebsd.org/changeset/base/214758

Log:
  MFC r209873:
  Document pl_siginfo and PT_FLAG_SI for PT_LWPINFO.

Modified:
  stable/8/lib/libc/sys/ptrace.2
Directory Properties:
  stable/8/lib/libc/   (props changed)
  stable/8/lib/libc/locale/   (props changed)
  stable/8/lib/libc/stdtime/   (props changed)
  stable/8/lib/libc/sys/   (props changed)

Modified: stable/8/lib/libc/sys/ptrace.2
==
--- stable/8/lib/libc/sys/ptrace.2  Wed Nov  3 21:31:03 2010
(r214757)
+++ stable/8/lib/libc/sys/ptrace.2  Wed Nov  3 21:32:31 2010
(r214758)
@@ -2,7 +2,7 @@
 .\$NetBSD: ptrace.2,v 1.2 1995/02/27 12:35:37 cgd Exp $
 .\
 .\ This file is in the public domain.
-.Dd May 24, 2010
+.Dd July 10, 2010
 .Dt PTRACE 2
 .Os
 .Sh NAME
@@ -294,6 +294,7 @@ struct ptrace_lwpinfo {
int pl_flags;
sigset_t pl_sigmask;
sigset_t pl_siglist;
+   siginfo_t pl_siginfo;
 };
 .Ed
 .Pp
@@ -338,13 +339,28 @@ program being executed by debuggee proce
 execution of a system call from the
 .Fn execve 2
 family.
+.It PL_FLAG_SI
+Indicates that
+.Va pl_siginfo
+member of
+.Vt struct ptrace_lwpinfo
+contains valid information.
 .El
 .It pl_sigmask
 The current signal mask of the LWP
 .It pl_siglist
-The current pending set of signals for the LWP. Note that signals that
-are delivered to the process would not appear on an LWP siglist until
-the thread is selected for delivery.
+The current pending set of signals for the LWP.
+Note that signals that are delivered to the process would not appear
+on an LWP siglist until the thread is selected for delivery.
+.It pl_siginfo
+The siginfo that accompanies the signal pending.
+Only valid for
+.Dv PL_EVENT_SIGNAL
+kind of stop, when
+.Va pl_flags
+has
+.Dv PL_FLAG_SI
+set.
 .El
 .It PT_GETNUMLWPS
 This request returns the number of kernel threads associated with the
___
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: r214759 - stable/8/lib/libthread_db

2010-11-03 Thread Konstantin Belousov
Author: kib
Date: Wed Nov  3 21:39:11 2010
New Revision: 214759
URL: http://svn.freebsd.org/changeset/base/214759

Log:
  MFC r209689:
  Extend the td_thrinfo_t to include siginfo for the signal that stopped
  the target.

Modified:
  stable/8/lib/libthread_db/Symbol.map
  stable/8/lib/libthread_db/libpthread_db.c
  stable/8/lib/libthread_db/libthr_db.c
  stable/8/lib/libthread_db/thread_db.c
  stable/8/lib/libthread_db/thread_db.h
  stable/8/lib/libthread_db/thread_db_int.h
Directory Properties:
  stable/8/lib/libthread_db/   (props changed)

Modified: stable/8/lib/libthread_db/Symbol.map
==
--- stable/8/lib/libthread_db/Symbol.mapWed Nov  3 21:32:31 2010
(r214758)
+++ stable/8/lib/libthread_db/Symbol.mapWed Nov  3 21:39:11 2010
(r214759)
@@ -19,7 +19,6 @@ FBSD_1.0 {
td_thr_dbsuspend;
td_thr_event_enable;
td_thr_event_getmsg;
-   td_thr_get_info;
td_thr_getfpregs;
td_thr_getgregs;
 #if defined(i386)
@@ -33,3 +32,7 @@ FBSD_1.0 {
td_thr_tls_get_addr;
td_thr_validate;
 };
+
+FBSD_1.2 {
+   td_thr_get_info;
+};

Modified: stable/8/lib/libthread_db/libpthread_db.c
==
--- stable/8/lib/libthread_db/libpthread_db.c   Wed Nov  3 21:32:31 2010
(r214758)
+++ stable/8/lib/libthread_db/libpthread_db.c   Wed Nov  3 21:39:11 2010
(r214759)
@@ -570,7 +570,7 @@ pt_thr_validate(const td_thrhandle_t *th
 }
 
 static td_err_e
-pt_thr_get_info(const td_thrhandle_t *th, td_thrinfo_t *info)
+pt_thr_old_get_info(const td_thrhandle_t *th, td_old_thrinfo_t *info)
 {
const td_thragent_t *ta = th-th_ta;
struct ptrace_lwpinfo linfo;
@@ -659,6 +659,16 @@ pt_thr_get_info(const td_thrhandle_t *th
return (0);
 }
 
+static td_err_e
+pt_thr_get_info(const td_thrhandle_t *th, td_thrinfo_t *info)
+{
+   td_err_e e;
+
+   e = pt_thr_old_get_info(th, (td_old_thrinfo_t *)info);
+   bzero(info-ti_siginfo, sizeof(info-ti_siginfo));
+   return (e);
+}
+
 #ifdef __i386__
 static td_err_e
 pt_thr_getxmmregs(const td_thrhandle_t *th, char *fxsave)
@@ -1114,6 +1124,7 @@ struct ta_ops libpthread_db_ops = {
.to_thr_dbsuspend   = pt_thr_dbsuspend,
.to_thr_event_enable= pt_thr_event_enable,
.to_thr_event_getmsg= pt_thr_event_getmsg,
+   .to_thr_old_get_info= pt_thr_old_get_info,
.to_thr_get_info= pt_thr_get_info,
.to_thr_getfpregs   = pt_thr_getfpregs,
.to_thr_getgregs= pt_thr_getgregs,

Modified: stable/8/lib/libthread_db/libthr_db.c
==
--- stable/8/lib/libthread_db/libthr_db.c   Wed Nov  3 21:32:31 2010
(r214758)
+++ stable/8/lib/libthread_db/libthr_db.c   Wed Nov  3 21:39:11 2010
(r214759)
@@ -453,7 +453,7 @@ pt_thr_validate(const td_thrhandle_t *th
 }
 
 static td_err_e
-pt_thr_get_info(const td_thrhandle_t *th, td_thrinfo_t *info)
+pt_thr_get_info_common(const td_thrhandle_t *th, td_thrinfo_t *info, int old)
 {
const td_thragent_t *ta = th-th_ta;
struct ptrace_lwpinfo linfo;
@@ -489,6 +489,13 @@ pt_thr_get_info(const td_thrhandle_t *th
if (ret == PS_OK) {
info-ti_sigmask = linfo.pl_sigmask;
info-ti_pending = linfo.pl_siglist;
+   if (!old) {
+   if ((linfo.pl_flags  PL_FLAG_SI) != 0)
+   info-ti_siginfo = linfo.pl_siginfo;
+   else
+   bzero(info-ti_siginfo,
+   sizeof(info-ti_siginfo));
+   }
} else
return (ret);
if (state == ta-thread_state_running)
@@ -501,6 +508,20 @@ pt_thr_get_info(const td_thrhandle_t *th
return (0);
 }
 
+static td_err_e
+pt_thr_old_get_info(const td_thrhandle_t *th, td_old_thrinfo_t *info)
+{
+
+   return (pt_thr_get_info_common(th, (td_thrinfo_t *)info, 1));
+}
+
+static td_err_e
+pt_thr_get_info(const td_thrhandle_t *th, td_thrinfo_t *info)
+{
+
+   return (pt_thr_get_info_common(th, info, 0));
+}
+
 #ifdef __i386__
 static td_err_e
 pt_thr_getxmmregs(const td_thrhandle_t *th, char *fxsave)
@@ -761,6 +782,7 @@ struct ta_ops libthr_db_ops = {
.to_thr_dbsuspend   = pt_thr_dbsuspend,
.to_thr_event_enable= pt_thr_event_enable,
.to_thr_event_getmsg= pt_thr_event_getmsg,
+   .to_thr_old_get_info= pt_thr_old_get_info,
.to_thr_get_info= pt_thr_get_info,
.to_thr_getfpregs   = pt_thr_getfpregs,
.to_thr_getgregs= pt_thr_getgregs,

Modified: stable/8/lib/libthread_db/thread_db.c
==
--- stable/8/lib/libthread_db/thread_db.c   Wed Nov  3 

svn commit: r214760 - stable/8/gnu/usr.bin/gdb/libgdb

2010-11-03 Thread Konstantin Belousov
Author: kib
Date: Wed Nov  3 21:40:57 2010
New Revision: 214760
URL: http://svn.freebsd.org/changeset/base/214760

Log:
  MFC r209690:
  For thread signal command, print some information from siginfo when
  available.

Modified:
  stable/8/gnu/usr.bin/gdb/libgdb/fbsd-threads.c
Directory Properties:
  stable/8/gnu/usr.bin/gdb/   (props changed)
  stable/8/gnu/usr.bin/gdb/kgdb/   (props changed)

Modified: stable/8/gnu/usr.bin/gdb/libgdb/fbsd-threads.c
==
--- stable/8/gnu/usr.bin/gdb/libgdb/fbsd-threads.c  Wed Nov  3 21:39:11 
2010(r214759)
+++ stable/8/gnu/usr.bin/gdb/libgdb/fbsd-threads.c  Wed Nov  3 21:40:57 
2010(r214760)
@@ -1299,6 +1299,7 @@ fbsd_thread_signal_cmd (char *exp, int f
   td_thrhandle_t th;
   td_thrinfo_t ti;
   td_err_e err;
+  const char *code;
 
   if (!fbsd_thread_active || !IS_THREAD(inferior_ptid))
 return;
@@ -1315,6 +1316,42 @@ fbsd_thread_signal_cmd (char *exp, int f
   fbsd_print_sigset(ti.ti_sigmask);
   printf_filtered(signal pending:\n);
   fbsd_print_sigset(ti.ti_pending);
+  if (ti.ti_siginfo.si_signo != 0) {
+   printf_filtered(si_signo %d si_errno %d, ti.ti_siginfo.si_signo,
+ ti.ti_siginfo.si_errno);
+   if (ti.ti_siginfo.si_errno != 0)
+printf_filtered( (%s), strerror(ti.ti_siginfo.si_errno));
+   printf_filtered(\n);
+   switch (ti.ti_siginfo.si_code) {
+   case SI_NOINFO:
+   code = NOINFO;
+   break;
+case SI_USER:
+   code = USER;
+   break;
+case SI_QUEUE:
+   code = QUEUE;
+   break;
+case SI_TIMER:
+   code = TIMER;
+   break;
+case SI_ASYNCIO:
+   code = ASYNCIO;
+   break;
+case SI_MESGQ:
+   code = MESGQ;
+   break;
+case SI_KERNEL:
+   code = KERNEL;
+   break;
+default:
+   code = UNKNOWN;
+   break;
+}
+printf_filtered(si_code %s si_pid %d si_uid %d si_status %x si_addr %p\n,
+  code, ti.ti_siginfo.si_pid, ti.ti_siginfo.si_uid, 
ti.ti_siginfo.si_status,
+  ti.ti_siginfo.si_addr);
+  }
 }
 
 static int
___
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: r214761 - in head/sys/dev/usb: net serial

2010-11-03 Thread Nick Hibma
Author: n_hibma
Date: Wed Nov  3 21:50:49 2010
New Revision: 214761
URL: http://svn.freebsd.org/changeset/base/214761

Log:
  - Simplify the way unit/subunit allocation is done in ucom.
  - hw.usb.ucom.cons_unit is now split into
hw.usb.ucom.cons_unit/...cons_subunit.
  
  Note: The tunable/sysctl hw.usb.ucom.cons_unit needs to be reviewed if
  
  a) a console was defined a USB serial devices, and a USB device with
  more than 1 subunit is present, and this device is attached before the
  device functioning as a console
  
  or
  
  b) a console was defined on a USB device with more than 1 subunit
  
  Reviewed by:  hps
  MFC after:2 weeks

Modified:
  head/sys/dev/usb/net/uhso.c
  head/sys/dev/usb/serial/u3g.c
  head/sys/dev/usb/serial/uark.c
  head/sys/dev/usb/serial/ubsa.c
  head/sys/dev/usb/serial/ubser.c
  head/sys/dev/usb/serial/uchcom.c
  head/sys/dev/usb/serial/ucycom.c
  head/sys/dev/usb/serial/ufoma.c
  head/sys/dev/usb/serial/uftdi.c
  head/sys/dev/usb/serial/ugensa.c
  head/sys/dev/usb/serial/uipaq.c
  head/sys/dev/usb/serial/umct.c
  head/sys/dev/usb/serial/umodem.c
  head/sys/dev/usb/serial/umoscom.c
  head/sys/dev/usb/serial/uplcom.c
  head/sys/dev/usb/serial/usb_serial.c
  head/sys/dev/usb/serial/usb_serial.h
  head/sys/dev/usb/serial/uslcom.c
  head/sys/dev/usb/serial/uvisor.c
  head/sys/dev/usb/serial/uvscom.c

Modified: head/sys/dev/usb/net/uhso.c
==
--- head/sys/dev/usb/net/uhso.c Wed Nov  3 21:40:57 2010(r214760)
+++ head/sys/dev/usb/net/uhso.c Wed Nov  3 21:50:49 2010(r214761)
@@ -633,11 +633,10 @@ uhso_attach(device_t self)
 
ht-ht_name[0] = 0;
if (sc-sc_ttys == 1)
-   snprintf(ht-ht_name, 32, cuaU%d, ucom-sc_unit);
+   snprintf(ht-ht_name, 32, cuaU%d, 
ucom-sc_super-sc_unit);
else {
snprintf(ht-ht_name, 32, cuaU%d.%d,
-   ucom-sc_unit - ucom-sc_local_unit,
-   ucom-sc_local_unit);
+   ucom-sc_super-sc_unit, ucom-sc_subunit);
}
 
desc = uhso_port_type[port];
@@ -666,7 +665,7 @@ uhso_detach(device_t self)
usbd_transfer_unsetup(sc-sc_xfer, 3);
usbd_transfer_unsetup(sc-sc_ctrl_xfer, UHSO_CTRL_MAX);
if (sc-sc_ttys  0) {
-   ucom_detach(sc-sc_super_ucom, sc-sc_ucom, sc-sc_ttys);
+   ucom_detach(sc-sc_super_ucom, sc-sc_ucom);
 
for (i = 0; i  sc-sc_ttys; i++) {
if (sc-sc_tty[i].ht_muxport != -1) {
@@ -1448,11 +1447,11 @@ uhso_ucom_start_read(struct ucom_softc *
 {
struct uhso_softc *sc = ucom-sc_parent;
 
-   UHSO_DPRINTF(3, unit=%d, local_unit=%d\n,
-   ucom-sc_unit, ucom-sc_local_unit);
+   UHSO_DPRINTF(3, unit=%d, subunit=%d\n,
+   ucom-sc_super-sc_unit, ucom-sc_subunit);
 
if (UHSO_IFACE_USB_TYPE(sc-sc_type)  UHSO_IF_MUX) {
-   sc-sc_tty[ucom-sc_local_unit].ht_open = 1;
+   sc-sc_tty[ucom-sc_subunit].ht_open = 1;
usbd_transfer_start(sc-sc_xfer[UHSO_MUX_ENDPT_INTR]);
}
else if (UHSO_IFACE_USB_TYPE(sc-sc_type)  UHSO_IF_BULK) {
@@ -1470,9 +1469,9 @@ uhso_ucom_stop_read(struct ucom_softc *u
struct uhso_softc *sc = ucom-sc_parent;
 
if (UHSO_IFACE_USB_TYPE(sc-sc_type)  UHSO_IF_MUX) {
-   sc-sc_tty[ucom-sc_local_unit].ht_open = 0;
+   sc-sc_tty[ucom-sc_subunit].ht_open = 0;
usbd_transfer_stop(
-   sc-sc_tty[ucom-sc_local_unit].ht_xfer[UHSO_CTRL_READ]);
+   sc-sc_tty[ucom-sc_subunit].ht_xfer[UHSO_CTRL_READ]);
}
else if (UHSO_IFACE_USB_TYPE(sc-sc_type)  UHSO_IF_BULK) {
sc-sc_tty[0].ht_open = 0;
@@ -1488,15 +1487,15 @@ uhso_ucom_start_write(struct ucom_softc 
struct uhso_softc *sc = ucom-sc_parent;
 
if (UHSO_IFACE_USB_TYPE(sc-sc_type)  UHSO_IF_MUX) {
-   UHSO_DPRINTF(3, local unit %d\n, ucom-sc_local_unit);
+   UHSO_DPRINTF(3, local unit %d\n, ucom-sc_subunit);
 
usbd_transfer_start(sc-sc_xfer[UHSO_MUX_ENDPT_INTR]);
 
usbd_xfer_set_priv(
-   sc-sc_tty[ucom-sc_local_unit].ht_xfer[UHSO_CTRL_WRITE],
-   sc-sc_tty[ucom-sc_local_unit]);
+   sc-sc_tty[ucom-sc_subunit].ht_xfer[UHSO_CTRL_WRITE],
+   sc-sc_tty[ucom-sc_subunit]);
usbd_transfer_start(
-   sc-sc_tty[ucom-sc_local_unit].ht_xfer[UHSO_CTRL_WRITE]);
+   sc-sc_tty[ucom-sc_subunit].ht_xfer[UHSO_CTRL_WRITE]);
 
}
else if (UHSO_IFACE_USB_TYPE(sc-sc_type)  UHSO_IF_BULK) {
@@ -1511,7 +1510,7 @@ uhso_ucom_stop_write(struct ucom_softc *
 
if (UHSO_IFACE_USB_TYPE(sc-sc_type)  UHSO_IF_MUX) {
usbd_transfer_stop(
-

svn commit: r214762 - stable/8/sys/sys

2010-11-03 Thread Konstantin Belousov
Author: kib
Date: Wed Nov  3 21:51:05 2010
New Revision: 214762
URL: http://svn.freebsd.org/changeset/base/214762

Log:
  Bump __FreeBSD_version for struct sysentvec changes in r214755.

Modified:
  stable/8/sys/sys/param.h

Modified: stable/8/sys/sys/param.h
==
--- stable/8/sys/sys/param.hWed Nov  3 21:50:49 2010(r214761)
+++ stable/8/sys/sys/param.hWed Nov  3 21:51:05 2010(r214762)
@@ -58,7 +58,7 @@
  * in the range 5 to 9.
  */
 #undef __FreeBSD_version
-#define __FreeBSD_version 801500   /* Master, propagated to newvers */
+#define __FreeBSD_version 801501   /* Master, propagated to newvers */
 
 #ifndef LOCORE
 #include sys/types.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: r214763 - in stable/8/sys/fs: nfs nfsserver

2010-11-03 Thread Rick Macklem
Author: rmacklem
Date: Wed Nov  3 22:17:42 2010
New Revision: 214763
URL: http://svn.freebsd.org/changeset/base/214763

Log:
  MFC: r214255
  Modify the experimental NFSv4 server's file handle hash function
  to use the generic hash32_buf() function. Although adding the
  bytes seemed sufficient for UFS and ZFS, since most of the bytes
  are the same for file handles on the same volume, this might not
  be sufficient for other file systems. Use of a generic function
  also seems preferable to one specific to NFSv4.

Modified:
  stable/8/sys/fs/nfs/nfs_var.h
  stable/8/sys/fs/nfsserver/nfs_nfsdport.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/fs/nfs/nfs_var.h
==
--- stable/8/sys/fs/nfs/nfs_var.h   Wed Nov  3 21:51:05 2010
(r214762)
+++ stable/8/sys/fs/nfs/nfs_var.h   Wed Nov  3 22:17:42 2010
(r214763)
@@ -578,7 +578,7 @@ void nfsvno_unlockvfs(mount_t);
 int nfsvno_lockvfs(mount_t);
 int nfsrv_v4rootexport(void *, struct ucred *, NFSPROC_T *);
 int nfsvno_testexp(struct nfsrv_descript *, struct nfsexstuff *);
-int nfsrv_hashfh(fhandle_t *);
+uint32_t nfsrv_hashfh(fhandle_t *);
 
 /* nfs_commonkrpc.c */
 int newnfs_nmcancelreqs(struct nfsmount *);

Modified: stable/8/sys/fs/nfsserver/nfs_nfsdport.c
==
--- stable/8/sys/fs/nfsserver/nfs_nfsdport.cWed Nov  3 21:51:05 2010
(r214762)
+++ stable/8/sys/fs/nfsserver/nfs_nfsdport.cWed Nov  3 22:17:42 2010
(r214763)
@@ -41,6 +41,7 @@ __FBSDID($FreeBSD$);
  */
 
 #include fs/nfs/nfsport.h
+#include sys/hash.h
 #include sys/sysctl.h
 #include nlm/nlm_prot.h
 #include nlm/nlm.h
@@ -3090,15 +3091,12 @@ nfsvno_testexp(struct nfsrv_descript *nd
 /*
  * Calculate a hash value for the fid in a file handle.
  */
-int
+uint32_t
 nfsrv_hashfh(fhandle_t *fhp)
 {
-   int hashval = 0, i;
-   uint8_t *cp;
+   uint32_t hashval;
 
-   cp = (uint8_t *)fhp-fh_fid;
-   for (i = 0; i  sizeof(struct fid); i++)
-   hashval += *cp++;
+   hashval = hash32_buf(fhp-fh_fid, sizeof(struct fid), 0);
return (hashval);
 }
 
___
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: r214765 - head/sys/dev/acpica

2010-11-03 Thread Jung-uk Kim
Author: jkim
Date: Wed Nov  3 23:16:35 2010
New Revision: 214765
URL: http://svn.freebsd.org/changeset/base/214765

Log:
  Adjust a comment to clarify why \_SB_ and \_TZ_ are defined as device type
  in ACPICA.  Reshuffle the code a bit to make sure this kludge only applies
  to these two specical cases and to make it cleaner.

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

Modified: head/sys/dev/acpica/acpi.c
==
--- head/sys/dev/acpica/acpi.c  Wed Nov  3 22:21:21 2010(r214764)
+++ head/sys/dev/acpica/acpi.c  Wed Nov  3 23:16:35 2010(r214765)
@@ -1673,38 +1673,36 @@ acpi_probe_child(ACPI_HANDLE handle, UIN
 ACPI_OBJECT_TYPE type;
 ACPI_HANDLE h;
 device_t bus, child;
+char *handle_str;
 int order;
-char *handle_str, **search;
-static char *scopes[] = {\\_PR_, \\_TZ_, \\_SI_, \\_SB_, NULL};
 
 ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__);
 
+if (acpi_disabled(children))
+   return_ACPI_STATUS (AE_OK);
+
 /* Skip this device if we think we'll have trouble with it. */
 if (acpi_avoid(handle))
return_ACPI_STATUS (AE_OK);
 
 bus = (device_t)context;
 if (ACPI_SUCCESS(AcpiGetType(handle, type))) {
+   handle_str = acpi_name(handle);
switch (type) {
case ACPI_TYPE_DEVICE:
-   case ACPI_TYPE_PROCESSOR:
-   case ACPI_TYPE_THERMAL:
-   case ACPI_TYPE_POWER:
-   if (acpi_disabled(children))
-   break;
-
/*
 * Since we scan from \, be sure to skip system scope objects.
-* At least \_SB and \_TZ are detected as devices (ACPI-CA bug?)
+* \_SB_ and \_TZ_ are defined in ACPICA as devices to work around
+* BIOS bugs.  For example, \_SB_ is to allow \_SB._INI to be run
+* during the intialization and \_TZ_ is to support Notify() on it.
 */
-   handle_str = acpi_name(handle);
-   for (search = scopes; *search != NULL; search++) {
-   if (strcmp(handle_str, *search) == 0)
-   break;
-   }
-   if (*search != NULL)
+   if (strcmp(handle_str, \\_SB_) == 0 ||
+   strcmp(handle_str, \\_TZ_) == 0)
break;
-
+   /* FALLTHROUGH */
+   case ACPI_TYPE_PROCESSOR:
+   case ACPI_TYPE_THERMAL:
+   case ACPI_TYPE_POWER:
/* 
 * Create a placeholder device for this node.  Sort the
 * placeholder so that the probe/attach passes will run
___
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: r214766 - head/sys/mips/cavium

2010-11-03 Thread Juli Mallett
Author: jmallett
Date: Wed Nov  3 23:29:52 2010
New Revision: 214766
URL: http://svn.freebsd.org/changeset/base/214766

Log:
  Don't attach the PCI bus driver if the board we're being run on has PCIe.  The
  two are mutually-exclusive on Octeon.

Modified:
  head/sys/mips/cavium/octopci.c

Modified: head/sys/mips/cavium/octopci.c
==
--- head/sys/mips/cavium/octopci.c  Wed Nov  3 23:16:35 2010
(r214765)
+++ head/sys/mips/cavium/octopci.c  Wed Nov  3 23:29:52 2010
(r214766)
@@ -108,6 +108,8 @@ octopci_probe(device_t dev)
 {
if (device_get_unit(dev) != 0)
return (ENXIO);
+   if (octeon_has_feature(OCTEON_FEATURE_PCIE))
+   return (ENXIO);
/* XXX Check sysinfo flag.  */
device_set_desc(dev, Cavium Octeon PCI bridge);
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