svn commit: r210147 - stable/8/usr.sbin/config

2010-07-15 Thread Warner Losh
Author: imp
Date: Thu Jul 15 22:52:36 2010
New Revision: 210147
URL: http://svn.freebsd.org/changeset/base/210147

Log:
  MFC r201227: record the fact

Modified:
Directory Properties:
  stable/8/usr.sbin/config/   (props changed)
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r210148 - stable/7/usr.sbin/config

2010-07-15 Thread Warner Losh
Author: imp
Date: Thu Jul 15 23:07:02 2010
New Revision: 210148
URL: http://svn.freebsd.org/changeset/base/210148

Log:
  MFC: r188277, r188280, r201227, r205880, r206664, r206915, r207260, r207263,
  r207265, r209135, r209969
  
  (I'm not repeating all that here, see the logs for all the details):
  
  Config version is now 600010
  option alias support
  makefile parsing fixes
  calloc failure coping
  WARNS=6
  comment placement correction
  alpha vestige removal
  
  This should allow building of -current kernels and modules on 7-stable
  machines (although not officially supported, enough people do it to
  make some efforts to make it work a big win).
  
  imp, ed, wkoszek, ru, gcooper, and nwhitehorn authored the original revs

Modified:
  stable/7/usr.sbin/config/config.8
  stable/7/usr.sbin/config/config.h
  stable/7/usr.sbin/config/config.y
  stable/7/usr.sbin/config/configvers.h
  stable/7/usr.sbin/config/lang.l
  stable/7/usr.sbin/config/main.c
  stable/7/usr.sbin/config/mkmakefile.c
  stable/7/usr.sbin/config/mkoptions.c
Directory Properties:
  stable/7/usr.sbin/config/   (props changed)

Modified: stable/7/usr.sbin/config/config.8
==
--- stable/7/usr.sbin/config/config.8   Thu Jul 15 22:52:36 2010
(r210147)
+++ stable/7/usr.sbin/config/config.8   Thu Jul 15 23:07:02 2010
(r210148)
@@ -92,6 +92,9 @@ Note that
 does not append
 .Ar SYSTEM_NAME
 to the directory given.
+.It Fl m
+Print the MACHINE and MACHINE_ARCH values for this
+kernel and exit.
 .It Fl g
 Configure a system for debugging.
 .It Fl x Ar kernel

Modified: stable/7/usr.sbin/config/config.h
==
--- stable/7/usr.sbin/config/config.h   Thu Jul 15 22:52:36 2010
(r210147)
+++ stable/7/usr.sbin/config/config.h   Thu Jul 15 23:07:02 2010
(r210148)
@@ -129,6 +129,8 @@ SLIST_HEAD(opt_head, opt) opt, mkopt, rm
 struct opt_list {
char *o_name;
char *o_file;
+   int o_flags;
+#define OL_ALIAS   1
SLIST_ENTRY(opt_list) o_next;
 };
 
@@ -177,6 +179,7 @@ voidmakehints(void);
 void   headers(void);
 void   cfgfile_add(const char *);
 void   cfgfile_removeall(void);
+FILE   *open_makefile_template(void);
 
 extern STAILQ_HEAD(device_head, device) dtab;
 

Modified: stable/7/usr.sbin/config/config.y
==
--- stable/7/usr.sbin/config/config.y   Thu Jul 15 22:52:36 2010
(r210147)
+++ stable/7/usr.sbin/config/config.y   Thu Jul 15 23:07:02 2010
(r210148)
@@ -166,6 +166,8 @@ Config_spec:
  = {
struct cputype *cp =
(struct cputype *)calloc(1, sizeof (struct cputype));
+   if (cp == NULL)
+   err(EXIT_FAILURE, "calloc");
cp->cpu_name = $2;
SLIST_INSERT_HEAD(&cputype, cp, cpu_next);
  } |
@@ -205,6 +207,8 @@ Config_spec:
struct hint *hint;
 
hint = (struct hint *)calloc(1, sizeof (struct hint));
+   if (hint == NULL)
+   err(EXIT_FAILURE, "calloc");
hint->hint_name = $2;
STAILQ_INSERT_TAIL(&hints, hint, hint_next);
hintmode = 1;
@@ -350,6 +354,8 @@ newfile(char *name)
struct files_name *nl;

nl = (struct files_name *) calloc(1, sizeof *nl);
+   if (nl == NULL)
+   err(EXIT_FAILURE, "calloc");
nl->f_name = name;
STAILQ_INSERT_TAIL(&fntab, nl, f_next);
 }
@@ -383,6 +389,8 @@ newdev(char *name)
}
 
np = (struct device *) calloc(1, sizeof *np);
+   if (np == NULL)
+   err(EXIT_FAILURE, "calloc");
np->d_name = name;
STAILQ_INSERT_TAIL(&dtab, np, d_next);
 }
@@ -441,6 +449,8 @@ newopt(struct opt_head *list, char *name
}
 
op = (struct opt *)calloc(1, sizeof (struct opt));
+   if (op == NULL)
+   err(EXIT_FAILURE, "calloc");
op->op_name = name;
op->op_ownfile = 0;
op->op_value = value;

Modified: stable/7/usr.sbin/config/configvers.h
==
--- stable/7/usr.sbin/config/configvers.h   Thu Jul 15 22:52:36 2010
(r210147)
+++ stable/7/usr.sbin/config/configvers.h   Thu Jul 15 23:07:02 2010
(r210148)
@@ -49,5 +49,5 @@
  *
  * $FreeBSD$
  */
-#defineCONFIGVERS  67
+#defineCONFIGVERS  600010
 #defineMAJOR_VERS(x)   ((x) / 10)

Modified: stable/7/usr.sbin/config/lang.l
==
--- stable/7/usr.sbin/config/lang.l Thu Jul 15 22:52:36 2010
(r210147)
+++ stable/7/usr.sbin/config/lang.l Thu Jul 15 23:07:02 2010
(r210148)
@@ -33,6 +33,7 @@
 
 #inclu

svn commit: r210149 - head/sys/isa

2010-07-15 Thread Jung-uk Kim
Author: jkim
Date: Thu Jul 15 23:11:51 2010
New Revision: 210149
URL: http://svn.freebsd.org/changeset/base/210149

Log:
  When we are not switching VTs, just mark all buffer to be updated.

Modified:
  head/sys/isa/syscons_isa.c

Modified: head/sys/isa/syscons_isa.c
==
--- head/sys/isa/syscons_isa.c  Thu Jul 15 23:07:02 2010(r210148)
+++ head/sys/isa/syscons_isa.c  Thu Jul 15 23:11:51 2010(r210149)
@@ -141,10 +141,16 @@ scresume(device_t dev)
 
sc = &main_softc;
 
+   if (sc->cur_scp == NULL)
+   return (0);
+
sc->suspend_in_progress--;
-   if (sc->suspend_in_progress == 0)
+   if (sc->suspend_in_progress == 0) {
if (!sc_no_suspend_vtswitch && sc_cur_scr != 0)
sc_switch_scr(sc, sc_cur_scr);
+   else
+   mark_all(sc->cur_scp);
+   }
 
return (0);
 }
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


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

2010-07-15 Thread Jung-uk Kim
Author: jkim
Date: Thu Jul 15 23:24:06 2010
New Revision: 210150
URL: http://svn.freebsd.org/changeset/base/210150

Log:
  If there is any pending sleep request, disallow entering S5 state.
  Otherwise, bad things may happen. ;-)

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

Modified: head/sys/dev/acpica/acpi.c
==
--- head/sys/dev/acpica/acpi.c  Thu Jul 15 23:11:51 2010(r210149)
+++ head/sys/dev/acpica/acpi.c  Thu Jul 15 23:24:06 2010(r210150)
@@ -2317,27 +2317,28 @@ acpi_ReqSleepState(struct acpi_softc *sc
 {
 #if defined(__amd64__) || defined(__i386__)
 struct apm_clone_data *clone;
+ACPI_STATUS status;
 
 if (state < ACPI_STATE_S1 || state > ACPI_S_STATES_MAX)
return (EINVAL);
 if (!acpi_sleep_states[state])
return (EOPNOTSUPP);
 
-/* S5 (soft-off) should be entered directly with no waiting. */
-if (state == ACPI_STATE_S5) {
-   if (ACPI_SUCCESS(acpi_EnterSleepState(sc, state)))
-   return (0);
-   else
-   return (ENXIO);
-}
+ACPI_LOCK(acpi);
 
 /* If a suspend request is already in progress, just return. */
-ACPI_LOCK(acpi);
 if (sc->acpi_next_sstate != 0) {
ACPI_UNLOCK(acpi);
return (0);
 }
 
+/* S5 (soft-off) should be entered directly with no waiting. */
+if (state == ACPI_STATE_S5) {
+   ACPI_UNLOCK(acpi);
+   status = acpi_EnterSleepState(sc, state);
+   return (ACPI_SUCCESS(status) ? 0 : ENXIO);
+}
+
 /* Record the pending state and notify all apm devices. */
 sc->acpi_next_sstate = state;
 STAILQ_FOREACH(clone, &sc->apm_cdevs, entries) {
@@ -2351,11 +2352,8 @@ acpi_ReqSleepState(struct acpi_softc *sc
 /* If devd(8) is not running, immediately enter the sleep state. */
 if (!devctl_process_running()) {
ACPI_UNLOCK(acpi);
-   if (ACPI_SUCCESS(acpi_EnterSleepState(sc, sc->acpi_next_sstate))) {
-   return (0);
-   } else {
-   return (ENXIO);
-   }
+   status = acpi_EnterSleepState(sc, state);
+   return (ACPI_SUCCESS(status) ? 0 : ENXIO);
 }
 
 /*
@@ -2592,7 +2590,6 @@ acpi_EnterSleepState(struct acpi_softc *
  * process.  This handles both the error and success cases.
  */
 backout:
-sc->acpi_next_sstate = 0;
 if (slp_state >= ACPI_SS_GPE_SET) {
acpi_wake_prep_walk(state);
sc->acpi_sstate = ACPI_STATE_S0;
@@ -2603,6 +2600,7 @@ backout:
DEVICE_RESUME(root_bus);
 if (slp_state >= ACPI_SS_SLEPT)
acpi_enable_fixed_events(sc);
+sc->acpi_next_sstate = 0;
 
 mtx_unlock(&Giant);
 
___
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: r210151 - head/sys/conf

2010-07-15 Thread Warner Losh
Author: imp
Date: Thu Jul 15 23:32:53 2010
New Revision: 210151
URL: http://svn.freebsd.org/changeset/base/210151

Log:
  Simple compatibility hacks for building on older systems where
  MACHINE_CPUARCH isn't defined.  I believe that this will cover all
  options.
  
  I didn't define it in kern.mk because $M is set to MACHINE_CPUARCH and
  then is expanded for the genassym.o rule in kern.post.mk and kern.mk
  is included after this, so the expansion isn't quite right.  I think
  this is a bug in make, but don't have the time to track it to ground
  (and even if I did, fixing it would require a MFC of the change to the
  very old systems we're targetting with this fix).

Modified:
  head/sys/conf/kern.pre.mk
  head/sys/conf/kmod.mk

Modified: head/sys/conf/kern.pre.mk
==
--- head/sys/conf/kern.pre.mk   Thu Jul 15 23:24:06 2010(r210150)
+++ head/sys/conf/kern.pre.mk   Thu Jul 15 23:32:53 2010(r210151)
@@ -5,6 +5,9 @@
 
 .include 
 
+# backwards compat option for older systems.
+MACHINE_CPUARCH?=${MACHINE_ARCH:C/mipse[lb]/mips/:C/armeb/arm/:C/powerpc64/powerpc/}
+
 # Can be overridden by makeoptions or /etc/make.conf
 KERNEL_KO?=kernel
 KERNEL?=   kernel
@@ -151,6 +154,7 @@ SYSTEM_DEP+= ${LDSCRIPT}
 # them.
 
 MKMODULESENV=  MAKEOBJDIRPREFIX=${.OBJDIR}/modules KMODDIR=${KODIR}
+MKMODULESENV+= MACHINE_CPUARCH=${MACHINE_CPUARCH}
 .if (${KERN_IDENT} == LINT)
 MKMODULESENV+= ALL_MODULES=LINT
 .endif

Modified: head/sys/conf/kmod.mk
==
--- head/sys/conf/kmod.mk   Thu Jul 15 23:24:06 2010(r210150)
+++ head/sys/conf/kmod.mk   Thu Jul 15 23:32:53 2010(r210151)
@@ -60,6 +60,9 @@
 #  Unload a module.
 #
 
+# backwards compat option for older systems.
+MACHINE_CPUARCH?=${MACHINE_ARCH:C/mipse[lb]/mips/:C/armeb/arm/:C/powerpc64/powerpc/}
+
 AWK?=  awk
 KMODLOAD?= /sbin/kldload
 KMODUNLOAD?=   /sbin/kldunload
___
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: r210152 - head/sys/dev/bge

2010-07-15 Thread Pyun YongHyeon
Author: yongari
Date: Thu Jul 15 23:34:58 2010
New Revision: 210152
URL: http://svn.freebsd.org/changeset/base/210152

Log:
  Use Miscellaneous Configuration Register bit definition instead of
  magic number.

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

Modified: head/sys/dev/bge/if_bge.c
==
--- head/sys/dev/bge/if_bge.c   Thu Jul 15 23:32:53 2010(r210151)
+++ head/sys/dev/bge/if_bge.c   Thu Jul 15 23:34:58 2010(r210152)
@@ -3117,7 +3117,7 @@ bge_reset(struct bge_softc *sc)
 * powered up in D0 uninitialized.
 */
if (BGE_IS_5705_PLUS(sc))
-   reset |= 0x0400;
+   reset |= BGE_MISCCFG_GPHY_PD_OVERRIDE;
 
/* Issue global reset */
write_op(sc, BGE_MISC_CFG, reset);

Modified: head/sys/dev/bge/if_bgereg.h
==
--- head/sys/dev/bge/if_bgereg.hThu Jul 15 23:32:53 2010
(r210151)
+++ head/sys/dev/bge/if_bgereg.hThu Jul 15 23:34:58 2010
(r210152)
@@ -1823,6 +1823,7 @@
 #defineBGE_MISCCFG_BOARD_ID_5788   0x0001
 #defineBGE_MISCCFG_BOARD_ID_5788M  0x00018000
 #defineBGE_MISCCFG_EPHY_IDDQ   0x0020
+#defineBGE_MISCCFG_GPHY_PD_OVERRIDE0x0400
 
 #defineBGE_32BITTIME_66MHZ (0x41 << 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: r210154 - head/sys/fs/nfsserver

2010-07-15 Thread Rick Macklem
Author: rmacklem
Date: Fri Jul 16 01:44:49 2010
New Revision: 210154
URL: http://svn.freebsd.org/changeset/base/210154

Log:
  Delete comments related to soft clock interrupts that don't apply
  to the FreeBSD port of the experimental NFSv4 server.
  
  Submitted by: zack.kirsch at isilon.com
  MFC after:2 weeks

Modified:
  head/sys/fs/nfsserver/nfs_nfsdstate.c

Modified: head/sys/fs/nfsserver/nfs_nfsdstate.c
==
--- head/sys/fs/nfsserver/nfs_nfsdstate.c   Fri Jul 16 00:56:17 2010
(r210153)
+++ head/sys/fs/nfsserver/nfs_nfsdstate.c   Fri Jul 16 01:44:49 2010
(r210154)
@@ -1015,7 +1015,6 @@ nfsrv_freedeleg(struct nfsstate *stp)
 
 /*
  * This function frees an open owner and all associated opens.
- * Must be called with soft clock interrupts disabled.
  */
 static void
 nfsrv_freeopenowner(struct nfsstate *stp, int cansleep, NFSPROC_T *p)
@@ -1161,7 +1160,6 @@ nfsrv_freeallnfslocks(struct nfsstate *s
 
 /*
  * Free an nfslock structure.
- * Must be called with soft clock interrupts disabled.
  */
 static void
 nfsrv_freenfslock(struct nfslock *lop)
@@ -1178,7 +1176,6 @@ nfsrv_freenfslock(struct nfslock *lop)
 
 /*
  * This function frees an nfslockfile structure.
- * Must be called with soft clock interrupts disabled.
  */
 static void
 nfsrv_freenfslockfile(struct nfslockfile *lfp)
@@ -1358,11 +1355,6 @@ tryagain:
}
}
 
-   /*
-* Since the code is manipulating lists that are also
-* manipulated by nfsrv_servertimer(), soft clock interrupts
-* must be masked off.
-*/
if (specialid == 0) {
if (new_stp->ls_flags & NFSLCK_TEST) {
/*
@@ -1971,9 +1963,6 @@ tryagain:
NFSLOCKSTATE();
/*
 * Get the nfsclient structure.
-* Since the code is manipulating lists that are also
-* manipulated by nfsrv_servertimer(), soft clock interrupts
-* must be masked off.
 */
error = nfsrv_getclient(clientid, CLOPS_RENEW, &clp,
(nfsquad_t)((u_quad_t)0), NULL, p);
@@ -3176,7 +3165,6 @@ nfsrv_getlockfile(u_short flags, struct 
  * This function adds a nfslock lock structure to the list for the associated
  * nfsstate and nfslockfile structures. It will be inserted after the
  * entry pointed at by insert_lop.
- * Must be called with soft clock interrupts disabled.
  */
 static void
 nfsrv_insertlock(struct nfslock *new_lop, struct nfslock *insert_lop,
@@ -3228,7 +3216,6 @@ nfsrv_insertlock(struct nfslock *new_lop
  * are NFSLCK_READ or NFSLCK_WRITE and non-overlapping (aka POSIX style).
  * It always adds new_lop to the list and sometimes uses the one pointed
  * at by other_lopp.
- * Must be called with soft clock interrupts disabled.
  */
 static void
 nfsrv_updatelock(struct nfsstate *stp, struct nfslock **new_lopp,
___
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: r210155 - head/sys/dev/acpica/Osd

2010-07-15 Thread Jung-uk Kim
Author: jkim
Date: Fri Jul 16 03:59:50 2010
New Revision: 210155
URL: http://svn.freebsd.org/changeset/base/210155

Log:
  Use pmap_mapdev()/pmap_unmapdev() to map device memory instead of using
  AcpiOsMapMemory()/AcpiOsUnmapMemory() (-> pmap_mapbios()/pmap_unmapbios())
  for AcpiOsReadMemory() and AcpiOsWriteMemory().  Although they do not sound
  too obvious, these functions are exclusively used to access memory mapped
  IO in ACPICA.

Modified:
  head/sys/dev/acpica/Osd/OsdMemory.c

Modified: head/sys/dev/acpica/Osd/OsdMemory.c
==
--- head/sys/dev/acpica/Osd/OsdMemory.c Fri Jul 16 01:44:49 2010
(r210154)
+++ head/sys/dev/acpica/Osd/OsdMemory.c Fri Jul 16 03:59:50 2010
(r210155)
@@ -97,7 +97,7 @@ AcpiOsReadMemory(ACPI_PHYSICAL_ADDRESS A
 {
 void   *LogicalAddress;
 
-LogicalAddress = AcpiOsMapMemory(Address, Width / 8);
+LogicalAddress = pmap_mapdev(Address, Width / 8);
 if (LogicalAddress == NULL)
return (AE_NOT_EXIST);
 
@@ -113,7 +113,7 @@ AcpiOsReadMemory(ACPI_PHYSICAL_ADDRESS A
break;
 }
 
-AcpiOsUnmapMemory(LogicalAddress, Width / 8);
+pmap_unmapdev((vm_offset_t)LogicalAddress, Width / 8);
 
 return (AE_OK);
 }
@@ -123,7 +123,7 @@ AcpiOsWriteMemory(ACPI_PHYSICAL_ADDRESS 
 {
 void   *LogicalAddress;
 
-LogicalAddress = AcpiOsMapMemory(Address, Width / 8);
+LogicalAddress = pmap_mapdev(Address, Width / 8);
 if (LogicalAddress == NULL)
return (AE_NOT_EXIST);
 
@@ -139,7 +139,7 @@ AcpiOsWriteMemory(ACPI_PHYSICAL_ADDRESS 
break;
 }
 
-AcpiOsUnmapMemory(LogicalAddress, Width / 8);
+pmap_unmapdev((vm_offset_t)LogicalAddress, Width / 8);
 
 return (AE_OK);
 }
___
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: r210156 - head/sys/dev/flash

2010-07-15 Thread Adrian Chadd
Author: adrian
Date: Fri Jul 16 04:26:37 2010
New Revision: 210156
URL: http://svn.freebsd.org/changeset/base/210156

Log:
  Fix KASSERT() messages to reflect reality.

Modified:
  head/sys/dev/flash/mx25l.c   (contents, props changed)

Modified: head/sys/dev/flash/mx25l.c
==
--- head/sys/dev/flash/mx25l.c  Fri Jul 16 03:59:50 2010(r210155)
+++ head/sys/dev/flash/mx25l.c  Fri Jul 16 04:26:37 2010(r210156)
@@ -303,11 +303,11 @@ mx25l_read(device_t dev, off_t offset, c
 * Sanity checks
 */
KASSERT(count % sc->sc_sectorsize == 0,
-   ("count for BIO_WRITE is not sector size (%d bytes) aligned",
+   ("count for BIO_READ is not sector size (%d bytes) aligned",
sc->sc_sectorsize));
 
KASSERT(offset % sc->sc_sectorsize == 0,
-   ("offset for BIO_WRITE is not sector size (%d bytes) aligned",
+   ("offset for BIO_READ is not sector size (%d bytes) aligned",
sc->sc_sectorsize));
 
txBuf[0] = CMD_FAST_READ;
___
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: r210157 - head/sys/dev/acpica/Osd

2010-07-15 Thread Jung-uk Kim
Author: jkim
Date: Fri Jul 16 04:27:38 2010
New Revision: 210157
URL: http://svn.freebsd.org/changeset/base/210157

Log:
  Simplify AcpiOsReadPort() and AcpiOsWritePort() with iodev_read_*() and
  iodev_write_*().  This removes unnecessary uses of temporary macros as well.
  There is no functional change after this (verified with md5(1) on amd64).

Modified:
  head/sys/dev/acpica/Osd/OsdHardware.c

Modified: head/sys/dev/acpica/Osd/OsdHardware.c
==
--- head/sys/dev/acpica/Osd/OsdHardware.c   Fri Jul 16 04:26:37 2010
(r210156)
+++ head/sys/dev/acpica/Osd/OsdHardware.c   Fri Jul 16 04:27:38 2010
(r210157)
@@ -36,7 +36,7 @@ __FBSDID("$FreeBSD$");
 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
@@ -48,36 +48,21 @@ __FBSDID("$FreeBSD$");
  *
  * In order to deal with this, we ignore resource ownership entirely, and 
simply
  * use the native I/O space accessor functionality.  This is Evil, but it 
works.
- *
- * XXX use an intermediate #define for the tag/handle
  */
 
-#ifdef __i386__
-#defineACPI_BUS_SPACE_IO   I386_BUS_SPACE_IO
-#defineACPI_BUS_HANDLE 0
-#endif
-#ifdef __ia64__
-#defineACPI_BUS_SPACE_IO   IA64_BUS_SPACE_IO
-#defineACPI_BUS_HANDLE 0
-#endif
-#ifdef __amd64__
-#defineACPI_BUS_SPACE_IO   AMD64_BUS_SPACE_IO
-#defineACPI_BUS_HANDLE 0
-#endif
-
 ACPI_STATUS
 AcpiOsReadPort(ACPI_IO_ADDRESS InPort, UINT32 *Value, UINT32 Width)
 {
 
 switch (Width) {
 case 8:
-   *Value = bus_space_read_1(ACPI_BUS_SPACE_IO, ACPI_BUS_HANDLE, InPort);
+   *Value = iodev_read_1(InPort);
break;
 case 16:
-   *Value = bus_space_read_2(ACPI_BUS_SPACE_IO, ACPI_BUS_HANDLE, InPort);
+   *Value = iodev_read_2(InPort);
break;
 case 32:
-   *Value = bus_space_read_4(ACPI_BUS_SPACE_IO, ACPI_BUS_HANDLE, InPort);
+   *Value = iodev_read_4(InPort);
break;
 }
 
@@ -90,13 +75,13 @@ AcpiOsWritePort(ACPI_IO_ADDRESS OutPort,
 
 switch (Width) {
 case 8:
-   bus_space_write_1(ACPI_BUS_SPACE_IO, ACPI_BUS_HANDLE, OutPort, Value);
+   iodev_write_1(OutPort, Value);
break;
 case 16:
-   bus_space_write_2(ACPI_BUS_SPACE_IO, ACPI_BUS_HANDLE, OutPort, Value);
+   iodev_write_2(OutPort, Value);
break;
 case 32:
-   bus_space_write_4(ACPI_BUS_SPACE_IO, ACPI_BUS_HANDLE, OutPort, Value);
+   iodev_write_4(OutPort, Value);
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: r210158 - head/sys/mips/include

2010-07-15 Thread Warner Losh
Author: imp
Date: Fri Jul 16 06:09:51 2010
New Revision: 210158
URL: http://svn.freebsd.org/changeset/base/210158

Log:
  Use #define for get_cyclecount rather than inline function.
  mips_rd_count() isn't defined in userland, and cpu.h is included there
  in alias_scpt.h (maybe they don't need it in the first place).

Modified:
  head/sys/mips/include/cpu.h

Modified: head/sys/mips/include/cpu.h
==
--- head/sys/mips/include/cpu.h Fri Jul 16 04:27:38 2010(r210157)
+++ head/sys/mips/include/cpu.h Fri Jul 16 06:09:51 2010(r210158)
@@ -78,11 +78,7 @@
 /*
  * A machine-independent interface to the CPU's counter.
  */
-static __inline uint64_t
-get_cyclecount(void)
-{
-   return (mips_rd_count());
-}
+#define get_cyclecount()   mips_rd_count()
 #endif /* !_LOCORE */
 
 #if defined(_KERNEL) && !defined(_LOCORE)
___
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: r210159 - head/sys/mips/include

2010-07-15 Thread Warner Losh
Author: imp
Date: Fri Jul 16 06:31:37 2010
New Revision: 210159
URL: http://svn.freebsd.org/changeset/base/210159

Log:
  This file appears not to be used.

Deleted:
  head/sys/mips/include/asmacros.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: r210160 - head/sys/netinet/libalias

2010-07-15 Thread Warner Losh
Author: imp
Date: Fri Jul 16 06:32:38 2010
New Revision: 210160
URL: http://svn.freebsd.org/changeset/base/210160

Log:
  machine/cpu.h isn't appropriate for this file,so remove it

Modified:
  head/sys/netinet/libalias/alias_sctp.h

Modified: head/sys/netinet/libalias/alias_sctp.h
==
--- head/sys/netinet/libalias/alias_sctp.h  Fri Jul 16 06:31:37 2010
(r210159)
+++ head/sys/netinet/libalias/alias_sctp.h  Fri Jul 16 06:32:38 2010
(r210160)
@@ -80,7 +80,6 @@
  * 
  */
 #include 
-#include 
 /* The packed define for 64 bit platforms */
 #ifndef SCTP_PACKED
 #define SCTP_PACKED __attribute__((packed))
___
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: r210161 - in head/sys/mips: include mips

2010-07-15 Thread Warner Losh
Author: imp
Date: Fri Jul 16 06:35:17 2010
New Revision: 210161
URL: http://svn.freebsd.org/changeset/base/210161

Log:
  Move common macros into asm.h.  Replace MIPS_CPU_NOP_DELAY with
  HAZARD_DELAY.  Move HAZARD_DELAY and ITLBNOPFIX into asm.h, for
  possible later optimization...
  
  Reviewed by:  jmallet, jchandra

Modified:
  head/sys/mips/include/asm.h
  head/sys/mips/mips/exception.S
  head/sys/mips/mips/support.S
  head/sys/mips/mips/swtch.S
  head/sys/mips/mips/tlb.S

Modified: head/sys/mips/include/asm.h
==
--- head/sys/mips/include/asm.h Fri Jul 16 06:32:38 2010(r210160)
+++ head/sys/mips/include/asm.h Fri Jul 16 06:35:17 2010(r210161)
@@ -843,4 +843,18 @@ _C_LABEL(x):
 
 #define _JB_SIGMASK13
 
+/*
+ * Various macros for dealing with TLB hazards
+ * (a) why so many?
+ * (b) when to use?
+ * (c) why not used everywhere?
+ */
+/*
+ * Assume that w alaways need nops to escape CP0 hazard
+ * TODO: Make hazard delays configurable. Stuck with 5 cycles on the moment
+ * For more info on CP0 hazards see Chapter 7 (p.99) of "MIPS32 Architecture 
+ *For Programmers Volume III: The MIPS32 Privileged Resource Architecture"
+ */
+#defineITLBNOPFIX  nop;nop;nop;nop;nop;nop;nop;nop;nop;nop;
+#defineHAZARD_DELAYnop;nop;nop;nop;nop;
 #endif /* !_MACHINE_ASM_H_ */

Modified: head/sys/mips/mips/exception.S
==
--- head/sys/mips/mips/exception.S  Fri Jul 16 06:32:38 2010
(r210160)
+++ head/sys/mips/mips/exception.S  Fri Jul 16 06:35:17 2010
(r210161)
@@ -80,15 +80,6 @@
  */
 #defineINTRCNT_COUNT   128
 
-/*
- * Assume that w alaways need nops to escape CP0 hazard
- * TODO: Make hazard delays configurable. Stuck with 5 cycles on the moment
- * For more info on CP0 hazards see Chapter 7 (p.99) of "MIPS32 Architecture 
- *For Programmers Volume III: The MIPS32 Privileged Resource Architecture"
- */
-#defineITLBNOPFIX  nop;nop;nop;nop;nop;nop;nop;nop;nop;nop;
-#defineHAZARD_DELAYnop;nop;nop;nop;nop;
-
 /* Pointer size and mask for n64 */
 #if defined(__mips_n64)
 #definePTRSHIFT3

Modified: head/sys/mips/mips/support.S
==
--- head/sys/mips/mips/support.SFri Jul 16 06:32:38 2010
(r210160)
+++ head/sys/mips/mips/support.SFri Jul 16 06:35:17 2010
(r210161)
@@ -1353,8 +1353,6 @@ esym: .word   0
 #endif /* DDB */
 #endif /* DDB || DEBUG */
 
-#defineITLBNOPFIX  nop;nop;nop;nop;nop;nop;nop;nop;nop;nop;
-
.text
 LEAF(breakpoint)
break   MIPS_BREAK_SOVER_VAL

Modified: head/sys/mips/mips/swtch.S
==
--- head/sys/mips/mips/swtch.S  Fri Jul 16 06:32:38 2010(r210160)
+++ head/sys/mips/mips/swtch.S  Fri Jul 16 06:35:17 2010(r210161)
@@ -67,17 +67,6 @@
 
.setnoreorder   # Noreorder is default style!
 
-/*
- * FREEBSD_DEVELOPERS_FIXME
- * Some MIPS CPU may need delays using nops between executing CP0 Instructions
- */
-
-#if 1
-#defineHAZARD_DELAYnop ; nop ; nop ; nop
-#else
-#defineHAZARD_DELAY
-#endif
-
 #defineSAVE_U_PCB_REG(reg, offs, base) \
REG_S   reg, U_PCB_REGS + (SZREG * offs) (base)
 
@@ -102,8 +91,6 @@
 #defineRESTORE_U_PCB_CONTEXT(reg, offs, base) \
REG_L   reg, U_PCB_CONTEXT + (SZREG * offs) (base)
 
-#defineITLBNOPFIX  nop;nop;nop;nop;nop;nop;nop;nop;nop;nop;
-
 /*
  * Setup for and return to user.
  */

Modified: head/sys/mips/mips/tlb.S
==
--- head/sys/mips/mips/tlb.SFri Jul 16 06:32:38 2010(r210160)
+++ head/sys/mips/mips/tlb.SFri Jul 16 06:35:17 2010(r210161)
@@ -97,14 +97,6 @@
.setmips3
 #endif
 
-#defineITLBNOPFIX  nop;nop;nop;nop;nop;nop;nop;nop;nop;nop;
-
-/*
- * FREEBSD_DEVELOPERS_FIXME
- * Some MIPS CPU may need delays using nops between executing CP0 Instructions
- */
-#defineMIPS_CPU_NOP_DELAY  nop;nop;nop;nop;
-
 /*--
  *
  * Mips_TLBWriteIndexed(unsigned index, tlb *tlb);
@@ -134,9 +126,9 @@ LEAF(Mips_TLBWriteIndexed)
mtc0a0, COP_0_TLB_INDEX # Set the index.
_MTC0   a2, COP_0_TLB_PG_MASK   # Set up entry mask.
_MTC0   a3, COP_0_TLB_HI# Set up entry high.
-   MIPS_CPU_NOP_DELAY
+   HAZARD_DELAY
tlbwi   # Write the TLB
-   MIPS_CPU_NOP_DELAY
+   HAZARD_DELAY
 
_MTC0   t0, COP_0_TLB_HI# Restore the PID.
nop
@@ -252,9 +244,9 @@ LEAF(Mips_

Re: svn commit: r210138 - in head/sys: kern sys

2010-07-15 Thread Bjoern A. Zeeb

On Thu, 15 Jul 2010, John Baldwin wrote:


Author: jhb
Date: Thu Jul 15 20:24:37 2010
New Revision: 210138
URL: http://svn.freebsd.org/changeset/base/210138

Log:
 Retire td_syscalls now that it is no longer needed.

Modified:
 head/sys/kern/kern_thread.c
 head/sys/kern/subr_trap.c
 head/sys/sys/proc.h


Did you want to leave the field as a placehgolder or add a note
somewhere that people should do a full recompile because the layout
changed?



Modified: head/sys/sys/proc.h
==
--- head/sys/sys/proc.h Thu Jul 15 19:52:54 2010(r210137)
+++ head/sys/sys/proc.h Thu Jul 15 20:24:37 2010(r210138)
@@ -296,7 +296,6 @@ struct thread {
struct mdthread td_md;  /* (k) Any machine-dependent fields. */
struct td_sched *td_sched;  /* (*) Scheduler-specific data. */
struct kaudit_record*td_ar; /* (k) Active audit record, if any. */
-   int td_syscalls;/* per-thread syscall count (used by 
NFS :)) */
struct lpohead  td_lprof[2];/* (a) lock profiling objects. */
struct kdtrace_thread   *td_dtrace; /* (*) DTrace-specific data. */
int td_errno;   /* Error returned by last syscall. */



--
Bjoern A. ZeebFrom August on I will have a life.  It's now up to you
to do the maths and count to 64. -- Bondorf, Germany, 14th June 2010
___
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: r210106 - stable/8/bin/pkill

2010-07-15 Thread Brian Somers
Author: brian
Date: Thu Jul 15 07:14:57 2010
New Revision: 210106
URL: http://svn.freebsd.org/changeset/base/210106

Log:
  MFC r209924; Add -l to the synopsis
  
  Submitted by: jhell at dataix dot net

Modified:
  stable/8/bin/pkill/pkill.1
Directory Properties:
  stable/8/bin/pkill/   (props changed)

Modified: stable/8/bin/pkill/pkill.1
==
--- stable/8/bin/pkill/pkill.1  Thu Jul 15 03:56:08 2010(r210105)
+++ stable/8/bin/pkill/pkill.1  Thu Jul 15 07:14:57 2010(r210106)
@@ -60,7 +60,7 @@
 .Ar pattern ...
 .Nm pkill
 .Op Fl Ar signal
-.Op Fl ILafinovx
+.Op Fl ILafilnovx
 .Op Fl F Ar pidfile
 .Op Fl G Ar gid
 .Op Fl M Ar core
___
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: r210107 - head/sys/dev/iwn

2010-07-15 Thread Bernhard Schmidt
Author: bschmidt
Date: Thu Jul 15 07:45:37 2010
New Revision: 210107
URL: http://svn.freebsd.org/changeset/base/210107

Log:
  Remove duplicate vendor:device entry.
  
  MFC after:3 days

Modified:
  head/sys/dev/iwn/if_iwn.c

Modified: head/sys/dev/iwn/if_iwn.c
==
--- head/sys/dev/iwn/if_iwn.c   Thu Jul 15 07:14:57 2010(r210106)
+++ head/sys/dev/iwn/if_iwn.c   Thu Jul 15 07:45:37 2010(r210107)
@@ -310,7 +310,6 @@ static const struct iwn_ident iwn_ident_
{ 0x8086, 0x423D, "Intel(R) PRO/Wireless 5150" },
{ 0x8086, 0x4235, "Intel(R) PRO/Wireless 5300" },
{ 0x8086, 0x4236, "Intel(R) PRO/Wireless 5300" },
-   { 0x8086, 0x4236, "Intel(R) PRO/Wireless 5350" },
{ 0x8086, 0x423A, "Intel(R) PRO/Wireless 5350" },
{ 0x8086, 0x423B, "Intel(R) PRO/Wireless 5350" },
{ 0x8086, 0x0083, "Intel(R) PRO/Wireless 1000" },
___
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: r210108 - head/sys/dev/iwn

2010-07-15 Thread Bernhard Schmidt
Author: bschmidt
Date: Thu Jul 15 08:05:20 2010
New Revision: 210108
URL: http://svn.freebsd.org/changeset/base/210108

Log:
  Fix some small whitespace nits.
  
  MFC after:3 days

Modified:
  head/sys/dev/iwn/if_iwn.c
  head/sys/dev/iwn/if_iwnvar.h

Modified: head/sys/dev/iwn/if_iwn.c
==
--- head/sys/dev/iwn/if_iwn.c   Thu Jul 15 07:45:37 2010(r210107)
+++ head/sys/dev/iwn/if_iwn.c   Thu Jul 15 08:05:20 2010(r210108)
@@ -1665,7 +1665,7 @@ iwn5000_read_eeprom(struct iwn_softc *sc
DPRINTF(sc, IWN_DEBUG_CALIBRATE,
"%s: calib version=%u pa type=%u voltage=%u\n",
__func__, hdr.version, hdr.pa_type, le16toh(hdr.volt));
-   sc->calib_ver = hdr.version;
+   sc->calib_ver = hdr.version;
 
if (sc->hw_type == IWN_HW_REV_TYPE_5150) {
/* Compute temperature offset. */
@@ -5867,9 +5867,9 @@ iwn5000_nic_config(struct iwn_softc *sc)
/* Use internal power amplifier only. */
IWN_WRITE(sc, IWN_GP_DRIVER, IWN_GP_DRIVER_RADIO_2X2_IPA);
}
-if (sc->hw_type == IWN_HW_REV_TYPE_6050 && sc->calib_ver >= 6) {
-/* Indicate that ROM calibration version is >=6. */
-IWN_SETBITS(sc, IWN_GP_DRIVER, IWN_GP_DRIVER_CALIB_VER6);
+   if (sc->hw_type == IWN_HW_REV_TYPE_6050 && sc->calib_ver >= 6) {
+   /* Indicate that ROM calibration version is >=6. */
+   IWN_SETBITS(sc, IWN_GP_DRIVER, IWN_GP_DRIVER_CALIB_VER6);
}
return 0;
 }

Modified: head/sys/dev/iwn/if_iwnvar.h
==
--- head/sys/dev/iwn/if_iwnvar.hThu Jul 15 07:45:37 2010
(r210107)
+++ head/sys/dev/iwn/if_iwnvar.hThu Jul 15 08:05:20 2010
(r210108)
@@ -307,7 +307,7 @@ struct iwn_softc {
 
 #define IWN_LOCK_INIT(_sc) \
mtx_init(&(_sc)->sc_mtx, device_get_nameunit((_sc)->sc_dev), \
-MTX_NETWORK_LOCK, MTX_DEF)
+   MTX_NETWORK_LOCK, MTX_DEF)
 #define IWN_LOCK(_sc)  mtx_lock(&(_sc)->sc_mtx)
 #define IWN_LOCK_ASSERT(_sc)   mtx_assert(&(_sc)->sc_mtx, MA_OWNED)
 #define IWN_UNLOCK(_sc)mtx_unlock(&(_sc)->sc_mtx)
___
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: r210109 - head/sys/dev/iwn

2010-07-15 Thread Bernhard Schmidt
Author: bschmidt
Date: Thu Jul 15 09:30:54 2010
New Revision: 210109
URL: http://svn.freebsd.org/changeset/base/210109

Log:
  - Add new IDs for 6000 series devices.
  - The 6000 series WiMAX devices need a separate firmware.
  - The b-gen devices are not hooked because the hardware revision type
is not know.
  
  Obtained from:OpenBSD
  MFC after:1 week

Modified:
  head/sys/dev/iwn/if_iwn.c
  head/sys/dev/iwn/if_iwnreg.h

Modified: head/sys/dev/iwn/if_iwn.c
==
--- head/sys/dev/iwn/if_iwn.c   Thu Jul 15 08:05:20 2010(r210108)
+++ head/sys/dev/iwn/if_iwn.c   Thu Jul 15 09:30:54 2010(r210109)
@@ -320,8 +320,17 @@ static const struct iwn_ident iwn_ident_
{ 0x8086, 0x4239, "Intel(R) PRO/Wireless 6000" },
{ 0x8086, 0x422B, "Intel(R) PRO/Wireless 6000" },
{ 0x8086, 0x422C, "Intel(R) PRO/Wireless 6000" },
-   { 0x8086, 0x0086, "Intel(R) PRO/Wireless 6050" },
-   { 0x8086, 0x0087, "Intel(R) PRO/Wireless 6050" },
+   { 0x8086, 0x0087, "Intel(R) PRO/Wireless 6250" },
+   { 0x8086, 0x0089, "Intel(R) PRO/Wireless 6250" },
+   { 0x8086, 0x0082, "Intel(R) PRO/Wireless 6205a" },
+   { 0x8086, 0x0085, "Intel(R) PRO/Wireless 6205a" },
+#ifdef notyet
+   { 0x8086, 0x008a, "Intel(R) PRO/Wireless 6205b" },
+   { 0x8086, 0x008b, "Intel(R) PRO/Wireless 6205b" },
+   { 0x8086, 0x008f, "Intel(R) PRO/Wireless 6205b" },
+   { 0x8086, 0x0090, "Intel(R) PRO/Wireless 6205b" },
+   { 0x8086, 0x0091, "Intel(R) PRO/Wireless 6205b" },
+#endif
{ 0, 0, NULL }
 };
 
@@ -734,7 +743,14 @@ iwn_hal_attach(struct iwn_softc *sc)
case IWN_HW_REV_TYPE_6050:
sc->sc_hal = &iwn5000_hal;
sc->limits = &iwn6000_sensitivity_limits;
-   sc->fwname = "iwn6000fw";
+   sc->fwname = "iwn6050fw";
+   sc->txchainmask = IWN_ANT_AB;
+   sc->rxchainmask = IWN_ANT_AB;
+   break;
+   case IWN_HW_REV_TYPE_6005:
+   sc->sc_hal = &iwn5000_hal;
+   sc->limits = &iwn6000_sensitivity_limits;
+   sc->fwname = "iwn6005fw";
sc->txchainmask = IWN_ANT_AB;
sc->rxchainmask = IWN_ANT_AB;
break;
@@ -5751,8 +5767,7 @@ iwn_apm_init(struct iwn_softc *sc)
IWN_CLRBITS(sc, IWN_GIO, IWN_GIO_L0S_ENA);
 
if (sc->hw_type != IWN_HW_REV_TYPE_4965 &&
-   sc->hw_type != IWN_HW_REV_TYPE_6000 &&
-   sc->hw_type != IWN_HW_REV_TYPE_6050)
+   sc->hw_type <= IWN_HW_REV_TYPE_1000)
IWN_SETBITS(sc, IWN_ANA_PLL, IWN_ANA_PLL_INIT);
 
/* Wait for clock stabilization before accessing prph. */

Modified: head/sys/dev/iwn/if_iwnreg.h
==
--- head/sys/dev/iwn/if_iwnreg.hThu Jul 15 08:05:20 2010
(r210108)
+++ head/sys/dev/iwn/if_iwnreg.hThu Jul 15 09:30:54 2010
(r210109)
@@ -1,5 +1,5 @@
 /* $FreeBSD$   */
-/* $OpenBSD: if_iwnreg.h,v 1.37 2010/02/17 18:23:00 damien Exp $   */
+/* $OpenBSD: if_iwnreg.h,v 1.38 2010/04/10 08:37:36 damien Exp $   */
 
 /*-
  * Copyright (c) 2007, 2008
@@ -204,6 +204,7 @@
 #define IWN_HW_REV_TYPE_1000   6
 #define IWN_HW_REV_TYPE_6000   7
 #define IWN_HW_REV_TYPE_6050   8
+#define IWN_HW_REV_TYPE_6005   11
 
 /* Possible flags for register IWN_GIO_CHICKEN. */
 #define IWN_GIO_CHICKEN_L1A_NO_L0S_RX  (1 << 23)
___
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: r210110 - head/sys/dev/iwn

2010-07-15 Thread Bernhard Schmidt
Author: bschmidt
Date: Thu Jul 15 09:34:00 2010
New Revision: 210110
URL: http://svn.freebsd.org/changeset/base/210110

Log:
  Detect active chains differently to work around a firmware bug which
  would mark non-existing chains as active.
  
  Obtained from:OpenBSD
  MFC after:1 week

Modified:
  head/sys/dev/iwn/if_iwn.c

Modified: head/sys/dev/iwn/if_iwn.c
==
--- head/sys/dev/iwn/if_iwn.c   Thu Jul 15 09:30:54 2010(r210109)
+++ head/sys/dev/iwn/if_iwn.c   Thu Jul 15 09:34:00 2010(r210110)
@@ -4134,10 +4134,14 @@ iwn_collect_noise(struct iwn_softc *sc,
val = MAX(calib->rssi[2], val);
 
/* Determine which antennas are connected. */
-   sc->chainmask = 0;
+   sc->chainmask = sc->rxchainmask;
for (i = 0; i < 3; i++)
-   if (val - calib->rssi[i] <= 15 * 20)
-   sc->chainmask |= 1 << i;
+   if (val - calib->rssi[i] > 15 * 20)
+   sc->chainmask &= ~(1 << i);
+   DPRINTF(sc, IWN_DEBUG_CALIBRATE,
+   "%s: RX chains mask: theoretical=0x%x, actual=0x%x\n",
+   __func__, sc->rxchainmask, sc->chainmask);
+
/* If none of the TX antennas are connected, keep at least one. */
if ((sc->chainmask & sc->txchainmask) == 0)
sc->chainmask |= IWN_LSB(sc->txchainmask);
___
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: r210111 - head/sys/dev/iwn

2010-07-15 Thread Bernhard Schmidt
Author: bschmidt
Date: Thu Jul 15 10:37:49 2010
New Revision: 210111
URL: http://svn.freebsd.org/changeset/base/210111

Log:
  Add support for firmware images in "type-length-value" format.
  
  Obtained from:OpenBSD
  MFC after:2 weeks

Modified:
  head/sys/dev/iwn/if_iwn.c
  head/sys/dev/iwn/if_iwnreg.h
  head/sys/dev/iwn/if_iwnvar.h

Modified: head/sys/dev/iwn/if_iwn.c
==
--- head/sys/dev/iwn/if_iwn.c   Thu Jul 15 09:34:00 2010(r210110)
+++ head/sys/dev/iwn/if_iwn.c   Thu Jul 15 10:37:49 2010(r210111)
@@ -231,6 +231,10 @@ static int iwn4965_load_firmware(struct 
 static int iwn5000_load_firmware_section(struct iwn_softc *, uint32_t,
const uint8_t *, int);
 static int iwn5000_load_firmware(struct iwn_softc *);
+static int iwn_read_firmware_leg(struct iwn_softc *,
+   struct iwn_fw_info *);
+static int iwn_read_firmware_tlv(struct iwn_softc *,
+   struct iwn_fw_info *, uint16_t);
 static int iwn_read_firmware(struct iwn_softc *);
 static int iwn_clock_wait(struct iwn_softc *);
 static int iwn_apm_init(struct iwn_softc *);
@@ -5644,39 +5648,19 @@ iwn5000_load_firmware(struct iwn_softc *
return 0;
 }
 
+/*
+ * Extract text and data sections from a legacy firmware image.
+ */
 static int
-iwn_read_firmware(struct iwn_softc *sc)
+iwn_read_firmware_leg(struct iwn_softc *sc, struct iwn_fw_info *fw)
 {
-   const struct iwn_hal *hal = sc->sc_hal;
-   struct iwn_fw_info *fw = &sc->fw;
const uint32_t *ptr;
+   size_t hdrlen = 24;
uint32_t rev;
-   size_t size;
-
-   IWN_UNLOCK(sc);
-
-   /* Read firmware image from filesystem. */
-   sc->fw_fp = firmware_get(sc->fwname);
-   if (sc->fw_fp == NULL) {
-   device_printf(sc->sc_dev,
-   "%s: could not load firmare image \"%s\"\n", __func__,
-   sc->fwname);
-   IWN_LOCK(sc);
-   return EINVAL;
-   }
-   IWN_LOCK(sc);
-
-   size = sc->fw_fp->datasize;
-   if (size < 28) {
-   device_printf(sc->sc_dev,
-   "%s: truncated firmware header: %zu bytes\n",
-   __func__, size);
-   return EINVAL;
-   }
 
-   /* Process firmware header. */
ptr = (const uint32_t *)sc->fw_fp->data;
rev = le32toh(*ptr++);
+
/* Check firmware API version. */
if (IWN_FW_API(rev) <= 1) {
device_printf(sc->sc_dev,
@@ -5685,34 +5669,27 @@ iwn_read_firmware(struct iwn_softc *sc)
}
if (IWN_FW_API(rev) >= 3) {
/* Skip build number (version 2 header). */
-   size -= 4;
+   hdrlen += 4;
ptr++;
}
+   if (fw->size < hdrlen) {
+   device_printf(sc->sc_dev,
+   "%s: firmware file too short: %zu bytes\n",
+   __func__, fw->size);
+   return EINVAL;
+   }
fw->main.textsz = le32toh(*ptr++);
fw->main.datasz = le32toh(*ptr++);
fw->init.textsz = le32toh(*ptr++);
fw->init.datasz = le32toh(*ptr++);
fw->boot.textsz = le32toh(*ptr++);
-   size -= 24;
-
-   /* Sanity-check firmware header. */
-   if (fw->main.textsz > hal->fw_text_maxsz ||
-   fw->main.datasz > hal->fw_data_maxsz ||
-   fw->init.textsz > hal->fw_text_maxsz ||
-   fw->init.datasz > hal->fw_data_maxsz ||
-   fw->boot.textsz > IWN_FW_BOOT_TEXT_MAXSZ ||
-   (fw->boot.textsz & 3) != 0) {
-   device_printf(sc->sc_dev, "%s: invalid firmware header\n",
-   __func__);
-   return EINVAL;
-   }
 
/* Check that all firmware sections fit. */
-   if (fw->main.textsz + fw->main.datasz + fw->init.textsz +
-   fw->init.datasz + fw->boot.textsz > size) {
+   if (fw->size < hdrlen + fw->main.textsz + fw->main.datasz +
+   fw->init.textsz + fw->init.datasz + fw->boot.textsz) {
device_printf(sc->sc_dev,
"%s: firmware file too short: %zu bytes\n",
-   __func__, size);
+   __func__, fw->size);
return EINVAL;
}
 
@@ -5726,6 +5703,151 @@ iwn_read_firmware(struct iwn_softc *sc)
return 0;
 }
 
+/*
+ * Extract text and data sections from a TLV firmware image.
+ */
+int
+iwn_read_firmware_tlv(struct iwn_softc *sc, struct iwn_fw_info *fw,
+uint16_t alt)
+{
+   const struct iwn_fw_tlv_hdr *hdr;
+   const struct iwn_fw_tlv *tlv;
+   const uint8_t *ptr, *end;
+   uint64_t altmask;
+   uint32_t len;
+
+   if (fw->size < sizeof (*hdr)) {
+   device_printf(sc->sc_dev,
+   "%s: firmware file too short: %zu bytes\n",
+   __func__, fw->size);
+   return EINVAL;
+   }
+   

svn commit: r210112 - head

2010-07-15 Thread Rafal Jaworowski
Author: raj
Date: Thu Jul 15 10:49:07 2010
New Revision: 210112
URL: http://svn.freebsd.org/changeset/base/210112

Log:
  Fix FDT_DTS_FILE parsing to properly retrieve its value. This unbreaks the
  'builddtb' target.
  
  Make the processing more robust against non-existent kernel config files
  (pointed out by imp@).

Modified:
  head/Makefile.inc1

Modified: head/Makefile.inc1
==
--- head/Makefile.inc1  Thu Jul 15 10:37:49 2010(r210111)
+++ head/Makefile.inc1  Thu Jul 15 10:49:07 2010(r210112)
@@ -1477,8 +1477,12 @@ _xi-links:
 DTBOUTPUTPATH= ${KRNLOBJDIR}/${KERNCONF}/
 
 .if !defined(FDT_DTS_FILE) || empty(FDT_DTS_FILE)
-FDT_DTS_FILE!= awk '/^makeoptions[[:space:]]+FDT_DTS_FILE/ {FS="=|[ \t]+"; 
print $$3}' \
+.if exists(${KERNCONFDIR}/${KERNCONF})
+FDT_DTS_FILE!= awk 'BEGIN {FS="="} /^makeoptions[[:space:]]+FDT_DTS_FILE/ 
{print $$2}' \
${KERNCONFDIR}/${KERNCONF}
+.else
+.error ERROR: kernel config file not found.
+.endif
 .endif
 
 .endif
___
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: r210103 - head/lib/liblzma

2010-07-15 Thread Dimitry Andric
On 2010-07-15 05:11, Marcel Moolenaar wrote:
> Author: marcel
> Date: Thu Jul 15 03:11:04 2010
> New Revision: 210103
> URL: http://svn.freebsd.org/changeset/base/210103
> 
> Log:
>   Unbreak xz (liblzma) on strong-aligned architectures (and without
>   emulation of misaligned memory accesses). We cannot map the unaligned
>   memory access functions to the ones used for aligned accesses, so do
>   not define TUKLIB_FAST_UNALIGNED_ACCESS.

Is there no way to define or undefine this per arch?  If this particular
define gives a speed advantage on the 'weak-aligned' architectures, it
might be worth it...
___
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: r210114 - head/sys/dev/iwn

2010-07-15 Thread Bernhard Schmidt
Author: bschmidt
Date: Thu Jul 15 11:52:20 2010
New Revision: 210114
URL: http://svn.freebsd.org/changeset/base/210114

Log:
  Handle RUN->ASSOC->RUN transition correctly, as in not trigger a
  firmware error. Convert if statements to a switch statement while
  I'm here.
  
  Tested by:Benjamin Kaduk 
  MFC after:2 weeks

Modified:
  head/sys/dev/iwn/if_iwn.c

Modified: head/sys/dev/iwn/if_iwn.c
==
--- head/sys/dev/iwn/if_iwn.c   Thu Jul 15 11:26:07 2010(r210113)
+++ head/sys/dev/iwn/if_iwn.c   Thu Jul 15 11:52:20 2010(r210114)
@@ -1940,27 +1940,44 @@ iwn_newstate(struct ieee80211vap *vap, e
IWN_LOCK(sc);
callout_stop(&sc->sc_timer_to);
 
-   if (nstate == IEEE80211_S_AUTH && vap->iv_state != IEEE80211_S_AUTH) {
-   /* !AUTH -> AUTH requires adapter config */
-   /* Reset state to handle reassociations correctly. */
+   switch (nstate) {
+   case IEEE80211_S_ASSOC:
+   if (vap->iv_state != IEEE80211_S_RUN)
+   break;
+   /* FALLTHROUGH */
+   case IEEE80211_S_AUTH:
+   if (vap->iv_state == IEEE80211_S_AUTH)
+   break;
+
+   /*
+* !AUTH -> AUTH transition requires state reset to handle
+* reassociations correctly.
+*/
sc->rxon.associd = 0;
sc->rxon.filter &= ~htole32(IWN_FILTER_BSS);
iwn_calib_reset(sc);
error = iwn_auth(sc, vap);
-   }
-   if (nstate == IEEE80211_S_RUN && vap->iv_state != IEEE80211_S_RUN) {
+   break;
+
+   case IEEE80211_S_RUN:
+   /*
+* RUN -> RUN transition; Just restart the timers.
+*/
+   if (vap->iv_state == IEEE80211_S_RUN) {
+   iwn_calib_reset(sc);
+   break;
+   }
+
/*
 * !RUN -> RUN requires setting the association id
 * which is done with a firmware cmd.  We also defer
 * starting the timers until that work is done.
 */
error = iwn_run(sc, vap);
-   }
-   if (nstate == IEEE80211_S_RUN) {
-   /*
-* RUN -> RUN transition; just restart the timers.
-*/
-   iwn_calib_reset(sc);
+   break;
+
+   default:
+   break;
}
IWN_UNLOCK(sc);
IEEE80211_LOCK(ic);
___
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: r210005 - head/sys/modules/acpi/acpi

2010-07-15 Thread Bruce Evans

On Tue, 13 Jul 2010, Jung-uk Kim wrote:


Log:
 Define SMP unconditionally for amd64 and remove opt_global.h from SRCS.
 Note it is done just for correctness sake because we do not build, ship, or
 support acpi.ko on amd64.

 Prodded by:bde


Thanks.

It was much more interesting than I noticed.  Modules are supposed to be
independent of all configuration options, especially global ones,
especially especially SMP.  Perhaps this is too much to ask for acpi.
Does it work now, after you removed an SMP ifdef from it?

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: r210115 - stable/8/sys/i386/i386

2010-07-15 Thread John Baldwin
Author: jhb
Date: Thu Jul 15 12:17:17 2010
New Revision: 210115
URL: http://svn.freebsd.org/changeset/base/210115

Log:
  MFC part of 209483:
  Clear DF bit in cmcint interrupt handler.
  
  Submitted by: kib

Modified:
  stable/8/sys/i386/i386/apic_vector.s

Modified: stable/8/sys/i386/i386/apic_vector.s
==
--- stable/8/sys/i386/i386/apic_vector.sThu Jul 15 11:52:20 2010
(r210114)
+++ stable/8/sys/i386/i386/apic_vector.sThu Jul 15 12:17:17 2010
(r210115)
@@ -120,6 +120,7 @@ IDTVEC(timerint)
 IDTVEC(cmcint)
PUSH_FRAME
SET_KERNEL_SREGS
+   cld
FAKE_MCOUNT(TF_EIP(%esp))
calllapic_handle_cmc
MEXITCOUNT
___
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: r210079 - in stable/8/sys: amd64/amd64 amd64/include i386/i386 i386/include

2010-07-15 Thread John Baldwin
On Wednesday, July 14, 2010 5:22:31 pm Kostik Belousov wrote:
> On Wed, Jul 14, 2010 at 09:10:14PM +, John Baldwin wrote:
> > Author: jhb
> > Date: Wed Jul 14 21:10:14 2010
> > New Revision: 210079
> > URL: http://svn.freebsd.org/changeset/base/210079
> 
> > Modified: stable/8/sys/i386/i386/apic_vector.s
> > 
==
> > --- stable/8/sys/i386/i386/apic_vector.sWed Jul 14 20:55:45 2010
(r210078)
> > +++ stable/8/sys/i386/i386/apic_vector.sWed Jul 14 21:10:14 2010
(r210079)
> > @@ -113,6 +113,19 @@ IDTVEC(timerint)
> > jmp doreti
> >  
> >  /*
> > + * Local APIC CMCI handler.
> > + */
> > +   .text
> > +   SUPERALIGN_TEXT
> > +IDTVEC(cmcint)
> > +   PUSH_FRAME
> > +   SET_KERNEL_SREGS
> I think cld is missed right there.

Oops, crossed commits. :(  Should be fixed, thanks.

-- 
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: r210116 - head

2010-07-15 Thread Rafal Jaworowski
Author: raj
Date: Thu Jul 15 13:21:25 2010
New Revision: 210116
URL: http://svn.freebsd.org/changeset/base/210116

Log:
  Relax FDT_DTS_FILE validation (and unbreak world build).
  
  Pointed out by:   kib

Modified:
  head/Makefile.inc1

Modified: head/Makefile.inc1
==
--- head/Makefile.inc1  Thu Jul 15 12:17:17 2010(r210115)
+++ head/Makefile.inc1  Thu Jul 15 13:21:25 2010(r210116)
@@ -1480,8 +1480,6 @@ DTBOUTPUTPATH= ${KRNLOBJDIR}/${KERNCONF}
 .if exists(${KERNCONFDIR}/${KERNCONF})
 FDT_DTS_FILE!= awk 'BEGIN {FS="="} /^makeoptions[[:space:]]+FDT_DTS_FILE/ 
{print $$2}' \
${KERNCONFDIR}/${KERNCONF}
-.else
-.error ERROR: kernel config file not found.
 .endif
 .endif
 
___
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: r210117 - head/sys/kern

2010-07-15 Thread Ivan Voras
Author: ivoras
Date: Thu Jul 15 13:46:30 2010
New Revision: 210117
URL: http://svn.freebsd.org/changeset/base/210117

Log:
  A cosmetic change - don't output empty .

Modified:
  head/sys/kern/sched_ule.c

Modified: head/sys/kern/sched_ule.c
==
--- head/sys/kern/sched_ule.c   Thu Jul 15 13:21:25 2010(r210116)
+++ head/sys/kern/sched_ule.c   Thu Jul 15 13:46:30 2010(r210117)
@@ -2656,16 +2656,16 @@ sysctl_kern_sched_topology_spec_internal
}
sbuf_printf(sb, "\n");
 
-   sbuf_printf(sb, "%*s ", indent, "");
if (cg->cg_flags != 0) {
+   sbuf_printf(sb, "%*s ", indent, "");
if ((cg->cg_flags & CG_FLAG_HTT) != 0)
sbuf_printf(sb, "HTT group");
if ((cg->cg_flags & CG_FLAG_THREAD) != 0)
sbuf_printf(sb, "THREAD 
group");
if ((cg->cg_flags & CG_FLAG_SMT) != 0)
sbuf_printf(sb, "SMT group");
+   sbuf_printf(sb, "\n");
}
-   sbuf_printf(sb, "\n");
 
if (cg->cg_children > 0) {
sbuf_printf(sb, "%*s \n", indent, "");
___
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: r210103 - head/lib/liblzma

2010-07-15 Thread Dag-Erling Smørgrav
Dimitry Andric  writes:
> Marcel Moolenaar  writes:
> > Unbreak xz (liblzma) on strong-aligned architectures (and without
> > emulation of misaligned memory accesses). We cannot map the unaligned
> > memory access functions to the ones used for aligned accesses, so do
> > not define TUKLIB_FAST_UNALIGNED_ACCESS.
> Is there no way to define or undefine this per arch?  If this particular
> define gives a speed advantage on the 'weak-aligned' architectures, it
> might be worth it...

Misaligned accesses, especially writes, are slow on all architectures -
but Marcel knows this, so I guess he has a reason for doing it this way?

DES
-- 
Dag-Erling Smørgrav - d...@des.no
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r210118 - head/sbin/ipfw

2010-07-15 Thread Luigi Rizzo
Author: luigi
Date: Thu Jul 15 14:34:56 2010
New Revision: 210118
URL: http://svn.freebsd.org/changeset/base/210118

Log:
  better printing of headers when listing flows

Modified:
  head/sbin/ipfw/dummynet.c

Modified: head/sbin/ipfw/dummynet.c
==
--- head/sbin/ipfw/dummynet.c   Thu Jul 15 13:46:30 2010(r210117)
+++ head/sbin/ipfw/dummynet.c   Thu Jul 15 14:34:56 2010(r210118)
@@ -146,10 +146,6 @@ print_mask(struct ipfw_flow_id *id)
id->proto,
id->src_ip, id->src_port,
id->dst_ip, id->dst_port);
-
-   printf("BKT Prot ___Source IP/port "
-   "Dest. IP/port "
-   "Tot_pkt/bytes Pkt/Byte Drp\n");
} else {
char buf[255];
printf("\nmask: %sproto: 0x%02x, flow_id: 0x%08x,  ",
@@ -159,22 +155,35 @@ print_mask(struct ipfw_flow_id *id)
printf("%s/0x%04x -> ", buf, id->src_port);
inet_ntop(AF_INET6, &(id->dst_ip6), buf, sizeof(buf));
printf("%s/0x%04x\n", buf, id->dst_port);
+   }
+}
 
+static void
+print_header(struct ipfw_flow_id *id)
+{
+   if (!IS_IP6_FLOW_ID(id))
+   printf("BKT Prot ___Source IP/port "
+   "Dest. IP/port "
+   "Tot_pkt/bytes Pkt/Byte Drp\n");
+   else
printf("BKT ___Prot___ _flow-id_ "
"__Source IPv6/port___ "
"___Dest. IPv6/port___ "
"Tot_pkt/bytes Pkt/Byte Drp\n");
-   }
 }
 
 static void
-list_flow(struct dn_flow *ni)
+list_flow(struct dn_flow *ni, int *print)
 {
char buff[255];
-   struct protoent *pe;
+   struct protoent *pe = NULL;
struct in_addr ina;
struct ipfw_flow_id *id = &ni->fid;
 
+   if (*print) {
+   print_header(&ni->fid);
+   *print = 0;
+   }
pe = getprotobynumber(id->proto);
/* XXX: Should check for IPv4 flows */
printf("%3u%c", (ni->oid.id) & 0xff,
@@ -290,6 +299,7 @@ static void
 list_pipes(struct dn_id *oid, struct dn_id *end)
 {
 char buf[160]; /* pending buffer */
+int toPrint = 1;   /* print header */
 
 buf[0] = '\0';
 for (; oid != end; oid = O_NEXT(oid, oid->len)) {
@@ -333,7 +343,7 @@ list_pipes(struct dn_id *oid, struct dn_
break;
 
case DN_FLOW:
-   list_flow((struct dn_flow *)oid);
+   list_flow((struct dn_flow *)oid, &toPrint);
break;
 
case DN_LINK: {
___
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: r210119 - head/sys/netinet/ipfw

2010-07-15 Thread Luigi Rizzo
Author: luigi
Date: Thu Jul 15 14:37:02 2010
New Revision: 210119
URL: http://svn.freebsd.org/changeset/base/210119

Log:
  fix a comment and final empty line

Modified:
  head/sys/netinet/ipfw/dn_heap.c

Modified: head/sys/netinet/ipfw/dn_heap.c
==
--- head/sys/netinet/ipfw/dn_heap.c Thu Jul 15 14:34:56 2010
(r210118)
+++ head/sys/netinet/ipfw/dn_heap.c Thu Jul 15 14:37:02 2010
(r210119)
@@ -514,9 +514,12 @@ dn_ht_scan(struct dn_ht *ht, int (*fn)(v
 }
 
 /*
- * Similar to dn_ht_scan(), except thah the scan is performed only
+ * Similar to dn_ht_scan(), except that the scan is performed only
  * in the bucket 'bucket'. The function returns a correct bucket number if
- * the original is invalid
+ * the original is invalid.
+ * If the callback returns DNHT_SCAN_END, the function move the ht->ht[i]
+ * pointer to the last entry processed. Moreover, the bucket number passed
+ * by caller is decremented, because usually the caller increment it.
  */
 int
 dn_ht_scan_bucket(struct dn_ht *ht, int *bucket, int (*fn)(void *, void *),
@@ -547,4 +550,3 @@ dn_ht_scan_bucket(struct dn_ht *ht, int 
}
return found;
 }
-
___
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: r210120 - head/sys/netinet/ipfw

2010-07-15 Thread Luigi Rizzo
Author: luigi
Date: Thu Jul 15 14:37:59 2010
New Revision: 210120
URL: http://svn.freebsd.org/changeset/base/210120

Log:
  whitespace fixes

Modified:
  head/sys/netinet/ipfw/ip_fw2.c

Modified: head/sys/netinet/ipfw/ip_fw2.c
==
--- head/sys/netinet/ipfw/ip_fw2.c  Thu Jul 15 14:37:02 2010
(r210119)
+++ head/sys/netinet/ipfw/ip_fw2.c  Thu Jul 15 14:37:59 2010
(r210120)
@@ -351,7 +351,7 @@ iface_match(struct ifnet *ifp, ipfw_insn
return(1);
}
} else {
-#ifdef __FreeBSD__ /* and OSX too ? */
+#ifdef __FreeBSD__ /* and OSX too ? */
struct ifaddr *ia;
 
if_addr_rlock(ifp);
@@ -1329,7 +1329,7 @@ do {  
\
/* For diverted packets, args->rule.info
 * contains the divert port (in host format)
 * reason and direction.
-*/
+*/
uint32_t i = args->rule.info;
match = (i&IPFW_IS_MASK) == IPFW_IS_DIVERT &&
cmd->arg1 & ((i & IPFW_INFO_IN) ? 1 : 2);
___
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: r210121 - head/sys/net

2010-07-15 Thread Luigi Rizzo
Author: luigi
Date: Thu Jul 15 14:41:06 2010
New Revision: 210121
URL: http://svn.freebsd.org/changeset/base/210121

Log:
  small portability fix to build on linux/windows

Modified:
  head/sys/net/pfil.h

Modified: head/sys/net/pfil.h
==
--- head/sys/net/pfil.h Thu Jul 15 14:37:59 2010(r210120)
+++ head/sys/net/pfil.h Thu Jul 15 14:41:06 2010(r210121)
@@ -69,7 +69,11 @@ struct pfil_head {
pfil_list_t ph_out;
int ph_type;
int ph_nhooks;
+#if defined( __linux__ ) || defined( _WIN32 )
+   rwlock_tph_mtx;
+#else
struct rmlock   ph_lock;
+#endif
union {
u_long  phu_val;
void*phu_ptr;
___
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: r210122 - head/sys/net

2010-07-15 Thread Luigi Rizzo
Author: luigi
Date: Thu Jul 15 14:41:59 2010
New Revision: 210122
URL: http://svn.freebsd.org/changeset/base/210122

Log:
  whitespace cleanup

Modified:
  head/sys/net/radix.c

Modified: head/sys/net/radix.c
==
--- head/sys/net/radix.cThu Jul 15 14:41:06 2010(r210121)
+++ head/sys/net/radix.cThu Jul 15 14:41:59 2010(r210122)
@@ -50,8 +50,8 @@
 #include 
 #include 
 #include 
-#define log(x, arg...)  fprintf(stderr, ## arg)
-#define panic(x)fprintf(stderr, "PANIC: %s", x), exit(1)
+#define log(x, arg...) fprintf(stderr, ## arg)
+#define panic(x)   fprintf(stderr, "PANIC: %s", x), exit(1)
 #define min(a, b) ((a) < (b) ? (a) : (b) )
 #include 
 #endif /* !_KERNEL */
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r210123 - head/sys/netinet/ipfw

2010-07-15 Thread Luigi Rizzo
Author: luigi
Date: Thu Jul 15 14:43:12 2010
New Revision: 210123
URL: http://svn.freebsd.org/changeset/base/210123

Log:
  remove some conditional #ifdefs (no-op on FreeBSD);
  run the timer routine on cpu 0.

Modified:
  head/sys/netinet/ipfw/ip_fw_dynamic.c

Modified: head/sys/netinet/ipfw/ip_fw_dynamic.c
==
--- head/sys/netinet/ipfw/ip_fw_dynamic.c   Thu Jul 15 14:41:59 2010
(r210122)
+++ head/sys/netinet/ipfw/ip_fw_dynamic.c   Thu Jul 15 14:43:12 2010
(r210123)
@@ -894,10 +894,7 @@ struct mbuf *
 ipfw_send_pkt(struct mbuf *replyto, struct ipfw_flow_id *id, u_int32_t seq,
 u_int32_t ack, int flags)
 {
-#ifndef __FreeBSD__
-   return NULL;
-#else
-   struct mbuf *m;
+   struct mbuf *m = NULL;  /* stupid compiler */
int len, dir;
struct ip *h = NULL;/* stupid compiler */
 #ifdef INET6
@@ -1033,7 +1030,6 @@ ipfw_send_pkt(struct mbuf *replyto, stru
}
 
return (m);
-#endif /* __FreeBSD__ */
 }
 
 /*
@@ -1131,8 +1127,8 @@ ipfw_tick(void * vnetx) 
}
 #endif
 done:
-   callout_reset(&V_ipfw_timeout, V_dyn_keepalive_period * hz,
- ipfw_tick, vnetx);
+   callout_reset_on(&V_ipfw_timeout, V_dyn_keepalive_period * hz,
+ ipfw_tick, vnetx, 0);
CURVNET_RESTORE();
 }
 
@@ -1173,7 +1169,7 @@ ipfw_dyn_init(void)
 
 V_dyn_max = 4096;   /* max # of dynamic rules */
 callout_init(&V_ipfw_timeout, CALLOUT_MPSAFE);
-callout_reset(&V_ipfw_timeout, hz, ipfw_tick, curvnet);
+callout_reset_on(&V_ipfw_timeout, hz, ipfw_tick, curvnet, 0);
 }
 
 void
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r210103 - head/lib/liblzma

2010-07-15 Thread Dimitry Andric
On 2010-07-15 16:28, Dag-Erling Smørgrav wrote:
> Misaligned accesses, especially writes, are slow on all architectures -
> but Marcel knows this, so I guess he has a reason for doing it this way?

I did some unscientific tests here, on an i386 box, and it did not turn
out to make too much difference, if at all.  I repeatedly compressed a
tar file containing an svn export of head (~537 MiB), using an 'aligned'
xz and an 'unaligned' one:

$ for i in 1 2 3 4 5; do time xz-aligned -z -9 -c test.tar > /dev/null; done

real8m42.535s
user8m27.231s
sys 0m14.375s

real8m39.049s
user8m25.645s
sys 0m12.686s

real9m53.560s
user9m30.045s
sys 0m22.208s

real8m49.051s
user8m29.796s
sys 0m18.200s

real8m35.901s
user8m18.468s
sys 0m16.705s
$ for i in 1 2 3 4 5; do time xz-unaligned -z -9 -c test.tar > /dev/null; done

real8m36.547s
user8m20.673s
sys 0m15.016s

real8m43.048s
user8m26.418s
sys 0m15.627s

real8m40.850s
user8m24.624s
sys 0m15.401s

real8m33.000s
user8m15.823s
sys 0m16.547s

real8m37.786s
user8m21.952s
sys 0m14.983s

I don't see too much difference, except one weird outlier; that was
probably caused by something else running concurrently on the system.

Maybe there is more difference when you use some other type of data,
such as less-compressible files, or a much larger set, but I did not
test that.

___
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: r210124 - head/sys/amd64/amd64

2010-07-15 Thread Alan Cox
Author: alc
Date: Thu Jul 15 16:25:51 2010
New Revision: 210124
URL: http://svn.freebsd.org/changeset/base/210124

Log:
  Optimize pmap_remove()'s handling of PG_G mappings.  Specifically,
  instead of calling pmap_invalidate_page() for each PG_G mapping, call
  pmap_invalidate_range() for each range of PG_G mappings.  In addition,
  eliminate a redundant call to pmap_invalidate_page().  Both
  pmap_remove_pte() and pmap_remove_page() called pmap_invalidate_page()
  when the mapping had the PG_G attribute.  Now, only pmap_remove_page()
  calls pmap_invalidate_page().  Altogether, these changes eliminate 53%
  of the TLB shootdowns for a "buildworld" on a ZFS file system.  On
  FFS, the reduction is 3%.
  
  MFC after:6 weeks

Modified:
  head/sys/amd64/amd64/pmap.c

Modified: head/sys/amd64/amd64/pmap.c
==
--- head/sys/amd64/amd64/pmap.c Thu Jul 15 14:43:12 2010(r210123)
+++ head/sys/amd64/amd64/pmap.c Thu Jul 15 16:25:51 2010(r210124)
@@ -2602,12 +2602,6 @@ pmap_remove_pte(pmap_t pmap, pt_entry_t 
oldpte = pte_load_clear(ptq);
if (oldpte & PG_W)
pmap->pm_stats.wired_count -= 1;
-   /*
-* Machines that don't support invlpg, also don't support
-* PG_G.
-*/
-   if (oldpte & PG_G)
-   pmap_invalidate_page(kernel_pmap, va);
pmap_resident_count_dec(pmap, 1);
if (oldpte & PG_MANAGED) {
m = PHYS_TO_VM_PAGE(oldpte & PG_FRAME);
@@ -2647,7 +2641,7 @@ pmap_remove_page(pmap_t pmap, vm_offset_
 void
 pmap_remove(pmap_t pmap, vm_offset_t sva, vm_offset_t eva)
 {
-   vm_offset_t va_next;
+   vm_offset_t va, va_next;
pml4_entry_t *pml4e;
pdp_entry_t *pdpe;
pd_entry_t ptpaddr, *pde;
@@ -2748,20 +2742,27 @@ pmap_remove(pmap_t pmap, vm_offset_t sva
if (va_next > eva)
va_next = eva;
 
+   va = va_next;
for (pte = pmap_pde_to_pte(pde, sva); sva != va_next; pte++,
sva += PAGE_SIZE) {
-   if (*pte == 0)
+   if (*pte == 0) {
+   if (va != va_next) {
+   pmap_invalidate_range(pmap, va, sva);
+   va = va_next;
+   }
continue;
-
-   /*
-* The TLB entry for a PG_G mapping is invalidated
-* by pmap_remove_pte().
-*/
+   }
if ((*pte & PG_G) == 0)
anyvalid = 1;
-   if (pmap_remove_pte(pmap, pte, sva, ptpaddr, &free))
+   else if (va == va_next)
+   va = sva;
+   if (pmap_remove_pte(pmap, pte, sva, ptpaddr, &free)) {
+   sva += PAGE_SIZE;
break;
+   }
}
+   if (va != va_next)
+   pmap_invalidate_range(pmap, va, sva);
}
 out:
if (anyvalid)
___
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: r210125 - head/release/picobsd/qemu

2010-07-15 Thread Luigi Rizzo
Author: luigi
Date: Thu Jul 15 16:32:59 2010
New Revision: 210125
URL: http://svn.freebsd.org/changeset/base/210125

Log:
  add some modern stuff: SMP, SCHED_ULE, PREEMPTION
  and support for VIMAGE

Modified:
  head/release/picobsd/qemu/PICOBSD
  head/release/picobsd/qemu/crunch.conf

Modified: head/release/picobsd/qemu/PICOBSD
==
--- head/release/picobsd/qemu/PICOBSD   Thu Jul 15 16:25:51 2010
(r210124)
+++ head/release/picobsd/qemu/PICOBSD   Thu Jul 15 16:32:59 2010
(r210125)
@@ -19,10 +19,12 @@ cpu I586_CPU
 cpuI686_CPU
 ident  PICOBSD
 
-#options   SMP
-#deviceapic
+# SMP seems to be needed for kern_et
+optionsSMP
+device apic
 
-optionsSCHED_4BSD  # mandatory to have one 
scheduler
+optionsSCHED_ULE   # mandatory to have one scheduler
+optionsPREEMPTION  # needed for decent interrupt processing
 #options   MATH_EMULATE#Support for x87 emulation
 optionsINET#InterNETworking
 #options   INET6
@@ -115,6 +117,7 @@ device  md  # Memory "disks"
 #devicefaith   1   # IPv6-to-IPv4 relaying (translation)
 device tap
 
+#options   VIMAGE  # soner or later we may want to test this
 #options   DEVICE_POLLING
 
 # The `bpf' device enables the Berkeley Packet Filter.

Modified: head/release/picobsd/qemu/crunch.conf
==
--- head/release/picobsd/qemu/crunch.conf   Thu Jul 15 16:25:51 2010
(r210124)
+++ head/release/picobsd/qemu/crunch.conf   Thu Jul 15 16:32:59 2010
(r210125)
@@ -133,6 +133,7 @@ libs_so -lalias # natd
 progs tcpdump
 special tcpdump srcdir /usr/src/usr.sbin/tcpdump/tcpdump
 libs_so -lpcap # used by tcpdump
+libs_so -lcrypto # used by tcpdump with inet6
 
 # ppp is rather large. Note that as of Jan.01, RELEASE_CRUNCH
 # makes ppp not use libalias, so you cannot have aliasing.
@@ -158,6 +159,9 @@ progs sed
 progs date
 progs time
 progs ping
+progs ping6
+progs tar
+
 #progs routed
 progs ipfw
 progs traceroute
@@ -174,6 +178,8 @@ ln mount_cd9660 cd9660
 # ln mount_msdosfs msdos
 
 # For a small ssh client/server use dropbear
+progs jail jexec jls   # why not...
+
 
 # Now the libraries
 libs_so-lc # the C library
@@ -189,3 +195,6 @@ libs_so -lz
 libs_so -lbsdxml
 libs_so -lsbuf
 libs_so -ljail # used by ifconfig
+libs_so -lipsec -lmd   # used with ipv6
+libs_so -larchive -lbz2
+libs_so -llzma # added after 207840
___
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: r210126 - head/sys/mips/rmi

2010-07-15 Thread Jayachandran C.
Author: jchandra
Date: Thu Jul 15 16:39:17 2010
New Revision: 210126
URL: http://svn.freebsd.org/changeset/base/210126

Log:
  Fix for 64 bit compilation.
  
  RMI bootloader passes argv[] and envp[] as an array of 32 bit pointers.
  Convert the pointers to correct pointer type before use.

Modified:
  head/sys/mips/rmi/xlr_machdep.c

Modified: head/sys/mips/rmi/xlr_machdep.c
==
--- head/sys/mips/rmi/xlr_machdep.c Thu Jul 15 16:32:59 2010
(r210125)
+++ head/sys/mips/rmi/xlr_machdep.c Thu Jul 15 16:39:17 2010
(r210126)
@@ -89,7 +89,7 @@ struct boot1_info xlr_boot1_info;
 struct xlr_loader_info xlr_loader_info;/* FIXME : Unused */
 int xlr_run_mode;
 int xlr_argc;
-char **xlr_argv, **xlr_envp;
+int32_t *xlr_argv, *xlr_envp;
 uint64_t cpu_mask_info;
 uint32_t xlr_online_cpumask;
 uint32_t xlr_core_cpu_mask = 0x1;  /* Core 0 thread 0 is always there */
@@ -298,8 +298,11 @@ platform_start(__register_t a0 __unused,
xlr_online_cpumask = read_c0_register32(MIPS_COP_0_OSSCRATCH, 2);
xlr_run_mode = read_c0_register32(MIPS_COP_0_OSSCRATCH, 3);
xlr_argc = read_c0_register32(MIPS_COP_0_OSSCRATCH, 4);
-   xlr_argv = (char 
**)(intptr_t)(int)read_c0_register32(MIPS_COP_0_OSSCRATCH, 5);
-   xlr_envp = (char 
**)(intptr_t)(int)read_c0_register32(MIPS_COP_0_OSSCRATCH, 6);
+   /*
+* argv and envp are passed in array of 32bit pointers
+*/
+   xlr_argv = (int32_t 
*)(intptr_t)(int)read_c0_register32(MIPS_COP_0_OSSCRATCH, 5);
+   xlr_envp = (int32_t 
*)(intptr_t)(int)read_c0_register32(MIPS_COP_0_OSSCRATCH, 6);
 
/* TODO: Verify the magic number here */
/* FIXMELATER: xlr_boot1_info.magic_number */
@@ -331,14 +334,15 @@ platform_start(__register_t a0 __unused,
if (xlr_argc == 1)
printf("\tNone\n");
for (i = 1; i < xlr_argc; i++) {
-   char *n;
+   char *n, *arg;
 
-   printf("\t%s\n", xlr_argv[i]);
-   n = strsep(&xlr_argv[i], "=");
-   if (xlr_argv[i] == NULL)
+   arg = (char *)(intptr_t)xlr_argv[i];
+   printf("\t%s\n", arg);
+   n = strsep(&arg, "=");
+   if (arg == NULL)
setenv(n, "1");
else
-   setenv(n, xlr_argv[i]);
+   setenv(n, arg);
}
 
xlr_set_boot_flags();
___
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: r210127 - in vendor/llvm/dist: . docs include/llvm include/llvm/ADT include/llvm/CodeGen include/llvm/MC/MCParser include/llvm/Support include/llvm/Target lib/Analysis lib/AsmParser lib...

2010-07-15 Thread Roman Divacky
Author: rdivacky
Date: Thu Jul 15 17:06:11 2010
New Revision: 210127
URL: http://svn.freebsd.org/changeset/base/210127

Log:
  Update LLVM to r108428.

Added:
  vendor/llvm/dist/test/CodeGen/ARM/sub.ll
  vendor/llvm/dist/test/CodeGen/Thumb2/thumb2-sub3.ll
  vendor/llvm/dist/test/CodeGen/X86/2010-06-28-DbgEntryPC.ll
  vendor/llvm/dist/test/CodeGen/X86/2010-07-13-indirectXconstraint.ll
  vendor/llvm/dist/test/CodeGen/X86/lsr-i386.ll
  vendor/llvm/dist/test/CodeGen/X86/sibcall-4.ll
  vendor/llvm/dist/test/FrontendC/2010-07-14-overconservative-align.c
  vendor/llvm/dist/test/FrontendC/2010-07-14-ref-off-end.c
  vendor/llvm/dist/test/FrontendC/vla-1.c
  vendor/llvm/dist/test/Transforms/InstCombine/bit-checks.ll
Deleted:
  vendor/llvm/dist/lib/Target/X86/X86COFF.h
  vendor/llvm/dist/test/CodeGen/X86/fast-isel-loads.ll
  vendor/llvm/dist/test/FrontendC/2010-06-28-DbgEntryPC.c
Modified:
  vendor/llvm/dist/Makefile.rules
  vendor/llvm/dist/docs/LangRef.html
  vendor/llvm/dist/docs/ProgrammersManual.html
  vendor/llvm/dist/docs/SourceLevelDebugging.html
  vendor/llvm/dist/include/llvm/ADT/APFloat.h
  vendor/llvm/dist/include/llvm/ADT/APInt.h
  vendor/llvm/dist/include/llvm/CodeGen/FastISel.h
  vendor/llvm/dist/include/llvm/CodeGen/LiveIntervalAnalysis.h
  vendor/llvm/dist/include/llvm/CodeGen/MachineModuleInfo.h
  vendor/llvm/dist/include/llvm/CodeGen/ProcessImplicitDefs.h
  vendor/llvm/dist/include/llvm/MC/MCParser/AsmParser.h
  vendor/llvm/dist/include/llvm/Support/COFF.h
  vendor/llvm/dist/include/llvm/Support/Regex.h
  vendor/llvm/dist/include/llvm/Support/StringPool.h
  vendor/llvm/dist/include/llvm/Target/TargetAsmParser.h
  vendor/llvm/dist/include/llvm/Target/TargetInstrInfo.h
  vendor/llvm/dist/include/llvm/Target/TargetOptions.h
  vendor/llvm/dist/include/llvm/Value.h
  vendor/llvm/dist/lib/Analysis/InstructionSimplify.cpp
  vendor/llvm/dist/lib/Analysis/ProfileInfo.cpp
  vendor/llvm/dist/lib/AsmParser/LLParser.cpp
  vendor/llvm/dist/lib/AsmParser/LLParser.h
  vendor/llvm/dist/lib/Bitcode/Reader/BitcodeReader.cpp
  vendor/llvm/dist/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
  vendor/llvm/dist/lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp
  vendor/llvm/dist/lib/CodeGen/LiveInterval.cpp
  vendor/llvm/dist/lib/CodeGen/MachineLICM.cpp
  vendor/llvm/dist/lib/CodeGen/MachineModuleInfo.cpp
  vendor/llvm/dist/lib/CodeGen/ProcessImplicitDefs.cpp
  vendor/llvm/dist/lib/CodeGen/SelectionDAG/FastISel.cpp
  vendor/llvm/dist/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
  vendor/llvm/dist/lib/MC/MCParser/AsmParser.cpp
  vendor/llvm/dist/lib/Support/APFloat.cpp
  vendor/llvm/dist/lib/Support/APInt.cpp
  vendor/llvm/dist/lib/Support/Regex.cpp
  vendor/llvm/dist/lib/Support/StringPool.cpp
  vendor/llvm/dist/lib/System/Unix/Program.inc
  vendor/llvm/dist/lib/Target/ARM/ARM.td
  vendor/llvm/dist/lib/Target/ARM/ARMAddressingModes.h
  vendor/llvm/dist/lib/Target/ARM/ARMISelLowering.cpp
  vendor/llvm/dist/lib/Target/ARM/ARMISelLowering.h
  vendor/llvm/dist/lib/Target/ARM/ARMInstrInfo.td
  vendor/llvm/dist/lib/Target/ARM/ARMInstrNEON.td
  vendor/llvm/dist/lib/Target/ARM/ARMInstrThumb2.td
  vendor/llvm/dist/lib/Target/ARM/ARMSubtarget.h
  vendor/llvm/dist/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
  vendor/llvm/dist/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp
  vendor/llvm/dist/lib/Target/ARM/AsmPrinter/ARMInstPrinter.cpp
  vendor/llvm/dist/lib/Target/ARM/README.txt
  vendor/llvm/dist/lib/Target/Alpha/AlphaMCAsmInfo.cpp
  vendor/llvm/dist/lib/Target/Alpha/AlphaMCAsmInfo.h
  vendor/llvm/dist/lib/Target/Blackfin/BlackfinMCAsmInfo.cpp
  vendor/llvm/dist/lib/Target/Blackfin/BlackfinMCAsmInfo.h
  vendor/llvm/dist/lib/Target/CellSPU/SPUMCAsmInfo.cpp
  vendor/llvm/dist/lib/Target/CellSPU/SPUMCAsmInfo.h
  vendor/llvm/dist/lib/Target/MBlaze/MBlazeMCAsmInfo.cpp
  vendor/llvm/dist/lib/Target/MBlaze/MBlazeMCAsmInfo.h
  vendor/llvm/dist/lib/Target/MSIL/MSILWriter.cpp
  vendor/llvm/dist/lib/Target/MSIL/MSILWriter.h
  vendor/llvm/dist/lib/Target/MSP430/MSP430MCAsmInfo.cpp
  vendor/llvm/dist/lib/Target/MSP430/MSP430MCAsmInfo.h
  vendor/llvm/dist/lib/Target/Mips/MipsMCAsmInfo.cpp
  vendor/llvm/dist/lib/Target/Mips/MipsMCAsmInfo.h
  vendor/llvm/dist/lib/Target/PIC16/PIC16DebugInfo.cpp
  vendor/llvm/dist/lib/Target/PIC16/PIC16MCAsmInfo.cpp
  vendor/llvm/dist/lib/Target/PIC16/PIC16MCAsmInfo.h
  vendor/llvm/dist/lib/Target/Sparc/SparcMCAsmInfo.cpp
  vendor/llvm/dist/lib/Target/Sparc/SparcMCAsmInfo.h
  vendor/llvm/dist/lib/Target/SystemZ/SystemZMCAsmInfo.cpp
  vendor/llvm/dist/lib/Target/SystemZ/SystemZMCAsmInfo.h
  vendor/llvm/dist/lib/Target/TargetMachine.cpp
  vendor/llvm/dist/lib/Target/X86/AsmParser/X86AsmParser.cpp
  vendor/llvm/dist/lib/Target/X86/AsmPrinter/X86AsmPrinter.cpp
  vendor/llvm/dist/lib/Target/X86/AsmPrinter/X86MCInstLower.cpp
  vendor/llvm/dist/lib/Target/X86/X86FastISel.cpp
  vendor/llvm/dist/lib/Target/X86/X86ISelLowering.cpp
  vendor/llvm/dist/lib/Target/X86/X86ISelLowering.h
  vendor/llvm/dist/lib/Target/X86/X86InstrFormats.td
  

svn commit: r210128 - in vendor/clang/dist: include/clang/AST include/clang/Basic include/clang/Driver include/clang/Frontend include/clang/Rewrite lib/AST lib/Basic lib/Checker lib/CodeGen lib/Dri...

2010-07-15 Thread Roman Divacky
Author: rdivacky
Date: Thu Jul 15 17:07:12 2010
New Revision: 210128
URL: http://svn.freebsd.org/changeset/base/210128

Log:
  Update clang to r108428.

Added:
  vendor/clang/dist/include/clang/Frontend/PCHDeserializationListener.h
  vendor/clang/dist/runtime/
  vendor/clang/dist/runtime/Makefile
  vendor/clang/dist/test/CodeCompletion/Inputs/reserved.h
  vendor/clang/dist/test/CodeGenCXX/lvalue-bitcasts.cpp
  vendor/clang/dist/test/CodeGenCXX/member-qual-debug-info.cpp
  vendor/clang/dist/test/PCH/pchpch.c
  vendor/clang/dist/test/PCH/pchpch1.h
  vendor/clang/dist/test/PCH/pchpch2.h
  vendor/clang/dist/test/SemaCXX/cv-unqual-rvalues.cpp
  vendor/clang/dist/test/SemaTemplate/deduction-crash.cpp
Modified:
  vendor/clang/dist/include/clang/AST/DeclBase.h
  vendor/clang/dist/include/clang/AST/DeclObjC.h
  vendor/clang/dist/include/clang/AST/Expr.h
  vendor/clang/dist/include/clang/AST/Type.h
  vendor/clang/dist/include/clang/Basic/Builtins.def
  vendor/clang/dist/include/clang/Basic/DiagnosticGroups.td
  vendor/clang/dist/include/clang/Basic/DiagnosticSemaKinds.td
  vendor/clang/dist/include/clang/Basic/FileManager.h
  vendor/clang/dist/include/clang/Basic/TargetInfo.h
  vendor/clang/dist/include/clang/Driver/ArgList.h
  vendor/clang/dist/include/clang/Driver/Driver.h
  vendor/clang/dist/include/clang/Driver/Options.td
  vendor/clang/dist/include/clang/Driver/ToolChain.h
  vendor/clang/dist/include/clang/Driver/Types.def
  vendor/clang/dist/include/clang/Frontend/ASTConsumers.h
  vendor/clang/dist/include/clang/Frontend/PCHReader.h
  vendor/clang/dist/include/clang/Frontend/PCHWriter.h
  vendor/clang/dist/include/clang/Rewrite/Rewriter.h
  vendor/clang/dist/lib/AST/DeclTemplate.cpp
  vendor/clang/dist/lib/AST/Expr.cpp
  vendor/clang/dist/lib/AST/ExprConstant.cpp
  vendor/clang/dist/lib/AST/Type.cpp
  vendor/clang/dist/lib/Basic/FileManager.cpp
  vendor/clang/dist/lib/Basic/TargetInfo.cpp
  vendor/clang/dist/lib/Basic/Targets.cpp
  vendor/clang/dist/lib/Checker/GRExprEngine.cpp
  vendor/clang/dist/lib/Checker/LLVMConventionsChecker.cpp
  vendor/clang/dist/lib/CodeGen/CGBlocks.cpp
  vendor/clang/dist/lib/CodeGen/CGCall.cpp
  vendor/clang/dist/lib/CodeGen/CGClass.cpp
  vendor/clang/dist/lib/CodeGen/CGDebugInfo.cpp
  vendor/clang/dist/lib/CodeGen/CGDecl.cpp
  vendor/clang/dist/lib/CodeGen/CGException.cpp
  vendor/clang/dist/lib/CodeGen/CGException.h
  vendor/clang/dist/lib/CodeGen/CGExpr.cpp
  vendor/clang/dist/lib/CodeGen/CGExprAgg.cpp
  vendor/clang/dist/lib/CodeGen/CGExprComplex.cpp
  vendor/clang/dist/lib/CodeGen/CGExprScalar.cpp
  vendor/clang/dist/lib/CodeGen/CGObjCGNU.cpp
  vendor/clang/dist/lib/CodeGen/CGObjCMac.cpp
  vendor/clang/dist/lib/CodeGen/CodeGenFunction.cpp
  vendor/clang/dist/lib/CodeGen/CodeGenFunction.h
  vendor/clang/dist/lib/CodeGen/CodeGenModule.h
  vendor/clang/dist/lib/CodeGen/Mangle.cpp
  vendor/clang/dist/lib/CodeGen/TargetInfo.cpp
  vendor/clang/dist/lib/Driver/ArgList.cpp
  vendor/clang/dist/lib/Driver/Driver.cpp
  vendor/clang/dist/lib/Driver/ToolChain.cpp
  vendor/clang/dist/lib/Driver/ToolChains.cpp
  vendor/clang/dist/lib/Driver/Tools.cpp
  vendor/clang/dist/lib/Frontend/ASTUnit.cpp
  vendor/clang/dist/lib/Frontend/FrontendActions.cpp
  vendor/clang/dist/lib/Frontend/GeneratePCH.cpp
  vendor/clang/dist/lib/Frontend/PCHReader.cpp
  vendor/clang/dist/lib/Frontend/PCHWriter.cpp
  vendor/clang/dist/lib/Rewrite/Rewriter.cpp
  vendor/clang/dist/lib/Sema/Sema.h
  vendor/clang/dist/lib/Sema/SemaCXXCast.cpp
  vendor/clang/dist/lib/Sema/SemaCodeComplete.cpp
  vendor/clang/dist/lib/Sema/SemaDecl.cpp
  vendor/clang/dist/lib/Sema/SemaExpr.cpp
  vendor/clang/dist/lib/Sema/SemaExprCXX.cpp
  vendor/clang/dist/lib/Sema/SemaInit.cpp
  vendor/clang/dist/lib/Sema/SemaObjCProperty.cpp
  vendor/clang/dist/lib/Sema/SemaOverload.cpp
  vendor/clang/dist/lib/Sema/SemaTemplate.cpp
  vendor/clang/dist/lib/Sema/SemaTemplateInstantiate.cpp
  vendor/clang/dist/lib/Sema/TreeTransform.h
  vendor/clang/dist/test/CXX/temp/temp.fct.spec/temp.arg.explicit/p3.cpp
  vendor/clang/dist/test/CodeCompletion/ordinary-name.c
  vendor/clang/dist/test/CodeGenCXX/condition.cpp
  vendor/clang/dist/test/CodeGenCXX/eh.cpp
  vendor/clang/dist/test/CodeGenCXX/instantiate-blocks.cpp
  vendor/clang/dist/test/CodeGenCXX/mangle.cpp
  vendor/clang/dist/test/CodeGenCXX/nrvo.cpp
  vendor/clang/dist/test/CodeGenCXX/static-init-2.cpp
  vendor/clang/dist/test/CodeGenObjC/metadata_symbols.m
  vendor/clang/dist/test/CodeGenObjC/unwind-fn.m
  vendor/clang/dist/test/Driver/darwin-iphone-defaults.m
  vendor/clang/dist/test/Driver/darwin-ld.c
  vendor/clang/dist/test/Frontend/darwin-version.c
  vendor/clang/dist/test/Index/c-index-api-loadTU-test.m
  vendor/clang/dist/test/Makefile
  vendor/clang/dist/test/Sema/block-call.c
  vendor/clang/dist/test/Sema/block-return.c
  vendor/clang/dist/test/Sema/exprs.c
  vendor/clang/dist/test/Sema/i-c-e.c
  vendor/clang/dist/test/Sema/return.c
  vendor/clang/dist/test/Sema/struct-cast.c
  vendor/clang/dist/tes

svn commit: r210129 - head/sys/dev/acpica/Osd

2010-07-15 Thread Jung-uk Kim
Author: jkim
Date: Thu Jul 15 17:11:49 2010
New Revision: 210129
URL: http://svn.freebsd.org/changeset/base/210129

Log:
  - AcpiOsReadMemory() needs similar fixes as r209965. [1]
  According to ACPICA User Guide and Programmer Reference, the read data must
  be zero extended to fill the 32-bit return value even if the bit width of
  the port is less than 32.
  - Remove 64-bit read/write from AcpiOsReadMemory() and AcpiOsWriteMemory().
  These functions do not support 64-bit access (yet).  Clean up style nits
  and unnecessary bit masking while I am here.
  
  Reported by:  Liu, Jinsong (jinsong dot liu at intel dot com) via
Lin Ming (ming dot m dot lin at intel dot com) [1]

Modified:
  head/sys/dev/acpica/Osd/OsdMemory.c

Modified: head/sys/dev/acpica/Osd/OsdMemory.c
==
--- head/sys/dev/acpica/Osd/OsdMemory.c Thu Jul 15 17:07:12 2010
(r210128)
+++ head/sys/dev/acpica/Osd/OsdMemory.c Thu Jul 15 17:11:49 2010
(r210129)
@@ -103,19 +103,13 @@ AcpiOsReadMemory(ACPI_PHYSICAL_ADDRESS A
 
 switch (Width) {
 case 8:
-   *(u_int8_t *)Value = (*(volatile u_int8_t *)LogicalAddress);
+   *Value = *(volatile uint8_t *)LogicalAddress;
break;
 case 16:
-   *(u_int16_t *)Value = (*(volatile u_int16_t *)LogicalAddress);
+   *Value = *(volatile uint16_t *)LogicalAddress;
break;
 case 32:
-   *(u_int32_t *)Value = (*(volatile u_int32_t *)LogicalAddress);
-   break;
-case 64:
-   *(u_int64_t *)Value = (*(volatile u_int64_t *)LogicalAddress);
-   break;
-default:
-   /* debug trap goes here */
+   *Value = *(volatile uint32_t *)LogicalAddress;
break;
 }
 
@@ -135,19 +129,13 @@ AcpiOsWriteMemory(ACPI_PHYSICAL_ADDRESS 
 
 switch (Width) {
 case 8:
-   (*(volatile u_int8_t *)LogicalAddress) = Value & 0xff;
+   *(volatile uint8_t *)LogicalAddress = Value;
break;
 case 16:
-   (*(volatile u_int16_t *)LogicalAddress) = Value & 0x;
+   *(volatile uint16_t *)LogicalAddress = Value;
break;
 case 32:
-   (*(volatile u_int32_t *)LogicalAddress) = Value & 0x;
-   break;
-case 64:
-   (*(volatile u_int64_t *)LogicalAddress) = Value;
-   break;
-default:
-   /* debug trap goes here */
+   *(volatile uint32_t *)LogicalAddress = Value;
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: r210131 - in head/sys: amd64/include i386/include sys

2010-07-15 Thread Alexander Motin
Author: mav
Date: Thu Jul 15 17:49:35 2010
New Revision: 210131
URL: http://svn.freebsd.org/changeset/base/210131

Log:
  Move functions declaration to MI code, following implementation.

Modified:
  head/sys/amd64/include/clock.h
  head/sys/i386/include/clock.h
  head/sys/sys/systm.h

Modified: head/sys/amd64/include/clock.h
==
--- head/sys/amd64/include/clock.h  Thu Jul 15 17:46:21 2010
(r210130)
+++ head/sys/amd64/include/clock.h  Thu Jul 15 17:49:35 2010
(r210131)
@@ -23,11 +23,6 @@ extern int   tsc_is_invariant;
 
 void   i8254_init(void);
 
-struct trapframe;
-
-inthardclockintr(struct trapframe *frame);
-intstatclockintr(struct trapframe *frame);
-
 /*
  * Driver to clock driver interface.
  */

Modified: head/sys/i386/include/clock.h
==
--- head/sys/i386/include/clock.h   Thu Jul 15 17:46:21 2010
(r210130)
+++ head/sys/i386/include/clock.h   Thu Jul 15 17:49:35 2010
(r210131)
@@ -23,11 +23,6 @@ extern int   tsc_is_invariant;
 
 void   i8254_init(void);
 
-struct trapframe;
- 
-inthardclockintr(struct trapframe *frame);
-intstatclockintr(struct trapframe *frame);
-
 /*
  * Driver to clock driver interface.
  */

Modified: head/sys/sys/systm.h
==
--- head/sys/sys/systm.hThu Jul 15 17:46:21 2010(r210130)
+++ head/sys/sys/systm.hThu Jul 15 17:49:35 2010(r210131)
@@ -140,6 +140,7 @@ struct tty;
 struct ucred;
 struct uio;
 struct _jmp_buf;
+struct trapframe;
 
 intsetjmp(struct _jmp_buf *);
 void   longjmp(struct _jmp_buf *, int) __dead2;
@@ -243,6 +244,9 @@ voidprofclock(int usermode, uintfptr_t 
 void   timer1clock(int usermode, uintfptr_t pc);
 void   timer2clock(int usermode, uintfptr_t pc);
 
+inthardclockintr(struct trapframe *frame);
+intstatclockintr(struct trapframe *frame);
+
 void   startprofclock(struct proc *);
 void   stopprofclock(struct proc *);
 void   cpu_startprofclock(void);
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r210132 - head/sys/compat/svr4

2010-07-15 Thread Edward Tomasz Napierala
Author: trasz
Date: Thu Jul 15 18:44:58 2010
New Revision: 210132
URL: http://svn.freebsd.org/changeset/base/210132

Log:
  Make svr4(4) version of poll(2) use the same limit of file descriptors as the
  usual poll(2) does, instead of checking resource limits.

Modified:
  head/sys/compat/svr4/svr4_filio.c

Modified: head/sys/compat/svr4/svr4_filio.c
==
--- head/sys/compat/svr4/svr4_filio.c   Thu Jul 15 17:49:35 2010
(r210131)
+++ head/sys/compat/svr4/svr4_filio.c   Thu Jul 15 18:44:58 2010
(r210132)
@@ -40,8 +40,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
-#include 
 
 #include 
 
@@ -67,8 +65,7 @@ svr4_sys_poll(td, uap)
  u_long siz;
 
  PROC_LOCK(td->td_proc);
- if (uap->nfds > lim_cur(td->td_proc, RLIMIT_NOFILE) &&
-   uap->nfds > FD_SETSIZE) {
+ if (uap->nfds > maxfilesperproc && uap->nfds > FD_SETSIZE) {
PROC_UNLOCK(td->td_proc);
return (EINVAL);
  }
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r210133 - head/lib/libjail

2010-07-15 Thread Jamie Gritton
Author: jamie
Date: Thu Jul 15 19:21:07 2010
New Revision: 210133
URL: http://svn.freebsd.org/changeset/base/210133

Log:
  Don't import parameter values in jail_getv, except for the search key.
  Remove the internal jailparam_vlist, in favor of using variants of its
   logic separately in jail_setv and jail_getv.
  Free the temporary parameter list and exported values in jail_setv
   and jail_getv.
  
  Noted by: Stanislav Uzunchev
  MFC after:3 days

Modified:
  head/lib/libjail/jail.c

Modified: head/lib/libjail/jail.c
==
--- head/lib/libjail/jail.c Thu Jul 15 18:44:58 2010(r210132)
+++ head/lib/libjail/jail.c Thu Jul 15 19:21:07 2010(r210133)
@@ -56,7 +56,6 @@ __FBSDID("$FreeBSD$");
 
 static int jailparam_import_enum(const char **values, int nvalues,
 const char *valstr, size_t valsize, int *value);
-static int jailparam_vlist(struct jailparam **jpp, va_list ap);
 static int jailparam_type(struct jailparam *jp);
 static char *noname(const char *name);
 static char *nononame(const char *name);
@@ -74,16 +73,31 @@ static const char *jailsys_values[] = { 
 int
 jail_setv(int flags, ...)
 {
-   va_list ap;
+   va_list ap, tap;
struct jailparam *jp;
-   int njp;
+   const char *name, *value;
+   int njp, jid;
 
+   /* Create the parameter list and import the parameters. */
va_start(ap, flags);
-   njp = jailparam_vlist(&jp, ap);
+   va_copy(tap, ap);
+   for (njp = 0; va_arg(tap, char *) != NULL; njp++)
+   (void)va_arg(tap, char *);
+   va_end(tap);
+   jp = alloca(njp * sizeof(struct jailparam));
+   for (njp = 0; (name = va_arg(ap, char *)) != NULL; njp++) {
+   value = va_arg(ap, char *);
+   if (jailparam_init(jp + njp, name) < 0 ||
+   jailparam_import(jp + njp, value) < 0) {
+   jailparam_free(jp, njp);
+   va_end(ap);
+   return (-1);
+   }
+   }
va_end(ap);
-   if (njp < 0)
-   return (njp);
-   return (jailparam_set(jp, njp, flags));
+   jid = jailparam_set(jp, njp, flags);
+   jailparam_free(jp, njp);
+   return (jid);
 }
 
 /*
@@ -94,48 +108,85 @@ int
 jail_getv(int flags, ...)
 {
va_list ap, tap;
-   struct jailparam *jp;
-   char *valarg;
-   const char *value;
-   int njp, i, jid, namekey, zero;
+   struct jailparam *jp, *jp_lastjid, *jp_jid, *jp_name, *jp_key;
+   char *valarg, *value;
+   const char *name, *key_value, *lastjid_value, *jid_value, *name_value;
+   int njp, i, jid;
 
+   /* Create the parameter list and find the key. */
va_start(ap, flags);
va_copy(tap, ap);
-   njp = jailparam_vlist(&jp, tap);
+   for (njp = 0; va_arg(tap, char *) != NULL; njp++)
+   (void)va_arg(tap, char *);
va_end(tap);
-   if (njp < 0)
-   return (njp);
-   /*
-* See if the name is the search key.  If so, we don't want to write
-* it back in case it's a read-only string.
-*/
-   namekey = 1;
-   zero = 0;
-   for (i = 0; i < njp; i++) {
-   if (!strcmp(jp->jp_name, "lastjid") ||
-   (!strcmp(jp->jp_name, "jid") &&
-memcmp(jp->jp_value, &zero, sizeof(zero
-   namekey = 0;
+
+   jp = alloca(njp * sizeof(struct jailparam));
+   va_copy(tap, ap);
+   jp_lastjid = jp_jid = jp_name = NULL;
+   lastjid_value = jid_value = name_value = NULL;
+   for (njp = 0; (name = va_arg(tap, char *)) != NULL; njp++) {
+   value = va_arg(tap, char *);
+   if (jailparam_init(jp + njp, name) < 0) {
+   va_end(tap);
+   goto error;
+   }
+   if (!strcmp(jp[njp].jp_name, "lastjid")) {
+   jp_lastjid = jp + njp;
+   lastjid_value = value;
+   } else if (!strcmp(jp[njp].jp_name, "jid")) {
+   jp_jid = jp + njp;
+   jid_value = value;
+   } if (!strcmp(jp[njp].jp_name, "name")) {
+   jp_name = jp + njp;
+   name_value = value;
+   }
}
-   jid = jailparam_get(jp, njp, flags);
-   if (jid < 0) {
-   va_end(ap);
-   return (-1);
+   va_end(tap);
+   /* Import the key parameter. */
+   if (jp_lastjid != NULL) {
+   jp_key = jp_lastjid;
+   key_value = lastjid_value;
+   } else if (jp_jid != NULL && strtol(jid_value, NULL, 10) != 0) {
+   jp_key = jp_jid;
+   key_value = jid_value;
+   } else if (jp_name != NULL) {
+   jp_key = jp_name;
+   key_value = name_value;
+   } else {
+   str

svn commit: r210134 - head/lib/libjail

2010-07-15 Thread Jamie Gritton
Author: jamie
Date: Thu Jul 15 19:21:33 2010
New Revision: 210134
URL: http://svn.freebsd.org/changeset/base/210134

Log:
  Don't copy and return a potentially unset buffer when jail_get fails.

Modified:
  head/lib/libjail/jail_getid.c

Modified: head/lib/libjail/jail_getid.c
==
--- head/lib/libjail/jail_getid.c   Thu Jul 15 19:21:07 2010
(r210133)
+++ head/lib/libjail/jail_getid.c   Thu Jul 15 19:21:33 2010
(r210134)
@@ -94,11 +94,15 @@ jail_getname(int jid)
jiov[5].iov_len = JAIL_ERRMSGLEN;
jail_errmsg[0] = 0;
jid = jail_get(jiov, 6, 0);
-   if (jid < 0 && !jail_errmsg[0])
-   snprintf(jail_errmsg, JAIL_ERRMSGLEN, "jail_get: %s",
-   strerror(errno));
-   name = strdup(namebuf);
-   if (name == NULL)
-   strerror_r(errno, jail_errmsg, JAIL_ERRMSGLEN);
+   if (jid < 0) {
+   if (!jail_errmsg[0])
+   snprintf(jail_errmsg, JAIL_ERRMSGLEN, "jail_get: %s",
+   strerror(errno));
+   return NULL;
+   } else {
+   name = strdup(namebuf);
+   if (name == NULL)
+   strerror_r(errno, jail_errmsg, JAIL_ERRMSGLEN);
+   }
return name;
 }
___
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: r210135 - head/sys/fs/nfsclient

2010-07-15 Thread John Baldwin
Author: jhb
Date: Thu Jul 15 19:21:48 2010
New Revision: 210135
URL: http://svn.freebsd.org/changeset/base/210135

Log:
  Merge 208603, 209946, and 209948 to the new NFS client:
  Move attribute cache flushes from VOP_OPEN() to VOP_LOOKUP() to provide
  more graceful recovery for stale filehandles and eliminate the need for
  conditionally clearing the attribute cache in the !NMODIFIED case in
  VOP_OPEN().
  
  Reviewed by:  rmacklem
  MFC after:2 weeks

Modified:
  head/sys/fs/nfsclient/nfs_clvnops.c

Modified: head/sys/fs/nfsclient/nfs_clvnops.c
==
--- head/sys/fs/nfsclient/nfs_clvnops.c Thu Jul 15 19:21:33 2010
(r210134)
+++ head/sys/fs/nfsclient/nfs_clvnops.c Thu Jul 15 19:21:48 2010
(r210135)
@@ -505,9 +505,11 @@ nfs_open(struct vop_open_args *ap)
(void) nfsrpc_close(vp, 0, ap->a_td);
return (error);
}
+   mtx_lock(&np->n_mtx);
np->n_attrstamp = 0;
if (vp->v_type == VDIR)
np->n_direofoffset = 0;
+   mtx_unlock(&np->n_mtx);
error = VOP_GETATTR(vp, &vattr, ap->a_cred);
if (error) {
if (NFS_ISV4(vp))
@@ -520,14 +522,6 @@ nfs_open(struct vop_open_args *ap)
np->n_change = vattr.va_filerev;
mtx_unlock(&np->n_mtx);
} else {
-   struct thread *td = curthread;
-   
-   if (np->n_ac_ts_syscalls != td->td_syscalls ||
-   np->n_ac_ts_tid != td->td_tid || 
-   td->td_proc == NULL ||
-   np->n_ac_ts_pid != td->td_proc->p_pid) {
-   np->n_attrstamp = 0;
-   }
mtx_unlock(&np->n_mtx); 

error = VOP_GETATTR(vp, &vattr, ap->a_cred);
if (error) {
@@ -987,7 +981,7 @@ nfs_lookup(struct vop_lookup_args *ap)
int flags = cnp->cn_flags;
struct vnode *newvp;
struct nfsmount *nmp;
-   struct nfsnode *np;
+   struct nfsnode *np, *newnp;
int error = 0, attrflag, dattrflag, ltype;
struct thread *td = cnp->cn_thread;
struct nfsfh *nfhp;
@@ -1023,11 +1017,27 @@ nfs_lookup(struct vop_lookup_args *ap)
 * change time of the file matches our cached copy.
 * Otherwise, we discard the cache entry and fallback
 * to doing a lookup RPC.
+*
+* To better handle stale file handles and attributes,
+* clear the attribute cache of this node if it is a
+* leaf component, part of an open() call, and not
+* locally modified before fetching the attributes.
+* This should allow stale file handles to be detected
+* here where we can fall back to a LOOKUP RPC to
+* recover rather than having nfs_open() detect the
+* stale file handle and failing open(2) with ESTALE.
 */
newvp = *vpp;
+   newnp = VTONFS(newvp);
+   if ((flags & (ISLASTCN | ISOPEN)) == (ISLASTCN | ISOPEN) &&
+   !(newnp->n_flag & NMODIFIED)) {
+   mtx_lock(&newnp->n_mtx);
+   newnp->n_attrstamp = 0;
+   mtx_unlock(&newnp->n_mtx);
+   }
if (nfscl_nodeleg(newvp, 0) == 0 ||
-   (!VOP_GETATTR(newvp, &vattr, cnp->cn_cred)
-   && vattr.va_ctime.tv_sec == VTONFS(newvp)->n_ctime)) {
+   (VOP_GETATTR(newvp, &vattr, cnp->cn_cred) == 0 &&
+   vattr.va_ctime.tv_sec == newnp->n_ctime)) {
NFSINCRGLOBAL(newnfsstats.lookupcache_hits);
if (cnp->cn_nameiop != LOOKUP &&
(flags & ISLASTCN))
@@ -1213,6 +1223,18 @@ nfs_lookup(struct vop_lookup_args *ap)
if (attrflag)
(void) nfscl_loadattrcache(&newvp, &nfsva, NULL, NULL,
0, 1);
+   else if ((flags & (ISLASTCN | ISOPEN)) == (ISLASTCN | ISOPEN) &&
+   !(np->n_flag & NMODIFIED)) {
+   /*
+* Flush the attribute cache when opening a
+* leaf node to ensure that fresh attributes
+* are fetched in nfs_open() since we did not
+* fetch attributes from the LOOKUP reply.
+*/
+   mtx_lock(&np->n_mtx);
+   np->n_attr

svn commit: r210136 - in head/sys: fs/nfsclient nfsclient

2010-07-15 Thread John Baldwin
Author: jhb
Date: Thu Jul 15 19:40:48 2010
New Revision: 210136
URL: http://svn.freebsd.org/changeset/base/210136

Log:
  Retire the NFS access cache timestamp structure.  It was used in VOP_OPEN()
  to avoid sending multiple ACCESS/GETATTR RPCs during a single open()
  between VOP_LOOKUP() and VOP_OPEN().  Now we always send the RPC in
  VOP_LOOKUP() and not VOP_OPEN() in the cases that multiple RPCs could be
  sent.
  
  MFC after:2 weeks

Modified:
  head/sys/fs/nfsclient/nfs_clport.c
  head/sys/fs/nfsclient/nfsnode.h
  head/sys/nfsclient/nfs_subs.c
  head/sys/nfsclient/nfsnode.h

Modified: head/sys/fs/nfsclient/nfs_clport.c
==
--- head/sys/fs/nfsclient/nfs_clport.c  Thu Jul 15 19:21:48 2010
(r210135)
+++ head/sys/fs/nfsclient/nfs_clport.c  Thu Jul 15 19:40:48 2010
(r210136)
@@ -340,7 +340,6 @@ nfscl_loadattrcache(struct vnode **vpp, 
struct nfsnode *np;
struct nfsmount *nmp;
struct timespec mtime_save;
-   struct thread *td = curthread;
 
/*
 * If v_type == VNON it is a new node, so fill in the v_type,
@@ -386,14 +385,6 @@ nfscl_loadattrcache(struct vnode **vpp, 
else
vap->va_fsid = vp->v_mount->mnt_stat.f_fsid.val[0];
np->n_attrstamp = time_second;
-   /* Timestamp the NFS otw getattr fetch */
-   if (td->td_proc) {
-   np->n_ac_ts_tid = td->td_tid;
-   np->n_ac_ts_pid = td->td_proc->p_pid;
-   np->n_ac_ts_syscalls = td->td_syscalls;
-   } else
-   bzero(&np->n_ac_ts, sizeof(struct nfs_attrcache_timestamp));
-   
if (vap->va_size != np->n_size) {
if (vap->va_type == VREG) {
if (dontshrink && vap->va_size < np->n_size) {

Modified: head/sys/fs/nfsclient/nfsnode.h
==
--- head/sys/fs/nfsclient/nfsnode.h Thu Jul 15 19:21:48 2010
(r210135)
+++ head/sys/fs/nfsclient/nfsnode.h Thu Jul 15 19:40:48 2010
(r210136)
@@ -68,16 +68,6 @@ struct nfsdmap {
 #definendm_cookies ndm_un1.ndmu3_cookies
 #definendm4_cookiesndm_un1.ndmu4_cookies
 
-#definen_ac_ts_tid n_ac_ts.nfs_ac_ts_tid
-#definen_ac_ts_pid n_ac_ts.nfs_ac_ts_pid
-#definen_ac_ts_syscallsn_ac_ts.nfs_ac_ts_syscalls
-
-struct nfs_attrcache_timestamp {
-   lwpid_t nfs_ac_ts_tid;
-   pid_t   nfs_ac_ts_pid;
-   unsigned long   nfs_ac_ts_syscalls; 
-};
-
 struct nfs_accesscache {
u_int32_t   mode;   /* ACCESS mode cache */
uid_t   uid;/* credentials having mode */
@@ -132,7 +122,6 @@ struct nfsnode {
u_int32_t   n_flag; /* Flag for locking.. */
int n_directio_opens;
int n_directio_asyncwr;
-   struct nfs_attrcache_timestamp n_ac_ts;
u_int64_tn_change;  /* old Change attribute */
struct nfsv4node*n_v4;  /* extra V4 stuff */
 };

Modified: head/sys/nfsclient/nfs_subs.c
==
--- head/sys/nfsclient/nfs_subs.c   Thu Jul 15 19:21:48 2010
(r210135)
+++ head/sys/nfsclient/nfs_subs.c   Thu Jul 15 19:40:48 2010
(r210136)
@@ -470,7 +470,6 @@ nfs_loadattrcache(struct vnode **vpp, st
u_short vmode;
struct timespec mtime, mtime_save;
int v3 = NFS_ISV3(vp);
-   struct thread *td = curthread;
int error = 0;
 
md = *mdp;
@@ -574,14 +573,6 @@ nfs_loadattrcache(struct vnode **vpp, st
vap->va_filerev = 0;
}
np->n_attrstamp = time_second;
-   /* Timestamp the NFS otw getattr fetch */
-   if (td->td_proc) {
-   np->n_ac_ts_tid = td->td_tid;
-   np->n_ac_ts_pid = td->td_proc->p_pid;
-   np->n_ac_ts_syscalls = td->td_syscalls;
-   } else
-   bzero(&np->n_ac_ts, sizeof(struct nfs_attrcache_timestamp));
-   
if (vap->va_size != np->n_size) {
if (vap->va_type == VREG) {
if (dontshrink && vap->va_size < np->n_size) {

Modified: head/sys/nfsclient/nfsnode.h
==
--- head/sys/nfsclient/nfsnode.hThu Jul 15 19:21:48 2010
(r210135)
+++ head/sys/nfsclient/nfsnode.hThu Jul 15 19:40:48 2010
(r210136)
@@ -74,16 +74,6 @@ struct nfsdmap {
 #define ndm_cookiesndm_un1.ndmu3_cookies
 #define ndm4_cookies   ndm_un1.ndmu4_cookies
 
-#define n_ac_ts_tidn_ac_ts.nfs_ac_ts_tid
-#define n_ac_ts_pidn_ac_ts.nfs_ac_ts_pid
-#define n_ac_ts_syscalls   n_ac_ts.nfs_ac_ts_syscalls
-
-struct nfs_attrcache_timestamp {
-   lwpid_t   

svn commit: r210137 - head/sys/dev/acpica/Osd

2010-07-15 Thread Jung-uk Kim
Author: jkim
Date: Thu Jul 15 19:52:54 2010
New Revision: 210137
URL: http://svn.freebsd.org/changeset/base/210137

Log:
  - AcpiOsReadPciConfiguration() needs similar fixes as r209965 and r210129.
  According to ACPICA User Guide and Programmer Reference, the read data must
  be zero extended to fill the 64-bit return value even if the bit width of
  the location is less than 64.
  - Return error when 64-bit access is requested as we do not support 64-bit
  PCI register access (yet).  XXX We may have to split it up into two 32-bit
  accesses if it is really required.

Modified:
  head/sys/dev/acpica/Osd/OsdHardware.c

Modified: head/sys/dev/acpica/Osd/OsdHardware.c
==
--- head/sys/dev/acpica/Osd/OsdHardware.c   Thu Jul 15 19:40:48 2010
(r210136)
+++ head/sys/dev/acpica/Osd/OsdHardware.c   Thu Jul 15 19:52:54 2010
(r210137)
@@ -79,9 +79,6 @@ AcpiOsReadPort(ACPI_IO_ADDRESS InPort, U
 case 32:
*Value = bus_space_read_4(ACPI_BUS_SPACE_IO, ACPI_BUS_HANDLE, InPort);
break;
-default:
-   /* debug trap goes here */
-   break;
 }
 
 return (AE_OK);
@@ -101,9 +98,6 @@ AcpiOsWritePort(ACPI_IO_ADDRESS OutPort,
 case 32:
bus_space_write_4(ACPI_BUS_SPACE_IO, ACPI_BUS_HANDLE, OutPort, Value);
break;
-default:
-   /* debug trap goes here */
-   break;
 }
 
 return (AE_OK);
@@ -113,28 +107,15 @@ ACPI_STATUS
 AcpiOsReadPciConfiguration(ACPI_PCI_ID *PciId, UINT32 Register, void *Value,
 UINT32 Width)
 {
-u_int32_t  byte_width = Width / 8;
-u_int32_t  val;
+
+if (Width == 64)
+   return (AE_SUPPORT);
 
 if (!pci_cfgregopen())
return (AE_NOT_EXIST);
 
-val = pci_cfgregread(PciId->Bus, PciId->Device, PciId->Function, Register,
-   byte_width);
-switch (Width) {
-case 8:
-   *(u_int8_t *)Value = val & 0xff;
-   break;
-case 16:
-   *(u_int16_t *)Value = val & 0x;
-   break;
-case 32:
-   *(u_int32_t *)Value = val;
-   break;
-default:
-   /* debug trap goes here */
-   break;
-}
+*(UINT64 *)Value = pci_cfgregread(PciId->Bus, PciId->Device,
+   PciId->Function, Register, Width / 8);
 
 return (AE_OK);
 }
@@ -144,13 +125,15 @@ ACPI_STATUS
 AcpiOsWritePciConfiguration (ACPI_PCI_ID *PciId, UINT32 Register,
 UINT64 Value, UINT32 Width)
 {
-u_int32_t  byte_width = Width / 8;
+
+if (Width == 64)
+   return (AE_SUPPORT);
 
 if (!pci_cfgregopen())
return (AE_NOT_EXIST);
 
 pci_cfgregwrite(PciId->Bus, PciId->Device, PciId->Function, Register,
-   Value, byte_width);
+   Value, Width / 8);
 
 return (AE_OK);
 }
___
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: r210138 - in head/sys: kern sys

2010-07-15 Thread John Baldwin
Author: jhb
Date: Thu Jul 15 20:24:37 2010
New Revision: 210138
URL: http://svn.freebsd.org/changeset/base/210138

Log:
  Retire td_syscalls now that it is no longer needed.

Modified:
  head/sys/kern/kern_thread.c
  head/sys/kern/subr_trap.c
  head/sys/sys/proc.h

Modified: head/sys/kern/kern_thread.c
==
--- head/sys/kern/kern_thread.c Thu Jul 15 19:52:54 2010(r210137)
+++ head/sys/kern/kern_thread.c Thu Jul 15 20:24:37 2010(r210138)
@@ -96,7 +96,6 @@ thread_ctor(void *mem, int size, void *a
td->td_oncpu = NOCPU;
 
td->td_tid = alloc_unr(tid_unrhdr);
-   td->td_syscalls = 0;
 
/*
 * Note that td_critnest begins life as 1 because the thread is not

Modified: head/sys/kern/subr_trap.c
==
--- head/sys/kern/subr_trap.c   Thu Jul 15 19:52:54 2010(r210137)
+++ head/sys/kern/subr_trap.c   Thu Jul 15 20:24:37 2010(r210138)
@@ -261,7 +261,6 @@ syscallenter(struct thread *td, struct s
 
PCPU_INC(cnt.v_syscall);
p = td->td_proc;
-   td->td_syscalls++;
 
td->td_pticks = 0;
if (td->td_ucred != p->p_ucred)

Modified: head/sys/sys/proc.h
==
--- head/sys/sys/proc.h Thu Jul 15 19:52:54 2010(r210137)
+++ head/sys/sys/proc.h Thu Jul 15 20:24:37 2010(r210138)
@@ -296,7 +296,6 @@ struct thread {
struct mdthread td_md;  /* (k) Any machine-dependent fields. */
struct td_sched *td_sched;  /* (*) Scheduler-specific data. */
struct kaudit_record*td_ar; /* (k) Active audit record, if any. */
-   int td_syscalls;/* per-thread syscall count (used by 
NFS :)) */
struct lpohead  td_lprof[2];/* (a) lock profiling objects. */
struct kdtrace_thread   *td_dtrace; /* (*) DTrace-specific data. */
int td_errno;   /* Error returned by last syscall. */
___
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: r210142 - head/sys/mips/include

2010-07-15 Thread Warner Losh
Author: imp
Date: Thu Jul 15 21:56:45 2010
New Revision: 210142
URL: http://svn.freebsd.org/changeset/base/210142

Log:
  Better description of this file

Modified:
  head/sys/mips/include/asmacros.h

Modified: head/sys/mips/include/asmacros.h
==
--- head/sys/mips/include/asmacros.hThu Jul 15 21:49:28 2010
(r210141)
+++ head/sys/mips/include/asmacros.hThu Jul 15 21:56:45 2010
(r210142)
@@ -34,8 +34,11 @@
 
 #include 
 
+/*
+ * This appears to be a verbatim copy of an old version of amd64's
+ * asmacros.h and has no prayer of acatually working on mips.
+ */
 #if 0
-/* XXX too much duplication in various asm*.h's. */
 
 /*
  * CNAME and HIDENAME manage the relationship between symbol names in C
___
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: r210144 - head/usr.sbin/config

2010-07-15 Thread Warner Losh
Author: imp
Date: Thu Jul 15 22:28:19 2010
New Revision: 210144
URL: http://svn.freebsd.org/changeset/base/210144

Log:
  Put warnings out to stderr rather than stdout.
  
  MFC after:3 days

Modified:
  head/usr.sbin/config/config.y
  head/usr.sbin/config/mkmakefile.c
  head/usr.sbin/config/mkoptions.c

Modified: head/usr.sbin/config/config.y
==
--- head/usr.sbin/config/config.y   Thu Jul 15 22:15:44 2010
(r210143)
+++ head/usr.sbin/config/config.y   Thu Jul 15 22:28:19 2010
(r210144)
@@ -365,7 +365,8 @@ newdev(char *name)
struct device *np;
 
if (finddev(&dtab, name)) {
-   printf("WARNING: duplicate device `%s' encountered.\n", name);
+   fprintf(stderr,
+   "WARNING: duplicate device `%s' encountered.\n", name);
return;
}
 
@@ -425,7 +426,8 @@ newopt(struct opt_head *list, char *name
 
op2 = findopt(list, name);
if (op2 != NULL && !append) {
-   printf("WARNING: duplicate option `%s' encountered.\n", name);
+   fprintf(stderr,
+   "WARNING: duplicate option `%s' encountered.\n", name);
return;
}
 

Modified: head/usr.sbin/config/mkmakefile.c
==
--- head/usr.sbin/config/mkmakefile.c   Thu Jul 15 22:15:44 2010
(r210143)
+++ head/usr.sbin/config/mkmakefile.c   Thu Jul 15 22:28:19 2010
(r210144)
@@ -341,7 +341,8 @@ next:
if (eq(wd, "include")) {
next_quoted_word(fp, wd);
if (wd == 0) {
-   printf("%s: missing include filename.\n", fname);
+   fprintf(stderr, "%s: missing include filename.\n",
+   fname);
exit(1);
}
(void) snprintf(ifname, sizeof(ifname), "../../%s", wd);
@@ -353,8 +354,7 @@ next:
this = ns(wd);
next_word(fp, wd);
if (wd == 0) {
-   printf("%s: No type for %s.\n",
-   fname, this);
+   fprintf(stderr, "%s: No type for %s.\n", fname, this);
exit(1);
}
tp = fl_lookup(this);
@@ -381,8 +381,9 @@ next:
} else if (eq(wd, "mandatory")) {
mandatory = 1;
} else if (!eq(wd, "optional")) {
-   printf("%s: %s must be optional, mandatory or standard\n",
-  fname, this);
+   fprintf(stderr,
+   "%s: %s must be optional, mandatory or standard\n",
+   fname, this);
exit(1);
}
 nextparam:
@@ -395,7 +396,7 @@ nextparam:
}
if (eq(wd, "|")) {
if (nreqs == 0) {
-   printf("%s: syntax error describing %s\n",
+   fprintf(stderr, "%s: syntax error describing %s\n",
fname, this);
exit(1);
}
@@ -410,9 +411,9 @@ nextparam:
}
if (eq(wd, "no-implicit-rule")) {
if (compilewith == 0) {
-   printf("%s: alternate rule required when "
-  "\"no-implicit-rule\" is specified.\n",
-  fname);
+   fprintf(stderr, "%s: alternate rule required when "
+   "\"no-implicit-rule\" is specified.\n",
+   fname);
}
imp_rule++;
goto nextparam;
@@ -424,8 +425,9 @@ nextparam:
if (eq(wd, "dependency")) {
next_quoted_word(fp, wd);
if (wd == 0) {
-   printf("%s: %s missing compile command string.\n",
-  fname, this);
+   fprintf(stderr,
+   "%s: %s missing compile command string.\n",
+   fname, this);
exit(1);
}
depends = ns(wd);
@@ -434,8 +436,8 @@ nextparam:
if (eq(wd, "clean")) {
next_quoted_word(fp, wd);
if (wd == 0) {
-   printf("%s: %s missing clean file list.\n",
-  fname, this);
+   fprintf(stderr, "%s: %s missing clean file list.\n",
+   fname, this);
exit(1);
}
clean = ns(wd);
@@ -444,8 +446,9 @@ nextparam:
if (eq(wd, "compile-with")) {
next_quoted_word(fp, wd);
if (wd == 0) {
-   printf("%s: %s missing compile command string.\n",
-  fname, this);
+   fprintf(stderr,
+   "%s: %s missing compile command string.\n",
+

svn commit: r210145 - stable/8/usr.sbin/config

2010-07-15 Thread Warner Losh
Author: imp
Date: Thu Jul 15 22:34:30 2010
New Revision: 210145
URL: http://svn.freebsd.org/changeset/base/210145

Log:
  MFC: r209135
  r209135 | imp | 2010-06-13 10:54:11 -0600 (Sun, 13 Jun 2010) | 9 lines
  
  style(9) fixes:
  
  o make cmd scoped to the whole do_rules function, since it really is
scoped to the whole fucnion.  Making it static was the wrong way to
fix referencing it outside of the block in which it was declared
(and conforms to the style of the rest of the file).
  o remove a couple of meaningless blank lines
  o properly wrap one line.

Modified:
  stable/8/usr.sbin/config/mkmakefile.c
Directory Properties:
  stable/8/usr.sbin/config/   (props changed)

Modified: stable/8/usr.sbin/config/mkmakefile.c
==
--- stable/8/usr.sbin/config/mkmakefile.c   Thu Jul 15 22:28:19 2010
(r210144)
+++ stable/8/usr.sbin/config/mkmakefile.c   Thu Jul 15 22:34:30 2010
(r210145)
@@ -683,6 +683,7 @@ do_rules(FILE *f)
char *cp, *np, och;
struct file_list *ftp;
char *compilewith;
+   char cmd[128];
 
STAILQ_FOREACH(ftp, &ftab, f_next) {
if (ftp->f_warn)
@@ -720,25 +721,24 @@ do_rules(FILE *f)
compilewith = ftp->f_compilewith;
if (compilewith == 0) {
const char *ftype = NULL;
-   static char cmd[128];
 
switch (ftp->f_type) {
-
case NORMAL:
ftype = "NORMAL";
break;
-
case PROFILING:
if (!profiling)
continue;
ftype = "PROFILE";
break;
-
default:
printf("config: don't know rules for %s\n", np);
break;
}
-   snprintf(cmd, sizeof(cmd), "${%s_%c%s}\n.if 
defined(NORMAL_CTFCONVERT) && 
!empty(NORMAL_CTFCONVERT)\n\t${NORMAL_CTFCONVERT}\n.endif", ftype,
+   snprintf(cmd, sizeof(cmd),
+   "${%s_%c%s}\n.if defined(NORMAL_CTFCONVERT) && "
+   "!empty(NORMAL_CTFCONVERT)\n"
+   "\t${NORMAL_CTFCONVERT}\n.endif", ftype,
toupper(och),
ftp->f_flags & NOWERROR ? "_NOWERROR" : "");
compilewith = cmd;
___
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: r210146 - stable/8/usr.sbin/config

2010-07-15 Thread Warner Losh
Author: imp
Date: Thu Jul 15 22:35:50 2010
New Revision: 210146
URL: http://svn.freebsd.org/changeset/base/210146

Log:
  MFC: r209969
  
  r209969 | nwhitehorn | 2010-07-12 22:08:08 -0600 (Mon, 12 Jul 2010) | 13 lines
  
  Enhance config to handle MACHINEs with multiple architectures:
  
  - Passing -m to config will now print the MACHINE and MACHINE_ARCH
given in the passed kernel configuration file and then exit.
  - If an option is defined in options.MACHINE with the same name as the
architecture of the kernel being configured, that option will be
considered set. This allows conditional compilation based on CPU
architecture.
  
  Config version is now 600010.
  
  Reviewed by:imp

Modified:
  stable/8/usr.sbin/config/config.8
  stable/8/usr.sbin/config/configvers.h
  stable/8/usr.sbin/config/main.c
  stable/8/usr.sbin/config/mkoptions.c
Directory Properties:
  stable/8/usr.sbin/config/   (props changed)

Modified: stable/8/usr.sbin/config/config.8
==
--- stable/8/usr.sbin/config/config.8   Thu Jul 15 22:34:30 2010
(r210145)
+++ stable/8/usr.sbin/config/config.8   Thu Jul 15 22:35:50 2010
(r210146)
@@ -78,6 +78,9 @@ Note that
 does not append
 .Ar SYSTEM_NAME
 to the directory given.
+.It Fl m
+Print the MACHINE and MACHINE_ARCH values for this
+kernel and exit.
 .It Fl g
 Configure a system for debugging.
 .It Fl x Ar kernel

Modified: stable/8/usr.sbin/config/configvers.h
==
--- stable/8/usr.sbin/config/configvers.h   Thu Jul 15 22:34:30 2010
(r210145)
+++ stable/8/usr.sbin/config/configvers.h   Thu Jul 15 22:35:50 2010
(r210146)
@@ -49,5 +49,5 @@
  *
  * $FreeBSD$
  */
-#defineCONFIGVERS  69
+#defineCONFIGVERS  600010
 #defineMAJOR_VERS(x)   ((x) / 10)

Modified: stable/8/usr.sbin/config/main.c
==
--- stable/8/usr.sbin/config/main.c Thu Jul 15 22:34:30 2010
(r210145)
+++ stable/8/usr.sbin/config/main.c Thu Jul 15 22:35:50 2010
(r210146)
@@ -110,13 +110,18 @@ main(int argc, char **argv)
char *p;
char xxx[MAXPATHLEN];
char *kernfile;
+   int printmachine;
 
+   printmachine = 0;
kernfile = NULL;
-   while ((ch = getopt(argc, argv, "Cd:gpVx:")) != -1)
+   while ((ch = getopt(argc, argv, "Cd:gmpVx:")) != -1)
switch (ch) {
case 'C':
filebased = 1;
break;
+   case 'm':
+   printmachine = 1;
+   break;
case 'd':
if (*destdir == '\0')
strlcpy(destdir, optarg, sizeof(destdir));
@@ -171,13 +176,6 @@ main(int argc, char **argv)
strlcat(destdir, PREFIX, sizeof(destdir));
}
 
-   p = path((char *)NULL);
-   if (stat(p, &buf)) {
-   if (mkdir(p, 0777))
-   err(2, "%s", p);
-   } else if (!S_ISDIR(buf.st_mode))
-   errx(EXIT_FAILURE, "%s isn't a directory", p);
-
SLIST_INIT(&cputype);
SLIST_INIT(&mkopt);
SLIST_INIT(&opt);
@@ -207,6 +205,19 @@ main(int argc, char **argv)
}
checkversion();
 
+   if (printmachine) {
+   printf("%s\t%s\n",machinename,machinearch);
+   exit(0);
+   }
+
+   /* Make compile directory */
+   p = path((char *)NULL);
+   if (stat(p, &buf)) {
+   if (mkdir(p, 0777))
+   err(2, "%s", p);
+   } else if (!S_ISDIR(buf.st_mode))
+   errx(EXIT_FAILURE, "%s isn't a directory", p);
+
/*
 * make symbolic links in compilation directory
 * for "sys" (to make genassym.c work along with #include )
@@ -280,7 +291,7 @@ static void
 usage(void)
 {
 
-   fprintf(stderr, "usage: config [-CgpV] [-d destdir] sysname\n");
+   fprintf(stderr, "usage: config [-CgmpV] [-d destdir] sysname\n");
fprintf(stderr, "   config -x kernel\n");
exit(EX_USAGE);
 }

Modified: stable/8/usr.sbin/config/mkoptions.c
==
--- stable/8/usr.sbin/config/mkoptions.cThu Jul 15 22:34:30 2010
(r210145)
+++ stable/8/usr.sbin/config/mkoptions.cThu Jul 15 22:35:50 2010
(r210146)
@@ -94,6 +94,20 @@ options(void)
SLIST_INSERT_HEAD(&opt, op, op_next);
 
read_options();
+
+   /* Fake the value of MACHINE_ARCH as an option if necessary */
+   SLIST_FOREACH(ol, &otab, o_next) {
+   if (strcasecmp(ol->o_name, machinearch) != 0)
+   continue;
+
+   op = (struct opt *)calloc(1, sizeof(*op));
+   if (op == NULL)
+