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

2009-05-14 Thread VANHULLEBUS Yvan
Author: vanhu
Date: Thu May 14 07:32:33 2009
New Revision: 192088
URL: http://svn.freebsd.org/changeset/base/192088

Log:
  MFC: Fixed deletion of sav entries in key_delsah()
  
  Approved by:  gnn(mentor)
  Obtained from:NETASQ

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

Modified: stable/7/sys/netipsec/key.c
==
--- stable/7/sys/netipsec/key.c Thu May 14 06:50:30 2009(r192087)
+++ stable/7/sys/netipsec/key.c Thu May 14 07:32:33 2009(r192088)
@@ -2654,7 +2654,12 @@ key_delsah(sah)
if (sav-refcnt == 0) {
/* sanity check */
KEY_CHKSASTATE(state, sav-state, __func__);
-   KEY_FREESAV(sav);
+   /* 
+* do NOT call KEY_FREESAV here:
+* it will only delete the sav if refcnt == 1,
+* where we already know that refcnt == 0
+*/
+   key_delsav(sav);
} else {
/* give up to delete this sa */
zombie++;
@@ -4086,6 +4091,7 @@ key_flush_sad(time_t now)
 
/* if LARVAL entry doesn't become MATURE, delete it. */
LIST_FOREACH_SAFE(sav, sah-savtree[SADB_SASTATE_LARVAL], 
chain, nextsav) {
+   /* Need to also check refcnt for a larval SA ??? */
if (now - sav-created  key_larval_lifetime)
KEY_FREESAV(sav);
}
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r192089 - head/etc/defaults

2009-05-14 Thread Craig Rodrigues
Author: rodrigc
Date: Thu May 14 08:26:20 2009
New Revision: 192089
URL: http://svn.freebsd.org/changeset/base/192089

Log:
  Set crashinfo_enable to YES by default.
  During bootup, if /etc/rc.d/savecore detects a core dump file
  on the dump device, the core file will be saved, and the crashinfo
  script will be run to generate a human-readable report.
  
  This will make it easier for end-users to provide feedback to
  developers about kernel crashes.
  
  Reviewed by:  jhb

Modified:
  head/etc/defaults/rc.conf

Modified: head/etc/defaults/rc.conf
==
--- head/etc/defaults/rc.conf   Thu May 14 07:32:33 2009(r192088)
+++ head/etc/defaults/rc.conf   Thu May 14 08:26:20 2009(r192089)
@@ -543,7 +543,7 @@ chkprintcap_flags=-d  # Create missing 
 dumpdev=AUTO # Device to crashdump to (device name, AUTO, or NO).
 dumpdir=/var/crash   # Directory where crash dumps are to be stored
 savecore_flags=  # Used if dumpdev is enabled above, and present.
-crashinfo_enable=NO  # Automatically generate crash dump summary.
+crashinfo_enable=YES # Automatically generate crash dump summary.
 crashinfo_program=/usr/sbin/crashinfo# Script to generate crash dump 
summary.
 quota_enable=NO  # turn on quotas on startup (or NO).
 check_quotas=YES # Check quotas on startup (or NO).
___
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: r192090 - head/sys/compat/ndis

2009-05-14 Thread Christian Brueffer
Author: brueffer
Date: Thu May 14 09:28:02 2009
New Revision: 192090
URL: http://svn.freebsd.org/changeset/base/192090

Log:
  Remove an unused variable.
  
  Found with:   Coverity Prevent(tm)
  CID:  1167

Modified:
  head/sys/compat/ndis/subr_ndis.c

Modified: head/sys/compat/ndis/subr_ndis.c
==
--- head/sys/compat/ndis/subr_ndis.cThu May 14 08:26:20 2009
(r192089)
+++ head/sys/compat/ndis/subr_ndis.cThu May 14 09:28:02 2009
(r192090)
@@ -2390,11 +2390,9 @@ NdisMDeregisterInterrupt(intr)
ndis_miniport_interrupt *intr;
 {
ndis_miniport_block *block;
-   struct ndis_softc   *sc;
uint8_t irql;
 
block = intr-ni_block;
-   sc = device_get_softc(block-nmb_physdeviceobj-do_devext);
 
/* Should really be KeSynchronizeExecution() */
 
___
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: r192095 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb kern

2009-05-14 Thread Konstantin Belousov
Author: kib
Date: Thu May 14 11:03:05 2009
New Revision: 192095
URL: http://svn.freebsd.org/changeset/base/192095

Log:
  MFC r192001:
  Prevent overflow of uio_resid.

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

Modified: stable/7/sys/kern/vfs_syscalls.c
==
--- stable/7/sys/kern/vfs_syscalls.cThu May 14 10:54:57 2009
(r192094)
+++ stable/7/sys/kern/vfs_syscalls.cThu May 14 11:03:05 2009
(r192095)
@@ -2360,6 +2360,9 @@ kern_readlink(struct thread *td, char *p
struct nameidata nd;
int vfslocked;
 
+   if (count  INT_MAX)
+   return (EINVAL);
+
NDINIT(nd, LOOKUP, NOFOLLOW | LOCKSHARED | LOCKLEAF | MPSAFE |
AUDITVNODE1, pathseg, path, td);
if ((error = namei(nd)) != 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: r192096 - head/sys/conf

2009-05-14 Thread Robert Watson
Author: rwatson
Date: Thu May 14 12:39:22 2009
New Revision: 192096
URL: http://svn.freebsd.org/changeset/base/192096

Log:
  Remove usb_ethersubr.c missed reference -- we don't build ousb
  with LINT, so the tinderbox didn't pick this up.

Modified:
  head/sys/conf/files

Modified: head/sys/conf/files
==
--- head/sys/conf/files Thu May 14 11:03:05 2009(r192095)
+++ head/sys/conf/files Thu May 14 12:39:22 2009(r192096)
@@ -1535,7 +1535,6 @@ legacy/dev/usb/ums.c  optional oums
 legacy/dev/usb/uplcom.coptional ouplcom
 legacy/dev/usb/urio.c  optional ourio
 legacy/dev/usb/usb.c   optional ousb
-legacy/dev/usb/usb_ethersubr.c optional ousb
 legacy/dev/usb/usb_if.moptional ousb
 legacy/dev/usb/usb_mem.c   optional ousb
 legacy/dev/usb/usb_quirks.coptional ousb
___
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: r192097 - head/sys/dev/iir

2009-05-14 Thread Christian Brueffer
Author: brueffer
Date: Thu May 14 13:32:33 2009
New Revision: 192097
URL: http://svn.freebsd.org/changeset/base/192097

Log:
  Compare the correct variable against NULL.
  
  Reviewed by:  scottl
  Found with:   Coverity Prevent(tm)
  CID:  821
  MFC after:2 weeks

Modified:
  head/sys/dev/iir/iir_pci.c

Modified: head/sys/dev/iir/iir_pci.c
==
--- head/sys/dev/iir/iir_pci.c  Thu May 14 12:39:22 2009(r192096)
+++ head/sys/dev/iir/iir_pci.c  Thu May 14 13:32:33 2009(r192097)
@@ -202,7 +202,7 @@ iir_pci_attach(device_t dev)
 rid = 0;
 irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, rid,
  RF_ACTIVE | RF_SHAREABLE);
-if (io == NULL) {
+if (irq == NULL) {
 device_printf(dev, can't find IRQ value\n);
 error = ENOMEM;
 goto err;
___
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: r192098 - in stable/6: gnu/usr.bin/gdb/libgdb lib/libthr/thread lib/libthread_db lib/libthread_db/arch/alpha lib/libthread_db/arch/amd64 lib/libthread_db/arch/i386 lib/libthread_db/arch...

2009-05-14 Thread Attilio Rao
Author: attilio
Date: Thu May 14 13:36:39 2009
New Revision: 192098
URL: http://svn.freebsd.org/changeset/base/192098

Log:
  MFC libthread_db modifies until r181651:
  - Introduce and use new functions pthread_{read, write}_*
  - Move psaddr_t from void * to uintptr_t
  - Fix some ABI mismatches
  - Introduce WARN 6 for compilation

Added:
  stable/6/lib/libthread_db/libc_r_db.h   (contents, props changed)
Modified:
  stable/6/gnu/usr.bin/gdb/libgdb/fbsd-threads.c
  stable/6/lib/libthr/thread/thr_event.c
  stable/6/lib/libthread_db/Makefile
  stable/6/lib/libthread_db/arch/alpha/libc_r_md.c
  stable/6/lib/libthread_db/arch/alpha/libpthread_md.c
  stable/6/lib/libthread_db/arch/amd64/libc_r_md.c
  stable/6/lib/libthread_db/arch/amd64/libpthread_md.c
  stable/6/lib/libthread_db/arch/i386/libc_r_md.c
  stable/6/lib/libthread_db/arch/i386/libpthread_md.c
  stable/6/lib/libthread_db/arch/ia64/libc_r_md.c
  stable/6/lib/libthread_db/arch/ia64/libpthread_md.c
  stable/6/lib/libthread_db/arch/sparc64/libc_r_md.c
  stable/6/lib/libthread_db/arch/sparc64/libpthread_md.c
  stable/6/lib/libthread_db/libc_r_db.c
  stable/6/lib/libthread_db/libpthread_db.c
  stable/6/lib/libthread_db/libpthread_db.h
  stable/6/lib/libthread_db/libthr_db.c
  stable/6/lib/libthread_db/thread_db.c
  stable/6/lib/libthread_db/thread_db.h
  stable/6/lib/libthread_db/thread_db_int.h
  stable/6/sys/sys/procfs.h

Modified: stable/6/gnu/usr.bin/gdb/libgdb/fbsd-threads.c
==
--- stable/6/gnu/usr.bin/gdb/libgdb/fbsd-threads.c  Thu May 14 13:32:33 
2009(r192097)
+++ stable/6/gnu/usr.bin/gdb/libgdb/fbsd-threads.c  Thu May 14 13:36:39 
2009(r192098)
@@ -710,7 +710,7 @@ check_event (ptid_t ptid)
   error (Cannot get thread event message: %s,
 thread_db_err_str (err));
 }
-  err = td_thr_get_info_p (msg.th_p, ti);
+  err = td_thr_get_info_p ((void*)(uintptr_t)msg.th_p, ti);
   if (err != TD_OK)
 error (Cannot get thread info: %s, thread_db_err_str (err));
   ptid = BUILD_THREAD (ti.ti_tid, GET_PID (ptid));
@@ -720,7 +720,7 @@ check_event (ptid_t ptid)
   /* We may already know about this thread, for instance when the
  user has issued the `info threads' command before the SIGTRAP
  for hitting the thread creation breakpoint was reported.  */
-  attach_thread (ptid, msg.th_p, ti, 1);
+  attach_thread (ptid, (void *)(uintptr_t)msg.th_p, ti, 1);
   break;
case TD_DEATH:
  if (!in_thread_list (ptid))
@@ -1178,13 +1178,14 @@ fbsd_thread_pid_to_str (ptid_t ptid)
 
   if (ti.ti_lid != 0)
 {
-  snprintf (buf, sizeof (buf), Thread %p (LWP %d),
-th.th_thread, ti.ti_lid);
+  snprintf (buf, sizeof (buf), Thread %llx (LWP %d),
+(unsigned long long)th.th_thread, ti.ti_lid);
 }
   else
 {
-  snprintf (buf, sizeof (buf), Thread %p (%s),
-th.th_thread, thread_db_state_str (ti.ti_state));
+  snprintf (buf, sizeof (buf), Thread %llx (%s),
+(unsigned long long)th.th_thread,
+thread_db_state_str (ti.ti_state));
 }
 
   return buf;

Modified: stable/6/lib/libthr/thread/thr_event.c
==
--- stable/6/lib/libthr/thread/thr_event.c  Thu May 14 13:32:33 2009
(r192097)
+++ stable/6/lib/libthr/thread/thr_event.c  Thu May 14 13:36:39 2009
(r192098)
@@ -42,7 +42,7 @@ void
 _thr_report_creation(struct pthread *curthread, struct pthread *newthread)
 {
curthread-event_buf.event = TD_CREATE;
-   curthread-event_buf.th_p = (td_thrhandle_t *)newthread;
+   curthread-event_buf.th_p = (uintptr_t)newthread;
curthread-event_buf.data = 0;
THR_UMTX_LOCK(curthread, _thr_event_lock);
_thread_last_event = curthread;
@@ -55,7 +55,7 @@ void
 _thr_report_death(struct pthread *curthread)
 {
curthread-event_buf.event = TD_DEATH;
-   curthread-event_buf.th_p = (td_thrhandle_t *)curthread;
+   curthread-event_buf.th_p = (uintptr_t)curthread;
curthread-event_buf.data = 0;
THR_UMTX_LOCK(curthread, _thr_event_lock);
_thread_last_event = curthread;

Modified: stable/6/lib/libthread_db/Makefile
==
--- stable/6/lib/libthread_db/Makefile  Thu May 14 13:32:33 2009
(r192097)
+++ stable/6/lib/libthread_db/Makefile  Thu May 14 13:36:39 2009
(r192098)
@@ -9,7 +9,7 @@ SRCS+=  libpthread_db.c libpthread_md.c
 SRCS+= libc_r_db.c libc_r_md.c
 SRCS+= libthr_db.c
 INCS=  thread_db.h
-WARNS?= 1
+WARNS?= 6
 
 CFLAGS+=-I. -I${.CURDIR}
 

Modified: stable/6/lib/libthread_db/arch/alpha/libc_r_md.c

Re: svn commit: r192098 - in stable/6: gnu/usr.bin/gdb/libgdb lib/libthr/thread lib/libthread_db lib/libthread_db/arch/alpha lib/libthread_db/arch/amd64 lib/libthread_db/arch/i386 lib/libthread_db/a

2009-05-14 Thread Attilio Rao
2009/5/14 Attilio Rao atti...@freebsd.org:
 Author: attilio
 Date: Thu May 14 13:36:39 2009
 New Revision: 192098
 URL: http://svn.freebsd.org/changeset/base/192098

 Log:
  MFC libthread_db modifies until r181651:
  - Introduce and use new functions pthread_{read, write}_*
  - Move psaddr_t from void * to uintptr_t
  - Fix some ABI mismatches
  - Introduce WARN 6 for compilation

Forgot to mention:
Reviewed by: emaste, marcel
Tested by: emaste
Sponsored by: Sandvine incorporated

While here, please note that the patch is not still merged back to 7.
It is preferable to wait for tree unfreezing and go-by just when the
release was shipped.

Thanks,
Attilio


-- 
Peace can only be achieved by understanding - A. Einstein
___
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: r192085 - head/sys/netinet

2009-05-14 Thread George Neville-Neil


On May 13, 2009, at 22:27 , Qing Li wrote:


Author: qingli
Date: Thu May 14 05:27:09 2009
New Revision: 192085
URL: http://svn.freebsd.org/changeset/base/192085

Log:
 Ignore the INADDR_ANY address inserted/deleted by DHCP when  
installing a loopback route

 to the interface address.



Hi,

Can you give more detail as to the purpose of this change?  I'm a bit  
confused by it.  Does
this fix any of the recent problems seen with DHCP and PXE or is this  
unrelated?


Best,
George

___
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: r192105 - in head/sys/dev/ata: . chipsets

2009-05-14 Thread John Baldwin
Author: jhb
Date: Thu May 14 14:57:13 2009
New Revision: 192105
URL: http://svn.freebsd.org/changeset/base/192105

Log:
  - Add a void pointer to the ata-pci controller softc to allow
chipset-specific code to attach chipset-specific data.
  - Use chipset-specific data in the acard and promise chipsets rather than
changing the ivars of ATA PCI devices.  ivars are reserved for use by the
parent bus driver and are _not_ available for use by devices directly.
This fixes a panic during sysctl -a with certain Promise controllers with
ACPI enabled.
  
  Reviewed by:  mav
  Tested by:Magnus Kling (kingfon @ gmail) (on 7)
  MFC after:3 days

Modified:
  head/sys/dev/ata/ata-pci.h
  head/sys/dev/ata/chipsets/ata-acard.c
  head/sys/dev/ata/chipsets/ata-promise.c

Modified: head/sys/dev/ata/ata-pci.h
==
--- head/sys/dev/ata/ata-pci.h  Thu May 14 14:18:53 2009(r192104)
+++ head/sys/dev/ata/ata-pci.h  Thu May 14 14:57:13 2009(r192105)
@@ -66,6 +66,7 @@ struct ata_pci_controller {
 void(*function)(void *);
 void*argument;
 } interrupt[8]; /* XXX SOS max ch# for now */
+void*chipset_data;
 };
 
 /* defines for known chipset PCI id's */

Modified: head/sys/dev/ata/chipsets/ata-acard.c
==
--- head/sys/dev/ata/chipsets/ata-acard.c   Thu May 14 14:18:53 2009
(r192104)
+++ head/sys/dev/ata/chipsets/ata-acard.c   Thu May 14 14:57:13 2009
(r192105)
@@ -51,6 +51,12 @@ __FBSDID($FreeBSD$);
 #include dev/ata/ata-pci.h
 #include ata_if.h
 
+struct ata_serialize {
+struct mtx  locked_mtx;
+int locked_ch;
+int restart_ch;
+};
+
 /* local prototypes */
 static int ata_acard_chipinit(device_t dev);
 static int ata_acard_ch_attach(device_t dev);
@@ -58,6 +64,7 @@ static int ata_acard_status(device_t dev
 static void ata_acard_850_setmode(device_t dev, int mode);
 static void ata_acard_86X_setmode(device_t dev, int mode);
 static int ata_serialize(device_t dev, int flags);
+static void ata_serialize_init(struct ata_serialize *serial);
 
 /* misc defines */
 #define ATP_OLD1
@@ -93,6 +100,7 @@ static int
 ata_acard_chipinit(device_t dev)
 {
 struct ata_pci_controller *ctlr = device_get_softc(dev);
+struct ata_serialize *serial;
 
 if (ata_setup_interrupt(dev, ata_generic_intr))
return ENXIO;
@@ -102,6 +110,10 @@ ata_acard_chipinit(device_t dev)
 if (ctlr-chip-cfg1 == ATP_OLD) {
ctlr-setmode = ata_acard_850_setmode;
ctlr-locking = ata_serialize;
+   serial = malloc(sizeof(struct ata_serialize),
+ M_TEMP, M_WAITOK | M_ZERO);
+   ata_serialize_init(serial);
+   ctlr-chipset_data = serial;
 }
 else
ctlr-setmode = ata_acard_86X_setmode;
@@ -225,11 +237,14 @@ ata_acard_86X_setmode(device_t dev, int 
 /* we could set PIO mode timings, but we assume the BIOS did that */
 }
 
-struct ata_serialize {
-struct mtx  locked_mtx;
-int locked_ch;
-int restart_ch;
-};
+static void
+ata_serialize_init(struct ata_serialize *serial)
+{
+
+mtx_init(serial-locked_mtx, ATA serialize lock, NULL, MTX_DEF); 
+serial-locked_ch = -1;
+serial-restart_ch = -1;
+}
 
 static int
 ata_serialize(device_t dev, int flags)
@@ -237,20 +252,9 @@ ata_serialize(device_t dev, int flags)
 struct ata_pci_controller *ctlr = device_get_softc(device_get_parent(dev));
 struct ata_channel *ch = device_get_softc(dev);
 struct ata_serialize *serial;
-static int inited = 0;
 int res;
 
-if (!inited) {
-   serial = malloc(sizeof(struct ata_serialize),
- M_TEMP, M_NOWAIT | M_ZERO);
-   mtx_init(serial-locked_mtx, ATA serialize lock, NULL, MTX_DEF); 
-   serial-locked_ch = -1;
-   serial-restart_ch = -1;
-   device_set_ivars(ctlr-dev, serial);
-   inited = 1;
-}
-else
-   serial = device_get_ivars(ctlr-dev);
+serial = ctlr-chipset_data;
 
 mtx_lock(serial-locked_mtx);
 switch (flags) {

Modified: head/sys/dev/ata/chipsets/ata-promise.c
==
--- head/sys/dev/ata/chipsets/ata-promise.c Thu May 14 14:18:53 2009
(r192104)
+++ head/sys/dev/ata/chipsets/ata-promise.c Thu May 14 14:57:13 2009
(r192105)
@@ -283,7 +283,7 @@ ata_promise_chipinit(device_t dev)
mtx_init(hpkt-mtx, ATA promise HPKT lock, NULL, MTX_DEF);
TAILQ_INIT(hpkt-queue);
hpkt-busy = 0;
-   device_set_ivars(dev, hpkt);
+   ctlr-chipset_data = hpkt;
ctlr-ch_attach = ata_promise_mio_ch_attach;
ctlr-ch_detach = ata_promise_mio_ch_detach;
ctlr-reset = ata_promise_mio_reset;
@@ -730,7 +730,7 @@ 

Re: svn commit: r192085 - head/sys/netinet

2009-05-14 Thread Dimitry Andric
On 2009-05-14 16:36, George Neville-Neil wrote:
 Can you give more detail as to the purpose of this change?  I'm a bit  
 confused by it.  Does
 this fix any of the recent problems seen with DHCP and PXE or is this  
 unrelated?

It fixes at least the DHCP issue, but I didn't see any independent
confirmation of it having fixed PXE, although it likely will.

This fix originated from:
http://docs.freebsd.org/cgi/mid.cgi?B583FBF374231F4A89607B4D08578A43041C25D9
___
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: r192106 - in head/sys: conf pc98/include pc98/pc98

2009-05-14 Thread Takahashi Yoshihiro
Author: nyan
Date: Thu May 14 16:01:29 2009
New Revision: 192106
URL: http://svn.freebsd.org/changeset/base/192106

Log:
  MFi386: revision 192050
  
Implement simple machine check support.

Added:
  head/sys/pc98/include/mca.h   (contents, props changed)
Modified:
  head/sys/conf/files.pc98
  head/sys/pc98/pc98/machdep.c

Modified: head/sys/conf/files.pc98
==
--- head/sys/conf/files.pc98Thu May 14 14:57:13 2009(r192105)
+++ head/sys/conf/files.pc98Thu May 14 16:01:29 2009(r192106)
@@ -150,6 +150,7 @@ i386/i386/k6_mem.c  optional mem
 i386/i386/legacy.c standard
 i386/i386/local_apic.c optional apic
 i386/i386/locore.s standardno-obj
+i386/i386/mca.cstandard
 i386/i386/mem.coptional mem
 i386/i386/minidump_machdep.c   standard
 i386/i386/mp_clock.c   optional smp

Added: head/sys/pc98/include/mca.h
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/pc98/include/mca.h Thu May 14 16:01:29 2009(r192106)
@@ -0,0 +1,6 @@
+/*-
+ * This file is in the public domain.
+ */
+/* $FreeBSD$ */
+
+#include i386/mca.h

Modified: head/sys/pc98/pc98/machdep.c
==
--- head/sys/pc98/pc98/machdep.cThu May 14 14:57:13 2009
(r192105)
+++ head/sys/pc98/pc98/machdep.cThu May 14 16:01:29 2009
(r192106)
@@ -111,6 +111,7 @@ __FBSDID($FreeBSD$);
 #include machine/cpu.h
 #include machine/cputypes.h
 #include machine/intr_machdep.h
+#include machine/mca.h
 #include machine/md_var.h
 #include machine/pc/bios.h
 #include machine/pcb.h
@@ -256,6 +257,8 @@ cpu_startup(dummy)
vm_pager_bufferinit();
 
cpu_setregs();
+
+   mca_init();
 }
 
 /*
___
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: r192107 - head/sys/net80211

2009-05-14 Thread Sam Leffler
Author: sam
Date: Thu May 14 16:23:24 2009
New Revision: 192107
URL: http://svn.freebsd.org/changeset/base/192107

Log:
  correct handling of ctl frames: the sender's address is always i_addr2 for
  frames we should expect to process (old code was trying to handle frames
  we should never see--like ACK)
  
  Reviewed by:  thompsa, cbzimmer

Modified:
  head/sys/net80211/ieee80211_node.c

Modified: head/sys/net80211/ieee80211_node.c
==
--- head/sys/net80211/ieee80211_node.c  Thu May 14 16:01:29 2009
(r192106)
+++ head/sys/net80211/ieee80211_node.c  Thu May 14 16:23:24 2009
(r192107)
@@ -1439,12 +1439,6 @@ ieee80211_add_neighbor(struct ieee80211v
return ni;
 }
 
-#defineIS_CTL(wh) \
-   ((wh-i_fc[0]  IEEE80211_FC0_TYPE_MASK) == IEEE80211_FC0_TYPE_CTL)
-#defineIS_PSPOLL(wh) \
-   ((wh-i_fc[0]  IEEE80211_FC0_SUBTYPE_MASK) == 
IEEE80211_FC0_SUBTYPE_PS_POLL)
-#defineIS_BAR(wh) \
-   ((wh-i_fc[0]  IEEE80211_FC0_SUBTYPE_MASK) == 
IEEE80211_FC0_SUBTYPE_BAR)
 #defineIS_PROBEREQ(wh) \
((wh-i_fc[0]  (IEEE80211_FC0_TYPE_MASK|IEEE80211_FC0_SUBTYPE_MASK)) \
== (IEEE80211_FC0_TYPE_MGT | IEEE80211_FC0_SUBTYPE_PROBE_REQ))
@@ -1456,9 +1450,6 @@ static __inline struct ieee80211_node *
 _find_rxnode(struct ieee80211_node_table *nt,
 const struct ieee80211_frame_min *wh)
 {
-   /* XXX 4-address frames? */
-   if (IS_CTL(wh)  !IS_PSPOLL(wh)  !IS_BAR(wh) /* !IS_RTS(ah)*/)
-   return ieee80211_find_node_locked(nt, wh-i_addr1);
if (IS_BCAST_PROBEREQ(wh))
return NULL;/* spam bcast probe req to all vap's */
return ieee80211_find_node_locked(nt, wh-i_addr2);
@@ -1547,9 +1538,6 @@ ieee80211_find_rxnode_withkey(struct iee
 }
 #undef IS_BCAST_PROBEREQ
 #undef IS_PROBEREQ
-#undef IS_BAR
-#undef IS_PSPOLL
-#undef IS_CTL
 
 /*
  * Return a reference to the appropriate node for sending
___
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: r192108 - head/sys/net80211

2009-05-14 Thread Sam Leffler
Author: sam
Date: Thu May 14 16:25:57 2009
New Revision: 192108
URL: http://svn.freebsd.org/changeset/base/192108

Log:
  add missing type for SYSCTL_PROC items; w/o a type you can view the value
  but not change it

Modified:
  head/sys/net80211/ieee80211_freebsd.c

Modified: head/sys/net80211/ieee80211_freebsd.c
==
--- head/sys/net80211/ieee80211_freebsd.c   Thu May 14 16:23:24 2009
(r192107)
+++ head/sys/net80211/ieee80211_freebsd.c   Thu May 14 16:25:57 2009
(r192108)
@@ -175,27 +175,27 @@ ieee80211_sysctl_msecs_ticks(SYSCTL_HAND
 
 #ifdef IEEE80211_AMPDU_AGE
 extern int ieee80211_ampdu_age;
-SYSCTL_PROC(_net_wlan, OID_AUTO, ampdu_age, CTLFLAG_RW,
+SYSCTL_PROC(_net_wlan, OID_AUTO, ampdu_age, CTLTYPE_INT | CTLFLAG_RW,
ieee80211_ampdu_age, 0, ieee80211_sysctl_msecs_ticks, I,
AMPDU max reorder age (ms));
 #endif
 extern int ieee80211_addba_timeout;
-SYSCTL_PROC(_net_wlan, OID_AUTO, addba_timeout, CTLFLAG_RW,
+SYSCTL_PROC(_net_wlan, OID_AUTO, addba_timeout, CTLTYPE_INT | CTLFLAG_RW,
ieee80211_addba_timeout, 0, ieee80211_sysctl_msecs_ticks, I,
ADDBA request timeout (ms));
 extern int ieee80211_addba_backoff;
-SYSCTL_PROC(_net_wlan, OID_AUTO, addba_backoff, CTLFLAG_RW,
+SYSCTL_PROC(_net_wlan, OID_AUTO, addba_backoff, CTLTYPE_INT | CTLFLAG_RW,
ieee80211_addba_backoff, 0, ieee80211_sysctl_msecs_ticks, I,
ADDBA request backoff (ms));
 extern int ieee80211_addba_maxtries;
-SYSCTL_INT(_net_wlan, OID_AUTO, addba_maxtries, CTLFLAG_RW,
+SYSCTL_INT(_net_wlan, OID_AUTO, addba_maxtries, CTLTYPE_INT | CTLFLAG_RW,
ieee80211_addba_maxtries, 0, max ADDBA requests sent before backoff);
 #ifdef IEEE80211_SUPPORT_SUPERG
 extern int ieee80211_ffppsmin;
-SYSCTL_INT(_net_wlan, OID_AUTO, ffppsmin, CTLFLAG_RW,
+SYSCTL_INT(_net_wlan, OID_AUTO, ffppsmin, CTLTYPE_INT | CTLFLAG_RW,
ieee80211_ffppsmin, 0, min packet rate before fast-frame staging);
 extern int ieee80211_ffagemax;
-SYSCTL_PROC(_net_wlan, OID_AUTO, ffagemax, CTLFLAG_RW,
+SYSCTL_PROC(_net_wlan, OID_AUTO, ffagemax, CTLTYPE_INT | CTLFLAG_RW,
ieee80211_ffagemax, 0, ieee80211_sysctl_msecs_ticks, I,
max hold time for fast-frame staging (ms));
 #endif /* IEEE80211_SUPPORT_SUPERG */
___
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: r192109 - in head/sys/powerpc: aim booke include powerpc

2009-05-14 Thread Rafal Jaworowski
Author: raj
Date: Thu May 14 16:48:25 2009
New Revision: 192109
URL: http://svn.freebsd.org/changeset/base/192109

Log:
  PowerPC common SMP startup and time base rework.
  
  - make mftb() shared, rewrite in C, provide complementary mttb()
  - adjust SMP startup per the above, additional comments, minor naming
changes
  - eliminate redundant TB defines, other minor cosmetics
  
  Reviewed by:  marcel, nwhitehorn
  Obtained from:Freescale, Semihalf

Modified:
  head/sys/powerpc/aim/clock.c
  head/sys/powerpc/booke/clock.c
  head/sys/powerpc/include/cpufunc.h
  head/sys/powerpc/include/md_var.h
  head/sys/powerpc/include/spr.h
  head/sys/powerpc/powerpc/mp_machdep.c

Modified: head/sys/powerpc/aim/clock.c
==
--- head/sys/powerpc/aim/clock.cThu May 14 16:25:57 2009
(r192108)
+++ head/sys/powerpc/aim/clock.cThu May 14 16:48:25 2009
(r192109)
@@ -148,22 +148,19 @@ decr_init(void)
mtmsr(msr);
 }
 
+#ifdef SMP
 void
-decr_tc_init(void)
+decr_ap_init(void)
 {
-   decr_timecounter.tc_frequency = ticks_per_sec;
-   tc_init(decr_timecounter);
+
 }
+#endif
 
-static __inline u_quad_t
-mftb(void)
+void
+decr_tc_init(void)
 {
-   u_long  scratch;
-   u_quad_ttb;
-
-   __asm (1: mftbu %0; mftb %0+1; mftbu %1; cmpw 0,%0,%1; bne 1b
- : =r(tb), =r(scratch));
-   return tb;
+   decr_timecounter.tc_frequency = ticks_per_sec;
+   tc_init(decr_timecounter);
 }
 
 static unsigned

Modified: head/sys/powerpc/booke/clock.c
==
--- head/sys/powerpc/booke/clock.c  Thu May 14 16:25:57 2009
(r192108)
+++ head/sys/powerpc/booke/clock.c  Thu May 14 16:48:25 2009
(r192109)
@@ -151,22 +151,6 @@ decr_init (void)
mtmsr(msr);
 }
 
-static __inline u_quad_t
-mftb (void)
-{
-   u_long  scratch;
-   u_quad_ttb;
-
-   __asm__ __volatile__(
-   1: mftbu %0;
-  mftb %0+1;
-  mftbu %1;
-  cmpw 0,%0,%1;
-  bne 1b
-   : =r(tb), =r(scratch));
-   return tb;
-}
-
 void
 decr_tc_init(void)
 {

Modified: head/sys/powerpc/include/cpufunc.h
==
--- head/sys/powerpc/include/cpufunc.h  Thu May 14 16:25:57 2009
(r192108)
+++ head/sys/powerpc/include/cpufunc.h  Thu May 14 16:48:25 2009
(r192109)
@@ -115,13 +115,37 @@ mfdec(void)
 static __inline register_t
 mfpvr(void)
 {
-   register_t  value;
+   register_t value;
 
__asm __volatile (mfpvr %0 : =r(value));
 
return (value);
 }
 
+static __inline u_quad_t
+mftb(void)
+{
+   u_quad_t tb;
+   uint32_t *tbup = (uint32_t *)tb;
+   uint32_t *tblp = tbup + 1;
+
+   do {
+   *tbup = mfspr(TBR_TBU);
+   *tblp = mfspr(TBR_TBL);
+   } while (*tbup != mfspr(TBR_TBU));
+
+   return (tb);
+}
+
+static __inline void
+mttb(u_quad_t time)
+{
+
+   mtspr(TBR_TBWL, 0);
+   mtspr(TBR_TBWU, (uint32_t)(time  32));
+   mtspr(TBR_TBWL, (uint32_t)(time  0x));
+}
+
 static __inline void
 eieio(void)
 {

Modified: head/sys/powerpc/include/md_var.h
==
--- head/sys/powerpc/include/md_var.h   Thu May 14 16:25:57 2009
(r192108)
+++ head/sys/powerpc/include/md_var.h   Thu May 14 16:48:25 2009
(r192109)
@@ -56,11 +56,12 @@ int is_physical_memory(vm_offset_t addr)
 intmem_valid(vm_offset_t addr, int len);
 
 void   decr_init(void);
+void   decr_ap_init(void);
 void   decr_tc_init(void);
 
 void   cpu_setup(u_int);
 
-struct trapframe;
+struct trapframe;
 void   powerpc_interrupt(struct trapframe *);
 
 #endif /* !_MACHINE_MD_VAR_H_ */

Modified: head/sys/powerpc/include/spr.h
==
--- head/sys/powerpc/include/spr.h  Thu May 14 16:25:57 2009
(r192108)
+++ head/sys/powerpc/include/spr.h  Thu May 14 16:48:25 2009
(r192109)
@@ -129,8 +129,6 @@
 #defineSPR_SPRG7   0x117   /* 4.. SPR General 7 */
 #defineSPR_ASR 0x118   /* ... Address Space Register 
(PPC64) */
 #defineSPR_EAR 0x11a   /* .68 External Access Register 
*/
-#defineSPR_TBL 0x11c   /* 468 Time Base Lower */
-#defineSPR_TBU 0x11d   /* 468 Time Base Upper */
 #defineSPR_PVR 0x11f   /* 468 Processor Version 
Register */
 #define  MPC601  0x0001
 #define  MPC603  0x0003

Modified: head/sys/powerpc/powerpc/mp_machdep.c
==
--- head/sys/powerpc/powerpc/mp_machdep.c   Thu 

svn commit: r192110 - head/sys/powerpc/include

2009-05-14 Thread Rafal Jaworowski
Author: raj
Date: Thu May 14 16:56:56 2009
New Revision: 192110
URL: http://svn.freebsd.org/changeset/base/192110

Log:
  Improve style(9)

Modified:
  head/sys/powerpc/include/cpufunc.h

Modified: head/sys/powerpc/include/cpufunc.h
==
--- head/sys/powerpc/include/cpufunc.h  Thu May 14 16:48:25 2009
(r192109)
+++ head/sys/powerpc/include/cpufunc.h  Thu May 14 16:56:56 2009
(r192110)
@@ -71,7 +71,7 @@ mtmsr(register_t value)
 static __inline register_t
 mfmsr(void)
 {
-   register_t  value;
+   register_t value;
 
__asm __volatile (mfmsr %0 : =r(value));
 
@@ -88,7 +88,7 @@ mtsrin(vm_offset_t va, register_t value)
 static __inline register_t
 mfsrin(vm_offset_t va)
 {
-   register_t  value;
+   register_t value;
 
__asm __volatile (mfsrin %0,%1 : =r(value) : r(va));
 
@@ -105,7 +105,7 @@ mtdec(register_t value)
 static __inline register_t
 mfdec(void)
 {
-   register_t  value;
+   register_t value;
 
__asm __volatile (mfdec %0 : =r(value));
 
@@ -170,7 +170,7 @@ powerpc_sync(void)
 static __inline register_t
 intr_disable(void)
 {
-   register_t  msr;
+   register_t msr;
 
msr = mfmsr();
mtmsr(msr  ~PSL_EE);
@@ -187,11 +187,11 @@ intr_restore(register_t msr)
 static __inline struct pcpu *
 powerpc_get_pcpup(void)
 {
-   struct pcpu *ret;
+   struct pcpu *ret;
 
__asm __volatile(mfsprg %0, 0 : =r(ret));
 
-   return(ret);
+   return (ret);
 }
 
 #endif /* _KERNEL */
___
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: r192113 - head/lib/libbluetooth

2009-05-14 Thread Maksim Yevmenkin
Author: emax
Date: Thu May 14 17:10:19 2009
New Revision: 192113
URL: http://svn.freebsd.org/changeset/base/192113

Log:
  Avoid floating point arithmetic while calculating iquiry length.
  
  Submitted by: Iain Hibbert  plunky -at- rya-online -dot- net 
  MFC after:1 week

Modified:
  head/lib/libbluetooth/hci.c

Modified: head/lib/libbluetooth/hci.c
==
--- head/lib/libbluetooth/hci.c Thu May 14 17:04:58 2009(r192112)
+++ head/lib/libbluetooth/hci.c Thu May 14 17:10:19 2009(r192113)
@@ -410,7 +410,6 @@ bt_devinquiry(char const *devname, time_
ng_hci_inquiry_response *ir;
struct bt_devinquiry*i;
int s, n;
-   time_t  to;
 
if (ii == NULL) {
errno = EINVAL;
@@ -452,16 +451,20 @@ bt_devinquiry(char const *devname, time_
cp-lap[1] = 0x8b;
cp-lap[2] = 0x9e;
 
-   /* Calculate inquire length in 1.28 second units */
-   to = (time_t) ((double) length / 1.28);
-   if (to = 0)
-   cp-inquiry_length = 4; /* 5.12 seconds */
-   else if (to  254)
-   cp-inquiry_length = 255;   /* 326.40 seconds */
-   else
-   cp-inquiry_length = to + 1;
+   /*
+* Calculate inquire length in 1.28 second units
+* v2.x specification says that 1.28 - 61.44 seconds
+* range is acceptable
+*/
+
+   if (length = 0)
+   length = 5;
+   else if (length == 1)
+   length = 2;
+   else if (length  62)
+   length = 62;
 
-   to = (time_t)((double) cp-inquiry_length * 1.28) + 1;
+   cp-inquiry_length = (uint8_t)((length * 100) / 128);
 
if (num_rsp = 0 || num_rsp  255)
num_rsp = 8;
@@ -484,7 +487,7 @@ bt_devinquiry(char const *devname, time_
 
 wait_for_more:
 
-   n = bt_devrecv(s, buf, sizeof(buf), to);
+   n = bt_devrecv(s, buf, sizeof(buf), length);
if (n  0) {
free(i);
bt_devclose(s);
___
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: r192114 - in head/sys: amd64/amd64 amd64/include gnu/fs/xfs/FreeBSD/support i386/i386 i386/include i386/xen

2009-05-14 Thread Attilio Rao
Author: attilio
Date: Thu May 14 17:43:00 2009
New Revision: 192114
URL: http://svn.freebsd.org/changeset/base/192114

Log:
  FreeBSD right now support 32 CPUs on all the architectures at least.
  With the arrival of 128+ cores it is necessary to handle more than that.
  One of the first thing to change is the support for cpumask_t that needs
  to handle more than 32 bits masking (which happens now).  Some places,
  however, still assume that cpumask_t is a 32 bits mask.
  Fix that situation by using always correctly cpumask_t when needed.
  
  While here, remove the part under STOP_NMI for the Xen support as it
  is broken in any case.
  
  Additively make ipi_nmi_pending as static.
  
  Reviewed by:  jhb, kmacy
  Tested by:Giovanni Trematerra giovanni dot trematerra at gmail dot com

Modified:
  head/sys/amd64/amd64/mp_machdep.c
  head/sys/amd64/include/smp.h
  head/sys/gnu/fs/xfs/FreeBSD/support/debug.h
  head/sys/i386/i386/mp_machdep.c
  head/sys/i386/i386/pmap.c
  head/sys/i386/include/smp.h
  head/sys/i386/xen/mp_machdep.c

Modified: head/sys/amd64/amd64/mp_machdep.c
==
--- head/sys/amd64/amd64/mp_machdep.c   Thu May 14 17:10:19 2009
(r192113)
+++ head/sys/amd64/amd64/mp_machdep.c   Thu May 14 17:43:00 2009
(r192114)
@@ -114,9 +114,9 @@ volatile int smp_tlb_wait;
 extern inthand_t IDTVEC(fast_syscall), IDTVEC(fast_syscall32);
 
 #ifdef STOP_NMI
-volatile cpumask_t ipi_nmi_pending;
+static volatile cpumask_t ipi_nmi_pending;
 
-static voidipi_nmi_selected(u_int32_t cpus);
+static voidipi_nmi_selected(cpumask_t cpus);
 #endif 
 
 /*
@@ -1016,7 +1016,7 @@ smp_tlb_shootdown(u_int vector, vm_offse
 }
 
 static void
-smp_targeted_tlb_shootdown(u_int mask, u_int vector, vm_offset_t addr1, 
vm_offset_t addr2)
+smp_targeted_tlb_shootdown(cpumask_t mask, u_int vector, vm_offset_t addr1, 
vm_offset_t addr2)
 {
int ncpu, othercpus;
 
@@ -1090,7 +1090,7 @@ smp_invlpg_range(vm_offset_t addr1, vm_o
 }
 
 void
-smp_masked_invltlb(u_int mask)
+smp_masked_invltlb(cpumask_t mask)
 {
 
if (smp_started) {
@@ -1099,7 +1099,7 @@ smp_masked_invltlb(u_int mask)
 }
 
 void
-smp_masked_invlpg(u_int mask, vm_offset_t addr)
+smp_masked_invlpg(cpumask_t mask, vm_offset_t addr)
 {
 
if (smp_started) {
@@ -1108,7 +1108,7 @@ smp_masked_invlpg(u_int mask, vm_offset_
 }
 
 void
-smp_masked_invlpg_range(u_int mask, vm_offset_t addr1, vm_offset_t addr2)
+smp_masked_invlpg_range(cpumask_t mask, vm_offset_t addr1, vm_offset_t addr2)
 {
 
if (smp_started) {
@@ -1143,7 +1143,7 @@ ipi_bitmap_handler(struct trapframe fram
  * send an IPI to a set of cpus.
  */
 void
-ipi_selected(u_int32_t cpus, u_int ipi)
+ipi_selected(cpumask_t cpus, u_int ipi)
 {
int cpu;
u_int bitmap = 0;
@@ -1206,8 +1206,8 @@ ipi_all_but_self(u_int ipi)
 
 #defineBEFORE_SPIN 100
 
-void
-ipi_nmi_selected(u_int32_t cpus)
+static void
+ipi_nmi_selected(cpumask_t cpus)
 {
int cpu;
register_t icrlo;
@@ -1331,7 +1331,7 @@ SYSINIT(start_aps, SI_SUB_SMP, SI_ORDER_
 static int
 sysctl_hlt_cpus(SYSCTL_HANDLER_ARGS)
 {
-   u_int mask;
+   cpumask_t mask;
int error;
 
mask = hlt_cpus_mask;

Modified: head/sys/amd64/include/smp.h
==
--- head/sys/amd64/include/smp.hThu May 14 17:10:19 2009
(r192113)
+++ head/sys/amd64/include/smp.hThu May 14 17:43:00 2009
(r192114)
@@ -52,19 +52,19 @@ voidcpu_add(u_int apic_id, char boot_cp
 void   cpustop_handler(void);
 void   cpususpend_handler(void);
 void   init_secondary(void);
-void   ipi_selected(u_int cpus, u_int ipi);
+void   ipi_selected(cpumask_t cpus, u_int ipi);
 void   ipi_all_but_self(u_int ipi);
 void   ipi_bitmap_handler(struct trapframe frame);
 u_int  mp_bootaddress(u_int);
 intmp_grab_cpu_hlt(void);
 void   smp_cache_flush(void);
 void   smp_invlpg(vm_offset_t addr);
-void   smp_masked_invlpg(u_int mask, vm_offset_t addr);
+void   smp_masked_invlpg(cpumask_t mask, vm_offset_t addr);
 void   smp_invlpg_range(vm_offset_t startva, vm_offset_t endva);
-void   smp_masked_invlpg_range(u_int mask, vm_offset_t startva,
+void   smp_masked_invlpg_range(cpumask_t mask, vm_offset_t startva,
vm_offset_t endva);
 void   smp_invltlb(void);
-void   smp_masked_invltlb(u_int mask);
+void   smp_masked_invltlb(cpumask_t mask);
 
 #ifdef STOP_NMI
 intipi_nmi_handler(void);

Modified: head/sys/gnu/fs/xfs/FreeBSD/support/debug.h
==
--- head/sys/gnu/fs/xfs/FreeBSD/support/debug.h Thu May 14 17:10:19 2009
(r192113)
+++ head/sys/gnu/fs/xfs/FreeBSD/support/debug.h Thu May 14 17:43:00 2009
(r192114)
@@ -75,6 +75,5 @@ extern int get_thread_id(void);
 #endif
 
 #define ASSERT_ALWAYS(EX)  ((EX)?((void)0):assfail(#EX, __FILE__, 

Re: svn commit: r192059 - in head/sys: arm/at91 dev/spibus

2009-05-14 Thread Oleksandr Tymoshenko

Stanislav Sedov wrote:

On Wed, 13 May 2009 18:42:49 + (UTC)
Oleksandr Tymoshenko go...@freebsd.org mentioned:


.. skipped ..




On the other hand this driver appears to be machine-specific. 

 What if one

would like to have a kernel with several SPI bus drivers included for devices
that doesn't support enumeration? In this case it will be impossible to
diffirentiate these drivers in the hints file.

Could you elaborate on this? Completely different drivers
or several instances of the same driver? Use case is welcome. 
dev/spibus is just abstraction that provides interface to child

devices. It can't be machine-specific. Bridge implementation
(at91_spi) is machine specific and implements actual hardware
access.
___
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: r192085 - head/sys/netinet

2009-05-14 Thread Andrew Thompson
On Thu, May 14, 2009 at 05:27:09AM +, Qing Li wrote:
 Author: qingli
 Date: Thu May 14 05:27:09 2009
 New Revision: 192085
 URL: http://svn.freebsd.org/changeset/base/192085
 
 Log:
   Ignore the INADDR_ANY address inserted/deleted by DHCP when installing a 
 loopback route
   to the interface address.
 
 Modified:
   head/sys/netinet/in.c

I have also tried this with pxe and its now working again. thanks.

Andrew
___
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: r192115 - head/sys/fs/nfs

2009-05-14 Thread Rick Macklem
Author: rmacklem
Date: Thu May 14 20:39:09 2009
New Revision: 192115
URL: http://svn.freebsd.org/changeset/base/192115

Log:
  Change the file names in the comments in sys/fs/nfs/nfs_var.h so
  that they are the names used in FreeBSD-CURRENT. Also shuffled a
  few entries around, so that they under the correct comment.
  
  Approved by:  kib (mentor)

Modified:
  head/sys/fs/nfs/nfs_var.h

Modified: head/sys/fs/nfs/nfs_var.h
==
--- head/sys/fs/nfs/nfs_var.h   Thu May 14 17:43:00 2009(r192114)
+++ head/sys/fs/nfs/nfs_var.h   Thu May 14 20:39:09 2009(r192115)
@@ -85,7 +85,7 @@ NFS_LOOKUP_ARGS;
 NFS_READDIR_ARGS;
 #endif
 
-/* nfsd_srvstate.c */
+/* nfs_nfsdstate.c */
 int nfsrv_setclient(struct nfsrv_descript *, struct nfsclient **,
 nfsquad_t *, nfsquad_t *, NFSPROC_T *);
 int nfsrv_getclient(nfsquad_t, int, struct nfsclient **, nfsquad_t,
@@ -125,7 +125,7 @@ int nfsrv_checkgetattr(struct nfsrv_desc
 int nfsrv_nfsuserdport(u_short, NFSPROC_T *);
 void nfsrv_nfsuserddelport(void);
 
-/* nfsd_serv.c */
+/* nfs_nfsdserv.c */
 int nfsrvd_access(struct nfsrv_descript *, int,
 vnode_t, NFSPROC_T *, struct nfsexstuff *);
 int nfsrvd_getattr(struct nfsrv_descript *, int,
@@ -209,23 +209,11 @@ int nfsrvd_releaselckown(struct nfsrv_de
 int nfsrvd_pathconf(struct nfsrv_descript *, int,
 vnode_t, NFSPROC_T *, struct nfsexstuff *);
 
-/* newnfs_socket.c */
-int newnfs_request(struct nfsrv_descript *, struct nfsmount *,
-struct nfsclient *, struct nfssockreq *, vnode_t, NFSPROC_T *,
-struct ucred *, u_int32_t, u_int32_t, u_char *, int, u_int64_t *);
-int newnfs_connect(struct nfsmount *, struct nfssockreq *,
-struct ucred *, NFSPROC_T *, int);
-void newnfs_disconnect(struct nfssockreq *);
-void newnfs_timer(void *);
-int newnfs_sigintr(struct nfsmount *, NFSPROC_T *);
-int newnfs_sndlock(int *);
-void newnfs_sndunlock(int *);
-
-/* nfsd_srvsocket.c */
+/* nfs_nfsdsocket.c */
 void nfsrvd_rephead(struct nfsrv_descript *);
 void nfsrvd_dorpc(struct nfsrv_descript *, int, NFSPROC_T *);
 
-/* nfs_srvcache.c */
+/* nfs_nfsdcache.c */
 void nfsrvd_initcache(void);
 int nfsrvd_getcache(struct nfsrv_descript *, struct socket *);
 struct nfsrvcache *nfsrvd_updatecache(struct nfsrv_descript *,
@@ -236,7 +224,7 @@ void nfsrvd_refcache(struct nfsrvcache *
 void nfsrvd_derefcache(struct nfsrvcache *);
 void nfsrvd_delcache(struct nfsrvcache *);
 
-/* newnfs_subs.c */
+/* nfs_commonsubs.c */
 void newnfs_init(void);
 int nfsaddr_match(int, union nethostaddr *, NFSSOCKADDR_T);
 int nfsaddr2_match(NFSSOCKADDR_T, NFSSOCKADDR_T);
@@ -265,8 +253,10 @@ void nfsv4_relref(struct nfsv4lock *);
 void nfsv4_getref(struct nfsv4lock *, int *, void *);
 int nfsrv_mtostr(struct nfsrv_descript *, char *, int);
 int nfsrv_checkutf8(u_int8_t *, int);
+int newnfs_sndlock(int *);
+void newnfs_sndunlock(int *);
 
-/* nfscl_subs.c */
+/* nfs_clcomsubs.c */
 void nfsm_uiombuf(struct nfsrv_descript *, struct uio *, int);
 void nfscl_reqstart(struct nfsrv_descript *, int, struct nfsmount *,
 u_int8_t *, int, u_int32_t **);
@@ -286,7 +276,7 @@ int nfscl_request(struct nfsrv_descript 
  NFSPROC_T *, struct ucred *, void *);
 void nfsm_stateidtom(struct nfsrv_descript *, nfsv4stateid_t *, int);
 
-/* nfsd_srvsubs.c */
+/* nfs_nfsdsubs.c */
 void nfsd_fhtovp(struct nfsrv_descript *, struct nfsrvfh *,
 vnode_t *, struct nfsexstuff *,
 mount_t *, int, NFSPROC_T *);
@@ -315,13 +305,11 @@ int nfsrv_putreferralattr(struct nfsrv_d
 struct nfsreferral *, int, int *);
 int nfsrv_parsename(struct nfsrv_descript *, char *, u_long *,
 NFSPATHLEN_T *);
-
-/* nfs_srvsyscalls.c */
 void nfsd_init(void);
 
-/* nfs_vfsops.c */
+/* nfs_clvfsops.c */
 
-/* newnfs_port.c */
+/* nfs_commonport.c */
 int nfsrv_checksockseqnum(struct socket *, tcp_seq);
 int nfsrv_getsockseqnum(struct socket *, tcp_seq *);
 int nfsrv_getsocksndseq(struct socket *, tcp_seq *, tcp_seq *);
@@ -335,8 +323,9 @@ void newnfs_setroot(struct ucred *);
 int nfs_catnap(int, const char *);
 struct nfsreferral *nfsv4root_getreferral(vnode_t, vnode_t, u_int32_t);
 int nfsrv_atroot(vnode_t, long *);
+void newnfs_timer(void *);
 
-/* newnfs_acl.c */
+/* nfs_commonacl.c */
 int nfsrv_dissectace(struct nfsrv_descript *, struct acl_entry *,
 int *, int *, NFSPROC_T *);
 #ifdef NFS4_ACL_EXTATTR_NAME
@@ -349,7 +338,7 @@ int nfsrv_setacl(vnode_t, NFSACL_T *, st
 int nfsrv_compareacl(NFSACL_T *, NFSACL_T *);
 #endif
 
-/* nfscl_rpcops.c */
+/* nfs_clrpcops.c */
 int nfsrpc_null(vnode_t, struct ucred *, NFSPROC_T *);
 int nfsrpc_access(vnode_t, int, struct ucred *, NFSPROC_T *,
 struct nfsvattr *, int *);
@@ -436,7 +425,7 @@ int nfsrpc_delegreturn(struct nfscldeleg
 int nfsrpc_getacl(vnode_t, struct ucred *, NFSPROC_T *, NFSACL_T *, void *);
 int nfsrpc_setacl(vnode_t, struct ucred *, NFSPROC_T *, NFSACL_T *, void *);
 
-/* nfscl_state.c */
+/* nfs_clstate.c */
 int 

svn commit: r192116 - head/sys/netinet

2009-05-14 Thread Robert Watson
Author: rwatson
Date: Thu May 14 20:59:36 2009
New Revision: 192116
URL: http://svn.freebsd.org/changeset/base/192116

Log:
  Staticize two functions not used outside of in_pcb.c: in_pcbremlists() and
  db_print_inpcb().
  
  MFC after:1 month

Modified:
  head/sys/netinet/in_pcb.c
  head/sys/netinet/in_pcb.h

Modified: head/sys/netinet/in_pcb.c
==
--- head/sys/netinet/in_pcb.c   Thu May 14 20:39:09 2009(r192115)
+++ head/sys/netinet/in_pcb.c   Thu May 14 20:59:36 2009(r192116)
@@ -120,6 +120,8 @@ int ipport_tcplastcount;
if ((var)  (min)) { (var) = (min); } \
else if ((var)  (max)) { (var) = (max); }
 
+static voidin_pcbremlists(struct inpcb *inp);
+
 static int
 sysctl_net_ipport_check(SYSCTL_HANDLER_ARGS)
 {
@@ -1512,7 +1514,7 @@ in_pcbrehash(struct inpcb *inp)
 /*
  * Remove PCB from various lists.
  */
-void
+static void
 in_pcbremlists(struct inpcb *inp)
 {
struct inpcbinfo *pcbinfo = inp-inp_pcbinfo;
@@ -1878,7 +1880,7 @@ db_print_inpvflag(u_char inp_vflag)
}
 }
 
-void
+static void
 db_print_inpcb(struct inpcb *inp, const char *name, int indent)
 {
 

Modified: head/sys/netinet/in_pcb.h
==
--- head/sys/netinet/in_pcb.h   Thu May 14 20:39:09 2009(r192115)
+++ head/sys/netinet/in_pcb.h   Thu May 14 20:59:36 2009(r192116)
@@ -501,14 +501,7 @@ intin_getsockaddr(struct socket *so, st
 struct sockaddr *
in_sockaddr(in_port_t port, struct in_addr *addr);
 void   in_pcbsosetlabel(struct socket *so);
-void   in_pcbremlists(struct inpcb *inp);
 void   ipport_tick(void *xtp);
-
-/*
- * Debugging routines compiled in when DDB is present.
- */
-void   db_print_inpcb(struct inpcb *inp, const char *name, int indent);
-
 #endif /* _KERNEL */
 
 #endif /* !_NETINET_IN_PCB_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: r192121 - in head/sys/fs: nfs nfsclient nfsserver

2009-05-14 Thread Rick Macklem
Author: rmacklem
Date: Thu May 14 21:39:08 2009
New Revision: 192121
URL: http://svn.freebsd.org/changeset/base/192121

Log:
  Apply changes to the experimental nfs server so that it uses the security
  flavors as exported in FreeBSD-CURRENT. This allows it to use a
  slightly modified mountd.c instead of a different utility.
  
  Approved by:  kib (mentor)

Modified:
  head/sys/fs/nfs/nfs.h
  head/sys/fs/nfs/nfs_var.h
  head/sys/fs/nfs/nfsdport.h
  head/sys/fs/nfs/nfsport.h
  head/sys/fs/nfsclient/nfs_clkrpc.c
  head/sys/fs/nfsserver/nfs_nfsdkrpc.c
  head/sys/fs/nfsserver/nfs_nfsdport.c
  head/sys/fs/nfsserver/nfs_nfsdserv.c
  head/sys/fs/nfsserver/nfs_nfsdsocket.c
  head/sys/fs/nfsserver/nfs_nfsdsubs.c

Modified: head/sys/fs/nfs/nfs.h
==
--- head/sys/fs/nfs/nfs.h   Thu May 14 21:27:03 2009(r192120)
+++ head/sys/fs/nfs/nfs.h   Thu May 14 21:39:08 2009(r192121)
@@ -580,7 +580,6 @@ struct nfsrv_descript {
u_int64_t   nd_compref; /* Compound RPC ref# */
time_t  nd_tcpconntime; /* Time TCP connection est. */
nfsquad_t   nd_clientid;/* Implied clientid */
-   int nd_credflavor;  /* credential flavor */
int nd_gssnamelen;  /* principal name length */
char*nd_gssname;/* principal name */
 };
@@ -608,8 +607,11 @@ struct nfsrv_descript {
 #defineND_V4WCCATTR0x0001
 #defineND_NFSCB0x0002
 #defineND_AUTHNONE 0x0004
-#defineND_EXGSSONLY0x0008
-#defineND_INCRSEQID0x0010
+#defineND_EXAUTHSYS0x0008
+#defineND_EXGSS0x0010
+#defineND_EXGSSINTEGRITY   0x0020
+#defineND_EXGSSPRIVACY 0x0040
+#defineND_INCRSEQID0x0080
 
 /*
  * ND_GSS should be the or of all GSS type authentications.
@@ -631,11 +633,6 @@ struct nfsv4_opflag {
 #defineNFSRVSEQID_OPEN 0x04
 
 /*
- * MNT_EXGSSONLY is the Or of all the EXGSS bits.
- */
-#defineMNT_EXGSSONLY   MNT_EXGSSKRB5
-
-/*
  * assign a doubly linked list to a new head
  * and prepend one list into another.
  */

Modified: head/sys/fs/nfs/nfs_var.h
==
--- head/sys/fs/nfs/nfs_var.h   Thu May 14 21:27:03 2009(r192120)
+++ head/sys/fs/nfs/nfs_var.h   Thu May 14 21:39:08 2009(r192121)
@@ -306,6 +306,7 @@ int nfsrv_putreferralattr(struct nfsrv_d
 int nfsrv_parsename(struct nfsrv_descript *, char *, u_long *,
 NFSPATHLEN_T *);
 void nfsd_init(void);
+int nfsd_checkrootexp(struct nfsrv_descript *);
 
 /* nfs_clvfsops.c */
 
@@ -575,6 +576,7 @@ int nfsvno_advlock(vnode_t, int, u_int64
 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 *);
 
 /* nfs_commonkrpc.c */
 int newnfs_nmcancelreqs(struct nfsmount *);

Modified: head/sys/fs/nfs/nfsdport.h
==
--- head/sys/fs/nfs/nfsdport.h  Thu May 14 21:27:03 2009(r192120)
+++ head/sys/fs/nfs/nfsdport.h  Thu May 14 21:39:08 2009(r192121)
@@ -52,8 +52,10 @@
  * needs to be returned by nfsd_fhtovp().
  */
 struct nfsexstuff {
-   int nes_vfslocked;  /* required for all ports */
-   int nes_exflag;
+   int nes_vfslocked;  /* required for all ports */
+   int nes_exflag; /* export flags */
+   int nes_numsecflavor;   /* # of security flavors */
+   int nes_secflavors[MAXSECFLAVORS];  /* and the flavors */
 };
 
 #defineNFSVNO_EXINIT(e)((e)-nes_exflag = 0)
@@ -61,11 +63,9 @@ struct nfsexstuff {
 #defineNFSVNO_EXRDONLY(e)  ((e)-nes_exflag  MNT_EXRDONLY)
 #defineNFSVNO_EXPORTANON(e)((e)-nes_exflag  
MNT_EXPORTANON)
 #defineNFSVNO_EXSTRICTACCESS(e)((e)-nes_exflag  
MNT_EXSTRICTACCESS)
-#defineNFSVNO_EXGSSONLY(e) ((e)-nes_exflag  
MNT_EXGSSONLY)
 #defineNFSVNO_EXV4ONLY(e)  ((e)-nes_exflag  MNT_EXV4ONLY)
 
 #defineNFSVNO_SETEXRDONLY(e)   ((e)-nes_exflag = 
(MNT_EXPORTED|MNT_EXRDONLY))
-#defineNFSVNO_SETEXGSSONLY(e)  ((e)-nes_exflag |= 
MNT_EXGSSONLY)
 
 #defineNFSVNO_CMPFH(f1, f2)
\
 ((f1)-fh_fsid.val[0] == (f2)-fh_fsid.val[0]\

Modified: head/sys/fs/nfs/nfsport.h
==
--- head/sys/fs/nfs/nfsport.h   Thu May 14 21:27:03 2009(r192120)
+++ 

svn commit: r192122 - in head/sys: amd64/conf i386/conf

2009-05-14 Thread John Baldwin
Author: jhb
Date: Thu May 14 21:53:35 2009
New Revision: 192122
URL: http://svn.freebsd.org/changeset/base/192122

Log:
  Trim the default set of device hints on i386 and amd64:
  - Remove vga0 and the disabled uart2/uart3 hints from both platforms.
  - Remove hints for ISA adv0, bt0, aha0, aic0, ed0, cs0, sn0, ie0, fe0, and
le0 from i386.  All these hints were marked 'disabled' and thus already
did not work out of the box.
  
  Discussed with:   imp

Modified:
  head/sys/amd64/conf/GENERIC.hints
  head/sys/i386/conf/GENERIC.hints

Modified: head/sys/amd64/conf/GENERIC.hints
==
--- head/sys/amd64/conf/GENERIC.hints   Thu May 14 21:39:08 2009
(r192121)
+++ head/sys/amd64/conf/GENERIC.hints   Thu May 14 21:53:35 2009
(r192122)
@@ -13,7 +13,6 @@ hint.atkbd.0.at=atkbdc
 hint.atkbd.0.irq=1
 hint.psm.0.at=atkbdc
 hint.psm.0.irq=12
-hint.vga.0.at=isa
 hint.sc.0.at=isa
 hint.sc.0.flags=0x100
 hint.uart.0.at=isa
@@ -23,13 +22,5 @@ hint.uart.0.irq=4
 hint.uart.1.at=isa
 hint.uart.1.port=0x2F8
 hint.uart.1.irq=3
-hint.uart.2.at=isa
-hint.uart.2.disabled=1
-hint.uart.2.port=0x3E8
-hint.uart.2.irq=5
-hint.uart.3.at=isa
-hint.uart.3.disabled=1
-hint.uart.3.port=0x2E8
-hint.uart.3.irq=9
 hint.ppc.0.at=isa
 hint.ppc.0.irq=7

Modified: head/sys/i386/conf/GENERIC.hints
==
--- head/sys/i386/conf/GENERIC.hintsThu May 14 21:39:08 2009
(r192121)
+++ head/sys/i386/conf/GENERIC.hintsThu May 14 21:53:35 2009
(r192122)
@@ -13,21 +13,12 @@ hint.ata.0.irq=14
 hint.ata.1.at=isa
 hint.ata.1.port=0x170
 hint.ata.1.irq=15
-hint.adv.0.at=isa
-hint.adv.0.disabled=1
-hint.bt.0.at=isa
-hint.bt.0.disabled=1
-hint.aha.0.at=isa
-hint.aha.0.disabled=1
-hint.aic.0.at=isa
-hint.aic.0.disabled=1
 hint.atkbdc.0.at=isa
 hint.atkbdc.0.port=0x060
 hint.atkbd.0.at=atkbdc
 hint.atkbd.0.irq=1
 hint.psm.0.at=atkbdc
 hint.psm.0.irq=12
-hint.vga.0.at=isa
 hint.sc.0.at=isa
 hint.sc.0.flags=0x100
 hint.apm.0.disabled=1
@@ -39,41 +30,8 @@ hint.uart.0.irq=4
 hint.uart.1.at=isa
 hint.uart.1.port=0x2F8
 hint.uart.1.irq=3
-hint.uart.2.at=isa
-hint.uart.2.disabled=1
-hint.uart.2.port=0x3E8
-hint.uart.2.irq=5
-hint.uart.3.at=isa
-hint.uart.3.disabled=1
-hint.uart.3.port=0x2E8
-hint.uart.3.irq=9
 hint.ppc.0.at=isa
 hint.ppc.0.irq=7
-hint.ed.0.at=isa
-hint.ed.0.disabled=1
-hint.ed.0.port=0x280
-hint.ed.0.irq=10
-hint.ed.0.maddr=0xd8000
-hint.cs.0.at=isa
-hint.cs.0.disabled=1
-hint.cs.0.port=0x300
-hint.sn.0.at=isa
-hint.sn.0.disabled=1
-hint.sn.0.port=0x300
-hint.sn.0.irq=10
-hint.ie.0.at=isa
-hint.ie.0.disabled=1
-hint.ie.0.port=0x300
-hint.ie.0.irq=10
-hint.ie.0.maddr=0xd
-hint.fe.0.at=isa
-hint.fe.0.disabled=1
-hint.fe.0.port=0x300
-hint.le.0.at=isa
-hint.le.0.disabled=1
-hint.le.0.port=0x280
-hint.le.0.irq=10
-hint.le.0.drq=0
 hint.atrtc.0.at=isa
 hint.atrtc.0.port=0x70
 hint.atrtc.0.irq=8
___
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: r192123 - stable/7/usr.sbin/pstat

2009-05-14 Thread Ed Schouten
Author: ed
Date: Thu May 14 22:01:00 2009
New Revision: 192123
URL: http://svn.freebsd.org/changeset/base/192123

Log:
  Make the layout of pstat -t less awful.
  
  Right now we have a device named consolectl, but pstat only reserves 7
  columns for the device name. Increase it to 10 to make it fit.
  
  This patch only applies to pre-MPSAFE TTY.

Modified:
  stable/7/usr.sbin/pstat/pstat.c

Modified: stable/7/usr.sbin/pstat/pstat.c
==
--- stable/7/usr.sbin/pstat/pstat.c Thu May 14 21:53:35 2009
(r192122)
+++ stable/7/usr.sbin/pstat/pstat.c Thu May 14 22:01:00 2009
(r192123)
@@ -215,7 +215,7 @@ static const char fhdr64[] =
 /* c000 -- RWAI 123 123 c000 1000 */
 
 static const char hdr[] =
-  LINE RAW CAN OUT IHIWT ILOWT OHWT LWT COL STATE  SESS  PGID DISC\n;
+ LINE RAW CAN OUT IHIWT ILOWT OHWT LWT COL STATE  SESS  PGID 
DISC\n;
 
 static void
 ttymode_kvm(void)
@@ -348,9 +348,9 @@ ttyprt(struct xtty *xt)
errx(1, struct xtty size mismatch);
if (usenumflag || xt-xt_dev == 0 ||
   (name = devname(xt-xt_dev, S_IFCHR)) == NULL)
-   printf(   %2d,%-2d, major(xt-xt_dev), minor(xt-xt_dev));
+   printf(%5d,%4d , major(xt-xt_dev), minor(xt-xt_dev));
else
-   (void)printf(%7s , name);
+   (void)printf(%10s , name);
(void)printf(%2ld %3ld , xt-xt_rawcc, xt-xt_cancc);
(void)printf(%3ld %5d %5d %4d %3d %7d , xt-xt_outcc,
xt-xt_ihiwat, xt-xt_ilowat, xt-xt_ohiwat, xt-xt_olowat,
___
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: r192125 - head/sys/kern

2009-05-14 Thread John Baldwin
Author: jhb
Date: Thu May 14 22:01:32 2009
New Revision: 192125
URL: http://svn.freebsd.org/changeset/base/192125

Log:
  - Use a separate sx lock to try to limit the number of concurrent userland
sysctl requests to avoid wiring too much user memory.  Only grab this
lock if the user's old buffer is larger than a page as a tradeoff to
allow more concurrency for common small requests.
  - Just use a shared lock on the sysctl tree for user sysctl requests now.
  
  MFC after:1 week

Modified:
  head/sys/kern/kern_sysctl.c

Modified: head/sys/kern/kern_sysctl.c
==
--- head/sys/kern/kern_sysctl.c Thu May 14 22:01:14 2009(r192124)
+++ head/sys/kern/kern_sysctl.c Thu May 14 22:01:32 2009(r192125)
@@ -77,11 +77,12 @@ static MALLOC_DEFINE(M_SYSCTLTMP, sysct
  * API rather than using the dynamic API.  Use of the dynamic API is
  * strongly encouraged for most code.
  *
- * This lock is also used to serialize userland sysctl requests.  Some
- * sysctls wire user memory, and serializing the requests limits the
- * amount of wired user memory in use.
+ * The sysctlmemlock is used to limit the amount of user memory wired for
+ * sysctl requests.  This is implemented by serializing any userland
+ * sysctl requests larger than a single page via an exclusive lock.
  */
 static struct sx sysctllock;
+static struct sx sysctlmemlock;
 
 #defineSYSCTL_SLOCK()  sx_slock(sysctllock)
 #defineSYSCTL_SUNLOCK()sx_sunlock(sysctllock)
@@ -543,6 +544,7 @@ sysctl_register_all(void *arg)
 {
struct sysctl_oid **oidp;
 
+   sx_init(sysctlmemlock, sysctl mem);
SYSCTL_INIT();
SYSCTL_XLOCK();
SET_FOREACH(oidp, sysctl_set)
@@ -1565,7 +1567,7 @@ userland_sysctl(struct thread *td, int *
 size_t *oldlenp, int inkernel, void *new, size_t newlen, size_t *retval,
 int flags)
 {
-   int error = 0;
+   int error = 0, memlocked;
struct sysctl_req req;
 
bzero(req, sizeof req);
@@ -1605,14 +1607,20 @@ userland_sysctl(struct thread *td, int *
if (KTRPOINT(curthread, KTR_SYSCTL))
ktrsysctl(name, namelen);
 #endif
-   
-   SYSCTL_XLOCK();
+
+   if (req.oldlen  PAGE_SIZE) {
+   memlocked = 1;
+   sx_xlock(sysctlmemlock);
+   } else
+   memlocked = 0;
CURVNET_SET(TD_TO_VNET(curthread));
 
for (;;) {
req.oldidx = 0;
req.newidx = 0;
+   SYSCTL_SLOCK();
error = sysctl_root(0, name, namelen, req);
+   SYSCTL_SUNLOCK();
if (error != EAGAIN)
break;
uio_yield();
@@ -1622,7 +1630,8 @@ userland_sysctl(struct thread *td, int *
 
if (req.lock == REQ_WIRED  req.validlen  0)
vsunlock(req.oldptr, req.validlen);
-   SYSCTL_XUNLOCK();
+   if (memlocked)
+   sx_xunlock(sysctlmemlock);
 
if (error  error != ENOMEM)
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: r192127 - head/sys/dev/bge

2009-05-14 Thread Xin LI
Author: delphij
Date: Thu May 14 22:33:37 2009
New Revision: 192127
URL: http://svn.freebsd.org/changeset/base/192127

Log:
  Try to workaround a race where bge_stop() may sneak in when bge_rxeof()
  drops and re-grabs the softc mutex in the middle, resulting in kernel
  trap 12.  This may happen when a lot of traffic is being hammered on
  one bge(4) interface while the system is shutting down.
  
  Reported by:  Alexander Sack pisymbol gmail com
  PR:   kern/134548
  MFC After:2 weeks

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

Modified: head/sys/dev/bge/if_bge.c
==
--- head/sys/dev/bge/if_bge.c   Thu May 14 22:13:17 2009(r192126)
+++ head/sys/dev/bge/if_bge.c   Thu May 14 22:33:37 2009(r192127)
@@ -3193,6 +3193,9 @@ bge_rxeof(struct bge_softc *sc)
BGE_UNLOCK(sc);
(*ifp-if_input)(ifp, m);
BGE_LOCK(sc);
+
+   if (!(ifp-if_drv_flags  IFF_DRV_RUNNING))
+   return;
}
 
if (stdcnt  0)
@@ -3301,6 +3304,10 @@ bge_poll(struct ifnet *ifp, enum poll_cm
 
sc-rxcycles = count;
bge_rxeof(sc);
+   if (!(ifp-if_drv_flags  IFF_DRV_RUNNING)) {
+   BGE_UNLOCK(sc);
+   return;
+   }
bge_txeof(sc);
if (!IFQ_DRV_IS_EMPTY(ifp-if_snd))
bge_start_locked(ifp);
@@ -3370,7 +3377,9 @@ bge_intr(void *xsc)
if (ifp-if_drv_flags  IFF_DRV_RUNNING) {
/* Check RX return ring producer/consumer. */
bge_rxeof(sc);
+   }
 
+   if (ifp-if_drv_flags  IFF_DRV_RUNNING) {
/* Check TX ring producer/consumer. */
bge_txeof(sc);
}
___
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: r192128 - head/sys/dev/bge

2009-05-14 Thread Xin LI
Author: delphij
Date: Thu May 14 22:36:56 2009
New Revision: 192128
URL: http://svn.freebsd.org/changeset/base/192128

Log:
  Some comment/space changes (FALLTHRU - FALLTHROUGH, space after while).

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

Modified: head/sys/dev/bge/if_bge.c
==
--- head/sys/dev/bge/if_bge.c   Thu May 14 22:33:37 2009(r192127)
+++ head/sys/dev/bge/if_bge.c   Thu May 14 22:36:56 2009(r192128)
@@ -2441,14 +2441,14 @@ bge_attach(device_t dev)
case BGE_ASICREV_BCM5780:
case BGE_ASICREV_BCM5714:
sc-bge_flags |= BGE_FLAG_5714_FAMILY /* | BGE_FLAG_JUMBO */;
-   /* FALLTHRU */
+   /* FALLTHROUGH */
case BGE_ASICREV_BCM5750:
case BGE_ASICREV_BCM5752:
case BGE_ASICREV_BCM5755:
case BGE_ASICREV_BCM5787:
case BGE_ASICREV_BCM5906:
sc-bge_flags |= BGE_FLAG_575X_PLUS;
-   /* FALLTHRU */
+   /* FALLTHROUGH */
case BGE_ASICREV_BCM5705:
sc-bge_flags |= BGE_FLAG_5705_PLUS;
break;
@@ -3073,7 +3073,7 @@ bge_rxeof(struct bge_softc *sc)
bus_dmamap_sync(sc-bge_cdata.bge_rx_jumbo_ring_tag,
sc-bge_cdata.bge_rx_jumbo_ring_map, BUS_DMASYNC_POSTREAD);
 
-   while(sc-bge_rx_saved_considx !=
+   while (sc-bge_rx_saved_considx !=
sc-bge_ldata.bge_status_block-bge_idx[0].bge_rx_prod_idx) {
struct bge_rx_bd*cur_rx;
uint32_trxidx;
___
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: r191762 - in head/sys: conf dev/bwi modules/bwi

2009-05-14 Thread Peter Jeremy
On 2009-May-03 04:01:43 +, Warner Losh i...@freebsd.org wrote:
  Bring in Andrew Thompson's port of Sepherosa Ziehau's bwi driver for
  Broadcom BCM43xx chipsets.

Thanks for this.  Is there a particular reason why it is not connected
to the build via either NOTES or modules/Makefile?

-- 
Peter Jeremy


pgp4upOwhkwGx.pgp
Description: PGP signature


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

2009-05-14 Thread Xin LI
Author: delphij
Date: Thu May 14 23:09:33 2009
New Revision: 192129
URL: http://svn.freebsd.org/changeset/base/192129

Log:
  As the comment says, close() frees the variable, record.  So we obtain
  the length by evaluating the value from the copy, cbuf instead.  This
  fixes a crash caused by previous commit (use-after-free)
  
  Submitted by: Dimitry Andric dimitry andric com
  Pointy hat to:delphij

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

Modified: head/lib/libc/gen/getcap.c
==
--- head/lib/libc/gen/getcap.c  Thu May 14 22:36:56 2009(r192128)
+++ head/lib/libc/gen/getcap.c  Thu May 14 23:09:33 2009(r192129)
@@ -260,7 +260,7 @@ getent(char **cap, u_int *len, char **db
errno = ENOMEM;
return (-2);
}
-   *len = strlen(record);
+   *len = strlen(cbuf);
*cap = cbuf;
return (retval);
} 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: r192130 - head/usr.sbin/sysinstall

2009-05-14 Thread Colin Percival
Author: cperciva
Date: Fri May 15 00:18:31 2009
New Revision: 192130
URL: http://svn.freebsd.org/changeset/base/192130

Log:
  Allow a comma-separated list of network interfaces to be specified via the
  netDev option in install.cfg.
  
  Submitted by: randi
  MFC after:1 week

Modified:
  head/usr.sbin/sysinstall/tcpip.c

Modified: head/usr.sbin/sysinstall/tcpip.c
==
--- head/usr.sbin/sysinstall/tcpip.cThu May 14 23:09:33 2009
(r192129)
+++ head/usr.sbin/sysinstall/tcpip.cFri May 15 00:18:31 2009
(r192130)
@@ -642,11 +642,26 @@ tcpDeviceSelect(void)
 {
 DMenu *menu;
 Device **devs, *rval;
+char *dev, *network_dev;
 int cnt;
 
+rval = NULL;
+
+if (variable_get(VAR_NONINTERACTIVE)  variable_get(VAR_NETWORK_DEVICE)) {
+   network_dev = variable_get(VAR_NETWORK_DEVICE);
+
+   while ((dev = strsep(network_dev, ,)) != NULL) {
+   devs = deviceFind(dev, DEVICE_TYPE_NETWORK);
+   cnt = deviceCount(devs);
+   if (cnt) {
+   if (DITEM_STATUS(tcpOpenDialog(devs[0]) == DITEM_SUCCESS))
+   return(devs[0]);
+   }
+   }
+}
+
 devs = deviceFind(variable_get(VAR_NETWORK_DEVICE), DEVICE_TYPE_NETWORK);
 cnt = deviceCount(devs);
-rval = NULL;
 
 if (!cnt) {
msgConfirm(No network devices available!);
@@ -660,14 +675,6 @@ tcpDeviceSelect(void)
if (DITEM_STATUS(tcpOpenDialog(devs[0]) == DITEM_SUCCESS))
rval = devs[0];
 }
-else if (variable_get(VAR_NONINTERACTIVE)  
variable_get(VAR_NETWORK_DEVICE)) {
-   devs = deviceFind(variable_get(VAR_NETWORK_DEVICE), 
DEVICE_TYPE_NETWORK);
-   cnt = deviceCount(devs);
-   if (cnt) {
-   if (DITEM_STATUS(tcpOpenDialog(devs[0]) == DITEM_SUCCESS))
-   rval = devs[0];
-   }
-}
 else {
int status;
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


RE: svn commit: r192085 - head/sys/netinet

2009-05-14 Thread Qing Li
 

 -Original Message-
 From: George Neville-Neil [mailto:g...@neville-neil.com] 
 Sent: Thursday, May 14, 2009 7:36 AM
 To: Qing Li
 Cc: src-committ...@freebsd.org; svn-src-all@FreeBSD.org; 
 svn-src-h...@freebsd.org
 Subject: Re: svn commit: r192085 - head/sys/netinet
 
 
 On May 13, 2009, at 22:27 , Qing Li wrote:
 
  Author: qingli
  Date: Thu May 14 05:27:09 2009
  New Revision: 192085
  URL: http://svn.freebsd.org/changeset/base/192085
 
  Log:
   Ignore the INADDR_ANY address inserted/deleted by DHCP when 
  installing a loopback route  to the interface address.
 
 


 
 Can you give more detail as to the purpose of this change?  
 I'm a bit confused by it.  Does this fix any of the recent 
 problems seen with DHCP and PXE or is this unrelated?
 

The DHCP client code adds a 0.0.0.0 address and then deletes
it once the server assign the node a real IP. It's easily
Observed by running dhclient followed by netstat.

I had to take care of this DHCP related bits before, e.g.,
not creating an ARP entry for it.

That's really it.  

Exactly which part is confusing you ? 

-- Qing


___
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: r192027 - head/sys/arm/at91

2009-05-14 Thread M. Warner Losh
In message: 200905122114.n4cleag9033...@svn.freebsd.org
Stanislav Sedov s...@freebsd.org writes:
: @@ -926,6 +937,7 @@ atestart_locked(struct ifnet *ifp)
:* tell the hardware to xmit the packet.
:*/
:   WR4(sc, ETH_TAR, segs[0].ds_addr);
: + BARRIER(sc, ETH_TAR, 8, BUS_SPACE_BARRIER_WRITE);
:   WR4(sc, ETH_TCR, segs[0].ds_len);

Why is a barrier needed here?

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


Re: svn commit: r192059 - in head/sys: arm/at91 dev/spibus

2009-05-14 Thread M. Warner Losh
In message: 20090514002555.f56ba38b.s...@freebsd.org
Stanislav Sedov s...@freebsd.org writes:
: On Wed, 13 May 2009 18:42:49 + (UTC)
: Oleksandr Tymoshenko go...@freebsd.org mentioned:
: 
:  Author: gonzo
:  Date: Wed May 13 18:42:49 2009
:  New Revision: 192059
:  URL: http://svn.freebsd.org/changeset/base/192059
:  
:  Log:
:- Make SPI bus bridge be non-arch dependent by using more generic
:name
:
:Reviewed by:  imp
:  
:  Modified:
:head/sys/arm/at91/at91_spi.c
:head/sys/dev/spibus/spibus.c
:  
:  Modified: head/sys/arm/at91/at91_spi.c
:  
==
:  --- head/sys/arm/at91/at91_spi.cWed May 13 18:31:28 2009
(r192058)
:  +++ head/sys/arm/at91/at91_spi.cWed May 13 18:42:49 2009
(r192059)
:  @@ -297,7 +297,7 @@ static device_method_t at91_spi_methods[
:   };
:   
:   static driver_t at91_spi_driver = {
:  -   at91_spi,
:  +   spi,
:  at91_spi_methods,
:  sizeof(struct at91_spi_softc),
:   };
:  
:  Modified: head/sys/dev/spibus/spibus.c
:  
==
:  --- head/sys/dev/spibus/spibus.cWed May 13 18:31:28 2009
(r192058)
:  +++ head/sys/dev/spibus/spibus.cWed May 13 18:42:49 2009
(r192059)
:  @@ -194,5 +194,5 @@ static driver_t spibus_driver = {
:   
:   devclass_t spibus_devclass;
:   
:  -DRIVER_MODULE(spibus, at91_spi, spibus_driver, spibus_devclass, 0, 0);
:  +DRIVER_MODULE(spibus, spi, spibus_driver, spibus_devclass, 0, 0);
:   MODULE_VERSION(spibus, 1);
:  
: 
: On the other hand this driver appears to be machine-specific. What if one
: would like to have a kernel with several SPI bus drivers included for devices
: that doesn't support enumeration? In this case it will be impossible to
: diffirentiate these drivers in the hints file.

The driver is machine specific.  However, there's almost certainly
only ever going to be one of these drivers that attaches to a given
bus.  It is little different from the variety pci bridge drivers we
have, for example, that all have the same name.

Unlike the i2c case we had recently (which is about devices that
attach to i2c), this driver is a controller for the spi bus.

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


Re: svn commit: r191762 - in head/sys: conf dev/bwi modules/bwi

2009-05-14 Thread M. Warner Losh
In message: 20090514224925.gb57...@server.vk2pj.dyndns.org
Peter Jeremy peterjer...@optushome.com.au writes:
: On 2009-May-03 04:01:43 +, Warner Losh i...@freebsd.org wrote:
:   Bring in Andrew Thompson's port of Sepherosa Ziehau's bwi driver for
:   Broadcom BCM43xx chipsets.
: 
: Thanks for this.  Is there a particular reason why it is not connected
: to the build via either NOTES or modules/Makefile?

I haven't gotten around to it. :)  There's no man page either.  And
maybe a couple of other things missing...

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: r192135 - head/sys/arm/at91

2009-05-14 Thread Warner Losh
Author: imp
Date: Fri May 15 04:49:20 2009
New Revision: 192135
URL: http://svn.freebsd.org/changeset/base/192135

Log:
  Fix name for driver to assign to the SPI device.

Modified:
  head/sys/arm/at91/at91.c

Modified: head/sys/arm/at91/at91.c
==
--- head/sys/arm/at91/at91.cFri May 15 04:33:35 2009(r192134)
+++ head/sys/arm/at91/at91.cFri May 15 04:49:20 2009(r192135)
@@ -409,7 +409,7 @@ struct cpu_devs at91rm9200_devs[] =
AT91RM92_IRQ_SSC2
},
{
-   at91_spi, 0,
+   spi, 0,
AT91RM92_BASE + AT91RM92_SPI_BASE, AT91RM92_SPI_SIZE,
AT91RM92_IRQ_SPI
},
___
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: r192027 - head/sys/arm/at91

2009-05-14 Thread Stanislav Sedov
On Thu, 14 May 2009 21:37:12 -0600 (MDT)
M. Warner Losh i...@bsdimp.com mentioned:

 In message: 200905122114.n4cleag9033...@svn.freebsd.org
 Stanislav Sedov s...@freebsd.org writes:
 : @@ -926,6 +937,7 @@ atestart_locked(struct ifnet *ifp)
 :  * tell the hardware to xmit the packet.
 :  */
 : WR4(sc, ETH_TAR, segs[0].ds_addr);
 : +   BARRIER(sc, ETH_TAR, 8, BUS_SPACE_BARRIER_WRITE);
 : WR4(sc, ETH_TCR, segs[0].ds_len);
 
 Why is a barrier needed here?
 
Writing the TCR register triggers the transmit, so it had to be written
strongly after the TAR register. That's why I added the barrier here.

-- 
Stanislav Sedov
ST4096-RIPE

!DSPAM:4a0cfbe4994295595297431!


___
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: r192033 - stable/7/sys/dev/ata

2009-05-14 Thread Bruce Simpson

Hi,

Could this commit have broken boot on my amd64 system with an ULi SATA 
controller?


I have not fully bisected (and to be honest, who really has time to do 
this for production machines, unless


The panic I get with RELENG_7 sources as of yesterday after this commit 
is 'resource list busy'. If you need any more information let me know, I 
have transcribed the backtrace and posted it to sta...@.


thanks,
BMS

Alexander Motin wrote:

Author: mav
Date: Wed May 13 02:55:21 2009
New Revision: 192033
URL: http://svn.freebsd.org/changeset/base/192033

Log:
  Make vendor-specific drivers prefered over the generic AHCI one.
  This fixes some controllers, like JMicron ones, which provide also PATA via
  PCI function that declared as AHCI controller.
  
  This is not an MFC, but the same was already done in 8-CURRENT in other way.
  
  PR:		kern/132082


...
  


___
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: r192027 - head/sys/arm/at91

2009-05-14 Thread M. Warner Losh
In message: 20090515092205.6f6d06fa.s...@freebsd.org
Stanislav Sedov s...@freebsd.org writes:
: On Thu, 14 May 2009 21:37:12 -0600 (MDT)
: M. Warner Losh i...@bsdimp.com mentioned:
: 
:  In message: 200905122114.n4cleag9033...@svn.freebsd.org
:  Stanislav Sedov s...@freebsd.org writes:
:  : @@ -926,6 +937,7 @@ atestart_locked(struct ifnet *ifp)
:  :* tell the hardware to xmit the packet.
:  :*/
:  :   WR4(sc, ETH_TAR, segs[0].ds_addr);
:  : + BARRIER(sc, ETH_TAR, 8, BUS_SPACE_BARRIER_WRITE);
:  :   WR4(sc, ETH_TCR, segs[0].ds_len);
:  
:  Why is a barrier needed here?
:  
: Writing the TCR register triggers the transmit, so it had to be written
: strongly after the TAR register. That's why I added the barrier here.

Then shouldn't the barrier be after TCR write?  Or does this ensure
that the write is before TCR?

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