PERFORCE change 112005 for review

Jung-uk Kim jkim at FreeBSD.org
Wed Dec 20 11:56:41 PST 2006


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

Change 112005 by jkim at jkim_hammer on 2006/12/20 19:55:41

	IFC

Affected files ...

.. //depot/projects/linuxolator/src/sys/amd64/amd64/apic_vector.S#2 integrate
.. //depot/projects/linuxolator/src/sys/amd64/amd64/cpu_switch.S#2 integrate
.. //depot/projects/linuxolator/src/sys/amd64/amd64/exception.S#2 integrate
.. //depot/projects/linuxolator/src/sys/amd64/amd64/genassym.c#4 integrate
.. //depot/projects/linuxolator/src/sys/amd64/amd64/local_apic.c#6 integrate
.. //depot/projects/linuxolator/src/sys/amd64/amd64/machdep.c#11 integrate
.. //depot/projects/linuxolator/src/sys/amd64/amd64/trap.c#4 integrate
.. //depot/projects/linuxolator/src/sys/amd64/ia32/ia32_exception.S#2 integrate
.. //depot/projects/linuxolator/src/sys/amd64/ia32/ia32_syscall.c#2 integrate
.. //depot/projects/linuxolator/src/sys/amd64/include/apicvar.h#4 integrate
.. //depot/projects/linuxolator/src/sys/amd64/isa/atpic.c#3 integrate
.. //depot/projects/linuxolator/src/sys/amd64/isa/atpic_vector.S#3 integrate
.. //depot/projects/linuxolator/src/sys/amd64/isa/icu.h#2 integrate
.. //depot/projects/linuxolator/src/sys/arm/at91/at91_st.c#2 integrate
.. //depot/projects/linuxolator/src/sys/arm/xscale/i80321/i80321_wdog.c#2 integrate
.. //depot/projects/linuxolator/src/sys/boot/arm/at91/Makefile.inc#4 integrate
.. //depot/projects/linuxolator/src/sys/boot/arm/at91/boot0spi/main.c#4 integrate
.. //depot/projects/linuxolator/src/sys/boot/arm/at91/libat91/arm_init.S#2 integrate
.. //depot/projects/linuxolator/src/sys/boot/arm/at91/libat91/at91rm9200_lowlevel.h#3 integrate
.. //depot/projects/linuxolator/src/sys/boot/arm/at91/libat91/eeprom.c#2 integrate
.. //depot/projects/linuxolator/src/sys/boot/arm/at91/libat91/emac.c#4 integrate
.. //depot/projects/linuxolator/src/sys/boot/arm/at91/libat91/emac_init.c#4 integrate
.. //depot/projects/linuxolator/src/sys/boot/arm/at91/libat91/lib.h#3 integrate
.. //depot/projects/linuxolator/src/sys/boot/arm/at91/libat91/spi_flash.c#3 integrate
.. //depot/projects/linuxolator/src/sys/boot/arm/at91/libat91/spi_flash.h#2 integrate
.. //depot/projects/linuxolator/src/sys/boot/common/bootstrap.h#3 integrate
.. //depot/projects/linuxolator/src/sys/boot/sparc64/loader/main.c#4 integrate
.. //depot/projects/linuxolator/src/sys/compat/freebsd32/freebsd32_misc.c#7 integrate
.. //depot/projects/linuxolator/src/sys/compat/freebsd32/freebsd32_proto.h#10 integrate
.. //depot/projects/linuxolator/src/sys/compat/freebsd32/freebsd32_syscall.h#10 integrate
.. //depot/projects/linuxolator/src/sys/compat/freebsd32/freebsd32_syscalls.c#10 integrate
.. //depot/projects/linuxolator/src/sys/compat/freebsd32/freebsd32_sysent.c#10 integrate
.. //depot/projects/linuxolator/src/sys/compat/freebsd32/syscalls.master#9 integrate
.. //depot/projects/linuxolator/src/sys/compat/linux/linux_ipc.c#6 integrate
.. //depot/projects/linuxolator/src/sys/conf/files.amd64#9 integrate
.. //depot/projects/linuxolator/src/sys/conf/files.arm#4 integrate
.. //depot/projects/linuxolator/src/sys/conf/files.i386#8 integrate
.. //depot/projects/linuxolator/src/sys/conf/files.pc98#6 integrate
.. //depot/projects/linuxolator/src/sys/conf/files.powerpc#3 integrate
.. //depot/projects/linuxolator/src/sys/conf/files.sparc64#4 integrate
.. //depot/projects/linuxolator/src/sys/conf/files.sun4v#7 integrate
.. //depot/projects/linuxolator/src/sys/conf/options#10 integrate
.. //depot/projects/linuxolator/src/sys/dev/aac/aac_linux.c#2 integrate
.. //depot/projects/linuxolator/src/sys/dev/ata/ata-all.c#4 integrate
.. //depot/projects/linuxolator/src/sys/dev/atkbdc/psm.c#2 integrate
.. //depot/projects/linuxolator/src/sys/dev/bge/if_bge.c#9 integrate
.. //depot/projects/linuxolator/src/sys/dev/bge/if_bgereg.h#6 integrate
.. //depot/projects/linuxolator/src/sys/dev/dc/if_dc.c#5 integrate
.. //depot/projects/linuxolator/src/sys/dev/ichwd/ichwd.c#2 integrate
.. //depot/projects/linuxolator/src/sys/dev/ipmi/ipmi.c#6 integrate
.. //depot/projects/linuxolator/src/sys/dev/isp/isp.c#7 integrate
.. //depot/projects/linuxolator/src/sys/dev/isp/isp_freebsd.c#7 integrate
.. //depot/projects/linuxolator/src/sys/dev/isp/isp_pci.c#7 integrate
.. //depot/projects/linuxolator/src/sys/dev/isp/isp_sbus.c#4 integrate
.. //depot/projects/linuxolator/src/sys/dev/isp/ispmbox.h#6 integrate
.. //depot/projects/linuxolator/src/sys/dev/mii/brgphy.c#4 integrate
.. //depot/projects/linuxolator/src/sys/dev/mii/rgephy.c#3 integrate
.. //depot/projects/linuxolator/src/sys/dev/mk48txx/mk48txx.c#2 integrate
.. //depot/projects/linuxolator/src/sys/dev/mpt/mpt_cam.c#9 integrate
.. //depot/projects/linuxolator/src/sys/dev/ral/rt2560.c#3 integrate
.. //depot/projects/linuxolator/src/sys/dev/ral/rt2560var.h#2 integrate
.. //depot/projects/linuxolator/src/sys/dev/ral/rt2661.c#3 integrate
.. //depot/projects/linuxolator/src/sys/dev/ral/rt2661var.h#2 integrate
.. //depot/projects/linuxolator/src/sys/dev/re/if_re.c#4 integrate
.. //depot/projects/linuxolator/src/sys/dev/sound/pci/envy24.c#3 integrate
.. //depot/projects/linuxolator/src/sys/dev/sound/pci/envy24ht.c#2 integrate
.. //depot/projects/linuxolator/src/sys/dev/sound/pci/envy24ht.h#2 integrate
.. //depot/projects/linuxolator/src/sys/dev/sound/pci/hda/hdac.c#8 integrate
.. //depot/projects/linuxolator/src/sys/dev/sound/pci/ich.c#3 integrate
.. //depot/projects/linuxolator/src/sys/dev/watchdog/watchdog.c#2 integrate
.. //depot/projects/linuxolator/src/sys/fs/msdosfs/bpb.h#2 integrate
.. //depot/projects/linuxolator/src/sys/i386/i386/apic_vector.s#2 integrate
.. //depot/projects/linuxolator/src/sys/i386/i386/elan-mmcr.c#2 integrate
.. //depot/projects/linuxolator/src/sys/i386/i386/exception.s#2 integrate
.. //depot/projects/linuxolator/src/sys/i386/i386/genassym.c#4 integrate
.. //depot/projects/linuxolator/src/sys/i386/i386/local_apic.c#6 integrate
.. //depot/projects/linuxolator/src/sys/i386/i386/machdep.c#9 integrate
.. //depot/projects/linuxolator/src/sys/i386/i386/swtch.s#2 integrate
.. //depot/projects/linuxolator/src/sys/i386/i386/trap.c#3 integrate
.. //depot/projects/linuxolator/src/sys/i386/i386/vm86.c#3 integrate
.. //depot/projects/linuxolator/src/sys/i386/i386/vm86bios.s#2 integrate
.. //depot/projects/linuxolator/src/sys/i386/include/apicvar.h#4 integrate
.. //depot/projects/linuxolator/src/sys/i386/isa/atpic.c#3 integrate
.. //depot/projects/linuxolator/src/sys/i386/isa/atpic_vector.s#3 integrate
.. //depot/projects/linuxolator/src/sys/i386/isa/icu.h#2 integrate
.. //depot/projects/linuxolator/src/sys/ia64/ia64/machdep.c#6 integrate
.. //depot/projects/linuxolator/src/sys/kern/kern_clock.c#4 integrate
.. //depot/projects/linuxolator/src/sys/kern/kern_condvar.c#3 integrate
.. //depot/projects/linuxolator/src/sys/kern/kern_ktrace.c#4 integrate
.. //depot/projects/linuxolator/src/sys/kern/kern_mutex.c#4 integrate
.. //depot/projects/linuxolator/src/sys/kern/kern_synch.c#5 integrate
.. //depot/projects/linuxolator/src/sys/kern/kern_thread.c#4 integrate
.. //depot/projects/linuxolator/src/sys/kern/kern_umtx.c#10 integrate
.. //depot/projects/linuxolator/src/sys/kern/subr_sleepqueue.c#3 integrate
.. //depot/projects/linuxolator/src/sys/kern/sys_pipe.c#3 integrate
.. //depot/projects/linuxolator/src/sys/kern/sysv_ipc.c#3 integrate
.. //depot/projects/linuxolator/src/sys/kern/sysv_msg.c#8 integrate
.. //depot/projects/linuxolator/src/sys/kern/tty.c#9 integrate
.. //depot/projects/linuxolator/src/sys/kern/vfs_bio.c#6 integrate
.. //depot/projects/linuxolator/src/sys/kern/vfs_export.c#4 integrate
.. //depot/projects/linuxolator/src/sys/kern/vfs_mount.c#7 integrate
.. //depot/projects/linuxolator/src/sys/modules/Makefile#6 integrate
.. //depot/projects/linuxolator/src/sys/modules/acpi/Makefile#4 integrate
.. //depot/projects/linuxolator/src/sys/modules/acpi/acpi/Makefile#2 integrate
.. //depot/projects/linuxolator/src/sys/netinet6/in6.c#5 integrate
.. //depot/projects/linuxolator/src/sys/pci/if_rl.c#4 integrate
.. //depot/projects/linuxolator/src/sys/powerpc/powerpc/mmu_oea.c#5 integrate
.. //depot/projects/linuxolator/src/sys/sparc64/include/param.h#2 integrate
.. //depot/projects/linuxolator/src/sys/sparc64/sparc64/genassym.c#6 integrate
.. //depot/projects/linuxolator/src/sys/sun4v/include/cddl/mdesc.h#2 integrate
.. //depot/projects/linuxolator/src/sys/sun4v/include/pcpu.h#5 integrate
.. //depot/projects/linuxolator/src/sys/sun4v/include/trap.h#3 integrate
.. //depot/projects/linuxolator/src/sys/sun4v/mdesc/mdesc_vdevfindnode.c#1 branch
.. //depot/projects/linuxolator/src/sys/sun4v/sun4v/exception.S#6 integrate
.. //depot/projects/linuxolator/src/sys/sun4v/sun4v/interrupt.S#5 integrate
.. //depot/projects/linuxolator/src/sys/sun4v/sun4v/mp_machdep.c#4 integrate
.. //depot/projects/linuxolator/src/sys/sun4v/sun4v/pmap.c#9 integrate
.. //depot/projects/linuxolator/src/sys/sun4v/sun4v/tick.c#2 integrate
.. //depot/projects/linuxolator/src/sys/sun4v/sun4v/trap.c#7 integrate
.. //depot/projects/linuxolator/src/sys/sun4v/sun4v/tsb.c#5 integrate
.. //depot/projects/linuxolator/src/sys/sun4v/sun4v/tte_hash.c#5 integrate
.. //depot/projects/linuxolator/src/sys/sun4v/sun4v/vm_machdep.c#3 integrate
.. //depot/projects/linuxolator/src/sys/sun4v/sun4v/wbuf.S#3 integrate
.. //depot/projects/linuxolator/src/sys/sys/lock_profile.h#3 integrate
.. //depot/projects/linuxolator/src/sys/sys/mount.h#6 integrate
.. //depot/projects/linuxolator/src/sys/sys/mouse.h#2 integrate
.. //depot/projects/linuxolator/src/sys/sys/mutex.h#3 integrate
.. //depot/projects/linuxolator/src/sys/sys/pcpu.h#4 integrate
.. //depot/projects/linuxolator/src/sys/sys/proc.h#9 integrate
.. //depot/projects/linuxolator/src/sys/sys/sleepqueue.h#3 integrate
.. //depot/projects/linuxolator/src/sys/sys/syscallsubr.h#3 integrate
.. //depot/projects/linuxolator/src/sys/sys/sysent.h#3 integrate
.. //depot/projects/linuxolator/src/sys/sys/umtx.h#7 integrate
.. //depot/projects/linuxolator/src/sys/sys/watchdog.h#2 integrate
.. //depot/projects/linuxolator/src/sys/vm/vm_object.c#4 integrate

Differences ...

==== //depot/projects/linuxolator/src/sys/amd64/amd64/apic_vector.S#2 (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/linuxolator/src/sys/amd64/amd64/cpu_switch.S#2 (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/linuxolator/src/sys/amd64/amd64/exception.S#2 (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.128 2006/12/17 06:48:39 kmacy 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)

==== //depot/projects/linuxolator/src/sys/amd64/amd64/genassym.c#4 (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/linuxolator/src/sys/amd64/amd64/local_apic.c#6 (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/linuxolator/src/sys/amd64/amd64/machdep.c#11 (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/linuxolator/src/sys/amd64/amd64/trap.c#4 (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/linuxolator/src/sys/amd64/ia32/ia32_exception.S#2 (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/linuxolator/src/sys/amd64/ia32/ia32_syscall.c#2 (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/linuxolator/src/sys/amd64/include/apicvar.h#4 (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/linuxolator/src/sys/amd64/isa/atpic.c#3 (text+ko) ====

@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/isa/atpic.c,v 1.20 2006/10/10 23:23:11 jhb Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/isa/atpic.c,v 1.21 2006/12/17 06:48:40 kmacy Exp $");
 
 #include "opt_auto_eoi.h"
 #include "opt_isa.h"
@@ -494,7 +494,7 @@
 SYSINIT(atpic_init, SI_SUB_INTR, SI_ORDER_SECOND + 1, atpic_init, NULL)
 
 void
-atpic_handle_intr(u_int vector, struct trapframe frame)
+atpic_handle_intr(u_int vector, struct trapframe *frame)
 {
 	struct intsrc *isrc;
 
@@ -521,7 +521,7 @@
 		if ((isr & IRQ_MASK(7)) == 0)
 			return;
 	}
-	intr_execute_handlers(isrc, &frame);
+	intr_execute_handlers(isrc, frame);
 }
 
 #ifdef DEV_ISA

==== //depot/projects/linuxolator/src/sys/amd64/isa/atpic_vector.S#3 (text+ko) ====

@@ -28,7 +28,7 @@
  * SUCH DAMAGE.
  *
  *	from: vector.s, 386BSD 0.1 unknown origin
- * $FreeBSD: src/sys/amd64/isa/atpic_vector.S,v 1.47 2006/09/20 20:52:11 wkoszek Exp $
+ * $FreeBSD: src/sys/amd64/isa/atpic_vector.S,v 1.48 2006/12/17 06:48:40 kmacy Exp $
  */
 
 /*
@@ -49,6 +49,7 @@
 IDTVEC(vec_name) ;							\
 	PUSH_FRAME ;							\
 	FAKE_MCOUNT(TF_RIP(%rsp)) ;					\
+	movq	%rsp, %rsi	;                                       \
 	movl	$irq_num, %edi; 	/* pass the IRQ */		\
 	call	atpic_handle_intr ;					\
 	MEXITCOUNT ;							\

==== //depot/projects/linuxolator/src/sys/amd64/isa/icu.h#2 (text+ko) ====

@@ -30,7 +30,7 @@
  * SUCH DAMAGE.
  *
  *	from: @(#)icu.h	5.6 (Berkeley) 5/9/91
- * $FreeBSD: src/sys/amd64/isa/icu.h,v 1.35 2005/12/08 18:33:30 jhb Exp $
+ * $FreeBSD: src/sys/amd64/isa/icu.h,v 1.36 2006/12/17 21:51:44 kmacy Exp $
  */
 
 /*
@@ -43,7 +43,7 @@
 
 #define	ICU_IMR_OFFSET	1
 
-void	atpic_handle_intr(u_int vector, struct trapframe frame);
+void	atpic_handle_intr(u_int vector, struct trapframe *frame);
 void	atpic_startup(void);
 
 #endif /* !_AMD64_ISA_ICU_H_ */

==== //depot/projects/linuxolator/src/sys/arm/at91/at91_st.c#2 (text) ====

@@ -23,7 +23,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/arm/at91/at91_st.c,v 1.5 2006/08/09 20:58:55 imp Exp $");
+__FBSDID("$FreeBSD: src/sys/arm/at91/at91_st.c,v 1.6 2006/12/15 21:44:48 n_hibma Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -170,10 +170,15 @@
 	uint32_t wdog;
 	int t;
 
-	wdog = 0;
 	t = cmd & WD_INTERVAL;
-	if (cmd != 0 && t >= 22 && t <= 37)
+	if (cmd > 0 && t >= 22 && t <= 37) {
 		wdog = (1 << (t - 22)) | ST_WDMR_RSTEN;
+		*error = 0;
+	} else {
+		wdog = 0;
+		if (cmd > 0)
+			*error = EINVAL;
+	}
 	WR4(ST_WDMR, wdog);
 	WR4(ST_CR, ST_CR_WDRST);
 }

==== //depot/projects/linuxolator/src/sys/arm/xscale/i80321/i80321_wdog.c#2 (text+ko) ====

@@ -41,7 +41,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/arm/xscale/i80321/i80321_wdog.c,v 1.2 2005/01/15 18:38:10 cognet Exp $");
+__FBSDID("$FreeBSD: src/sys/arm/xscale/i80321/i80321_wdog.c,v 1.3 2006/12/15 21:44:48 n_hibma Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -62,7 +62,6 @@
 	device_t dev;
 	int armed;
 	int wdog_period;
-	struct callout_handle wdog_callout;
 };
 
 static __inline void
@@ -83,8 +82,6 @@
 		return;
 	wdtcr_write(WDTCR_ENABLE1);
 	wdtcr_write(WDTCR_ENABLE2);
-	sc->wdog_callout = timeout(iopwdog_tickle, sc,
-	    hz * (sc->wdog_period - 1));
 }
 
 static int
@@ -112,14 +109,21 @@
 {
 	struct iopwdog_softc *sc = private;
 
-	if (cmd == 0)
-		return;
-	if ((((uint64_t)1 << (cmd & WD_INTERVAL))) >
-	    (uint64_t)sc->wdog_period * 1000000000)
-		return;
-	sc->armed = 1;
-	iopwdog_tickle(sc);
-	*error = 0;
+	cmd &= WD_INTERVAL;
+	if (cmd > 0 && cmd <= 63
+	    && (uint64_t)1 << (cmd & WD_INTERVAL) <=
+	       (uint64_t)sc->wdog_period * 1000000000) {
+		/* Valid value -> Enable watchdog */
+		iopwdog_tickle(sc);
+		sc->armed = 1;
+		*error = 0;
+	} else {
+		/* XXX Can't disable this watchdog? */
+		if (sc->armed)
+			*error = EOPNOTSUPP;
+		else if (cmd > 0)
+			*error = EINVAL;
+	}
 }
 
 static int

==== //depot/projects/linuxolator/src/sys/boot/arm/at91/Makefile.inc#4 (text) ====


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


More information about the p4-projects mailing list