svn commit: r236433 - head/usr.bin/find

2012-06-01 Thread Eitan Adler
Author: eadler
Date: Sat Jun  2 03:13:27 2012
New Revision: 236433
URL: http://svn.freebsd.org/changeset/base/236433

Log:
  Document the limitations of the -delete primary
  
  PR:   bin/166554
  Submitted by: Richard Kettlewell 
  Discussed with:   jilles
  Approved by:  bcr
  MFC after:3 days

Modified:
  head/usr.bin/find/find.1

Modified: head/usr.bin/find/find.1
==
--- head/usr.bin/find/find.1Sat Jun  2 02:27:01 2012(r236432)
+++ head/usr.bin/find/find.1Sat Jun  2 03:13:27 2012(r236433)
@@ -31,7 +31,7 @@
 .\"@(#)find.1  8.7 (Berkeley) 5/9/95
 .\" $FreeBSD$
 .\"
-.Dd September 28, 2011
+.Dd May 06, 2012
 .Dt FIND 1
 .Os
 .Sh NAME
@@ -319,6 +319,9 @@ character in its pathname relative to
 .Dq Pa \&.
 for security reasons.
 Depth-first traversal processing is implied by this option.
+The
+.Ic -delete
+primary will fail to delete a directory if it is not empty.
 Following symlinks is incompatible with this option.
 .It Ic -depth
 Always true;
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r236427 - in head/sys: conf dev/isp

2012-06-01 Thread Matt Jacob
Author: mjacob
Date: Fri Jun  1 23:29:48 2012
New Revision: 236427
URL: http://svn.freebsd.org/changeset/base/236427

Log:
  Clean up and complete the incomplete deferred enable code.
  Make the default role NONE if target mode is selected. This
  allows ctl(8) to switch to/from target mode via knob settings.
  If we default to role 'none', this causes a reset of the
  24XX f/w which then causes initiators to wake up and notice
  when we come online.
  
  Reviewed by:kdm
  MFC after:  2 weeks
  Sponsored by:   Spectralogic

Modified:
  head/sys/conf/NOTES
  head/sys/dev/isp/isp.c
  head/sys/dev/isp/isp_freebsd.c
  head/sys/dev/isp/isp_freebsd.h
  head/sys/dev/isp/ispvar.h

Modified: head/sys/conf/NOTES
==
--- head/sys/conf/NOTES Fri Jun  1 23:24:56 2012(r236426)
+++ head/sys/conf/NOTES Fri Jun  1 23:29:48 2012(r236427)
@@ -1603,7 +1603,7 @@ options   ISP_TARGET_MODE=1
 #
 #  ISP_INTERNAL_TARGET (trivial internal disk target, for 
testing)
 #
-optionsISP_DEFAULT_ROLES=2
+optionsISP_DEFAULT_ROLES=0
 
 # Options used in dev/sym/ (Symbios SCSI driver).
 #options   SYM_SETUP_LP_PROBE_MAP  #-Low Priority Probe Map (bits)

Modified: head/sys/dev/isp/isp.c
==
--- head/sys/dev/isp/isp.c  Fri Jun  1 23:24:56 2012(r236426)
+++ head/sys/dev/isp/isp.c  Fri Jun  1 23:29:48 2012(r236427)
@@ -2306,6 +2306,11 @@ isp_port_login(ispsoftc_t *isp, uint16_t
}
 }
 
+/*
+ * Pre-24XX fabric port logout
+ *
+ * Note that portid is not used
+ */
 static int
 isp_port_logout(ispsoftc_t *isp, uint16_t handle, uint32_t portid)
 {
@@ -2750,7 +2755,7 @@ not_on_fabric:
  * layer appropriately).
  *
  * We also do initiator map target id assignment here for new initiator
- * devices and refresh old ones ot make sure that they point to the corret
+ * devices and refresh old ones ot make sure that they point to the correct
  * entities.
  */
 static int

Modified: head/sys/dev/isp/isp_freebsd.c
==
--- head/sys/dev/isp/isp_freebsd.c  Fri Jun  1 23:24:56 2012
(r236426)
+++ head/sys/dev/isp/isp_freebsd.c  Fri Jun  1 23:29:48 2012
(r236427)
@@ -781,6 +781,9 @@ isp_free_pcmd(ispsoftc_t *isp, union ccb
  */
 
 #ifdef ISP_TARGET_MODE
+static ISP_INLINE void isp_tmlock(ispsoftc_t *, const char *);
+static ISP_INLINE void isp_tmunlk(ispsoftc_t *);
+static ISP_INLINE int is_any_lun_enabled(ispsoftc_t *, int);
 static ISP_INLINE int is_lun_enabled(ispsoftc_t *, int, lun_id_t);
 static ISP_INLINE tstate_t *get_lun_statep(ispsoftc_t *, int, lun_id_t);
 static ISP_INLINE tstate_t *get_lun_statep_from_tag(ispsoftc_t *, int, 
uint32_t);
@@ -794,10 +797,11 @@ static ISP_INLINE void isp_put_ntpd(isps
 static cam_status create_lun_state(ispsoftc_t *, int, struct cam_path *, 
tstate_t **);
 static void destroy_lun_state(ispsoftc_t *, tstate_t *);
 static void isp_enable_lun(ispsoftc_t *, union ccb *);
-static void isp_enable_deferred_luns(ispsoftc_t *, int);
+static cam_status isp_enable_deferred_luns(ispsoftc_t *, int);
 static cam_status isp_enable_deferred(ispsoftc_t *, int, lun_id_t);
 static void isp_disable_lun(ispsoftc_t *, union ccb *);
 static int isp_enable_target_mode(ispsoftc_t *, int);
+static int isp_disable_target_mode(ispsoftc_t *, int);
 static void isp_ledone(ispsoftc_t *, lun_entry_t *);
 static timeout_t isp_refire_putback_atio;
 static void isp_complete_ctio(union ccb *);
@@ -815,6 +819,40 @@ static void isp_handle_platform_target_t
 static void isp_target_mark_aborted(ispsoftc_t *, union ccb *);
 static void isp_target_mark_aborted_early(ispsoftc_t *, tstate_t *, uint32_t);
 
+static ISP_INLINE void
+isp_tmlock(ispsoftc_t *isp, const char *msg)
+{
+   while (isp->isp_osinfo.tmbusy) {
+   isp->isp_osinfo.tmwanted = 1;
+   mtx_sleep(isp, &isp->isp_lock, PRIBIO, msg, 0);
+   }
+   isp->isp_osinfo.tmbusy = 1;
+}
+
+static ISP_INLINE void
+isp_tmunlk(ispsoftc_t *isp)
+{
+   isp->isp_osinfo.tmbusy = 0;
+   if (isp->isp_osinfo.tmwanted) {
+   isp->isp_osinfo.tmwanted = 0;
+   wakeup(isp);
+   }
+}
+
+static ISP_INLINE int
+is_any_lun_enabled(ispsoftc_t *isp, int bus)
+{
+   struct tslist *lhp;
+   int i;
+
+   for (i = 0; i < LUN_HASH_SIZE; i++) {
+   ISP_GET_PC_ADDR(isp, bus, lun_hash[i], lhp);
+   if (SLIST_FIRST(lhp))
+   return (1);
+   }
+   return (0);
+}
+
 static ISP_INLINE int
 is_lun_enabled(ispsoftc_t *isp, int bus, lun_id_t lun)
 {
@@ -917,6 +955,7 @@ get_ntp_from_tagdata(ispsoftc_t *isp, ui
}
return (NULL);
 }
+
 static ISP_INLINE void
 rls_lun_statep(ispsoftc_t *isp, tstate_t *tptr)
 {
@@ -1058,7 +1097,7 @@ create_lun_state(ispsoftc_t *isp, int b

svn commit: r236426 - head/sys/cam/ctl

2012-06-01 Thread Matt Jacob
Author: mjacob
Date: Fri Jun  1 23:24:56 2012
New Revision: 236426
URL: http://svn.freebsd.org/changeset/base/236426

Log:
  Print FC PortID as a hex number. This makes it easy to
  figure out domain, etc..
  
  Zero ATIO and INOTify allocations. It makes for much
  less guesswork when looking at the structure and
  seeing 'deadc0de' present.
  
  Reviewed by:  kdm
  MFC after:2 weeks
  Sponsored by: Spectralogic

Modified:
  head/sys/cam/ctl/scsi_ctl.c

Modified: head/sys/cam/ctl/scsi_ctl.c
==
--- head/sys/cam/ctl/scsi_ctl.c Fri Jun  1 23:19:39 2012(r236425)
+++ head/sys/cam/ctl/scsi_ctl.c Fri Jun  1 23:24:56 2012(r236426)
@@ -490,7 +490,7 @@ ctlfeasync(void *callback_arg, uint32_t 
 
dev_chg = (struct ac_device_changed *)ac->contract_data;
 
-   printf("%s: WWPN %#jx port %u path %u target %u %s\n",
+   printf("%s: WWPN %#jx port 0x%06x path %u target %u 
%s\n",
   __func__, dev_chg->wwpn, dev_chg->port,
   xpt_path_path_id(path), dev_chg->target,
   (dev_chg->arrived == 0) ?  "left" : "arrived");
@@ -582,7 +582,7 @@ ctlferegister(struct cam_periph *periph,
union ccb *new_ccb;
 
new_ccb = (union ccb *)malloc(sizeof(*new_ccb), M_CTLFE,
- M_NOWAIT);
+ M_ZERO|M_NOWAIT);
if (new_ccb == NULL) {
status = CAM_RESRC_UNAVAIL;
break;
@@ -616,7 +616,7 @@ ctlferegister(struct cam_periph *periph,
union ccb *new_ccb;
 
new_ccb = (union ccb *)malloc(sizeof(*new_ccb), M_CTLFE,
- M_NOWAIT);
+ M_ZERO|M_NOWAIT);
if (new_ccb == NULL) {
status = CAM_RESRC_UNAVAIL;
break;
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r236424 - in head/sys: amd64/acpica dev/acpica dev/acpica/Osd i386/acpica

2012-06-01 Thread Jung-uk Kim
Author: jkim
Date: Fri Jun  1 21:33:33 2012
New Revision: 236424
URL: http://svn.freebsd.org/changeset/base/236424

Log:
  Consistently use ACPI_SUCCESS() and ACPI_FAILURE() macros wherever possible.

Modified:
  head/sys/amd64/acpica/acpi_wakeup.c
  head/sys/dev/acpica/Osd/OsdSynch.c
  head/sys/dev/acpica/acpi_ec.c
  head/sys/dev/acpica/acpivar.h
  head/sys/i386/acpica/acpi_wakeup.c

Modified: head/sys/amd64/acpica/acpi_wakeup.c
==
--- head/sys/amd64/acpica/acpi_wakeup.c Fri Jun  1 21:29:26 2012
(r236423)
+++ head/sys/amd64/acpica/acpi_wakeup.c Fri Jun  1 21:33:33 2012
(r236424)
@@ -263,8 +263,7 @@ acpi_sleep_machdep(struct acpi_softc *sc
status = AcpiEnterSleepStateS4bios();
else
status = AcpiEnterSleepState(state, acpi_sleep_flags);
-
-   if (status != AE_OK) {
+   if (ACPI_FAILURE(status)) {
device_printf(sc->acpi_dev,
"AcpiEnterSleepState failed - %s\n",
AcpiFormatException(status));

Modified: head/sys/dev/acpica/Osd/OsdSynch.c
==
--- head/sys/dev/acpica/Osd/OsdSynch.c  Fri Jun  1 21:29:26 2012
(r236423)
+++ head/sys/dev/acpica/Osd/OsdSynch.c  Fri Jun  1 21:33:33 2012
(r236424)
@@ -208,7 +208,7 @@ AcpiOsWaitSemaphore(ACPI_SEMAPHORE Handl
tmo -= slptick;
}
}
-   if (status == AE_OK)
+   if (ACPI_SUCCESS(status))
as->as_units -= Units;
 
mtx_unlock(&as->as_lock);
@@ -402,7 +402,7 @@ AcpiOsAcquireMutex(ACPI_MUTEX Handle, UI
tmo -= slptick;
}
}
-   if (status == AE_OK)
+   if (ACPI_SUCCESS(status))
am->am_owner = curthread;
 
mtx_unlock(&am->am_lock);

Modified: head/sys/dev/acpica/acpi_ec.c
==
--- head/sys/dev/acpica/acpi_ec.c   Fri Jun  1 21:29:26 2012
(r236423)
+++ head/sys/dev/acpica/acpi_ec.c   Fri Jun  1 21:33:33 2012
(r236424)
@@ -649,8 +649,8 @@ EcGpeQueryHandler(void *Context)
Status = EcCommand(sc, EC_COMMAND_QUERY);
if (ACPI_SUCCESS(Status))
break;
-   if (EcCheckStatus(sc, "retr_check",
-   EC_EVENT_INPUT_BUFFER_EMPTY) == AE_OK)
+   if (ACPI_SUCCESS(EcCheckStatus(sc, "retr_check",
+   EC_EVENT_INPUT_BUFFER_EMPTY)))
continue;
else
break;
@@ -845,7 +845,7 @@ EcWaitEvent(struct acpi_ec_softc *sc, EC
DELAY(10);
for (i = 0; i < count; i++) {
Status = EcCheckStatus(sc, "poll", Event);
-   if (Status == AE_OK)
+   if (ACPI_SUCCESS(Status))
break;
DELAY(EC_POLL_DELAY);
}
@@ -875,7 +875,7 @@ EcWaitEvent(struct acpi_ec_softc *sc, EC
 * event we are actually waiting for.
 */
Status = EcCheckStatus(sc, "sleep", Event);
-   if (Status == AE_OK) {
+   if (ACPI_SUCCESS(Status)) {
if (gen_count == sc->ec_gencount)
no_intr++;
else
@@ -890,7 +890,7 @@ EcWaitEvent(struct acpi_ec_softc *sc, EC
 * read the register once and trust whatever value we got.  This is
 * the best we can do at this point.
 */
-   if (Status != AE_OK)
+   if (ACPI_FAILURE(Status))
Status = EcCheckStatus(sc, "sleep_end", Event);
 }
 if (!need_poll && no_intr > 10) {
@@ -898,7 +898,7 @@ EcWaitEvent(struct acpi_ec_softc *sc, EC
"not getting interrupts, switched to polled mode\n");
ec_polled_mode = 1;
 }
-if (Status != AE_OK)
+if (ACPI_FAILURE(Status))
CTR0(KTR_ACPI, "error: ec wait timed out");
 return (Status);
 }
@@ -977,8 +977,8 @@ EcRead(struct acpi_ec_softc *sc, UINT8 A
EC_SET_DATA(sc, Address);
status = EcWaitEvent(sc, EC_EVENT_OUTPUT_BUFFER_FULL, gen_count);
if (ACPI_FAILURE(status)) {
-   if (EcCheckStatus(sc, "retr_check",
-   EC_EVENT_INPUT_BUFFER_EMPTY) == AE_OK)
+   if (ACPI_SUCCESS(EcCheckStatus(sc, "retr_check",
+   EC_EVENT_INPUT_BUFFER_EMPTY)))
continue;
else
break;

Modified: head/sys/dev/acpica/acpivar.h
==
--- head/sys/dev/acpica/acpivar.h   Fri Jun  1 21:29:26 2012
(r236423)
+++ head/sys/dev/acpica/acpivar.h   Fri Jun  1 21:33:33 2012
(r236424)
@@ -273,7 +273,7 @@ acpi_get_type(device_t dev)
 
 if ((h = acpi_get_handle(dev)) == NULL)
return (ACPI_TYPE_NOT_FOUND);
-if (AcpiGetType(h, &t) != AE_OK)
+if (ACPI_FAILURE(AcpiGetType(h, &t)))
  

svn commit: r236422 - in head/kerberos5: . lib/libasn1 lib/libgssapi_spnego lib/libhdb lib/libhx509 lib/libroken lib/libvers libexec/kdigest tools/slc usr.bin/hxtool usr.bin/kadmin usr.bin/kcc usr....

2012-06-01 Thread David E. O'Brien
Author: obrien
Date: Fri Jun  1 21:26:28 2012
New Revision: 236422
URL: http://svn.freebsd.org/changeset/base/236422

Log:
  Centralize the specification of the krb5 build tools.

Modified:
  head/kerberos5/Makefile.inc
  head/kerberos5/lib/libasn1/Makefile
  head/kerberos5/lib/libgssapi_spnego/Makefile
  head/kerberos5/lib/libhdb/Makefile
  head/kerberos5/lib/libhx509/Makefile
  head/kerberos5/lib/libroken/Makefile
  head/kerberos5/lib/libvers/Makefile
  head/kerberos5/libexec/kdigest/Makefile
  head/kerberos5/tools/slc/Makefile
  head/kerberos5/usr.bin/hxtool/Makefile
  head/kerberos5/usr.bin/kadmin/Makefile
  head/kerberos5/usr.bin/kcc/Makefile
  head/kerberos5/usr.sbin/iprop-log/Makefile
  head/kerberos5/usr.sbin/ktutil/Makefile

Modified: head/kerberos5/Makefile.inc
==
--- head/kerberos5/Makefile.inc Fri Jun  1 21:22:46 2012(r236421)
+++ head/kerberos5/Makefile.inc Fri Jun  1 21:26:28 2012(r236422)
@@ -46,3 +46,7 @@ CLEANFILES+=  ${_ET}.h ${_ET}.c
 .endfor
 
 .endif # defined(SRCS)
+
+ASN1_COMPILE=  asn1_compile
+MAKE_ROKEN=make-roken
+SLC=   slc

Modified: head/kerberos5/lib/libasn1/Makefile
==
--- head/kerberos5/lib/libasn1/Makefile Fri Jun  1 21:22:46 2012
(r236421)
+++ head/kerberos5/lib/libasn1/Makefile Fri Jun  1 21:26:28 2012
(r236422)
@@ -56,8 +56,6 @@ INCS+=krb5_asn1.h \
digest_asn1.h \
kx509_asn1.h
 
-ASN1_COMPILE=  asn1_compile
-
 ${GEN_CMS}: cms.asn1 cms.opt
${ASN1_COMPILE} --one-code-file \
--option-file=${.ALLSRC:M*.opt} ${.ALLSRC:M*.asn1} cms_asn1

Modified: head/kerberos5/lib/libgssapi_spnego/Makefile
==
--- head/kerberos5/lib/libgssapi_spnego/MakefileFri Jun  1 21:22:46 
2012(r236421)
+++ head/kerberos5/lib/libgssapi_spnego/MakefileFri Jun  1 21:26:28 
2012(r236422)
@@ -38,8 +38,6 @@ CFLAGS+=-I${KRB5DIR}/lib/roken -I.
 CLEANFILES=${GEN} ${GEN:S/.x$/.c/:S/.hx$/.h/} \
spnego_asn1_files spnego_asn1-template.c
 
-ASN1_COMPILE=  asn1_compile
-
 ${GEN}: spnego.asn1 spnego.opt
${ASN1_COMPILE} --option-file=${.ALLSRC:M*.opt} \
${.ALLSRC:M*.asn1} spnego_asn1

Modified: head/kerberos5/lib/libhdb/Makefile
==
--- head/kerberos5/lib/libhdb/Makefile  Fri Jun  1 21:22:46 2012
(r236421)
+++ head/kerberos5/lib/libhdb/Makefile  Fri Jun  1 21:26:28 2012
(r236422)
@@ -84,8 +84,6 @@ GEN=  asn1_Salt.x \
 CLEANFILES=${GEN} ${GEN:S/.x$/.c/:S/.hx$/.h/} hdb_asn1_files \
hdb_asn1-template.[ch]*
 
-ASN1_COMPILE=  asn1_compile
-
 ${GEN}: hdb.asn1
${ASN1_COMPILE} ${.ALLSRC:M*.asn1} hdb_asn1
 

Modified: head/kerberos5/lib/libhx509/Makefile
==
--- head/kerberos5/lib/libhx509/MakefileFri Jun  1 21:22:46 2012
(r236421)
+++ head/kerberos5/lib/libhx509/MakefileFri Jun  1 21:26:28 2012
(r236422)
@@ -269,8 +269,6 @@ CLEANFILES= ${GEN} ${GEN:S/.x$/.c/:S/.hx
 
 INCS+= ocsp_asn1.h pkcs10_asn1.h crmf_asn1.h
 
-ASN1_COMPILE=  asn1_compile
-
 ${GEN_OCSP}: ocsp.asn1 ocsp.opt
${ASN1_COMPILE} --option-file=${.ALLSRC:M*.opt} \
 ${.ALLSRC:M*.asn1} ocsp_asn1

Modified: head/kerberos5/lib/libroken/Makefile
==
--- head/kerberos5/lib/libroken/MakefileFri Jun  1 21:22:46 2012
(r236421)
+++ head/kerberos5/lib/libroken/MakefileFri Jun  1 21:26:28 2012
(r236422)
@@ -82,8 +82,6 @@ CFLAGS+=-I${KRB5DIR}/lib/roken -I.
 
 CLEANFILES= roken.h
 
-MAKE_ROKEN=make-roken
-
 roken.h:
${MAKE_ROKEN} > ${.TARGET}
 

Modified: head/kerberos5/lib/libvers/Makefile
==
--- head/kerberos5/lib/libvers/Makefile Fri Jun  1 21:22:46 2012
(r236421)
+++ head/kerberos5/lib/libvers/Makefile Fri Jun  1 21:26:28 2012
(r236422)
@@ -7,8 +7,6 @@ CFLAGS+=-I. -I${KRB5DIR}/lib/roken
 
 CLEANFILES= roken.h
 
-MAKE_ROKEN=make-roken
-
 roken.h:
${MAKE_ROKEN} > ${.TARGET}
 

Modified: head/kerberos5/libexec/kdigest/Makefile
==
--- head/kerberos5/libexec/kdigest/Makefile Fri Jun  1 21:22:46 2012
(r236421)
+++ head/kerberos5/libexec/kdigest/Makefile Fri Jun  1 21:26:28 2012
(r236422)
@@ -14,7 +14,7 @@ SRCS= kdigest.c \
kdigest-commands.h
 
 kdigest-commands.h: kdigest-commands.in
-   slc ${.ALLSRC:M*.in}
+   ${SLC} ${.ALLSRC:M*.in}
 
 .for ext in c o
 kdigest-commands.${ext}: kdigest-commands.h

Modified: head/kerberos5

svn commit: r236420 - head/share/man/man4

2012-06-01 Thread Joel Dahl
Author: joel (doc committer)
Date: Fri Jun  1 19:26:38 2012
New Revision: 236420
URL: http://svn.freebsd.org/changeset/base/236420

Log:
  mdoc: terminate quoted string and remove unneeded paragraph macro.

Modified:
  head/share/man/man4/bce.4

Modified: head/share/man/man4/bce.4
==
--- head/share/man/man4/bce.4   Fri Jun  1 19:19:04 2012(r236419)
+++ head/share/man/man4/bce.4   Fri Jun  1 19:26:38 2012(r236420)
@@ -317,7 +317,7 @@ address space.
 .It "bce%d: Could not allocate TX descriptor chain DMA tag!"
 The driver could not allocate a DMA tag for the controller's
 TX chain.
-.It "bce%d: Could not allocate TX descriptor chain DMA memory!
+.It "bce%d: Could not allocate TX descriptor chain DMA memory!"
 The driver could not allocate DMA addressable memory for the controller's
 TX chain.
 .It "bce%d: Could not map TX descriptor chain DMA memory!"
@@ -401,7 +401,6 @@ If the problem continues replace the con
 For general information and support,
 go to the Broadcom NIC Open Source Developer Resource Site:
 .Pa http://www.broadcom.com/support/ethernet_nic/open_source.php .
-.Pp
 .Sh SEE ALSO
 .Xr altq 4 ,
 .Xr arp 4 ,
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r236419 - in head/sys: amd64/acpica i386/acpica

2012-06-01 Thread Jung-uk Kim
Author: jkim
Date: Fri Jun  1 19:19:04 2012
New Revision: 236419
URL: http://svn.freebsd.org/changeset/base/236419

Log:
  Tidy up code clutter in SMP case a bit.  No functional change.

Modified:
  head/sys/amd64/acpica/acpi_wakeup.c
  head/sys/i386/acpica/acpi_wakeup.c

Modified: head/sys/amd64/acpica/acpi_wakeup.c
==
--- head/sys/amd64/acpica/acpi_wakeup.c Fri Jun  1 19:09:17 2012
(r236418)
+++ head/sys/amd64/acpica/acpi_wakeup.c Fri Jun  1 19:19:04 2012
(r236419)
@@ -71,15 +71,12 @@ extern int  acpi_reset_video;
 #ifdef SMP
 extern struct pcb  **susppcbs;
 extern void**suspfpusave;
+static cpuset_tsuspcpus;
 #else
 static struct pcb  **susppcbs;
 static void**suspfpusave;
 #endif
 
-#ifdef SMP
-static cpuset_tsuspcpus;
-#endif
-
 intacpi_restorecpu(uint64_t, vm_offset_t);
 
 static void*acpi_alloc_wakeup_handler(void);
@@ -87,7 +84,7 @@ static void   acpi_stop_beep(void *);
 
 #ifdef SMP
 static int acpi_wakeup_ap(struct acpi_softc *, int);
-static voidacpi_wakeup_cpus(struct acpi_softc *, const cpuset_t *);
+static voidacpi_wakeup_cpus(struct acpi_softc *);
 #endif
 
 #defineWAKECODE_VADDR(sc)  ((sc)->acpi_wakeaddr + (3 * PAGE_SIZE))
@@ -184,7 +181,7 @@ acpi_wakeup_ap(struct acpi_softc *sc, in
 #defineBIOS_WARM   (0x0a)
 
 static void
-acpi_wakeup_cpus(struct acpi_softc *sc, const cpuset_t *wakeup_cpus)
+acpi_wakeup_cpus(struct acpi_softc *sc)
 {
uint32_tmpbioswarmvec;
int cpu;
@@ -203,7 +200,7 @@ acpi_wakeup_cpus(struct acpi_softc *sc, 
 
/* Wake up each AP. */
for (cpu = 1; cpu < mp_ncpus; cpu++) {
-   if (!CPU_ISSET(cpu, wakeup_cpus))
+   if (!CPU_ISSET(cpu, &suspcpus))
continue;
if (acpi_wakeup_ap(sc, cpu) == 0) {
/* restore the warmstart vector */
@@ -244,8 +241,7 @@ acpi_sleep_machdep(struct acpi_softc *sc
if (savectx(susppcbs[0])) {
ctx_fpusave(suspfpusave[0]);
 #ifdef SMP
-   if (!CPU_EMPTY(&suspcpus) &&
-   suspend_cpus(suspcpus) == 0) {
+   if (!CPU_EMPTY(&suspcpus) && suspend_cpus(suspcpus) == 0) {
device_printf(sc->acpi_dev, "Failed to suspend APs\n");
return (0); /* couldn't sleep */
}
@@ -300,7 +296,7 @@ acpi_wakeup_machdep(struct acpi_softc *s
PCPU_SET(switchticks, ticks);
 #ifdef SMP
if (!CPU_EMPTY(&suspcpus))
-   acpi_wakeup_cpus(sc, &suspcpus);
+   acpi_wakeup_cpus(sc);
 #endif
}
 

Modified: head/sys/i386/acpica/acpi_wakeup.c
==
--- head/sys/i386/acpica/acpi_wakeup.c  Fri Jun  1 19:09:17 2012
(r236418)
+++ head/sys/i386/acpica/acpi_wakeup.c  Fri Jun  1 19:19:04 2012
(r236419)
@@ -70,20 +70,17 @@ extern int  acpi_reset_video;
 
 #ifdef SMP
 extern struct pcb  **susppcbs;
+static cpuset_tsuspcpus;
 #else
 static struct pcb  **susppcbs;
 #endif
 
-#ifdef SMP
-static cpuset_tsuspcpus;
-#endif
-
 static void*acpi_alloc_wakeup_handler(void);
 static voidacpi_stop_beep(void *);
 
 #ifdef SMP
 static int acpi_wakeup_ap(struct acpi_softc *, int);
-static voidacpi_wakeup_cpus(struct acpi_softc *, const cpuset_t *);
+static voidacpi_wakeup_cpus(struct acpi_softc *);
 #endif
 
 #define ACPI_PAGETABLES0
@@ -176,7 +173,7 @@ acpi_wakeup_ap(struct acpi_softc *sc, in
 #defineBIOS_WARM   (0x0a)
 
 static void
-acpi_wakeup_cpus(struct acpi_softc *sc, const cpuset_t *wakeup_cpus)
+acpi_wakeup_cpus(struct acpi_softc *sc)
 {
uint32_tmpbioswarmvec;
int cpu;
@@ -195,7 +192,7 @@ acpi_wakeup_cpus(struct acpi_softc *sc, 
 
/* Wake up each AP. */
for (cpu = 1; cpu < mp_ncpus; cpu++) {
-   if (!CPU_ISSET(cpu, wakeup_cpus))
+   if (!CPU_ISSET(cpu, &suspcpus))
continue;
if (acpi_wakeup_ap(sc, cpu) == 0) {
/* restore the warmstart vector */
@@ -235,8 +232,7 @@ acpi_sleep_machdep(struct acpi_softc *sc
 
if (suspendctx(susppcbs[0])) {
 #ifdef SMP
-   if (!CPU_EMPTY(&suspcpus) &&
-   suspend_cpus(suspcpus) == 0) {
+   if (!CPU_EMPTY(&suspcpus) && suspend_cpus(suspcpus) == 0) {
device_printf(sc->acpi_dev, "Failed to suspend APs\n");
return (0); /* couldn't sleep */
}
@@ -286,7 +282,7 @@ acpi_

Re: svn commit: r236414 - in head/sys: amd64/acpica i386/acpica

2012-06-01 Thread Mitsuru IWASAKI
> > Regarding to ACPICA source code, they said nothing about this so I
> > think it's not big deal.
> > 
> > Just FYI, AcpiSetFirmwareWakingVector(0) was called with interrupt 
> > enabled in Linux.
> 
> This function does not care about interrupt context.  However, the
> first AcpiSetFirmwareWakingVector() is now called with interrupt
> disabled after r236403.  Thus, I wanted it to be consistent as well.

OK, it's just for consistency with acpi_sleep_machdep(), understood.

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


svn commit: r236418 - head/share/man/man4

2012-06-01 Thread Sean Bruno
Author: sbruno
Date: Fri Jun  1 19:09:17 2012
New Revision: 236418
URL: http://svn.freebsd.org/changeset/base/236418

Log:
  Doh!  Bump the date as I touched it!
  
  Noted by: gjb@
  MFC after:3 days

Modified:
  head/share/man/man4/bce.4

Modified: head/share/man/man4/bce.4
==
--- head/share/man/man4/bce.4   Fri Jun  1 18:58:50 2012(r236417)
+++ head/share/man/man4/bce.4   Fri Jun  1 19:09:17 2012(r236418)
@@ -28,7 +28,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd October 7, 2009
+.Dd June 1, 2012
 .Dt BCE 4
 .Os
 .Sh NAME
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r236414 - in head/sys: amd64/acpica i386/acpica

2012-06-01 Thread Jung-uk Kim
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 2012-06-01 14:43:49 -0400, Mitsuru IWASAKI wrote:
> Hi, thanks for following up.
> 
>> Log: Call AcpiSetFirmwareWakingVector() with interrupt disabled
>> for consistency.
> 
> Are you sure about this?  Original code is like this (interrupt
> ENABLED);
> 
>  intr_restore(rf);
> 
> AcpiSetFirmwareWakingVector(0);
> 
> if (ret == 0 && mem_range_softc.mr_op != NULL && 
> 
> Regarding to ACPICA source code, they said nothing about this so I
> think it's not big deal.
> 
> Just FYI, AcpiSetFirmwareWakingVector(0) was called with interrupt 
> enabled in Linux.

This function does not care about interrupt context.  However, the
first AcpiSetFirmwareWakingVector() is now called with interrupt
disabled after r236403.  Thus, I wanted it to be consistent as well.

Jung-uk Kim
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.19 (FreeBSD)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk/JEWgACgkQmlay1b9qnVN+zwCfTn5zY6gmmAipPnsIgvjEK6vC
5k4AoMjdIUmRg5EuR0awEG4+uiqGCAWo
=ZYNR
-END PGP SIGNATURE-
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r236417 - head/sys/vm

2012-06-01 Thread Eitan Adler
Author: eadler
Date: Fri Jun  1 18:58:50 2012
New Revision: 236417
URL: http://svn.freebsd.org/changeset/base/236417

Log:
  Revert r236380
  
  PR:   kern/166780
  Requested by: many
  Approved by:  cperciva (implicit)

Modified:
  head/sys/vm/swap_pager.c

Modified: head/sys/vm/swap_pager.c
==
--- head/sys/vm/swap_pager.cFri Jun  1 18:57:57 2012(r236416)
+++ head/sys/vm/swap_pager.cFri Jun  1 18:58:50 2012(r236417)
@@ -2692,18 +2692,3 @@ swaponvp(struct thread *td, struct vnode
NODEV);
return (0);
 }
-
-static int
-sysctl_vm_swap_free(SYSCTL_HANDLER_ARGS) {
-   int swap_free, used;
-   int total;
-
-   swap_pager_status(&total, &used);
-
-   swap_free = (total - used) * PAGE_SIZE;
-   return SYSCTL_OUT(req, &swap_free, sizeof(swap_free));
-}
-
-SYSCTL_OID(_vm, OID_AUTO, swap_free, CTLTYPE_INT|CTLFLAG_RD|CTLFLAG_MPSAFE,
-   NULL, 0, sysctl_vm_swap_free, "Q",
-   "Blocks of free swap storage.");
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r236414 - in head/sys: amd64/acpica i386/acpica

2012-06-01 Thread Mitsuru IWASAKI
Hi, thanks for following up.

> Log:
>   Call AcpiSetFirmwareWakingVector() with interrupt disabled for consistency.

Are you sure about this?  Original code is like this (interrupt ENABLED);


intr_restore(rf);
 
AcpiSetFirmwareWakingVector(0);

if (ret == 0 && mem_range_softc.mr_op != NULL &&


Regarding to ACPICA source code, they said nothing about this
so I think it's not big deal.

Just FYI, AcpiSetFirmwareWakingVector(0) was called with interrupt
enabled in Linux.

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


svn commit: r236415 - head/usr.sbin/pciconf

2012-06-01 Thread John Baldwin
Author: jhb
Date: Fri Jun  1 18:33:40 2012
New Revision: 236415
URL: http://svn.freebsd.org/changeset/base/236415

Log:
  Add a new -e flag to pciconf(8)'s list mode to display PCI error details.
  Currently this dumps the status of any error bits in the PCI status register
  and PCI-express device status register.  It also lists any errors indicated
  by version 1 of PCI-express Advanced Error Reporting (AER).
  
  MFC after:1 week

Added:
  head/usr.sbin/pciconf/err.c   (contents, props changed)
Modified:
  head/usr.sbin/pciconf/Makefile
  head/usr.sbin/pciconf/cap.c
  head/usr.sbin/pciconf/pciconf.8
  head/usr.sbin/pciconf/pciconf.c
  head/usr.sbin/pciconf/pciconf.h

Modified: head/usr.sbin/pciconf/Makefile
==
--- head/usr.sbin/pciconf/Makefile  Fri Jun  1 18:18:48 2012
(r236414)
+++ head/usr.sbin/pciconf/Makefile  Fri Jun  1 18:33:40 2012
(r236415)
@@ -2,7 +2,7 @@
 # $FreeBSD$
 
 PROG=  pciconf
-SRCS=  pciconf.c cap.c
+SRCS=  pciconf.c cap.c err.c
 MAN=   pciconf.8
 
 CFLAGS+= -I${.CURDIR}/../../sys

Modified: head/usr.sbin/pciconf/cap.c
==
--- head/usr.sbin/pciconf/cap.c Fri Jun  1 18:18:48 2012(r236414)
+++ head/usr.sbin/pciconf/cap.c Fri Jun  1 18:33:40 2012(r236415)
@@ -630,3 +630,59 @@ list_ecaps(int fd, struct pci_conf *p)
ecap = read_config(fd, &p->pc_sel, ptr, 4);
}
 }
+
+/* Find offset of a specific capability.  Returns 0 on failure. */
+uint8_t
+pci_find_cap(int fd, struct pci_conf *p, uint8_t id)
+{
+   uint16_t sta;
+   uint8_t ptr, cap;
+
+   /* Are capabilities present for this device? */
+   sta = read_config(fd, &p->pc_sel, PCIR_STATUS, 2);
+   if (!(sta & PCIM_STATUS_CAPPRESENT))
+   return (0);
+
+   switch (p->pc_hdr & PCIM_HDRTYPE) {
+   case PCIM_HDRTYPE_NORMAL:
+   case PCIM_HDRTYPE_BRIDGE:
+   ptr = PCIR_CAP_PTR;
+   break;
+   case PCIM_HDRTYPE_CARDBUS:
+   ptr = PCIR_CAP_PTR_2;
+   break;
+   default:
+   return (0);
+   }
+
+   ptr = read_config(fd, &p->pc_sel, ptr, 1);
+   while (ptr != 0 && ptr != 0xff) {
+   cap = read_config(fd, &p->pc_sel, ptr + PCICAP_ID, 1);
+   if (cap == id)
+   return (ptr);
+   ptr = read_config(fd, &p->pc_sel, ptr + PCICAP_NEXTPTR, 1);
+   }
+   return (0);
+}
+
+/* Find offset of a specific extended capability.  Returns 0 on failure. */
+uint16_t
+pcie_find_cap(int fd, struct pci_conf *p, uint16_t id)
+{
+   uint32_t ecap;
+   uint16_t ptr;
+
+   ptr = PCIR_EXTCAP;
+   ecap = read_config(fd, &p->pc_sel, ptr, 4);
+   if (ecap == 0x || ecap == 0)
+   return (0);
+   for (;;) {
+   if (PCI_EXTCAP_ID(ecap) == id)
+   return (ptr);
+   ptr = PCI_EXTCAP_NEXTPTR(ecap);
+   if (ptr == 0)
+   break;
+   ecap = read_config(fd, &p->pc_sel, ptr, 4);
+   }
+   return (0);
+}

Added: head/usr.sbin/pciconf/err.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/usr.sbin/pciconf/err.c Fri Jun  1 18:33:40 2012(r236415)
@@ -0,0 +1,167 @@
+/*-
+ * Copyright (c) 2012 Advanced Computing Technologies LLC
+ * Written by: John H. Baldwin 
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#ifndef lint
+static const char rcsid[] =
+"$FreeBSD$";
+#endif 

svn commit: r236414 - in head/sys: amd64/acpica i386/acpica

2012-06-01 Thread Jung-uk Kim
Author: jkim
Date: Fri Jun  1 18:18:48 2012
New Revision: 236414
URL: http://svn.freebsd.org/changeset/base/236414

Log:
  Call AcpiSetFirmwareWakingVector() with interrupt disabled for consistency.

Modified:
  head/sys/amd64/acpica/acpi_wakeup.c
  head/sys/i386/acpica/acpi_wakeup.c

Modified: head/sys/amd64/acpica/acpi_wakeup.c
==
--- head/sys/amd64/acpica/acpi_wakeup.c Fri Jun  1 18:16:10 2012
(r236413)
+++ head/sys/amd64/acpica/acpi_wakeup.c Fri Jun  1 18:18:48 2012
(r236414)
@@ -310,10 +310,10 @@ acpi_wakeup_machdep(struct acpi_softc *s
 #endif
mca_resume();
intr_resume();
+
+   AcpiSetFirmwareWakingVector(0);
} else {
/* Wakeup MD procedures in interrupt enabled context */
-   AcpiSetFirmwareWakingVector(0);
-
if (sleep_result == 1 && mem_range_softc.mr_op != NULL &&
mem_range_softc.mr_op->reinit != NULL)
mem_range_softc.mr_op->reinit(&mem_range_softc);

Modified: head/sys/i386/acpica/acpi_wakeup.c
==
--- head/sys/i386/acpica/acpi_wakeup.c  Fri Jun  1 18:16:10 2012
(r236413)
+++ head/sys/i386/acpica/acpi_wakeup.c  Fri Jun  1 18:18:48 2012
(r236414)
@@ -296,10 +296,10 @@ acpi_wakeup_machdep(struct acpi_softc *s
 #endif
mca_resume();
intr_resume();
+
+   AcpiSetFirmwareWakingVector(0);
} else {
/* Wakeup MD procedures in interrupt enabled context */
-   AcpiSetFirmwareWakingVector(0);
-
if (sleep_result == 1 && mem_range_softc.mr_op != NULL &&
mem_range_softc.mr_op->reinit != NULL)
mem_range_softc.mr_op->reinit(&mem_range_softc);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r236412 - head/share/man/man4

2012-06-01 Thread Sean Bruno
Author: sbruno
Date: Fri Jun  1 18:01:51 2012
New Revision: 236412
URL: http://svn.freebsd.org/changeset/base/236412

Log:
  Add notes and information for exposed tuneables in bce(4).
  Add source of documentation for this driver.
  
  Thanks to Warren Block for the suggestions for readability.
  
  Note that strict_rx_mtu in inverted in stable/7/8/9 and is
  named loose_rx_mtu.  Ensure that this is converted over when MFC'd
  
  hw.bce.rx_ticks
  hw.bce.rx_ticks_int
  hw.bce.rx_quick_cons_trip
  hw.bce.rx_quick_cons_trip_int
  hw.bce.tx_ticks
  hw.bce.tx_ticks_int
  hw.bce.tx_quick_cons_trip
  hw.bce.tx_quick_cons_trip_int
  hw.bce.strict_rx_mtu
  hw.bce.hdr_split
  hw.bce.tx_pages
  hw.bce.rx_pages
  hw.bce.tso_enable
  hw.bce.verbose
  
  Reviewed by:  Warren Block 
  MFC after:3 days

Modified:
  head/share/man/man4/bce.4

Modified: head/share/man/man4/bce.4
==
--- head/share/man/man4/bce.4   Fri Jun  1 17:22:20 2012(r236411)
+++ head/share/man/man4/bce.4   Fri Jun  1 18:01:51 2012(r236412)
@@ -200,9 +200,60 @@ variables and
 .Xr loader 8
 tunables:
 .Bl -tag -width indent
+.It Va hw.bce.verbose
+Enable/Disable verbose logging and output to the console.
+Useful for debugging (default 0).
 .It Va hw.bce.msi_enable
-Whether or not MSI support is enabled in the driver.
-The default value is 1.
+Enable/Disable MSI support (default 1).
+.It Va hw.bce.tso_enable
+Enable/Disable TSO support (default 1).
+.It Va hw.bce.strict_rx_mtu
+Enable/Disable strict RX frame size checking (default 0).
+.It Va hw.bce.hdr_split
+Enable/Disable frame header/payload splitting (default 1).
+.It Va hw.bce.rx_pages
+Set the number of memory pages assigned to recieve packets by the driver.
+Due to alignment issues, this value can only be of the set 1, 2, 4 or 8 
(default 2).
+.It Va hw.bce.tx_pages
+Set the number of memory pages assigned to transmit packets by the driver.
+Due to alignment issues, this value can only be of the set 1, 2, 4 or 8 
(default 2).
+.It Va hw.bce.rx_ticks
+Time in microsecond ticks to wait before generating a status block updates due 
to RX processing activity.
+Values from 0-100 are valid.
+A value of 0 disables this status block update.
+Cannot be set to 0 if hw.bce.rx_quick_cons_trip is also 0 (default 18).
+.It Va hw.bce.rx_ticks_int
+Time in microsecond ticks to wait during RX interrupt processing before 
generating a status block update.
+Values from 0-100 are valid.
+Valid values are in the range from 0-100.
+A value of 0 disables this status block update (default 18).
+.It Va hw.bce.rx_quick_cons_trip
+Number of RX Quick BD Chain entries that must be completed before a status 
block is generated.
+Values from 0-256 are valid.
+A value of 0 disables this status block update.
+Cannot be set to 0 if hw.bce.rx_ticks is also 0 (default 6).
+.It Va hw.bce.rx_quick_cons_trip_int
+Number of RX quick BD entries that must be completed before a status block is 
generated duing interrupt processing.
+Values from 0-256 are valid.
+A value of 0 disables this status block update (default 6).
+.It Va hw.bce.tx_ticks
+Time in microsecond ticks to wait before a status block update is generated 
due to TX activitiy.
+Values from 0-100 are valid.
+A value of 0 disables this status block update.
+Cannot be set to 0 if hw.bce.tx_quick_cons_trip is also 0 (default 80).
+.It Va hw.bce.tx_ticks_int
+Time in microsecond ticks to wait in interrupt processing before a status 
block update is generated due to TX activity
+Values from 0-100 are valid.
+A value of 0 disables this status block update (default 80).
+.It Va hw.bce.tx_cons_trip
+How many TX Quick BD Chain entries that must be completed before a status 
block is generated.
+Values from 0-100 are valid.
+A value of 0 disables this status block update.
+Cannot be set to 0 if hw.bce.tx_ticks is also 0 (default 20).
+.It Va hw.bce.tx_cons_trip_int
+How many TX Quick BD Chain entries that must be completed before a status 
block is generated during an interrupt.
+Values from 0-100 are valid.
+A value of 0 disables this status block update (default 20).
 .El
 .Sh DIAGNOSTICS
 .Bl -diag
@@ -266,7 +317,7 @@ address space.
 .It "bce%d: Could not allocate TX descriptor chain DMA tag!"
 The driver could not allocate a DMA tag for the controller's
 TX chain.
-.It "bce%d: Could not allocate TX descriptor chain DMA memory!"
+.It "bce%d: Could not allocate TX descriptor chain DMA memory!
 The driver could not allocate DMA addressable memory for the controller's
 TX chain.
 .It "bce%d: Could not map TX descriptor chain DMA memory!"
@@ -346,6 +397,11 @@ with the cable connection, or a driver l
 A controller hardware failure has occurred.
 If the problem continues replace the controller.
 .El
+.Sh SUPPORT
+For general information and support,
+go to the Broadcom NIC Open Source Developer Resource Site:
+.Pa http://www.broadcom.com/support/ethernet_nic/open_source.php .
+.Pp
 .Sh SEE ALS

Re: svn commit: r236377 - head/sys/dev/vxge/vxgehal

2012-06-01 Thread John Baldwin
On Friday, June 01, 2012 12:39:48 pm Eitan Adler wrote:
> On 1 June 2012 07:24, John Baldwin  wrote:
> > This is why I personally loathe assignment side effects in boolean 
> > expressions
> > for control flow.  I tend to write this sort of thing instead as:
> >
> >channel->dtr_arr[dtr_index].dtr = dtrh;
> >if (dtrh != NULL) {
> 
> Same here. I was told to use the assignment is style(9) by multiple
> people though. If it really is, I wish it would change.

style(9) doesn't make a clear statement either way, but it has contradicting
examples.

First:

 while ((ch = getopt(argc, argv, "abNn:")) != -1)

(and this one I use all the time myself as that is the common idiom for
getopt())

Second:

 error = function(a1, a2);
 if (error != 0)
 exit(error);

Also, style(9) tends to frown on assignments that are side-effects in other
places, for example:

 Be careful to not obfuscate the code by initializing variables in the
 declarations.  Use this feature only thoughtfully.  DO NOT use function
 calls in initializers.

 struct foo one, *two;
 double three;
 int *four, five;
 char *six, seven, eight, nine, ten, eleven, twelve;

 four = myfunction();

Some newer changes added at the end do use assignment side-effects while
demonstrating other rules (the !p example and err(3) and warn(3) examples,
this last I find particularly obfuscated and painful to read).

Note that I do not consider this to be an assignment side effect:

if (ioctl(...) < 0)
err(1, "ioctl");

That is, I don't write that out as:

i = ioctl(...);
if (i < 0)

However, I do split it out if the return value is used for more than error
checking, e.g.:

fd = open(...);
if (fd < 0)
err(1, "open");

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


svn commit: r236409 - in head/sys: amd64/acpica i386/acpica ia64/acpica

2012-06-01 Thread Jung-uk Kim
Author: jkim
Date: Fri Jun  1 17:07:52 2012
New Revision: 236409
URL: http://svn.freebsd.org/changeset/base/236409

Log:
  Improve style(9) in the previous commit.

Modified:
  head/sys/amd64/acpica/acpi_wakeup.c
  head/sys/i386/acpica/acpi_wakeup.c
  head/sys/ia64/acpica/acpi_wakeup.c

Modified: head/sys/amd64/acpica/acpi_wakeup.c
==
--- head/sys/amd64/acpica/acpi_wakeup.c Fri Jun  1 17:00:33 2012
(r236408)
+++ head/sys/amd64/acpica/acpi_wakeup.c Fri Jun  1 17:07:52 2012
(r236409)
@@ -283,14 +283,14 @@ acpi_sleep_machdep(struct acpi_softc *sc
 }
 
 int
-acpi_wakeup_machdep(struct acpi_softc *sc, int state,
-int sleep_result, int intr_enabled)
+acpi_wakeup_machdep(struct acpi_softc *sc, int state, int sleep_result,
+int intr_enabled)
 {
 
if (sleep_result == -1)
return (sleep_result);
 
-   if (intr_enabled == 0) {
+   if (!intr_enabled) {
/* Wakeup MD procedures in interrupt disabled context */
if (sleep_result == 1) {
pmap_init_pat();

Modified: head/sys/i386/acpica/acpi_wakeup.c
==
--- head/sys/i386/acpica/acpi_wakeup.c  Fri Jun  1 17:00:33 2012
(r236408)
+++ head/sys/i386/acpica/acpi_wakeup.c  Fri Jun  1 17:07:52 2012
(r236409)
@@ -269,14 +269,14 @@ acpi_sleep_machdep(struct acpi_softc *sc
 }
 
 int
-acpi_wakeup_machdep(struct acpi_softc *sc, int state,
-int sleep_result, int intr_enabled)
+acpi_wakeup_machdep(struct acpi_softc *sc, int state, int sleep_result,
+int intr_enabled)
 {
 
if (sleep_result == -1)
return (sleep_result);
 
-   if (intr_enabled == 0) {
+   if (!intr_enabled) {
/* Wakeup MD procedures in interrupt disabled context */
if (sleep_result == 1) {
pmap_init_pat();

Modified: head/sys/ia64/acpica/acpi_wakeup.c
==
--- head/sys/ia64/acpica/acpi_wakeup.c  Fri Jun  1 17:00:33 2012
(r236408)
+++ head/sys/ia64/acpica/acpi_wakeup.c  Fri Jun  1 17:07:52 2012
(r236409)
@@ -40,8 +40,8 @@ acpi_sleep_machdep(struct acpi_softc *sc
 }
 
 int
-acpi_wakeup_machdep(struct acpi_softc *sc, int state,
-int sleep_result, int intr_enabled)
+acpi_wakeup_machdep(struct acpi_softc *sc, int state, int sleep_result,
+int intr_enabled)
 {
return (0);
 }
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


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

2012-06-01 Thread Jung-uk Kim
Author: jkim
Date: Fri Jun  1 17:00:33 2012
New Revision: 236408
URL: http://svn.freebsd.org/changeset/base/236408

Log:
  Execute AcpiLeaveSleepStatePrep() for S1 and reduce code duplication.
  
  MFC after:3 days

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

Modified: head/sys/dev/acpica/acpi.c
==
--- head/sys/dev/acpica/acpi.c  Fri Jun  1 16:30:54 2012(r236407)
+++ head/sys/dev/acpica/acpi.c  Fri Jun  1 17:00:33 2012(r236408)
@@ -2746,8 +2746,8 @@ acpi_EnterSleepState(struct acpi_softc *
 if (sc->acpi_sleep_delay > 0)
DELAY(sc->acpi_sleep_delay * 100);
 
+intr = intr_disable();
 if (state != ACPI_STATE_S1) {
-   intr = intr_disable();
sleep_result = acpi_sleep_machdep(sc, state);
acpi_wakeup_machdep(sc, state, sleep_result, 0);
AcpiLeaveSleepStatePrep(state, acpi_sleep_flags);
@@ -2763,8 +2763,8 @@ acpi_EnterSleepState(struct acpi_softc *
if (state == ACPI_STATE_S4)
AcpiEnable();
 } else {
-   intr = intr_disable();
status = AcpiEnterSleepState(state, acpi_sleep_flags);
+   AcpiLeaveSleepStatePrep(state, acpi_sleep_flags);
intr_restore(intr);
if (ACPI_FAILURE(status)) {
device_printf(sc->acpi_dev, "AcpiEnterSleepState failed - %s\n",
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r236377 - head/sys/dev/vxge/vxgehal

2012-06-01 Thread Eitan Adler
On 1 June 2012 07:24, John Baldwin  wrote:
> This is why I personally loathe assignment side effects in boolean expressions
> for control flow.  I tend to write this sort of thing instead as:
>
>        channel->dtr_arr[dtr_index].dtr = dtrh;
>        if (dtrh != NULL) {

Same here. I was told to use the assignment is style(9) by multiple
people though. If it really is, I wish it would change.

-- 
Eitan Adler
Source & Ports committer
X11, Bugbusting teams
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


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

2012-06-01 Thread Hans Petter Selasky
Author: hselasky
Date: Fri Jun  1 16:30:54 2012
New Revision: 236407
URL: http://svn.freebsd.org/changeset/base/236407

Log:
  Improve support for detaching kernel drivers on a per interface basis.
  
  MFC after:1 week

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

Modified: head/sys/dev/usb/usb_device.c
==
--- head/sys/dev/usb/usb_device.c   Fri Jun  1 15:52:41 2012
(r236406)
+++ head/sys/dev/usb/usb_device.c   Fri Jun  1 16:30:54 2012
(r236407)
@@ -750,10 +750,13 @@ usb_config_parse(struct usb_device *udev
if (do_init) {
/* setup the USB interface structure */
iface->idesc = id;
-   /* default setting */
-   iface->parent_iface_index = USB_IFACE_INDEX_ANY;
/* set alternate index */
iface->alt_index = alt_index;
+   /* set default interface parent */
+   if (iface_index == USB_IFACE_INDEX_ANY) {
+   iface->parent_iface_index =
+   USB_IFACE_INDEX_ANY;
+   }
}
 
DPRINTFN(5, "found idesc nendpt=%d\n", id->bNumEndpoints);
@@ -1229,10 +1232,13 @@ usbd_set_parent_iface(struct usb_device 
 {
struct usb_interface *iface;
 
+   if (udev == NULL) {
+   /* nothing to do */
+   return;
+   }
iface = usbd_get_iface(udev, iface_index);
-   if (iface) {
+   if (iface != NULL)
iface->parent_iface_index = parent_index;
-   }
 }
 
 static void

Modified: head/sys/dev/usb/usb_generic.c
==
--- head/sys/dev/usb/usb_generic.c  Fri Jun  1 15:52:41 2012
(r236406)
+++ head/sys/dev/usb/usb_generic.c  Fri Jun  1 16:30:54 2012
(r236407)
@@ -2166,7 +2166,16 @@ ugen_ioctl_post(struct usb_fifo *f, u_lo
break;
}
 
+   /*
+* Detach the currently attached driver.
+*/
usb_detach_device(f->udev, n, 0);
+
+   /*
+* Set parent to self, this should keep attach away
+* until the next set configuration event.
+*/
+   usbd_set_parent_iface(f->udev, n, n);
break;
 
case USB_SET_POWER_MODE:
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r236380 - head/sys/vm

2012-06-01 Thread Bruce Evans

On Fri, 1 Jun 2012 m...@freebsd.org wrote:


On Fri, Jun 1, 2012 at 2:14 AM, Bruce Evans  wrote:

+SYSCTL_OID(_vm, OID_AUTO, swap_free,
CTLTYPE_INT|CTLFLAG_RD|CTLFLAG_MPSAFE,
+ ? ? ? ? ? ? ? NULL, 0, sysctl_vm_swap_free, "Q",
+ ? ? ? ? ? ? ? "Blocks of free swap storage.");


Bug 9 is a style bug. ?I didn't even know that the raw SYSCTL_OID() could
be misused like this. ?The normal SYSCTL_PROC() is identical with
SYSCTL_OID() except it checks that the access flags are not 0. ?Few or no
SYSCTL_FOO()s have no access flags, and this is not one. ?It has rather
excessive access flags (I think CTLFLAG_MPSAFE is unnecessary.


I wanted to correct this one point.  CTLFLAG_MPSAFE is helpful,
because its use prevents kern_sysctl from taking Giant before calling
the sysctl handler.  It's probably nearing the case, now, that any
sysctl *without* CTLFLAG_MPSAFE is incorrect, except perhaps for a few
that set/get text strings that don't want to roll their own
serialization.


The magic is that SYSCTL_FOO() adds CTFLAG_MPSAFE for most or all
simple integer SYSCTL_FOO()s like SYSCTL_INT(), but it doesn't do this
for any non-integer SYSCTL_FOO().  Not for SYSCTL_PROC(), and especially
not for the raw SYSCTL_OID().  There must be a lot of SYSCTL_PROC()s
that don't bother with this, although many return an integer after
calculating it.  Perhaps the calculation isn't properly locked, but
Giant will rarely help and no locking helps much for read-only sysctls
of dynamic data (the value may change before it is returned).  In kern,
there are 113 lines matching SYSCTL_PROC, and only 4 of these match
CTLFLAG_MPSAFE.

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

Re: svn commit: r236338 - head/usr.bin/make

2012-06-01 Thread David O'Brien
On Thu, May 31, 2012 at 08:35:54PM -0600, Warner Losh wrote:
> What are your MFC plans for 9.x and 8.x?

I'd like to commit to both 8 and 9 for the next release of each.

> > .It Cm :L
> > Converts variable to lower-case letters.
> > +(deprecated)
...
> > +The use of the
> > +.Cm :L
> > +and
> > +.Cm :U
> > +modifiers are deprecated
> > +in
> > +.Fx 10.0

Though I am wondering if the man page language should be tweaked to not
say "deprecated" given it would go into 9.1 and 8.3 -- i.e., mid-stream
releases.

Thoughts?

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


Re: svn commit: r236404 - head/sys/kern

2012-06-01 Thread John Baldwin
On Friday, June 01, 2012 11:42:37 am John Baldwin wrote:
> Author: jhb
> Date: Fri Jun  1 15:42:37 2012
> New Revision: 236404
> URL: http://svn.freebsd.org/changeset/base/236404
> 
> Log:
>   Extend VERBOSE_SYSINIT to also print out the name of variables passed
>   to SYSINIT routines if they can be resolved via symbol look up in DDB.
>   To avoid false positives, only honor a name if the symbol resolves
>   exactly to the pointer value (no offset).
>   
>   MFC after:  1 week

Some sample output:

subsystem e00   
   kick_init(0)... done.
   kstack_cache_init(0)... done.
subsystem e40   
   kproc_start(&page_kp)... done.   
subsystem e80   
   kproc_start(&vm_kp)... done. 
   pagezero_start(0)... done.   
subsystem ea0   
   kproc_start(&buf_kp)... done.
subsystem ec0   
   kproc_start(&up_kp)... done. 
   kproc_start(&vnlru_kp)... done.  
   kproc_start(&softdep_kp)... done.

SDT initialization uses some really long names:

   
sdt_argtype_register(&sdt_mac_framework_kernel_vnode_check_deleteextattr_mac_check_ok4)...
 
done.
   
sdt_argtype_register(&sdt_mac_framework_kernel_vnode_check_deleteextattr_mac_check_ok3)...
 
done.
   
sdt_argtype_register(&sdt_mac_framework_kernel_vnode_check_deleteextattr_mac_check_ok2)...
 
done.
   
sdt_argtype_register(&sdt_mac_framework_kernel_vnode_check_deleteextattr_mac_check_ok1)...
 
done.
   
sdt_argtype_register(&sdt_mac_framework_kernel_vnode_check_deleteextattr_mac_check_ok0)...
 
done.
   
sdt_argtype_register(&sdt_mac_framework_kernel_cred_check_setresgid_mac_check_err2)...
 
done.
   
sdt_argtype_register(&sdt_mac_framework_kernel_vnode_check_deleteextattr_mac_check_err4)...
 
done.
   
sdt_argtype_register(&sdt_mac_framework_kernel_vnode_check_deleteextattr_mac_check_err3)...
 
done.
   
sdt_argtype_register(&sdt_mac_framework_kernel_vnode_check_deleteextattr_mac_check_err2)...
 
done.

etc.

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


Re: svn commit: r236402 - head/lib/libc/gen

2012-06-01 Thread Bruce Evans

On Fri, 1 Jun 2012, Guy Helmer wrote:


Log:
 Style(9) improvements: remove unnecessary parenthesis, improve order
 of local variable declarations, remove bogus casts, and resolve long
 lines.

 Reviewed by:   bde


Thanks.

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


Re: svn commit: r236377 - head/sys/dev/vxge/vxgehal

2012-06-01 Thread Bruce Evans

On Fri, 1 Jun 2012, John Baldwin wrote:


On Friday, June 01, 2012 2:23:42 am Eitan Adler wrote:

On 31 May 2012 22:13, Bruce Evans  wrote:

This seems to change a style by (excessive parentheses for a normal
equality test) into logic bug (assignment of dtrh instead of compariing
with it).


intentional - perhaps my commit message was poorly worded.

The comment above says
283 /*
284  * restore a previously allocated dtrh at current offset and update
285  * the available reserve length accordingly. If dtrh is null just
286  * update the reserve length, only
287  */

and gnn confirmed that the patch as committed is correct.


Oops.


This is why I personally loathe assignment side effects in boolean expressions
for control flow.  I tend to write this sort of thing instead as:

channel->dtr_arr[dtr_index].dtr = dtrh;
if (dtrh != NULL) {


Except here you would have written:

channel->dtr_arr[dtr_index].dtr = dtrh;
if (dtrh == NULL)
return;

to avoid a large compound statement for the null case.

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


Re: svn commit: r236380 - head/sys/vm

2012-06-01 Thread mdf
On Fri, Jun 1, 2012 at 2:14 AM, Bruce Evans  wrote:
>>> +SYSCTL_OID(_vm, OID_AUTO, swap_free,
>>> CTLTYPE_INT|CTLFLAG_RD|CTLFLAG_MPSAFE,
>>> +               NULL, 0, sysctl_vm_swap_free, "Q",
>>> +               "Blocks of free swap storage.");
>
>
> Bug 9 is a style bug.  I didn't even know that the raw SYSCTL_OID() could
> be misused like this.  The normal SYSCTL_PROC() is identical with
> SYSCTL_OID() except it checks that the access flags are not 0.  Few or no
> SYSCTL_FOO()s have no access flags, and this is not one.  It has rather
> excessive access flags (I think CTLFLAG_MPSAFE is unnecessary.

I wanted to correct this one point.  CTLFLAG_MPSAFE is helpful,
because its use prevents kern_sysctl from taking Giant before calling
the sysctl handler.  It's probably nearing the case, now, that any
sysctl *without* CTLFLAG_MPSAFE is incorrect, except perhaps for a few
that set/get text strings that don't want to roll their own
serialization.

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


svn commit: r236406 - head/sys/dev/e1000

2012-06-01 Thread John Baldwin
Author: jhb
Date: Fri Jun  1 15:52:41 2012
New Revision: 236406
URL: http://svn.freebsd.org/changeset/base/236406

Log:
  Commit a portion of 233708 I missed earlier and don't include the
  definition of igb_start() and igb_start_locked() (nor set if_start in
  the ifnet) when igb(4) uses if_transmit.

Modified:
  head/sys/dev/e1000/if_igb.c

Modified: head/sys/dev/e1000/if_igb.c
==
--- head/sys/dev/e1000/if_igb.c Fri Jun  1 15:48:24 2012(r236405)
+++ head/sys/dev/e1000/if_igb.c Fri Jun  1 15:52:41 2012(r236406)
@@ -846,6 +846,8 @@ igb_resume(device_t dev)
 }
 
 
+#if __FreeBSD_version < 80
+
 /*
  *  Transmit entry point
  *
@@ -922,7 +924,7 @@ igb_start(struct ifnet *ifp)
return;
 }
 
-#if __FreeBSD_version >= 80
+#else
 /*
 ** Multiqueue Transmit driver
 **
@@ -3010,14 +3012,15 @@ igb_setup_interface(device_t dev, struct
ifp->if_softc = adapter;
ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST;
ifp->if_ioctl = igb_ioctl;
-   ifp->if_start = igb_start;
 #if __FreeBSD_version >= 80
ifp->if_transmit = igb_mq_start;
ifp->if_qflush = igb_qflush;
-#endif
+#else
+   ifp->if_start = igb_start;
IFQ_SET_MAXLEN(&ifp->if_snd, adapter->num_tx_desc - 1);
ifp->if_snd.ifq_drv_maxlen = adapter->num_tx_desc - 1;
IFQ_SET_READY(&ifp->if_snd);
+#endif
 
ether_ifattach(ifp, adapter->hw.mac.addr);
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r236405 - head/sys/boot/i386/boot2

2012-06-01 Thread John Baldwin
Author: jhb
Date: Fri Jun  1 15:48:24 2012
New Revision: 236405
URL: http://svn.freebsd.org/changeset/base/236405

Log:
  Remove unnecessary initializations.  The BSS of boot2 is in fact
  zero'd when boot2 begins execution by the _start() routine in btxcsu.S.
  
  MFC after:1 week

Modified:
  head/sys/boot/i386/boot2/boot2.c

Modified: head/sys/boot/i386/boot2/boot2.c
==
--- head/sys/boot/i386/boot2/boot2.cFri Jun  1 15:42:37 2012
(r236404)
+++ head/sys/boot/i386/boot2/boot2.cFri Jun  1 15:48:24 2012
(r236405)
@@ -129,8 +129,8 @@ static struct dsk {
 int init;
 } dsk;
 static char cmd[512], cmddup[512], knamebuf[1024];
-static const char *kname = NULL;
-static uint32_t opts = 0;
+static const char *kname;
+static uint32_t opts;
 static int comspeed = SIOSPD;
 static struct bootinfo bootinfo;
 static uint8_t ioctrl = IO_KEYBOARD;
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r236404 - head/sys/kern

2012-06-01 Thread John Baldwin
Author: jhb
Date: Fri Jun  1 15:42:37 2012
New Revision: 236404
URL: http://svn.freebsd.org/changeset/base/236404

Log:
  Extend VERBOSE_SYSINIT to also print out the name of variables passed
  to SYSINIT routines if they can be resolved via symbol look up in DDB.
  To avoid false positives, only honor a name if the symbol resolves
  exactly to the pointer value (no offset).
  
  MFC after:1 week

Modified:
  head/sys/kern/init_main.c

Modified: head/sys/kern/init_main.c
==
--- head/sys/kern/init_main.c   Fri Jun  1 15:26:32 2012(r236403)
+++ head/sys/kern/init_main.c   Fri Jun  1 15:42:37 2012(r236404)
@@ -158,6 +158,24 @@ sysinit_add(struct sysinit **set, struct
newsysinit_end = newset + count;
 }
 
+#if defined (DDB) && defined(VERBOSE_SYSINIT)
+static const char *
+symbol_name(vm_offset_t va, db_strategy_t strategy)
+{
+   const char *name;
+   c_db_sym_t sym;
+   db_expr_t  offset;
+
+   if (va == 0)
+   return (NULL);
+   sym = db_search_symbol(va, strategy, &offset);
+   if (offset != 0)
+   return (NULL);
+   db_symbol_values(sym, &name, NULL);
+   return (name);
+}
+#endif
+
 /*
  * System startup; initialize the world, create process 0, mount root
  * filesystem, and fork to create init and pagedaemon.  Most of the
@@ -238,15 +256,16 @@ restart:
}
if (verbose) {
 #if defined(DDB)
-   const char *name;
-   c_db_sym_t sym;
-   db_expr_t  offset;
-
-   sym = db_search_symbol((vm_offset_t)(*sipp)->func,
-   DB_STGY_PROC, &offset);
-   db_symbol_values(sym, &name, NULL);
-   if (name != NULL)
-   printf("   %s(%p)... ", name, (*sipp)->udata);
+   const char *func, *data;
+
+   func = symbol_name((vm_offset_t)(*sipp)->func,
+   DB_STGY_PROC);
+   data = symbol_name((vm_offset_t)(*sipp)->udata,
+   DB_STGY_ANY);
+   if (func != NULL && data != NULL)
+   printf("   %s(&%s)... ", func, data);
+   else if (func != NULL)
+   printf("   %s(%p)... ", func, (*sipp)->udata);
else
 #endif
printf("   %p(%p)... ", (*sipp)->func,
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r236403 - in head/sys: amd64/acpica dev/acpica i386/acpica ia64/acpica

2012-06-01 Thread Mitsuru IWASAKI
Author: iwasaki
Date: Fri Jun  1 15:26:32 2012
New Revision: 236403
URL: http://svn.freebsd.org/changeset/base/236403

Log:
  Call AcpiLeaveSleepStatePrep() in interrupt disabled context
  (described in ACPICA source code).
  
  - Move intr_disable() and intr_restore() from acpi_wakeup.c to acpi.c
and call AcpiLeaveSleepStatePrep() in interrupt disabled context.
  - Add acpi_wakeup_machdep() to execute wakeup MD procedures and call
it twice in interrupt disabled/enabled context (ia64 version is
just dummy).
  - Rename wakeup_cpus variable in acpi_sleep_machdep() to suspcpus in
order to be shared by acpi_sleep_machdep() and acpi_wakeup_machdep().
  - Move identity mapping related code to acpi_install_wakeup_handler()
(i386 version) for preparation of x86/acpica/acpi_wakeup.c
(MFC candidate).
  
  Reviewed by:  jkim@
  MFC after:2 days

Modified:
  head/sys/amd64/acpica/acpi_wakeup.c
  head/sys/dev/acpica/acpi.c
  head/sys/dev/acpica/acpivar.h
  head/sys/i386/acpica/acpi_wakeup.c
  head/sys/ia64/acpica/acpi_wakeup.c

Modified: head/sys/amd64/acpica/acpi_wakeup.c
==
--- head/sys/amd64/acpica/acpi_wakeup.c Fri Jun  1 15:02:23 2012
(r236402)
+++ head/sys/amd64/acpica/acpi_wakeup.c Fri Jun  1 15:26:32 2012
(r236403)
@@ -76,6 +76,10 @@ static struct pcb**susppcbs;
 static void**suspfpusave;
 #endif
 
+#ifdef SMP
+static cpuset_tsuspcpus;
+#endif
+
 intacpi_restorecpu(uint64_t, vm_offset_t);
 
 static void*acpi_alloc_wakeup_handler(void);
@@ -220,21 +224,14 @@ acpi_wakeup_cpus(struct acpi_softc *sc, 
 int
 acpi_sleep_machdep(struct acpi_softc *sc, int state)
 {
-#ifdef SMP
-   cpuset_twakeup_cpus;
-#endif
-   register_t  rf;
ACPI_STATUS status;
-   int ret;
-
-   ret = -1;
 
if (sc->acpi_wakeaddr == 0ul)
-   return (ret);
+   return (-1);/* couldn't alloc wake memory */
 
 #ifdef SMP
-   wakeup_cpus = all_cpus;
-   CPU_CLR(PCPU_GET(cpuid), &wakeup_cpus);
+   suspcpus = all_cpus;
+   CPU_CLR(PCPU_GET(cpuid), &suspcpus);
 #endif
 
if (acpi_resume_beep != 0)
@@ -242,16 +239,15 @@ acpi_sleep_machdep(struct acpi_softc *sc
 
AcpiSetFirmwareWakingVector(WAKECODE_PADDR(sc));
 
-   rf = intr_disable();
intr_suspend();
 
if (savectx(susppcbs[0])) {
ctx_fpusave(suspfpusave[0]);
 #ifdef SMP
-   if (!CPU_EMPTY(&wakeup_cpus) &&
-   suspend_cpus(wakeup_cpus) == 0) {
+   if (!CPU_EMPTY(&suspcpus) &&
+   suspend_cpus(suspcpus) == 0) {
device_printf(sc->acpi_dev, "Failed to suspend APs\n");
-   goto out;
+   return (0); /* couldn't sleep */
}
 #endif
 
@@ -276,41 +272,54 @@ acpi_sleep_machdep(struct acpi_softc *sc
device_printf(sc->acpi_dev,
"AcpiEnterSleepState failed - %s\n",
AcpiFormatException(status));
-   goto out;
+   return (0); /* couldn't sleep */
}
 
for (;;)
ia32_pause();
-   } else {
-   pmap_init_pat();
-   load_cr3(susppcbs[0]->pcb_cr3);
-   initializecpu();
-   PCPU_SET(switchtime, 0);
-   PCPU_SET(switchticks, ticks);
-#ifdef SMP
-   if (!CPU_EMPTY(&wakeup_cpus))
-   acpi_wakeup_cpus(sc, &wakeup_cpus);
-#endif
-   ret = 0;
}
 
-out:
+   return (1); /* wakeup successfully */
+}
+
+int
+acpi_wakeup_machdep(struct acpi_softc *sc, int state,
+int sleep_result, int intr_enabled)
+{
+
+   if (sleep_result == -1)
+   return (sleep_result);
+
+   if (intr_enabled == 0) {
+   /* Wakeup MD procedures in interrupt disabled context */
+   if (sleep_result == 1) {
+   pmap_init_pat();
+   load_cr3(susppcbs[0]->pcb_cr3);
+   initializecpu();
+   PCPU_SET(switchtime, 0);
+   PCPU_SET(switchticks, ticks);
 #ifdef SMP
-   if (!CPU_EMPTY(&wakeup_cpus))
-   restart_cpus(wakeup_cpus);
+   if (!CPU_EMPTY(&suspcpus))
+   acpi_wakeup_cpus(sc, &suspcpus);
 #endif
+   }
 
-   mca_resume();
-   intr_resume();
-   intr_restore(rf);
-
-   AcpiSetFirmwareWakingVector(0);
+#ifdef SMP
+   if (!CPU_EMPTY(&suspcpus))
+   restart_cpus(suspcpus);
+#endif
+   mca_resume();
+   intr_resume();
+   } else {
+   /* Wakeup MD procedures in interrupt enabled context */
+   

Re: svn commit: r236380 - head/sys/vm

2012-06-01 Thread Eitan Adler
On 1 June 2012 05:14, Bruce Evans  wrote:

>> On 1 June 2012 08:42, Eitan Adler  wrote:
...

I want to ack the replies to this commit. I'll either try to fix the
bugs mentioned here, or more likely revert the commit. Note that it
may take a few days for me to get to this though.


-- 
Eitan Adler
Source & Ports committer
X11, Bugbusting teams
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r236377 - head/sys/dev/vxge/vxgehal

2012-06-01 Thread John Baldwin
On Friday, June 01, 2012 2:23:42 am Eitan Adler wrote:
> On 31 May 2012 22:13, Bruce Evans  wrote:
> > This seems to change a style by (excessive parentheses for a normal
> > equality test) into logic bug (assignment of dtrh instead of compariing
> > with it).
> 
> intentional - perhaps my commit message was poorly worded.
> 
> The comment above says
> 283 /*
> 284  * restore a previously allocated dtrh at current offset and 
> update
> 285  * the available reserve length accordingly. If dtrh is null just
> 286  * update the reserve length, only
> 287  */
> 
> 
> and gnn confirmed that the patch as committed is correct.

This is why I personally loathe assignment side effects in boolean expressions
for control flow.  I tend to write this sort of thing instead as:

channel->dtr_arr[dtr_index].dtr = dtrh;
if (dtrh != NULL) {


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


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

2012-06-01 Thread Guy Helmer
Author: ghelmer
Date: Fri Jun  1 15:02:23 2012
New Revision: 236402
URL: http://svn.freebsd.org/changeset/base/236402

Log:
  Style(9) improvements: remove unnecessary parenthesis, improve order
  of local variable declarations, remove bogus casts, and resolve long
  lines.
  
  Reviewed by:  bde

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

Modified: head/lib/libc/gen/getnetgrent.c
==
--- head/lib/libc/gen/getnetgrent.c Fri Jun  1 14:57:55 2012
(r236401)
+++ head/lib/libc/gen/getnetgrent.c Fri Jun  1 15:02:23 2012
(r236402)
@@ -309,28 +309,30 @@ _revnetgr_lookup(char* lookupdom, char* 
 
for (rot = 0; ; rot++) {
switch (rot) {
-   case(0):
+   case 0:
snprintf(key, MAXHOSTNAMELEN, "%s.%s", str,
dom ? dom : lookupdom);
break;
-   case(1):
+   case 1:
snprintf(key, MAXHOSTNAMELEN, "%s.*", str);
break;
-   case(2):
+   case 2:
snprintf(key, MAXHOSTNAMELEN, "*.%s",
dom ? dom : lookupdom);
break;
-   case(3):
+   case 3:
snprintf(key, MAXHOSTNAMELEN, "*.*");
break;
-   default: return (0);
+   default:
+   return (0);
}
y = yp_match(lookupdom, map, key, strlen(key), &result,
-&resultlen);
+   &resultlen);
if (y == 0) {
rv = _listmatch(result, group, resultlen);
free(result);
-   if (rv) return (1);
+   if (rv)
+   return (1);
} else if (y != YPERR_KEY) {
/*
 * If we get an error other than 'no
@@ -417,14 +419,14 @@ innetgr(const char *group, const char *h
 static int
 parse_netgrp(const char *group)
 {
-   char *spos, *epos;
-   int len, strpos;
+   struct netgrp *grp;
+   struct linelist *lp = linehead;
+   char **ng;
+   char *epos, *gpos, *pos, *spos;
+   int freepos, len, strpos;
 #ifdef DEBUG
int fields;
 #endif
-   char *pos, *gpos;
-   struct netgrp *grp;
-   struct linelist *lp = linehead;
 
/*
 * First, see if the line has already been read in.
@@ -454,49 +456,48 @@ parse_netgrp(const char *group)
/* Watch for null pointer dereferences, dammit! */
while (pos != NULL && *pos != '\0') {
if (*pos == '(') {
-   grp = (struct netgrp *)malloc(sizeof (struct netgrp));
+   grp = malloc(sizeof(*grp));
if (grp == NULL)
return (1);
-   bzero((char *)grp, sizeof (struct netgrp));
+   ng = grp->ng_str;
+   bzero(grp, sizeof(*grp));
pos++;
gpos = strsep(&pos, ")");
 #ifdef DEBUG
fields = 0;
 #endif
for (strpos = 0; strpos < 3; strpos++) {
-   if ((spos = strsep(&gpos, ","))) {
-#ifdef DEBUG
-   fields++;
-#endif
-   while (*spos == ' ' || *spos == '\t')
-   spos++;
-   if ((epos = strpbrk(spos, " \t"))) {
-   *epos = '\0';
-   len = epos - spos;
-   } else
-   len = strlen(spos);
-   if (len > 0) {
-   grp->ng_str[strpos] =  (char *)
-   malloc(len + 1);
-   if (grp->ng_str[strpos] == 
NULL) {
-   int freepos;
-   for (freepos = 0; 
freepos < strpos; freepos++)
-   
free(grp->ng_str[freepos]);
-   free(grp);
-   return (1);
-   }
-   bcopy(spos, grp->ng_str[strpos],
-   len + 1);
-   }
-   } else {
+ 

svn commit: r236394 - head/sys/netinet

2012-06-01 Thread Bjoern A. Zeeb
Author: bz
Date: Fri Jun  1 11:42:50 2012
New Revision: 236394
URL: http://svn.freebsd.org/changeset/base/236394

Log:
  Make TCP LRO work properly with VIMAGE kernels rather than just panicing.
  There's no VIMAGE context set there yet as this is before if_ethersubr.c.
  
  MFC after:3 days
  X-MFC with:   r235981

Modified:
  head/sys/netinet/tcp_lro.c

Modified: head/sys/netinet/tcp_lro.c
==
--- head/sys/netinet/tcp_lro.c  Fri Jun  1 09:32:37 2012(r236393)
+++ head/sys/netinet/tcp_lro.c  Fri Jun  1 11:42:50 2012(r236394)
@@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -370,10 +371,14 @@ tcp_lro_rx(struct lro_ctrl *lc, struct m
switch (eh_type) {
 #ifdef INET6
case ETHERTYPE_IPV6:
+   {
+   CURVNET_SET(lc->ifp->if_vnet);
if (V_ip6_forwarding != 0) {
/* XXX-BZ stats but changing lro_ctrl is a problem. */
+   CURVNET_RESTORE();
return (TCP_LRO_CANNOT);
}
+   CURVNET_RESTORE();
l3hdr = ip6 = (struct ip6_hdr *)(eh + 1);
error = tcp_lro_rx_ipv6(lc, m, ip6, &th);
if (error != 0)
@@ -381,13 +386,18 @@ tcp_lro_rx(struct lro_ctrl *lc, struct m
tcp_data_len = ntohs(ip6->ip6_plen);
ip_len = sizeof(*ip6) + tcp_data_len;
break;
+   }
 #endif
 #ifdef INET
case ETHERTYPE_IP:
+   {
+   CURVNET_SET(lc->ifp->if_vnet);
if (V_ipforwarding != 0) {
/* XXX-BZ stats but changing lro_ctrl is a problem. */
+   CURVNET_RESTORE();
return (TCP_LRO_CANNOT);
}
+   CURVNET_RESTORE();
l3hdr = ip4 = (struct ip *)(eh + 1);
error = tcp_lro_rx_ipv4(lc, m, ip4, &th);
if (error != 0)
@@ -395,6 +405,7 @@ tcp_lro_rx(struct lro_ctrl *lc, struct m
ip_len = ntohs(ip4->ip_len);
tcp_data_len = ip_len - sizeof(*ip4);
break;
+   }
 #endif
/* XXX-BZ what happens in case of VLAN(s)? */
default:
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r236393 - in head/sys/cam: . ata

2012-06-01 Thread Alexander Motin
Author: mav
Date: Fri Jun  1 09:32:37 2012
New Revision: 236393
URL: http://svn.freebsd.org/changeset/base/236393

Log:
  Use AC_GETDEV_CHANGED async to notify ada driver about DMA and NCQ status
  change. Now that allows switching between PIO and DMA modes on the fly.

Modified:
  head/sys/cam/ata/ata_da.c
  head/sys/cam/ata/ata_xpt.c
  head/sys/cam/cam_xpt.c

Modified: head/sys/cam/ata/ata_da.c
==
--- head/sys/cam/ata/ata_da.c   Fri Jun  1 08:44:17 2012(r236392)
+++ head/sys/cam/ata/ata_da.c   Fri Jun  1 09:32:37 2012(r236393)
@@ -742,6 +742,7 @@ static void
 adaasync(void *callback_arg, u_int32_t code,
struct cam_path *path, void *arg)
 {
+   struct ccb_getdev cgd;
struct cam_periph *periph;
struct ada_softc *softc;
 
@@ -776,6 +777,32 @@ adaasync(void *callback_arg, u_int32_t c
"due to status 0x%x\n", status);
break;
}
+   case AC_GETDEV_CHANGED:
+   {
+   softc = (struct ada_softc *)periph->softc;
+   xpt_setup_ccb(&cgd.ccb_h, periph->path, CAM_PRIORITY_NORMAL);
+   cgd.ccb_h.func_code = XPT_GDEV_TYPE;
+   xpt_action((union ccb *)&cgd);
+
+   if ((cgd.ident_data.capabilities1 & ATA_SUPPORT_DMA) &&
+   (cgd.inq_flags & SID_DMA))
+   softc->flags |= ADA_FLAG_CAN_DMA;
+   else
+   softc->flags &= ~ADA_FLAG_CAN_DMA;
+   if ((cgd.ident_data.satacapabilities & ATA_SUPPORT_NCQ) &&
+   (cgd.inq_flags & SID_DMA) && (cgd.inq_flags & SID_CmdQue))
+   softc->flags |= ADA_FLAG_CAN_NCQ;
+   else
+   softc->flags &= ~ADA_FLAG_CAN_NCQ;
+   if ((cgd.ident_data.support_dsm & ATA_SUPPORT_DSM_TRIM) &&
+   (cgd.inq_flags & SID_DMA))
+   softc->flags |= ADA_FLAG_CAN_TRIM;
+   else
+   softc->flags &= ~ADA_FLAG_CAN_TRIM;
+
+   cam_periph_async(periph, code, path, arg);
+   break;
+   }
case AC_ADVINFO_CHANGED:
{
uintptr_t buftype;
@@ -793,8 +820,6 @@ adaasync(void *callback_arg, u_int32_t c
case AC_SENT_BDR:
case AC_BUS_RESET:
{
-   struct ccb_getdev cgd;
-
softc = (struct ada_softc *)periph->softc;
cam_periph_async(periph, code, path, arg);
if (softc->state != ADA_STATE_NORMAL)
@@ -933,7 +958,7 @@ adaregister(struct cam_periph *periph, v
bioq_init(&softc->bio_queue);
bioq_init(&softc->trim_queue);
 
-   if (cgd->ident_data.capabilities1 & ATA_SUPPORT_DMA &&
+   if ((cgd->ident_data.capabilities1 & ATA_SUPPORT_DMA) &&
(cgd->inq_flags & SID_DMA))
softc->flags |= ADA_FLAG_CAN_DMA;
if (cgd->ident_data.support.command2 & ATA_SUPPORT_ADDRESS48)
@@ -942,10 +967,11 @@ adaregister(struct cam_periph *periph, v
softc->flags |= ADA_FLAG_CAN_FLUSHCACHE;
if (cgd->ident_data.support.command1 & ATA_SUPPORT_POWERMGT)
softc->flags |= ADA_FLAG_CAN_POWERMGT;
-   if (cgd->ident_data.satacapabilities & ATA_SUPPORT_NCQ &&
+   if ((cgd->ident_data.satacapabilities & ATA_SUPPORT_NCQ) &&
(cgd->inq_flags & SID_DMA) && (cgd->inq_flags & SID_CmdQue))
softc->flags |= ADA_FLAG_CAN_NCQ;
-   if (cgd->ident_data.support_dsm & ATA_SUPPORT_DSM_TRIM) {
+   if ((cgd->ident_data.support_dsm & ATA_SUPPORT_DSM_TRIM) &&
+   (cgd->inq_flags & SID_DMA)) {
softc->flags |= ADA_FLAG_CAN_TRIM;
softc->trim_max_ranges = TRIM_MAX_RANGES;
if (cgd->ident_data.max_dsm_blocks != 0) {
@@ -1103,7 +1129,8 @@ adaregister(struct cam_periph *periph, v
 * not attach the device on failure.
 */
xpt_register_async(AC_SENT_BDR | AC_BUS_RESET | AC_LOST_DEVICE |
-   AC_ADVINFO_CHANGED, adaasync, periph, periph->path);
+   AC_GETDEV_CHANGED | AC_ADVINFO_CHANGED,
+   adaasync, periph, periph->path);
 
/*
 * Schedule a periodic event to occasionally send an

Modified: head/sys/cam/ata/ata_xpt.c
==
--- head/sys/cam/ata/ata_xpt.c  Fri Jun  1 08:44:17 2012(r236392)
+++ head/sys/cam/ata/ata_xpt.c  Fri Jun  1 09:32:37 2012(r236393)
@@ -413,6 +413,7 @@ negotiate:
path->device->inq_flags &= ~SID_DMA;
else
path->device->inq_flags |= SID_DMA;
+   xpt_async(AC_GETDEV_CHANGED, path, NULL);
cam_fill_ataio(ataio,
  1,
  probedone,
@@ -1018,6 +1019,7 @@ noerror:
}
 
path->devi

Re: svn commit: r236380 - head/sys/vm

2012-06-01 Thread Bruce Evans

On Fri, 1 Jun 2012, Sergey Kandaurov wrote:


On 1 June 2012 08:42, Eitan Adler  wrote:

...
Log:
?Add sysctl to query amount of swap space free

?PR: ? ? ? ? ? kern/166780
?Submitted by: Radim Kolar 
?Approved by: ?cperciva
?MFC after: ? ?1 week


Well, we already have more powerful vm.swap_info, so
I see no reason to add yet another one to do the same thing
(but now with a human interface).


The new interface provides many more bugs.  Mostly style bugs, but
also type mismatches and potential overflow.


Probably sysctl(8) should be enhanced to parse it instead.


That would be another bug.  sysctl(8) already does too much parsing.
Parsing belongs in specialized utilities, and I think there are already
some that do it for swap.  sysctl(8) largest existing exessive parsing
and presenting is for related vmtotal things.


Modified:
?head/sys/vm/swap_pager.c

Modified: head/sys/vm/swap_pager.c
==
--- head/sys/vm/swap_pager.c ? ?Fri Jun ?1 04:34:49 2012 ? ? ? ?(r236379)
+++ head/sys/vm/swap_pager.c ? ?Fri Jun ?1 04:42:52 2012 ? ? ? ?(r236380)
@@ -2692,3 +2692,18 @@ swaponvp(struct thread *td, struct vnode
? ? ? ? ? ?NODEV);
? ? ? ?return (0);
?}


Please don't put binary characters in mail.


+
+static int
+sysctl_vm_swap_free(SYSCTL_HANDLER_ARGS) {


First style bug: misplaced brace.


+ ? ? ? int swap_free, used;
+ ? ? ? int total;


Second and third style bugs: int variables not altogther, and not sorted.
But these are probably actually type and overflow errors (bugs 4 and 5)...


+
+ ? ? ? swap_pager_status(&total, &used);
+


Bug 6 is a style bug (extra blank line).


+ ? ? ? swap_free = (total - used) * PAGE_SIZE;


We multiply by PAGE_SIZE.  This can probably overflow at 2G.  Then
assigning to the int variable overflows at the same point.  This gives
bugs 4 and 5.  Related sysctls for memory sizes (see kern_mib.c) avoid
this problem by using u_long instead of int.  But for disk sizes, using
u_long only reduces the problem to overflow at 4G, since systems with
32-bit longs can have larger disks than memory, and large disks can
have large swap.

I'm not sure if old restrictions on swap size have been fixed so that
more than 2G can actually be allocated, but most places that muliply
by PAGE_SIZE aee now careful to use expressions like
'(vm_ooffset_t)nblks * PAGE_SIZE' and to assign the result to a variable
of type vm_ooffset_t.  swap_total is one such variable.  But its sysctl
has type errors too.  vm_ooffset_t is just not a supported type in sysctl.
SYSCTL_QUAD() is used for it.  Quads shouldn't exist, and SYSCTL_QUAD()
should never be used, especially for non-quads.  There are now some
support for 64-bit types in sysctl.  Using these would be less bogus.

Bug 7 is a style bug: the related sysctls for memory sizes use ctob()
instead of hard-coding PAGE_SIZE.  Avoiding this style bug also avoids
multiplication overflow (else you need a cast to go above 2G starting
with an int page count).  ctob() is bogus too (seen any clicks lately?).


+ ? ? ? return SYSCTL_OUT(req, &swap_free, sizeof(swap_free));


Bug 8 is a style bug (no spaces around return value).


+}
+
+SYSCTL_OID(_vm, OID_AUTO, swap_free, CTLTYPE_INT|CTLFLAG_RD|CTLFLAG_MPSAFE,
+ ? ? ? ? ? ? ? NULL, 0, sysctl_vm_swap_free, "Q",
+ ? ? ? ? ? ? ? "Blocks of free swap storage.");


Bug 9 is a style bug.  I didn't even know that the raw SYSCTL_OID() could
be misused like this.  The normal SYSCTL_PROC() is identical with
SYSCTL_OID() except it checks that the access flags are not 0.  Few or no
SYSCTL_FOO()s have no access flags, and this is not one.  It has rather
excessive access flags (I think CTLFLAG_MPSAFE is unnecessary.  It is not
used for the related memory sysctls).  vm has 4 existing SYSCTL_OID()s;
kern has 3; ia64/ia64 has 1; i386/i386 has 1; netipsec has 1.  These are
the only matches for ^SYSCTL_OID in /sys, and they all seem to be just
style bugs.

Bug 10 is a collection of style bugs (missing spaces around binary operator
'|').

Bug 11 is a collection of style bugs (weird 2-tab continuation indentation
instead of the normal 4 spaces.  5 out of 7 existing SYSCTL_*()s in this
file including the vm_swap ones use normal continuation indentation.

Bug 12 is the most serious type error.  The format is "Q", but only
an int is returned.  I don't see how this can result in anything except
garbage printing in sysctl(8).  The access flag gives the type correctly
as int, but sysctl(8) mostly uses the format string for output.  Oops,
that was in an old version.  sysctl(8) now mostly uses the access flag,
and has no literal Q's in it any more.  So this error might not be
serious, depending on whether the bad format string is actually used.

The sysctl data doesn't give the size of type type, but leaves it as
0.  This works because the size is given as sizeof(swap_free) in the
call to SYSCTL_OUT().  This can be confusing, and use of the raw
SYSCTL_OUT() should be avoided if pos

svn commit: r236392 - head/usr.bin/calendar/calendars

2012-06-01 Thread Jase Thew
Author: jase (ports committer)
Date: Fri Jun  1 08:44:17 2012
New Revision: 236392
URL: http://svn.freebsd.org/changeset/base/236392

Log:
  Add myself as a new committer.
  
  Approved by:  flo, culot (mentors)

Modified:
  head/usr.bin/calendar/calendars/calendar.freebsd

Modified: head/usr.bin/calendar/calendars/calendar.freebsd
==
--- head/usr.bin/calendar/calendars/calendar.freebsdFri Jun  1 08:26:50 
2012(r236391)
+++ head/usr.bin/calendar/calendars/calendar.freebsdFri Jun  1 08:44:17 
2012(r236392)
@@ -144,6 +144,7 @@
 05/08  Sean Kelly  born in Walnut Creek, California, 
United States, 1982
 05/09  Daniel Eischen  born in Syracuse, New York, 
United States, 1963
 05/09  Aaron Dalton  born in Boise, Idaho, United States, 
1973
+05/09  Jase Thew  born in Abergavenny, Gwent, United 
Kingdom, 1974
 05/10  Markus Brueffer  born in Gronau, 
Nordrhein-Westfalen, Germany, 1977
 05/11  Jesus Rodriguez  born in Barcelona, Spain, 1972
 05/11  Roman Kurakin  born in Moscow, USSR, 1979
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r236380 - head/sys/vm

2012-06-01 Thread Konstantin Belousov
On Fri, Jun 01, 2012 at 04:42:52AM +, Eitan Adler wrote:
> Author: eadler
> Date: Fri Jun  1 04:42:52 2012
> New Revision: 236380
> URL: http://svn.freebsd.org/changeset/base/236380
> 
> Log:
>   Add sysctl to query amount of swap space free
>   
>   PR: kern/166780
>   Submitted by:   Radim Kolar 
>   Approved by:cperciva
>   MFC after:  1 week
> 
> Modified:
>   head/sys/vm/swap_pager.c
The commit messages lack any rationale for the change.

The rationale specified in the PR is wrong, there _is_ the sysctl
interface to read the swap use, vm.swap_info.N. It is used by e.g.
swapinfo(8)/libkvm(3) on live system.

> 
> Modified: head/sys/vm/swap_pager.c
> ==
> --- head/sys/vm/swap_pager.c  Fri Jun  1 04:34:49 2012(r236379)
> +++ head/sys/vm/swap_pager.c  Fri Jun  1 04:42:52 2012(r236380)
> @@ -2692,3 +2692,18 @@ swaponvp(struct thread *td, struct vnode
>   NODEV);
>   return (0);
>  }
> +
> +static int
> +sysctl_vm_swap_free(SYSCTL_HANDLER_ARGS) {
> + int swap_free, used;
> + int total;
> +
> + swap_pager_status(&total, &used);
> +
> + swap_free = (total - used) * PAGE_SIZE;
> + return SYSCTL_OUT(req, &swap_free, sizeof(swap_free));
> +}
This just overflows at swap sizes greater then 2GB.

> +
> +SYSCTL_OID(_vm, OID_AUTO, swap_free, CTLTYPE_INT|CTLFLAG_RD|CTLFLAG_MPSAFE,
> + NULL, 0, sysctl_vm_swap_free, "Q",
> + "Blocks of free swap storage.");

Please revert the commit.


pgptg3nKDADR4.pgp
Description: PGP signature


svn commit: r236391 - head/sys/netinet

2012-06-01 Thread Michael Tuexen
Author: tuexen
Date: Fri Jun  1 08:26:50 2012
New Revision: 236391
URL: http://svn.freebsd.org/changeset/base/236391

Log:
  Small cleanups. No functional change.
  
  MFC after: 3 days

Modified:
  head/sys/netinet/sctp_asconf.c
  head/sys/netinet/sctputil.h

Modified: head/sys/netinet/sctp_asconf.c
==
--- head/sys/netinet/sctp_asconf.c  Fri Jun  1 07:07:36 2012
(r236390)
+++ head/sys/netinet/sctp_asconf.c  Fri Jun  1 08:26:50 2012
(r236391)
@@ -48,8 +48,6 @@ __FBSDID("$FreeBSD$");
  * SCTP_DEBUG_ASCONF1: protocol info, general info and errors
  * SCTP_DEBUG_ASCONF2: detailed info
  */
-#ifdef SCTP_DEBUG
-#endif /* SCTP_DEBUG */
 
 
 static void

Modified: head/sys/netinet/sctputil.h
==
--- head/sys/netinet/sctputil.h Fri Jun  1 07:07:36 2012(r236390)
+++ head/sys/netinet/sctputil.h Fri Jun  1 08:26:50 2012(r236391)
@@ -381,7 +381,5 @@ sctp_auditing(int, struct sctp_inpcb *, 
 void sctp_audit_log(uint8_t, uint8_t);
 
 #endif
-
-
 #endif /* _KERNEL */
 #endif
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r236380 - head/sys/vm

2012-06-01 Thread Daniel O'Connor

On 01/06/2012, at 15:38, Sergey Kandaurov wrote:
> Well, we already have more powerful vm.swap_info, so
> I see no reason to add yet another one to do the same thing
> (but now with a human interface).
> Probably sysctl(8) should be enhanced to parse it instead.

There are already sysctls which have duplicate information, eg kern.geom.conf* 
(text, XML & dot versions of the same data)

--
Daniel O'Connor software and network engineer
for Genesis Software - http://www.gsoft.com.au
"The nice thing about standards is that there
are so many of them to choose from."
  -- Andrew Tanenbaum
GPG Fingerprint - 5596 B766 97C0 0E94 4347 295E E593 DC20 7B3F CE8C






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


svn commit: r236388 - head/sbin/devd

2012-06-01 Thread Dimitry Andric
Author: dim
Date: Fri Jun  1 06:56:35 2012
New Revision: 236388
URL: http://svn.freebsd.org/changeset/base/236388

Log:
  Make devd build with libc++.
  
  MFC after:3 days

Modified:
  head/sbin/devd/devd.cc

Modified: head/sbin/devd/devd.cc
==
--- head/sbin/devd/devd.cc  Fri Jun  1 06:55:01 2012(r236387)
+++ head/sbin/devd/devd.cc  Fri Jun  1 06:56:35 2012(r236388)
@@ -807,7 +807,7 @@ create_socket(const char *name)
unlink(name);
if (fcntl(fd, F_SETFL, O_NONBLOCK) < 0)
err(1, "fcntl");
-   if (bind(fd, (struct sockaddr *) & sun, slen) < 0)
+   if (::bind(fd, (struct sockaddr *) & sun, slen) < 0)
err(1, "bind");
listen(fd, 4);
chown(name, 0, 0);  /* XXX - root.wheel */
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r236387 - head/contrib/libc++/include

2012-06-01 Thread Dimitry Andric
Author: dim
Date: Fri Jun  1 06:55:01 2012
New Revision: 236387
URL: http://svn.freebsd.org/changeset/base/236387

Log:
  Fix dangling else in libc++'s __bit_reference header.  This has also
  been sent upstream.
  
  MFC after:3 days

Modified:
  head/contrib/libc++/include/__bit_reference

Modified: head/contrib/libc++/include/__bit_reference
==
--- head/contrib/libc++/include/__bit_reference Fri Jun  1 06:50:37 2012
(r236386)
+++ head/contrib/libc++/include/__bit_reference Fri Jun  1 06:55:01 2012
(r236387)
@@ -950,11 +950,15 @@ __equal_unaligned(__bit_iterator<_Cp, tr
 __storage_type __ddn = _VSTD::min<__storage_type>(__dn, __clz_r);
 __m = (~__storage_type(0) << __first2.__ctz_) & 
(~__storage_type(0) >> (__clz_r - __ddn));
 if (__first2.__ctz_ > __first1.__ctz_)
+{
 if ((*__first2.__seg_ & __m) != (__b << (__first2.__ctz_ - 
__first1.__ctz_)))
 return false;
+}
 else
+{
 if ((*__first2.__seg_ & __m) != (__b >> (__first1.__ctz_ - 
__first2.__ctz_)))
 return false;
+}
 __first2.__seg_ += (__ddn + __first2.__ctz_) / __bits_per_word;
 __first2.__ctz_ = static_cast((__ddn + __first2.__ctz_)  
% __bits_per_word);
 __dn -= __ddn;
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r236386 - head/contrib/llvm/tools/bugpoint

2012-06-01 Thread Dimitry Andric
Author: dim
Date: Fri Jun  1 06:50:37 2012
New Revision: 236386
URL: http://svn.freebsd.org/changeset/base/236386

Log:
  Pull in r155978 from upstream llvm trunk:
  
Fix unintentional use of operator bool.
  
  This enables llvm's bugpoint tool to build with libc++.
  
  MFC after:3 days

Modified:
  head/contrib/llvm/tools/bugpoint/ToolRunner.cpp

Modified: head/contrib/llvm/tools/bugpoint/ToolRunner.cpp
==
--- head/contrib/llvm/tools/bugpoint/ToolRunner.cpp Fri Jun  1 06:45:14 
2012(r236385)
+++ head/contrib/llvm/tools/bugpoint/ToolRunner.cpp Fri Jun  1 06:50:37 
2012(r236386)
@@ -128,7 +128,7 @@ static int RunProgramRemotelyWithTimeout
   ErrorFile.close();
 }
 
-errs() << OS;
+errs() << OS.str();
   }
 
   return ReturnCode;
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r236381 - head/sys/dev/wpi

2012-06-01 Thread Adrian Chadd
Author: adrian
Date: Fri Jun  1 06:20:39 2012
New Revision: 236381
URL: http://svn.freebsd.org/changeset/base/236381

Log:
  Add a missing #include, required for IEEE80211_DEBUG.

Modified:
  head/sys/dev/wpi/if_wpi.c

Modified: head/sys/dev/wpi/if_wpi.c
==
--- head/sys/dev/wpi/if_wpi.c   Fri Jun  1 04:42:52 2012(r236380)
+++ head/sys/dev/wpi/if_wpi.c   Fri Jun  1 06:20:39 2012(r236381)
@@ -59,6 +59,8 @@ __FBSDID("$FreeBSD$");
  * via the firmware.
  */
 
+#include "opt_wlan.h"
+
 #include 
 #include 
 #include 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r236377 - head/sys/dev/vxge/vxgehal

2012-06-01 Thread Eitan Adler
On 31 May 2012 22:13, Bruce Evans  wrote:
> This seems to change a style by (excessive parentheses for a normal
> equality test) into logic bug (assignment of dtrh instead of compariing
> with it).

intentional - perhaps my commit message was poorly worded.

The comment above says
283 /*
284  * restore a previously allocated dtrh at current offset and update
285  * the available reserve length accordingly. If dtrh is null just
286  * update the reserve length, only
287  */


and gnn confirmed that the patch as committed is correct.


-- 
Eitan Adler
Source & Ports committer
X11, Bugbusting teams
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r236380 - head/sys/vm

2012-06-01 Thread Sergey Kandaurov
On 1 June 2012 08:42, Eitan Adler  wrote:
> Author: eadler
> Date: Fri Jun  1 04:42:52 2012
> New Revision: 236380
> URL: http://svn.freebsd.org/changeset/base/236380
>
> Log:
>  Add sysctl to query amount of swap space free
>
>  PR:           kern/166780
>  Submitted by: Radim Kolar 
>  Approved by:  cperciva
>  MFC after:    1 week

Well, we already have more powerful vm.swap_info, so
I see no reason to add yet another one to do the same thing
(but now with a human interface).
Probably sysctl(8) should be enhanced to parse it instead.

>
> Modified:
>  head/sys/vm/swap_pager.c
>
> Modified: head/sys/vm/swap_pager.c
> ==
> --- head/sys/vm/swap_pager.c    Fri Jun  1 04:34:49 2012        (r236379)
> +++ head/sys/vm/swap_pager.c    Fri Jun  1 04:42:52 2012        (r236380)
> @@ -2692,3 +2692,18 @@ swaponvp(struct thread *td, struct vnode
>            NODEV);
>        return (0);
>  }
> +
> +static int
> +sysctl_vm_swap_free(SYSCTL_HANDLER_ARGS) {
> +       int swap_free, used;
> +       int total;
> +
> +       swap_pager_status(&total, &used);
> +
> +       swap_free = (total - used) * PAGE_SIZE;
> +       return SYSCTL_OUT(req, &swap_free, sizeof(swap_free));
> +}
> +
> +SYSCTL_OID(_vm, OID_AUTO, swap_free, CTLTYPE_INT|CTLFLAG_RD|CTLFLAG_MPSAFE,
> +               NULL, 0, sysctl_vm_swap_free, "Q",
> +               "Blocks of free swap storage.");



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