Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 20 Nov 2012 17:08:37 +0000 (UTC)
From:      Andre Oppermann <andre@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-user@freebsd.org
Subject:   svn commit: r243345 - in user/andre/tcp_workqueue/sys: amd64/amd64 arm/arm arm/conf arm/xscale/i80321 boot/forth boot/i386/common boot/powerpc/boot1.chrp boot/sparc64/boot1 boot/userboot boot/userb...
Message-ID:  <201211201708.qAKH8bW2060333@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: andre
Date: Tue Nov 20 17:08:37 2012
New Revision: 243345
URL: http://svnweb.freebsd.org/changeset/base/243345

Log:
  Integrate from HEAD @243344.

Added:
  user/andre/tcp_workqueue/sys/mips/cavium/octeon_pci_console.c
     - copied unchanged from r243344, head/sys/mips/cavium/octeon_pci_console.c
  user/andre/tcp_workqueue/sys/ufs/ffs/ffs_suspend.c
     - copied unchanged from r243344, head/sys/ufs/ffs/ffs_suspend.c
Modified:
  user/andre/tcp_workqueue/sys/amd64/amd64/minidump_machdep.c
  user/andre/tcp_workqueue/sys/amd64/amd64/uma_machdep.c
  user/andre/tcp_workqueue/sys/arm/arm/busdma_machdep-v6.c
  user/andre/tcp_workqueue/sys/arm/arm/cpufunc.c
  user/andre/tcp_workqueue/sys/arm/arm/cpufunc_asm_armv7.S
  user/andre/tcp_workqueue/sys/arm/arm/pmap-v6.c
  user/andre/tcp_workqueue/sys/arm/arm/pmap.c
  user/andre/tcp_workqueue/sys/arm/arm/vm_machdep.c
  user/andre/tcp_workqueue/sys/arm/conf/CAMBRIA
  user/andre/tcp_workqueue/sys/arm/xscale/i80321/ep80219_machdep.c
  user/andre/tcp_workqueue/sys/arm/xscale/i80321/iq31244_machdep.c
  user/andre/tcp_workqueue/sys/boot/forth/menu-commands.4th
  user/andre/tcp_workqueue/sys/boot/forth/menu.4th
  user/andre/tcp_workqueue/sys/boot/i386/common/edd.h
  user/andre/tcp_workqueue/sys/boot/powerpc/boot1.chrp/boot1.c
  user/andre/tcp_workqueue/sys/boot/sparc64/boot1/boot1.c
  user/andre/tcp_workqueue/sys/boot/userboot/test/test.c
  user/andre/tcp_workqueue/sys/boot/userboot/userboot.h
  user/andre/tcp_workqueue/sys/boot/userboot/userboot/main.c
  user/andre/tcp_workqueue/sys/bsm/audit_kevents.h
  user/andre/tcp_workqueue/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c
  user/andre/tcp_workqueue/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
  user/andre/tcp_workqueue/sys/cddl/contrib/opensolaris/uts/common/sys/procset.h
  user/andre/tcp_workqueue/sys/compat/freebsd32/freebsd32.h
  user/andre/tcp_workqueue/sys/compat/freebsd32/freebsd32_misc.c
  user/andre/tcp_workqueue/sys/compat/freebsd32/freebsd32_proto.h
  user/andre/tcp_workqueue/sys/compat/freebsd32/freebsd32_syscall.h
  user/andre/tcp_workqueue/sys/compat/freebsd32/freebsd32_syscalls.c
  user/andre/tcp_workqueue/sys/compat/freebsd32/freebsd32_sysent.c
  user/andre/tcp_workqueue/sys/compat/freebsd32/freebsd32_systrace_args.c
  user/andre/tcp_workqueue/sys/compat/freebsd32/syscalls.master
  user/andre/tcp_workqueue/sys/conf/files
  user/andre/tcp_workqueue/sys/conf/files.mips
  user/andre/tcp_workqueue/sys/conf/kern.pre.mk
  user/andre/tcp_workqueue/sys/contrib/octeon-sdk/cvmx-helper-board.c
  user/andre/tcp_workqueue/sys/contrib/octeon-sdk/cvmx-helper-spi.c
  user/andre/tcp_workqueue/sys/contrib/octeon-sdk/cvmx-spi.c
  user/andre/tcp_workqueue/sys/contrib/octeon-sdk/octeon-pci-console.c
  user/andre/tcp_workqueue/sys/dev/acpica/acpivar.h
  user/andre/tcp_workqueue/sys/dev/adb/adb_mouse.c
  user/andre/tcp_workqueue/sys/dev/agp/agp.c
  user/andre/tcp_workqueue/sys/dev/agp/agp_ali.c
  user/andre/tcp_workqueue/sys/dev/agp/agp_amd.c
  user/andre/tcp_workqueue/sys/dev/agp/agp_amd64.c
  user/andre/tcp_workqueue/sys/dev/agp/agp_apple.c
  user/andre/tcp_workqueue/sys/dev/agp/agp_ati.c
  user/andre/tcp_workqueue/sys/dev/agp/agp_i810.c
  user/andre/tcp_workqueue/sys/dev/agp/agp_intel.c
  user/andre/tcp_workqueue/sys/dev/agp/agp_nvidia.c
  user/andre/tcp_workqueue/sys/dev/agp/agp_sis.c
  user/andre/tcp_workqueue/sys/dev/agp/agp_via.c
  user/andre/tcp_workqueue/sys/dev/aic7xxx/aicasm/aicasm_gram.y
  user/andre/tcp_workqueue/sys/dev/ath/ath_hal/ar5210/ar5210.h
  user/andre/tcp_workqueue/sys/dev/ath/ath_hal/ar5210/ar5210_misc.c
  user/andre/tcp_workqueue/sys/dev/ath/ath_hal/ar5210/ar5210_recv.c
  user/andre/tcp_workqueue/sys/dev/ath/ath_hal/ar5210/ar5210_reset.c
  user/andre/tcp_workqueue/sys/dev/ath/ath_hal/ar5210/ar5210_xmit.c
  user/andre/tcp_workqueue/sys/dev/ath/ath_hal/ar5210/ar5210desc.h
  user/andre/tcp_workqueue/sys/dev/ath/ath_hal/ar5210/ar5210reg.h
  user/andre/tcp_workqueue/sys/dev/ath/ath_hal/ar5211/ar5211desc.h
  user/andre/tcp_workqueue/sys/dev/ath/ath_hal/ar5212/ar5212_recv.c
  user/andre/tcp_workqueue/sys/dev/ath/ath_hal/ar5212/ar5212_xmit.c
  user/andre/tcp_workqueue/sys/dev/ath/ath_hal/ar5212/ar5212desc.h
  user/andre/tcp_workqueue/sys/dev/ath/ath_hal/ar5416/ar5416desc.h
  user/andre/tcp_workqueue/sys/dev/ath/if_ath.c
  user/andre/tcp_workqueue/sys/dev/ath/if_ath_alq.c
  user/andre/tcp_workqueue/sys/dev/ath/if_ath_alq.h
  user/andre/tcp_workqueue/sys/dev/ath/if_ath_keycache.c
  user/andre/tcp_workqueue/sys/dev/ath/if_ath_rx.c
  user/andre/tcp_workqueue/sys/dev/ath/if_ath_sysctl.c
  user/andre/tcp_workqueue/sys/dev/ath/if_ath_tx.c
  user/andre/tcp_workqueue/sys/dev/ath/if_ath_tx.h
  user/andre/tcp_workqueue/sys/dev/ath/if_ath_tx_edma.c
  user/andre/tcp_workqueue/sys/dev/cxgbe/tom/t4_listen.c
  user/andre/tcp_workqueue/sys/dev/fdc/fdc.c
  user/andre/tcp_workqueue/sys/dev/iicbus/iic.c
  user/andre/tcp_workqueue/sys/dev/mfi/mfi_syspd.c
  user/andre/tcp_workqueue/sys/dev/sio/sio_isa.c
  user/andre/tcp_workqueue/sys/dev/sound/pci/hda/hdaa.c
  user/andre/tcp_workqueue/sys/dev/sound/pcm/channel.c
  user/andre/tcp_workqueue/sys/dev/sound/pcm/feeder_matrix.c
  user/andre/tcp_workqueue/sys/dev/sound/pcm/matrix.h
  user/andre/tcp_workqueue/sys/dev/sound/pcm/matrix_map.h
  user/andre/tcp_workqueue/sys/dev/uart/uart_bus_isa.c
  user/andre/tcp_workqueue/sys/dev/xen/netback/netback_unit_tests.c
  user/andre/tcp_workqueue/sys/fs/devfs/devfs_devs.c
  user/andre/tcp_workqueue/sys/fs/ext2fs/ext2_vfsops.c
  user/andre/tcp_workqueue/sys/fs/msdosfs/msdosfs_denode.c
  user/andre/tcp_workqueue/sys/fs/nfsclient/nfs_clnode.c
  user/andre/tcp_workqueue/sys/fs/nfsclient/nfs_clport.c
  user/andre/tcp_workqueue/sys/fs/nullfs/null_subr.c
  user/andre/tcp_workqueue/sys/fs/smbfs/smbfs_node.c
  user/andre/tcp_workqueue/sys/fs/smbfs/smbfs_vnops.c
  user/andre/tcp_workqueue/sys/fs/unionfs/union_subr.c
  user/andre/tcp_workqueue/sys/geom/bde/g_bde.c
  user/andre/tcp_workqueue/sys/geom/cache/g_cache.c
  user/andre/tcp_workqueue/sys/geom/geom.h
  user/andre/tcp_workqueue/sys/geom/geom_aes.c
  user/andre/tcp_workqueue/sys/geom/geom_dev.c
  user/andre/tcp_workqueue/sys/geom/geom_mbr.c
  user/andre/tcp_workqueue/sys/geom/geom_slice.c
  user/andre/tcp_workqueue/sys/geom/geom_slice.h
  user/andre/tcp_workqueue/sys/geom/label/g_label.c
  user/andre/tcp_workqueue/sys/geom/mountver/g_mountver.c
  user/andre/tcp_workqueue/sys/geom/multipath/g_multipath.c
  user/andre/tcp_workqueue/sys/geom/nop/g_nop.c
  user/andre/tcp_workqueue/sys/geom/sched/g_sched.c
  user/andre/tcp_workqueue/sys/gnu/fs/reiserfs/reiserfs_inode.c
  user/andre/tcp_workqueue/sys/i386/xen/clock.c
  user/andre/tcp_workqueue/sys/ia64/ia64/uma_machdep.c
  user/andre/tcp_workqueue/sys/kern/init_sysent.c
  user/andre/tcp_workqueue/sys/kern/kern_exit.c
  user/andre/tcp_workqueue/sys/kern/kern_ktr.c
  user/andre/tcp_workqueue/sys/kern/kern_proc.c
  user/andre/tcp_workqueue/sys/kern/kern_prot.c
  user/andre/tcp_workqueue/sys/kern/kern_racct.c
  user/andre/tcp_workqueue/sys/kern/sched_ule.c
  user/andre/tcp_workqueue/sys/kern/subr_lock.c
  user/andre/tcp_workqueue/sys/kern/subr_smp.c
  user/andre/tcp_workqueue/sys/kern/subr_taskqueue.c
  user/andre/tcp_workqueue/sys/kern/sys_procdesc.c
  user/andre/tcp_workqueue/sys/kern/syscalls.c
  user/andre/tcp_workqueue/sys/kern/syscalls.master
  user/andre/tcp_workqueue/sys/kern/systrace_args.c
  user/andre/tcp_workqueue/sys/kern/tty_pts.c
  user/andre/tcp_workqueue/sys/kern/uipc_usrreq.c
  user/andre/tcp_workqueue/sys/kern/vfs_subr.c
  user/andre/tcp_workqueue/sys/kern/vnode_if.src
  user/andre/tcp_workqueue/sys/mips/atheros/files.ar71xx
  user/andre/tcp_workqueue/sys/mips/cavium/files.octeon1
  user/andre/tcp_workqueue/sys/mips/cavium/octe/ethernet-tx.c
  user/andre/tcp_workqueue/sys/mips/cavium/octe/ethernet.c
  user/andre/tcp_workqueue/sys/mips/cavium/octeon_machdep.c
  user/andre/tcp_workqueue/sys/mips/conf/AR71XX_BASE
  user/andre/tcp_workqueue/sys/mips/conf/AR724X_BASE
  user/andre/tcp_workqueue/sys/mips/conf/AR91XX_BASE
  user/andre/tcp_workqueue/sys/mips/conf/OCTEON1
  user/andre/tcp_workqueue/sys/mips/conf/PB92
  user/andre/tcp_workqueue/sys/mips/include/pmap.h
  user/andre/tcp_workqueue/sys/mips/mips/pmap.c
  user/andre/tcp_workqueue/sys/mips/mips/support.S
  user/andre/tcp_workqueue/sys/mips/mips/uma_machdep.c
  user/andre/tcp_workqueue/sys/modules/Makefile
  user/andre/tcp_workqueue/sys/modules/agp/Makefile
  user/andre/tcp_workqueue/sys/modules/mthca/Makefile
  user/andre/tcp_workqueue/sys/modules/ufs/Makefile
  user/andre/tcp_workqueue/sys/net/rtsock.c
  user/andre/tcp_workqueue/sys/netinet/sctp_constants.h
  user/andre/tcp_workqueue/sys/netinet/sctp_indata.c
  user/andre/tcp_workqueue/sys/netinet/sctp_input.c
  user/andre/tcp_workqueue/sys/netinet/sctp_output.c
  user/andre/tcp_workqueue/sys/netinet/sctp_pcb.c
  user/andre/tcp_workqueue/sys/netinet/sctp_pcb.h
  user/andre/tcp_workqueue/sys/netinet/sctp_sysctl.c
  user/andre/tcp_workqueue/sys/netinet/sctp_timer.c
  user/andre/tcp_workqueue/sys/netinet/sctputil.c
  user/andre/tcp_workqueue/sys/netinet/sctputil.h
  user/andre/tcp_workqueue/sys/netinet6/icmp6.c
  user/andre/tcp_workqueue/sys/netinet6/in6_src.c
  user/andre/tcp_workqueue/sys/netinet6/ip6_input.c
  user/andre/tcp_workqueue/sys/netinet6/ip6_mroute.c
  user/andre/tcp_workqueue/sys/netinet6/nd6.c
  user/andre/tcp_workqueue/sys/netinet6/nd6_rtr.c
  user/andre/tcp_workqueue/sys/netinet6/scope6.c
  user/andre/tcp_workqueue/sys/netinet6/sctp6_usrreq.c
  user/andre/tcp_workqueue/sys/netinet6/sctp6_var.h
  user/andre/tcp_workqueue/sys/nfsclient/nfs_node.c
  user/andre/tcp_workqueue/sys/ofed/drivers/infiniband/core/cma.c
  user/andre/tcp_workqueue/sys/ofed/drivers/infiniband/core/ud_header.c
  user/andre/tcp_workqueue/sys/ofed/drivers/infiniband/ulp/sdp/sdp_rx.c
  user/andre/tcp_workqueue/sys/ofed/include/linux/pci.h
  user/andre/tcp_workqueue/sys/powerpc/aim/mmu_oea64.c
  user/andre/tcp_workqueue/sys/powerpc/aim/slb.c
  user/andre/tcp_workqueue/sys/powerpc/aim/uma_machdep.c
  user/andre/tcp_workqueue/sys/sparc64/include/ktr.h
  user/andre/tcp_workqueue/sys/sparc64/sparc64/pmap.c
  user/andre/tcp_workqueue/sys/sparc64/sparc64/vm_machdep.c
  user/andre/tcp_workqueue/sys/sys/ktr.h
  user/andre/tcp_workqueue/sys/sys/lock.h
  user/andre/tcp_workqueue/sys/sys/param.h
  user/andre/tcp_workqueue/sys/sys/proc.h
  user/andre/tcp_workqueue/sys/sys/resource.h
  user/andre/tcp_workqueue/sys/sys/smp.h
  user/andre/tcp_workqueue/sys/sys/syscall.h
  user/andre/tcp_workqueue/sys/sys/syscall.mk
  user/andre/tcp_workqueue/sys/sys/syscallsubr.h
  user/andre/tcp_workqueue/sys/sys/sysproto.h
  user/andre/tcp_workqueue/sys/sys/vmmeter.h
  user/andre/tcp_workqueue/sys/sys/wait.h
  user/andre/tcp_workqueue/sys/ufs/ffs/ffs_extern.h
  user/andre/tcp_workqueue/sys/ufs/ffs/ffs_softdep.c
  user/andre/tcp_workqueue/sys/ufs/ffs/ffs_vfsops.c
  user/andre/tcp_workqueue/sys/ufs/ffs/fs.h
  user/andre/tcp_workqueue/sys/ufs/ufs/ufsmount.h
  user/andre/tcp_workqueue/sys/vm/device_pager.c
  user/andre/tcp_workqueue/sys/vm/sg_pager.c
  user/andre/tcp_workqueue/sys/vm/swap_pager.c
  user/andre/tcp_workqueue/sys/vm/vm_fault.c
  user/andre/tcp_workqueue/sys/vm/vm_kern.c
  user/andre/tcp_workqueue/sys/vm/vm_page.c
  user/andre/tcp_workqueue/sys/vm/vm_page.h
  user/andre/tcp_workqueue/sys/vm/vm_pageout.c
  user/andre/tcp_workqueue/sys/vm/vm_phys.h
Directory Properties:
  user/andre/tcp_workqueue/sys/   (props changed)
  user/andre/tcp_workqueue/sys/boot/   (props changed)
  user/andre/tcp_workqueue/sys/boot/powerpc/boot1.chrp/   (props changed)
  user/andre/tcp_workqueue/sys/cddl/contrib/opensolaris/   (props changed)
  user/andre/tcp_workqueue/sys/conf/   (props changed)
  user/andre/tcp_workqueue/sys/contrib/octeon-sdk/   (props changed)

Modified: user/andre/tcp_workqueue/sys/amd64/amd64/minidump_machdep.c
==============================================================================
--- user/andre/tcp_workqueue/sys/amd64/amd64/minidump_machdep.c	Tue Nov 20 17:04:52 2012	(r243344)
+++ user/andre/tcp_workqueue/sys/amd64/amd64/minidump_machdep.c	Tue Nov 20 17:08:37 2012	(r243345)
@@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$");
 #include <sys/watchdog.h>
 #include <vm/vm.h>
 #include <vm/vm_page.h>
+#include <vm/vm_phys.h>
 #include <vm/pmap.h>
 #include <machine/atomic.h>
 #include <machine/elf.h>

Modified: user/andre/tcp_workqueue/sys/amd64/amd64/uma_machdep.c
==============================================================================
--- user/andre/tcp_workqueue/sys/amd64/amd64/uma_machdep.c	Tue Nov 20 17:04:52 2012	(r243344)
+++ user/andre/tcp_workqueue/sys/amd64/amd64/uma_machdep.c	Tue Nov 20 17:08:37 2012	(r243345)
@@ -29,6 +29,7 @@ __FBSDID("$FreeBSD$");
 
 #include <sys/param.h>
 #include <sys/lock.h>
+#include <sys/malloc.h>
 #include <sys/mutex.h>
 #include <sys/systm.h>
 #include <vm/vm.h>
@@ -48,12 +49,7 @@ uma_small_alloc(uma_zone_t zone, int byt
 	int pflags;
 
 	*flags = UMA_SLAB_PRIV;
-	if ((wait & (M_NOWAIT|M_USE_RESERVE)) == M_NOWAIT)
-		pflags = VM_ALLOC_INTERRUPT | VM_ALLOC_NOOBJ | VM_ALLOC_WIRED;
-	else
-		pflags = VM_ALLOC_SYSTEM | VM_ALLOC_NOOBJ | VM_ALLOC_WIRED;
-	if (wait & M_ZERO)
-		pflags |= VM_ALLOC_ZERO;
+	pflags = malloc2vm_flags(wait) | VM_ALLOC_NOOBJ | VM_ALLOC_WIRED;
 	for (;;) {
 		m = vm_page_alloc(NULL, 0, pflags);
 		if (m == NULL) {

Modified: user/andre/tcp_workqueue/sys/arm/arm/busdma_machdep-v6.c
==============================================================================
--- user/andre/tcp_workqueue/sys/arm/arm/busdma_machdep-v6.c	Tue Nov 20 17:04:52 2012	(r243344)
+++ user/andre/tcp_workqueue/sys/arm/arm/busdma_machdep-v6.c	Tue Nov 20 17:08:37 2012	(r243345)
@@ -1463,7 +1463,6 @@ add_bounce_page(bus_dma_tag_t dmat, bus_
 	struct bounce_zone *bz;
 	struct bounce_page *bpage;
 
-	printf("add bounce page\n");
 	KASSERT(dmat->bounce_zone != NULL, ("no bounce zone in dma tag"));
 	KASSERT(map != NULL,
 	    ("add_bounce_page: bad map %p", map));

Modified: user/andre/tcp_workqueue/sys/arm/arm/cpufunc.c
==============================================================================
--- user/andre/tcp_workqueue/sys/arm/arm/cpufunc.c	Tue Nov 20 17:04:52 2012	(r243344)
+++ user/andre/tcp_workqueue/sys/arm/arm/cpufunc.c	Tue Nov 20 17:08:37 2012	(r243345)
@@ -1047,7 +1047,7 @@ struct cpu_functions cortexa_cpufuncs = 
 	
 	/* TLB functions */
 	
-	arm11_tlb_flushID,              /* tlb_flushID          */
+	armv7_tlb_flushID,              /* tlb_flushID          */
 	armv7_tlb_flushID_SE,           /* tlb_flushID_SE       */
 	arm11_tlb_flushI,               /* tlb_flushI           */
 	arm11_tlb_flushI_SE,            /* tlb_flushI_SE        */
@@ -1067,7 +1067,8 @@ struct cpu_functions cortexa_cpufuncs = 
 	armv7_idcache_wbinv_all,        /* idcache_wbinv_all    */
 	armv7_idcache_wbinv_range,      /* idcache_wbinv_range  */
 	
-	/* Note: From OMAP4 the L2 ops are filled in when the
+	/* 
+	 * Note: For CPUs using the PL310 the L2 ops are filled in when the
 	 * L2 cache controller is actually enabled.
 	 */
 	cpufunc_nullop,                 /* l2cache_wbinv_all    */

Modified: user/andre/tcp_workqueue/sys/arm/arm/cpufunc_asm_armv7.S
==============================================================================
--- user/andre/tcp_workqueue/sys/arm/arm/cpufunc_asm_armv7.S	Tue Nov 20 17:04:52 2012	(r243344)
+++ user/andre/tcp_workqueue/sys/arm/arm/cpufunc_asm_armv7.S	Tue Nov 20 17:08:37 2012	(r243345)
@@ -70,7 +70,11 @@ ENTRY(armv7_setttb)
 				
 	orr 	r0, r0, #PT_ATTR
  	mcr	p15, 0, r0, c2, c0, 0	/* Translation Table Base Register 0 (TTBR0) */
+#ifdef SMP
+ 	mcr     p15, 0, r0, c8, c3, 0   /* invalidate I+D TLBs Inner Shareable*/
+#else
  	mcr     p15, 0, r0, c8, c7, 0   /* invalidate I+D TLBs */
+#endif
  	dsb
  	isb
 	RET
@@ -78,11 +82,12 @@ ENTRY(armv7_setttb)
 ENTRY(armv7_tlb_flushID)
 	dsb
 #ifdef SMP
-	mcr 	p15, 0, r0, c8, c3, 0
+	mcr	p15, 0, r0, c8, c3, 0	/* flush I+D tlb */
+	mcr	p15, 0, r0, c7, c1, 6	/* flush BTB */
 #else
 	mcr	p15, 0, r0, c8, c7, 0	/* flush I+D tlb */
-#endif
 	mcr	p15, 0, r0, c7, c5, 6	/* flush BTB */
+#endif
 	dsb
 	isb
 	mov	pc, lr
@@ -91,11 +96,12 @@ ENTRY(armv7_tlb_flushID_SE)
 	ldr	r1, .Lpage_mask
 	bic	r0, r0, r1
 #ifdef SMP
-	mcr	p15, 0, r0, c8, c3, 1	/* flush D tlb single entry */
+	mcr	p15, 0, r0, c8, c3, 1	/* flush D tlb single entry Inner Shareable*/
+	mcr	p15, 0, r0, c7, c1, 6	/* flush BTB Inner Shareable */
 #else
 	mcr	p15, 0, r0, c8, c7, 1	/* flush D tlb single entry */
-#endif
 	mcr	p15, 0, r0, c7, c5, 6	/* flush BTB */
+#endif
 	dsb
 	isb
 	mov	pc, lr
@@ -155,7 +161,11 @@ Finished:
 ENTRY(armv7_idcache_wbinv_all)
 	stmdb	sp!, {lr}
 	bl armv7_dcache_wbinv_all
+#ifdef SMP
+	mcr	p15, 0, r0, c7, c1, 0	/* Invalidate all I caches to PoU (ICIALLUIS) */
+#else
 	mcr	p15, 0, r0, c7, c5, 0	/* Invalidate all I caches to PoU (ICIALLU) */
+#endif
 	dsb
 	isb
 	ldmia	sp!, {lr}
@@ -251,7 +261,11 @@ ENTRY(armv7_context_switch)
 	orr     r0, r0, #PT_ATTR
 			
 	mcr	p15, 0, r0, c2, c0, 0	/* set the new TTB */
+#ifdef SMP
+	mcr	p15, 0, r0, c8, c3, 0	/* and flush the I+D tlbs Inner Sharable */
+#else
 	mcr	p15, 0, r0, c8, c7, 0	/* and flush the I+D tlbs */
+#endif
 	dsb
 	isb
 	RET

Modified: user/andre/tcp_workqueue/sys/arm/arm/pmap-v6.c
==============================================================================
--- user/andre/tcp_workqueue/sys/arm/arm/pmap-v6.c	Tue Nov 20 17:04:52 2012	(r243344)
+++ user/andre/tcp_workqueue/sys/arm/arm/pmap-v6.c	Tue Nov 20 17:08:37 2012	(r243345)
@@ -2361,8 +2361,10 @@ pmap_change_attr(vm_offset_t sva, vm_siz
 	 * Only supported on kernel virtual addresses, including the direct
 	 * map but excluding the recursive map.
 	 */
-	if (base < DMAP_MIN_ADDRESS)
+	if (base < DMAP_MIN_ADDRESS) {
+		PMAP_UNLOCK(kernel_pmap);
 		return (EINVAL);
+	}
 #endif
 	for (tmpva = base; tmpva < base + size; ) {
 		next_bucket = L2_NEXT_BUCKET(tmpva);
@@ -2377,8 +2379,10 @@ pmap_change_attr(vm_offset_t sva, vm_siz
 
 		ptep = &l2b->l2b_kva[l2pte_index(tmpva)];
 
-		if (*ptep == 0)
+		if (*ptep == 0) {
+			PMAP_UNLOCK(kernel_pmap);
 			return(EINVAL);
+		}
 
 		pte = *ptep &~ L2_S_CACHE_MASK;
 		cpu_idcache_wbinv_range(tmpva, PAGE_SIZE);

Modified: user/andre/tcp_workqueue/sys/arm/arm/pmap.c
==============================================================================
--- user/andre/tcp_workqueue/sys/arm/arm/pmap.c	Tue Nov 20 17:04:52 2012	(r243344)
+++ user/andre/tcp_workqueue/sys/arm/arm/pmap.c	Tue Nov 20 17:08:37 2012	(r243345)
@@ -165,6 +165,7 @@ __FBSDID("$FreeBSD$");
 #include <vm/vm_map.h>
 #include <vm/vm_page.h>
 #include <vm/vm_pageout.h>
+#include <vm/vm_phys.h>
 #include <vm/vm_extern.h>
 
 #include <machine/md_var.h>

Modified: user/andre/tcp_workqueue/sys/arm/arm/vm_machdep.c
==============================================================================
--- user/andre/tcp_workqueue/sys/arm/arm/vm_machdep.c	Tue Nov 20 17:04:52 2012	(r243344)
+++ user/andre/tcp_workqueue/sys/arm/arm/vm_machdep.c	Tue Nov 20 17:08:37 2012	(r243345)
@@ -651,12 +651,7 @@ uma_small_alloc(uma_zone_t zone, int byt
 			ret = ((void *)kmem_malloc(kmem_map, bytes, M_NOWAIT));
 			return (ret);
 		}
-		if ((wait & (M_NOWAIT|M_USE_RESERVE)) == M_NOWAIT)
-			pflags = VM_ALLOC_INTERRUPT | VM_ALLOC_WIRED;
-		else
-			pflags = VM_ALLOC_SYSTEM | VM_ALLOC_WIRED;
-		if (wait & M_ZERO)
-			pflags |= VM_ALLOC_ZERO;
+		pflags = malloc2vm_flags(wait) | VM_ALLOC_WIRED;
 		for (;;) {
 			m = vm_page_alloc(NULL, 0, pflags | VM_ALLOC_NOOBJ);
 			if (m == NULL) {

Modified: user/andre/tcp_workqueue/sys/arm/conf/CAMBRIA
==============================================================================
--- user/andre/tcp_workqueue/sys/arm/conf/CAMBRIA	Tue Nov 20 17:04:52 2012	(r243344)
+++ user/andre/tcp_workqueue/sys/arm/conf/CAMBRIA	Tue Nov 20 17:08:37 2012	(r243345)
@@ -126,26 +126,15 @@ device		ath		# Atheros NICs
 device		ath_pci		# Atheros pci/cardbus glue
 options 	ATH_DEBUG
 options 	ATH_DIAGAPI
+options 	ATH_ENABLE_DFS
+options 	ATH_ENABLE_11N
 #options 	ATH_TX99_DIAG
 device		ath_rate_sample	# SampleRate tx rate control for ath
 
-#options 	AH_DEBUG
-#options 	AH_ASSERT
+options 	AH_DEBUG
 options 	AH_PRIVATE_DIAG
-#device		ath_ar5210
-#device		ath_ar5211
-#
-device		ath_ar5212
-#device		ath_rf2413
-#device		ath_rf2425		# NB:supports 2417 too
-#device		ath_rf5111
-device		ath_rf5112
-device		ath_rf5413
-#
-#device		ath_ar5416
 options 	AH_SUPPORT_AR5416	# NB: for 11n descriptor format
-#device		ath_ar9160
-#device		ath_ar9280
+device		ath_hal
 
 # NB: 2 USB 2.0 ports standard
 device		usb

Modified: user/andre/tcp_workqueue/sys/arm/xscale/i80321/ep80219_machdep.c
==============================================================================
--- user/andre/tcp_workqueue/sys/arm/xscale/i80321/ep80219_machdep.c	Tue Nov 20 17:04:52 2012	(r243344)
+++ user/andre/tcp_workqueue/sys/arm/xscale/i80321/ep80219_machdep.c	Tue Nov 20 17:08:37 2012	(r243345)
@@ -95,11 +95,11 @@ __FBSDID("$FreeBSD$");
 #include <arm/xscale/i80321/iq80321reg.h>
 #include <arm/xscale/i80321/obiovar.h>
 
-#define KERNEL_PT_SYS			0	/* Page table for mapping proc0 zero page */
-#define KERNEL_PT_IOPXS			1
-#define KERNEL_PT_BEFOREKERN	2
-#define KERNEL_PT_AFKERNEL		3	/* L2 table for mapping after kernel */
-#define KERNEL_PT_AFKERNEL_NUM	9
+#define	KERNEL_PT_SYS		0	/* Page table for mapping proc0 zero page */
+#define	KERNEL_PT_IOPXS		1
+#define	KERNEL_PT_BEFOREKERN	2
+#define	KERNEL_PT_AFKERNEL	3	/* L2 table for mapping after kernel */
+#define	KERNEL_PT_AFKERNEL_NUM	9
 
 /* this should be evenly divisable by PAGE_SIZE / L2_TABLE_SIZE_REAL (or 4) */
 #define NUM_KERNEL_PTS		(KERNEL_PT_AFKERNEL + KERNEL_PT_AFKERNEL_NUM)
@@ -184,10 +184,13 @@ initarm(struct arm_boot_params *abp)
 	pcpu_init(pcpup, 0, sizeof(struct pcpu));
 	PCPU_SET(curthread, &thread0);
 
+	/* Do basic tuning, hz etc */
+	init_param1();
+
 	freemempos = 0xa0200000;
 	/* Define a macro to simplify memory allocation */
 #define	valloc_pages(var, np)			\
-	alloc_pages((var).pv_pa, (np));				\
+	alloc_pages((var).pv_pa, (np));		\
 	(var).pv_va = (var).pv_pa + 0x20000000;
 
 #define alloc_pages(var, np)			\
@@ -195,16 +198,13 @@ initarm(struct arm_boot_params *abp)
 	(var) = freemempos;		\
 	memset((char *)(var), 0, ((np) * PAGE_SIZE));
 
-	/* Do basic tuning, hz etc */
-	init_param1();
-
 	while (((freemempos - L1_TABLE_SIZE) & (L1_TABLE_SIZE - 1)) != 0)
 		freemempos -= PAGE_SIZE;
 	valloc_pages(kernel_l1pt, L1_TABLE_SIZE / PAGE_SIZE);
 	for (loop = 0; loop < NUM_KERNEL_PTS; ++loop) {
 		if (!(loop % (PAGE_SIZE / L2_TABLE_SIZE_REAL))) {
 			valloc_pages(kernel_pt_table[loop],
-						 L2_TABLE_SIZE / PAGE_SIZE);
+			    L2_TABLE_SIZE / PAGE_SIZE);
 		} else {
 			kernel_pt_table[loop].pv_pa = freemempos +
 			    (loop % (PAGE_SIZE / L2_TABLE_SIZE_REAL)) *
@@ -237,15 +237,14 @@ initarm(struct arm_boot_params *abp)
 	freemempos -= PAGE_SIZE;
 	freemem_pt = trunc_page(freemem_pt);
 	freemem_after = freemempos - ((freemem_pt - 0xa0100000) /
-								  PAGE_SIZE) * sizeof(struct arm_small_page);
-	arm_add_smallalloc_pages((void *)(freemem_after + 0x20000000)
-							 , (void *)0xc0100000, freemem_pt - 0xa0100000, 1);
+	    PAGE_SIZE) * sizeof(struct arm_small_page);
+	arm_add_smallalloc_pages((void *)(freemem_after + 0x20000000),
+	    (void *)0xc0100000, freemem_pt - 0xa0100000, 1);
 	freemem_after -= ((freemem_after - 0xa0001000) / PAGE_SIZE) *
 	    sizeof(struct arm_small_page);
 	arm_add_smallalloc_pages((void *)(freemem_after + 0x20000000),
-							 (void *)0xc0001000,
-							 trunc_page(freemem_after) - 0xa0001000, 0);
-	
+	    (void *)0xc0001000, trunc_page(freemem_after) - 0xa0001000, 0);
+
 	freemempos = trunc_page(freemem_after);
 	freemempos -= PAGE_SIZE;
 #endif
@@ -265,27 +264,27 @@ initarm(struct arm_boot_params *abp)
 
 	/* Map the L2 pages tables in the L1 page table */
 	pmap_link_l2pt(l1pagetable, ARM_VECTORS_HIGH & ~(0x00100000 - 1),
-				   &kernel_pt_table[KERNEL_PT_SYS]);
+	    &kernel_pt_table[KERNEL_PT_SYS]);
 	pmap_link_l2pt(l1pagetable, IQ80321_IOPXS_VBASE,
-				   &kernel_pt_table[KERNEL_PT_IOPXS]);
+	    &kernel_pt_table[KERNEL_PT_IOPXS]);
 	pmap_link_l2pt(l1pagetable, KERNBASE,
-				   &kernel_pt_table[KERNEL_PT_BEFOREKERN]);
+	    &kernel_pt_table[KERNEL_PT_BEFOREKERN]);
 	pmap_map_chunk(l1pagetable, KERNBASE, IQ80321_SDRAM_START, 0x100000,
-				   VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE);
+	    VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE);
 	pmap_map_chunk(l1pagetable, KERNBASE + 0x100000, IQ80321_SDRAM_START + 0x100000,
-				   0x100000, VM_PROT_READ|VM_PROT_WRITE, PTE_PAGETABLE);
+	    0x100000, VM_PROT_READ|VM_PROT_WRITE, PTE_PAGETABLE);
 	pmap_map_chunk(l1pagetable, KERNBASE + 0x200000, IQ80321_SDRAM_START + 0x200000,
-				   (((uint32_t)(lastaddr) - KERNBASE - 0x200000) + L1_S_SIZE) & ~(L1_S_SIZE - 1),
-				   VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE);
+	    (((uint32_t)(lastaddr) - KERNBASE - 0x200000) + L1_S_SIZE) & ~(L1_S_SIZE - 1),
+	    VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE);
 	freemem_after = ((int)lastaddr + PAGE_SIZE) & ~(PAGE_SIZE - 1);
 	afterkern = round_page(((vm_offset_t)lastaddr + L1_S_SIZE) & ~(L1_S_SIZE
-																   - 1));
+	    - 1));
 	for (i = 0; i < KERNEL_PT_AFKERNEL_NUM; i++) {
 		pmap_link_l2pt(l1pagetable, afterkern + i * 0x00100000,
-					   &kernel_pt_table[KERNEL_PT_AFKERNEL + i]);
+		    &kernel_pt_table[KERNEL_PT_AFKERNEL + i]);
 	}
 	pmap_map_entry(l1pagetable, afterkern, minidataclean.pv_pa,
-				   VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE);
+	    VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE);
 	
 
 #ifdef ARM_USE_SMALL_ALLOC
@@ -299,11 +298,11 @@ initarm(struct arm_boot_params *abp)
 
 	/* Map the Mini-Data cache clean area. */
 	xscale_setup_minidata(l1pagetable, afterkern,
-						  minidataclean.pv_pa);
+	    minidataclean.pv_pa);
 
 	/* Map the vector page. */
 	pmap_map_entry(l1pagetable, ARM_VECTORS_HIGH, systempage.pv_pa,
-				   VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE);
+	    VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE);
 	pmap_devmap_bootstrap(l1pagetable, ep80219_devmap);
 	/*
 	 * Give the XScale global cache clean code an appropriately
@@ -360,10 +359,15 @@ initarm(struct arm_boot_params *abp)
 
 	arm_vector_init(ARM_VECTORS_HIGH, ARM_VEC_ALL);
 	pmap_curmaxkvaddr = afterkern + PAGE_SIZE;
+	/*
+	 * ARM_USE_SMALL_ALLOC uses dump_avail, so it must be filled before
+	 * calling pmap_bootstrap.
+	 */
 	dump_avail[0] = 0xa0000000;
 	dump_avail[1] = 0xa0000000 + memsize;
 	dump_avail[2] = 0;
 	dump_avail[3] = 0;
+					
 	pmap_bootstrap(pmap_curmaxkvaddr,
 	    0xd0000000, &kernel_l1pt);
 	msgbufp = (void*)msgbufpv.pv_va;

Modified: user/andre/tcp_workqueue/sys/arm/xscale/i80321/iq31244_machdep.c
==============================================================================
--- user/andre/tcp_workqueue/sys/arm/xscale/i80321/iq31244_machdep.c	Tue Nov 20 17:04:52 2012	(r243344)
+++ user/andre/tcp_workqueue/sys/arm/xscale/i80321/iq31244_machdep.c	Tue Nov 20 17:08:37 2012	(r243345)
@@ -95,10 +95,10 @@ __FBSDID("$FreeBSD$");
 #include <arm/xscale/i80321/iq80321reg.h>
 #include <arm/xscale/i80321/obiovar.h>
 
-#define KERNEL_PT_SYS		0	/* Page table for mapping proc0 zero page */
+#define	KERNEL_PT_SYS		0	/* Page table for mapping proc0 zero page */
 #define	KERNEL_PT_IOPXS		1
-#define KERNEL_PT_BEFOREKERN	2
-#define KERNEL_PT_AFKERNEL	3	/* L2 table for mapping after kernel */
+#define	KERNEL_PT_BEFOREKERN	2
+#define	KERNEL_PT_AFKERNEL	3	/* L2 table for mapping after kernel */
 #define	KERNEL_PT_AFKERNEL_NUM	9
 
 /* this should be evenly divisable by PAGE_SIZE / L2_TABLE_SIZE_REAL (or 4) */
@@ -187,7 +187,7 @@ initarm(struct arm_boot_params *abp)
 
 	/* Do basic tuning, hz etc */
 	init_param1();
-		
+
 	freemempos = 0xa0200000;
 	/* Define a macro to simplify memory allocation */
 #define	valloc_pages(var, np)			\
@@ -239,12 +239,13 @@ initarm(struct arm_boot_params *abp)
 	freemem_pt = trunc_page(freemem_pt);
 	freemem_after = freemempos - ((freemem_pt - 0xa0100000) /
 	    PAGE_SIZE) * sizeof(struct arm_small_page);
-	arm_add_smallalloc_pages((void *)(freemem_after + 0x20000000)
-	    , (void *)0xc0100000, freemem_pt - 0xa0100000, 1);
+	arm_add_smallalloc_pages((void *)(freemem_after + 0x20000000),
+	    (void *)0xc0100000, freemem_pt - 0xa0100000, 1);
 	freemem_after -= ((freemem_after - 0xa0001000) / PAGE_SIZE) *
 	    sizeof(struct arm_small_page);
-	arm_add_smallalloc_pages((void *)(freemem_after + 0x20000000)
-	, (void *)0xc0001000, trunc_page(freemem_after) - 0xa0001000, 0);
+	arm_add_smallalloc_pages((void *)(freemem_after + 0x20000000),
+	    (void *)0xc0001000, trunc_page(freemem_after) - 0xa0001000, 0);
+
 	freemempos = trunc_page(freemem_after);
 	freemempos -= PAGE_SIZE;
 #endif
@@ -266,7 +267,7 @@ initarm(struct arm_boot_params *abp)
 	pmap_link_l2pt(l1pagetable, ARM_VECTORS_HIGH & ~(0x00100000 - 1),
 	    &kernel_pt_table[KERNEL_PT_SYS]);
 	pmap_link_l2pt(l1pagetable, IQ80321_IOPXS_VBASE,
-	                &kernel_pt_table[KERNEL_PT_IOPXS]);
+	    &kernel_pt_table[KERNEL_PT_IOPXS]);
 	pmap_link_l2pt(l1pagetable, KERNBASE,
 	    &kernel_pt_table[KERNEL_PT_BEFOREKERN]);
 	pmap_map_chunk(l1pagetable, KERNBASE, SDRAM_START, 0x100000,
@@ -274,7 +275,7 @@ initarm(struct arm_boot_params *abp)
 	pmap_map_chunk(l1pagetable, KERNBASE + 0x100000, SDRAM_START + 0x100000,
 	    0x100000, VM_PROT_READ|VM_PROT_WRITE, PTE_PAGETABLE);
 	pmap_map_chunk(l1pagetable, KERNBASE + 0x200000, SDRAM_START + 0x200000,
-	   (((uint32_t)(lastaddr) - KERNBASE - 0x200000) + L1_S_SIZE) & ~(L1_S_SIZE - 1),
+	    (((uint32_t)(lastaddr) - KERNBASE - 0x200000) + L1_S_SIZE) & ~(L1_S_SIZE - 1),
 	    VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE);
 	freemem_after = ((int)lastaddr + PAGE_SIZE) & ~(PAGE_SIZE - 1);
 	afterkern = round_page(((vm_offset_t)lastaddr + L1_S_SIZE) & ~(L1_S_SIZE
@@ -358,9 +359,6 @@ initarm(struct arm_boot_params *abp)
 	/* Enable MMU, I-cache, D-cache, write buffer. */
 
 	arm_vector_init(ARM_VECTORS_HIGH, ARM_VEC_ALL);
-
-
-
 	pmap_curmaxkvaddr = afterkern + PAGE_SIZE;
 	/*
 	 * ARM_USE_SMALL_ALLOC uses dump_avail, so it must be filled before
@@ -396,7 +394,6 @@ initarm(struct arm_boot_params *abp)
 	    sizeof(struct pcb)));
 }
 
-
 extern int
 machdep_pci_route_interrupt(device_t pcib, device_t dev, int pin)
 {

Modified: user/andre/tcp_workqueue/sys/boot/forth/menu-commands.4th
==============================================================================
--- user/andre/tcp_workqueue/sys/boot/forth/menu-commands.4th	Tue Nov 20 17:04:52 2012	(r243344)
+++ user/andre/tcp_workqueue/sys/boot/forth/menu-commands.4th	Tue Nov 20 17:08:37 2012	(r243345)
@@ -31,6 +31,10 @@ include /boot/menusets.4th
 variable kernel_state
 variable root_state
 
+\ 
+\ ACPI
+\ 
+
 : acpi_enable ( -- )
 	s" set acpi_load=YES" evaluate \ XXX deprecated but harmless
 	s" set hint.acpi.0.disabled=0" evaluate
@@ -58,9 +62,38 @@ variable root_state
 	TRUE \ loop menu again
 ;
 
+\ 
+\ Safe Mode
+\ 
+
+: safemode_enabled? ( -- flag )
+	s" kern.smp.disabled" getenv -1 <> dup if
+		swap drop ( c-addr flag -- flag )
+	then
+;
+
+: safemode_enable ( -- )
+	s" set kern.smp.disabled=1" evaluate
+	s" set hw.ata.ata_dma=0" evaluate
+	s" set hw.ata.atapi_dma=0" evaluate
+	s" set hw.ata.wc=0" evaluate
+	s" set hw.eisa_slots=0" evaluate
+	s" set kern.eventtimer.periodic=1" evaluate
+	s" set kern.geom.part.check_integrity=0" evaluate
+;
+
+: safemode_disable ( -- )
+	s" kern.smp.disabled" unsetenv
+	s" hw.ata.ata_dma" unsetenv
+	s" hw.ata.atapi_dma" unsetenv
+	s" hw.ata.wc" unsetenv
+	s" hw.eisa_slots" unsetenv
+	s" kern.eventtimer.periodic" unsetenv
+	s" kern.geom.part.check_integrity" unsetenv
+;
+
 : init_safemode ( N -- N )
-	s" kern.smp.disabled" getenv -1 <> if
-		drop ( n c-addr -- n ) \ unused
+	safemode_enabled? if
 		toggle_menuitem ( n -- n )
 	then
 ;
@@ -70,25 +103,10 @@ variable root_state
 
 	\ Now we're going to make the change effective
 
-	s" toggle_stateN @"      \ base name of toggle state var
-	-rot 2dup 12 + c! rot    \ replace 'N' with ASCII numeral
-
-	evaluate 0= if
-		s" kern.smp.disabled" unsetenv
-		s" hw.ata.ata_dma" unsetenv
-		s" hw.ata.atapi_dma" unsetenv
-		s" hw.ata.wc" unsetenv
-		s" hw.eisa_slots" unsetenv
-		s" kern.eventtimer.periodic" unsetenv
-		s" kern.geom.part.check_integrity" unsetenv
+	dup toggle_stateN @ 0= if
+		safemode_disable
 	else
-		s" set kern.smp.disabled=1" evaluate
-		s" set hw.ata.ata_dma=0" evaluate
-		s" set hw.ata.atapi_dma=0" evaluate
-		s" set hw.ata.wc=0" evaluate
-		s" set hw.eisa_slots=0" evaluate
-		s" set kern.eventtimer.periodic=1" evaluate
-		s" set kern.geom.part.check_integrity=0" evaluate
+		safemode_enable
 	then
 
 	menu-redraw
@@ -96,9 +114,26 @@ variable root_state
 	TRUE \ loop menu again
 ;
 
+\ 
+\ Single User Mode
+\ 
+
+: singleuser_enabled? ( -- flag )
+	s" boot_single" getenv -1 <> dup if
+		swap drop ( c-addr flag -- flag )
+	then
+;
+
+: singleuser_enable ( -- )
+	s" set boot_single=YES" evaluate
+;
+
+: singleuser_disable ( -- )
+	s" boot_single" unsetenv
+;
+
 : init_singleuser ( N -- N )
-	s" boot_single" getenv -1 <> if
-		drop ( n c-addr -- n ) \ unused
+	singleuser_enabled? if
 		toggle_menuitem ( n -- n )
 	then
 ;
@@ -109,21 +144,35 @@ variable root_state
 
 	\ Now we're going to make the change effective
 
-	s" toggle_stateN @"      \ base name of toggle state var
-	-rot 2dup 12 + c! rot    \ replace 'N' with ASCII numeral
-
-	evaluate 0= if
-		s" boot_single" unsetenv
+	dup toggle_stateN @ 0= if
+		singleuser_disable
 	else
-		s" set boot_single=YES" evaluate
+		singleuser_enable
 	then
 
 	TRUE \ loop menu again
 ;
 
+\ 
+\ Verbose Boot
+\ 
+
+: verbose_enabled? ( -- flag )
+	s" boot_verbose" getenv -1 <> dup if
+		swap drop ( c-addr flag -- flag )
+	then
+;
+
+: verbose_enable ( -- )
+	s" set boot_verbose=YES" evaluate
+;
+
+: verbose_disable ( -- )
+	s" boot_verbose" unsetenv
+;
+
 : init_verbose ( N -- N )
-	s" boot_verbose" getenv -1 <> if
-		drop ( n c-addr -- n ) \ unused
+	verbose_enabled? if
 		toggle_menuitem ( n -- n )
 	then
 ;
@@ -134,18 +183,19 @@ variable root_state
 
 	\ Now we're going to make the change effective
 
-	s" toggle_stateN @"      \ base name of toggle state var
-	-rot 2dup 12 + c! rot    \ replace 'N' with ASCII numeral
-
-	evaluate 0= if
-		s" boot_verbose" unsetenv
+	dup toggle_stateN @ 0= if
+		verbose_disable
 	else
-		s" set boot_verbose=YES" evaluate
+		verbose_enable
 	then
 
 	TRUE \ loop menu again
 ;
 
+\ 
+\ Escape to Prompt
+\ 
+
 : goto_prompt ( N -- N FALSE )
 
 	s" set autoboot_delay=NO" evaluate
@@ -158,11 +208,12 @@ variable root_state
 	FALSE \ exit the menu
 ;
 
+\ 
+\ Cyclestate (used by kernel/root below)
+\ 
+
 : init_cyclestate ( N K -- N )
-	over                   ( n k -- n k n )
-	s" cycle_stateN"       ( n k n -- n k n c-addr u )
-	-rot tuck 11 + c! swap ( n k n c-addr u -- n k c-addr u )
-	evaluate               ( n k c-addr u -- n k addr )
+	over cycle_stateN ( n k -- n k addr )
 	begin
 		tuck @  ( n k addr -- n addr k c )
 		over <> ( n addr k c -- n addr k 0|-1 )
@@ -174,6 +225,10 @@ variable root_state
 	2drop ( n k addr -- n )
 ;
 
+\
+\ Kernel
+\ 
+
 : init_kernel ( N -- N )
 	kernel_state @  ( n -- n k )
 	init_cyclestate ( n k -- n )
@@ -185,21 +240,21 @@ variable root_state
 
 	\ Now we're going to make the change effective
 
-	s" cycle_stateN"         \ base name of array state var
-	-rot 2dup 11 + c! rot    \ replace 'N' with ASCII numeral
-	evaluate                 \ translate name into address
-	@                        \ dereference address into value
+	dup cycle_stateN @
 	dup kernel_state !       \ save a copy for re-initialization
 	48 +                     \ convert to ASCII numeral
 
 	s" set kernel=${kernel_prefix}${kernel[N]}${kernel_suffix}"
-	                          \ command to assemble full kernel-path
-	-rot tuck 36 + c! swap    \ replace 'N' with array index value
-	evaluate                  \ sets $kernel to full kernel-path
+	36 +c!   \ replace 'N' with ASCII numeral
+	evaluate \ sets $kernel to full kernel-path
 
 	TRUE \ loop menu again
 ;
 
+\ 
+\ Root
+\ 
+
 : init_root ( N -- N )
 	root_state @    ( n -- n k )
 	init_cyclestate ( n k -- n )
@@ -211,21 +266,21 @@ variable root_state
 
 	\ Now we're going to make the change effective
 
-	s" cycle_stateN"         \ base name of array state var
-	-rot 2dup 11 + c! rot    \ replace 'N' with ASCII numeral
-	evaluate                 \ translate name into address
-	@                        \ dereference address into value
+	dup cycle_stateN @
 	dup root_state !         \ save a copy for re-initialization
 	48 +                     \ convert to ASCII numeral
 
 	s" set root=${root_prefix}${root[N]}${root_suffix}"
-	                          \ command to assemble root image-path
-	-rot tuck 30 + c! swap    \ replace 'N' with array index value
-	evaluate                  \ sets $kernel to full kernel-path
+	30 +c!   \ replace 'N' with ASCII numeral
+	evaluate \ sets $root to full root-path
 
 	TRUE \ loop menu again
 ;
 
+\ 
+\ Menusets
+\ 
+
 : goto_menu ( N M -- N TRUE )
 	menu-unset
 	menuset-loadsetnum ( n m -- n )

Modified: user/andre/tcp_workqueue/sys/boot/forth/menu.4th
==============================================================================
--- user/andre/tcp_workqueue/sys/boot/forth/menu.4th	Tue Nov 20 17:04:52 2012	(r243344)
+++ user/andre/tcp_workqueue/sys/boot/forth/menu.4th	Tue Nov 20 17:08:37 2012	(r243345)
@@ -116,6 +116,48 @@ create init_text6 255 allot
 create init_text7 255 allot
 create init_text8 255 allot
 
+: +c! ( N C-ADDR/U K -- C-ADDR/U )
+	3 pick 3 pick	( n c-addr/u k -- n c-addr/u k n c-addr )
+	rot + c!	( n c-addr/u k n c-addr -- n c-addr/u )
+	rot drop	( n c-addr/u -- c-addr/u )
+;
+
+: menukeyN      ( N -- ADDR )   s" menukeyN"       7 +c! evaluate ;
+: init_stateN   ( N -- ADDR )   s" init_stateN"   10 +c! evaluate ;
+: toggle_stateN ( N -- ADDR )   s" toggle_stateN" 12 +c! evaluate ;
+: cycle_stateN  ( N -- ADDR )   s" cycle_stateN"  11 +c! evaluate ;
+: init_textN    ( N -- C-ADDR ) s" init_textN"     9 +c! evaluate ;
+
+: str_loader_menu_title     ( -- C-ADDR/U ) s" loader_menu_title" ;
+: str_loader_menu_timeout_x ( -- C-ADDR/U ) s" loader_menu_timeout_x" ;
+: str_loader_menu_timeout_y ( -- C-ADDR/U ) s" loader_menu_timeout_y" ;
+: str_menu_init             ( -- C-ADDR/U ) s" menu_init" ;
+: str_menu_timeout_command  ( -- C-ADDR/U ) s" menu_timeout_command" ;
+: str_menu_reboot           ( -- C-ADDR/U ) s" menu_reboot" ;
+: str_menu_acpi             ( -- C-ADDR/U ) s" menu_acpi" ;
+: str_menu_options          ( -- C-ADDR/U ) s" menu_options" ;
+: str_menu_optionstext      ( -- C-ADDR/U ) s" menu_optionstext" ;
+
+: str_menu_init[x]          ( -- C-ADDR/U ) s" menu_init[x]" ;
+: str_menu_command[x]       ( -- C-ADDR/U ) s" menu_command[x]" ;
+: str_menu_caption[x]       ( -- C-ADDR/U ) s" menu_caption[x]" ;
+: str_ansi_caption[x]       ( -- C-ADDR/U ) s" ansi_caption[x]" ;
+: str_menu_keycode[x]       ( -- C-ADDR/U ) s" menu_keycode[x]" ;
+: str_toggled_text[x]       ( -- C-ADDR/U ) s" toggled_text[x]" ;
+: str_toggled_ansi[x]       ( -- C-ADDR/U ) s" toggled_ansi[x]" ;
+: str_menu_caption[x][y]    ( -- C-ADDR/U ) s" menu_caption[x][y]" ;
+: str_ansi_caption[x][y]    ( -- C-ADDR/U ) s" ansi_caption[x][y]" ;
+
+: menu_init[x]       ( N -- C-ADDR/U )   str_menu_init[x]       10 +c! ;
+: menu_command[x]    ( N -- C-ADDR/U )   str_menu_command[x]    13 +c! ;
+: menu_caption[x]    ( N -- C-ADDR/U )   str_menu_caption[x]    13 +c! ;
+: ansi_caption[x]    ( N -- C-ADDR/U )   str_ansi_caption[x]    13 +c! ;
+: menu_keycode[x]    ( N -- C-ADDR/U )   str_menu_keycode[x]    13 +c! ;
+: toggled_text[x]    ( N -- C-ADDR/U )   str_toggled_text[x]    13 +c! ;
+: toggled_ansi[x]    ( N -- C-ADDR/U )   str_toggled_ansi[x]    13 +c! ;
+: menu_caption[x][y] ( N M -- C-ADDR/U ) str_menu_caption[x][y] 16 +c! 13 +c! ;
+: ansi_caption[x][y] ( N M -- C-ADDR/U ) str_ansi_caption[x][y] 16 +c! 13 +c! ;
+
 : arch-i386? ( -- BOOL ) \ Returns TRUE (-1) on i386, FALSE (0) otherwise.
 	s" arch-i386" environment? dup if
 		drop
@@ -172,10 +214,7 @@ create init_text8 255 allot
 	\ ASCII numeral equal to user-selected menu item must be on the stack.
 	\ We do not modify the stack, so the ASCII numeral is left on top.
 
-	s" init_textN"          \ base name of buffer
-	-rot 2dup 9 + c! rot    \ replace 'N' with ASCII num
-
-	evaluate c@ 0= if
+	dup init_textN c@ 0= if
 		\ NOTE: no need to check toggle_stateN since the first time we
 		\ are called, we will populate init_textN. Further, we don't
 		\ need to test whether menu_caption[x] (ansi_caption[x] when
@@ -183,19 +222,16 @@ create init_text8 255 allot
 		\ called if the caption was NULL.
 
 		\ base name of environment variable
+		dup ( n -- n n ) \ key pressed
 		loader_color? if
-			s" ansi_caption[x]"
+			ansi_caption[x]
 		else
-			s" menu_caption[x]"
+			menu_caption[x]
 		then	
-		-rot 2dup 13 + c! rot    \ replace 'x' with ASCII numeral
-
 		getenv dup -1 <> if
 
-			s" init_textN"          \ base name of buffer
-			4 pick                  \ copy ASCII num to top
-			rot tuck 9 + c! swap    \ replace 'N' with ASCII num
-			evaluate
+			2 pick ( n c-addr/u -- n c-addr/u n )
+			init_textN ( n c-addr/u n -- n c-addr/u c-addr )
 
 			\ now we have the buffer c-addr on top
 			\ ( followed by c-addr/u of current caption )
@@ -227,67 +263,49 @@ create init_text8 255 allot
 	\ negate the toggled state so that we reverse the flow on subsequent
 	\ calls.
 
-	s" toggle_stateN @"      \ base name of toggle state var
-	-rot 2dup 12 + c! rot    \ replace 'N' with ASCII numeral
-
-	evaluate 0= if
+	dup toggle_stateN @ 0= if
 		\ state is OFF, toggle to ON
 
-		\ base name of toggled text var
+		dup ( n -- n n ) \ key pressed
 		loader_color? if
-			s" toggled_ansi[x]"
+			toggled_ansi[x]
 		else
-			s" toggled_text[x]"
+			toggled_text[x]
 		then
-		-rot 2dup 13 + c! rot    \ replace 'x' with ASCII num
-
 		getenv dup -1 <> if
 			\ Assign toggled text to menu caption
-
-			\ base name of caption var
+			2 pick ( n c-addr/u -- n c-addr/u n ) \ key pressed
 			loader_color? if
-				s" ansi_caption[x]"
+				ansi_caption[x]
 			else
-				s" menu_caption[x]"
+				menu_caption[x]
 			then
-			4 pick                   \ copy ASCII num to top
-			rot tuck 13 + c! swap    \ replace 'x' with ASCII num
-
-			setenv \ set new caption
+			setenv
 		else
 			\ No toggled text, keep the same caption
-
-			drop
+			drop ( n -1 -- n ) \ getenv cruft
 		then
 
 		true \ new value of toggle state var (to be stored later)
 	else
 		\ state is ON, toggle to OFF
 
-		s" init_textN"           \ base name of initial text buffer
-		-rot 2dup 9 + c! rot     \ replace 'N' with ASCII numeral
-		evaluate                 \ convert string to c-addr
-		count                    \ convert c-addr to c-addr/u
+		dup init_textN count ( n -- n c-addr/u )
 
-		\ base name of caption var
+		\ Assign init_textN text to menu caption
+		2 pick ( n c-addr/u -- n c-addr/u n ) \ key pressed
 		loader_color? if
-			s" ansi_caption[x]"
+			ansi_caption[x]
 		else
-			s" menu_caption[x]"
+			menu_caption[x]
 		then
-		4 pick                   \ copy ASCII num to top
-		rot tuck 13 + c! swap    \ replace 'x' with ASCII numeral
+		setenv
 
-		setenv    \ set new caption
-		false     \ new value of toggle state var (to be stored below)
+		false \ new value of toggle state var (to be stored below)
 	then
 
 	\ now we'll store the new toggle state (on top of stack)
-	s" toggle_stateN"        \ base name of toggle state var
-	3 pick                   \ copy ASCII numeral to top
-	rot tuck 12 + c! swap    \ replace 'N' with ASCII numeral
-	evaluate                 \ convert string to addr
-	!                        \ store new value
+	over toggle_stateN !
 ;
 
 : cycle_menuitem ( N -- N ) \ cycles through array of choices for a menuitem
@@ -295,28 +313,23 @@ create init_text8 255 allot
 	\ ASCII numeral equal to user-selected menu item must be on the stack.
 	\ We do not modify the stack, so the ASCII numeral is left on top.
 
-	s" cycle_stateN"         \ base name of array state var
-	-rot 2dup 11 + c! rot    \ replace 'N' with ASCII numeral
-
-	evaluate    \ we now have a pointer to the proper variable
-	dup @       \ resolve the pointer (but leave it on the stack)
-	1+          \ increment the value
+	dup cycle_stateN dup @ 1+ \ get value and increment
 
 	\ Before assigning the (incremented) value back to the pointer,
 	\ let's test for the existence of this particular array element.
 	\ If the element exists, we'll store index value and move on.
 	\ Otherwise, we'll loop around to zero and store that.
 
-	dup 48 + \ duplicate Array index and convert to ASCII numeral
+	dup 48 + ( n addr k -- n addr k k' )
+	         \ duplicate array index and convert to ASCII numeral
 
-	\ base name of array caption text
+	3 pick swap ( n addr k k' -- n addr k n k' ) \ (n,k') as (x,y)
 	loader_color? if
-		s" ansi_caption[x][y]"          
+		ansi_caption[x][y]
 	else
-		s" menu_caption[x][y]"          
+		menu_caption[x][y]
 	then
-	-rot tuck 16 + c! swap          \ replace 'y' with Array index
-	4 pick rot tuck 13 + c! swap    \ replace 'x' with menu choice
+	( n addr k n k' -- n addr k c-addr/u )
 
 	\ Now test for the existence of our incremented array index in the
 	\ form of $menu_caption[x][y] ($ansi_caption[x][y] with loader_color
@@ -325,48 +338,47 @@ create init_text8 255 allot
 	getenv dup -1 = if
 		\ No caption set for this array index. Loop back to zero.
 
-		drop    ( getenv cruft )
-		drop    ( incremented array index )
-		0       ( new array index that will be stored later )
+		drop ( n addr k -1 -- n addr k ) \ getenv cruft
+		drop 0 ( n addr k -- n addr 0 )  \ new value to store later
 
-		\ base name of caption var
+		2 pick [char] 0 ( n addr 0 -- n addr 0 n 48 ) \ (n,48) as (x,y)
 		loader_color? if
-			s" ansi_caption[x][0]"
+			ansi_caption[x][y]
 		else
-			s" menu_caption[x][0]"
+			menu_caption[x][y]
 		then
-		4 pick rot tuck 13 + c! swap    \ replace 'x' with menu choice
-
+		( n addr 0 n 48 -- n addr 0 c-addr/u )
 		getenv dup -1 = if
 			\ This is highly unlikely to occur, but to make
 			\ sure that things move along smoothly, allocate
 			\ a temporary NULL string
 
-			s" "
+			drop ( n addr 0 -1 -- n addr 0 ) \ getenv cruft
+			s" " ( n addr 0 -- n addr 0 c-addr/u )
 		then
 	then
 
 	\ At this point, we should have the following on the stack (in order,
 	\ from bottom to top):
 	\ 
-	\    N      - Ascii numeral representing the menu choice (inherited)
-	\    Addr   - address of our internal cycle_stateN variable
-	\    N      - zero-based number we intend to store to the above
-	\    C-Addr - string value we intend to store to menu_caption[x]
-	\             (or ansi_caption[x] with loader_color enabled)
+	\    n        - Ascii numeral representing the menu choice (inherited)
+	\    addr     - address of our internal cycle_stateN variable
+	\    k        - zero-based number we intend to store to the above
+	\    c-addr/u - string value we intend to store to menu_caption[x]
+	\               (or ansi_caption[x] with loader_color enabled)
 	\ 
 	\ Let's perform what we need to with the above.
 
-	\ base name of menuitem caption var
+	\ Assign array value text to menu caption
+	4 pick ( n addr k c-addr/u -- n addr k c-addr/u n )
 	loader_color? if
-		s" ansi_caption[x]"
+		ansi_caption[x]
 	else
-		s" menu_caption[x]"
+		menu_caption[x]
 	then
-	6 pick rot tuck 13 + c! swap    \ replace 'x' with menu choice
-	setenv                          \ set the new caption
+	setenv
 
-	swap ! \ update array state variable
+	swap ! ( n addr k -- n ) \ update array state variable
 ;
 
 : acpipresent? ( -- flag ) \ Returns TRUE if ACPI is present, FALSE otherwise
@@ -400,15 +412,15 @@ create init_text8 255 allot
 		acpipresent? if
 			acpienabled? if
 				loader_color? if
-					s" toggled_ansi[x]"
+					str_toggled_ansi[x]
 				else
-					s" toggled_text[x]"
+					str_toggled_text[x]
 				then
 			else
 				loader_color? if
-					s" ansi_caption[x]"
+					str_ansi_caption[x]
 				else
-					s" menu_caption[x]"
+					str_menu_caption[x]

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201211201708.qAKH8bW2060333>