Date: Tue, 27 Feb 2007 20:54:37 GMT From: John Baldwin <jhb@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 115142 for review Message-ID: <200702272054.l1RKsbFZ078496@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=115142 Change 115142 by jhb@jhb_mutex on 2007/02/27 20:53:48 IFC @115141. Affected files ... .. //depot/projects/smpng/sys/amd64/linux32/linux.h#10 integrate .. //depot/projects/smpng/sys/amd64/linux32/linux32_machdep.c#19 integrate .. //depot/projects/smpng/sys/arm/arm/db_interface.c#7 integrate .. //depot/projects/smpng/sys/arm/arm/locore.S#14 integrate .. //depot/projects/smpng/sys/arm/arm/support.S#11 integrate .. //depot/projects/smpng/sys/arm/arm/trap.c#27 integrate .. //depot/projects/smpng/sys/arm/at91/at91.c#9 integrate .. //depot/projects/smpng/sys/arm/at91/at91_rtc.c#4 integrate .. //depot/projects/smpng/sys/arm/at91/at91_spi.c#6 integrate .. //depot/projects/smpng/sys/arm/conf/AVILA#2 integrate .. //depot/projects/smpng/sys/arm/sa11x0/sa11x0_ost.c#7 integrate .. //depot/projects/smpng/sys/arm/xscale/ixp425/avila_ata.c#2 integrate .. //depot/projects/smpng/sys/arm/xscale/ixp425/ixp425_qmgr.c#2 integrate .. //depot/projects/smpng/sys/cam/scsi/scsi_target.c#23 integrate .. //depot/projects/smpng/sys/compat/linux/linux_emul.c#8 integrate .. //depot/projects/smpng/sys/compat/linux/linux_futex.c#3 integrate .. //depot/projects/smpng/sys/compat/linux/linux_futex.h#2 integrate .. //depot/projects/smpng/sys/compat/linux/linux_misc.c#80 integrate .. //depot/projects/smpng/sys/compat/linux/linux_uid16.c#23 integrate .. //depot/projects/smpng/sys/compat/linux/linux_util.c#17 integrate .. //depot/projects/smpng/sys/conf/NOTES#137 integrate .. //depot/projects/smpng/sys/conf/files#199 integrate .. //depot/projects/smpng/sys/conf/options#136 integrate .. //depot/projects/smpng/sys/dev/acpica/acpi_ec.c#41 integrate .. //depot/projects/smpng/sys/dev/ata/atapi-cam.c#30 integrate .. //depot/projects/smpng/sys/dev/ath/if_ath.c#50 integrate .. //depot/projects/smpng/sys/dev/ath/if_athvar.h#30 integrate .. //depot/projects/smpng/sys/dev/exca/exca.c#22 integrate .. //depot/projects/smpng/sys/dev/fdc/fdc.c#29 integrate .. //depot/projects/smpng/sys/dev/firewire/fwohci.c#36 integrate .. //depot/projects/smpng/sys/dev/firewire/sbp.c#40 integrate .. //depot/projects/smpng/sys/dev/hptmv/entry.c#13 integrate .. //depot/projects/smpng/sys/dev/hptmv/ioctl.c#5 integrate .. //depot/projects/smpng/sys/dev/hwpmc/hwpmc_mod.c#20 integrate .. //depot/projects/smpng/sys/dev/ipmi/ipmi_ssif.c#2 integrate .. //depot/projects/smpng/sys/dev/mii/rlphy.c#22 integrate .. //depot/projects/smpng/sys/dev/pccard/pccard_cis.c#25 integrate .. //depot/projects/smpng/sys/dev/pccbb/pccbb.c#63 integrate .. //depot/projects/smpng/sys/dev/random/randomdev_soft.c#13 integrate .. //depot/projects/smpng/sys/dev/re/if_re.c#52 integrate .. //depot/projects/smpng/sys/dev/scd/scd.c#13 integrate .. //depot/projects/smpng/sys/dev/sound/midi/midi.c#13 integrate .. //depot/projects/smpng/sys/dev/sound/midi/midi.h#10 integrate .. //depot/projects/smpng/sys/dev/sound/midi/midiq.h#3 integrate .. //depot/projects/smpng/sys/dev/sound/midi/mpu401.c#3 integrate .. //depot/projects/smpng/sys/dev/sound/midi/mpu401.h#3 integrate .. //depot/projects/smpng/sys/dev/sound/midi/mpu_if.m#3 integrate .. //depot/projects/smpng/sys/dev/sound/midi/mpufoi_if.m#3 integrate .. //depot/projects/smpng/sys/dev/sound/midi/sequencer.c#17 integrate .. //depot/projects/smpng/sys/dev/sound/midi/sequencer.h#6 integrate .. //depot/projects/smpng/sys/dev/sound/midi/synth_if.m#3 integrate .. //depot/projects/smpng/sys/dev/sound/pci/hda/hdac.c#10 integrate .. //depot/projects/smpng/sys/dev/usb/sl811hs.c#5 integrate .. //depot/projects/smpng/sys/dev/usb/sl811hsvar.h#4 integrate .. //depot/projects/smpng/sys/dev/usb/usb_subr.c#39 integrate .. //depot/projects/smpng/sys/dev/usb/uvscom.c#20 integrate .. //depot/projects/smpng/sys/dev/zs/z8530var.h#3 integrate .. //depot/projects/smpng/sys/dev/zs/zs.c#25 integrate .. //depot/projects/smpng/sys/dev/zs/zs_macio.c#6 integrate .. //depot/projects/smpng/sys/fs/smbfs/smbfs_smb.c#16 integrate .. //depot/projects/smpng/sys/geom/geom_dev.c#43 integrate .. //depot/projects/smpng/sys/geom/geom_io.c#46 integrate .. //depot/projects/smpng/sys/geom/multipath/g_multipath.c#1 branch .. //depot/projects/smpng/sys/geom/multipath/g_multipath.h#1 branch .. //depot/projects/smpng/sys/i386/ibcs2/ibcs2_xenix.c#22 integrate .. //depot/projects/smpng/sys/i386/linux/imgact_linux.c#18 integrate .. //depot/projects/smpng/sys/i386/linux/linux.h#17 integrate .. //depot/projects/smpng/sys/i386/linux/linux_machdep.c#44 integrate .. //depot/projects/smpng/sys/ia64/isa/isa.c#4 integrate .. //depot/projects/smpng/sys/isa/syscons_isa.c#12 integrate .. //depot/projects/smpng/sys/kern/kern_fork.c#106 integrate .. //depot/projects/smpng/sys/kern/kern_intr.c#84 integrate .. //depot/projects/smpng/sys/kern/kern_linker.c#85 integrate .. //depot/projects/smpng/sys/kern/kern_lock.c#58 integrate .. //depot/projects/smpng/sys/kern/kern_mutex.c#140 integrate .. //depot/projects/smpng/sys/kern/kern_resource.c#69 integrate .. //depot/projects/smpng/sys/kern/kern_rwlock.c#10 integrate .. //depot/projects/smpng/sys/kern/kern_sx.c#40 integrate .. //depot/projects/smpng/sys/kern/kern_synch.c#112 integrate .. //depot/projects/smpng/sys/kern/link_elf.c#42 integrate .. //depot/projects/smpng/sys/kern/sched_4bsd.c#68 integrate .. //depot/projects/smpng/sys/kern/sched_ule.c#74 integrate .. //depot/projects/smpng/sys/kern/subr_bus.c#65 integrate .. //depot/projects/smpng/sys/kern/subr_lock.c#6 integrate .. //depot/projects/smpng/sys/kern/uipc_socket.c#101 integrate .. //depot/projects/smpng/sys/kern/uipc_usrreq.c#73 integrate .. //depot/projects/smpng/sys/modules/geom/Makefile#16 integrate .. //depot/projects/smpng/sys/modules/geom/geom_multipath/Makefile#1 branch .. //depot/projects/smpng/sys/net/bpf.c#67 integrate .. //depot/projects/smpng/sys/net/bpf.h#20 integrate .. //depot/projects/smpng/sys/net/bpfdesc.h#18 integrate .. //depot/projects/smpng/sys/netinet/in.h#38 integrate .. //depot/projects/smpng/sys/netinet/ip_mroute.c#53 integrate .. //depot/projects/smpng/sys/netinet/tcp_input.c#95 integrate .. //depot/projects/smpng/sys/netinet/tcp_subr.c#87 integrate .. //depot/projects/smpng/sys/netinet/tcp_timer.c#32 integrate .. //depot/projects/smpng/sys/netinet/tcp_timer.h#13 integrate .. //depot/projects/smpng/sys/netinet/tcp_usrreq.c#57 integrate .. //depot/projects/smpng/sys/netinet/tcp_var.h#47 integrate .. //depot/projects/smpng/sys/netinet6/ip6_mroute.c#29 integrate .. //depot/projects/smpng/sys/netinet6/raw_ip6.c#43 integrate .. //depot/projects/smpng/sys/netipx/ipx_ip.c#17 integrate .. //depot/projects/smpng/sys/netipx/ipx_ip.h#6 integrate .. //depot/projects/smpng/sys/netncp/ncp_sock.c#10 integrate .. //depot/projects/smpng/sys/nfsclient/bootp_subr.c#34 integrate .. //depot/projects/smpng/sys/pc98/cbus/clock.c#8 integrate .. //depot/projects/smpng/sys/pc98/cbus/syscons_cbus.c#3 integrate .. //depot/projects/smpng/sys/powerpc/powermac/pswitch.c#4 integrate .. //depot/projects/smpng/sys/sparc64/sparc64/machdep.c#84 integrate .. //depot/projects/smpng/sys/sys/extattr.h#9 integrate .. //depot/projects/smpng/sys/sys/lock.h#42 integrate .. //depot/projects/smpng/sys/sys/lock_profile.h#4 integrate .. //depot/projects/smpng/sys/sys/mutex.h#69 integrate .. //depot/projects/smpng/sys/sys/rwlock.h#6 integrate .. //depot/projects/smpng/sys/sys/unpcb.h#12 integrate .. //depot/projects/smpng/sys/tools/fw_stub.awk#4 integrate .. //depot/projects/smpng/sys/vm/phys_pager.c#15 integrate .. //depot/projects/smpng/sys/vm/swap_pager.c#69 integrate .. //depot/projects/smpng/sys/vm/vm_kern.c#36 integrate .. //depot/projects/smpng/sys/vm/vm_map.c#83 integrate .. //depot/projects/smpng/sys/vm/vm_object.c#92 integrate .. //depot/projects/smpng/sys/vm/vm_page.c#90 integrate .. //depot/projects/smpng/sys/vm/vm_page.h#38 integrate Differences ... ==== //depot/projects/smpng/sys/amd64/linux32/linux.h#10 (text+ko) ==== @@ -27,7 +27,7 @@ * (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: src/sys/amd64/linux32/linux.h,v 1.12 2007/02/15 00:54:40 jkim Exp $ + * $FreeBSD: src/sys/amd64/linux32/linux.h,v 1.13 2007/02/24 16:49:24 netchild Exp $ */ #ifndef _AMD64_LINUX_LINUX_H_ @@ -783,7 +783,7 @@ /* * macros which does the same thing as those in linux include/asm-um/ldt-i386.h - * these convert linux user-space descriptor to machine one + * these convert linux user space descriptor to machine one */ #define LDT_entry_a(info) \ ((((info)->base_addr & LINUX_LOWERWORD) << 16) | ((info)->limit & LINUX_LOWERWORD)) ==== //depot/projects/smpng/sys/amd64/linux32/linux32_machdep.c#19 (text+ko) ==== @@ -29,7 +29,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/amd64/linux32/linux32_machdep.c,v 1.33 2007/02/15 01:20:43 jkim Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/linux32/linux32_machdep.c,v 1.35 2007/02/27 02:08:00 jkim Exp $"); #include <sys/param.h> #include <sys/kernel.h> @@ -568,8 +568,8 @@ /* * XXX: in linux sharing of fs info (chroot/cwd/umask) * and open files is independant. in fbsd its in one - * structure but in reality it doesnt make any problems - * because both this flags are set at once usually. + * structure but in reality it doesn't cause any problems + * because both of these flags are usually set together. */ if (!(args->flags & (CLONE_FILES | CLONE_FS))) ff |= RFFDG; @@ -579,7 +579,7 @@ * kernel threads. Unfortunately despite the existence of the * CLONE_THREAD flag, version of linuxthreads package used in * most popular distros as of beginning of 2005 doesn't make - * any use of it. Therefore, this detection relay fully on + * any use of it. Therefore, this detection relies on * empirical observation that linuxthreads sets certain * combination of flags, so that we can make more or less * precise detection and notify the FreeBSD kernel that several @@ -793,7 +793,9 @@ if (bsd_args.prot & (PROT_READ | PROT_WRITE | PROT_EXEC)) bsd_args.prot |= PROT_READ | PROT_EXEC; - if (linux_args->fd != -1) { + /* Linux does not check file descriptor when MAP_ANONYMOUS is set. */ + bsd_args.fd = (bsd_args.flags & MAP_ANON) ? -1 : linux_args->fd; + if (bsd_args.fd != -1) { /* * Linux follows Solaris mmap(2) description: * The file descriptor fildes is opened with @@ -801,7 +803,7 @@ * protection options specified. */ - if ((error = fget(td, linux_args->fd, &fp)) != 0) + if ((error = fget(td, bsd_args.fd, &fp)) != 0) return (error); if (fp->f_type != DTYPE_VNODE) { fdrop(fp, td); @@ -816,7 +818,6 @@ fdrop(fp, td); } - bsd_args.fd = linux_args->fd; if (linux_args->flags & LINUX_MAP_GROWSDOWN) { /* @@ -833,7 +834,7 @@ * Our mmap with MAP_STACK takes addr as the maximum * downsize limit on BOS, and as len the max size of * the region. It them maps the top SGROWSIZ bytes, - * and autgrows the region down, up to the limit + * and auto grows the region down, up to the limit * in addr. * * If we don't use the MAP_STACK option, the effect ==== //depot/projects/smpng/sys/arm/arm/db_interface.c#7 (text+ko) ==== @@ -35,7 +35,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/arm/arm/db_interface.c,v 1.6 2007/02/14 01:25:41 kevlo Exp $"); +__FBSDID("$FreeBSD: src/sys/arm/arm/db_interface.c,v 1.7 2007/02/26 05:17:47 kevlo Exp $"); #include "opt_ddb.h" #include <sys/param.h> @@ -53,7 +53,6 @@ #include <vm/vm_extern.h> #include <machine/db_machdep.h> -#include <machine/katelib.h> #include <machine/vmparam.h> #include <machine/cpu.h> ==== //depot/projects/smpng/sys/arm/arm/locore.S#14 (text+ko) ==== @@ -37,7 +37,7 @@ #include <machine/asm.h> #include <machine/armreg.h> #include <machine/pte.h> -__FBSDID("$FreeBSD: src/sys/arm/arm/locore.S,v 1.15 2007/02/19 00:57:27 cognet Exp $"); +__FBSDID("$FreeBSD: src/sys/arm/arm/locore.S,v 1.16 2007/02/26 02:03:48 cognet Exp $"); /* What size should this really be ? It is only used by initarm() */ #define INIT_ARM_STACK_SIZE 2048 @@ -95,11 +95,6 @@ sub r0, r0, r9 add r0, r0, r8 mov r4, r0 - /* Make sure _arm_memcpy is NULL */ - ldr r3, .L_arm_memcpy - ldr r3, [r3] - mov r5, #0 - str r5, [r3] bl memcpy ldr r0, Lram_offset add pc, r4, r0 ==== //depot/projects/smpng/sys/arm/arm/support.S#11 (text+ko) ==== @@ -26,7 +26,7 @@ #include <machine/asm.h> #include <machine/asmacros.h> -__FBSDID("$FreeBSD: src/sys/arm/arm/support.S,v 1.11 2005/10/23 23:09:14 cognet Exp $"); +__FBSDID("$FreeBSD: src/sys/arm/arm/support.S,v 1.12 2007/02/26 02:03:48 cognet Exp $"); #include "assym.s" @@ -871,6 +871,18 @@ #if !defined(__XSCALE__) ENTRY(memcpy) /* save leaf functions having to store this away */ + /* Do not check arm_memcpy if we're running from flash */ +#ifdef FLASHADDR +#if FLASHADDR > PHYSADDR + ldr r3, =FLASHADDR + cmp r3, pc + bls .Lnormal +#else + ldr r3, =FLASHADDR + cmp r3, pc + bhi .Lnormal +#endif +#endif ldr r3, .L_arm_memcpy ldr r3, [r3] cmp r3, #0 @@ -1096,6 +1108,17 @@ pld [r1] cmp r2, #0x0c ble .Lmemcpy_short /* <= 12 bytes */ +#ifdef FLASHADDR +#if FLASHADDR > PHYSADDR + ldr r3, =FLASHADDR + cmp r3, pc + bls .Lnormal +#else + ldr r3, =FLASHADDR + cmp r3, pc + bhi .Lnormal +#endif +#endif ldr r3, .L_arm_memcpy ldr r3, [r3] cmp r3, #0 ==== //depot/projects/smpng/sys/arm/arm/trap.c#27 (text+ko) ==== @@ -82,7 +82,7 @@ #include "opt_ktrace.h" #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/arm/arm/trap.c,v 1.32 2006/10/26 21:42:16 jb Exp $"); +__FBSDID("$FreeBSD: src/sys/arm/arm/trap.c,v 1.33 2007/02/26 05:17:47 kevlo Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -110,7 +110,6 @@ #include <machine/cpuconf.h> #include <machine/vmparam.h> #include <machine/frame.h> -#include <machine/katelib.h> #include <machine/cpu.h> #include <machine/intr.h> #include <machine/pcb.h> ==== //depot/projects/smpng/sys/arm/at91/at91.c#9 (text) ==== @@ -23,7 +23,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/arm/at91/at91.c,v 1.11 2007/02/23 12:18:27 piso Exp $"); +__FBSDID("$FreeBSD: src/sys/arm/at91/at91.c,v 1.12 2007/02/25 14:34:59 piso Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -548,7 +548,7 @@ { struct at91_softc *sc = device_get_softc(dev); - if (rman_get_start(ires) == AT91RM92_IRQ_SYSTEM && !(flags & INTR_FAST)) + if (rman_get_start(ires) == AT91RM92_IRQ_SYSTEM && filt == NULL) panic("All system interrupt ISRs must be type INTR_FAST"); BUS_SETUP_INTR(device_get_parent(dev), child, ires, flags, filt, intr, arg, cookiep); ==== //depot/projects/smpng/sys/arm/at91/at91_rtc.c#4 (text) ==== @@ -23,7 +23,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/arm/at91/at91_rtc.c,v 1.3 2007/02/23 12:18:27 piso Exp $"); +__FBSDID("$FreeBSD: src/sys/arm/at91/at91_rtc.c,v 1.4 2007/02/27 13:39:34 piso Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -80,7 +80,7 @@ static int at91_rtc_probe(device_t dev); static int at91_rtc_attach(device_t dev); static int at91_rtc_detach(device_t dev); -static void at91_rtc_intr(void *); +static int at91_rtc_intr(void *); /* helper routines */ static int at91_rtc_activate(device_t dev); ==== //depot/projects/smpng/sys/arm/at91/at91_spi.c#6 (text) ==== @@ -23,7 +23,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/arm/at91/at91_spi.c,v 1.5 2007/02/23 12:18:27 piso Exp $"); +__FBSDID("$FreeBSD: src/sys/arm/at91/at91_spi.c,v 1.6 2007/02/27 17:15:39 jhb Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -248,7 +248,7 @@ rxdone = sc->rxdone; do { - err = msleep(&sc->rxdone, NULL, PCATCH | PZERO, "spi", hz); + err = tsleep(&sc->rxdone, PCATCH | PZERO, "spi", hz); } while (rxdone == sc->rxdone && err != EINTR); WR4(sc, PDC_PTCR, PDC_PTCR_TXTDIS | PDC_PTCR_RXTDIS); if (err == 0) { ==== //depot/projects/smpng/sys/arm/conf/AVILA#2 (text+ko) ==== @@ -16,7 +16,7 @@ # If you are in doubt as to the purpose or necessity of a line, check first # in NOTES. # -# $FreeBSD: src/sys/arm/conf/AVILA,v 1.2 2006/11/22 12:57:17 kevlo Exp $ +# $FreeBSD: src/sys/arm/conf/AVILA,v 1.3 2007/02/26 02:04:24 cognet Exp $ machine arm ident AVILA @@ -24,6 +24,8 @@ options PHYSADDR=0x10000000 options KERNPHYSADDR=0x10200000 options KERNVIRTADDR=0xc0200000 # Used in ldscript.arm +options FLASHADDR=0x50000000 +options LOADERRAMADDR=0x00000000 options STARTUP_PAGETABLE_ADDR=0x10000000 include "../xscale/ixp425/std.avila" ==== //depot/projects/smpng/sys/arm/sa11x0/sa11x0_ost.c#7 (text+ko) ==== @@ -38,7 +38,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/arm/sa11x0/sa11x0_ost.c,v 1.6 2007/02/23 12:18:28 piso Exp $"); +__FBSDID("$FreeBSD: src/sys/arm/sa11x0/sa11x0_ost.c,v 1.7 2007/02/26 05:17:47 kevlo Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -57,8 +57,6 @@ #include <machine/cpufunc.h> #include <machine/frame.h> -#include <machine/katelib.h> - #include <arm/sa11x0/sa11x0_reg.h> #include <arm/sa11x0/sa11x0_var.h> #include <arm/sa11x0/sa11x0_ostreg.h> ==== //depot/projects/smpng/sys/arm/xscale/ixp425/avila_ata.c#2 (text+ko) ==== @@ -28,7 +28,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/arm/xscale/ixp425/avila_ata.c,v 1.1 2006/11/19 23:55:23 sam Exp $"); +__FBSDID("$FreeBSD: src/sys/arm/xscale/ixp425/avila_ata.c,v 1.2 2007/02/25 22:17:54 cognet Exp $"); /* * Compact Flash Support for the Avila Gateworks XScale boards. @@ -160,7 +160,7 @@ panic("Unable to allocate irq %u.\n", AVILA_IDE_IRQ); bus_setup_intr(dev, sc->sc_irq, INTR_TYPE_BIO | INTR_MPSAFE | INTR_ENTROPY, - ata_avila_intr, sc, &sc->sc_ih); + NULL, ata_avila_intr, sc, &sc->sc_ih); /* attach channel on this controller */ device_add_child(dev, "ata", devclass_find_free_unit(ata_devclass, 0)); @@ -225,8 +225,8 @@ static int ata_avila_setup_intr(device_t dev, device_t child, struct resource *irq, - int flags, driver_intr_t *function, void *argument, - void **cookiep) + int flags, driver_filter_t *filt, + driver_intr_t *function, void *argument, void **cookiep) { struct ata_avila_softc *sc = device_get_softc(dev); int unit = ((struct ata_channel *)device_get_softc(child))->unit; ==== //depot/projects/smpng/sys/arm/xscale/ixp425/ixp425_qmgr.c#2 (text+ko) ==== @@ -57,7 +57,7 @@ * SUCH DAMAGE. */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/arm/xscale/ixp425/ixp425_qmgr.c,v 1.1 2006/11/19 23:55:23 sam Exp $"); +__FBSDID("$FreeBSD: src/sys/arm/xscale/ixp425/ixp425_qmgr.c,v 1.2 2007/02/25 22:17:54 cognet Exp $"); /* * Intel XScale Queue Manager support. @@ -225,7 +225,7 @@ panic("Unable to allocate the qmgr irqs.\n"); /* XXX could be a source of entropy */ bus_setup_intr(dev, sc->sc_irq, INTR_TYPE_NET | INTR_MPSAFE, - ixpqmgr_intr, NULL, &sc->sc_ih); + NULL, ixpqmgr_intr, NULL, &sc->sc_ih); /* NB: softc is pre-zero'd */ for (i = 0; i < IX_QMGR_MAX_NUM_QUEUES; i++) { ==== //depot/projects/smpng/sys/cam/scsi/scsi_target.c#23 (text+ko) ==== @@ -28,7 +28,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/cam/scsi/scsi_target.c,v 1.71 2006/12/05 07:45:28 mjacob Exp $"); +__FBSDID("$FreeBSD: src/sys/cam/scsi/scsi_target.c,v 1.72 2007/02/27 17:15:39 jhb Exp $"); #include <sys/param.h> @@ -810,8 +810,8 @@ user_descr = TAILQ_FIRST(abort_queue); while (ccb_h == NULL && user_descr == NULL) { if ((ioflag & IO_NDELAY) == 0) { - error = msleep(user_queue, NULL, - PRIBIO | PCATCH, "targrd", 0); + error = tsleep(user_queue, + PRIBIO | PCATCH, "targrd", 0); ccb_h = TAILQ_FIRST(user_queue); user_descr = TAILQ_FIRST(abort_queue); if (error != 0) { @@ -1037,7 +1037,7 @@ /* If we aborted at least one pending CCB ok, wait for it. */ if (cab.ccb_h.status == CAM_REQ_CMP) { - msleep(&softc->pending_ccb_queue, NULL, + tsleep(&softc->pending_ccb_queue, PRIBIO | PCATCH, "tgabrt", 0); } ==== //depot/projects/smpng/sys/compat/linux/linux_emul.c#8 (text+ko) ==== @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/compat/linux/linux_emul.c,v 1.17 2007/02/23 22:39:26 netchild Exp $"); +__FBSDID("$FreeBSD: src/sys/compat/linux/linux_emul.c,v 1.18 2007/02/24 16:49:24 netchild Exp $"); #include "opt_compat.h" @@ -212,7 +212,7 @@ error = linux_sys_futex(FIRST_THREAD_IN_PROC(p), &cup); /* * this cannot happen at the moment and if this happens it - * probably mean there is a userspace bug + * probably means there is a user space bug */ if (error) printf(LMSG("futex stuff in proc_exit failed.\n")); ==== //depot/projects/smpng/sys/compat/linux/linux_futex.c#3 (text+ko) ==== @@ -1,4 +1,4 @@ -/* $NetBSD: linux_futex.c,v 1.5 2005/11/23 16:14:57 manu Exp $ */ +/* $NetBSD: linux_futex.c,v 1.7 2006/07/24 19:01:49 manu Exp $ */ /*- * Copyright (c) 2005 Emmanuel Dreyfus, all rights reserved. @@ -14,14 +14,14 @@ * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by Emmanuel Dreyfus - * 4. The name of the author may not be used to endorse or promote - * products derived from this software without specific prior written + * 4. The name of the author may not be used to endorse or promote + * products derived from this software without specific prior written * permission. * - * THIS SOFTWARE IS PROVIDED BY THE THE AUTHOR AND CONTRIBUTORS ``AS IS'' - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THIS SOFTWARE IS PROVIDED BY THE 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 + * 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 @@ -32,9 +32,9 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/compat/linux/linux_futex.c,v 1.6 2006/09/09 16:25:25 netchild Exp $"); +__FBSDID("$FreeBSD: src/sys/compat/linux/linux_futex.c,v 1.8 2007/02/25 12:43:07 netchild Exp $"); #if 0 - __KERNEL_RCSID(1, "$NetBSD: linux_futex.c,v 1.5 2005/11/23 16:14:57 manu Exp $"); +__KERNEL_RCSID(1, "$NetBSD: linux_futex.c,v 1.7 2006/07/24 19:01:49 manu Exp $"); #endif #include "opt_compat.h" @@ -67,8 +67,8 @@ TAILQ_ENTRY(waiting_proc) wp_list; }; struct futex { - void *f_uaddr; - int f_refcount; + void *f_uaddr; + int f_refcount; LIST_ENTRY(futex) f_list; TAILQ_HEAD(lf_waiting_proc, waiting_proc) f_waiting_proc; }; @@ -85,7 +85,7 @@ #define FUTEX_SYSTEM_LOCK mtx_lock(&Giant) #define FUTEX_SYSTEM_UNLOCK mtx_unlock(&Giant) -static struct futex *futex_get(void *, int); +static struct futex *futex_get(void *, int); static void futex_put(struct futex *); static int futex_sleep(struct futex *, struct thread *, unsigned long); static int futex_wake(struct futex *, int, struct futex *); @@ -105,7 +105,7 @@ { int val; int ret; - struct l_timespec timeout = { 0, 0 }; + struct l_timespec timeout = {0, 0}; int error = 0; struct futex *f; struct futex *newf; @@ -118,56 +118,57 @@ #ifdef DEBUG if (ldebug(sys_futex)) - printf(ARGS(futex,"%p, %i, %i"), args->uaddr, args->op, args->val); + printf(ARGS(futex, "%p, %i, %i"), args->uaddr, args->op, + args->val); #endif switch (args->op) { case LINUX_FUTEX_WAIT: - FUTEX_SYSTEM_LOCK; + FUTEX_SYSTEM_LOCK; - if ((error = copyin(args->uaddr, + if ((error = copyin(args->uaddr, &val, sizeof(val))) != 0) { - FUTEX_SYSTEM_UNLOCK; + FUTEX_SYSTEM_UNLOCK; return error; } if (val != args->val) { - FUTEX_SYSTEM_UNLOCK; + FUTEX_SYSTEM_UNLOCK; return EWOULDBLOCK; } if (args->timeout != NULL) { - if ((error = copyin(args->timeout, + if ((error = copyin(args->timeout, &timeout, sizeof(timeout))) != 0) { - FUTEX_SYSTEM_UNLOCK; + FUTEX_SYSTEM_UNLOCK; return error; } } #ifdef DEBUG if (ldebug(sys_futex)) - printf("FUTEX_WAIT %d: val = %d, uaddr = %p, " - "*uaddr = %d, timeout = %d.%09lu\n", - td->td_proc->p_pid, args->val, - args->uaddr, val, timeout.tv_sec, - (unsigned long)timeout.tv_nsec); + printf("FUTEX_WAIT %d: val = %d, uaddr = %p, " + "*uaddr = %d, timeout = %d.%09lu\n", + td->td_proc->p_pid, args->val, + args->uaddr, val, timeout.tv_sec, + (unsigned long)timeout.tv_nsec); #endif tv.tv_usec = timeout.tv_sec * 1000000 + timeout.tv_nsec / 1000; timeout_hz = tvtohz(&tv); if (timeout.tv_sec == 0 && timeout.tv_nsec == 0) - timeout_hz = 0; - /* - * If the user process requests a non null timeout, - * make sure we do not turn it into an infinite - * timeout because timeout_hz gets null. - * - * We use a minimal timeout of 1/hz. Maybe it would - * make sense to just return ETIMEDOUT without sleeping. - */ - if (((timeout.tv_sec != 0) || (timeout.tv_nsec != 0)) && - (timeout_hz == 0)) - timeout_hz = 1; + timeout_hz = 0; + /* + * If the user process requests a non null timeout, + * make sure we do not turn it into an infinite + * timeout because timeout_hz gets null. + * + * We use a minimal timeout of 1/hz. Maybe it would + * make sense to just return ETIMEDOUT without sleeping. + */ + if (((timeout.tv_sec != 0) || (timeout.tv_nsec != 0)) && + (timeout_hz == 0)) + timeout_hz = 1; f = futex_get(args->uaddr, FUTEX_UNLOCKED); @@ -176,8 +177,8 @@ #ifdef DEBUG if (ldebug(sys_futex)) - printf("FUTEX_WAIT %d: uaddr = %p, " - "ret = %d\n", td->td_proc->p_pid, args->uaddr, ret); + printf("FUTEX_WAIT %d: uaddr = %p, " + "ret = %d\n", td->td_proc->p_pid, args->uaddr, ret); #endif FUTEX_SYSTEM_UNLOCK; @@ -188,37 +189,37 @@ case EINTR: /* signal */ return EINTR; break; - case 0: /* FUTEX_WAKE received */ + case 0: /* FUTEX_WAKE received */ #ifdef DEBUG if (ldebug(sys_futex)) printf("FUTEX_WAIT %d: uaddr = %p, got FUTEX_WAKE\n", - td->td_proc->p_pid, args->uaddr); + td->td_proc->p_pid, args->uaddr); #endif return 0; break; default: #ifdef DEBUG if (ldebug(sys_futex)) - printf("FUTEX_WAIT: unexpected ret = %d\n", ret); + printf("FUTEX_WAIT: unexpected ret = %d\n", ret); #endif break; } /* NOTREACHED */ break; - + case LINUX_FUTEX_WAKE: FUTEX_SYSTEM_LOCK; - /* - * XXX: Linux is able cope with different addresses - * corresponding to the same mapped memory in the sleeping + /* + * XXX: Linux is able cope with different addresses + * corresponding to the same mapped memory in the sleeping * and the waker process. */ #ifdef DEBUG if (ldebug(sys_futex)) - printf("FUTEX_WAKE %d: uaddr = %p, val = %d\n", - td->td_proc->p_pid, args->uaddr, args->val); + printf("FUTEX_WAKE %d: uaddr = %p, val = %d\n", + td->td_proc->p_pid, args->uaddr, args->val); #endif f = futex_get(args->uaddr, FUTEX_UNLOCKED); td->td_retval[0] = futex_wake(f, args->val, NULL); @@ -230,14 +231,14 @@ case LINUX_FUTEX_CMP_REQUEUE: FUTEX_SYSTEM_LOCK; - if ((error = copyin(args->uaddr, + if ((error = copyin(args->uaddr, &val, sizeof(val))) != 0) { - FUTEX_SYSTEM_UNLOCK; + FUTEX_SYSTEM_UNLOCK; return error; } if (val != args->val3) { - FUTEX_SYSTEM_UNLOCK; + FUTEX_SYSTEM_UNLOCK; return EAGAIN; } @@ -272,30 +273,32 @@ FUTEX_SYSTEM_LOCK; #ifdef DEBUG if (ldebug(sys_futex)) - printf("FUTEX_WAKE_OP: %d: uaddr = %p, op = %d, val = %d, uaddr2 = %p, val3 = %d\n", - td->td_proc->p_pid, args->uaddr, args->op, args->val, args->uaddr2, args->val3); + printf("FUTEX_WAKE_OP: %d: uaddr = %p, op = %d, val = %d, uaddr2 = %p, val3 = %d\n", + td->td_proc->p_pid, args->uaddr, args->op, args->val, + args->uaddr2, args->val3); #endif f = futex_get(args->uaddr, FUTEX_UNLOCKED); f2 = futex_get(args->uaddr2, FUTEX_UNLOCKED); - /* This function returns positive number as results - * and negative as errors + /* + * This function returns positive number as results and + * negative as errors */ op_ret = futex_atomic_op(td, args->val3, args->uaddr2); if (op_ret < 0) { - /* XXX: we dont handle the EFAULT yet */ - if (op_ret != -EFAULT) { - futex_put(f); - futex_put(f2); + /* XXX: we dont handle the EFAULT yet */ + if (op_ret != -EFAULT) { + futex_put(f); + futex_put(f2); FUTEX_SYSTEM_UNLOCK; - return (-op_ret); + return (-op_ret); } futex_put(f); futex_put(f2); - FUTEX_SYSTEM_UNLOCK; + FUTEX_SYSTEM_UNLOCK; return (EFAULT); } @@ -335,12 +338,12 @@ struct futex *f; if (locked == FUTEX_UNLOCKED) - FUTEX_LOCK; + FUTEX_LOCK; LIST_FOREACH(f, &futex_list, f_list) { if (f->f_uaddr == uaddr) { f->f_refcount++; if (locked == FUTEX_UNLOCKED) - FUTEX_UNLOCK; + FUTEX_UNLOCK; return f; } } @@ -351,17 +354,17 @@ TAILQ_INIT(&f->f_waiting_proc); LIST_INSERT_HEAD(&futex_list, f, f_list); if (locked == FUTEX_UNLOCKED) - FUTEX_UNLOCK; + FUTEX_UNLOCK; return f; } -static void +static void futex_put(f) struct futex *f; { - FUTEX_LOCK; - f->f_refcount--; + FUTEX_LOCK; + f->f_refcount--; if (f->f_refcount == 0) { LIST_REMOVE(f, f_list); free(f, M_LINUX); @@ -371,7 +374,7 @@ return; } -static int +static int futex_sleep(struct futex *f, struct thread *td, unsigned long timeout) { struct waiting_proc *wp; @@ -386,10 +389,15 @@ #ifdef DEBUG if (ldebug(sys_futex)) - printf("FUTEX --> %d tlseep timeout = %ld\n", td->td_proc->p_pid, - timeout); + printf("FUTEX --> %d tlseep timeout = %ld\n", td->td_proc->p_pid, + timeout); +#endif + ret = tsleep(wp, PCATCH | PZERO, "linuxfutex", timeout); +#ifdef DEBUG + if (ldebug(sys_futex)) + printf("FUTEX -> %d tsleep returns %d\n", + td->td_proc->p_pid, ret); #endif - ret = tsleep(wp, PCATCH|PZERO, "linuxfutex", timeout); FUTEX_LOCK; TAILQ_REMOVE(&f->f_waiting_proc, wp, wp_list); @@ -397,7 +405,7 @@ if ((ret == 0) && (wp->wp_new_futex != NULL)) { ret = futex_sleep(wp->wp_new_futex, td, timeout); - futex_put(wp->wp_new_futex); /* futex_get called in wakeup */ + futex_put(wp->wp_new_futex); /* futex_get called in wakeup */ } free(wp, M_LINUX); @@ -409,7 +417,7 @@ futex_wake(struct futex *f, int n, struct futex *newf) { struct waiting_proc *wp; - int count = 0; + int count = 0; FUTEX_LOCK; TAILQ_FOREACH(wp, &f->f_waiting_proc, wp_list) { ==== //depot/projects/smpng/sys/compat/linux/linux_futex.h#2 (text+ko) ==== @@ -14,14 +14,14 @@ * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by Emmanuel Dreyfus - * 4. The name of the author may not be used to endorse or promote - * products derived from this software without specific prior written + * 4. The name of the author may not be used to endorse or promote + * products derived from this software without specific prior written * permission. * - * THIS SOFTWARE IS PROVIDED BY THE THE AUTHOR AND CONTRIBUTORS ``AS IS'' - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THIS SOFTWARE IS PROVIDED BY THE 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 + * 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 @@ -30,32 +30,32 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - * $FreeBSD: src/sys/compat/linux/linux_futex.h,v 1.1 2006/08/15 12:20:59 netchild Exp $ + * $FreeBSD: src/sys/compat/linux/linux_futex.h,v 1.2 2007/02/25 12:40:35 netchild Exp $ */ #ifndef _LINUX_FUTEX_H #define _LINUX_FUTEX_H -#define LINUX_FUTEX_WAIT 0 +#define LINUX_FUTEX_WAIT 0 #define LINUX_FUTEX_WAKE 1 #define LINUX_FUTEX_FD 2 #define LINUX_FUTEX_REQUEUE 3 #define LINUX_FUTEX_CMP_REQUEUE 4 #define LINUX_FUTEX_WAKE_OP 5 -#define FUTEX_OP_SET 0 /* *(int *)UADDR2 = OPARG; */ -#define FUTEX_OP_ADD 1 /* *(int *)UADDR2 += OPARG; */ -#define FUTEX_OP_OR 2 /* *(int *)UADDR2 |= OPARG; */ -#define FUTEX_OP_ANDN 3 /* *(int *)UADDR2 &= ~OPARG; */ -#define FUTEX_OP_XOR 4 /* *(int *)UADDR2 ^= OPARG; */ +#define FUTEX_OP_SET 0 /* *(int *)UADDR2 = OPARG; */ +#define FUTEX_OP_ADD 1 /* *(int *)UADDR2 += OPARG; */ +#define FUTEX_OP_OR 2 /* *(int *)UADDR2 |= OPARG; */ +#define FUTEX_OP_ANDN 3 /* *(int *)UADDR2 &= ~OPARG; */ +#define FUTEX_OP_XOR 4 /* *(int *)UADDR2 ^= OPARG; */ -#define FUTEX_OP_OPARG_SHIFT 8 /* Use (1 << OPARG) instead of OPARG. */ +#define FUTEX_OP_OPARG_SHIFT 8 /* Use (1 << OPARG) instead of OPARG. */ -#define FUTEX_OP_CMP_EQ 0 /* if (oldval == CMPARG) wake */ -#define FUTEX_OP_CMP_NE 1 /* if (oldval != CMPARG) wake */ -#define FUTEX_OP_CMP_LT 2 /* if (oldval < CMPARG) wake */ -#define FUTEX_OP_CMP_LE 3 /* if (oldval <= CMPARG) wake */ -#define FUTEX_OP_CMP_GT 4 /* if (oldval > CMPARG) wake */ -#define FUTEX_OP_CMP_GE 5 /* if (oldval >= CMPARG) wake */ +#define FUTEX_OP_CMP_EQ 0 /* if (oldval == CMPARG) wake */ +#define FUTEX_OP_CMP_NE 1 /* if (oldval != CMPARG) wake */ +#define FUTEX_OP_CMP_LT 2 /* if (oldval < CMPARG) wake */ +#define FUTEX_OP_CMP_LE 3 /* if (oldval <= CMPARG) wake */ +#define FUTEX_OP_CMP_GT 4 /* if (oldval > CMPARG) wake */ +#define FUTEX_OP_CMP_GE 5 /* if (oldval >= CMPARG) wake */ -#endif /* !_LINUX_FUTEX_H */ +#endif /* !_LINUX_FUTEX_H */ ==== //depot/projects/smpng/sys/compat/linux/linux_misc.c#80 (text+ko) ==== @@ -28,7 +28,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/compat/linux/linux_misc.c,v 1.207 2007/02/23 22:39:26 netchild Exp $"); +__FBSDID("$FreeBSD: src/sys/compat/linux/linux_misc.c,v 1.208 2007/02/24 16:49:24 netchild Exp $"); #include "opt_compat.h" #include "opt_mac.h" @@ -833,7 +833,7 @@ args->pid, (void *)args->status, args->options); #endif /* - * this is necessary because the test in kern_wait doesnt work + * this is necessary because the test in kern_wait doesn't work * because we mess with the options here */ if (args->options & ~(WUNTRACED | WNOHANG | WCONTINUED | __WCLONE)) @@ -1418,10 +1418,9 @@ /* * The FreeBSD native getpid(2), getgid(2) and getuid(2) also modify - * td->td_retval[1] when COMPAT_43 is defined. This - * globbers registers that are assumed to be preserved. The following - * lightweight syscalls fixes this. See also linux_getgid16() and - * linux_getuid16() in linux_uid16.c. + * td->td_retval[1] when COMPAT_43 is defined. This clobbers registers that >>> TRUNCATED FOR MAIL (1000 lines) <<<
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200702272054.l1RKsbFZ078496>