svn commit: r195043 - stable/7/sbin/restore

2009-06-26 Thread Warner Losh
Author: imp
Date: Fri Jun 26 06:59:47 2009
New Revision: 195043
URL: http://svn.freebsd.org/changeset/base/195043

Log:
  Merge r187828: restore necessary NUL termination.

Modified:
  stable/7/sbin/restore/   (props changed)
  stable/7/sbin/restore/interactive.c

Modified: stable/7/sbin/restore/interactive.c
==
--- stable/7/sbin/restore/interactive.c Fri Jun 26 06:40:12 2009
(r195042)
+++ stable/7/sbin/restore/interactive.c Fri Jun 26 06:59:47 2009
(r195043)
@@ -545,6 +545,7 @@ printlist(char *name, char *basename)
 strcmp(dp->d_name, ".") == 0 ||
 strcmp(dp->d_name, "..") == 0))
continue;
+   locname[namelen] = '\0';
if (namelen + dp->d_namlen >= MAXPATHLEN) {
fprintf(stderr, "%s%s: name exceeds %d char\n",
locname, dp->d_name, MAXPATHLEN);
___
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: r195044 - head/share/misc

2009-06-26 Thread Warner Losh
Author: imp
Date: Fri Jun 26 07:11:14 2009
New Revision: 195044
URL: http://svn.freebsd.org/changeset/base/195044

Log:
  Correct some minor nits with the 2BSD and 3BSD series of releases
  based on the information at The Unix Historical Society web page
  (http://www.tuhs.org/Unix_History).  Where multiple sources differ,
  retain all data.  Prefer 2.79BSD to 2.7.9BSD, since the former is from
  /LABEL form the actual release.  Use the /LABEL date as in the TUHS
  tables (the curious can read http://minnie.tuhs.org/Unix_History/2bsd
  for all the conflicting date confusion if they want).
  
  Approved by:  re@

Modified:
  head/share/misc/bsd-family-tree

Modified: head/share/misc/bsd-family-tree
==
--- head/share/misc/bsd-family-tree Fri Jun 26 06:59:47 2009
(r195043)
+++ head/share/misc/bsd-family-tree Fri Jun 26 07:11:14 2009
(r195044)
@@ -25,7 +25,7 @@ Seventh Edition (V7)|
   \/ |
  3BSD|
   |  |
-   4.0BSD   2.7.9BSD
+   4.0BSD2.79BSD
   |  |
4.1BSD --> 2.8BSD
   |  |
@@ -260,6 +260,7 @@ was the announcement in Usenet or if it 
 [OBD] OpenBSD Project, The.
 [QCU] Salus, Peter H. A quarter century of UNIX.
 [SMS] Steven M. Schultz. 2.11BSD, UNIX for the PDP-11.
+[TUHS] The Unix Historical Society.  http://minnie.tuhs.org/Unix_History/.
 [USE] Usenet announcement.
 [WRS] Wind River Systems, Inc.
 [dmr] Dennis Ritchie, via E-Mail
@@ -297,15 +298,15 @@ Tenth   Edition 1989-10-xx [QCU]
PDP-11, Pascal, ex(1)
30 free copies of 1BSD sent out
35 tapes sold for 50 USD [QCU]
-2BSDmid 1978 [QCU]
+2BSDmid 1978 [QCU] 1979-05-10 [TUHS]
75 2BSD tapes shipped
-2.7.9BSD   ?? [SMS]
+2.79BSD1980-04-xx [TUHS]
 2.8BSD 1981-07-xx [KSJ]
 
 2.8.1BSD   1982-01-xx [QCU]
set of performance improvements
 2.9BSD 1983-07-xx [KSJ]
-2.9.1BSD1983-11-xx
+2.9.1BSD1983-11-xx [TUHS]
 2.9BSD-Seismo  1985-08-xx [SMS]
 2.10BSD1987-04-xx [KKK]
 2.10.1BSD  1989-01-xx [SMS]
@@ -313,7 +314,7 @@ Tenth   Edition 1989-10-xx [QCU]
 2.11BSD rev #430   1999-12-13 [SMS]
 
 32V1978-1[01]-xx [QCU]
-3BSDlate 1979 [QCU]
+3BSDlate 1979 [QCU] March 1980 [TUHS]
virtual memory, page replacement,
demand paging
 4.0BSD  1980-10-xx
___
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: r195026 - head/etc/rc.d

2009-06-26 Thread Robert Watson


On Fri, 26 Jun 2009, Doug Barton wrote:


 Reverse the effect of r193198 for pf and ipfw which will once again
 allow them to start after netif. There were too many problems reported
 with this change in the short period of time that it lived in HEAD, and
 we are too late in the release cycle to properly shake it out.

 IMO the issue of having the firewalls up before the network is still a
 valid concern, particularly for pf whose default state is wide open.
 However properly solving this issue is going to take some investment
 on the part of the people who actually use those tools.


This sounds right to me, FWIW -- being able to fully configure the policy 
before network traffic starts is definitely right in the abstract, it's just a 
question of getting there...


Robert N M Watson
Computer Laboratory
University of Cambridge



 This is not a strict reversion of all the changes for r193198 since it
 also included some simplification of the BEFORE/REQUIRE logic which is
 still valid for ipfilter and ip6fw.

Modified:
 head/etc/rc.d/NETWORKING
 head/etc/rc.d/ipfw
 head/etc/rc.d/netif
 head/etc/rc.d/pf
 head/etc/rc.d/pflog
 head/etc/rc.d/pfsync

Modified: head/etc/rc.d/NETWORKING
==
--- head/etc/rc.d/NETWORKINGFri Jun 26 01:01:50 2009(r195025)
+++ head/etc/rc.d/NETWORKINGFri Jun 26 01:04:50 2009(r195026)
@@ -4,7 +4,7 @@
#

# PROVIDE: NETWORKING NETWORK
-# REQUIRE: netif netoptions routing network_ipv6 ppp
+# REQUIRE: netif netoptions routing network_ipv6 ppp ipfw
# REQUIRE: defaultroute routed mrouted route6d mroute6d resolv

#   This is a dummy dependency, for services which require networking

Modified: head/etc/rc.d/ipfw
==
--- head/etc/rc.d/ipfw  Fri Jun 26 01:01:50 2009(r195025)
+++ head/etc/rc.d/ipfw  Fri Jun 26 01:04:50 2009(r195026)
@@ -4,7 +4,7 @@
#

# PROVIDE: ipfw
-# REQUIRE: FILESYSTEMS
+# REQUIRE: ppp
# KEYWORD: nojail

. /etc/rc.subr

Modified: head/etc/rc.d/netif
==
--- head/etc/rc.d/netif Fri Jun 26 01:01:50 2009(r195025)
+++ head/etc/rc.d/netif Fri Jun 26 01:04:50 2009(r195026)
@@ -27,7 +27,7 @@

# PROVIDE: netif
# REQUIRE: atm1 cleanvar FILESYSTEMS serial sppp sysctl
-# REQUIRE: ipfilter ipfs pf ipfw
+# REQUIRE: ipfilter ipfs
# KEYWORD: nojail

. /etc/rc.subr

Modified: head/etc/rc.d/pf
==
--- head/etc/rc.d/pfFri Jun 26 01:01:50 2009(r195025)
+++ head/etc/rc.d/pfFri Jun 26 01:04:50 2009(r195026)
@@ -4,7 +4,7 @@
#

# PROVIDE: pf
-# REQUIRE: FILESYSTEMS pflog pfsync
+# REQUIRE: FILESYSTEMS netif pflog pfsync
# BEFORE:  routing
# KEYWORD: nojail


Modified: head/etc/rc.d/pflog
==
--- head/etc/rc.d/pflog Fri Jun 26 01:01:50 2009(r195025)
+++ head/etc/rc.d/pflog Fri Jun 26 01:04:50 2009(r195026)
@@ -4,7 +4,7 @@
#

# PROVIDE: pflog
-# REQUIRE: FILESYSTEMS cleanvar
+# REQUIRE: FILESYSTEMS netif cleanvar
# KEYWORD: nojail

. /etc/rc.subr

Modified: head/etc/rc.d/pfsync
==
--- head/etc/rc.d/pfsyncFri Jun 26 01:01:50 2009(r195025)
+++ head/etc/rc.d/pfsyncFri Jun 26 01:04:50 2009(r195026)
@@ -4,7 +4,7 @@
#

# PROVIDE: pfsync
-# REQUIRE: FILESYSTEMS
+# REQUIRE: FILESYSTEMS netif
# KEYWORD: nojail

. /etc/rc.subr


___
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: r195045 - head/sys/boot/i386/libi386

2009-06-26 Thread Rui Paulo
Author: rpaulo
Date: Fri Jun 26 09:32:31 2009
New Revision: 195045
URL: http://svn.freebsd.org/changeset/base/195045

Log:
  On special systems where the MBR and the GPT are in sync (up to the 4th
  slicei, Apple EFI hardware), the bootloader will fail to recognize the GPT
  if it finds anything else but the EFI partition. Change the check to continue
  detecting the GPT by looking at the EFI partition on the MBR but
  stopping successfuly after finding it.
  
  PR:   kern/134590
  Submitted by: Christoph Langguth 
  Reviewed by:  jhb
  MFC after:2 weeks
  Approved by:  re (kib)

Modified:
  head/sys/boot/i386/libi386/biosdisk.c

Modified: head/sys/boot/i386/libi386/biosdisk.c
==
--- head/sys/boot/i386/libi386/biosdisk.c   Fri Jun 26 07:11:14 2009
(r195044)
+++ head/sys/boot/i386/libi386/biosdisk.c   Fri Jun 26 09:32:31 2009
(r195045)
@@ -880,7 +880,7 @@ bd_open_gpt(struct open_disk *od, struct
 for (i = 0; i < NDOSPART; i++) {
if (dp[i].dp_typ == 0xee)
part++;
-   else if (dp[i].dp_typ != 0x00)
+   else if ((part != 1) && (dp[i].dp_typ != 0x00))
return (EINVAL);
 }
 if (part != 1)
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r195046 - head/sys/dev/asmc

2009-06-26 Thread Rui Paulo
Author: rpaulo
Date: Fri Jun 26 10:23:17 2009
New Revision: 195046
URL: http://svn.freebsd.org/changeset/base/195046

Log:
  Add support for MacBook4,1.
  
  Submitted by: Christoph Langguth 
  MFC after:2 weeks
  Approved by:  re (kib)

Modified:
  head/sys/dev/asmc/asmc.c
  head/sys/dev/asmc/asmcvar.h

Modified: head/sys/dev/asmc/asmc.c
==
--- head/sys/dev/asmc/asmc.cFri Jun 26 09:32:31 2009(r195045)
+++ head/sys/dev/asmc/asmc.cFri Jun 26 10:23:17 2009(r195046)
@@ -68,7 +68,9 @@ static intasmc_detach(device_t dev);
  * SMC functions.
  */
 static int asmc_init(device_t dev);
+static int asmc_command(device_t dev, uint8_t command);
 static int asmc_wait(device_t dev, uint8_t val);
+static int asmc_wait_ack(device_t dev, uint8_t val, int amount);
 static int asmc_key_write(device_t dev, const char *key, uint8_t *buf,
 uint8_t len);
 static int asmc_key_read(device_t dev, const char *key, uint8_t *buf,
@@ -99,6 +101,7 @@ static int   asmc_mb_sysctl_sms_y(SYSCTL_
 static int asmc_mb_sysctl_sms_z(SYSCTL_HANDLER_ARGS);
 static int asmc_mbp_sysctl_light_left(SYSCTL_HANDLER_ARGS);
 static int asmc_mbp_sysctl_light_right(SYSCTL_HANDLER_ARGS);
+static int asmc_mbp_sysctl_light_control(SYSCTL_HANDLER_ARGS);
 
 struct asmc_model {
const char   *smc_model;/* smbios.system.product env var. */
@@ -115,6 +118,7 @@ struct asmc_model {
int (*smc_fan_targetspeed)(SYSCTL_HANDLER_ARGS);
int (*smc_light_left)(SYSCTL_HANDLER_ARGS);
int (*smc_light_right)(SYSCTL_HANDLER_ARGS);
+   int (*smc_light_control)(SYSCTL_HANDLER_ARGS);
 
const char  *smc_temps[ASMC_TEMP_MAX];
const char  *smc_tempnames[ASMC_TEMP_MAX];
@@ -131,18 +135,19 @@ static struct asmc_model *asmc_match(dev
asmc_mb_sysctl_fanmaxspeed, \
asmc_mb_sysctl_fantargetspeed
 #define ASMC_LIGHT_FUNCS asmc_mbp_sysctl_light_left, \
-asmc_mbp_sysctl_light_right
+asmc_mbp_sysctl_light_right, \
+asmc_mbp_sysctl_light_control
 
 struct asmc_model asmc_models[] = {
{ 
  "MacBook1,1", "Apple SMC MacBook Core Duo",
- ASMC_SMS_FUNCS, ASMC_FAN_FUNCS, NULL, NULL,
+ ASMC_SMS_FUNCS, ASMC_FAN_FUNCS, NULL, NULL, NULL,
  ASMC_MB_TEMPS, ASMC_MB_TEMPNAMES, ASMC_MB_TEMPDESCS
},
 
{ 
  "MacBook2,1", "Apple SMC MacBook Core 2 Duo",
- ASMC_SMS_FUNCS, ASMC_FAN_FUNCS, NULL, NULL,
+ ASMC_SMS_FUNCS, ASMC_FAN_FUNCS, NULL, NULL, NULL,
  ASMC_MB_TEMPS, ASMC_MB_TEMPNAMES, ASMC_MB_TEMPDESCS
},
 
@@ -182,12 +187,18 @@ struct asmc_model asmc_models[] = {
  ASMC_MBP_TEMPS, ASMC_MBP_TEMPNAMES, ASMC_MBP_TEMPDESCS
},

+   { 
+ "MacBookPro4,1", "Apple SMC MacBook Pro Core 2 Duo (Penryn)",
+ ASMC_SMS_FUNCS, ASMC_FAN_FUNCS, ASMC_LIGHT_FUNCS,
+ ASMC_MBP4_TEMPS, ASMC_MBP4_TEMPNAMES, ASMC_MBP4_TEMPDESCS
+   },
+   
/* The Mac Mini has no SMS */
{ 
  "Macmini1,1", "Apple SMC Mac Mini",
  NULL, NULL, NULL,
  ASMC_FAN_FUNCS,
- NULL, NULL,
+ NULL, NULL, NULL,
  ASMC_MM_TEMPS, ASMC_MM_TEMPNAMES, ASMC_MM_TEMPDESCS
},
 
@@ -196,13 +207,13 @@ struct asmc_model asmc_models[] = {
  "MacPro2", "Apple SMC Mac Pro (8-core)",
  NULL, NULL, NULL,
  ASMC_FAN_FUNCS,
- NULL, NULL,
+ NULL, NULL, NULL,
  ASMC_MP_TEMPS, ASMC_MP_TEMPNAMES, ASMC_MP_TEMPDESCS
},
 
{
  "MacBookAir1,1", "Apple SMC MacBook Air",
- ASMC_SMS_FUNCS, ASMC_FAN_FUNCS, NULL, NULL,
+ ASMC_SMS_FUNCS, ASMC_FAN_FUNCS, NULL, NULL, NULL,
  ASMC_MBA_TEMPS, ASMC_MBA_TEMPNAMES, ASMC_MBA_TEMPDESCS
},  
 
@@ -242,6 +253,7 @@ ACPI_MODULE_NAME("ASMC")
 #define ASMC_DPRINTF(str)  
 #endif
 
+/* NB: can't be const */
 static char *asmc_ids[] = { "APP0001", NULL };
 
 static devclass_t asmc_devclass;
@@ -385,6 +397,33 @@ asmc_attach(device_t dev)
model->smc_tempdescs[i]);
}
 
+   /*
+* dev.asmc.n.light
+*/
+   if (model->smc_light_left) {
+   sc->sc_light_tree = SYSCTL_ADD_NODE(sysctlctx,
+   SYSCTL_CHILDREN(sysctlnode), OID_AUTO, "light",
+   CTLFLAG_RD, 0, "Keyboard backlight sensors");
+   
+   SYSCTL_ADD_PROC(sysctlctx,
+   SYSCTL_CHILDREN(sc->sc_light_tree),
+   OID_AUTO, "left", CTLTYPE_INT | CTLFLAG_RD,
+   dev, 0, model->smc_light_left, "I",
+   "Keyboard backlight left sensor");
+   
+   SYSCTL_ADD_PROC(sysctlctx,
+   SYSCTL_CHILDREN(sc->sc_light_tree),
+   OID_AUTO, "right", CT

svn commit: r195049 - in head/sys: arm/at91 arm/xscale/ixp425 dev/ae dev/age dev/alc dev/ale dev/ath dev/bce dev/bfe dev/bge dev/bm dev/cas dev/cs dev/dc dev/de dev/e1000 dev/ed dev/et dev/ex dev/f...

2009-06-26 Thread Robert Watson
Author: rwatson
Date: Fri Jun 26 11:45:06 2009
New Revision: 195049
URL: http://svn.freebsd.org/changeset/base/195049

Log:
  Use if_maddr_rlock()/if_maddr_runlock() rather than IF_ADDR_LOCK()/
  IF_ADDR_UNLOCK() across network device drivers when accessing the
  per-interface multicast address list, if_multiaddrs.  This will
  allow us to change the locking strategy without affecting our driver
  programming interface or binary interface.
  
  For two wireless drivers, remove unnecessary locking, since they
  don't actually access the multicast address list.
  
  Approved by:  re (kib)
  MFC after:6 weeks

Modified:
  head/sys/arm/at91/if_ate.c
  head/sys/arm/xscale/ixp425/if_npe.c
  head/sys/dev/ae/if_ae.c
  head/sys/dev/age/if_age.c
  head/sys/dev/alc/if_alc.c
  head/sys/dev/ale/if_ale.c
  head/sys/dev/ath/if_ath.c
  head/sys/dev/bce/if_bce.c
  head/sys/dev/bfe/if_bfe.c
  head/sys/dev/bge/if_bge.c
  head/sys/dev/bm/if_bm.c
  head/sys/dev/cas/if_cas.c
  head/sys/dev/cs/if_cs.c
  head/sys/dev/dc/if_dc.c
  head/sys/dev/de/if_de.c
  head/sys/dev/e1000/if_em.c
  head/sys/dev/e1000/if_igb.c
  head/sys/dev/ed/if_ed.c
  head/sys/dev/et/if_et.c
  head/sys/dev/ex/if_ex.c
  head/sys/dev/fe/if_fe.c
  head/sys/dev/fxp/if_fxp.c
  head/sys/dev/gem/if_gem.c
  head/sys/dev/hme/if_hme.c
  head/sys/dev/ie/if_ie.c
  head/sys/dev/if_ndis/if_ndis.c
  head/sys/dev/ixgb/if_ixgb.c
  head/sys/dev/ixgbe/ixgbe.c
  head/sys/dev/jme/if_jme.c
  head/sys/dev/le/lance.c
  head/sys/dev/lge/if_lge.c
  head/sys/dev/malo/if_malo.c
  head/sys/dev/mge/if_mge.c
  head/sys/dev/msk/if_msk.c
  head/sys/dev/mxge/if_mxge.c
  head/sys/dev/my/if_my.c
  head/sys/dev/nfe/if_nfe.c
  head/sys/dev/nge/if_nge.c
  head/sys/dev/nve/if_nve.c
  head/sys/dev/nxge/if_nxge.c
  head/sys/dev/pcn/if_pcn.c
  head/sys/dev/pdq/pdq_ifsubr.c
  head/sys/dev/re/if_re.c
  head/sys/dev/sf/if_sf.c
  head/sys/dev/sis/if_sis.c
  head/sys/dev/sk/if_sk.c
  head/sys/dev/sn/if_sn.c
  head/sys/dev/snc/dp83932.c
  head/sys/dev/ste/if_ste.c
  head/sys/dev/stge/if_stge.c
  head/sys/dev/ti/if_ti.c
  head/sys/dev/tl/if_tl.c
  head/sys/dev/tsec/if_tsec.c
  head/sys/dev/tx/if_tx.c
  head/sys/dev/txp/if_txp.c
  head/sys/dev/usb/net/if_aue.c
  head/sys/dev/usb/net/if_axe.c
  head/sys/dev/usb/net/if_cue.c
  head/sys/dev/usb/net/if_kue.c
  head/sys/dev/usb/net/if_rue.c
  head/sys/dev/usb/net/if_udav.c
  head/sys/dev/usb/wlan/if_upgt.c
  head/sys/dev/usb/wlan/if_urtw.c
  head/sys/dev/usb/wlan/if_zyd.c
  head/sys/dev/vge/if_vge.c
  head/sys/dev/vr/if_vr.c
  head/sys/dev/wb/if_wb.c
  head/sys/dev/wi/if_wi.c
  head/sys/dev/wl/if_wl.c
  head/sys/dev/xe/if_xe.c
  head/sys/dev/xl/if_xl.c
  head/sys/mips/adm5120/if_admsw.c
  head/sys/netgraph/ng_ether.c
  head/sys/pci/if_rl.c

Modified: head/sys/arm/at91/if_ate.c
==
--- head/sys/arm/at91/if_ate.c  Fri Jun 26 11:07:57 2009(r195048)
+++ head/sys/arm/at91/if_ate.c  Fri Jun 26 11:45:06 2009(r195049)
@@ -413,7 +413,7 @@ ate_setmcast(struct ate_softc *sc)
 */
mcaf[0] = 0;
mcaf[1] = 0;
-   IF_ADDR_LOCK(ifp);
+   if_maddr_rlock(ifp);
TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
if (ifma->ifma_addr->sa_family != AF_LINK)
continue;
@@ -421,14 +421,14 @@ ate_setmcast(struct ate_softc *sc)
ifma->ifma_addr), ETHER_ADDR_LEN) >> 26;
af[index >> 3] |= 1 << (index & 7);
}
-   IF_ADDR_UNLOCK(ifp);
+   if_maddr_runlock(ifp);
 
/*
 * Write the hash to the hash register.  This card can also
 * accept unicast packets as well as multicast packets using this
 * register for easier bridging operations, but we don't take
 * advantage of that.  Locks here are to avoid LOR with the
-* IF_ADDR_LOCK, but might not be strictly necessary.
+* if_maddr_rlock, but might not be strictly necessary.
 */
WR4(sc, ETH_HSL, mcaf[0]);
WR4(sc, ETH_HSH, mcaf[1]);

Modified: head/sys/arm/xscale/ixp425/if_npe.c
==
--- head/sys/arm/xscale/ixp425/if_npe.c Fri Jun 26 11:07:57 2009
(r195048)
+++ head/sys/arm/xscale/ixp425/if_npe.c Fri Jun 26 11:45:06 2009
(r195049)
@@ -435,7 +435,7 @@ npe_setmcast(struct npe_softc *sc)
memset(clr, 0, ETHER_ADDR_LEN);
memset(set, 0xff, ETHER_ADDR_LEN);
 
-   IF_ADDR_LOCK(ifp);
+   if_maddr_rlock(ifp);
TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
if (ifma->ifma_addr->sa_family != AF_LINK)
continue;
@@ -445,7 +445,7 @@ npe_setmcast(struct npe_softc *sc)
set[i] &= mac[i];
}
}
-   IF_ADDR_UNLOCK(ifp);
+   if_maddr_runlock(ifp);
 

svn commit: r195053 - in stable/7/sys: . contrib/pf netipsec

2009-06-26 Thread VANHULLEBUS Yvan
Author: vanhu
Date: Fri Jun 26 13:37:53 2009
New Revision: 195053
URL: http://svn.freebsd.org/changeset/base/195053

Log:
  MFC: Only decrease refcnt once when flushing SPD entries, to
  avoid flushing entries which are still used.
  
  Obtained from:NETASQ

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

Modified: stable/7/sys/netipsec/key.c
==
--- stable/7/sys/netipsec/key.c Fri Jun 26 11:58:15 2009(r195052)
+++ stable/7/sys/netipsec/key.c Fri Jun 26 13:37:53 2009(r195053)
@@ -4057,10 +4057,21 @@ restart:
if (sp->scangen == gen) /* previously handled */
continue;
sp->scangen = gen;
-   if (sp->state == IPSEC_SPSTATE_DEAD) {
-   /* NB: clean entries created by key_spdflush */
+   if (sp->state == IPSEC_SPSTATE_DEAD &&
+   sp->refcnt == 1) {
+   /*
+* Ensure that we only decrease refcnt once,
+* when we're the last consumer.
+* Directly call SP_DELREF/key_delsp instead
+* of KEY_FREESP to avoid unlocking/relocking
+* SPTREE_LOCK before key_delsp: may refcnt
+* be increased again during that time ?
+* NB: also clean entries created by
+* key_spdflush
+*/
+   SP_DELREF(sp);
+   key_delsp(sp);
SPTREE_UNLOCK();
-   KEY_FREESP(&sp);
goto restart;
}
if (sp->lifetime == 0 && sp->validtime == 0)
@@ -4070,7 +4081,6 @@ restart:
sp->state = IPSEC_SPSTATE_DEAD;
SPTREE_UNLOCK();
key_spdexpire(sp);
-   KEY_FREESP(&sp);
goto restart;
}
}
___
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: r195045 - head/sys/boot/i386/libi386

2009-06-26 Thread John Baldwin
On Friday 26 June 2009 5:32:31 am Rui Paulo wrote:
> Author: rpaulo
> Date: Fri Jun 26 09:32:31 2009
> New Revision: 195045
> URL: http://svn.freebsd.org/changeset/base/195045
> 
> Log:
>   On special systems where the MBR and the GPT are in sync (up to the 4th
>   slicei, Apple EFI hardware), the bootloader will fail to recognize the GPT
>   if it finds anything else but the EFI partition. Change the check to 
> continue
>   detecting the GPT by looking at the EFI partition on the MBR but
>   stopping successfuly after finding it.

Technically it is not an EFI partition btw.  That is a different type.  0xee
is a dedicated type used to mark a PMBR.

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


svn commit: r195060 - in head/sys: amd64/include arm/include i386/include ia64/include mips/include powerpc/include sparc64/include sun4v/include

2009-06-26 Thread Alan Cox
Author: alc
Date: Fri Jun 26 16:22:24 2009
New Revision: 195060
URL: http://svn.freebsd.org/changeset/base/195060

Log:
  Correct the #endif comment.
  
  Noticed by:   jmallett
  Approved by:  re (kib)

Modified:
  head/sys/amd64/include/vm.h
  head/sys/arm/include/vm.h
  head/sys/i386/include/vm.h
  head/sys/ia64/include/vm.h
  head/sys/mips/include/vm.h
  head/sys/powerpc/include/vm.h
  head/sys/sparc64/include/vm.h
  head/sys/sun4v/include/vm.h

Modified: head/sys/amd64/include/vm.h
==
--- head/sys/amd64/include/vm.h Fri Jun 26 16:22:07 2009(r195059)
+++ head/sys/amd64/include/vm.h Fri Jun 26 16:22:24 2009(r195060)
@@ -42,4 +42,4 @@
 
 #defineVM_CACHE_DEFAULTVM_CACHE_WRITE_BACK
 
-#endif /* !_MACHINE_PMAP_H_ */
+#endif /* !_MACHINE_VM_H_ */

Modified: head/sys/arm/include/vm.h
==
--- head/sys/arm/include/vm.h   Fri Jun 26 16:22:07 2009(r195059)
+++ head/sys/arm/include/vm.h   Fri Jun 26 16:22:24 2009(r195060)
@@ -32,4 +32,4 @@
 /* Cache control is not (yet) implemented. */
 #defineVM_CACHE_DEFAULT0
 
-#endif /* !_MACHINE_PMAP_H_ */
+#endif /* !_MACHINE_VM_H_ */

Modified: head/sys/i386/include/vm.h
==
--- head/sys/i386/include/vm.h  Fri Jun 26 16:22:07 2009(r195059)
+++ head/sys/i386/include/vm.h  Fri Jun 26 16:22:24 2009(r195060)
@@ -42,4 +42,4 @@
 
 #defineVM_CACHE_DEFAULTVM_CACHE_WRITE_BACK
 
-#endif /* !_MACHINE_PMAP_H_ */
+#endif /* !_MACHINE_VM_H_ */

Modified: head/sys/ia64/include/vm.h
==
--- head/sys/ia64/include/vm.h  Fri Jun 26 16:22:07 2009(r195059)
+++ head/sys/ia64/include/vm.h  Fri Jun 26 16:22:24 2009(r195060)
@@ -41,4 +41,4 @@
 
 #defineVM_CACHE_DEFAULTVM_CACHE_WRITE_BACK
 
-#endif /* !_MACHINE_PMAP_H_ */
+#endif /* !_MACHINE_VM_H_ */

Modified: head/sys/mips/include/vm.h
==
--- head/sys/mips/include/vm.h  Fri Jun 26 16:22:07 2009(r195059)
+++ head/sys/mips/include/vm.h  Fri Jun 26 16:22:24 2009(r195060)
@@ -37,4 +37,4 @@
 
 #defineVM_CACHE_DEFAULTVM_CACHE_CACHEABLE_NONCOHERENT
 
-#endif /* !_MACHINE_PMAP_H_ */
+#endif /* !_MACHINE_VM_H_ */

Modified: head/sys/powerpc/include/vm.h
==
--- head/sys/powerpc/include/vm.h   Fri Jun 26 16:22:07 2009
(r195059)
+++ head/sys/powerpc/include/vm.h   Fri Jun 26 16:22:24 2009
(r195060)
@@ -37,4 +37,4 @@
 
 #defineVM_CACHE_DEFAULT0
 
-#endif /* !_MACHINE_PMAP_H_ */
+#endif /* !_MACHINE_VM_H_ */

Modified: head/sys/sparc64/include/vm.h
==
--- head/sys/sparc64/include/vm.h   Fri Jun 26 16:22:07 2009
(r195059)
+++ head/sys/sparc64/include/vm.h   Fri Jun 26 16:22:24 2009
(r195060)
@@ -32,4 +32,4 @@
 /* Cache control is not (yet) implemented. */
 #defineVM_CACHE_DEFAULT0
 
-#endif /* !_MACHINE_PMAP_H_ */
+#endif /* !_MACHINE_VM_H_ */

Modified: head/sys/sun4v/include/vm.h
==
--- head/sys/sun4v/include/vm.h Fri Jun 26 16:22:07 2009(r195059)
+++ head/sys/sun4v/include/vm.h Fri Jun 26 16:22:24 2009(r195060)
@@ -32,4 +32,4 @@
 /* Cache control is not (yet) implemented. */
 #defineVM_CACHE_DEFAULT0
 
-#endif /* !_MACHINE_PMAP_H_ */
+#endif /* !_MACHINE_VM_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: r195064 - in head: . sys/conf

2009-06-26 Thread John Baldwin
Author: jhb
Date: Fri Jun 26 17:50:52 2009
New Revision: 195064
URL: http://svn.freebsd.org/changeset/base/195064

Log:
  Note that as a result of the SYSV IPC changes, COMPAT_FREEBSD[456] now
  require COMPAT_FREEBSD7.  Also, explicitly note in NOTES that any version
  of COMPAT_FREEBSD effectively requires for newer binaries (i.e.
  COMPAT_FREEBSD, etc.).  While this has been true in practice
  previously, it used to compile ok before the commit earlier this week.
  
  Discussed with:   peter
  Approved by:  re (kensmith)

Modified:
  head/UPDATING
  head/sys/conf/NOTES

Modified: head/UPDATING
==
--- head/UPDATING   Fri Jun 26 17:30:33 2009(r195063)
+++ head/UPDATING   Fri Jun 26 17:50:52 2009(r195064)
@@ -22,6 +22,12 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 8.
to maximize performance.  (To disable malloc debugging, run
ln -s aj /etc/malloc.conf.)
 
+20090624:
+   The ABI of various structures related to the SYSV IPC API have
+   been changed.  As a result, the COMPAT_FREEBSD[456] kernel
+   options now all require COMPAT_FREEBSD7.  Bump __FreeBSD_version
+   to 800100.
+
 20090622:
Layout of struct vnet has changed as routing related variables
were moved to their own Vimage module. Modules need to be

Modified: head/sys/conf/NOTES
==
--- head/sys/conf/NOTES Fri Jun 26 17:30:33 2009(r195063)
+++ head/sys/conf/NOTES Fri Jun 26 17:50:52 2009(r195064)
@@ -301,6 +301,9 @@ options COMPAT_43
 # Old tty interface.
 optionsCOMPAT_43TTY
 
+# Note that as a general rule, COMPAT_FREEBSD depends on
+# COMPAT_FREEBSD, COMPAT_FREEBSD, etc.
+
 # Enable FreeBSD4 compatibility syscalls
 optionsCOMPAT_FREEBSD4
 
___
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: r194789 - head/usr.bin/usbhidctl

2009-06-26 Thread Bruce Evans

On Thu, 25 Jun 2009, Xin LI wrote:


Bruce Evans wrote:

On Tue, 23 Jun 2009, Xin LI wrote:


Log:
 Use getprogname() instead of referencing __progname.


Neither is permitted in FreeBSD in usage().


I didn't see references about this?  If this is discouraged, perhaps we
should mention it in style(9) or somewhere.


FreeBSD style(9) simply doesn't mention getprogname(), while NetBSD
share/misc/style requires it in the example usage().

Actually, it is OK to use it in FreeBSD iff the system supports the
same program having different names, like reboot/halt/etc.


It looks like that a lot of
programs are using (not necessarily from NetBSD), but also others.  Do
we have some discussion in the past regarding this?


Most are still from NetBSD, except for lots in tools/regression.  Most
other uses are still correct ones, for things like setproctitle() (and
for not so correct things like fprintf() -- why not use warnx()?).

This was discussed in FreeBSD mailing lists years ago, and IIRC no one
disagreed with the existing practice of hard-coding the program name.
It can be considered a feature that if you copy or rename "cp" to
"foo", its usage message reminds you that it is still "cp".


Modified:
 head/usr.bin/usbhidctl/usbhid.c


This was obtained from NetBSD, which requires using getprogname() in
usage().


This is purely coincidence...  I didn't even looked at NetBSD code in
this case, otherwise I would have brought the TNF copyright changes,
etc. altogether.


The __progname in usbhidctl was obtained from NetBSD.  Without this,
the usage() function would have been a normal one and you shouldn't
have needed to fix it.  NetBSD of course fixed it long ago (FreeBSD
obtained the bug in 2000 and it was fixed in NetBSD in 2001).  In my
2005 copy of NetBSD, all usage() messages in utilities seem to have
been roto-tilled to use getprogname().  This gives 343 files matching
getprogname in NetBSD 2005 (incomplete sources but I forget how incomplete).
FreeBSD now has only 88 files matching.

Bruce
___
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: r195070 - head/sys/net

2009-06-26 Thread Robert Watson
Author: rwatson
Date: Fri Jun 26 18:50:49 2009
New Revision: 195070
URL: http://svn.freebsd.org/changeset/base/195070

Log:
  Use if_addr_rlock/if_addr_runlock for if_spp when iterating if_addrhead,
  as it is loadable as a module.
  
  Approved by:  re (kib)
  MFC after:6 weeks

Modified:
  head/sys/net/if_spppsubr.c

Modified: head/sys/net/if_spppsubr.c
==
--- head/sys/net/if_spppsubr.c  Fri Jun 26 18:40:29 2009(r195069)
+++ head/sys/net/if_spppsubr.c  Fri Jun 26 18:50:49 2009(r195070)
@@ -4905,7 +4905,7 @@ sppp_get_ip_addrs(struct sppp *sp, u_lon
 * aliases don't make any sense on a p2p link anyway.
 */
si = 0;
-   IF_ADDR_LOCK(ifp);
+   if_addr_rlock(ifp);
TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link)
if (ifa->ifa_addr->sa_family == AF_INET) {
si = (struct sockaddr_in *)ifa->ifa_addr;
@@ -4924,7 +4924,7 @@ sppp_get_ip_addrs(struct sppp *sp, u_lon
if (si && si->sin_addr.s_addr)
ddst = si->sin_addr.s_addr;
}
-   IF_ADDR_UNLOCK(ifp);
+   if_addr_runlock(ifp);
 
if (dst) *dst = ntohl(ddst);
if (src) *src = ntohl(ssrc);
@@ -4948,7 +4948,7 @@ sppp_set_ip_addr(struct sppp *sp, u_long
 * aliases don't make any sense on a p2p link anyway.
 */
si = 0;
-   IF_ADDR_LOCK(ifp);
+   if_addr_rlock(ifp);
TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
if (ifa->ifa_addr->sa_family == AF_INET) {
si = (struct sockaddr_in *)ifa->ifa_addr;
@@ -4958,7 +4958,7 @@ sppp_set_ip_addr(struct sppp *sp, u_long
}
}
}
-   IF_ADDR_UNLOCK(ifp);
+   if_addr_runlock(ifp);
 
if (ifa != NULL) {
int error;
@@ -5010,7 +5010,7 @@ sppp_get_ip6_addrs(struct sppp *sp, stru
 * aliases don't make any sense on a p2p link anyway.
 */
si = NULL;
-   IF_ADDR_LOCK(ifp);
+   if_addr_rlock(ifp);
TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link)
if (ifa->ifa_addr->sa_family == AF_INET6) {
si = (struct sockaddr_in6 *)ifa->ifa_addr;
@@ -5036,7 +5036,7 @@ sppp_get_ip6_addrs(struct sppp *sp, stru
bcopy(&ddst, dst, sizeof(*dst));
if (src)
bcopy(&ssrc, src, sizeof(*src));
-   IF_ADDR_UNLOCK(ifp);
+   if_addr_runlock(ifp);
 }
 
 #ifdef IPV6CP_MYIFID_DYN
@@ -5065,7 +5065,7 @@ sppp_set_ip6_addr(struct sppp *sp, const
 */
 
sin6 = NULL;
-   IF_ADDR_LOCK(ifp);
+   if_addr_rlock(ifp);
TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
if (ifa->ifa_addr->sa_family == AF_INET6) {
sin6 = (struct sockaddr_in6 *)ifa->ifa_addr;
@@ -5075,7 +5075,7 @@ sppp_set_ip6_addr(struct sppp *sp, const
}
}
}
-   IF_ADDR_UNLOCK(ifp);
+   if_addr_runlock(ifp);
 
if (ifa != NULL) {
int 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: r195071 - head/sys/dev/cxgb

2009-06-26 Thread Robert Watson
Author: rwatson
Date: Fri Jun 26 19:04:08 2009
New Revision: 195071
URL: http://svn.freebsd.org/changeset/base/195071

Log:
  Use if_maddr_rlock() instead of IF_ADDR_LOCK() to protect access to
  if_multiaddrs in if_cxgb.
  
  Approved by:  re (kib)
  MFC after:6 weeks

Modified:
  head/sys/dev/cxgb/cxgb_adapter.h

Modified: head/sys/dev/cxgb/cxgb_adapter.h
==
--- head/sys/dev/cxgb/cxgb_adapter.hFri Jun 26 18:50:49 2009
(r195070)
+++ head/sys/dev/cxgb/cxgb_adapter.hFri Jun 26 19:04:08 2009
(r195071)
@@ -467,7 +467,7 @@ t3_get_next_mcaddr(struct t3_rx_mode *rm
struct ifmultiaddr *ifma;
int i = 0;
 
-   IF_ADDR_LOCK(ifp);
+   if_maddr_rlock(ifp);
TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
if (ifma->ifma_addr->sa_family != AF_LINK)
continue;
@@ -477,8 +477,7 @@ t3_get_next_mcaddr(struct t3_rx_mode *rm
}
i++;
}
-   IF_ADDR_UNLOCK(ifp);
-
+   if_maddr_runlock(ifp);

rm->idx++;
return (macaddr);
___
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: r195074 - head/sys/i386/linux

2009-06-26 Thread John Baldwin
Author: jhb
Date: Fri Jun 26 19:39:33 2009
New Revision: 195074
URL: http://svn.freebsd.org/changeset/base/195074

Log:
  Return ENOSYS instead of EINVAL for invalid function codes to match the
  behavior of Linux.
  
  Reported by:  Alexander Best  alexbestms of math.uni-muenster.de
  Approved by:  re (kib)

Modified:
  head/sys/i386/linux/linux_machdep.c

Modified: head/sys/i386/linux/linux_machdep.c
==
--- head/sys/i386/linux/linux_machdep.c Fri Jun 26 19:14:53 2009
(r195073)
+++ head/sys/i386/linux/linux_machdep.c Fri Jun 26 19:39:33 2009
(r195074)
@@ -866,9 +866,6 @@ linux_modify_ldt(struct thread *td, stru
union descriptor desc;
int size, written;
 
-   if (uap->ptr == NULL)
-   return (EINVAL);
-
switch (uap->func) {
case 0x00: /* read_ldt */
ldt.start = 0;
@@ -911,7 +908,7 @@ linux_modify_ldt(struct thread *td, stru
error = i386_set_ldt(td, &ldt, &desc);
break;
default:
-   error = EINVAL;
+   error = ENOSYS;
break;
}
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r195075 - head/sbin/ipfw

2009-06-26 Thread Oleg Bulyzhin
Author: oleg
Date: Fri Jun 26 19:49:06 2009
New Revision: 195075
URL: http://svn.freebsd.org/changeset/base/195075

Log:
  - 'burst' description rewritten.
  
  Submitted by: Ben Kaduk
  Approved by:  re (kib)

Modified:
  head/sbin/ipfw/ipfw.8

Modified: head/sbin/ipfw/ipfw.8
==
--- head/sbin/ipfw/ipfw.8   Fri Jun 26 19:39:33 2009(r195074)
+++ head/sbin/ipfw/ipfw.8   Fri Jun 26 19:49:06 2009(r195075)
@@ -1944,13 +1944,18 @@ the granularity to 1ms or less).
 The default value is 0, meaning no delay.
 .Pp
 .It Cm burst Ar size
-If the data rate exceeds the pipe bandwith limit
-(and pipe was idle long enough),
+If the data to be sent exceeds the pipe's bandwidth limit
+(and the pipe was previously idle), up to
 .Ar size
-bytes of data is allowed to bypass the
+bytes of data are allowed to bypass the
 .Nm dummynet
-scheduler (i.e. it will be sent without shaping), then transmission rate
-will not exceed pipe bandwidth. Effective burst size calculated as follows:
+scheduler, and will be sent as fast as the physical link allows.
+Any additional data will be transmitted at the rate specified
+by the
+.Nm pipe
+bandwidth.
+The burst size depends on how long the pipe has been idle;
+the effective burst size is calculated as follows:
 MAX(
 .Ar size
 ,
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r195078 - head/sys/net

2009-06-26 Thread Robert Watson
Author: rwatson
Date: Fri Jun 26 20:39:36 2009
New Revision: 195078
URL: http://svn.freebsd.org/changeset/base/195078

Log:
  In light of DPCPU use by netisr, revise various for loops from using
  MAXCPU to mp_maxid, and handling and reporting of requests to use more
  threads than we have CPUs to run them on.
  
  Reviewed by:  bz
  Approved by:  re (kib)
  MFC after:6 weeks

Modified:
  head/sys/net/netisr.c

Modified: head/sys/net/netisr.c
==
--- head/sys/net/netisr.c   Fri Jun 26 19:56:35 2009(r195077)
+++ head/sys/net/netisr.c   Fri Jun 26 20:39:36 2009(r195078)
@@ -154,7 +154,7 @@ SYSCTL_INT(_net_isr, OID_AUTO, direct, C
  * CPU 0, so in practice we ignore values <= 1.  This must be set at boot.
  * We will create at most one thread per CPU.
  */
-static int netisr_maxthreads = 1;  /* Max number of threads. */
+static int netisr_maxthreads = -1; /* Max number of threads. */
 TUNABLE_INT("net.isr.maxthreads", &netisr_maxthreads);
 SYSCTL_INT(_net_isr, OID_AUTO, maxthreads, CTLFLAG_RD,
 &netisr_maxthreads, 0,
@@ -393,7 +393,7 @@ netisr_register(const struct netisr_hand
} else
np[proto].np_qlimit = nhp->nh_qlimit;
np[proto].np_policy = nhp->nh_policy;
-   for (i = 0; i < MAXCPU; i++) {
+   for (i = 0; i <= mp_maxid; i++) {
if (CPU_ABSENT(i))
continue;
npwp = &(DPCPU_ID_PTR(i, nws))->nws_work[proto];
@@ -427,7 +427,7 @@ netisr_clearqdrops(const struct netisr_h
("%s(%u): protocol not registered for %s", __func__, proto,
name));
 
-   for (i = 0; i < MAXCPU; i++) {
+   for (i = 0; i <= mp_maxid; i++) {
if (CPU_ABSENT(i))
continue;
npwp = &(DPCPU_ID_PTR(i, nws))->nws_work[proto];
@@ -462,7 +462,7 @@ netisr_getqdrops(const struct netisr_han
("%s(%u): protocol not registered for %s", __func__, proto,
name));
 
-   for (i = 0; i < MAXCPU; i++) {
+   for (i = 0; i <= mp_maxid; i++) {
if (CPU_ABSENT(i))
continue;
npwp = &(DPCPU_ID_PTR(i, nws))->nws_work[proto];
@@ -528,7 +528,7 @@ netisr_setqlimit(const struct netisr_han
name));
 
np[proto].np_qlimit = qlimit;
-   for (i = 0; i < MAXCPU; i++) {
+   for (i = 0; i <= mp_maxid; i++) {
if (CPU_ABSENT(i))
continue;
npwp = &(DPCPU_ID_PTR(i, nws))->nws_work[proto];
@@ -594,7 +594,7 @@ netisr_unregister(const struct netisr_ha
np[proto].np_m2cpuid = NULL;
np[proto].np_qlimit = 0;
np[proto].np_policy = 0;
-   for (i = 0; i < MAXCPU; i++) {
+   for (i = 0; i <= mp_maxid; i++) {
if (CPU_ABSENT(i))
continue;
npwp = &(DPCPU_ID_PTR(i, nws))->nws_work[proto];
@@ -818,8 +818,8 @@ netisr_queue_internal(u_int proto, struc
 #ifdef NETISR_LOCKING
NETISR_LOCK_ASSERT();
 #endif
-   KASSERT(cpuid < MAXCPU, ("%s: cpuid too big (%u, %u)", __func__,
-   cpuid, MAXCPU));
+   KASSERT(cpuid <= mp_maxid, ("%s: cpuid too big (%u, %u)", __func__,
+   cpuid, mp_maxid));
KASSERT(!CPU_ABSENT(cpuid), ("%s: CPU %u absent", __func__, cpuid));
 
dosignal = 0;
@@ -1064,17 +1064,16 @@ netisr_init(void *arg)
KASSERT(curcpu == 0, ("%s: not on CPU 0", __func__));
 
NETISR_LOCK_INIT();
-   if (netisr_maxthreads < 1) {
-   printf("netisr2: forcing maxthreads to 1\n");
+   if (netisr_maxthreads < 1)
netisr_maxthreads = 1;
-   }
-   if (netisr_maxthreads > MAXCPU) {
-   printf("netisr2: forcing maxthreads to %d\n", MAXCPU);
-   netisr_maxthreads = MAXCPU;
+   if (netisr_maxthreads > mp_ncpus) {
+   printf("netisr2: forcing maxthreads from %d to %d\n",
+   netisr_maxthreads, mp_ncpus);
+   netisr_maxthreads = mp_ncpus;
}
if (netisr_defaultqlimit > netisr_maxqlimit) {
-   printf("netisr2: forcing defaultqlimit to %d\n",
-   netisr_maxqlimit);
+   printf("netisr2: forcing defaultqlimit from %d to %d\n",
+   netisr_defaultqlimit, netisr_maxqlimit);
netisr_defaultqlimit = netisr_maxqlimit;
}
 #ifdef DEVICE_POLLING
@@ -1128,7 +1127,7 @@ DB_SHOW_COMMAND(netisr, db_show_netisr)
 
db_printf("%3s %6s %5s %5s %5s %8s %8s %8s %8s\n", "CPU", "Proto",
"Len", "WMark", "Max", "Disp", "HDisp", "Drop", "Queue");
-   for (cpuid = 0; cpuid < MAXCPU; cpuid++) {
+   for (cpuid = 0; cpuid <= mp_maxid; cpuid++) {
if (CPU_ABSENT(cpuid))
continue;
nwsp = DPCPU_ID_PTR(cpuid, nws);
__

svn commit: r195080 - in head/sys/dev/usb: . storage

2009-06-26 Thread Xin LI
Author: delphij
Date: Fri Jun 26 21:47:37 2009
New Revision: 195080
URL: http://svn.freebsd.org/changeset/base/195080

Log:
  Add quirks for Actions MP4 player.
  
  Submitted by: John Hixson 
  Approved by:  re (kib)
  MFC after:2 weeks

Modified:
  head/sys/dev/usb/storage/umass.c
  head/sys/dev/usb/usbdevs

Modified: head/sys/dev/usb/storage/umass.c
==
--- head/sys/dev/usb/storage/umass.cFri Jun 26 21:31:07 2009
(r195079)
+++ head/sys/dev/usb/storage/umass.cFri Jun 26 21:47:37 2009
(r195080)
@@ -961,6 +961,10 @@ static const struct umass_devdescr umass
UMASS_PROTO_SCSI | UMASS_PROTO_BBB,
NO_INQUIRY | NO_SYNCHRONIZE_CACHE
},
+   {USB_VENDOR_ACTIONS, USB_PRODUCT_ACTIONS_MP4, RID_WILDCARD,
+   UMASS_PROTO_SCSI | UMASS_PROTO_BBB,
+   NO_SYNCHRONIZE_CACHE
+   },
{VID_EOT, PID_EOT, RID_EOT, 0, 0}
 };
 

Modified: head/sys/dev/usb/usbdevs
==
--- head/sys/dev/usb/usbdevsFri Jun 26 21:31:07 2009(r195079)
+++ head/sys/dev/usb/usbdevsFri Jun 26 21:47:37 2009(r195080)
@@ -552,6 +552,7 @@ vendor USI  0x10ab  USI
 vendor PLX 0x10b5  PLX
 vendor ASANTE  0x10bd  Asante
 vendor SILABS  0x10c4  Silicon Labs
+vendor ACTIONS 0x10d6  Actions
 vendor ANALOG  0x1110  Analog Devices
 vendor TENX0x1130  Ten X Technology, Inc.
 vendor ISSC0x1131  Integrated System Solution Corp.
@@ -741,6 +742,9 @@ product ACERP AWL4000x9001  AWL400 Wire
 /* Acer Warp products */
 product ACERW WARPLINK 0x0204  Warplink
 
+/* Actions products */
+product ACTIONS MP40x1101  Actions MP4 Player
+
 /* Actiontec, Inc. products */
 product ACTIONTEC PRISM_25 0x0408  Prism2.5 Wireless Adapter
 product ACTIONTEC PRISM_25A0x0421  Prism2.5 Wireless Adapter A
___
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: r195081 - head/sys/dev/cpuctl

2009-06-26 Thread Stanislav Sedov
Author: stas
Date: Fri Jun 26 22:13:15 2009
New Revision: 195081
URL: http://svn.freebsd.org/changeset/base/195081

Log:
  - Don't zero data field in case of MSR write operation.  Before this change
the value written to MSR register was always 0 regardless of value passed
by user.
  - Use proper data pointer when performing AMD microcode update.  Previously,
the pointer to user-space data has been provided instead, which is totally
incorrect.
  
  Approved by:  re (kib)
  MFC after:1 week

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

Modified: head/sys/dev/cpuctl/cpuctl.c
==
--- head/sys/dev/cpuctl/cpuctl.cFri Jun 26 21:47:37 2009
(r195080)
+++ head/sys/dev/cpuctl/cpuctl.cFri Jun 26 22:13:15 2009
(r195081)
@@ -222,14 +222,17 @@ cpuctl_do_msr(int cpu, cpuctl_msr_args_t
 * Explicitly clear cpuid data to avoid returning stale
 * info
 */
-   data->data = 0;
DPRINTF("[cpuctl,%d]: operating on MSR %#0x for %d cpu\n", __LINE__,
data->msr, cpu);
oldcpu = td->td_oncpu;
is_bound = cpu_sched_is_bound(td);
set_cpu(cpu, td);
-   ret = cmd == CPUCTL_RDMSR ? rdmsr_safe(data->msr, &data->data) :
-   wrmsr_safe(data->msr, data->data);
+   if (cmd == CPUCTL_RDMSR) {
+   data->data = 0;
+   ret = rdmsr_safe(data->msr, &data->data);
+   } else {
+   ret = wrmsr_safe(data->msr, data->data);
+   }
restore_cpu(oldcpu, is_bound, td);
return (ret);
 }
@@ -368,7 +371,7 @@ update_amd(int cpu, cpuctl_update_args_t
/*
 * Perform update.
 */
-   wrmsr_safe(MSR_K8_UCODE_UPDATE, (uintptr_t)args->data);
+   wrmsr_safe(MSR_K8_UCODE_UPDATE, (uintptr_t)ptr);
 
/*
 * Serialize instruction flow.
___
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: r195089 - head/sys/pc98/include

2009-06-26 Thread Takahashi Yoshihiro
Author: nyan
Date: Sat Jun 27 02:20:31 2009
New Revision: 195089
URL: http://svn.freebsd.org/changeset/base/195089

Log:
  Add stub vm.h for pc98.
  
  Approved by:  re (kensmith)

Added:
  head/sys/pc98/include/vm.h   (contents, props changed)

Added: head/sys/pc98/include/vm.h
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/pc98/include/vm.h  Sat Jun 27 02:20:31 2009(r195089)
@@ -0,0 +1,6 @@
+/*-
+ * This file is in the public domain.
+ */
+/* $FreeBSD$ */
+
+#include 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"