PERFORCE change 112214 for review

John Baldwin jhb at FreeBSD.org
Thu Dec 28 05:35:10 PST 2006


http://perforce.freebsd.org/chv.cgi?CH=112214

Change 112214 by jhb at jhb_zion on 2006/12/28 13:34:32

	IFC @112213.

Affected files ...

.. //depot/projects/smpng/sys/amd64/amd64/apic_vector.S#15 integrate
.. //depot/projects/smpng/sys/amd64/amd64/cpu_switch.S#16 integrate
.. //depot/projects/smpng/sys/amd64/amd64/exception.S#17 integrate
.. //depot/projects/smpng/sys/amd64/amd64/genassym.c#18 integrate
.. //depot/projects/smpng/sys/amd64/amd64/local_apic.c#26 integrate
.. //depot/projects/smpng/sys/amd64/amd64/machdep.c#63 integrate
.. //depot/projects/smpng/sys/amd64/amd64/trap.c#57 integrate
.. //depot/projects/smpng/sys/amd64/ia32/ia32_exception.S#4 integrate
.. //depot/projects/smpng/sys/amd64/ia32/ia32_syscall.c#23 integrate
.. //depot/projects/smpng/sys/amd64/include/apicvar.h#15 integrate
.. //depot/projects/smpng/sys/amd64/include/atomic.h#29 integrate
.. //depot/projects/smpng/sys/amd64/isa/atpic.c#15 integrate
.. //depot/projects/smpng/sys/amd64/isa/atpic_vector.S#6 integrate
.. //depot/projects/smpng/sys/amd64/isa/icu.h#7 integrate
.. //depot/projects/smpng/sys/amd64/linux32/linux.h#7 integrate
.. //depot/projects/smpng/sys/amd64/linux32/linux32_machdep.c#14 integrate
.. //depot/projects/smpng/sys/boot/arm/at91/Makefile.inc#5 integrate
.. //depot/projects/smpng/sys/boot/arm/at91/boot0spi/main.c#5 integrate
.. //depot/projects/smpng/sys/boot/arm/at91/libat91/arm_init.S#2 integrate
.. //depot/projects/smpng/sys/boot/arm/at91/libat91/at91rm9200_lowlevel.h#4 integrate
.. //depot/projects/smpng/sys/boot/arm/at91/libat91/eeprom.c#3 integrate
.. //depot/projects/smpng/sys/boot/arm/at91/libat91/emac.c#6 integrate
.. //depot/projects/smpng/sys/boot/arm/at91/libat91/emac_init.c#4 integrate
.. //depot/projects/smpng/sys/boot/arm/at91/libat91/lib.h#4 integrate
.. //depot/projects/smpng/sys/boot/arm/at91/libat91/spi_flash.c#3 integrate
.. //depot/projects/smpng/sys/boot/arm/at91/libat91/spi_flash.h#2 integrate
.. //depot/projects/smpng/sys/boot/common/bootstrap.h#11 integrate
.. //depot/projects/smpng/sys/boot/sparc64/loader/main.c#22 integrate
.. //depot/projects/smpng/sys/cam/cam_xpt.c#40 integrate
.. //depot/projects/smpng/sys/compat/freebsd32/freebsd32_misc.c#44 integrate
.. //depot/projects/smpng/sys/compat/freebsd32/freebsd32_proto.h#37 integrate
.. //depot/projects/smpng/sys/compat/freebsd32/freebsd32_syscall.h#37 integrate
.. //depot/projects/smpng/sys/compat/freebsd32/freebsd32_syscalls.c#37 integrate
.. //depot/projects/smpng/sys/compat/freebsd32/freebsd32_sysent.c#37 integrate
.. //depot/projects/smpng/sys/compat/freebsd32/syscalls.master#41 integrate
.. //depot/projects/smpng/sys/compat/linux/linux_ipc.c#29 integrate
.. //depot/projects/smpng/sys/compat/linux/linux_ipc.h#7 integrate
.. //depot/projects/smpng/sys/compat/linux/linux_time.c#2 integrate
.. //depot/projects/smpng/sys/compat/ndis/subr_ntoskrnl.c#42 integrate
.. //depot/projects/smpng/sys/conf/files#194 integrate
.. //depot/projects/smpng/sys/conf/files.amd64#50 integrate
.. //depot/projects/smpng/sys/conf/files.arm#12 integrate
.. //depot/projects/smpng/sys/conf/files.i386#105 integrate
.. //depot/projects/smpng/sys/conf/files.pc98#87 integrate
.. //depot/projects/smpng/sys/conf/files.powerpc#34 integrate
.. //depot/projects/smpng/sys/conf/files.sparc64#59 integrate
.. //depot/projects/smpng/sys/conf/files.sun4v#4 integrate
.. //depot/projects/smpng/sys/conf/options#131 integrate
.. //depot/projects/smpng/sys/contrib/ipfilter/netinet/ip_state.c#15 integrate
.. //depot/projects/smpng/sys/dev/aac/aac_linux.c#4 integrate
.. //depot/projects/smpng/sys/dev/acpica/acpi_battery.c#19 integrate
.. //depot/projects/smpng/sys/dev/ata/ata-queue.c#37 integrate
.. //depot/projects/smpng/sys/dev/ath/if_ath.c#47 integrate
.. //depot/projects/smpng/sys/dev/ath/if_athvar.h#28 integrate
.. //depot/projects/smpng/sys/dev/atkbdc/psm.c#5 integrate
.. //depot/projects/smpng/sys/dev/bge/if_bge.c#85 integrate
.. //depot/projects/smpng/sys/dev/bge/if_bgereg.h#49 integrate
.. //depot/projects/smpng/sys/dev/dc/if_dc.c#13 integrate
.. //depot/projects/smpng/sys/dev/if_ndis/if_ndis.c#42 integrate
.. //depot/projects/smpng/sys/dev/isp/isp.c#50 integrate
.. //depot/projects/smpng/sys/dev/isp/isp_freebsd.c#50 integrate
.. //depot/projects/smpng/sys/dev/isp/isp_pci.c#46 integrate
.. //depot/projects/smpng/sys/dev/isp/ispmbox.h#25 integrate
.. //depot/projects/smpng/sys/dev/mii/brgphy.c#35 integrate
.. //depot/projects/smpng/sys/dev/mii/rgephy.c#11 integrate
.. //depot/projects/smpng/sys/dev/pci/pci.c#82 integrate
.. //depot/projects/smpng/sys/dev/ral/rt2560.c#7 integrate
.. //depot/projects/smpng/sys/dev/ral/rt2560var.h#2 integrate
.. //depot/projects/smpng/sys/dev/ral/rt2661.c#5 integrate
.. //depot/projects/smpng/sys/dev/ral/rt2661var.h#2 integrate
.. //depot/projects/smpng/sys/dev/re/if_re.c#47 integrate
.. //depot/projects/smpng/sys/dev/sound/pci/envy24.c#4 integrate
.. //depot/projects/smpng/sys/dev/sound/pci/envy24ht.c#2 integrate
.. //depot/projects/smpng/sys/dev/sound/pci/envy24ht.h#2 integrate
.. //depot/projects/smpng/sys/dev/sound/pci/hda/hdac.c#5 integrate
.. //depot/projects/smpng/sys/dev/sound/pci/ich.c#47 integrate
.. //depot/projects/smpng/sys/dev/usb/if_aue.c#46 integrate
.. //depot/projects/smpng/sys/dev/usb/if_auereg.h#13 integrate
.. //depot/projects/smpng/sys/dev/usb/uplcom.c#28 integrate
.. //depot/projects/smpng/sys/fs/msdosfs/bpb.h#5 integrate
.. //depot/projects/smpng/sys/fs/udf/udf_vnops.c#35 integrate
.. //depot/projects/smpng/sys/i386/i386/apic_vector.s#23 integrate
.. //depot/projects/smpng/sys/i386/i386/exception.s#27 integrate
.. //depot/projects/smpng/sys/i386/i386/genassym.c#35 integrate
.. //depot/projects/smpng/sys/i386/i386/local_apic.c#47 integrate
.. //depot/projects/smpng/sys/i386/i386/machdep.c#122 integrate
.. //depot/projects/smpng/sys/i386/i386/swtch.s#29 integrate
.. //depot/projects/smpng/sys/i386/i386/trap.c#104 integrate
.. //depot/projects/smpng/sys/i386/i386/vm86.c#22 integrate
.. //depot/projects/smpng/sys/i386/i386/vm86bios.s#7 integrate
.. //depot/projects/smpng/sys/i386/include/apicvar.h#24 integrate
.. //depot/projects/smpng/sys/i386/include/atomic.h#47 integrate
.. //depot/projects/smpng/sys/i386/isa/atpic.c#18 integrate
.. //depot/projects/smpng/sys/i386/isa/atpic_vector.s#14 integrate
.. //depot/projects/smpng/sys/i386/isa/icu.h#13 integrate
.. //depot/projects/smpng/sys/i386/linux/linux.h#14 integrate
.. //depot/projects/smpng/sys/i386/linux/linux_proto.h#38 integrate
.. //depot/projects/smpng/sys/i386/linux/linux_syscall.h#36 integrate
.. //depot/projects/smpng/sys/i386/linux/linux_sysent.c#37 integrate
.. //depot/projects/smpng/sys/i386/linux/syscalls.master#43 integrate
.. //depot/projects/smpng/sys/ia64/ia64/machdep.c#108 integrate
.. //depot/projects/smpng/sys/kern/kern_ktrace.c#56 integrate
.. //depot/projects/smpng/sys/kern/kern_mac.c#47 integrate
.. //depot/projects/smpng/sys/kern/kern_sig.c#129 integrate
.. //depot/projects/smpng/sys/kern/kern_thread.c#97 integrate
.. //depot/projects/smpng/sys/kern/kern_umtx.c#30 integrate
.. //depot/projects/smpng/sys/kern/sched_4bsd.c#65 integrate
.. //depot/projects/smpng/sys/kern/subr_sleepqueue.c#30 integrate
.. //depot/projects/smpng/sys/kern/sys_pipe.c#57 integrate
.. //depot/projects/smpng/sys/kern/sysv_msg.c#34 integrate
.. //depot/projects/smpng/sys/kern/tty.c#69 integrate
.. //depot/projects/smpng/sys/kern/uipc_mbuf.c#51 integrate
.. //depot/projects/smpng/sys/kern/uipc_socket.c#97 integrate
.. //depot/projects/smpng/sys/kern/vfs_bio.c#98 integrate
.. //depot/projects/smpng/sys/kern/vfs_export.c#25 integrate
.. //depot/projects/smpng/sys/kern/vfs_extattr.c#1 branch
.. //depot/projects/smpng/sys/kern/vfs_mount.c#67 integrate
.. //depot/projects/smpng/sys/kern/vfs_syscalls.c#120 integrate
.. //depot/projects/smpng/sys/modules/Makefile#133 integrate
.. //depot/projects/smpng/sys/modules/acpi/Makefile#31 integrate
.. //depot/projects/smpng/sys/modules/acpi/acpi/Makefile#13 integrate
.. //depot/projects/smpng/sys/modules/ufs/Makefile#5 integrate
.. //depot/projects/smpng/sys/net/if_ethersubr.c#78 integrate
.. //depot/projects/smpng/sys/net/if_media.h#20 integrate
.. //depot/projects/smpng/sys/net80211/_ieee80211.h#5 integrate
.. //depot/projects/smpng/sys/net80211/ieee80211.c#24 integrate
.. //depot/projects/smpng/sys/net80211/ieee80211_node.c#28 integrate
.. //depot/projects/smpng/sys/net80211/ieee80211_output.c#29 integrate
.. //depot/projects/smpng/sys/net80211/ieee80211_proto.c#21 integrate
.. //depot/projects/smpng/sys/net80211/ieee80211_var.h#23 integrate
.. //depot/projects/smpng/sys/netgraph/ng_nat.c#6 integrate
.. //depot/projects/smpng/sys/netgraph/ng_ppp.c#20 integrate
.. //depot/projects/smpng/sys/netgraph/ng_ppp.h#6 integrate
.. //depot/projects/smpng/sys/pci/if_rl.c#67 integrate
.. //depot/projects/smpng/sys/powerpc/powerpc/mmu_oea.c#10 integrate
.. //depot/projects/smpng/sys/security/mac/mac_framework.h#5 integrate
.. //depot/projects/smpng/sys/security/mac/mac_inet.c#5 integrate
.. //depot/projects/smpng/sys/security/mac/mac_internal.h#11 integrate
.. //depot/projects/smpng/sys/security/mac/mac_label.c#5 integrate
.. //depot/projects/smpng/sys/security/mac/mac_net.c#17 integrate
.. //depot/projects/smpng/sys/security/mac/mac_pipe.c#9 integrate
.. //depot/projects/smpng/sys/security/mac/mac_policy.h#1 branch
.. //depot/projects/smpng/sys/security/mac/mac_posix_sem.c#5 integrate
.. //depot/projects/smpng/sys/security/mac/mac_priv.c#2 integrate
.. //depot/projects/smpng/sys/security/mac/mac_process.c#12 integrate
.. //depot/projects/smpng/sys/security/mac/mac_socket.c#7 integrate
.. //depot/projects/smpng/sys/security/mac/mac_system.c#8 integrate
.. //depot/projects/smpng/sys/security/mac/mac_sysv_msg.c#5 integrate
.. //depot/projects/smpng/sys/security/mac/mac_sysv_sem.c#5 integrate
.. //depot/projects/smpng/sys/security/mac/mac_sysv_shm.c#4 integrate
.. //depot/projects/smpng/sys/security/mac/mac_vfs.c#15 integrate
.. //depot/projects/smpng/sys/security/mac_biba/mac_biba.c#44 integrate
.. //depot/projects/smpng/sys/security/mac_bsdextended/mac_bsdextended.c#21 integrate
.. //depot/projects/smpng/sys/security/mac_ifoff/mac_ifoff.c#8 integrate
.. //depot/projects/smpng/sys/security/mac_lomac/mac_lomac.c#34 integrate
.. //depot/projects/smpng/sys/security/mac_mls/mac_mls.c#39 integrate
.. //depot/projects/smpng/sys/security/mac_none/mac_none.c#14 integrate
.. //depot/projects/smpng/sys/security/mac_partition/mac_partition.c#10 integrate
.. //depot/projects/smpng/sys/security/mac_portacl/mac_portacl.c#10 integrate
.. //depot/projects/smpng/sys/security/mac_seeotheruids/mac_seeotheruids.c#9 integrate
.. //depot/projects/smpng/sys/security/mac_stub/mac_stub.c#19 integrate
.. //depot/projects/smpng/sys/security/mac_test/mac_test.c#35 integrate
.. //depot/projects/smpng/sys/sparc64/include/param.h#18 integrate
.. //depot/projects/smpng/sys/sparc64/sparc64/genassym.c#41 integrate
.. //depot/projects/smpng/sys/sun4v/include/cddl/mdesc.h#2 integrate
.. //depot/projects/smpng/sys/sun4v/include/pcpu.h#3 integrate
.. //depot/projects/smpng/sys/sun4v/include/smp.h#3 integrate
.. //depot/projects/smpng/sys/sun4v/mdesc/mdesc_init.c#4 integrate
.. //depot/projects/smpng/sys/sun4v/mdesc/mdesc_vdevfindnode.c#1 branch
.. //depot/projects/smpng/sys/sun4v/sun4v/exception.S#6 integrate
.. //depot/projects/smpng/sys/sun4v/sun4v/hcall.S#5 integrate
.. //depot/projects/smpng/sys/sun4v/sun4v/interrupt.S#5 integrate
.. //depot/projects/smpng/sys/sun4v/sun4v/mp_machdep.c#3 integrate
.. //depot/projects/smpng/sys/sun4v/sun4v/pmap.c#9 integrate
.. //depot/projects/smpng/sys/sun4v/sun4v/tick.c#2 integrate
.. //depot/projects/smpng/sys/sun4v/sun4v/trap.c#7 integrate
.. //depot/projects/smpng/sys/sun4v/sun4v/tsb.c#3 integrate
.. //depot/projects/smpng/sys/sun4v/sun4v/tte.c#3 integrate
.. //depot/projects/smpng/sys/sun4v/sun4v/tte_hash.c#6 integrate
.. //depot/projects/smpng/sys/sun4v/sun4v/wbuf.S#4 integrate
.. //depot/projects/smpng/sys/sys/mac_policy.h#42 delete
.. //depot/projects/smpng/sys/sys/mount.h#56 integrate
.. //depot/projects/smpng/sys/sys/mouse.h#7 integrate
.. //depot/projects/smpng/sys/sys/mutex.h#68 integrate
.. //depot/projects/smpng/sys/sys/pcpu.h#18 integrate
.. //depot/projects/smpng/sys/sys/syscallsubr.h#50 integrate
.. //depot/projects/smpng/sys/sys/sysent.h#23 integrate
.. //depot/projects/smpng/sys/sys/systm.h#76 integrate
.. //depot/projects/smpng/sys/sys/umtx.h#20 integrate
.. //depot/projects/smpng/sys/vm/vm_object.c#89 integrate

Differences ...

==== //depot/projects/smpng/sys/amd64/amd64/apic_vector.S#15 (text+ko) ====

@@ -28,7 +28,7 @@
  * SUCH DAMAGE.
  *
  *	from: vector.s, 386BSD 0.1 unknown origin
- * $FreeBSD: src/sys/amd64/amd64/apic_vector.S,v 1.109 2006/05/01 21:36:46 jhb Exp $
+ * $FreeBSD: src/sys/amd64/amd64/apic_vector.S,v 1.110 2006/12/17 06:48:39 kmacy Exp $
  */
 
 /*
@@ -60,6 +60,7 @@
 	jz	2f ;							\
 	addl	$(32 * index),%eax ;					\
 1: ;									\
+	movq	%rsp, %rsi	;                                       \
 	movl	%eax, %edi ;	/* pass the IRQ */			\
 	call	lapic_handle_intr ;					\
 	MEXITCOUNT ;							\
@@ -98,7 +99,7 @@
 IDTVEC(timerint)
 	PUSH_FRAME
 	FAKE_MCOUNT(TF_RIP(%rsp))
-
+	movq	%rsp, %rdi
 	call	lapic_handle_timer
 	MEXITCOUNT
 	jmp	doreti

==== //depot/projects/smpng/sys/amd64/amd64/cpu_switch.S#16 (text+ko) ====

@@ -30,7 +30,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $FreeBSD: src/sys/amd64/amd64/cpu_switch.S,v 1.154 2005/10/17 23:10:31 davidxu Exp $
+ * $FreeBSD: src/sys/amd64/amd64/cpu_switch.S,v 1.155 2006/12/20 04:40:38 davidxu Exp $
  */
 
 #include <machine/asmacros.h>
@@ -206,6 +206,11 @@
 	movq	%rbx, (%rax)
 	movq	%rbx, PCPU(RSP0)
 
+	movl	TD_TID(%rsi), %eax
+	movq	%r8, PCPU(CURPCB)
+	movl	%eax, PCPU(CURTID)
+	movq	%rsi, PCPU(CURTHREAD)		/* into next thread */
+
 	/* Restore context. */
 	movq	PCB_RBX(%r8),%rbx
 	movq	PCB_RSP(%r8),%rsp
@@ -217,9 +222,6 @@
 	movq	PCB_RIP(%r8),%rax
 	movq	%rax,(%rsp)
 
-	movq	%r8, PCPU(CURPCB)
-	movq	%rsi, PCPU(CURTHREAD)		/* into next thread */
-
 	/* Test if debug registers should be restored. */
 	testl	$PCB_DBREGS,PCB_FLAGS(%r8)
 	jz	1f

==== //depot/projects/smpng/sys/amd64/amd64/exception.S#17 (text+ko) ====

@@ -27,7 +27,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $FreeBSD: src/sys/amd64/amd64/exception.S,v 1.127 2005/08/27 16:03:40 jkoshy Exp $
+ * $FreeBSD: src/sys/amd64/amd64/exception.S,v 1.129 2006/12/23 03:30:50 davidxu Exp $
  */
 
 #include "opt_atpic.h"
@@ -165,6 +165,7 @@
 	.globl	calltrap
 	.type	calltrap, at function
 calltrap:
+	movq	%rsp, %rdi
 	call	trap
 	MEXITCOUNT
 	jmp	doreti			/* Handle any pending ASTs */
@@ -267,6 +268,7 @@
 	movq	%r14,TF_R14(%rsp)	/* C preserved */
 	movq	%r15,TF_R15(%rsp)	/* C preserved */
 	FAKE_MCOUNT(TF_RIP(%rsp))
+	movq	%rsp, %rdi
 	call	syscall
 	movq	PCPU(CURPCB),%rax
 	testq	$PCB_FULLCTX,PCB_FLAGS(%rax)
@@ -363,6 +365,7 @@
 /* Note: this label is also used by ddb and gdb: */
 nmi_calltrap:
 	FAKE_MCOUNT(TF_RIP(%rsp))
+	movq	%rsp, %rdi
 	call	trap
 	MEXITCOUNT
 	testl	%ebx,%ebx

==== //depot/projects/smpng/sys/amd64/amd64/genassym.c#18 (text+ko) ====

@@ -33,7 +33,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/amd64/genassym.c,v 1.159 2006/11/30 04:17:04 jb Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/amd64/genassym.c,v 1.160 2006/12/20 04:40:38 davidxu Exp $");
 
 #include "opt_compat.h"
 #include "opt_kstack_pages.h"
@@ -79,6 +79,7 @@
 ASSYM(TD_FLAGS, offsetof(struct thread, td_flags));
 ASSYM(TD_PCB, offsetof(struct thread, td_pcb));
 ASSYM(TD_PROC, offsetof(struct thread, td_proc));
+ASSYM(TD_TID, offsetof(struct thread, td_tid));
 
 ASSYM(TDF_ASTPENDING, TDF_ASTPENDING);
 ASSYM(TDF_NEEDRESCHED, TDF_NEEDRESCHED);
@@ -190,6 +191,7 @@
 ASSYM(PC_CURPMAP, offsetof(struct pcpu, pc_curpmap));
 ASSYM(PC_TSSP, offsetof(struct pcpu, pc_tssp));
 ASSYM(PC_RSP0, offsetof(struct pcpu, pc_rsp0));
+ASSYM(PC_CURTID, offsetof(struct pcpu, pc_curtid));
  
 ASSYM(LA_VER, offsetof(struct LAPIC, version));
 ASSYM(LA_TPR, offsetof(struct LAPIC, tpr));

==== //depot/projects/smpng/sys/amd64/amd64/local_apic.c#26 (text+ko) ====

@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/amd64/local_apic.c,v 1.33 2006/11/13 22:23:32 jhb Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/amd64/local_apic.c,v 1.34 2006/12/17 06:48:39 kmacy Exp $");
 
 #include "opt_hwpmc_hooks.h"
 
@@ -610,18 +610,18 @@
 }
 
 void
-lapic_handle_intr(int vector, struct trapframe frame)
+lapic_handle_intr(int vector, struct trapframe *frame)
 {
 	struct intsrc *isrc;
 
 	if (vector == -1)
 		panic("Couldn't get vector from ISR!");
 	isrc = intr_lookup_source(apic_idt_to_irq(vector));
-	intr_execute_handlers(isrc, &frame);
+	intr_execute_handlers(isrc, frame);
 }
 
 void
-lapic_handle_timer(struct trapframe frame)
+lapic_handle_timer(struct trapframe *frame)
 {
 	struct lapic *la;
 
@@ -654,16 +654,16 @@
 	if (la->la_hard_ticks >= lapic_timer_hz) {
 		la->la_hard_ticks -= lapic_timer_hz;
 		if (PCPU_GET(cpuid) == 0)
-			hardclock(TRAPF_USERMODE(&frame), TRAPF_PC(&frame));
+			hardclock(TRAPF_USERMODE(frame), TRAPF_PC(frame));
 		else
-			hardclock_cpu(TRAPF_USERMODE(&frame));
+			hardclock_cpu(TRAPF_USERMODE(frame));
 	}
 
 	/* Fire statclock at stathz. */
 	la->la_stat_ticks += stathz;
 	if (la->la_stat_ticks >= lapic_timer_hz) {
 		la->la_stat_ticks -= lapic_timer_hz;
-		statclock(TRAPF_USERMODE(&frame));
+		statclock(TRAPF_USERMODE(frame));
 	}
 
 	/* Fire profclock at profhz, but only when needed. */
@@ -671,7 +671,7 @@
 	if (la->la_prof_ticks >= lapic_timer_hz) {
 		la->la_prof_ticks -= lapic_timer_hz;
 		if (profprocs != 0)
-			profclock(TRAPF_USERMODE(&frame), TRAPF_PC(&frame));
+			profclock(TRAPF_USERMODE(frame), TRAPF_PC(frame));
 	}
 	critical_exit();
 }

==== //depot/projects/smpng/sys/amd64/amd64/machdep.c#63 (text+ko) ====

@@ -39,7 +39,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/amd64/machdep.c,v 1.666 2006/12/06 18:27:17 sobomax Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/amd64/machdep.c,v 1.667 2006/12/20 04:40:38 davidxu Exp $");
 
 #include "opt_atalk.h"
 #include "opt_atpic.h"
@@ -1164,6 +1164,7 @@
 	PCPU_SET(prvspace, pc);
 	PCPU_SET(curthread, &thread0);
 	PCPU_SET(curpcb, thread0.td_pcb);
+	PCPU_SET(curtid, thread0.td_tid);
 	PCPU_SET(tssp, &common_tss[0]);
 
 	/*

==== //depot/projects/smpng/sys/amd64/amd64/trap.c#57 (text+ko) ====

@@ -38,7 +38,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/amd64/trap.c,v 1.312 2006/11/28 20:04:00 ru Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/amd64/trap.c,v 1.313 2006/12/17 06:48:39 kmacy Exp $");
 
 /*
  * AMD64 Trap and System call handling
@@ -94,8 +94,8 @@
 #endif
 #include <machine/tss.h>
 
-extern void trap(struct trapframe frame);
-extern void syscall(struct trapframe frame);
+extern void trap(struct trapframe *frame);
+extern void syscall(struct trapframe *frame);
 
 static int trap_pfault(struct trapframe *, int);
 static void trap_fatal(struct trapframe *, vm_offset_t);
@@ -155,8 +155,7 @@
  */
 
 void
-trap(frame)
-	struct trapframe frame;
+trap(struct trapframe *frame)
 {
 	struct thread *td = curthread;
 	struct proc *p = td->td_proc;
@@ -165,7 +164,7 @@
 	ksiginfo_t ksi;
 
 	PCPU_LAZY_INC(cnt.v_trap);
-	type = frame.tf_trapno;
+	type = frame->tf_trapno;
 
 #ifdef SMP
 #ifdef STOP_NMI
@@ -192,12 +191,12 @@
 	 * the NMI was handled by it and we can return immediately.
 	 */
 	if (type == T_NMI && pmc_intr &&
-	    (*pmc_intr)(PCPU_GET(cpuid), (uintptr_t) frame.tf_rip,
-		TRAPF_USERMODE(&frame)))
+	    (*pmc_intr)(PCPU_GET(cpuid), (uintptr_t) frame->tf_rip,
+		TRAPF_USERMODE(frame)))
 		goto out;
 #endif
 
-	if ((frame.tf_rflags & PSL_I) == 0) {
+	if ((frame->tf_rflags & PSL_I) == 0) {
 		/*
 		 * Buggy application or kernel code has disabled
 		 * interrupts and then trapped.  Enabling interrupts
@@ -205,7 +204,7 @@
 		 * interrupts disabled until they are accidentally
 		 * enabled later.
 		 */
-		if (ISPL(frame.tf_cs) == SEL_UPL)
+		if (ISPL(frame->tf_cs) == SEL_UPL)
 			printf(
 			    "pid %ld (%s): trap %d with interrupts disabled\n",
 			    (long)curproc->p_pid, curproc->p_comm, type);
@@ -226,7 +225,7 @@
 		}
 	}
 
-	code = frame.tf_err;
+	code = frame->tf_err;
 	if (type == T_PAGEFLT) {
 		/*
 		 * If we get a page fault while in a critical section, then
@@ -245,15 +244,15 @@
 		if (td->td_critnest != 0 ||
 		    WITNESS_CHECK(WARN_SLEEPOK | WARN_GIANTOK, NULL,
 		    "Kernel page fault") != 0)
-			trap_fatal(&frame, frame.tf_addr);
+			trap_fatal(frame, frame->tf_addr);
 	}
 
-        if (ISPL(frame.tf_cs) == SEL_UPL) {
+        if (ISPL(frame->tf_cs) == SEL_UPL) {
 		/* user trap */
 
 		td->td_pticks = 0;
-		td->td_frame = &frame;
-		addr = frame.tf_rip;
+		td->td_frame = frame;
+		addr = frame->tf_rip;
 		if (td->td_ucred != p->p_ucred) 
 			cred_update_thread(td);
 
@@ -266,7 +265,7 @@
 		case T_BPTFLT:		/* bpt instruction fault */
 		case T_TRCTRAP:		/* trace trap */
 			enable_intr();
-			frame.tf_rflags &= ~PSL_T;
+			frame->tf_rflags &= ~PSL_T;
 			i = SIGTRAP;
 			ucode = (type == T_TRCTRAP ? TRAP_TRACE : TRAP_BRKPT);
 			break;
@@ -298,12 +297,12 @@
 			break;
 
 		case T_PAGEFLT:		/* page fault */
-			addr = frame.tf_addr;
+			addr = frame->tf_addr;
 #ifdef KSE
 			if (td->td_pflags & TDP_SA)
 				thread_user_enter(td);
 #endif
-			i = trap_pfault(&frame, TRUE);
+			i = trap_pfault(frame, TRUE);
 			if (i == -1)
 				goto userout;
 			if (i == 0)
@@ -334,7 +333,7 @@
 				 */
 				if (kdb_on_nmi) {
 					printf ("NMI ... going to debugger\n");
-					kdb_trap(type, 0, &frame);
+					kdb_trap(type, 0, frame);
 				}
 #endif /* KDB */
 				goto userout;
@@ -380,7 +379,7 @@
 		    ("kernel trap doesn't have ucred"));
 		switch (type) {
 		case T_PAGEFLT:			/* page fault */
-			(void) trap_pfault(&frame, FALSE);
+			(void) trap_pfault(frame, FALSE);
 			goto out;
 
 		case T_DNA:
@@ -413,12 +412,12 @@
 			 * selectors and pointers when the user changes
 			 * them.
 			 */
-			if (frame.tf_rip == (long)doreti_iret) {
-				frame.tf_rip = (long)doreti_iret_fault;
+			if (frame->tf_rip == (long)doreti_iret) {
+				frame->tf_rip = (long)doreti_iret_fault;
 				goto out;
 			}
 			if (PCPU_GET(curpcb)->pcb_onfault != NULL) {
-				frame.tf_rip =
+				frame->tf_rip =
 				    (long)PCPU_GET(curpcb)->pcb_onfault;
 				goto out;
 			}
@@ -434,8 +433,8 @@
 			 * problem here and not every time the kernel is
 			 * entered.
 			 */
-			if (frame.tf_rflags & PSL_NT) {
-				frame.tf_rflags &= ~PSL_NT;
+			if (frame->tf_rflags & PSL_NT) {
+				frame->tf_rflags &= ~PSL_NT;
 				goto out;
 			}
 			break;
@@ -470,7 +469,7 @@
 			 */
 #ifdef KDB
 			/* XXX Giant */
-			if (kdb_trap(type, 0, &frame))
+			if (kdb_trap(type, 0, frame))
 				goto out;
 #endif
 			break;
@@ -487,7 +486,7 @@
 				 */
 				if (kdb_on_nmi) {
 					printf ("NMI ... going to debugger\n");
-					kdb_trap(type, 0, &frame);
+					kdb_trap(type, 0, frame);
 				}
 #endif /* KDB */
 				goto out;
@@ -497,7 +496,7 @@
 #endif /* DEV_ISA */
 		}
 
-		trap_fatal(&frame, 0);
+		trap_fatal(frame, 0);
 		goto out;
 	}
 
@@ -517,13 +516,13 @@
 		uprintf("fatal process exception: %s",
 			trap_msg[type]);
 		if ((type == T_PAGEFLT) || (type == T_PROTFLT))
-			uprintf(", fault VA = 0x%lx", frame.tf_addr);
+			uprintf(", fault VA = 0x%lx", frame->tf_addr);
 		uprintf("\n");
 	}
 #endif
 
 user:
-	userret(td, &frame);
+	userret(td, frame);
 	mtx_assert(&Giant, MA_NOTOWNED);
 userout:
 out:
@@ -723,8 +722,7 @@
  *	A system call is essentially treated as a trap.
  */
 void
-syscall(frame)
-	struct trapframe frame;
+syscall(struct trapframe *frame)
 {
 	caddr_t params;
 	struct sysent *callp;
@@ -746,7 +744,7 @@
 	PCPU_LAZY_INC(cnt.v_syscall);
 
 #ifdef DIAGNOSTIC
-	if (ISPL(frame.tf_cs) != SEL_UPL) {
+	if (ISPL(frame->tf_cs) != SEL_UPL) {
 		mtx_lock(&Giant);	/* try to stabilize the system XXX */
 		panic("syscall");
 		/* NOT REACHED */
@@ -757,25 +755,25 @@
 	reg = 0;
 	regcnt = 6;
 	td->td_pticks = 0;
-	td->td_frame = &frame;
+	td->td_frame = frame;
 	if (td->td_ucred != p->p_ucred) 
 		cred_update_thread(td);
 #ifdef KSE
 	if (p->p_flag & P_SA)
 		thread_user_enter(td);
 #endif
-	params = (caddr_t)frame.tf_rsp + sizeof(register_t);
-	code = frame.tf_rax;
-	orig_tf_rflags = frame.tf_rflags;
+	params = (caddr_t)frame->tf_rsp + sizeof(register_t);
+	code = frame->tf_rax;
+	orig_tf_rflags = frame->tf_rflags;
 
 	if (p->p_sysent->sv_prepsyscall) {
 		/*
 		 * The prep code is MP aware.
 		 */
-		(*p->p_sysent->sv_prepsyscall)(&frame, (int *)args, &code, &params);
+		(*p->p_sysent->sv_prepsyscall)(frame, (int *)args, &code, &params);
 	} else {
 		if (code == SYS_syscall || code == SYS___syscall) {
-			code = frame.tf_rdi;
+			code = frame->tf_rdi;
 			reg++;
 			regcnt--;
 		}
@@ -797,7 +795,7 @@
 	KASSERT(narg <= sizeof(args) / sizeof(args[0]),
 	    ("Too many syscall arguments!"));
 	error = 0;
-	argp = &frame.tf_rdi;
+	argp = &frame->tf_rdi;
 	argp += reg;
 	bcopy(argp, args, sizeof(args[0]) * regcnt);
 	if (narg > regcnt) {
@@ -817,7 +815,7 @@
 
 	if (error == 0) {
 		td->td_retval[0] = 0;
-		td->td_retval[1] = frame.tf_rdx;
+		td->td_retval[1] = frame->tf_rdx;
 
 		STOPEVENT(p, S_SCE, narg);
 
@@ -830,9 +828,9 @@
 
 	switch (error) {
 	case 0:
-		frame.tf_rax = td->td_retval[0];
-		frame.tf_rdx = td->td_retval[1];
-		frame.tf_rflags &= ~PSL_C;
+		frame->tf_rax = td->td_retval[0];
+		frame->tf_rdx = td->td_retval[1];
+		frame->tf_rflags &= ~PSL_C;
 		break;
 
 	case ERESTART:
@@ -842,8 +840,8 @@
 		 * (which was holding the value of %rcx) is restored for
 		 * the next iteration.
 		 */
-		frame.tf_rip -= frame.tf_err;
-		frame.tf_r10 = frame.tf_rcx;
+		frame->tf_rip -= frame->tf_err;
+		frame->tf_r10 = frame->tf_rcx;
 		td->td_pcb->pcb_flags |= PCB_FULLCTX;
 		break;
 
@@ -857,8 +855,8 @@
    			else
   				error = p->p_sysent->sv_errtbl[error];
 		}
-		frame.tf_rax = error;
-		frame.tf_rflags |= PSL_C;
+		frame->tf_rax = error;
+		frame->tf_rflags |= PSL_C;
 		break;
 	}
 
@@ -866,11 +864,11 @@
 	 * Traced syscall.
 	 */
 	if (orig_tf_rflags & PSL_T) {
-		frame.tf_rflags &= ~PSL_T;
+		frame->tf_rflags &= ~PSL_T;
 		ksiginfo_init_trap(&ksi);
 		ksi.ksi_signo = SIGTRAP;
 		ksi.ksi_code = TRAP_TRACE;
-		ksi.ksi_addr = (void *)frame.tf_rip;
+		ksi.ksi_addr = (void *)frame->tf_rip;
 		trapsignal(td, &ksi);
 	}
 
@@ -890,7 +888,7 @@
 	/*
 	 * Handle reschedule and other end-of-syscall issues
 	 */
-	userret(td, &frame);
+	userret(td, frame);
 
 	CTR4(KTR_SYSC, "syscall exit thread %p pid %d proc %s code %d", td,
 	    td->td_proc->p_pid, td->td_proc->p_comm, code);

==== //depot/projects/smpng/sys/amd64/ia32/ia32_exception.S#4 (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/amd64/ia32/ia32_exception.S,v 1.4 2004/05/24 11:28:11 bde Exp $
+ * $FreeBSD: src/sys/amd64/ia32/ia32_exception.S,v 1.5 2006/12/17 06:48:39 kmacy Exp $
  */
 
 #include <machine/asmacros.h>
@@ -61,6 +61,7 @@
 	movq	%r14,TF_R14(%rsp)
 	movq	%r15,TF_R15(%rsp)
 	FAKE_MCOUNT(TF_RIP(%rsp))
+	movq	%rsp, %rdi
 	call	ia32_syscall
 	MEXITCOUNT
 	jmp	doreti

==== //depot/projects/smpng/sys/amd64/ia32/ia32_syscall.c#23 (text+ko) ====

@@ -36,7 +36,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/ia32/ia32_syscall.c,v 1.16 2006/07/28 20:22:57 jhb Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/ia32/ia32_syscall.c,v 1.17 2006/12/17 06:48:39 kmacy Exp $");
 
 /*
  * 386 Trap and System call handling
@@ -86,10 +86,10 @@
 extern inthand_t IDTVEC(int0x80_syscall), IDTVEC(rsvd);
 extern const char *freebsd32_syscallnames[];
 
-void ia32_syscall(struct trapframe frame);	/* Called from asm code */
+void ia32_syscall(struct trapframe *frame);	/* Called from asm code */
 
 void
-ia32_syscall(struct trapframe frame)
+ia32_syscall(struct trapframe *frame)
 {
 	caddr_t params;
 	int i;
@@ -111,18 +111,18 @@
 	PCPU_LAZY_INC(cnt.v_syscall);
 
 	td->td_pticks = 0;
-	td->td_frame = &frame;
+	td->td_frame = frame;
 	if (td->td_ucred != p->p_ucred) 
 		cred_update_thread(td);
-	params = (caddr_t)frame.tf_rsp + sizeof(u_int32_t);
-	code = frame.tf_rax;
-	orig_tf_rflags = frame.tf_rflags;
+	params = (caddr_t)frame->tf_rsp + sizeof(u_int32_t);
+	code = frame->tf_rax;
+	orig_tf_rflags = frame->tf_rflags;
 
 	if (p->p_sysent->sv_prepsyscall) {
 		/*
 		 * The prep code is MP aware.
 		 */
-		(*p->p_sysent->sv_prepsyscall)(&frame, args, &code, &params);
+		(*p->p_sysent->sv_prepsyscall)(frame, args, &code, &params);
 	} else {
 		/*
 		 * Need to check if this is a 32 bit or 64 bit syscall.
@@ -177,7 +177,7 @@
 
 	if (error == 0) {
 		td->td_retval[0] = 0;
-		td->td_retval[1] = frame.tf_rdx;
+		td->td_retval[1] = frame->tf_rdx;
 
 		STOPEVENT(p, S_SCE, narg);
 
@@ -190,9 +190,9 @@
 
 	switch (error) {
 	case 0:
-		frame.tf_rax = td->td_retval[0];
-		frame.tf_rdx = td->td_retval[1];
-		frame.tf_rflags &= ~PSL_C;
+		frame->tf_rax = td->td_retval[0];
+		frame->tf_rdx = td->td_retval[1];
+		frame->tf_rflags &= ~PSL_C;
 		break;
 
 	case ERESTART:
@@ -200,7 +200,7 @@
 		 * Reconstruct pc, assuming lcall $X,y is 7 bytes,
 		 * int 0x80 is 2 bytes. We saved this in tf_err.
 		 */
-		frame.tf_rip -= frame.tf_err;
+		frame->tf_rip -= frame->tf_err;
 		break;
 
 	case EJUSTRETURN:
@@ -213,8 +213,8 @@
    			else
   				error = p->p_sysent->sv_errtbl[error];
 		}
-		frame.tf_rax = error;
-		frame.tf_rflags |= PSL_C;
+		frame->tf_rax = error;
+		frame->tf_rflags |= PSL_C;
 		break;
 	}
 
@@ -222,11 +222,11 @@
 	 * Traced syscall.
 	 */
 	if (orig_tf_rflags & PSL_T) {
-		frame.tf_rflags &= ~PSL_T;
+		frame->tf_rflags &= ~PSL_T;
 		ksiginfo_init_trap(&ksi);
 		ksi.ksi_signo = SIGTRAP;
 		ksi.ksi_code = TRAP_TRACE;
-		ksi.ksi_addr = (void *)frame.tf_rip;
+		ksi.ksi_addr = (void *)frame->tf_rip;
 		trapsignal(td, &ksi);
 	}
 
@@ -246,7 +246,7 @@
 	/*
 	 * Handle reschedule and other end-of-syscall issues
 	 */
-	userret(td, &frame);
+	userret(td, frame);
 
 	CTR4(KTR_SYSC, "syscall exit thread %p pid %d proc %s code %d", td,
 	    td->td_proc->p_pid, td->td_proc->p_comm, code);

==== //depot/projects/smpng/sys/amd64/include/apicvar.h#15 (text+ko) ====

@@ -26,7 +26,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $FreeBSD: src/sys/amd64/include/apicvar.h,v 1.20 2006/11/13 22:23:33 jhb Exp $
+ * $FreeBSD: src/sys/amd64/include/apicvar.h,v 1.21 2006/12/17 06:48:40 kmacy Exp $
  */
 
 #ifndef _MACHINE_APICVAR_H_
@@ -202,8 +202,8 @@
 void	lapic_ipi_raw(register_t icrlo, u_int dest);
 void	lapic_ipi_vectored(u_int vector, int dest);
 int	lapic_ipi_wait(int delay);
-void	lapic_handle_intr(int vector, struct trapframe frame);
-void	lapic_handle_timer(struct trapframe frame);
+void	lapic_handle_intr(int vector, struct trapframe *frame);
+void	lapic_handle_timer(struct trapframe *frame);
 void	lapic_set_logical_id(u_int apic_id, u_int cluster, u_int cluster_id);
 int	lapic_set_lvt_mask(u_int apic_id, u_int lvt, u_char masked);
 int	lapic_set_lvt_mode(u_int apic_id, u_int lvt, u_int32_t mode);

==== //depot/projects/smpng/sys/amd64/include/atomic.h#29 (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/amd64/include/atomic.h,v 1.39 2005/09/27 17:39:10 jhb Exp $
+ * $FreeBSD: src/sys/amd64/include/atomic.h,v 1.41 2006/12/28 08:15:14 bde Exp $
  */
 #ifndef _MACHINE_ATOMIC_H_
 #define	_MACHINE_ATOMIC_H_
@@ -67,7 +67,7 @@
  * Kernel modules call real functions which are built into the kernel.
  * This allows kernel modules to be portable between UP and SMP systems.
  */
-#if defined(KLD_MODULE) || !(defined(__GNUCLIKE_ASM) && defined(__CC_SUPPORTS___INLINE))
+#if defined(KLD_MODULE) || !defined(__GNUCLIKE_ASM)
 #define	ATOMIC_ASM(NAME, TYPE, OP, CONS, V)			\
 void atomic_##NAME##_##TYPE(volatile u_##TYPE *p, u_##TYPE v)
 
@@ -79,7 +79,7 @@
 u_##TYPE	atomic_load_acq_##TYPE(volatile u_##TYPE *p);	\
 void		atomic_store_rel_##TYPE(volatile u_##TYPE *p, u_##TYPE v)
 
-#else /* !KLD_MODULE && __GNUCLIKE_ASM && __CC_SUPPORTS___INLINE */
+#else /* !KLD_MODULE && __GNUCLIKE_ASM */
 
 /*
  * For userland, assume the SMP case and use lock prefixes so that
@@ -116,19 +116,19 @@
 static __inline int
 atomic_cmpset_int(volatile u_int *dst, u_int exp, u_int src)
 {
-	int res = exp;
+	u_char res;
 
 	__asm __volatile (
 	"	" __XSTRING(MPLOCKED) "	"
 	"	cmpxchgl %2,%1 ;	"
-	"       setz	%%al ;		"
-	"	movzbl	%%al,%0 ;	"
+	"       sete	%0 ;		"
 	"1:				"
 	"# atomic_cmpset_int"
-	: "+a" (res), 			/* 0 (result) */
+	: "=a" (res),			/* 0 */
 	  "=m" (*dst)			/* 1 */
 	: "r" (src),			/* 2 */
-	  "m" (*dst)			/* 3 */
+	  "a" (exp),			/* 3 */
+	  "m" (*dst)			/* 4 */
 	: "memory");
 
 	return (res);
@@ -137,19 +137,19 @@
 static __inline int
 atomic_cmpset_long(volatile u_long *dst, u_long exp, u_long src)
 {
-	long res = exp;
+	u_char res;
 
 	__asm __volatile (
 	"	" __XSTRING(MPLOCKED) "	"
 	"	cmpxchgq %2,%1 ;	"
-	"       setz	%%al ;		"
-	"	movzbq	%%al,%0 ;	"
+	"       sete	%0 ;		"
 	"1:				"
 	"# atomic_cmpset_long"
-	: "+a" (res),			/* 0 (result) */
+	: "=a" (res),			/* 0 */
 	  "=m" (*dst)			/* 1 */
 	: "r" (src),			/* 2 */
-	  "m" (*dst)			/* 3 */
+	  "a" (exp),			/* 3 */
+	  "m" (*dst)			/* 4 */
 	: "memory");
 
 	return (res);
@@ -209,7 +209,7 @@
 	: "=a" (res),			/* 0 (result) */\
 	  "=m" (*p)			/* 1 */		\
 	: "m" (*p)			/* 2 */		\
-	: "memory");				 	\
+	: "memory");					\
 							\
 	return (res);					\
 }							\
@@ -229,7 +229,7 @@
 
 #endif /* SMP */
 
-#endif /* KLD_MODULE || !(__GNUCLIKE_ASM && __CC_SUPPORTS___INLINE) */
+#endif /* KLD_MODULE || !__GNUCLIKE_ASM */
 
 ATOMIC_ASM(set,	     char,  "orb %b1,%0",  "iq",  v);
 ATOMIC_ASM(clear,    char,  "andb %b1,%0", "iq", ~v);
@@ -262,7 +262,7 @@
 #if !defined(WANT_FUNCTIONS)

>>> TRUNCATED FOR MAIL (1000 lines) <<<


More information about the p4-projects mailing list