Date: Wed, 10 Dec 2008 20:04:03 GMT From: John Baldwin <jhb@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 154459 for review Message-ID: <200812102004.mBAK43KP006599@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=154459 Change 154459 by jhb@jhb_mutex on 2008/12/10 20:03:58 IFC @154458 Affected files ... .. //depot/projects/smpng/sys/amd64/amd64/db_trace.c#26 integrate .. //depot/projects/smpng/sys/amd64/amd64/pmap.c#86 integrate .. //depot/projects/smpng/sys/arm/mv/mv_pci.c#2 integrate .. //depot/projects/smpng/sys/arm/mv/orion/std.db88f5xxx#2 integrate .. //depot/projects/smpng/sys/boot/common/loader.8#47 integrate .. //depot/projects/smpng/sys/boot/forth/support.4th#6 integrate .. //depot/projects/smpng/sys/boot/i386/boot0/boot0.S#10 integrate .. //depot/projects/smpng/sys/boot/i386/btx/btxldr/btxldr.S#4 integrate .. //depot/projects/smpng/sys/boot/zfs/Makefile#3 integrate .. //depot/projects/smpng/sys/boot/zfs/zfsimpl.c#3 integrate .. //depot/projects/smpng/sys/compat/linprocfs/linprocfs.c#70 integrate .. //depot/projects/smpng/sys/contrib/pf/net/pf_table.c#7 integrate .. //depot/projects/smpng/sys/dev/adb/adb.h#2 integrate .. //depot/projects/smpng/sys/dev/adb/adb_bus.c#3 integrate .. //depot/projects/smpng/sys/dev/adb/adb_kbd.c#2 integrate .. //depot/projects/smpng/sys/dev/adb/adb_mouse.c#2 integrate .. //depot/projects/smpng/sys/dev/adb/adbvar.h#2 integrate .. //depot/projects/smpng/sys/dev/ae/if_ae.c#2 integrate .. //depot/projects/smpng/sys/dev/ath/if_ath.c#61 integrate .. //depot/projects/smpng/sys/dev/ath/if_athvar.h#38 integrate .. //depot/projects/smpng/sys/dev/bge/if_bge.c#102 integrate .. //depot/projects/smpng/sys/dev/cxgb/common/cxgb_t3_hw.c#10 integrate .. //depot/projects/smpng/sys/dev/cxgb/cxgb_main.c#17 integrate .. //depot/projects/smpng/sys/dev/dc/if_dc.c#20 integrate .. //depot/projects/smpng/sys/dev/dc/if_dcreg.h#10 integrate .. //depot/projects/smpng/sys/dev/e1000/if_em.c#4 integrate .. //depot/projects/smpng/sys/dev/fxp/if_fxp.c#85 integrate .. //depot/projects/smpng/sys/dev/mmc/mmc.c#7 integrate .. //depot/projects/smpng/sys/dev/mmc/mmcsd.c#8 integrate .. //depot/projects/smpng/sys/dev/pccbb/pccbb.c#68 integrate .. //depot/projects/smpng/sys/dev/pccbb/pccbb_pci.c#17 integrate .. //depot/projects/smpng/sys/dev/pccbb/pccbbvar.h#21 integrate .. //depot/projects/smpng/sys/dev/re/if_re.c#66 integrate .. //depot/projects/smpng/sys/dev/sdhci/sdhci.c#4 integrate .. //depot/projects/smpng/sys/dev/sis/if_sis.c#2 integrate .. //depot/projects/smpng/sys/dev/sis/if_sisreg.h#2 integrate .. //depot/projects/smpng/sys/dev/usb/if_ural.c#29 integrate .. //depot/projects/smpng/sys/fs/procfs/procfs_map.c#14 integrate .. //depot/projects/smpng/sys/geom/geom_subr.c#55 integrate .. //depot/projects/smpng/sys/geom/journal/g_journal.c#10 integrate .. //depot/projects/smpng/sys/geom/journal/g_journal.h#2 integrate .. //depot/projects/smpng/sys/i386/include/atomic.h#51 integrate .. //depot/projects/smpng/sys/kern/kern_exec.c#115 integrate .. //depot/projects/smpng/sys/kern/kern_exit.c#135 integrate .. //depot/projects/smpng/sys/kern/kern_fork.c#116 integrate .. //depot/projects/smpng/sys/kern/kern_linker.c#95 integrate .. //depot/projects/smpng/sys/kern/kern_module.c#28 integrate .. //depot/projects/smpng/sys/kern/kern_proc.c#100 integrate .. //depot/projects/smpng/sys/kern/kern_rwlock.c#25 integrate .. //depot/projects/smpng/sys/kern/subr_param.c#25 integrate .. //depot/projects/smpng/sys/kern/subr_witness.c#175 integrate .. //depot/projects/smpng/sys/kern/vfs_export.c#31 integrate .. //depot/projects/smpng/sys/libkern/iconv.c#12 integrate .. //depot/projects/smpng/sys/net/if.c#107 integrate .. //depot/projects/smpng/sys/net/radix.c#15 integrate .. //depot/projects/smpng/sys/net/radix.h#10 integrate .. //depot/projects/smpng/sys/net/route.c#42 integrate .. //depot/projects/smpng/sys/net/route.h#29 integrate .. //depot/projects/smpng/sys/net/rtsock.c#65 integrate .. //depot/projects/smpng/sys/netgraph/ng_mppc.c#17 integrate .. //depot/projects/smpng/sys/netinet/if_ether.c#63 integrate .. //depot/projects/smpng/sys/netinet/in_pcb.c#88 integrate .. //depot/projects/smpng/sys/netinet/in_pcb.h#56 integrate .. //depot/projects/smpng/sys/netinet/ip_carp.c#30 integrate .. //depot/projects/smpng/sys/netinet/ip_fw_nat.c#5 integrate .. //depot/projects/smpng/sys/netinet/sctp.h#10 integrate .. //depot/projects/smpng/sys/netinet/sctp_asconf.c#14 integrate .. //depot/projects/smpng/sys/netinet/sctp_asconf.h#8 integrate .. //depot/projects/smpng/sys/netinet/sctp_auth.c#14 integrate .. //depot/projects/smpng/sys/netinet/sctp_auth.h#6 integrate .. //depot/projects/smpng/sys/netinet/sctp_constants.h#17 integrate .. //depot/projects/smpng/sys/netinet/sctp_header.h#7 integrate .. //depot/projects/smpng/sys/netinet/sctp_indata.c#20 integrate .. //depot/projects/smpng/sys/netinet/sctp_indata.h#8 integrate .. //depot/projects/smpng/sys/netinet/sctp_input.c#20 integrate .. //depot/projects/smpng/sys/netinet/sctp_os_bsd.h#17 integrate .. //depot/projects/smpng/sys/netinet/sctp_output.c#23 integrate .. //depot/projects/smpng/sys/netinet/sctp_output.h#9 integrate .. //depot/projects/smpng/sys/netinet/sctp_pcb.c#23 integrate .. //depot/projects/smpng/sys/netinet/sctp_pcb.h#16 integrate .. //depot/projects/smpng/sys/netinet/sctp_structs.h#12 integrate .. //depot/projects/smpng/sys/netinet/sctp_sysctl.c#9 integrate .. //depot/projects/smpng/sys/netinet/sctp_sysctl.h#8 integrate .. //depot/projects/smpng/sys/netinet/sctp_timer.c#17 integrate .. //depot/projects/smpng/sys/netinet/sctp_uio.h#15 integrate .. //depot/projects/smpng/sys/netinet/sctp_usrreq.c#21 integrate .. //depot/projects/smpng/sys/netinet/sctp_var.h#12 integrate .. //depot/projects/smpng/sys/netinet/sctputil.c#24 integrate .. //depot/projects/smpng/sys/netinet/sctputil.h#13 integrate .. //depot/projects/smpng/sys/netinet/tcp_input.c#121 integrate .. //depot/projects/smpng/sys/netinet/tcp_syncache.h#4 integrate .. //depot/projects/smpng/sys/netinet/tcp_var.h#62 integrate .. //depot/projects/smpng/sys/netinet6/in6_rmx.c#17 integrate .. //depot/projects/smpng/sys/netinet6/nd6_rtr.c#25 integrate .. //depot/projects/smpng/sys/netinet6/sctp6_usrreq.c#16 integrate .. //depot/projects/smpng/sys/nfsserver/nfs_fha.c#3 integrate .. //depot/projects/smpng/sys/pci/if_rlreg.h#46 integrate .. //depot/projects/smpng/sys/powerpc/conf/NOTES#11 integrate .. //depot/projects/smpng/sys/powerpc/powermac/cuda.c#2 integrate .. //depot/projects/smpng/sys/powerpc/powermac/cudavar.h#2 integrate .. //depot/projects/smpng/sys/powerpc/powermac/macgpio.c#2 integrate .. //depot/projects/smpng/sys/powerpc/powermac/macgpiovar.h#2 integrate .. //depot/projects/smpng/sys/powerpc/powermac/pmu.c#2 integrate .. //depot/projects/smpng/sys/powerpc/powermac/pmuvar.h#2 integrate .. //depot/projects/smpng/sys/sys/aio.h#8 integrate .. //depot/projects/smpng/sys/sys/module.h#12 integrate .. //depot/projects/smpng/sys/sys/proc.h#193 integrate .. //depot/projects/smpng/sys/sys/rwlock.h#16 integrate .. //depot/projects/smpng/sys/ufs/ufs/ufs_quota.c#42 integrate Differences ... ==== //depot/projects/smpng/sys/amd64/amd64/db_trace.c#26 (text+ko) ==== @@ -25,7 +25,9 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/amd64/amd64/db_trace.c,v 1.82 2007/12/02 20:40:30 rwatson Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/amd64/db_trace.c,v 1.83 2008/12/05 11:34:36 kib Exp $"); + +#include "opt_compat.h" #include <sys/param.h> #include <sys/systm.h> @@ -318,6 +320,10 @@ frame_type = INTERRUPT; else if (strcmp(name, "Xfast_syscall") == 0) frame_type = SYSCALL; +#ifdef COMPAT_IA32 + else if (strcmp(name, "Xint0x80_syscall") == 0) + frame_type = SYSCALL; +#endif /* XXX: These are interrupts with trap frames. */ else if (strcmp(name, "Xtimerint") == 0 || strcmp(name, "Xcpustop") == 0 || ==== //depot/projects/smpng/sys/amd64/amd64/pmap.c#86 (text+ko) ==== @@ -77,7 +77,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/amd64/amd64/pmap.c,v 1.645 2008/08/09 05:46:13 alc Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/amd64/pmap.c,v 1.646 2008/12/06 19:37:52 alc Exp $"); /* * Manages physical address maps. @@ -180,7 +180,7 @@ SYSCTL_NODE(_vm, OID_AUTO, pmap, CTLFLAG_RD, 0, "VM/pmap parameters"); -static int pg_ps_enabled; +static int pg_ps_enabled = 1; SYSCTL_INT(_vm_pmap, OID_AUTO, pg_ps_enabled, CTLFLAG_RD, &pg_ps_enabled, 0, "Are large page mappings enabled?"); ==== //depot/projects/smpng/sys/arm/mv/mv_pci.c#2 (text+ko) ==== @@ -34,7 +34,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/arm/mv/mv_pci.c,v 1.2 2008/11/19 17:07:01 raj Exp $"); +__FBSDID("$FreeBSD: src/sys/arm/mv/mv_pci.c,v 1.3 2008/12/05 15:27:28 raj Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -598,6 +598,10 @@ mem_limit = mem_base + sc->sc_info->op_mem_size - 1; /* Configure I/O decode registers */ + pcib_mbus_write_config(sc->sc_dev, bus, slot, func, PCIR_IOBASEL_1, + io_base >> 8, 1); + pcib_mbus_write_config(sc->sc_dev, bus, slot, func, PCIR_IOBASEH_1, + io_base >> 16, 2); pcib_mbus_write_config(sc->sc_dev, bus, slot, func, PCIR_IOLIMITL_1, io_limit >> 8, 1); pcib_mbus_write_config(sc->sc_dev, bus, slot, func, PCIR_IOLIMITH_1, ==== //depot/projects/smpng/sys/arm/mv/orion/std.db88f5xxx#2 (text+ko) ==== @@ -1,13 +1,13 @@ -# $FreeBSD: src/sys/arm/mv/orion/std.db88f5xxx,v 1.1 2008/10/13 20:07:13 raj Exp $ +# $FreeBSD: src/sys/arm/mv/orion/std.db88f5xxx,v 1.2 2008/12/05 15:31:51 raj Exp $ include "../mv/std.mv" files "../mv/orion/files.db88f5xxx" -makeoptions KERNPHYSADDR=0x00400000 -makeoptions KERNVIRTADDR=0xc0400000 +makeoptions KERNPHYSADDR=0x00900000 +makeoptions KERNVIRTADDR=0xc0900000 -options KERNPHYSADDR=0x00400000 -options KERNVIRTADDR=0xc0400000 +options KERNPHYSADDR=0x00900000 +options KERNVIRTADDR=0xc0900000 options PHYSADDR=0x00000000 options PHYSMEM_SIZE=0x08000000 options STARTUP_PAGETABLE_ADDR=0x00100000 ==== //depot/projects/smpng/sys/boot/common/loader.8#47 (text+ko) ==== @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $FreeBSD: src/sys/boot/common/loader.8,v 1.94 2007/11/08 11:59:38 ru Exp $ +.\" $FreeBSD: src/sys/boot/common/loader.8,v 1.95 2008/12/06 11:21:10 danger Exp $ .\" .Dd November 8, 2007 .Dt LOADER 8 @@ -454,7 +454,7 @@ or if a SIGTERM is delivered to the .Xr init 8 process (PID 1). -.It Va init_script +.It Va init_shell Defines the shell binary to be used for executing the various shell scripts. The default is .Dq Li /bin/sh . ==== //depot/projects/smpng/sys/boot/forth/support.4th#6 (text+ko) ==== @@ -22,7 +22,7 @@ \ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF \ SUCH DAMAGE. \ -\ $FreeBSD: src/sys/boot/forth/support.4th,v 1.17 2007/12/19 17:06:32 ambrisko Exp $ +\ $FreeBSD: src/sys/boot/forth/support.4th,v 1.18 2008/12/07 19:42:20 luigi Exp $ \ Loader.rc support functions: \ @@ -288,6 +288,17 @@ : free-memory free if free_error throw then ; +: strget { var -- addr len } var .addr @ var .len @ ; + +\ assign addr len to variable. +: strset { addr len var -- } addr var .addr ! len var .len ! ; + +\ free memory and reset fields +: strfree { var -- } var .addr @ ?dup if free-memory 0 0 var strset then ; + +\ free old content, make a copy of the string and assign to variable +: string= { addr len var -- } var strfree addr len strdup var strset ; + \ Assignment data temporary storage string name_buffer @@ -712,19 +723,6 @@ module_loaderror_suffix suffix_type? ; -: set_conf_files - conf_files .addr @ ?dup if - free-memory - then - value_buffer .addr @ c@ [char] " = if - value_buffer .addr @ char+ value_buffer .len @ 2 chars - - else - value_buffer .addr @ value_buffer .len @ - then - strdup - conf_files .len ! conf_files .addr ! -; - : set_nextboot_conf nextboot_conf_file .addr @ ?dup if free-memory @@ -888,6 +886,11 @@ then ; +: set_conf_files + set_environment_variable + s" loader_conf_files" getenv conf_files string= +; + : set_nextboot_flag yes_value? to nextboot? ; @@ -1045,7 +1048,6 @@ \ Variables used for processing multiple conf files string current_file_name -variable current_conf_files \ Indicates if any conf file was succesfully read @@ -1053,18 +1055,10 @@ \ loader_conf_files processing support functions -: set_current_conf_files - conf_files .addr @ current_conf_files ! +: get_conf_files ( -- addr len ) \ put addr/len on stack, reset var + conf_files strget 0 0 conf_files strset ; -: get_conf_files - conf_files .addr @ conf_files .len @ strdup -; - -: recurse_on_conf_files? - current_conf_files @ conf_files .addr @ <> -; - : skip_leading_spaces { addr len pos -- addr len pos' } begin pos len = if addr len pos exit then @@ -1133,7 +1127,6 @@ \ Interface to loader_conf_files processing : include_conf_files - set_current_conf_files get_conf_files 0 begin get_next_file ?dup @@ -1141,7 +1134,7 @@ set_current_file_name ['] load_conf catch process_conf_errors - recurse_on_conf_files? if recurse then + conf_files .addr @ if recurse then repeat ; ==== //depot/projects/smpng/sys/boot/i386/boot0/boot0.S#10 (text+ko) ==== @@ -14,7 +14,7 @@ * warranties of merchantability and fitness for a particular * purpose. * - * $FreeBSD: src/sys/boot/i386/boot0/boot0.S,v 1.20 2008/12/03 14:53:59 luigi Exp $ + * $FreeBSD: src/sys/boot/i386/boot0/boot0.S,v 1.21 2008/12/08 20:53:27 sobomax Exp $ */ /* build options: */ @@ -93,7 +93,7 @@ * %si pointer to the partition table from which we were loaded. * Some boot code (e.g. syslinux) use this info to relocate * themselves, so we want to pass a valid one to the next stage. - * NOTE: the use of %is is not a standard. + * NOTE: the use of %si is not a standard. * * This boot block first relocates itself at a different address (0:0x600), * to free the space at 0:0x7c00 for the next stage boot block. ==== //depot/projects/smpng/sys/boot/i386/btx/btxldr/btxldr.S#4 (text+ko) ==== @@ -12,9 +12,12 @@ * warranties of merchantability and fitness for a particular * purpose. * - * $FreeBSD: src/sys/boot/i386/btx/btxldr/btxldr.S,v 1.17 2004/05/14 20:29:30 ru Exp $ + * $FreeBSD: src/sys/boot/i386/btx/btxldr/btxldr.S,v 1.20 2008/12/09 00:25:57 sobomax Exp $ */ +#define RBX_MUTE 0x10 /* -m */ +#define OPT_SET(opt) (1 << (opt)) + /* * Prototype BTX loader program, written in a couple of hours. The * real thing should probably be more flexible, and in C. @@ -64,6 +67,8 @@ * BTX program loader for ELF clients. */ start: cld # String ops inc + testl $OPT_SET(RBX_MUTE), 4(%esp) # Check first argument + setnz muted # for RBX_MUTE, set flag movl $m_logo,%esi # Identify call putstr # ourselves movzwl BDA_MEM,%eax # Get base memory @@ -288,7 +293,9 @@ /* * Output character AL to the console. */ -putchr: pusha # Save +putchr: testb $1,muted # Check muted + jnz putchr.5 # do a nop + pusha # Save xorl %ecx,%ecx # Zero for loops movb $SCR_MAT,%ah # Mode/attribute movl $BDA_POS,%ebx # BDA pointer @@ -325,7 +332,7 @@ movb $SCR_ROW-1,%dh # Bottom line putchr.4: movw %dx,(%ebx) # Update position popa # Restore - ret # To caller +putchr.5: ret # To caller /* * Convert EAX, AX, or AL to hex, saving the result to [EDI]. */ @@ -390,6 +397,12 @@ .asciz " memsz=\0\n" m_done: .asciz "Loading complete\n" #endif + +/* + * Flags + */ +muted: .byte 0x0 + /* * Uninitialized data area. */ ==== //depot/projects/smpng/sys/boot/zfs/Makefile#3 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/sys/boot/zfs/Makefile,v 1.2 2008/11/22 14:24:55 dfr Exp $ +# $FreeBSD: src/sys/boot/zfs/Makefile,v 1.3 2008/12/06 14:45:03 ps Exp $ LIB= zfsboot INTERNALLIB= @@ -29,7 +29,7 @@ .if ${MACHINE_ARCH} == "amd64" CLEANFILES+= machine machine: - ln -sf ${.CURDIR}/../../../i386/include machine + ln -sf ${.CURDIR}/../../i386/include machine .endif .include <bsd.lib.mk> ==== //depot/projects/smpng/sys/boot/zfs/zfsimpl.c#3 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/boot/zfs/zfsimpl.c,v 1.2 2008/11/19 16:59:19 dfr Exp $"); +__FBSDID("$FreeBSD: src/sys/boot/zfs/zfsimpl.c,v 1.3 2008/12/10 10:46:34 dfr Exp $"); /* * Stand-alone ZFS file reader. @@ -623,7 +623,7 @@ uint64_t pool_txg, pool_guid; const char *pool_name; const unsigned char *vdevs; - int i; + int i, rc; char upbuf[1024]; const struct uberblock *up; @@ -723,7 +723,9 @@ DATA_TYPE_NVLIST, 0, &vdevs)) { return (EIO); } - vdev_init_from_nvlist(vdevs, &top_vdev); + rc = vdev_init_from_nvlist(vdevs, &top_vdev); + if (rc) + return (rc); /* * Add the toplevel vdev to the pool if its not already there. ==== //depot/projects/smpng/sys/compat/linprocfs/linprocfs.c#70 (text+ko) ==== @@ -42,7 +42,7 @@ #include "opt_compat.h" #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/compat/linprocfs/linprocfs.c,v 1.128 2008/12/02 21:37:28 bz Exp $"); +__FBSDID("$FreeBSD: src/sys/compat/linprocfs/linprocfs.c,v 1.131 2008/12/10 16:11:09 kib Exp $"); #include <sys/param.h> #include <sys/queue.h> @@ -273,8 +273,7 @@ /* XXX per-cpu vendor / class / model / id? */ } - sbuf_cat(sb, - "flags\t\t:"); + sbuf_cat(sb, "flags\t\t:"); if (!strcmp(cpu_vendor, "AuthenticAMD") && (class < 6)) { flags[16] = "fcmov"; @@ -876,10 +875,12 @@ linprocfs_doprocmaps(PFS_FILL_ARGS) { vm_map_t map = &p->p_vmspace->vm_map; - vm_map_entry_t entry; + vm_map_entry_t entry, tmp_entry; vm_object_t obj, tobj, lobj; - vm_offset_t saved_end; + vm_offset_t e_start, e_end; vm_ooffset_t off = 0; + vm_prot_t e_prot; + unsigned int last_timestamp; char *name = "", *freename = NULL; ino_t ino; int ref_count, shadow_count, flags; @@ -905,7 +906,9 @@ freename = NULL; if (entry->eflags & MAP_ENTRY_IS_SUB_MAP) continue; - saved_end = entry->end; + e_prot = entry->protection; + e_start = entry->start; + e_end = entry->end; obj = entry->object.vm_object; for (lobj = tobj = obj; tobj; tobj = tobj->backing_object) { VM_OBJECT_LOCK(tobj); @@ -913,6 +916,8 @@ VM_OBJECT_UNLOCK(lobj); lobj = tobj; } + last_timestamp = map->timestamp; + vm_map_unlock_read(map); ino = 0; if (lobj) { off = IDX_TO_OFF(lobj->size); @@ -950,10 +955,10 @@ */ error = sbuf_printf(sb, "%08lx-%08lx %s%s%s%s %08lx %02x:%02x %lu%s%s\n", - (u_long)entry->start, (u_long)entry->end, - (entry->protection & VM_PROT_READ)?"r":"-", - (entry->protection & VM_PROT_WRITE)?"w":"-", - (entry->protection & VM_PROT_EXECUTE)?"x":"-", + (u_long)e_start, (u_long)e_end, + (e_prot & VM_PROT_READ)?"r":"-", + (e_prot & VM_PROT_WRITE)?"w":"-", + (e_prot & VM_PROT_EXECUTE)?"x":"-", "p", (u_long)off, 0, @@ -964,10 +969,20 @@ ); if (freename) free(freename, M_TEMP); + vm_map_lock_read(map); if (error == -1) { error = 0; break; } + if (last_timestamp + 1 != map->timestamp) { + /* + * Look again for the entry because the map was + * modified while it was unlocked. Specifically, + * the entry may have been clipped, merged, or deleted. + */ + vm_map_lookup_entry(map, e_end - 1, &tmp_entry); + entry = tmp_entry; + } } vm_map_unlock_read(map); ==== //depot/projects/smpng/sys/contrib/pf/net/pf_table.c#7 (text+ko) ==== @@ -35,7 +35,7 @@ #include "opt_inet6.h" #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/contrib/pf/net/pf_table.c,v 1.9 2007/10/24 20:57:17 mlaier Exp $"); +__FBSDID("$FreeBSD: src/sys/contrib/pf/net/pf_table.c,v 1.10 2008/12/07 21:15:43 kmacy Exp $"); #endif #include <sys/param.h> @@ -43,6 +43,8 @@ #include <sys/socket.h> #include <sys/mbuf.h> #include <sys/kernel.h> +#include <sys/lock.h> +#include <sys/rwlock.h> #ifdef __FreeBSD__ #include <sys/malloc.h> #endif ==== //depot/projects/smpng/sys/dev/adb/adb.h#2 (text+ko) ==== @@ -22,7 +22,7 @@ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $FreeBSD: src/sys/dev/adb/adb.h,v 1.1 2008/10/26 19:37:38 nwhitehorn Exp $ + * $FreeBSD: src/sys/dev/adb/adb.h,v 1.2 2008/12/06 23:26:02 nwhitehorn Exp $ */ #ifndef _POWERPC_ADB_H_ @@ -68,7 +68,7 @@ uint8_t adb_get_device_handler(device_t dev); uint8_t adb_set_device_handler(device_t dev, uint8_t newhandler); -uint8_t adb_read_register(device_t dev, u_char reg, size_t *len, void *data); +size_t adb_read_register(device_t dev, u_char reg, void *data); /* Bits for implementing ADB host bus adapters */ extern devclass_t adb_devclass; ==== //depot/projects/smpng/sys/dev/adb/adb_bus.c#3 (text+ko) ==== @@ -22,7 +22,7 @@ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $FreeBSD: src/sys/dev/adb/adb_bus.c,v 1.3 2008/11/12 17:33:36 nwhitehorn Exp $ + * $FreeBSD: src/sys/dev/adb/adb_bus.c,v 1.4 2008/12/06 23:26:02 nwhitehorn Exp $ */ #include <sys/cdefs.h> @@ -48,7 +48,7 @@ static void adb_probe_nomatch(device_t dev, device_t child); static int adb_print_child(device_t dev, device_t child); -static int adb_send_raw_packet_sync(device_t dev, uint8_t to, uint8_t command, uint8_t reg, int len, u_char *data); +static int adb_send_raw_packet_sync(device_t dev, uint8_t to, uint8_t command, uint8_t reg, int len, u_char *data, u_char *reply); static char *adb_device_string[] = { "HOST", "dongle", "keyboard", "mouse", "tablet", "modem", "RESERVED", "misc" @@ -118,9 +118,8 @@ sc->packet_reply = 0; sc->autopoll_mask = 0; + sc->sync_packet = 0xffff; - mtx_init(&sc->sc_sync_mtx,"adbsyn",NULL,MTX_DEF | MTX_RECURSE); - /* Initialize devinfo */ for (i = 0; i < 16; i++) { sc->devinfo[i].address = i; @@ -128,7 +127,7 @@ } /* Reset ADB bus */ - adb_send_raw_packet_sync(dev,0,ADB_COMMAND_BUS_RESET,0,0,NULL); + adb_send_raw_packet_sync(dev,0,ADB_COMMAND_BUS_RESET,0,0,NULL,NULL); DELAY(1500); /* Enumerate bus */ @@ -140,7 +139,7 @@ do { reply = adb_send_raw_packet_sync(dev,i, - ADB_COMMAND_TALK,3,0,NULL); + ADB_COMMAND_TALK,3,0,NULL,NULL); if (reply) { /* If we got a response, relocate to next_free */ @@ -150,10 +149,10 @@ r3 |= 0x00fe; adb_send_raw_packet_sync(dev,i, ADB_COMMAND_LISTEN,3, - sizeof(uint16_t),(u_char *)(&r3)); + sizeof(uint16_t),(u_char *)(&r3),NULL); adb_send_raw_packet_sync(dev,next_free, - ADB_COMMAND_TALK,3,0,NULL); + ADB_COMMAND_TALK,3,0,NULL,NULL); sc->devinfo[next_free].default_address = i; if (first_relocated < 0) @@ -169,9 +168,9 @@ adb_send_raw_packet_sync(dev,first_relocated, ADB_COMMAND_LISTEN,3, - sizeof(uint16_t),(u_char *)(&r3)); + sizeof(uint16_t),(u_char *)(&r3),NULL); adb_send_raw_packet_sync(dev,i, - ADB_COMMAND_TALK,3,0,NULL); + ADB_COMMAND_TALK,3,0,NULL,NULL); sc->devinfo[i].default_address = i; sc->devinfo[(int)(first_relocated)].default_address = 0; @@ -194,10 +193,6 @@ static int adb_bus_detach(device_t dev) { - struct adb_softc *sc = device_get_softc(dev); - - mtx_destroy(&sc->sc_sync_mtx); - return (bus_generic_detach(dev)); } @@ -230,6 +225,7 @@ if (sc->sync_packet == command) { memcpy(sc->syncreg,data,(len > 8) ? 8 : len); atomic_store_rel_int(&sc->packet_reply,len + 1); + wakeup(sc); } if (sc->children[addr] != NULL) { @@ -317,12 +313,12 @@ static int adb_send_raw_packet_sync(device_t dev, uint8_t to, uint8_t command, - uint8_t reg, int len, u_char *data) + uint8_t reg, int len, u_char *data, u_char *reply) { u_char command_byte = 0; struct adb_softc *sc; int result = -1; - int i = 0; + int i = 1; sc = device_get_softc(dev); @@ -331,7 +327,8 @@ command_byte |= reg; /* Wait if someone else has a synchronous request pending */ - mtx_lock(&sc->sc_sync_mtx); + while (!atomic_cmpset_int(&sc->sync_packet, 0xffff, command_byte)) + tsleep(sc, 0, "ADB sync", hz/10); sc->packet_reply = 0; sc->sync_packet = command_byte; @@ -343,21 +340,27 @@ * Maybe the command got lost? Try resending and polling the * controller. */ - if (i > 40) + if (i % 40 == 0) ADB_HB_SEND_RAW_PACKET(sc->parent, command_byte, len, data, 1); - DELAY(100); + tsleep(sc, 0, "ADB sync", hz/10); i++; } result = sc->packet_reply - 1; + if (reply != NULL && result > 0) + memcpy(reply,sc->syncreg,result); + /* Clear packet sync */ sc->packet_reply = 0; - sc->sync_packet = 0xffff; /* We can't match a 16 bit value */ - mtx_unlock(&sc->sc_sync_mtx); + /* + * We can't match a value beyond 8 bits, so set sync_packet to + * 0xffff to avoid collisions. + */ + atomic_set_int(&sc->sync_packet, 0xffff); return (result); } @@ -375,37 +378,27 @@ newr3 = dinfo->register3 & 0xff00; newr3 |= (uint16_t)(newhandler); + adb_send_raw_packet_sync(sc->sc_dev,dinfo->address, ADB_COMMAND_LISTEN, + 3, sizeof(uint16_t), (u_char *)(&newr3), NULL); adb_send_raw_packet_sync(sc->sc_dev,dinfo->address, - ADB_COMMAND_LISTEN, 3, sizeof(uint16_t), (u_char *)(&newr3)); - adb_send_raw_packet_sync(sc->sc_dev,dinfo->address, - ADB_COMMAND_TALK, 3, 0, NULL); + ADB_COMMAND_TALK, 3, 0, NULL, NULL); return (dinfo->handler_id); } -uint8_t -adb_read_register(device_t dev, u_char reg, - size_t *len, void *data) +size_t +adb_read_register(device_t dev, u_char reg, void *data) { struct adb_softc *sc; struct adb_devinfo *dinfo; - size_t orig_len; + size_t result; dinfo = device_get_ivars(dev); sc = device_get_softc(device_get_parent(dev)); - orig_len = *len; + result = adb_send_raw_packet_sync(sc->sc_dev,dinfo->address, + ADB_COMMAND_TALK, reg, 0, NULL, data); - mtx_lock(&sc->sc_sync_mtx); - - *len = adb_send_raw_packet_sync(sc->sc_dev,dinfo->address, - ADB_COMMAND_TALK, reg, 0, NULL); - - if (*len > 0) - memcpy(data,sc->syncreg,*len); - - mtx_unlock(&sc->sc_sync_mtx); - - return ((*len > 0) ? 0 : -1); + return (result); } ==== //depot/projects/smpng/sys/dev/adb/adb_kbd.c#2 (text+ko) ==== @@ -22,7 +22,7 @@ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $FreeBSD: src/sys/dev/adb/adb_kbd.c,v 1.1 2008/10/26 19:37:38 nwhitehorn Exp $ + * $FreeBSD: src/sys/dev/adb/adb_kbd.c,v 1.2 2008/12/06 23:26:02 nwhitehorn Exp $ */ #include <sys/cdefs.h> @@ -271,12 +271,13 @@ } #endif + /* Check if we can read out the LED state from + this keyboard by reading the key state register */ + if (adb_read_register(dev, 2, NULL) == 2) + sc->have_led_control = 1; + adb_set_autopoll(dev,1); - /* Check (asynchronously) if we can read out the LED state from - this keyboard by reading the key state register */ - adb_send_packet(dev,ADB_COMMAND_TALK,2,0,NULL); - return (0); } @@ -323,11 +324,6 @@ if (command != ADB_COMMAND_TALK) return 0; - if (reg == 2 && len == 2) { - sc->have_led_control = 1; - return 0; - } - if (reg != 0 || len != 2) return (0); ==== //depot/projects/smpng/sys/dev/adb/adb_mouse.c#2 (text+ko) ==== @@ -22,7 +22,7 @@ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $FreeBSD: src/sys/dev/adb/adb_mouse.c,v 1.3 2008/11/02 19:08:10 ed Exp $ + * $FreeBSD: src/sys/dev/adb/adb_mouse.c,v 1.4 2008/12/06 23:26:02 nwhitehorn Exp $ */ #include <sys/cdefs.h> @@ -181,7 +181,7 @@ sc->mode.resolution = 200; break; case 4: - adb_read_register(dev,1,&r1_len,r1); + r1_len = adb_read_register(dev,1,r1); if (r1_len < 8) break; ==== //depot/projects/smpng/sys/dev/adb/adbvar.h#2 (text+ko) ==== @@ -22,7 +22,7 @@ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $FreeBSD: src/sys/dev/adb/adbvar.h,v 1.2 2008/10/30 15:27:13 nwhitehorn Exp $ + * $FreeBSD: src/sys/dev/adb/adbvar.h,v 1.3 2008/12/06 23:26:02 nwhitehorn Exp $ */ #ifndef _POWERPC_ADBVAR_H_ @@ -40,7 +40,6 @@ device_t parent; struct intr_config_hook enum_hook; - struct mtx sc_sync_mtx; volatile int sync_packet; volatile int packet_reply; ==== //depot/projects/smpng/sys/dev/ae/if_ae.c#2 (text+ko) ==== @@ -28,7 +28,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/ae/if_ae.c,v 1.1 2008/10/03 10:31:31 stas Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/ae/if_ae.c,v 1.2 2008/12/06 14:23:45 stas Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -1105,12 +1105,9 @@ static int ae_alloc_rings(ae_softc_t *sc) { - bus_dma_tag_t bustag; bus_addr_t busaddr; int error; - bustag = bus_get_dma_tag(sc->dev); - /* * Create parent DMA tag. */ @@ -1903,8 +1900,8 @@ if_printf(ifp, "Rx interrupt occuried.\n"); #endif size = le16toh(rxd->len) - ETHER_CRC_LEN; - if (size < 0) { - if_printf(ifp, "Negative length packet received."); + if (size < (ETHER_MIN_LEN - ETHER_CRC_LEN - ETHER_VLAN_ENCAP_LEN)) { + if_printf(ifp, "Runt frame received."); return (EIO); } ==== //depot/projects/smpng/sys/dev/ath/if_ath.c#61 (text+ko) ==== @@ -28,7 +28,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/ath/if_ath.c,v 1.221 2008/12/01 16:53:01 sam Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/ath/if_ath.c,v 1.223 2008/12/07 19:29:11 sam Exp $"); /* * Driver for the Atheros Wireless LAN controller. @@ -219,9 +219,15 @@ SYSCTL_DECL(_hw_ath); /* XXX validate sysctl values */ -static int ath_calinterval = 30; /* calibrate every 30 secs */ -SYSCTL_INT(_hw_ath, OID_AUTO, calibrate, CTLFLAG_RW, &ath_calinterval, - 0, "chip calibration interval (secs)"); +static int ath_longcalinterval = 30; /* long cals every 30 secs */ +SYSCTL_INT(_hw_ath, OID_AUTO, longcal, CTLFLAG_RW, &ath_longcalinterval, + 0, "long chip calibration interval (secs)"); +static int ath_shortcalinterval = 100; /* short cals every 100 ms */ +SYSCTL_INT(_hw_ath, OID_AUTO, shortcal, CTLFLAG_RW, &ath_shortcalinterval, + 0, "short chip calibration interval (msecs)"); +static int ath_resetcalinterval = 20*60; /* reset cal state 20 mins */ +SYSCTL_INT(_hw_ath, OID_AUTO, resetcal, CTLFLAG_RW, &ath_resetcalinterval, + 0, "reset chip calibration results (secs)"); static int ath_rxbuf = ATH_RXBUF; /* # rx buffers to allocate */ SYSCTL_INT(_hw_ath, OID_AUTO, rxbuf, CTLFLAG_RW, &ath_rxbuf, @@ -1433,8 +1439,9 @@ * state cached in the driver. */ sc->sc_diversity = ath_hal_getdiversity(ah); - sc->sc_calinterval = 1; - sc->sc_caltries = 0; + sc->sc_lastlongcal = 0; + sc->sc_resetcal = 1; + sc->sc_lastcalreset = 0; /* * Setup the hardware after reset: the key cache @@ -1566,8 +1573,6 @@ if_printf(ifp, "%s: unable to reset hardware; hal status %u\n", __func__, status); sc->sc_diversity = ath_hal_getdiversity(ah); - sc->sc_calinterval = 1; - sc->sc_caltries = 0; if (ath_startrecv(sc) != 0) /* restart recv */ if_printf(ifp, "%s: unable to start recv logic\n", __func__); /* @@ -5493,8 +5498,6 @@ } sc->sc_curchan = hchan; sc->sc_diversity = ath_hal_getdiversity(ah); - sc->sc_calinterval = 1; - sc->sc_caltries = 0; /* * Re-enable rx framework. @@ -5528,54 +5531,76 @@ { struct ath_softc *sc = arg; struct ath_hal *ah = sc->sc_ah; - HAL_BOOL iqCalDone; + struct ifnet *ifp = sc->sc_ifp; + HAL_BOOL longCal, isCalDone; + int nextcal; - sc->sc_stats.ast_per_cal++; - - if (ath_hal_getrfgain(ah) == HAL_RFGAIN_NEED_CHANGE) { + longCal = (ticks - sc->sc_lastlongcal >= ath_longcalinterval*hz); + if (longCal) { + sc->sc_stats.ast_per_cal++; + if (ath_hal_getrfgain(ah) == HAL_RFGAIN_NEED_CHANGE) { + /* + * Rfgain is out of bounds, reset the chip + * to load new gain values. + */ >>> TRUNCATED FOR MAIL (1000 lines) <<<
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200812102004.mBAK43KP006599>