Date: Tue, 27 Sep 2005 18:47:01 GMT From: John Baldwin <jhb@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 84378 for review Message-ID: <200509271847.j8RIl1cm024438@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=84378 Change 84378 by jhb@jhb_slimer on 2005/09/27 18:46:44 IFC @84370. Affected files ... .. //depot/projects/smpng/sys/alpha/alpha/sgmap.c#5 integrate .. //depot/projects/smpng/sys/alpha/conf/GENERIC#50 integrate .. //depot/projects/smpng/sys/alpha/include/atomic.h#32 integrate .. //depot/projects/smpng/sys/alpha/isa/isa.c#14 integrate .. //depot/projects/smpng/sys/alpha/mcbus/mcpcia.c#23 integrate .. //depot/projects/smpng/sys/alpha/pci/apecs.c#16 integrate .. //depot/projects/smpng/sys/alpha/pci/cia.c#20 integrate .. //depot/projects/smpng/sys/alpha/pci/pcibus.c#8 integrate .. //depot/projects/smpng/sys/alpha/pci/t2.c#22 integrate .. //depot/projects/smpng/sys/alpha/pci/tsunami.c#17 integrate .. //depot/projects/smpng/sys/alpha/pci/tsunami_pci.c#7 integrate .. //depot/projects/smpng/sys/alpha/tlsb/dwlpx.c#17 integrate .. //depot/projects/smpng/sys/amd64/amd64/elf_machdep.c#9 integrate .. //depot/projects/smpng/sys/amd64/amd64/machdep.c#43 integrate .. //depot/projects/smpng/sys/amd64/amd64/nexus.c#17 integrate .. //depot/projects/smpng/sys/amd64/amd64/trap.c#32 integrate .. //depot/projects/smpng/sys/amd64/ia32/ia32_signal.c#11 integrate .. //depot/projects/smpng/sys/amd64/include/atomic.h#28 integrate .. //depot/projects/smpng/sys/amd64/linux32/linux32_sysvec.c#8 integrate .. //depot/projects/smpng/sys/arm/arm/nexus.c#6 integrate .. //depot/projects/smpng/sys/arm/include/atomic.h#18 integrate .. //depot/projects/smpng/sys/arm/sa11x0/sa11x0.c#5 integrate .. //depot/projects/smpng/sys/arm/sa11x0/sa11x0_irqhandler.c#5 integrate .. //depot/projects/smpng/sys/arm/sa11x0/sa11x0_var.h#2 integrate .. //depot/projects/smpng/sys/arm/xscale/i80321/i80321_pci.c#5 integrate .. //depot/projects/smpng/sys/arm/xscale/i80321/i80321var.h#3 integrate .. //depot/projects/smpng/sys/arm/xscale/i80321/iq80321.c#7 integrate .. //depot/projects/smpng/sys/arm/xscale/i80321/obio.c#3 integrate .. //depot/projects/smpng/sys/arm/xscale/i80321/obiovar.h#3 integrate .. //depot/projects/smpng/sys/boot/common/help.common#19 integrate .. //depot/projects/smpng/sys/boot/common/loader.8#38 integrate .. //depot/projects/smpng/sys/boot/efi/libefi/bootinfo.c#10 integrate .. //depot/projects/smpng/sys/boot/forth/loader.conf#38 integrate .. //depot/projects/smpng/sys/boot/i386/boot2/boot2.c#27 integrate .. //depot/projects/smpng/sys/boot/i386/libi386/bootinfo.c#11 integrate .. //depot/projects/smpng/sys/boot/i386/libi386/libi386.h#9 integrate .. //depot/projects/smpng/sys/boot/i386/loader/main.c#11 integrate .. //depot/projects/smpng/sys/boot/ia64/ski/bootinfo.c#3 integrate .. //depot/projects/smpng/sys/boot/powerpc/loader/metadata.c#6 integrate .. //depot/projects/smpng/sys/boot/sparc64/loader/metadata.c#15 integrate .. //depot/projects/smpng/sys/compat/freebsd32/freebsd32_proto.h#20 integrate .. //depot/projects/smpng/sys/compat/freebsd32/freebsd32_syscall.h#20 integrate .. //depot/projects/smpng/sys/compat/freebsd32/freebsd32_syscalls.c#20 integrate .. //depot/projects/smpng/sys/compat/freebsd32/freebsd32_sysent.c#20 integrate .. //depot/projects/smpng/sys/compat/freebsd32/syscalls.master#20 integrate .. //depot/projects/smpng/sys/conf/NOTES#104 integrate .. //depot/projects/smpng/sys/conf/files#150 integrate .. //depot/projects/smpng/sys/conf/files.pc98#76 integrate .. //depot/projects/smpng/sys/conf/options#106 integrate .. //depot/projects/smpng/sys/dev/adlink/adlink.c#12 integrate .. //depot/projects/smpng/sys/dev/aic7xxx/ahd_pci.c#18 integrate .. //depot/projects/smpng/sys/dev/aic7xxx/aic79xx.c#25 integrate .. //depot/projects/smpng/sys/dev/aic7xxx/aic79xx_osm.c#19 integrate .. //depot/projects/smpng/sys/dev/aic7xxx/aic7xxx_osm.c#17 integrate .. //depot/projects/smpng/sys/dev/aic7xxx/aic7xxx_pci.c#18 integrate .. //depot/projects/smpng/sys/dev/an/if_an.c#47 integrate .. //depot/projects/smpng/sys/dev/an/if_an_pccard.c#17 integrate .. //depot/projects/smpng/sys/dev/ata/ata-card.c#28 integrate .. //depot/projects/smpng/sys/dev/cardbus/cardbus.c#26 integrate .. //depot/projects/smpng/sys/dev/cp/if_cp.c#16 integrate .. //depot/projects/smpng/sys/dev/ctau/if_ct.c#17 integrate .. //depot/projects/smpng/sys/dev/cx/if_cx.c#21 integrate .. //depot/projects/smpng/sys/dev/ed/if_ed.c#35 integrate .. //depot/projects/smpng/sys/dev/ed/if_ed_pccard.c#34 integrate .. //depot/projects/smpng/sys/dev/em/if_em.h#27 integrate .. //depot/projects/smpng/sys/dev/exca/exca.c#15 integrate .. //depot/projects/smpng/sys/dev/fe/if_fe.c#22 integrate .. //depot/projects/smpng/sys/dev/fe/if_fe_pccard.c#16 integrate .. //depot/projects/smpng/sys/dev/fxp/if_fxp.c#66 integrate .. //depot/projects/smpng/sys/dev/fxp/if_fxpvar.h#18 integrate .. //depot/projects/smpng/sys/dev/ieee488/pcii.c#3 integrate .. //depot/projects/smpng/sys/dev/ieee488/tnt4882.c#2 integrate .. //depot/projects/smpng/sys/dev/ieee488/upd7210.c#6 integrate .. //depot/projects/smpng/sys/dev/ieee488/upd7210.h#5 integrate .. //depot/projects/smpng/sys/dev/if_ndis/if_ndis.c#32 integrate .. //depot/projects/smpng/sys/dev/ips/ips.c#13 integrate .. //depot/projects/smpng/sys/dev/ips/ips.h#12 integrate .. //depot/projects/smpng/sys/dev/ips/ips_commands.c#11 integrate .. //depot/projects/smpng/sys/dev/ips/ips_disk.c#8 integrate .. //depot/projects/smpng/sys/dev/ips/ips_ioctl.c#7 integrate .. //depot/projects/smpng/sys/dev/ixgb/if_ixgb.h#7 integrate .. //depot/projects/smpng/sys/dev/pccard/card_if.m#16 integrate .. //depot/projects/smpng/sys/dev/pccard/pccard.c#40 integrate .. //depot/projects/smpng/sys/dev/pccard/pccarddevs#51 integrate .. //depot/projects/smpng/sys/dev/pccard/pccardvar.h#26 integrate .. //depot/projects/smpng/sys/dev/pccbb/pccbb.c#51 integrate .. //depot/projects/smpng/sys/dev/puc/puc.c#23 integrate .. //depot/projects/smpng/sys/dev/ral/if_ral_pccard.c#4 integrate .. //depot/projects/smpng/sys/dev/ray/if_ray.c#23 integrate .. //depot/projects/smpng/sys/dev/sio/sio.c#55 integrate .. //depot/projects/smpng/sys/dev/sn/if_snreg.h#4 integrate .. //depot/projects/smpng/sys/dev/snc/if_snc_pccard.c#9 integrate .. //depot/projects/smpng/sys/dev/stg/tmc18c30_pccard.c#16 integrate .. //depot/projects/smpng/sys/dev/uart/uart_bus_pccard.c#5 integrate .. //depot/projects/smpng/sys/dev/usb/ehcivar.h#9 integrate .. //depot/projects/smpng/sys/dev/usb/if_cdce.c#6 integrate .. //depot/projects/smpng/sys/dev/usb/if_cdcereg.h#4 integrate .. //depot/projects/smpng/sys/dev/usb/slhci_pccard.c#2 integrate .. //depot/projects/smpng/sys/dev/usb/uvscom.c#17 integrate .. //depot/projects/smpng/sys/dev/wi/if_wi_pccard.c#36 integrate .. //depot/projects/smpng/sys/dev/wi/if_wivar.h#22 integrate .. //depot/projects/smpng/sys/fs/devfs/devfs.h#17 integrate .. //depot/projects/smpng/sys/fs/devfs/devfs_rule.c#14 integrate .. //depot/projects/smpng/sys/fs/devfs/devfs_vfsops.c#26 integrate .. //depot/projects/smpng/sys/fs/fifofs/fifo_vnops.c#37 integrate .. //depot/projects/smpng/sys/i386/include/atomic.h#45 integrate .. //depot/projects/smpng/sys/i386/isa/isa.c#11 integrate .. //depot/projects/smpng/sys/ia64/ia32/ia32_signal.c#3 integrate .. //depot/projects/smpng/sys/ia64/include/atomic.h#12 integrate .. //depot/projects/smpng/sys/kern/init_sysent.c#59 integrate .. //depot/projects/smpng/sys/kern/kern_environment.c#19 integrate .. //depot/projects/smpng/sys/kern/kern_proc.c#76 integrate .. //depot/projects/smpng/sys/kern/kern_prot.c#90 integrate .. //depot/projects/smpng/sys/kern/kern_resource.c#55 integrate .. //depot/projects/smpng/sys/kern/kern_shutdown.c#61 integrate .. //depot/projects/smpng/sys/kern/sched_ule.c#62 integrate .. //depot/projects/smpng/sys/kern/subr_bus.c#55 integrate .. //depot/projects/smpng/sys/kern/subr_pcpu.c#7 integrate .. //depot/projects/smpng/sys/kern/subr_prf.c#42 integrate .. //depot/projects/smpng/sys/kern/subr_rman.c#22 integrate .. //depot/projects/smpng/sys/kern/subr_witness.c#139 integrate .. //depot/projects/smpng/sys/kern/syscalls.c#59 integrate .. //depot/projects/smpng/sys/kern/syscalls.master#61 integrate .. //depot/projects/smpng/sys/kern/uipc_usrreq.c#49 integrate .. //depot/projects/smpng/sys/kern/vfs_export.c#20 integrate .. //depot/projects/smpng/sys/kern/vfs_syscalls.c#93 integrate .. //depot/projects/smpng/sys/modules/Makefile#106 integrate .. //depot/projects/smpng/sys/modules/agp/Makefile#10 integrate .. //depot/projects/smpng/sys/modules/ath/Makefile#2 integrate .. //depot/projects/smpng/sys/modules/ath_rate_amrr/Makefile#2 integrate .. //depot/projects/smpng/sys/modules/ath_rate_onoe/Makefile#2 integrate .. //depot/projects/smpng/sys/modules/ath_rate_sample/Makefile#2 integrate .. //depot/projects/smpng/sys/modules/aue/Makefile#3 integrate .. //depot/projects/smpng/sys/modules/axe/Makefile#3 integrate .. //depot/projects/smpng/sys/modules/bfe/Makefile#2 integrate .. //depot/projects/smpng/sys/modules/bge/Makefile#4 integrate .. //depot/projects/smpng/sys/modules/bridge/Makefile#5 delete .. //depot/projects/smpng/sys/modules/cdce/Makefile#2 integrate .. //depot/projects/smpng/sys/modules/cue/Makefile#3 integrate .. //depot/projects/smpng/sys/modules/dc/Makefile#2 integrate .. //depot/projects/smpng/sys/modules/de/Makefile#5 integrate .. //depot/projects/smpng/sys/modules/dummynet/Makefile#4 integrate .. //depot/projects/smpng/sys/modules/em/Makefile#5 integrate .. //depot/projects/smpng/sys/modules/fxp/Makefile#4 integrate .. //depot/projects/smpng/sys/modules/hifn/Makefile#4 integrate .. //depot/projects/smpng/sys/modules/if_ndis/Makefile#5 integrate .. //depot/projects/smpng/sys/modules/ipw/Makefile#2 integrate .. //depot/projects/smpng/sys/modules/iwi/Makefile#2 integrate .. //depot/projects/smpng/sys/modules/ixgb/Makefile#2 integrate .. //depot/projects/smpng/sys/modules/kue/Makefile#3 integrate .. //depot/projects/smpng/sys/modules/lge/Makefile#2 integrate .. //depot/projects/smpng/sys/modules/ncv/Makefile#3 integrate .. //depot/projects/smpng/sys/modules/ndis/Makefile#6 integrate .. //depot/projects/smpng/sys/modules/nge/Makefile#3 integrate .. //depot/projects/smpng/sys/modules/nsp/Makefile#3 integrate .. //depot/projects/smpng/sys/modules/pcn/Makefile#2 integrate .. //depot/projects/smpng/sys/modules/ral/Makefile#2 integrate .. //depot/projects/smpng/sys/modules/re/Makefile#2 integrate .. //depot/projects/smpng/sys/modules/rl/Makefile#2 integrate .. //depot/projects/smpng/sys/modules/rue/Makefile#3 integrate .. //depot/projects/smpng/sys/modules/safe/Makefile#2 integrate .. //depot/projects/smpng/sys/modules/sf/Makefile#2 integrate .. //depot/projects/smpng/sys/modules/sis/Makefile#2 integrate .. //depot/projects/smpng/sys/modules/sk/Makefile#2 integrate .. //depot/projects/smpng/sys/modules/snc/Makefile#2 integrate .. //depot/projects/smpng/sys/modules/ste/Makefile#2 integrate .. //depot/projects/smpng/sys/modules/stg/Makefile#4 integrate .. //depot/projects/smpng/sys/modules/ti/Makefile#5 integrate .. //depot/projects/smpng/sys/modules/tl/Makefile#2 integrate .. //depot/projects/smpng/sys/modules/tx/Makefile#6 integrate .. //depot/projects/smpng/sys/modules/txp/Makefile#3 integrate .. //depot/projects/smpng/sys/modules/ubsec/Makefile#4 integrate .. //depot/projects/smpng/sys/modules/udav/Makefile#3 integrate .. //depot/projects/smpng/sys/modules/ural/Makefile#2 integrate .. //depot/projects/smpng/sys/modules/vge/Makefile#2 integrate .. //depot/projects/smpng/sys/modules/vr/Makefile#2 integrate .. //depot/projects/smpng/sys/modules/vx/Makefile#3 integrate .. //depot/projects/smpng/sys/modules/wb/Makefile#2 integrate .. //depot/projects/smpng/sys/modules/xl/Makefile#2 integrate .. //depot/projects/smpng/sys/net/bridge.c#40 delete .. //depot/projects/smpng/sys/net/bridge.h#10 delete .. //depot/projects/smpng/sys/net/if_bridge.c#10 integrate .. //depot/projects/smpng/sys/net/if_ethersubr.c#64 integrate .. //depot/projects/smpng/sys/netgraph/bluetooth/drivers/bt3c/ng_bt3c_pccard.c#11 integrate .. //depot/projects/smpng/sys/netgraph/ng_ether.c#26 integrate .. //depot/projects/smpng/sys/netinet/if_ether.c#40 integrate .. //depot/projects/smpng/sys/netinet/in.h#33 integrate .. //depot/projects/smpng/sys/netinet/in_pcb.h#38 integrate .. //depot/projects/smpng/sys/netinet/ip_dummynet.c#41 integrate .. //depot/projects/smpng/sys/netinet/ip_dummynet.h#19 integrate .. //depot/projects/smpng/sys/netinet/ip_fw2.c#60 integrate .. //depot/projects/smpng/sys/netinet/ip_output.c#77 integrate .. //depot/projects/smpng/sys/netinet/raw_ip.c#52 integrate .. //depot/projects/smpng/sys/netinet/udp_usrreq.c#59 integrate .. //depot/projects/smpng/sys/netipsec/ipsec_mbuf.c#9 integrate .. //depot/projects/smpng/sys/nfsserver/nfs_srvsock.c#23 integrate .. //depot/projects/smpng/sys/nfsserver/nfs_srvsubs.c#27 integrate .. //depot/projects/smpng/sys/pc98/conf/GENERIC#57 integrate .. //depot/projects/smpng/sys/pc98/conf/GENERIC.hints#13 integrate .. //depot/projects/smpng/sys/pc98/conf/NOTES#42 integrate .. //depot/projects/smpng/sys/pccard/mecia.c#6 delete .. //depot/projects/smpng/sys/pccard/pccard.c#25 delete .. //depot/projects/smpng/sys/pccard/pccard_beep.c#4 delete .. //depot/projects/smpng/sys/pccard/pccard_nbk.c#15 delete .. //depot/projects/smpng/sys/pccard/pcic.c#27 delete .. //depot/projects/smpng/sys/pccard/pcic_isa.c#12 delete .. //depot/projects/smpng/sys/pccard/pcic_pci.c#33 delete .. //depot/projects/smpng/sys/pci/if_sis.c#54 integrate .. //depot/projects/smpng/sys/pci/if_sisreg.h#17 integrate .. //depot/projects/smpng/sys/pci/if_wb.c#33 integrate .. //depot/projects/smpng/sys/powerpc/include/atomic.h#17 integrate .. //depot/projects/smpng/sys/sparc64/include/atomic.h#15 integrate .. //depot/projects/smpng/sys/sys/bus.h#25 integrate .. //depot/projects/smpng/sys/sys/proc.h#150 integrate .. //depot/projects/smpng/sys/sys/refcount.h#1 branch .. //depot/projects/smpng/sys/sys/resourcevar.h#25 integrate .. //depot/projects/smpng/sys/sys/rman.h#13 integrate .. //depot/projects/smpng/sys/sys/syscall.h#58 integrate .. //depot/projects/smpng/sys/sys/syscall.mk#58 integrate .. //depot/projects/smpng/sys/sys/sysproto.h#60 integrate .. //depot/projects/smpng/sys/sys/types.h#30 integrate .. //depot/projects/smpng/sys/sys/ucred.h#27 integrate .. //depot/projects/smpng/sys/tools/bus_macro.sh#1 branch .. //depot/projects/smpng/sys/ufs/ufs/ufs_inode.c#22 integrate .. //depot/projects/smpng/sys/ufs/ufs/ufs_vnops.c#53 integrate Differences ... ==== //depot/projects/smpng/sys/alpha/alpha/sgmap.c#5 (text+ko) ==== @@ -25,9 +25,8 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/alpha/alpha/sgmap.c,v 1.7 2004/07/01 15:07:26 gallatin Exp $"); +__FBSDID("$FreeBSD: src/sys/alpha/alpha/sgmap.c,v 1.8 2005/09/25 20:12:29 phk Exp $"); -#define __RMAN_RESOURCE_VISIBLE #include <sys/param.h> #include <sys/systm.h> #include <sys/kernel.h> ==== //depot/projects/smpng/sys/alpha/conf/GENERIC#50 (text+ko) ==== @@ -18,7 +18,7 @@ # # For hardware specific information check HARDWARE.TXT # -# $FreeBSD: src/sys/alpha/conf/GENERIC,v 1.187 2005/07/14 15:39:04 kensmith Exp $ +# $FreeBSD: src/sys/alpha/conf/GENERIC,v 1.188 2005/09/24 16:47:34 wilko Exp $ machine alpha cpu EV4 @@ -86,6 +86,9 @@ # To make an SMP kernel, the next line is needed options SMP # Symmetric MultiProcessor Kernel +# Alpha's do not appear to react well to probing high EISA slots +options EISA_SLOTS=2 + # Standard busses device isa device eisa ==== //depot/projects/smpng/sys/alpha/include/atomic.h#32 (text+ko) ==== @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/alpha/include/atomic.h,v 1.23 2005/09/15 19:31:22 jhb Exp $ + * $FreeBSD: src/sys/alpha/include/atomic.h,v 1.24 2005/09/27 17:39:09 jhb Exp $ */ #ifndef _MACHINE_ATOMIC_H_ @@ -365,6 +365,27 @@ return (atomic_cmpset_64(p, cmpval, newval)); } +/* + * Atomically add the value of v to the integer pointed to by p and return + * the previous value of *p. + */ +static __inline u_int +atomic_fetchadd_32(volatile u_int32_t *p, u_int32_t v) +{ + u_int32_t value, temp; + +#ifdef __GNUCLIKE_ASM + __asm __volatile ( + "1:\tldl_l %0, %1\n\t" /* load old value */ + "addl %0, %3, %2\n\t" /* calculate new value */ + "stl_c %2, %1\n\t" /* attempt to store */ + "beq %2, 1b\n" /* spin if failed */ + : "=&r" (value), "=m" (*p), "=r" (temp) + : "r" (v), "m" (*p)); +#endif + return (value); +} + /* Operations on chars. */ #define atomic_set_char atomic_set_8 #define atomic_set_acq_char atomic_set_acq_8 @@ -412,6 +433,7 @@ #define atomic_load_acq_int atomic_load_acq_32 #define atomic_store_rel_int atomic_store_rel_32 #define atomic_readandclear_int atomic_readandclear_32 +#define atomic_fetchadd_int atomic_fetchadd_32 /* Operations on longs. */ #define atomic_set_long atomic_set_64 ==== //depot/projects/smpng/sys/alpha/isa/isa.c#14 (text+ko) ==== @@ -25,9 +25,8 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/alpha/isa/isa.c,v 1.36 2004/07/01 15:07:26 gallatin Exp $"); +__FBSDID("$FreeBSD: src/sys/alpha/isa/isa.c,v 1.37 2005/09/25 19:34:54 phk Exp $"); -#define __RMAN_RESOURCE_VISIBLE #include <sys/param.h> #include <sys/systm.h> #include <sys/kernel.h> @@ -359,28 +358,28 @@ return ENOMEM; ii->intr = intr; ii->arg = arg; - ii->irq = irq->r_start; + ii->irq = rman_get_start(irq); error = alpha_setup_intr( device_get_nameunit(child ? child : dev), - 0x800 + (irq->r_start << 4), + 0x800 + (ii->irq << 4), ((flags & INTR_FAST) ? isa_handle_fast_intr : isa_handle_intr), ii, flags, &ii->ih, - &intrcnt[INTRCNT_ISA_IRQ + irq->r_start], + &intrcnt[INTRCNT_ISA_IRQ + ii->irq], isa_disable_intr, isa_enable_intr); if (error) { free(ii, M_DEVBUF); return error; } mtx_lock_spin(&icu_lock); - isa_intr_enable(irq->r_start); + isa_intr_enable(ii->irq); mtx_unlock_spin(&icu_lock); *cookiep = ii; if (child) device_printf(child, "interrupting at ISA irq %d\n", - (int)irq->r_start); + (int)ii->irq); return 0; } @@ -406,11 +405,10 @@ if (num_handlers == 1) { mtx_lock_spin(&icu_lock); - isa_intr_disable(irq->r_start); + isa_intr_disable(ii->irq); mtx_unlock_spin(&icu_lock); if (platform.isa_teardown_intr) { - platform.isa_teardown_intr(dev, child, irq, - cookie); + platform.isa_teardown_intr(dev, child, irq, cookie); return 0; } ==== //depot/projects/smpng/sys/alpha/mcbus/mcpcia.c#23 (text+ko) ==== @@ -25,9 +25,8 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/alpha/mcbus/mcpcia.c,v 1.31 2005/09/19 13:50:07 ticso Exp $"); +__FBSDID("$FreeBSD: src/sys/alpha/mcbus/mcpcia.c,v 1.32 2005/09/25 20:12:29 phk Exp $"); -#define __RMAN_RESOURCE_VISIBLE #include <sys/param.h> #include <sys/systm.h> #include <sys/kernel.h> @@ -430,7 +429,7 @@ struct mcpcia_softc *sc = MCPCIA_SOFTC(dev); int mid, birq, irq, error, h; - irq = ir->r_start; + irq = rman_get_start(ir); mid = mcbus_get_mid(dev); error = rman_activate_resource(ir); @@ -469,7 +468,7 @@ struct mcpcia_softc *sc = MCPCIA_SOFTC(dev); mtx_lock_spin(&icu_lock); - mcpcia_disable_intr(sc, i->r_start); + mcpcia_disable_intr(sc, rman_get_start(i)); mtx_unlock_spin(&icu_lock); alpha_teardown_intr(c); return (rman_deactivate_resource(i)); ==== //depot/projects/smpng/sys/alpha/pci/apecs.c#16 (text+ko) ==== @@ -55,9 +55,8 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/alpha/pci/apecs.c,v 1.28 2005/09/19 13:50:07 ticso Exp $"); +__FBSDID("$FreeBSD: src/sys/alpha/pci/apecs.c,v 1.29 2005/09/25 19:48:51 phk Exp $"); -#define __RMAN_RESOURCE_VISIBLE #include <sys/param.h> #include <sys/systm.h> #include <sys/kernel.h> @@ -338,8 +337,9 @@ struct resource *irq, int flags, driver_intr_t *intr, void *arg, void **cookiep) { - int error; + int error, start; + start = rman_get_start(irq); /* * the avanti routes interrupts through the isa interrupt * controller, so we need to special case it @@ -353,19 +353,19 @@ return error; error = alpha_setup_intr(device_get_nameunit(child ? child : dev), - 0x900 + (irq->r_start << 4), intr, arg, flags, cookiep, - &intrcnt[INTRCNT_EB64PLUS_IRQ + irq->r_start], + 0x900 + (start << 4), intr, arg, flags, cookiep, + &intrcnt[INTRCNT_EB64PLUS_IRQ + start], apecs_disable_intr, apecs_enable_intr); if (error) return error; /* Enable PCI interrupt */ mtx_lock_spin(&icu_lock); - platform.pci_intr_enable(irq->r_start); + platform.pci_intr_enable(start); mtx_unlock_spin(&icu_lock); - device_printf(child, "interrupting at APECS irq %d\n", - (int) irq->r_start); + device_printf(child, "interrupting at APECS irq %d\n", start); + return 0; ==== //depot/projects/smpng/sys/alpha/pci/cia.c#20 (text+ko) ==== @@ -87,11 +87,10 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/alpha/pci/cia.c,v 1.45 2005/09/19 13:50:07 ticso Exp $"); +__FBSDID("$FreeBSD: src/sys/alpha/pci/cia.c,v 1.46 2005/09/25 20:12:29 phk Exp $"); #include "opt_cpu.h" -#define __RMAN_RESOURCE_VISIBLE #include <sys/param.h> #include <sys/systm.h> #include <sys/kernel.h> @@ -545,27 +544,27 @@ struct resource *irq, int flags, driver_intr_t *intr, void *arg, void **cookiep) { - int error; + int error, start; error = rman_activate_resource(irq); if (error) return error; + start = rman_get_start(irq); error = alpha_setup_intr( device_get_nameunit(child ? child : dev), - 0x900 + (irq->r_start << 4), intr, arg, flags, cookiep, - &intrcnt[INTRCNT_EB164_IRQ + irq->r_start], + 0x900 + (start << 4), intr, arg, flags, cookiep, + &intrcnt[INTRCNT_EB164_IRQ + start], cia_disable_intr, cia_enable_intr); if (error) return error; /* Enable PCI interrupt */ mtx_lock_spin(&icu_lock); - platform.pci_intr_enable(irq->r_start); + platform.pci_intr_enable(start); mtx_unlock_spin(&icu_lock); - device_printf(child, "interrupting at CIA irq %d\n", - (int) irq->r_start); + device_printf(child, "interrupting at CIA irq %d\n", start); return 0; } ==== //depot/projects/smpng/sys/alpha/pci/pcibus.c#8 (text+ko) ==== @@ -25,11 +25,10 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/alpha/pci/pcibus.c,v 1.36 2005/01/05 20:05:52 imp Exp $"); +__FBSDID("$FreeBSD: src/sys/alpha/pci/pcibus.c,v 1.37 2005/09/25 20:12:29 phk Exp $"); #include "opt_isa.h" -#define __RMAN_RESOURCE_VISIBLE #include <sys/param.h> #include <sys/systm.h> #include <sys/kernel.h> @@ -160,7 +159,7 @@ * XXX - If we aren't the resource manager for this IRQ, assume that * it is actually handled by the ISA PIC. */ - if(irq->r_rm != &irq_rman) + if (!rman_is_region_manager(irq, &irq_rman)) return isa_setup_intr(dev, child, irq, flags, intr, arg, cookiep); else @@ -178,7 +177,7 @@ * XXX - If we aren't the resource manager for this IRQ, assume that * it is actually handled by the ISA PIC. */ - if(irq->r_rm != &irq_rman) + if (!rman_is_region_manager(irq, &irq_rman)) return isa_teardown_intr(dev, child, irq, cookie); else #endif @@ -224,6 +223,7 @@ struct rman *rm; struct resource *rv; void *va; + int rstart; switch (type) { case SYS_RES_IRQ: @@ -252,17 +252,18 @@ if (rv == 0) return 0; + rstart = rman_get_start(rv); rman_set_bustag(rv, ALPHAPCI_GET_BUSTAG(bus, type)); - rman_set_bushandle(rv, rv->r_start); + rman_set_bushandle(rv, rstart); switch (type) { case SYS_RES_MEMORY: va = 0; if (flags & PCI_RF_DENSE) - va = ALPHAPCI_CVT_DENSE(bus, rv->r_start); + va = ALPHAPCI_CVT_DENSE(bus, rstart); else if (flags & PCI_RF_BWX) - va = ALPHAPCI_CVT_BWX(bus, rv->r_start); + va = ALPHAPCI_CVT_BWX(bus, rstart); else - va = (void *)ALPHA_PHYS_TO_K0SEG(rv->r_start); + va = (void *)ALPHA_PHYS_TO_K0SEG(rstart); rman_set_virtual(rv, va); break; ==== //depot/projects/smpng/sys/alpha/pci/t2.c#22 (text+ko) ==== @@ -51,9 +51,8 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/alpha/pci/t2.c,v 1.23 2005/09/19 13:50:07 ticso Exp $"); +__FBSDID("$FreeBSD: src/sys/alpha/pci/t2.c,v 1.24 2005/09/25 20:12:29 phk Exp $"); -#define __RMAN_RESOURCE_VISIBLE #include <sys/param.h> #include <sys/systm.h> #include <sys/kernel.h> @@ -536,12 +535,12 @@ struct resource *irq, int flags, void *intr, void *arg, void **cookiep) { - int error, vector, stdio_irq; + int error, vector, stdio_irq, start; const char *name; device_t bus, parent; name = device_get_nameunit(dev); - stdio_irq = irq->r_start; + start = stdio_irq = rman_get_start(irq); if (strncmp(name, "eisa", 4) == 0) { if ((stdio_irq != 6 ) && (stdio_irq != 3 )) { stdio_irq = @@ -568,7 +567,7 @@ error = alpha_setup_intr(device_get_nameunit(child ? child : dev), vector, intr, arg, flags, cookiep, - &intrcnt[irq->r_start], t2_disable_vec, t2_enable_vec); + &intrcnt[start], t2_disable_vec, t2_enable_vec); if (error) return error; @@ -579,7 +578,7 @@ if (bootverbose != 0) device_printf(child, "interrupting at T2 irq %d (stdio irq %d)\n", - (int) irq->r_start, stdio_irq); + start, stdio_irq); return 0; } @@ -589,7 +588,7 @@ { int mask; - mask = irq_to_mask[irq->r_start]; + mask = irq_to_mask[rman_get_start(irq)]; /* Disable interrupt */ ==== //depot/projects/smpng/sys/alpha/pci/tsunami.c#17 (text+ko) ==== @@ -25,11 +25,10 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/alpha/pci/tsunami.c,v 1.25 2005/09/19 13:50:07 ticso Exp $"); +__FBSDID("$FreeBSD: src/sys/alpha/pci/tsunami.c,v 1.26 2005/09/25 20:12:29 phk Exp $"); #include "opt_cpu.h" -#define __RMAN_RESOURCE_VISIBLE #include <sys/param.h> #include <sys/systm.h> #include <sys/kernel.h> @@ -337,26 +336,27 @@ struct resource *irq, int flags, driver_intr_t *intr, void *arg, void **cookiep) { - int error; + int error, start; error = rman_activate_resource(irq); if (error) return error; + start = rman_get_start(irq); + error = alpha_setup_intr(device_get_nameunit(child ? child : dev), - 0x900 + (irq->r_start << 4), intr, arg, flags, cookiep, - &intrcnt[INTRCNT_EB164_IRQ + irq->r_start], + 0x900 + (start << 4), intr, arg, flags, cookiep, + &intrcnt[INTRCNT_EB164_IRQ + start], tsunami_disable_intr_vec, tsunami_enable_intr_vec); if (error) return error; /* Enable PCI interrupt */ mtx_lock_spin(&icu_lock); - platform.pci_intr_enable(irq->r_start); + platform.pci_intr_enable(start); mtx_unlock_spin(&icu_lock); - device_printf(child, "interrupting at TSUNAMI irq %d\n", - (int) irq->r_start); + device_printf(child, "interrupting at TSUNAMI irq %d\n", start); return 0; } ==== //depot/projects/smpng/sys/alpha/pci/tsunami_pci.c#7 (text+ko) ==== @@ -25,9 +25,8 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/alpha/pci/tsunami_pci.c,v 1.17 2004/07/01 15:07:27 gallatin Exp $"); +__FBSDID("$FreeBSD: src/sys/alpha/pci/tsunami_pci.c,v 1.18 2005/09/25 20:12:29 phk Exp $"); -#define __RMAN_RESOURCE_VISIBLE #include <sys/param.h> #include <sys/systm.h> #include <sys/kernel.h> ==== //depot/projects/smpng/sys/alpha/tlsb/dwlpx.c#17 (text+ko) ==== @@ -56,9 +56,8 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/alpha/tlsb/dwlpx.c,v 1.29 2005/09/19 13:50:07 ticso Exp $"); +__FBSDID("$FreeBSD: src/sys/alpha/tlsb/dwlpx.c,v 1.30 2005/09/25 20:12:30 phk Exp $"); -#define __RMAN_RESOURCE_VISIBLE #include <sys/param.h> #include <sys/systm.h> #include <sys/kernel.h> ==== //depot/projects/smpng/sys/amd64/amd64/elf_machdep.c#9 (text+ko) ==== @@ -24,7 +24,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/amd64/amd64/elf_machdep.c,v 1.22 2004/08/11 02:35:04 marcel Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/amd64/elf_machdep.c,v 1.23 2005/09/27 18:18:23 peter Exp $"); #include <sys/param.h> #include <sys/kernel.h> @@ -195,6 +195,7 @@ break; case R_X86_64_GLOB_DAT: /* S */ + case R_X86_64_JMP_SLOT: /* XXX need addend + offset */ addr = lookup(lf, symidx, 1); if (addr == 0) return -1; ==== //depot/projects/smpng/sys/amd64/amd64/machdep.c#43 (text+ko) ==== @@ -39,7 +39,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/amd64/amd64/machdep.c,v 1.638 2005/06/29 22:28:45 peter Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/amd64/machdep.c,v 1.640 2005/09/27 18:15:57 peter Exp $"); #include "opt_atalk.h" #include "opt_atpic.h" @@ -189,8 +189,8 @@ #ifdef PERFMON perfmon_init(); #endif - printf("real memory = %ju (%ju MB)\n", ptoa((uintmax_t)Maxmem), - ptoa((uintmax_t)Maxmem) / 1048576); + printf("usable memory = %ju (%ju MB)\n", ptoa((uintmax_t)physmem), + ptoa((uintmax_t)physmem) / 1048576); realmem = Maxmem; /* * Display any holes after the first chunk of extended memory. @@ -1726,11 +1726,15 @@ * check for undefined settings. Setting these bit patterns * result in undefined behaviour and can lead to an unexpected * TRCTRAP or a general protection fault right here. + * Upper bits of dr6 and dr7 must not be set */ for (i = 0, mask1 = 0x3<<16, mask2 = 0x2<<16; i < 8; i++, mask1 <<= 2, mask2 <<= 2) if ((dbregs->dr[7] & mask1) == mask2) return (EINVAL); + if ((dbregs->dr[6] & 0xffffffff00000000ul) != 0 || + (dbregs->dr[7] & 0xffffffff00000000ul) != 0) + return (EINVAL); pcb = td->td_pcb; ==== //depot/projects/smpng/sys/amd64/amd64/nexus.c#17 (text+ko) ==== @@ -28,7 +28,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/amd64/amd64/nexus.c,v 1.66 2005/03/18 11:57:43 phk Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/amd64/nexus.c,v 1.67 2005/09/25 20:03:41 phk Exp $"); /* * This code implements a `root nexus' for Intel Architecture @@ -41,7 +41,6 @@ * and I/O memory address space. */ -#define __RMAN_RESOURCE_VISIBLE #include "opt_isa.h" #include <sys/param.h> ==== //depot/projects/smpng/sys/amd64/amd64/trap.c#32 (text+ko) ==== @@ -38,7 +38,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/amd64/amd64/trap.c,v 1.291 2005/09/19 16:51:40 rwatson Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/amd64/trap.c,v 1.292 2005/09/27 18:13:07 peter Exp $"); /* * AMD64 Trap and System call handling @@ -220,9 +220,9 @@ type); /* * We shouldn't enable interrupts while in a critical - * section. + * section or servicing an NMI. */ - if (td->td_critnest == 0) + if (type != T_NMI && td->td_critnest == 0) enable_intr(); } } ==== //depot/projects/smpng/sys/amd64/ia32/ia32_signal.c#11 (text+ko) ==== @@ -32,7 +32,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/amd64/ia32/ia32_signal.c,v 1.10 2004/04/05 23:55:14 imp Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/ia32/ia32_signal.c,v 1.11 2005/09/27 18:04:20 peter Exp $"); #include "opt_compat.h" @@ -92,38 +92,14 @@ static void ia32_get_fpcontext(struct thread *td, struct ia32_mcontext *mcp) { - struct savefpu *addr; - /* - * XXX mc_fpstate might be misaligned, since its declaration is not - * unportabilized using __attribute__((aligned(16))) like the - * declaration of struct savemm, and anyway, alignment doesn't work - * for auto variables since we don't use gcc's pessimal stack - * alignment. Work around this by abusing the spare fields after - * mcp->mc_fpstate. - * - * XXX unpessimize most cases by only aligning when fxsave might be - * called, although this requires knowing too much about - * fpugetregs()'s internals. - */ - addr = (struct savefpu *)&mcp->mc_fpstate; - if (td == PCPU_GET(fpcurthread) && ((uintptr_t)(void *)addr & 0xF)) { - do - addr = (void *)((char *)addr + 4); - while ((uintptr_t)(void *)addr & 0xF); - } - mcp->mc_ownedfp = fpugetregs(td, addr); - if (addr != (struct savefpu *)&mcp->mc_fpstate) { - bcopy(addr, &mcp->mc_fpstate, sizeof(mcp->mc_fpstate)); - bzero(&mcp->mc_spare2, sizeof(mcp->mc_spare2)); - } + mcp->mc_ownedfp = fpugetregs(td, (struct savefpu *)&mcp->mc_fpstate); mcp->mc_fpformat = fpuformat(); } static int ia32_set_fpcontext(struct thread *td, const struct ia32_mcontext *mcp) { - struct savefpu *addr; if (mcp->mc_fpformat == _MC_FPFMT_NODEV) return (0); @@ -134,31 +110,180 @@ fpstate_drop(td); else if (mcp->mc_ownedfp == _MC_FPOWNED_FPU || mcp->mc_ownedfp == _MC_FPOWNED_PCB) { - /* XXX align as above. */ - addr = (struct savefpu *)&mcp->mc_fpstate; - if (td == PCPU_GET(fpcurthread) && - ((uintptr_t)(void *)addr & 0xF)) { - do - addr = (void *)((char *)addr + 4); - while ((uintptr_t)(void *)addr & 0xF); - bcopy(&mcp->mc_fpstate, addr, sizeof(mcp->mc_fpstate)); - } /* * XXX we violate the dubious requirement that fpusetregs() * be called with interrupts disabled. */ - fpusetregs(td, addr); - /* - * Don't bother putting things back where they were in the - * misaligned case, since we know that the caller won't use - * them again. - */ + fpusetregs(td, (struct savefpu *)&mcp->mc_fpstate); } else return (EINVAL); return (0); } /* + * Get machine context. + */ +static int +ia32_get_mcontext(struct thread *td, struct ia32_mcontext *mcp, int flags) +{ + struct trapframe *tp; + + tp = td->td_frame; + + PROC_LOCK(curthread->td_proc); + mcp->mc_onstack = sigonstack(tp->tf_rsp); + PROC_UNLOCK(curthread->td_proc); + mcp->mc_gs = td->td_pcb->pcb_gs; + mcp->mc_fs = td->td_pcb->pcb_fs; + mcp->mc_es = td->td_pcb->pcb_es; + mcp->mc_ds = td->td_pcb->pcb_ds; + mcp->mc_edi = tp->tf_rdi; + mcp->mc_esi = tp->tf_rsi; + mcp->mc_ebp = tp->tf_rbp; + mcp->mc_isp = tp->tf_rsp; + if (flags & GET_MC_CLEAR_RET) { + mcp->mc_eax = 0; + mcp->mc_edx = 0; + } else { + mcp->mc_eax = tp->tf_rax; + mcp->mc_edx = tp->tf_rdx; + } + mcp->mc_ebx = tp->tf_rbx; + mcp->mc_ecx = tp->tf_rcx; + mcp->mc_eip = tp->tf_rip; + mcp->mc_cs = tp->tf_cs; + mcp->mc_eflags = tp->tf_rflags; + mcp->mc_esp = tp->tf_rsp; + mcp->mc_ss = tp->tf_ss; + mcp->mc_len = sizeof(*mcp); + ia32_get_fpcontext(td, mcp); + return (0); +} + +/* + * Set machine context. + * + * However, we don't set any but the user modifiable flags, and we won't + * touch the cs selector. + */ +static int +ia32_set_mcontext(struct thread *td, const struct ia32_mcontext *mcp) +{ + struct trapframe *tp; + long rflags; + int ret; + + tp = td->td_frame; + if (mcp->mc_len != sizeof(*mcp)) + return (EINVAL); + rflags = (mcp->mc_eflags & PSL_USERCHANGE) | + (tp->tf_rflags & ~PSL_USERCHANGE); + ret = ia32_set_fpcontext(td, mcp); + if (ret != 0) + return (ret); +#if 0 /* XXX deal with load_fs() and friends */ + tp->tf_fs = mcp->mc_fs; + tp->tf_es = mcp->mc_es; + tp->tf_ds = mcp->mc_ds; +#endif + tp->tf_rdi = mcp->mc_edi; + tp->tf_rsi = mcp->mc_esi; + tp->tf_rbp = mcp->mc_ebp; + tp->tf_rbx = mcp->mc_ebx; + tp->tf_rdx = mcp->mc_edx; + tp->tf_rcx = mcp->mc_ecx; + tp->tf_rax = mcp->mc_eax; + /* trapno, err */ + tp->tf_rip = mcp->mc_eip; + tp->tf_rflags = rflags; + tp->tf_rsp = mcp->mc_esp; + tp->tf_ss = mcp->mc_ss; +#if 0 /* XXX deal with load_gs() and friends */ + td->td_pcb->pcb_gs = mcp->mc_gs; +#endif + td->td_pcb->pcb_flags |= PCB_FULLCTX; + return (0); +} + +/* + * The first two fields of a ucontext_t are the signal mask and + * the machine context. The next field is uc_link; we want to + * avoid destroying the link when copying out contexts. + */ +#define UC_COPY_SIZE offsetof(struct ia32_ucontext, uc_link) + +int +freebsd32_getcontext(struct thread *td, struct freebsd32_getcontext_args *uap) +{ + struct ia32_ucontext uc; + int ret; + + if (uap->ucp == NULL) + ret = EINVAL; + else { + ia32_get_mcontext(td, &uc.uc_mcontext, GET_MC_CLEAR_RET); + PROC_LOCK(td->td_proc); + uc.uc_sigmask = td->td_sigmask; + PROC_UNLOCK(td->td_proc); + ret = copyout(&uc, uap->ucp, UC_COPY_SIZE); >>> TRUNCATED FOR MAIL (1000 lines) <<<
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200509271847.j8RIl1cm024438>