Re: svn commit: r242835 - head/contrib/llvm/lib/Target/X86

2012-11-12 Thread Bruce Evans

On Mon, 12 Nov 2012, Bruce Evans wrote:


On Sun, 11 Nov 2012, Dimitry Andric wrote:



It works just fine now with clang.  For the first example, I get:

   pushl   %ebp
   movl%esp, %ebp
   andl$-32, %esp

as prolog, and for the second:

   pushl   %ebp
   movl%esp, %ebp
   andl$-16, %esp


Good.

The andl executes very fast.  Perhaps not as fast as subl on %esp,
because subl is normal so more likely to be optimized (they nominally
have the same speeds, but %esp is magic).  Unfortunately, it seems to
be impossible to both align the stack and reserve some space on it in
1 instruction -- the andl might not reserve any.


I lost kib's reply to this.  He said something agreeeing about %esp
being magic on Intel CPUs starting with PentiumPro.

The following quick test shows no problems on Xeon 5650 (freefall) or
Athlon64:

@ asm("\n\
@ .globl main   \n\
@ main: \n\
@   movl$266681734,%eax \n\
@   # movl  $201017002,%eax \n\
@ 1:\n\
@   callfoo1\n\
@   decl%eax\n\
@   jne 1b  \n\
@   ret \n\
@   \n\
@ foo1: \n\
@   pushl   %ebp\n\
@   movl%esp,%ebp   \n\
@   andl$-16,%esp   \n\
@   callfoo2\n\
@   movl%ebp,%esp   \n\
@   popl%ebp\n\
@   ret \n\
@   \n\
@ foo2: \n\
@   pushl   %ebp\n\
@   movl%esp,%ebp   \n\
@   andl$-16,%esp   \n\
@   callfoo3\n\
@   movl%ebp,%esp   \n\
@   popl%ebp\n\
@   ret \n\
@   \n\
@ foo3: \n\
@   pushl   %ebp\n\
@   movl%esp,%ebp   \n\
@   andl$-16,%esp   \n\
@   callfoo4\n\
@   movl%ebp,%esp   \n\
@   popl%ebp\n\
@   ret \n\
@   \n\
@ foo4: \n\
@   pushl   %ebp\n\
@   movl%esp,%ebp   \n\
@   andl$-16,%esp   \n\
@   callfoo5\n\
@   movl%ebp,%esp   \n\
@   popl%ebp\n\
@   ret \n\
@   \n\
@ foo5: \n\
@   pushl   %ebp\n\
@   movl%esp,%ebp   \n\
@   andl$-16,%esp   \n\
@   callfoo6\n\
@   movl%ebp,%esp   \n\
@   popl%ebp\n\
@   ret \n\
@   \n\
@ foo6: \n\
@   pushl   %ebp\n\
@   movl%esp,%ebp   \n\
@   andl$-16,%esp   \n\
@   callfoo7\n\
@   movl%ebp,%esp   \n\
@   popl%ebp\n\
@   ret \n\
@   \n\
@ foo7: \n\
@   pushl   %ebp\n\
@   movl%esp,%ebp   \n\
@   andl$-16,%esp   \n\
@   callfoo8\n\
@   movl%ebp,%esp   \n\
@   popl%ebp\n\
@   ret \n\
@   \n\
@ foo8: \n\
@   pushl   %ebp\n\
@   movl%esp,%ebp   \n\
@   andl$-16,%esp   \n\
@   # call  foo9\n\
@   movl%ebp,%esp   \n\
@   popl%ebp\n\
@   ret \n\
@ ");

Build this on an i386 system so that it is 32-bit mode.

This takes 56-57 cycles/iteration on Athlon64 and 50-51 cycles/iteration
on X6560.  Changing the andls to subls of 16 doesn't change this.
Removing all the andls and subls doesn't change this on Athlon64, but
on X6560 it is 4-5 cycles faster.  This shows that the gcc pessimization
is largest on X6560 :-).  Adding "pushl %eax; popl %eax" before the
calls to foo[2-8] adds 35-36 cycles/iteration on Athlon64 but only 6-7
on X6560.  I know some Athlons 

svn commit: r242918 - head/usr.bin/ssh-copy-id

2012-11-12 Thread Eitan Adler
Author: eadler
Date: Mon Nov 12 14:16:39 2012
New Revision: 242918
URL: http://svnweb.freebsd.org/changeset/base/242918

Log:
  Clarify where the authorized_key file lives.
  
  Approved by:  bcr (mentor)
  MFC after:3 days

Modified:
  head/usr.bin/ssh-copy-id/ssh-copy-id.1

Modified: head/usr.bin/ssh-copy-id/ssh-copy-id.1
==
--- head/usr.bin/ssh-copy-id/ssh-copy-id.1  Mon Nov 12 14:14:01 2012
(r242917)
+++ head/usr.bin/ssh-copy-id/ssh-copy-id.1  Mon Nov 12 14:16:39 2012
(r242918)
@@ -42,8 +42,8 @@
 The
 .Nm
 utility copies public keys to a remote host's
-.Pa authorized_keys
-file.
+.Pa ~/.ssh/authorized_keys
+file (creating the file and directory, if required).
 .Pp
 The following options are available:
 .Bl -tag -width indent
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


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

2012-11-12 Thread Sean Bruno
Author: sbruno
Date: Mon Nov 12 18:09:25 2012
New Revision: 242922
URL: http://svnweb.freebsd.org/changeset/base/242922

Log:
  Update MAX_TASKS to scale a bit based on MAXCPU
  
  This alleviates issues on newer Sandy/Ivy Bridge gear that seems to require
  boatloads more ACPI resources than before.
  
  Reviewed by:  avg@
  Obtained from:Yahoo! Inc.
  MFC after:2 weeks

Modified:
  head/sys/dev/acpica/acpivar.h

Modified: head/sys/dev/acpica/acpivar.h
==
--- head/sys/dev/acpica/acpivar.h   Mon Nov 12 15:17:25 2012
(r242921)
+++ head/sys/dev/acpica/acpivar.h   Mon Nov 12 18:09:25 2012
(r242922)
@@ -476,7 +476,7 @@ ACPI_HANDLE acpi_GetReference(ACPI_HANDL
 
 /* Default maximum number of tasks to enqueue. */
 #ifndef ACPI_MAX_TASKS
-#defineACPI_MAX_TASKS  32
+#defineACPI_MAX_TASKS  MAX(32, MAXCPU * 2)
 #endif
 
 /* Default number of task queue threads to start. */
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r242923 - head/sys/boot/forth

2012-11-12 Thread Devin Teske
Author: dteske
Date: Mon Nov 12 18:38:54 2012
New Revision: 242923
URL: http://svnweb.freebsd.org/changeset/base/242923

Log:
  Fix a stack leak in [unused] cycle_menuitem function while we're here
  (required misconfiguration and/or missing environment vars to occur).
  
  Reviewed by:  peterj, adrian (co-mentor)
  Approved by:  adrian (co-mentor)

Modified:
  head/sys/boot/forth/menu.4th

Modified: head/sys/boot/forth/menu.4th
==
--- head/sys/boot/forth/menu.4thMon Nov 12 18:09:25 2012
(r242922)
+++ head/sys/boot/forth/menu.4thMon Nov 12 18:38:54 2012
(r242923)
@@ -342,6 +342,7 @@ create init_text8 255 allot
\ sure that things move along smoothly, allocate
\ a temporary NULL string
 
+   drop ( getenv cruft )
s" "
then
then
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r242924 - head/sys/ufs/ffs

2012-11-12 Thread Jeff Roberson
Author: jeff
Date: Mon Nov 12 19:53:55 2012
New Revision: 242924
URL: http://svnweb.freebsd.org/changeset/base/242924

Log:
   - Fix a bug that has existed since the original softdep implementation.
 When a background copy of a cg is written we complete any work associated
 with that bmsafemap.  If new work has been added to the non-background
 copy of the buffer it will be completed before the next write happens.
 The solution is to do the rollbacks when we make the copy so only those
 dependencies that were present at the time of writing will be completed
 when the background write completes.  This would've resulted in various
 bitmap related corruptions and panics.  It also would've expired journal
 entries early causing journal replay to miss some records.
  
  MFC after:2 weeks

Modified:
  head/sys/ufs/ffs/ffs_softdep.c

Modified: head/sys/ufs/ffs/ffs_softdep.c
==
--- head/sys/ufs/ffs/ffs_softdep.c  Mon Nov 12 18:38:54 2012
(r242923)
+++ head/sys/ufs/ffs/ffs_softdep.c  Mon Nov 12 19:53:55 2012
(r242924)
@@ -977,7 +977,7 @@ static  struct freework *newfreework(stru
struct freework *, ufs_lbn_t, ufs2_daddr_t, int, int, int);
 static int jwait(struct worklist *, int);
 static struct inodedep *inodedep_lookup_ip(struct inode *);
-static int bmsafemap_rollbacks(struct bmsafemap *);
+static int bmsafemap_backgroundwrite(struct bmsafemap *, struct buf *);
 static struct freefile *handle_bufwait(struct inodedep *, struct workhead *);
 static void handle_jwork(struct workhead *);
 static struct mkdir *setup_newdir(struct diradd *, ino_t, ino_t, struct buf *,
@@ -1795,7 +1795,7 @@ softdep_move_dependencies(oldbp, newbp)
while ((wk = LIST_FIRST(&oldbp->b_dep)) != NULL) {
LIST_REMOVE(wk, wk_list);
if (wk->wk_type == D_BMSAFEMAP &&
-   bmsafemap_rollbacks(WK_BMSAFEMAP(wk)))
+   bmsafemap_backgroundwrite(WK_BMSAFEMAP(wk), newbp))
dirty = 1;
if (wktail == 0)
LIST_INSERT_HEAD(&newbp->b_dep, wk, wk_list);
@@ -5173,9 +5173,15 @@ jnewblk_merge(new, old, wkhd)
return (new);
/* Replace a jfreefrag with a jnewblk. */
if (new->wk_type == D_JFREEFRAG) {
+   if (WK_JNEWBLK(old)->jn_blkno != WK_JFREEFRAG(new)->fr_blkno)
+   panic("jnewblk_merge: blkno mismatch: %p, %p",
+   old, new);
cancel_jfreefrag(WK_JFREEFRAG(new));
return (old);
}
+   if (old->wk_type != D_JNEWBLK || new->wk_type != D_JNEWBLK)
+   panic("jnewblk_merge: Bad type: old %d new %d\n",
+   old->wk_type, new->wk_type);
/*
 * Handle merging of two jnewblk records that describe
 * different sets of fragments in the same block.
@@ -10504,7 +10510,7 @@ initiate_write_bmsafemap(bmsafemap, bp)
ino_t ino;
 
if (bmsafemap->sm_state & IOSTARTED)
-   panic("initiate_write_bmsafemap: Already started\n");
+   return;
bmsafemap->sm_state |= IOSTARTED;
/*
 * Clear any inode allocations which are pending journal writes.
@@ -10515,10 +10521,6 @@ initiate_write_bmsafemap(bmsafemap, bp)
inosused = cg_inosused(cgp);
LIST_FOREACH(jaddref, &bmsafemap->sm_jaddrefhd, ja_bmdeps) {
ino = jaddref->ja_ino % fs->fs_ipg;
-   /*
-* If this is a background copy the inode may not
-* be marked used yet.
-*/
if (isset(inosused, ino)) {
if ((jaddref->ja_mode & IFMT) == IFDIR)
cgp->cg_cs.cs_ndir--;
@@ -10527,7 +10529,7 @@ initiate_write_bmsafemap(bmsafemap, bp)
jaddref->ja_state &= ~ATTACHED;
jaddref->ja_state |= UNDONE;
stat_jaddref++;
-   } else if ((bp->b_xflags & BX_BKGRDMARKER) == 0)
+   } else
panic("initiate_write_bmsafemap: inode %ju "
"marked free", (uintmax_t)jaddref->ja_ino);
}
@@ -10542,9 +10544,8 @@ initiate_write_bmsafemap(bmsafemap, bp)
LIST_FOREACH(jnewblk, &bmsafemap->sm_jnewblkhd, jn_deps) {
if (jnewblk_rollback(jnewblk, fs, cgp, blksfree))
continue;
-   if ((bp->b_xflags & BX_BKGRDMARKER) == 0)
-   panic("initiate_write_bmsafemap: block %jd "
-   "marked free", jnewblk->jn_blkno);
+   panic("initiate_write_bmsafemap: block %jd 

svn commit: r242927 - head/contrib/tzdata

2012-11-12 Thread Edwin Groothuis
Author: edwin
Date: Mon Nov 12 20:44:59 2012
New Revision: 242927
URL: http://svnweb.freebsd.org/changeset/base/242927

Log:
  Merge of vendor import of 242925, tzdata2012i
  
  Update to tzdata2012i:
  - Cuba is changing back to Standard Time on 4 November 2012.

Modified:
  head/contrib/tzdata/asia
  head/contrib/tzdata/northamerica
Directory Properties:
  head/contrib/tzdata/   (props changed)

Modified: head/contrib/tzdata/asia
==
--- head/contrib/tzdata/asiaMon Nov 12 20:42:08 2012(r242926)
+++ head/contrib/tzdata/asiaMon Nov 12 20:44:59 2012(r242927)
@@ -1204,7 +1204,7 @@ Rule  Zion2012only-   Sep 23  
2:000   S
 # past, approved sending the proposed June 2011 changes to the Time
 # Decree Law back to the Knesset for second and third (final) votes
 # before the upcoming elections on Jan. 22, 2013.  Hence, although the
-# changes are not yet law, they are expected to be so before Februray 2013.
+# changes are not yet law, they are expected to be so before February 2013.
 #
 # As of 2013, DST starts at 02:00 on the Friday before the last Sunday in 
March.
 # DST ends at 02:00 on the first Sunday after October 1, unless it occurs on 
the

Modified: head/contrib/tzdata/northamerica
==
--- head/contrib/tzdata/northamericaMon Nov 12 20:42:08 2012
(r242926)
+++ head/contrib/tzdata/northamericaMon Nov 12 20:44:59 2012
(r242927)
@@ -2797,6 +2797,13 @@ Zone America/Costa_Rica  -5:36:20 -  LMT 1
 # http://www.timeanddate.com/news/time/cuba-starts-dst-2012.html
 # 
 
+# From Steffen Thorsen (2012-11-03):
+# Radio Reloj and many other sources report that Cuba is changing back
+# to standard time on 2012-11-04:
+# 
http://www.radioreloj.cu/index.php/noticias-radio-reloj/36-nacionales/9961-regira-horario-normal-en-cuba-desde-el-domingo-cuatro-de-noviembre
+# From Paul Eggert (2012-11-03):
+# For now, assume the future rule is first Sunday in November.
+
 # Rule NAMEFROMTO  TYPEIN  ON  AT  SAVELETTER/S
 Rule   Cuba1928only-   Jun 10  0:001:00D
 Rule   Cuba1928only-   Oct 10  0:000   S
@@ -2834,7 +2841,7 @@ Rule  Cuba20092010-   Mar Sun>=8  
0:00s   1
 Rule   Cuba2011only-   Mar Sun>=15 0:00s   1:00D
 Rule   Cuba2011only-   Nov 13  0:00s   0   S
 Rule   Cuba2012only-   Apr 1   0:00s   1:00D
-Rule   Cuba2012max -   Oct lastSun 0:00s   0   S
+Rule   Cuba2012max -   Nov Sun>=1  0:00s   0   S
 Rule   Cuba2013max -   Mar Sun>=8  0:00s   1:00D
 
 # Zone NAMEGMTOFF  RULES   FORMAT  [UNTIL]
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r242931 - head/sys/i386/xen

2012-11-12 Thread Dimitry Andric
Author: dim
Date: Mon Nov 12 20:50:11 2012
New Revision: 242931
URL: http://svnweb.freebsd.org/changeset/base/242931

Log:
  Fix a minor warning in sys/i386/xen/clock.c.
  
  MFC after:3 days

Modified:
  head/sys/i386/xen/clock.c

Modified: head/sys/i386/xen/clock.c
==
--- head/sys/i386/xen/clock.c   Mon Nov 12 20:48:52 2012(r242930)
+++ head/sys/i386/xen/clock.c   Mon Nov 12 20:50:11 2012(r242931)
@@ -516,7 +516,7 @@ startrtclock()
__cpu_khz = 100ULL << 32;
info = &HYPERVISOR_shared_info->vcpu_info[0].time;
 
-   do_div(__cpu_khz, info->tsc_to_system_mul);
+   (void)do_div(__cpu_khz, info->tsc_to_system_mul);
if ( info->tsc_shift < 0 )
cpu_khz = __cpu_khz << -info->tsc_shift;
else
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r242933 - in head/sys: conf modules/mthca ofed/drivers/infiniband/core ofed/drivers/infiniband/ulp/sdp ofed/include/linux

2012-11-12 Thread Dimitry Andric
Author: dim
Date: Mon Nov 12 22:01:29 2012
New Revision: 242933
URL: http://svnweb.freebsd.org/changeset/base/242933

Log:
  Redo r242842, now actually fixing the warnings, as follows:
  - In sys/ofed/drivers/infiniband/core/cma.c, an enum struct member is
interpreted as an int, so cast it to an int.
  - In sys/ofed/drivers/infiniband/core/ud_header.c, initialize the
packet_length variable in ib_ud_header_init(), to prevent undefined
behaviour.
  - In sys/ofed/drivers/infiniband/ulp/sdp/sdp_rx.c, call rdma_notify()
with the correct enum type and value.
  - In sys/ofed/include/linux/pci.h, change the PCI_DEVICE and PCI_VDEVICE
macros to use C99 struct initializers, so additional members can be
overridden.
  
  Reviewed by:  delphij, Garrett Cooper 
  MFC after:1 week

Modified:
  head/sys/conf/kern.pre.mk
  head/sys/modules/mthca/Makefile
  head/sys/ofed/drivers/infiniband/core/cma.c
  head/sys/ofed/drivers/infiniband/core/ud_header.c
  head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_rx.c
  head/sys/ofed/include/linux/pci.h

Modified: head/sys/conf/kern.pre.mk
==
--- head/sys/conf/kern.pre.mk   Mon Nov 12 20:50:15 2012(r242932)
+++ head/sys/conf/kern.pre.mk   Mon Nov 12 22:01:29 2012(r242933)
@@ -156,7 +156,7 @@ NORMAL_LINT=${LINT} ${LINTFLAGS} ${CFLA
 # Infiniband C flags.  Correct include paths and omit errors that linux
 # does not honor.
 OFEDINCLUDES=  -I$S/ofed/include/
-OFEDNOERR= -Wno-cast-qual -Wno-pointer-arith -fms-extensions -Wno-switch 
-Wno-sometimes-uninitialized -Wno-conversion -Wno-initializer-overrides
+OFEDNOERR= -Wno-cast-qual -Wno-pointer-arith -fms-extensions
 OFEDCFLAGS=${CFLAGS:N-I*} ${OFEDINCLUDES} ${CFLAGS:M-I*} ${OFEDNOERR}
 OFED_C_NOIMP=  ${CC} -c -o ${.TARGET} ${OFEDCFLAGS} ${WERROR} ${PROF}
 OFED_C=${OFED_C_NOIMP} ${.IMPSRC}

Modified: head/sys/modules/mthca/Makefile
==
--- head/sys/modules/mthca/Makefile Mon Nov 12 20:50:15 2012
(r242932)
+++ head/sys/modules/mthca/Makefile Mon Nov 12 22:01:29 2012
(r242933)
@@ -28,4 +28,4 @@ opt_inet6.h:
 
 .include 
 
-CFLAGS+= -Wno-cast-qual -Wno-pointer-arith -fms-extensions  -Wno-switch 
-Wno-sometimes-uninitialized -Wno-conversion -Wno-initializer-overrides
+CFLAGS+= -Wno-cast-qual -Wno-pointer-arith -fms-extensions

Modified: head/sys/ofed/drivers/infiniband/core/cma.c
==
--- head/sys/ofed/drivers/infiniband/core/cma.c Mon Nov 12 20:50:15 2012
(r242932)
+++ head/sys/ofed/drivers/infiniband/core/cma.c Mon Nov 12 22:01:29 2012
(r242933)
@@ -1312,7 +1312,7 @@ static int cma_iw_handler(struct iw_cm_i
*sin = iw_event->local_addr;
sin = (struct sockaddr_in *) &id_priv->id.route.addr.dst_addr;
*sin = iw_event->remote_addr;
-   switch (iw_event->status) {
+   switch ((int)iw_event->status) {
case 0:
event.event = RDMA_CM_EVENT_ESTABLISHED;
break;

Modified: head/sys/ofed/drivers/infiniband/core/ud_header.c
==
--- head/sys/ofed/drivers/infiniband/core/ud_header.c   Mon Nov 12 20:50:15 
2012(r242932)
+++ head/sys/ofed/drivers/infiniband/core/ud_header.c   Mon Nov 12 22:01:29 
2012(r242933)
@@ -230,7 +230,7 @@ void ib_ud_header_init(int  pay
   int  immediate_present,
   struct ib_ud_header *header)
 {
-   u16 packet_length;
+   u16 packet_length = 0;
 
memset(header, 0, sizeof *header);
 

Modified: head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_rx.c
==
--- head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_rx.c   Mon Nov 12 20:50:15 
2012(r242932)
+++ head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_rx.c   Mon Nov 12 22:01:29 
2012(r242933)
@@ -590,7 +590,7 @@ sdp_rx_comp_work(struct work_struct *wor
if (unlikely(!ssk->poll_cq)) {
struct rdma_cm_id *id = ssk->id;
if (id && id->qp)
-   rdma_notify(id, RDMA_CM_EVENT_ESTABLISHED);
+   rdma_notify(id, IB_EVENT_COMM_EST);
goto out;
}
 

Modified: head/sys/ofed/include/linux/pci.h
==
--- head/sys/ofed/include/linux/pci.h   Mon Nov 12 20:50:15 2012
(r242932)
+++ head/sys/ofed/include/linux/pci.h   Mon Nov 12 22:01:29 2012
(r242933)
@@ -73,10 +73,12 @@ struct pci_device_id {
 #definePCI_DEVICE_ID_MELLANOX_SINAI0x6274
 
 
-#define PCI_VDEVICE(vendor, device)

svn commit: r242934 - head/sys/dev/xen/netback

2012-11-12 Thread Dimitry Andric
Author: dim
Date: Mon Nov 12 22:28:32 2012
New Revision: 242934
URL: http://svnweb.freebsd.org/changeset/base/242934

Log:
  Redo r242889, now using the method from projects/amd64_xen_pv r240747.
  
  Reminded by:  kib
  MFC after:3 days

Modified:
  head/sys/dev/xen/netback/netback_unit_tests.c

Modified: head/sys/dev/xen/netback/netback_unit_tests.c
==
--- head/sys/dev/xen/netback/netback_unit_tests.c   Mon Nov 12 22:01:29 
2012(r242933)
+++ head/sys/dev/xen/netback/netback_unit_tests.c   Mon Nov 12 22:28:32 
2012(r242934)
@@ -58,11 +58,11 @@ __FBSDID("$FreeBSD$");
 #defineTOSTRING(x) STRINGIFY(x)
 
 /**
- * Writes an error message to buffer if cond is false, and returns true
- * iff the assertion failed.  Note the implied parameters buffer and
+ * Writes an error message to buffer if cond is false
+ * Note the implied parameters buffer and
  * buflen
  */
-#defineXNB_ASSERT(cond) do {   
\
+#defineXNB_ASSERT(cond) ({ 
\
int passed = (cond);\
char *_buffer = (buffer);   \
size_t _buflen = (buflen);  \
@@ -71,7 +71,7 @@ __FBSDID("$FreeBSD$");
strlcat(_buffer, ":" TOSTRING(__LINE__) \
  " Assertion Error: " #cond "\n", _buflen);\
}   \
-   } while (0)
+   })
 
 
 /**
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r242935 - in head/sys/boot/userboot: . test userboot

2012-11-12 Thread Neel Natu
Author: neel
Date: Mon Nov 12 22:38:54 2012
New Revision: 242935
URL: http://svnweb.freebsd.org/changeset/base/242935

Log:
  Add a callback function to userboot.so to fetch a list of environment
  variables and pass them to the kernel.
  
  Reviewed by:  dfr

Modified:
  head/sys/boot/userboot/test/test.c
  head/sys/boot/userboot/userboot.h
  head/sys/boot/userboot/userboot/main.c

Modified: head/sys/boot/userboot/test/test.c
==
--- head/sys/boot/userboot/test/test.c  Mon Nov 12 22:28:32 2012
(r242934)
+++ head/sys/boot/userboot/test/test.c  Mon Nov 12 22:38:54 2012
(r242935)
@@ -364,6 +364,18 @@ test_getmem(void *arg, uint64_t *lowmem,
 *highmem = 0;
 }
 
+const char *
+test_getenv(void *arg, int idx)
+{
+   static const char *vars[] = {
+   "foo=bar",
+   "bar=barbar",
+   NULL
+   };
+
+   return (vars[idx]);
+}
+
 struct loader_callbacks cb = {
.putc = test_putc,
.getc = test_getc,
@@ -391,6 +403,8 @@ struct loader_callbacks cb = {
.delay = test_delay,
.exit = test_exit,
 .getmem = test_getmem,
+
+   .getenv = test_getenv,
 };
 
 void
@@ -450,5 +464,5 @@ main(int argc, char** argv)
term.c_lflag &= ~(ICANON|ECHO);
tcsetattr(0, TCSAFLUSH, &term);
 
-   func(&cb, NULL, USERBOOT_VERSION_2, disk_fd >= 0);
+   func(&cb, NULL, USERBOOT_VERSION_3, disk_fd >= 0);
 }

Modified: head/sys/boot/userboot/userboot.h
==
--- head/sys/boot/userboot/userboot.h   Mon Nov 12 22:28:32 2012
(r242934)
+++ head/sys/boot/userboot/userboot.h   Mon Nov 12 22:38:54 2012
(r242935)
@@ -31,6 +31,7 @@
  */
 #defineUSERBOOT_VERSION_1  1
 #defineUSERBOOT_VERSION_2  2
+#defineUSERBOOT_VERSION_3  3
 
 /*
  * Exit codes from the loader
@@ -176,9 +177,22 @@ struct loader_callbacks {
  */
void(*getmem)(void *arg, uint64_t *lowmem,
 uint64_t *highmem);
+
/*
 * ioctl interface to the disk device
 */
int (*diskioctl)(void *arg, int unit, u_long cmd,
void *data);
+
+   /*
+* Returns an environment variable in the form "name=value".
+*
+* If there are no more variables that need to be set in the
+* loader environment then return NULL.
+*
+* 'num' is used as a handle for the callback to identify which
+* environment variable to return next. It will begin at 0 and
+* each invocation will add 1 to the previous value of 'num'.
+*/
+   const char *(*getenv)(void *arg, int num);
 };

Modified: head/sys/boot/userboot/userboot/main.c
==
--- head/sys/boot/userboot/userboot/main.c  Mon Nov 12 22:28:32 2012
(r242934)
+++ head/sys/boot/userboot/userboot/main.c  Mon Nov 12 22:38:54 2012
(r242935)
@@ -36,7 +36,7 @@ __FBSDID("$FreeBSD$");
 #include "disk.h"
 #include "libuserboot.h"
 
-#defineUSERBOOT_VERSIONUSERBOOT_VERSION_2
+#defineUSERBOOT_VERSIONUSERBOOT_VERSION_3
 
 struct loader_callbacks *callbacks;
 void *callbacks_arg;
@@ -70,6 +70,7 @@ void
 loader_main(struct loader_callbacks *cb, void *arg, int version, int ndisks)
 {
static char malloc[512*1024];
+   const char *var;
int i;
 
 if (version != USERBOOT_VERSION)
@@ -107,6 +108,17 @@ loader_main(struct loader_callbacks *cb,
 
setenv("LINES", "24", 1);   /* optional */
 
+   /*
+* Set custom environment variables
+*/
+   i = 0;
+   while (1) {
+   var = CALLBACK(getenv, i++);
+   if (var == NULL)
+   break;
+   putenv(var);
+   }
+
archsw.arch_autoload = userboot_autoload;
archsw.arch_getdev = userboot_getdev;
archsw.arch_copyin = userboot_copyin;
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r242934 - head/sys/dev/xen/netback

2012-11-12 Thread Ben Kaduk
On Mon, Nov 12, 2012 at 5:28 PM, Dimitry Andric  wrote:
> Author: dim
> Date: Mon Nov 12 22:28:32 2012
> New Revision: 242934
> URL: http://svnweb.freebsd.org/changeset/base/242934
>
> Log:
>   Redo r242889, now using the method from projects/amd64_xen_pv r240747.
>
>   Reminded by:  kib
>   MFC after:3 days
>
> Modified:
>   head/sys/dev/xen/netback/netback_unit_tests.c
>
> Modified: head/sys/dev/xen/netback/netback_unit_tests.c
> ==
> --- head/sys/dev/xen/netback/netback_unit_tests.c   Mon Nov 12 22:01:29 
> 2012(r242933)
> +++ head/sys/dev/xen/netback/netback_unit_tests.c   Mon Nov 12 22:28:32 
> 2012(r242934)
> @@ -58,11 +58,11 @@ __FBSDID("$FreeBSD$");
>  #defineTOSTRING(x) STRINGIFY(x)
>
>  /**
> - * Writes an error message to buffer if cond is false, and returns true
> - * iff the assertion failed.  Note the implied parameters buffer and
> + * Writes an error message to buffer if cond is false
> + * Note the implied parameters buffer and

At risk of being Bruce, aren't comments like this supposed to be
complete sentences and end with a full stop?

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


Re: svn commit: r241933 - head/sys/conf

2012-11-12 Thread David O'Brien
On Tue, Oct 23, 2012 at 02:58:25PM +, Warner Losh wrote:
> Log:
>   Start a clean-room implementation of files.mips.  This is sufficient
>   for SWARM64 and SWARM64_SMP to compile.  Other kernels will be layered
>   in.
> Modified:
>   head/sys/conf/files.mips
...
> -# Copyright (c) 2001, 2004-2005, Juniper Networks, Inc.
> -# All rights reserved.
> -# JNPR: files.mips,v 1.11 2007/08/09 12:25:35 katta

Hi Warner,
What is the purpose of this?

$ diff -Bbw files.mips.r241680,sorted files.mips.r241933,sorted | egrep -v 
'^(\+|-|@@)' | wc -l
  43

So some of the content did "filter through" the clean room.
Who did the "clean-room" implementation?  If you, is it really a
clean-room reimplementation?  You're so familiar with this file are you
really able to do such a thing?

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


Re: svn commit: r241933 - head/sys/conf

2012-11-12 Thread David O'Brien
On Mon, Nov 12, 2012 at 04:29:07PM -0800, David O'Brien (@FreeBSD) wrote:
> $ diff -Bbw files.mips.r241680,sorted files.mips.r241933,sorted | egrep -v 
> '^(\+|-|@@)' | wc -l
>   43

Sorry, should have better ensured all input lines appeared in the output.

$ diff -u999 -Bbw files.mips.r241680,sorted files.mips.r241933,sorted | egrep 
-v '^(\+|-|@@)' | wc -l
  61

Using your immediate r241936 follow on commit:
$ diff -u999 -Bbw files.mips.r241680,sorted files.mips.r241936,sorted | egrep 
-v '^(\+|-|@@)' | wc -l
  68

And by end of the day (r242031, all your commits to this file on the 23rd):
$ diff -u999 -Bbw files.mips.r241680,sorted files.mips.r241986,sorted | egrep 
-v '^(\+|-|@@)' | wc -l
  84

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


Re: svn commit: r241933 - head/sys/conf

2012-11-12 Thread Ben Kaduk
On Mon, Nov 12, 2012 at 7:47 PM, David O'Brien  wrote:
> On Mon, Nov 12, 2012 at 04:29:07PM -0800, David O'Brien (@FreeBSD) wrote:
>> $ diff -Bbw files.mips.r241680,sorted files.mips.r241933,sorted | egrep -v 
>> '^(\+|-|@@)' | wc -l
>>   43
>
> Sorry, should have better ensured all input lines appeared in the output.
>
> $ diff -u999 -Bbw files.mips.r241680,sorted files.mips.r241933,sorted | egrep 
> -v '^(\+|-|@@)' | wc -l
>   61
>
> Using your immediate r241936 follow on commit:
> $ diff -u999 -Bbw files.mips.r241680,sorted files.mips.r241936,sorted | egrep 
> -v '^(\+|-|@@)' | wc -l
>   68
>
> And by end of the day (r242031, all your commits to this file on the 23rd):
> $ diff -u999 -Bbw files.mips.r241680,sorted files.mips.r241986,sorted | egrep 
> -v '^(\+|-|@@)' | wc -l

My reading was that the idea was to start from scratch with a
files.mips and get one that works for all configurations, instead of
having a balkanized regime where each board (or nearly so) had its own
files file.

I don't see that there's a way for the traditional meaning of "clean
room" for licensing concerns to apply here.

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


svn commit: r242936 - head/contrib/gdb/gdb

2012-11-12 Thread Ed Maste
Author: emaste
Date: Tue Nov 13 01:21:17 2012
New Revision: 242936
URL: http://svnweb.freebsd.org/changeset/base/242936

Log:
  Set optimized_out instead of reporting an error.
  
  This provides a better display when debugging code compiled with
  optimization on.
  
  GDB git revision e8395b4efd184f745070afb953f451f99e922be7 (prior to GDB's
  switch to GPLv3), modified for the interfaces provided by GDB 6.1.1.
  
  2005-02-28  Daniel Jacobowitz  
  
   * dwarf2loc.c (loclist_read_variable): Set optimized_out
   instead of reporting an error.
   * valprint.c (value_check_printable): New function.
   (common_val_print): New function.  Use value_check_printable.
   (value_print): Use value_check_printable.
   * value.h (common_val_print): Add prototype.
   * c-valprint.c (c_val_print): Use common_val_print.
   * cp-valprint.c (cp_print_value_fields): Likewise.
   (cp_print_hpacc_virtual_table_entries): Likewise.
   * f-valprint.c (f_val_print): Likewise.
   * jv-valprint.c (java_value_print, java_print_value_fields):
   Likewise.
   * scm-valprint.c (scm_value_print): Likewise.
   * stack.c (print_frame_args): Likewise.
   * varobj.c (c_value_of_variable): Likewise.
   * p-valprint.c (pascal_val_print, pascal_value_print): Likewise.
   (pascal_object_print_value_fields): Likewise.  Update call to
   pascal_object_print_static_field.
   (pascal_object_print_static_field): Remove TYPE argument.  Use
   common_val_print.
  
  Sponsored by: ADARA Networks
  MFC after:1 month

Modified:
  head/contrib/gdb/gdb/c-valprint.c
  head/contrib/gdb/gdb/cp-valprint.c
  head/contrib/gdb/gdb/dwarf2loc.c
  head/contrib/gdb/gdb/f-valprint.c
  head/contrib/gdb/gdb/jv-valprint.c
  head/contrib/gdb/gdb/p-valprint.c
  head/contrib/gdb/gdb/scm-valprint.c
  head/contrib/gdb/gdb/stack.c
  head/contrib/gdb/gdb/valprint.c
  head/contrib/gdb/gdb/value.h
  head/contrib/gdb/gdb/varobj.c

Modified: head/contrib/gdb/gdb/c-valprint.c
==
--- head/contrib/gdb/gdb/c-valprint.c   Mon Nov 12 22:38:54 2012
(r242935)
+++ head/contrib/gdb/gdb/c-valprint.c   Tue Nov 13 01:21:17 2012
(r242936)
@@ -232,9 +232,8 @@ c_val_print (struct type *type, char *va
  wtype = TYPE_TARGET_TYPE (type);
}
  vt_val = value_at (wtype, vt_address, NULL);
- val_print (VALUE_TYPE (vt_val), VALUE_CONTENTS (vt_val), 0,
-VALUE_ADDRESS (vt_val), stream, format,
-deref_ref, recurse + 1, pretty);
+ common_val_print (vt_val, stream, format,
+   deref_ref, recurse + 1, pretty);
  if (pretty)
{
  fprintf_filtered (stream, "\n");
@@ -283,15 +282,8 @@ c_val_print (struct type *type, char *va
   unpack_pointer (lookup_pointer_type (builtin_type_void),
   valaddr + embedded_offset),
   NULL);
- val_print (VALUE_TYPE (deref_val),
-VALUE_CONTENTS (deref_val),
-0,
-VALUE_ADDRESS (deref_val),
-stream,
-format,
-deref_ref,
-recurse,
-pretty);
+ common_val_print (deref_val, stream, format, deref_ref,
+   recurse, pretty);
}
  else
fputs_filtered ("???", stream);

Modified: head/contrib/gdb/gdb/cp-valprint.c
==
--- head/contrib/gdb/gdb/cp-valprint.c  Mon Nov 12 22:38:54 2012
(r242935)
+++ head/contrib/gdb/gdb/cp-valprint.c  Tue Nov 13 01:21:17 2012
(r242936)
@@ -361,8 +361,7 @@ cp_print_value_fields (struct type *type
(TYPE_FIELD_TYPE (type, i), 
 unpack_field_as_long (type, valaddr + offset, i));
 
- val_print (TYPE_FIELD_TYPE (type, i), VALUE_CONTENTS (v),
-0, 0, stream, format, 0, recurse + 1, pretty);
+ common_val_print (v, stream, format, 0, recurse + 1, pretty);
}
}
  else
@@ -426,8 +425,7 @@ cp_print_value_fields (struct type *type
   v = value_from_pointer (lookup_pointer_type (builtin_type_unsigned_long),
  *(unsigned long *) (valaddr + offset));
 
-  val_print (VALUE_TYPE (v), VALUE_CONTENTS (v), 0, 0,
-stream, format, 0, recurse + 1, pretty);
+  common_val_print (v, stream, format, 0, recurse + 1, pretty);
   fields_seen = 1;
 
   if (vtblprint)
@@ -791,8 +789,7 @@ cp_print_hpacc_virtual_table_entries (st
  VALUE_TYPE (vf) = VALUE_TYPE (v); /* make it a pointer */
 
  /* print out the entry */
- val_print (VALUE_TYPE (vf)

svn commit: r242938 - head/sys/netinet6

2012-11-12 Thread David E. O'Brien
Author: obrien
Date: Tue Nov 13 01:48:00 2012
New Revision: 242938
URL: http://svnweb.freebsd.org/changeset/base/242938

Log:
  Use consistent style.

Modified:
  head/sys/netinet6/in6_src.c

Modified: head/sys/netinet6/in6_src.c
==
--- head/sys/netinet6/in6_src.c Tue Nov 13 01:46:56 2012(r242937)
+++ head/sys/netinet6/in6_src.c Tue Nov 13 01:48:00 2012(r242938)
@@ -140,7 +140,7 @@ static void init_policy_queue(void);
 static int add_addrsel_policyent(struct in6_addrpolicy *);
 static int delete_addrsel_policyent(struct in6_addrpolicy *);
 static int walk_addrsel_policy(int (*)(struct in6_addrpolicy *, void *),
-   void *);
+   void *);
 static int dump_addrsel_policyent(struct in6_addrpolicy *, void *);
 static struct in6_addrpolicy *match_addrsel_policy(struct sockaddr_in6 *);
 
@@ -1103,8 +1103,7 @@ delete_addrsel_policyent(struct in6_addr
 }
 
 static int
-walk_addrsel_policy(int (*callback)(struct in6_addrpolicy *, void *),
-void *w)
+walk_addrsel_policy(int (*callback)(struct in6_addrpolicy *, void *), void *w)
 {
struct addrsel_policyent *pol;
int error = 0;
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r240494 - in head: contrib/pf/man contrib/pf/pfctl include sbin/pfctl sbin/pfctl/missing share/man/man4 share/man/man5 sys/conf sys/contrib/pf sys/modules/dummynet sys/modules/ipfw sys

2012-11-12 Thread David O'Brien
On Fri, Sep 14, 2012 at 11:51:51AM +, Gleb Smirnoff wrote:
> Log:
>   o Create directory sys/netpfil, where all packet filters should
> reside, and move there ipfw(4) and pf(4).
>   o Move most modified parts of pf out of contrib.

Why didn't contrib/ipfilter/ move to sys/netpfil/ as well?

Having 1/3 of our packet filters not there (sys/netpfil) might suggest we
shouldn't create sys/netpfil/

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


Re: svn commit: r241933 - head/sys/conf

2012-11-12 Thread Warner Losh

On Nov 12, 2012, at 5:29 PM, David O'Brien wrote:

> On Tue, Oct 23, 2012 at 02:58:25PM +, Warner Losh wrote:
>> Log:
>>  Start a clean-room implementation of files.mips.  This is sufficient
>>  for SWARM64 and SWARM64_SMP to compile.  Other kernels will be layered
>>  in.
>> Modified:
>>  head/sys/conf/files.mips
> ...
>> -# Copyright (c) 2001, 2004-2005, Juniper Networks, Inc.
>> -# All rights reserved.
>> -# JNPR: files.mips,v 1.11 2007/08/09 12:25:35 katta
> 
> Hi Warner,
> What is the purpose of this?

A complete rewrite from scratch, starting with an empty file and fixing things 
that config/buildkernel complained about.

> $ diff -Bbw files.mips.r241680,sorted files.mips.r241933,sorted | egrep -v 
> '^(\+|-|@@)' | wc -l
>  43
> 
> So some of the content did "filter through" the clean room.

No, it did not.  You are mistaken. Sometimes, there's only one way to list 
files.

> Who did the "clean-room" implementation?

I did.

> If you, is it really a clean-room reimplementation?

Yes.

> You're so familiar with this file are you really able to do such a thing?

Yes.

This file is so simple that there's really only one way that a 'find sys/mips 
-name \*.c' can be expressed.

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


svn commit: r242941 - in head/sys: sys vm

2012-11-12 Thread Alan Cox
Author: alc
Date: Tue Nov 13 02:50:39 2012
New Revision: 242941
URL: http://svnweb.freebsd.org/changeset/base/242941

Log:
  Replace the single, global page queues lock with per-queue locks on the
  active and inactive paging queues.
  
  Reviewed by:  kib

Modified:
  head/sys/sys/vmmeter.h
  head/sys/vm/vm_fault.c
  head/sys/vm/vm_page.c
  head/sys/vm/vm_page.h
  head/sys/vm/vm_pageout.c

Modified: head/sys/sys/vmmeter.h
==
--- head/sys/sys/vmmeter.h  Tue Nov 13 02:42:31 2012(r242940)
+++ head/sys/sys/vmmeter.h  Tue Nov 13 02:50:39 2012(r242941)
@@ -46,7 +46,7 @@
  *  c - constant after initialization
  *  f - locked by vm_page_queue_free_mtx
  *  p - locked by being in the PCPU and atomicity respect to interrupts
- *  q - locked by vm_page_queue_mtx
+ *  q - changes are synchronized by the corresponding vm_pagequeue lock
  */
 struct vmmeter {
/*
@@ -76,7 +76,7 @@ struct vmmeter {
u_int v_intrans;/* (p) intransit blocking page faults */
u_int v_reactivated;/* (f) pages reactivated from free list */
u_int v_pdwakeups;  /* (f) times daemon has awaken from sleep */
-   u_int v_pdpages;/* (q) pages analyzed by daemon */
+   u_int v_pdpages;/* (p) pages analyzed by daemon */
 
u_int v_tcached;/* (p) total pages cached */
u_int v_dfree;  /* (p) pages freed by daemon */

Modified: head/sys/vm/vm_fault.c
==
--- head/sys/vm/vm_fault.c  Tue Nov 13 02:42:31 2012(r242940)
+++ head/sys/vm/vm_fault.c  Tue Nov 13 02:50:39 2012(r242941)
@@ -388,7 +388,7 @@ RetryFault:;
vm_object_deallocate(fs.first_object);
goto RetryFault;
}
-   vm_pageq_remove(fs.m);
+   vm_page_remque(fs.m);
vm_page_unlock(fs.m);
 
/*

Modified: head/sys/vm/vm_page.c
==
--- head/sys/vm/vm_page.c   Tue Nov 13 02:42:31 2012(r242940)
+++ head/sys/vm/vm_page.c   Tue Nov 13 02:50:39 2012(r242941)
@@ -63,10 +63,16 @@
 /*
  * GENERAL RULES ON VM_PAGE MANIPULATION
  *
- * - a pageq mutex is required when adding or removing a page from a
- *   page queue (vm_page_queue[]), regardless of other mutexes or the
+ * - A page queue lock is required when adding or removing a page from a
+ *   page queue (vm_pagequeues[]), regardless of other locks or the
  *   busy state of a page.
  *
+ * * In general, no thread besides the page daemon can acquire or
+ *   hold more than one page queue lock at a time.
+ *
+ * * The page daemon can acquire and hold any pair of page queue
+ *   locks in any order.
+ *
  * - The object mutex is held when inserting or removing
  *   pages from an object (vm_page_insert() or vm_page_remove()).
  *
@@ -115,8 +121,20 @@ __FBSDID("$FreeBSD$");
  * page structure.
  */
 
-struct vpgqueues vm_page_queues[PQ_COUNT];
-struct mtx_padalign vm_page_queue_mtx;
+struct vm_pagequeue vm_pagequeues[PQ_COUNT] = {
+   [PQ_INACTIVE] = {
+   .pq_pl = TAILQ_HEAD_INITIALIZER(
+   vm_pagequeues[PQ_INACTIVE].pq_pl),
+   .pq_cnt = &cnt.v_inactive_count,
+   .pq_name = "vm inactive pagequeue"
+   },
+   [PQ_ACTIVE] = {
+   .pq_pl = TAILQ_HEAD_INITIALIZER(
+   vm_pagequeues[PQ_ACTIVE].pq_pl),
+   .pq_cnt = &cnt.v_active_count,
+   .pq_name = "vm active pagequeue"
+   }
+};
 struct mtx_padalign vm_page_queue_free_mtx;
 
 struct mtx_padalign pa_lock[PA_LOCK_COUNT];
@@ -139,7 +157,6 @@ static uma_zone_t fakepg_zone;
 
 static struct vnode *vm_page_alloc_init(vm_page_t m);
 static void vm_page_clear_dirty_mask(vm_page_t m, vm_page_bits_t pagebits);
-static void vm_page_queue_remove(int queue, vm_page_t m);
 static void vm_page_enqueue(int queue, vm_page_t m);
 static void vm_page_init_fakepg(void *dummy);
 
@@ -294,20 +311,11 @@ vm_page_startup(vm_offset_t vaddr)
/*
 * Initialize the page and queue locks.
 */
-   mtx_init(&vm_page_queue_mtx, "vm page queue", NULL, MTX_DEF |
-   MTX_RECURSE);
mtx_init(&vm_page_queue_free_mtx, "vm page free queue", NULL, MTX_DEF);
for (i = 0; i < PA_LOCK_COUNT; i++)
mtx_init(&pa_lock[i], "vm page", NULL, MTX_DEF);
-
-   /*
-* Initialize the queue headers for the hold queue, the active queue,
-* and the inactive queue.
-*/
for (i = 0; i < PQ_COUNT; i++)
-   TAILQ_INIT(&vm_page_queues[i].pl);
-   vm_page_queues[PQ

svn commit: r242943 - head/contrib/gdb/gdb

2012-11-12 Thread Ed Maste
Author: emaste
Date: Tue Nov 13 03:05:28 2012
New Revision: 242943
URL: http://svnweb.freebsd.org/changeset/base/242943

Log:
  Do not unwind past a zero PC frame.
  
  This improves GDB usability when debugging code compiled with
  optimization.
  
  Upstream GDB revision f0031b6d3ae9b164b3747986ab898190bd4dcf8c (prior
  to GDB's switch to GPLv3), with frame_debug_got_null_frame expanded
  inline.
  
  | 2004-12-12  Andrew Cagney  
  |
  | * frame.c (get_prev_frame): When unwinding normal frames, check
  | that the PC isn't zero.
  
  Sponsored by: ADARA Networks
  MFC After:1 month

Modified:
  head/contrib/gdb/gdb/frame.c

Modified: head/contrib/gdb/gdb/frame.c
==
--- head/contrib/gdb/gdb/frame.cTue Nov 13 03:00:01 2012
(r242942)
+++ head/contrib/gdb/gdb/frame.cTue Nov 13 03:05:28 2012
(r242943)
@@ -1846,6 +1846,23 @@ get_prev_frame (struct frame_info *this_
   return NULL;
 }
 
+  /* Assume that the only way to get a zero PC is through something
+ like a SIGSEGV or a dummy frame, and hence that NORMAL frames
+ will never unwind a zero PC.  */
+  if (this_frame->level > 0
+  && get_frame_type (this_frame) == NORMAL_FRAME
+  && get_frame_type (get_next_frame (this_frame)) == NORMAL_FRAME
+  && get_frame_pc (this_frame) == 0)
+{
+  if (frame_debug)
+   {
+ fprintf_unfiltered (gdb_stdlog, "-> ");
+ fprint_frame (gdb_stdlog, this_frame->prev);
+ fprintf_unfiltered (gdb_stdlog, " // zero PC \n");
+   }
+  return NULL;
+}
+
   /* Only try to do the unwind once.  */
   if (this_frame->prev_p)
 {
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r242944 - head/sys/conf

2012-11-12 Thread David E. O'Brien
Author: obrien
Date: Tue Nov 13 03:09:26 2012
New Revision: 242944
URL: http://svnweb.freebsd.org/changeset/base/242944

Log:
  Garbage collect the explicit "compile-with", they are no longer needed.

Modified:
  head/sys/conf/files

Modified: head/sys/conf/files
==
--- head/sys/conf/files Tue Nov 13 03:05:28 2012(r242943)
+++ head/sys/conf/files Tue Nov 13 03:09:26 2012(r242944)
@@ -274,20 +274,14 @@ compat/freebsd32/freebsd32_ioctl.coptio
 compat/freebsd32/freebsd32_misc.c  optionalcompat_freebsd32
 compat/freebsd32/freebsd32_syscalls.c  optionalcompat_freebsd32
 compat/freebsd32/freebsd32_sysent.coptionalcompat_freebsd32
-contrib/altq/altq/altq_cbq.c   optional altq \
-   compile-with "${NORMAL_C}"
-contrib/altq/altq/altq_cdnr.c  optional altq
-contrib/altq/altq/altq_hfsc.c  optional altq \
-   compile-with "${NORMAL_C}"
-contrib/altq/altq/altq_priq.c  optional altq \
-   compile-with "${NORMAL_C}"
-contrib/altq/altq/altq_red.c   optional altq \
-   compile-with "${NORMAL_C}"
-contrib/altq/altq/altq_rio.c   optional altq \
-   compile-with "${NORMAL_C}"
-contrib/altq/altq/altq_rmclass.c optional altq
-contrib/altq/altq/altq_subr.c  optional altq \
-   compile-with "${NORMAL_C}"
+contrib/altq/altq/altq_cbq.c   optional altq
+contrib/altq/altq/altq_cdnr.c  optional altq
+contrib/altq/altq/altq_hfsc.c  optional altq
+contrib/altq/altq/altq_priq.c  optional altq
+contrib/altq/altq/altq_red.c   optional altq
+contrib/altq/altq/altq_rio.c   optional altq
+contrib/altq/altq/altq_rmclass.c   optional altq
+contrib/altq/altq/altq_subr.c  optional altq
 contrib/dev/acpica/components/debugger/dbcmds.coptional acpi 
acpi_debug
 contrib/dev/acpica/components/debugger/dbdisply.c  optional acpi acpi_debug
 contrib/dev/acpica/components/debugger/dbexec.coptional acpi 
acpi_debug
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r242945 - in head/contrib/libc++: include include/ext src

2012-11-12 Thread David Chisnall
Author: theraven
Date: Tue Nov 13 03:27:43 2012
New Revision: 242945
URL: http://svnweb.freebsd.org/changeset/base/242945

Log:
  Import new version of libc++ into base.

Modified:
  head/contrib/libc++/include/__config
  head/contrib/libc++/include/__functional_base
  head/contrib/libc++/include/__functional_base_03
  head/contrib/libc++/include/__locale
  head/contrib/libc++/include/__mutex_base
  head/contrib/libc++/include/algorithm
  head/contrib/libc++/include/cmath
  head/contrib/libc++/include/complex
  head/contrib/libc++/include/condition_variable
  head/contrib/libc++/include/cstddef
  head/contrib/libc++/include/ext/__hash
  head/contrib/libc++/include/future
  head/contrib/libc++/include/ios
  head/contrib/libc++/include/istream
  head/contrib/libc++/include/iterator
  head/contrib/libc++/include/locale
  head/contrib/libc++/include/memory
  head/contrib/libc++/include/ostream
  head/contrib/libc++/include/random
  head/contrib/libc++/include/streambuf
  head/contrib/libc++/include/string
  head/contrib/libc++/include/system_error
  head/contrib/libc++/include/tuple
  head/contrib/libc++/include/type_traits
  head/contrib/libc++/include/utility
  head/contrib/libc++/include/valarray
  head/contrib/libc++/include/vector
  head/contrib/libc++/src/memory.cpp
Directory Properties:
  head/contrib/libc++/   (props changed)

Modified: head/contrib/libc++/include/__config
==
--- head/contrib/libc++/include/__configTue Nov 13 03:09:26 2012
(r242944)
+++ head/contrib/libc++/include/__configTue Nov 13 03:27:43 2012
(r242945)
@@ -415,11 +415,11 @@ template  struct __static_asse
 #endif
 
 #ifdef _LIBCPP_HAS_NO_STRONG_ENUMS
-#define _LIBCPP_DECLARE_STRONG_ENUM(x) struct _LIBCPP_VISIBLE x { enum _
+#define _LIBCPP_DECLARE_STRONG_ENUM(x) struct _LIBCPP_VISIBLE x { enum __lx
 #define _LIBCPP_DECLARE_STRONG_ENUM_EPILOG(x) \
-_ __v_; \
-_LIBCPP_ALWAYS_INLINE x(_ __v) : __v_(__v) {} \
-_LIBCPP_ALWAYS_INLINE explicit x(int __v) : __v_(static_cast<_>(__v)) {} \
+__lx __v_; \
+_LIBCPP_ALWAYS_INLINE x(__lx __v) : __v_(__v) {} \
+_LIBCPP_ALWAYS_INLINE explicit x(int __v) : __v_(static_cast<__lx>(__v)) 
{} \
 _LIBCPP_ALWAYS_INLINE operator int() const {return __v_;} \
 };
 #else  // _LIBCPP_HAS_NO_STRONG_ENUMS
@@ -427,6 +427,10 @@ template  struct __static_asse
 #define _LIBCPP_DECLARE_STRONG_ENUM_EPILOG(x)
 #endif  // _LIBCPP_HAS_NO_STRONG_ENUMS
 
+#ifndef _LIBCPP_EXTERN_TEMPLATE
+#define _LIBCPP_EXTERN_TEMPLATE(...) extern template __VA_ARGS__;
+#endif
+
 #if __APPLE__ || __FreeBSD__ || _WIN32 || __sun__
 #define _LIBCPP_LOCALE__L_EXTENSIONS 1
 #endif

Modified: head/contrib/libc++/include/__functional_base
==
--- head/contrib/libc++/include/__functional_base   Tue Nov 13 03:09:26 
2012(r242944)
+++ head/contrib/libc++/include/__functional_base   Tue Nov 13 03:27:43 
2012(r242945)
@@ -43,7 +43,7 @@ template 
 struct __has_result_type
 {
 private:
-struct __two {char _; char __;};
+struct __two {char __lx; char __lxx;};
 template  static __two __test(...);
 template  static char __test(typename _Up::result_type* = 0);
 public:
@@ -69,7 +69,7 @@ template 
 struct __derives_from_unary_function
 {
 private:
-struct __two {char _; char __;};
+struct __two {char __lx; char __lxx;};
 static __two __test(...);
 template 
 static unary_function<_Ap, _Rp>
@@ -83,7 +83,7 @@ template 
 struct __derives_from_binary_function
 {
 private:
-struct __two {char _; char __;};
+struct __two {char __lx; char __lxx;};
 static __two __test(...);
 template 
 static binary_function<_A1, _A2, _Rp>

Modified: head/contrib/libc++/include/__functional_base_03
==
--- head/contrib/libc++/include/__functional_base_03Tue Nov 13 03:09:26 
2012(r242944)
+++ head/contrib/libc++/include/__functional_base_03Tue Nov 13 03:27:43 
2012(r242945)
@@ -19,7 +19,7 @@ template 
 struct __derives_from_unary_function
 {
 private:
-struct __two {char _; char __;};
+struct __two {char __lx; char __lxx;};
 static __two __test(...);
 template 
 static unary_function<_Ap, _Rp>
@@ -33,7 +33,7 @@ template 
 struct __derives_from_binary_function
 {
 private:
-struct __two {char _; char __;};
+struct __two {char __lx; char __lxx;};
 static __two __test(...);
 template 
 static binary_function<_A1, _A2, _Rp>
@@ -943,7 +943,7 @@ template 
 struct __has_type
 {
 private:
-struct __two {char _; char __;};
+struct __two {char __lx; char __lxx;};
 template  static __two __test(...);
 template  static char __test(typename _Up::type* = 0);
 public:

Modified: head/contrib/libc++/include/__locale
==

svn commit: r242947 - head/sys/dev/iicbus

2012-11-12 Thread Kevin Lo
Author: kevlo
Date: Tue Nov 13 05:58:52 2012
New Revision: 242947
URL: http://svnweb.freebsd.org/changeset/base/242947

Log:
  Check the return value of uiomove(9).

Modified:
  head/sys/dev/iicbus/iic.c

Modified: head/sys/dev/iicbus/iic.c
==
--- head/sys/dev/iicbus/iic.c   Tue Nov 13 03:56:50 2012(r242946)
+++ head/sys/dev/iicbus/iic.c   Tue Nov 13 05:58:52 2012(r242947)
@@ -221,7 +221,11 @@ iicwrite(struct cdev *dev, struct uio * 
}
 
count = min(uio->uio_resid, BUFSIZE);
-   uiomove(sc->sc_buffer, count, uio);
+   error = uiomove(sc->sc_buffer, count, uio);
+   if (error) {
+   IIC_UNLOCK(sc);
+   return (error);
+   }
 
error = iicbus_block_write(device_get_parent(iicdev), sc->sc_addr,
sc->sc_buffer, count, &sent);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r242948 - head/sys/dev/adb

2012-11-12 Thread Kevin Lo
Author: kevlo
Date: Tue Nov 13 06:03:43 2012
New Revision: 242948
URL: http://svnweb.freebsd.org/changeset/base/242948

Log:
  Use uiomove return value instead of returning 0.

Modified:
  head/sys/dev/adb/adb_mouse.c

Modified: head/sys/dev/adb/adb_mouse.c
==
--- head/sys/dev/adb/adb_mouse.cTue Nov 13 05:58:52 2012
(r242947)
+++ head/sys/dev/adb/adb_mouse.cTue Nov 13 06:03:43 2012
(r242948)
@@ -569,9 +569,9 @@ ams_read(struct cdev *dev, struct uio *u
 
mtx_unlock(&sc->sc_mtx);
 
-   uiomove(outpacket,len,uio);
+   error = uiomove(outpacket,len,uio);
 
-   return (0);
+   return (error);
 }
 
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r242949 - head/sys/conf

2012-11-12 Thread David E. O'Brien
Author: obrien
Date: Tue Nov 13 06:07:13 2012
New Revision: 242949
URL: http://svnweb.freebsd.org/changeset/base/242949

Log:
  Be more consistent.

Modified:
  head/sys/conf/files

Modified: head/sys/conf/files
==
--- head/sys/conf/files Tue Nov 13 06:03:43 2012(r242948)
+++ head/sys/conf/files Tue Nov 13 06:07:13 2012(r242949)
@@ -270,10 +270,10 @@ cddl/contrib/opensolaris/uts/common/zmod
 cddl/contrib/opensolaris/uts/common/zmod/zmod.c
optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/zmod/zmod_subr.c   
optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/zmod/zutil.c   
optional zfs compile-with "${ZFS_C}"
-compat/freebsd32/freebsd32_ioctl.c optionalcompat_freebsd32
-compat/freebsd32/freebsd32_misc.c  optionalcompat_freebsd32
-compat/freebsd32/freebsd32_syscalls.c  optionalcompat_freebsd32
-compat/freebsd32/freebsd32_sysent.coptionalcompat_freebsd32
+compat/freebsd32/freebsd32_ioctl.c optional compat_freebsd32
+compat/freebsd32/freebsd32_misc.c  optional compat_freebsd32
+compat/freebsd32/freebsd32_syscalls.c  optional compat_freebsd32
+compat/freebsd32/freebsd32_sysent.coptional compat_freebsd32
 contrib/altq/altq/altq_cbq.c   optional altq
 contrib/altq/altq/altq_cdnr.c  optional altq
 contrib/altq/altq/altq_hfsc.c  optional altq
@@ -462,12 +462,12 @@ contrib/ipfilter/netinet/ip_sync.c optio
compile-with "${NORMAL_C} -I$S/contrib/ipfilter"
 contrib/ipfilter/netinet/mlfk_ipl.c optional ipfilter inet \
compile-with "${NORMAL_C} -I$S/contrib/ipfilter"
-contrib/libfdt/fdt.c   optionalfdt
-contrib/libfdt/fdt_ro.coptionalfdt
-contrib/libfdt/fdt_rw.coptionalfdt
-contrib/libfdt/fdt_strerror.c  optionalfdt
-contrib/libfdt/fdt_sw.coptionalfdt
-contrib/libfdt/fdt_wip.c   optionalfdt
+contrib/libfdt/fdt.c   optional fdt
+contrib/libfdt/fdt_ro.coptional fdt
+contrib/libfdt/fdt_rw.coptional fdt
+contrib/libfdt/fdt_strerror.c  optional fdt
+contrib/libfdt/fdt_sw.coptional fdt
+contrib/libfdt/fdt_wip.c   optional fdt
 contrib/ngatm/netnatm/api/cc_conn.c optional ngatm_ccatm \
compile-with "${NORMAL_C_NOWERROR} -I$S/contrib/ngatm"
 contrib/ngatm/netnatm/api/cc_data.c optional ngatm_ccatm \
@@ -512,10 +512,10 @@ contrib/ngatm/netnatm/sig/sig_unimsgcpy.
compile-with "${NORMAL_C} -I$S/contrib/ngatm"
 contrib/ngatm/netnatm/sig/sig_verify.c optional ngatm_uni \
compile-with "${NORMAL_C} -I$S/contrib/ngatm"
-crypto/blowfish/bf_ecb.c   optional ipsec 
-crypto/blowfish/bf_skey.c  optional crypto | ipsec 
-crypto/camellia/camellia.c optional crypto | ipsec 
-crypto/camellia/camellia-api.c optional crypto | ipsec 
+crypto/blowfish/bf_ecb.c   optional ipsec
+crypto/blowfish/bf_skey.c  optional crypto | ipsec
+crypto/camellia/camellia.c optional crypto | ipsec
+crypto/camellia/camellia-api.c optional crypto | ipsec
 crypto/des/des_ecb.c   optional crypto | ipsec
 crypto/des/des_setkey.coptional crypto | ipsec
 crypto/rc4/rc4.c   optional netgraph_mppc_encryption | kgssapi
@@ -527,26 +527,26 @@ crypto/sha1.c optional carp | crypto |
 netgraph_mppc_encryption | sctp
 crypto/sha2/sha2.c optional crypto | geom_bde | ipsec | random | \
 sctp | zfs
-ddb/db_access.coptionalddb
-ddb/db_break.c optionalddb
-ddb/db_capture.c   optionalddb
-ddb/db_command.c   optionalddb
-ddb/db_examine.c   optionalddb
-ddb/db_expr.c  optionalddb
-ddb/db_input.c optionalddb
-ddb/db_lex.c   optionalddb
-ddb/db_main.c  optionalddb
-ddb/db_output.coptionalddb
-ddb/db_print.c optionalddb
-ddb/db_ps.coptionalddb
-ddb/db_run.c   optionalddb
-ddb/db_script.coptionalddb
-ddb/db_sym.c   optionalddb
-ddb/db_thread.coptionalddb
-ddb/db_textdump.c  optionalddb
-ddb/db_variables.c optionalddb
-ddb/db_watch.c optionalddb
-ddb/db_write_cmd.c optionalddb
+ddb/db_access.coptional ddb
+ddb/db_break.c optional ddb
+ddb/db_capture.c   optiona

svn commit: r242951 - head/sys/dev/ath

2012-11-12 Thread Adrian Chadd
Author: adrian
Date: Tue Nov 13 06:28:57 2012
New Revision: 242951
URL: http://svnweb.freebsd.org/changeset/base/242951

Log:
  Add some debugging to try and catch an invalid TX rate (0x0) that is
  being reported.

Modified:
  head/sys/dev/ath/if_ath_tx.c

Modified: head/sys/dev/ath/if_ath_tx.c
==
--- head/sys/dev/ath/if_ath_tx.cTue Nov 13 06:12:26 2012
(r242950)
+++ head/sys/dev/ath/if_ath_tx.cTue Nov 13 06:28:57 2012
(r242951)
@@ -528,11 +528,19 @@ ath_tx_setds_11n(struct ath_softc *sc, s
__func__, bf_first->bf_state.bfs_nframes,
bf_first->bf_state.bfs_al);
 
+   bf = bf_first;
+
+   if (bf->bf_state.bfs_txrate0 == 0)
+   device_printf(sc->sc_dev, "%s: bf=%p, txrate0=%d\n",
+   __func__, bf, 0);
+   if (bf->bf_state.bfs_rc[0].ratecode == 0)
+   device_printf(sc->sc_dev, "%s: bf=%p, rix0=%d\n",
+   __func__, bf, 0);
+
/*
 * Setup all descriptors of all subframes - this will
 * call ath_hal_set11naggrmiddle() on every frame.
 */
-   bf = bf_first;
while (bf != NULL) {
DPRINTF(sc, ATH_DEBUG_SW_TX_AGGR,
"%s: bf=%p, nseg=%d, pktlen=%d, seqno=%d\n",
@@ -1236,6 +1244,10 @@ ath_tx_setds(struct ath_softc *sc, struc
struct ath_desc *ds = bf->bf_desc;
struct ath_hal *ah = sc->sc_ah;
 
+   if (bf->bf_state.bfs_txrate0 == 0)
+   device_printf(sc->sc_dev, "%s: bf=%p, txrate0=%d\n",
+   __func__, bf, 0);
+
ath_hal_setuptxdesc(ah, ds
, bf->bf_state.bfs_pktlen   /* packet length */
, bf->bf_state.bfs_hdrlen   /* header length */
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r242934 - head/sys/dev/xen/netback

2012-11-12 Thread Dimitry Andric

On 2012-11-12 23:57, Ben Kaduk wrote:> On Mon, Nov 12, 2012 at 5:28 PM, Dimitry 
Andric  wrote:

Author: dim
Date: Mon Nov 12 22:28:32 2012
New Revision: 242934
URL: http://svnweb.freebsd.org/changeset/base/242934

Log:
   Redo r242889, now using the method from projects/amd64_xen_pv r240747.

   Reminded by:  kib
   MFC after:3 days

Modified:
   head/sys/dev/xen/netback/netback_unit_tests.c

Modified: head/sys/dev/xen/netback/netback_unit_tests.c
==
--- head/sys/dev/xen/netback/netback_unit_tests.c   Mon Nov 12 22:01:29 
2012(r242933)
+++ head/sys/dev/xen/netback/netback_unit_tests.c   Mon Nov 12 22:28:32 
2012(r242934)
@@ -58,11 +58,11 @@ __FBSDID("$FreeBSD$");
  #defineTOSTRING(x) STRINGIFY(x)

  /**
- * Writes an error message to buffer if cond is false, and returns true
- * iff the assertion failed.  Note the implied parameters buffer and
+ * Writes an error message to buffer if cond is false
+ * Note the implied parameters buffer and


At risk of being Bruce, aren't comments like this supposed to be
complete sentences and end with a full stop?


Yes, but I purposely copied what was in the projects/amd64_xen_pv
branch, to make it easier for those people to merge back.  Please take
up comment comments with them, thanks. ;-)
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r242952 - head/sys/contrib/octeon-sdk

2012-11-12 Thread Juli Mallett
Author: jmallett
Date: Tue Nov 13 07:33:45 2012
New Revision: 242952
URL: http://svnweb.freebsd.org/changeset/base/242952

Log:
  Fix build for FreeBSD kernel.

Modified:
  head/sys/contrib/octeon-sdk/octeon-pci-console.c

Modified: head/sys/contrib/octeon-sdk/octeon-pci-console.c
==
--- head/sys/contrib/octeon-sdk/octeon-pci-console.cTue Nov 13 06:28:57 
2012(r242951)
+++ head/sys/contrib/octeon-sdk/octeon-pci-console.cTue Nov 13 07:33:45 
2012(r242952)
@@ -75,7 +75,7 @@
 
 /* The following code is only used in standalone CVMX applications. It does
 not apply for kernel or Linux programming */
-#if defined(OCTEON_TARGET) && !defined(__linux__)
+#if defined(OCTEON_TARGET) && !defined(__linux__) && 
!defined(CVMX_BUILD_FOR_LINUX_KERNEL)
 
 static int cvmx_pci_console_num = 0;
 static int per_core_pci_consoles = 0;
@@ -110,14 +110,14 @@ int  __cvmx_pci_console_write (int fd, c
 
 
 #if !defined(CONFIG_OCTEON_U_BOOT) || (defined(CONFIG_OCTEON_U_BOOT) && 
(defined(CFG_PCI_CONSOLE) || defined(CONFIG_SYS_PCI_CONSOLE)))
-int octeon_pci_console_buffer_free_bytes(uint32_t buffer_size, uint32_t 
wr_idx, uint32_t rd_idx)
+static int octeon_pci_console_buffer_free_bytes(uint32_t buffer_size, uint32_t 
wr_idx, uint32_t rd_idx)
 {
 if (rd_idx >= buffer_size || wr_idx >= buffer_size)
 return -1;
 
 return (((buffer_size -1) - (wr_idx - rd_idx))%buffer_size);
 }
-int octeon_pci_console_buffer_avail_bytes(uint32_t buffer_size, uint32_t 
wr_idx, uint32_t rd_idx)
+static int octeon_pci_console_buffer_avail_bytes(uint32_t buffer_size, 
uint32_t wr_idx, uint32_t rd_idx)
 {
 if (rd_idx >= buffer_size || wr_idx >= buffer_size)
 return -1;
@@ -287,7 +287,7 @@ int octeon_pci_console_host_read_avail(u
 
 /* This code is only available in a kernel or CVMX standalone. It can't be used
 from userspace */
-#if (!defined(CONFIG_OCTEON_U_BOOT) && (!defined(__linux__) || 
defined(__KERNEL__))) || (defined(CONFIG_OCTEON_U_BOOT) && 
(defined(CFG_PCI_CONSOLE) || defined(CONFIG_SYS_PCI_CONSOLE)))
+#if (!defined(CONFIG_OCTEON_U_BOOT) && (!defined(__linux__) || 
defined(__KERNEL__))) || (defined(CONFIG_OCTEON_U_BOOT) && 
(defined(CFG_PCI_CONSOLE) || defined(CONFIG_SYS_PCI_CONSOLE))) || 
defined(CVMX_BUILD_FOR_LINUX_KERNEL)
 
 static octeon_pci_console_t *octeon_pci_console_get_ptr(uint64_t 
console_desc_addr, unsigned int console_num)
 {
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r242953 - head/sys/mips/conf

2012-11-12 Thread Juli Mallett
Author: jmallett
Date: Tue Nov 13 07:34:46 2012
New Revision: 242953
URL: http://svnweb.freebsd.org/changeset/base/242953

Log:
  Add some useful options to consider.

Modified:
  head/sys/mips/conf/OCTEON1

Modified: head/sys/mips/conf/OCTEON1
==
--- head/sys/mips/conf/OCTEON1  Tue Nov 13 07:33:45 2012(r242952)
+++ head/sys/mips/conf/OCTEON1  Tue Nov 13 07:34:46 2012(r242953)
@@ -261,6 +261,9 @@ device  firmware# firmware assist modul
 # Note that 'bpf' is required for DHCP.
 device bpf # Berkeley packet filter
 
+# Hardware watchdog support.
+#deviceocteon_wdog # Octeon hardware watchdog
+
 # USB support
 optionsUSB_DEBUG   # enable debug msgs
 device octusb  # Cavium Octeon on-board USB interface (USB 2.0)
@@ -297,3 +300,14 @@ device rum # Ralink Technology 
RT2501U
 device uath# Atheros AR5523 wireless NICs
 device ural# Ralink Technology RT2500USB wireless NICs
 device zyd # ZyDAS zd1211/zd1211b wireless NICs
+
+# crypto subsystem
+device crypto  # core crypto support
+device cryptodev   # /dev/crypto for access to h/w
+device cryptocteon # Octeon coprocessor 2 crypto offload
+
+# GPIO support
+#devicegpio
+
+# PMC support
+#devicehwpmc
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r242955 - head/sys/mips/cavium

2012-11-12 Thread Juli Mallett
Author: jmallett
Date: Tue Nov 13 07:39:49 2012
New Revision: 242955
URL: http://svnweb.freebsd.org/changeset/base/242955

Log:
  Add preliminary Octeon PCI console support.  Radisys-specific PCI console
  support may follow soon (it uses a proprietary memory layout, but operation
  looks pretty trivial.)

Added:
  head/sys/mips/cavium/octeon_pci_console.c   (contents, props changed)
Modified:
  head/sys/mips/cavium/files.octeon1

Modified: head/sys/mips/cavium/files.octeon1
==
--- head/sys/mips/cavium/files.octeon1  Tue Nov 13 07:39:05 2012
(r242954)
+++ head/sys/mips/cavium/files.octeon1  Tue Nov 13 07:39:49 2012
(r242955)
@@ -45,6 +45,8 @@ mips/cavium/octe/octebus.coptional oc
 
 mips/cavium/octopci.c  optional pci
 mips/cavium/octopci_bus_space.coptional pci
+mips/cavium/octeon_pci_console.c   optional pci
+contrib/octeon-sdk/octeon-pci-console.coptional pci
 
 mips/cavium/usb/octusb.c   optional usb octusb
 mips/cavium/usb/octusb_octeon.coptional usb octusb

Added: head/sys/mips/cavium/octeon_pci_console.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/mips/cavium/octeon_pci_console.c   Tue Nov 13 07:39:49 2012
(r242955)
@@ -0,0 +1,122 @@
+/*-
+ * Copyright (c) 2012 Juli Mallett 
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#include 
+__FBSDID("$FreeBSD$");
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+
+static cn_probe_t opcic_cnprobe;
+static cn_init_t opcic_cninit;
+static cn_term_t opcic_cnterm;
+static cn_getc_t opcic_cngetc;
+static cn_putc_t opcic_cnputc;
+static cn_grab_t opcic_cngrab;
+static cn_ungrab_t opcic_cnungrab;
+
+CONSOLE_DRIVER(opcic);
+
+static void
+opcic_cnprobe(struct consdev *cp)
+{
+   const struct cvmx_bootmem_named_block_desc *pci_console_block;
+
+   cp->cn_pri = CN_DEAD;
+
+   pci_console_block = 
cvmx_bootmem_find_named_block(OCTEON_PCI_CONSOLE_BLOCK_NAME);
+   if (pci_console_block == NULL)
+   return;
+
+   cp->cn_arg = (void *)(uintptr_t)pci_console_block->base_addr;
+   snprintf(cp->cn_name, sizeof cp->cn_name, "opcic@%p", cp->cn_arg);
+   cp->cn_pri = (boothowto & RB_SERIAL) ? CN_REMOTE : CN_NORMAL;
+}
+
+static void
+opcic_cninit(struct consdev *cp)
+{
+   (void)cp;
+}
+
+static void
+opcic_cnterm(struct consdev *cp)
+{
+   (void)cp;
+}
+
+static int
+opcic_cngetc(struct consdev *cp)
+{
+   uint64_t console_desc_addr;
+   char ch;
+   int rv;
+
+   console_desc_addr = (uintptr_t)cp->cn_arg;
+
+   rv = octeon_pci_console_read(console_desc_addr, 0, &ch, 1, 
OCT_PCI_CON_FLAG_NONBLOCK);
+   if (rv != 1)
+   return (-1);
+   return (ch);
+}
+
+static void
+opcic_cnputc(struct consdev *cp, int c)
+{
+   uint64_t console_desc_addr;
+   char ch;
+   int rv;
+
+   console_desc_addr = (uintptr_t)cp->cn_arg;
+   ch = c;
+
+   rv = octeon_pci_console_write(console_desc_addr, 0, &ch, 1, 0);
+   if (rv == -1)
+   panic("%s: octeon_pci_console_write failed.", __func__);
+}
+
+static void
+opcic_cngrab(struct consdev *cp)
+{
+   (void)cp;
+}
+
+static void
+opcic_cnungrab(struct consdev *cp)
+{
+   (void)cp;
+}
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-

Re: svn commit: r242941 - in head/sys: sys vm

2012-11-12 Thread Andre Oppermann

On 13.11.2012 03:50, Alan Cox wrote:

Author: alc
Date: Tue Nov 13 02:50:39 2012
New Revision: 242941
URL: http://svnweb.freebsd.org/changeset/base/242941

Log:
   Replace the single, global page queues lock with per-queue locks on the
   active and inactive paging queues.


Hear hear!  Now if only the cache-poisining splay tree would
go as well...  I still have some patches that macrotize it
so it can rather easily be replaced with something else, eg.
an RB tree or such.

--
Andre

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