PERFORCE change 31168 for review

John Baldwin jhb at FreeBSD.org
Wed May 14 09:50:50 PDT 2003


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

Change 31168 by jhb at jhb_laptop on 2003/05/14 09:50:05

	IFC @31165.

Affected files ...

.. //depot/projects/smpng/sys/amd64/amd64/cpu_switch.S#3 integrate
.. //depot/projects/smpng/sys/amd64/amd64/exception.S#4 integrate
.. //depot/projects/smpng/sys/amd64/amd64/genassym.c#3 integrate
.. //depot/projects/smpng/sys/amd64/amd64/machdep.c#5 integrate
.. //depot/projects/smpng/sys/amd64/amd64/support.S#3 integrate
.. //depot/projects/smpng/sys/amd64/amd64/trap.c#4 integrate
.. //depot/projects/smpng/sys/amd64/amd64/vm_machdep.c#2 integrate
.. //depot/projects/smpng/sys/amd64/conf/GENERIC#3 integrate
.. //depot/projects/smpng/sys/amd64/ia32/Makefile#1 branch
.. //depot/projects/smpng/sys/amd64/ia32/ia32.h#1 branch
.. //depot/projects/smpng/sys/amd64/ia32/ia32_exception.S#1 branch
.. //depot/projects/smpng/sys/amd64/ia32/ia32_genassym.c#1 branch
.. //depot/projects/smpng/sys/amd64/ia32/ia32_misc.c#1 branch
.. //depot/projects/smpng/sys/amd64/ia32/ia32_proto.h#1 branch
.. //depot/projects/smpng/sys/amd64/ia32/ia32_signal.c#1 branch
.. //depot/projects/smpng/sys/amd64/ia32/ia32_signal.h#1 branch
.. //depot/projects/smpng/sys/amd64/ia32/ia32_sigtramp.S#1 branch
.. //depot/projects/smpng/sys/amd64/ia32/ia32_syscall.c#1 branch
.. //depot/projects/smpng/sys/amd64/ia32/ia32_syscall.h#1 branch
.. //depot/projects/smpng/sys/amd64/ia32/ia32_sysent.c#1 branch
.. //depot/projects/smpng/sys/amd64/ia32/ia32_sysvec.c#1 branch
.. //depot/projects/smpng/sys/amd64/ia32/ia32_util.h#1 branch
.. //depot/projects/smpng/sys/amd64/ia32/syscalls.conf#1 branch
.. //depot/projects/smpng/sys/amd64/ia32/syscalls.master#1 branch
.. //depot/projects/smpng/sys/amd64/include/cpufunc.h#2 integrate
.. //depot/projects/smpng/sys/amd64/include/elf.h#2 integrate
.. //depot/projects/smpng/sys/amd64/include/md_var.h#3 integrate
.. //depot/projects/smpng/sys/amd64/include/pcb.h#3 integrate
.. //depot/projects/smpng/sys/amd64/include/segments.h#2 integrate
.. //depot/projects/smpng/sys/conf/files.amd64#2 integrate
.. //depot/projects/smpng/sys/conf/options.amd64#2 integrate
.. //depot/projects/smpng/sys/dev/ata/atapi-cam.c#8 integrate
.. //depot/projects/smpng/sys/dev/puc/pucdata.c#14 integrate
.. //depot/projects/smpng/sys/kern/tty.c#35 integrate
.. //depot/projects/smpng/sys/sys/signalvar.h#17 integrate

Differences ...

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

@@ -33,7 +33,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.139 2003/05/12 02:37:28 peter Exp $
+ * $FreeBSD: src/sys/amd64/amd64/cpu_switch.S,v 1.140 2003/05/14 04:10:47 peter Exp $
  */
 
 #include <machine/asmacros.h>
@@ -106,6 +106,12 @@
 	pushfq					/* PSL */
 	popq	PCB_RFLAGS(%r8)
 
+	/* Save kernel %gs.base */
+	movl	$MSR_GSBASE,%ecx
+	rdmsr
+	movl	%eax,PCB_KGSBASE(%r8)
+	movl	%edx,PCB_KGSBASE+4(%r8)
+
 	/* Save userland %fs */
 	movl	$MSR_FSBASE,%ecx
 	rdmsr
@@ -118,6 +124,12 @@
 	movl	%eax,PCB_GSBASE(%r8)
 	movl	%edx,PCB_GSBASE+4(%r8)
 
+	/* Save segment selector numbers */
+	movl	%ds,PCB_DS(%r8)
+	movl	%es,PCB_ES(%r8)
+	movl	%fs,PCB_FS(%r8)
+	movl	%gs,PCB_GS(%r8)
+
 	/* have we used fp, and need a save? */
 	cmpq	%rdi,PCPU(FPCURTHREAD)
 	jne	1f
@@ -160,6 +172,18 @@
 	 */
 	movq	TD_PCB(%rsi),%r8
 
+	/* Restore segment selector numbers */
+	movl	PCB_DS(%r8),%ds
+	movl	PCB_ES(%r8),%es
+	movl	PCB_FS(%r8),%fs
+	movl	PCB_GS(%r8),%gs
+
+	/* Restore kernel %gs.base */
+	movl	$MSR_GSBASE,%ecx
+	movl	PCB_KGSBASE(%r8),%eax
+	movl	PCB_KGSBASE+4(%r8),%edx
+	wrmsr
+
 	/* Restore userland %fs */
 	movl	$MSR_FSBASE,%ecx
 	movl	PCB_FSBASE(%r8),%eax

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

@@ -31,7 +31,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.109 2003/05/12 18:33:19 peter Exp $
+ * $FreeBSD: src/sys/amd64/amd64/exception.S,v 1.110 2003/05/14 04:10:47 peter Exp $
  */
 
 #include <machine/asmacros.h>
@@ -218,40 +218,6 @@
 	jmp	alltraps_pushregs_no_rdi
 
 /*
- * Call gate entry for FreeBSD ELF and Linux/NetBSD syscall (int 0x80)
- *
- * This is a SDT_SYSIDT entry point (unlike the i386 port) so that we
- * can do a swapgs before enabling interrupts.  This is critical because
- * if we took an interrupt before swapgs, the interrupt code would see
- * that it originated in supervisor mode and skip the swapgs.
- */
-	SUPERALIGN_TEXT
-IDTVEC(int0x80_syscall)
-	swapgs
-	sti
-	pushq	$2			/* sizeof "int 0x80" */
-	subq	$TF_ERR,%rsp		/* skip over tf_trapno */
-	movq	%rdi,TF_RDI(%rsp)
-	movq	%rsi,TF_RSI(%rsp)
-	movq	%rdx,TF_RDX(%rsp)
-	movq	%rcx,TF_RCX(%rsp)
-	movq	%r8,TF_R8(%rsp)
-	movq	%r9,TF_R9(%rsp)
-	movq	%rax,TF_RAX(%rsp)
-	movq	%rbx,TF_RBX(%rsp)
-	movq	%rbp,TF_RBP(%rsp)
-	movq	%r10,TF_R10(%rsp)
-	movq	%r11,TF_R11(%rsp)
-	movq	%r12,TF_R12(%rsp)
-	movq	%r13,TF_R13(%rsp)
-	movq	%r14,TF_R14(%rsp)
-	movq	%r15,TF_R15(%rsp)
-	FAKE_MCOUNT(13*4(%rsp))
-	call	syscall
-	MEXITCOUNT
-	jmp	doreti
-
-/*
  * Fast syscall entry point.  We enter here with just our new %cs/%ss set,
  * and the new privilige level.  We are still running on the old user stack
  * pointer.  We have to juggle a few things around to find our stack etc.
@@ -353,6 +319,7 @@
  */
 	.text
 	SUPERALIGN_TEXT
+	.globl	doreti
 	.type	doreti, at function
 doreti:
 	FAKE_MCOUNT(bintr)		/* init "from" bintr -> doreti */

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

@@ -34,7 +34,7 @@
  * SUCH DAMAGE.
  *
  *	from: @(#)genassym.c	5.11 (Berkeley) 5/10/91
- * $FreeBSD: src/sys/amd64/amd64/genassym.c,v 1.144 2003/05/12 18:33:19 peter Exp $
+ * $FreeBSD: src/sys/amd64/amd64/genassym.c,v 1.145 2003/05/14 04:10:48 peter Exp $
  */
 
 #include "opt_compat.h"
@@ -125,6 +125,11 @@
 ASSYM(PCB_RFLAGS, offsetof(struct pcb, pcb_rflags));
 ASSYM(PCB_FSBASE, offsetof(struct pcb, pcb_fsbase));
 ASSYM(PCB_GSBASE, offsetof(struct pcb, pcb_gsbase));
+ASSYM(PCB_KGSBASE, offsetof(struct pcb, pcb_kgsbase));
+ASSYM(PCB_DS, offsetof(struct pcb, pcb_ds));
+ASSYM(PCB_ES, offsetof(struct pcb, pcb_es));
+ASSYM(PCB_FS, offsetof(struct pcb, pcb_fs));
+ASSYM(PCB_GS, offsetof(struct pcb, pcb_gs));
 
 ASSYM(PCB_FLAGS, offsetof(struct pcb, pcb_flags));
 ASSYM(PCB_FULLCTX, PCB_FULLCTX);
@@ -181,8 +186,10 @@
 ASSYM(KDSEL, GSEL(GDATA_SEL, SEL_KPL));
 ASSYM(KUCSEL, GSEL(GUCODE_SEL, SEL_UPL));
 ASSYM(KUDSEL, GSEL(GUDATA_SEL, SEL_UPL));
+ASSYM(KUC32SEL, GSEL(GUCODE32_SEL, SEL_UPL));
 
 ASSYM(MSR_FSBASE, MSR_FSBASE);
+ASSYM(MSR_GSBASE, MSR_GSBASE);
 ASSYM(MSR_KGSBASE, MSR_KGSBASE);
 ASSYM(GPROC0_SEL, GPROC0_SEL);
 

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

@@ -35,7 +35,7 @@
  * SUCH DAMAGE.
  *
  *	from: @(#)machdep.c	7.4 (Berkeley) 6/3/91
- * $FreeBSD: src/sys/amd64/amd64/machdep.c,v 1.576 2003/05/13 20:35:57 jhb Exp $
+ * $FreeBSD: src/sys/amd64/amd64/machdep.c,v 1.577 2003/05/14 04:10:48 peter Exp $
  */
 
 #include "opt_atalk.h"
@@ -124,12 +124,11 @@
 #define	EFL_SECURE(ef, oef)	((((ef) ^ (oef)) & ~PSL_USERCHANGE) == 0)
 
 static void cpu_startup(void *);
-static void fpstate_drop(struct thread *td);
 static void get_fpcontext(struct thread *td, mcontext_t *mcp);
 static int  set_fpcontext(struct thread *td, const mcontext_t *mcp);
 SYSINIT(cpu, SI_SUB_CPU, SI_ORDER_FIRST, cpu_startup, NULL)
 
-int	_udatasel, _ucodesel;
+int	_udatasel, _ucodesel, _ucode32sel;
 u_long	atdevbase;
 
 u_int64_t	modulep;	/* phys addr of metadata table */
@@ -390,6 +389,16 @@
 	return (EJUSTRETURN);
 }
 
+#ifdef COMPAT_FREEBSD4
+int
+freebsd4_sigreturn(struct thread *td, struct freebsd4_sigreturn_args *uap)
+{
+ 
+	return sigreturn(td, (struct sigreturn_args *)uap);
+}
+#endif
+
+
 /*
  * Machine dependent boot() routine
  *
@@ -467,11 +476,25 @@
 {
 	struct trapframe *regs = td->td_frame;
 	struct pcb *pcb = td->td_pcb;
+	u_int64_t pc;
 	
+	wrmsr(MSR_FSBASE, 0);
+	wrmsr(MSR_KGSBASE, 0);	/* User value while we're in the kernel */
 	pcb->pcb_fsbase = 0;
 	pcb->pcb_gsbase = 0;
-	wrmsr(MSR_FSBASE, 0);
-	wrmsr(MSR_KGSBASE, 0);	/* User value while we're in the kernel */
+	pcb->pcb_kgsbase = rdmsr(MSR_GSBASE);
+	load_ds(_udatasel);
+	load_es(_udatasel);
+	load_fs(_udatasel);
+	critical_enter();
+	pc = rdmsr(MSR_GSBASE);
+	load_gs(_udatasel);	/* Clobbers kernel %GS.base */
+	wrmsr(MSR_GSBASE, pc);
+	critical_exit();
+	pcb->pcb_ds = _udatasel;
+	pcb->pcb_es = _udatasel;
+	pcb->pcb_fs = _udatasel;
+	pcb->pcb_gs = _udatasel;
 
 	bzero((char *)regs, sizeof(struct trapframe));
 	regs->tf_rip = entry;
@@ -590,7 +613,7 @@
 	0xfffff,		/* length - all address space */
 	SDT_MEMERA,		/* segment type */
 	SEL_UPL,		/* segment descriptor priority level */
-	0,			/* segment descriptor present */
+	1,			/* segment descriptor present */
 	0,			/* long */
 	1,			/* default 32 vs 16 bit size */
 	1  			/* limit granularity (byte/page units)*/ },
@@ -661,7 +684,7 @@
 	IDTVEC(bnd), IDTVEC(ill), IDTVEC(dna), IDTVEC(fpusegm),
 	IDTVEC(tss), IDTVEC(missing), IDTVEC(stk), IDTVEC(prot),
 	IDTVEC(page), IDTVEC(mchk), IDTVEC(rsvd), IDTVEC(fpu), IDTVEC(align),
-	IDTVEC(xmm), IDTVEC(dblfault), IDTVEC(int0x80_syscall),
+	IDTVEC(xmm), IDTVEC(dblfault),
 	IDTVEC(fast_syscall), IDTVEC(fast_syscall32);
 
 void
@@ -1232,7 +1255,6 @@
 	setidt(17, &IDTVEC(align), SDT_SYSIGT, SEL_KPL, 0);
 	setidt(18, &IDTVEC(mchk),  SDT_SYSIGT, SEL_KPL, 0);
 	setidt(19, &IDTVEC(xmm), SDT_SYSIGT, SEL_KPL, 0);
- 	setidt(0x80, &IDTVEC(int0x80_syscall), SDT_SYSIGT, SEL_UPL, 0);
 
 	r_idt.rd_limit = sizeof(idt0) - 1;
 	r_idt.rd_base = (long) idt;
@@ -1290,10 +1312,12 @@
 
 	_ucodesel = GSEL(GUCODE_SEL, SEL_UPL);
 	_udatasel = GSEL(GUDATA_SEL, SEL_UPL);
+	_ucode32sel = GSEL(GUCODE32_SEL, SEL_UPL);
 
 	/* setup proc 0's pcb */
 	thread0.td_pcb->pcb_flags = 0; /* XXXKSE */
 	thread0.td_pcb->pcb_cr3 = IdlePML4;
+	thread0.td_pcb->pcb_kgsbase = (u_int64_t)pc;
 	thread0.td_frame = &proc0_tf;
 }
 
@@ -1613,7 +1637,7 @@
 	return (0);
 }
 
-static void
+void
 fpstate_drop(struct thread *td)
 {
 	register_t s;

==== //depot/projects/smpng/sys/amd64/amd64/support.S#3 (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/support.S,v 1.99 2003/05/11 22:38:54 peter Exp $
+ * $FreeBSD: src/sys/amd64/amd64/support.S,v 1.100 2003/05/14 03:38:13 peter Exp $
  */
 
 #include <machine/asmacros.h>
@@ -358,6 +358,9 @@
 	movq	$0,PCB_ONFAULT(%rcx)
 	ret
 
+ENTRY(fuword)
+	jmp	fuword64
+
 ENTRY(fuword32)
 	movq	PCPU(CURPCB),%rcx
 	movq	$fusufault,PCB_ONFAULT(%rcx)
@@ -366,15 +369,10 @@
 	cmpq	%rax,%rdi			/* verify address is valid */
 	ja	fusufault
 
-/* XXX use the 64 extend */
-	xorq	%rax, %rax
 	movl	(%rdi),%eax
 	movq	$0,PCB_ONFAULT(%rcx)
 	ret
 
-ENTRY(fuword)
-	jmp	fuword32
-
 /*
  * These two routines are called from the profiling code, potentially
  * at interrupt time. If they fail, that's okay, good things will
@@ -397,8 +395,6 @@
 	cmpq	%rax,%rdi
 	ja	fusufault
 
-/* XXX use the 64 extend */
-	xorq	%rax, %rax
 	movzwl	(%rdi),%eax
 	movq	$0,PCB_ONFAULT(%rcx)
 	ret
@@ -414,8 +410,6 @@
 	cmpq	%rax,%rdi
 	ja	fusufault
 
-/* XXX use the 64 extend */
-	xorq	%rax, %rax
 	movzbl	(%rdi),%eax
 	movq	$0,PCB_ONFAULT(%rcx)
 	ret
@@ -448,6 +442,9 @@
 	movq	%rax,PCB_ONFAULT(%rcx)
 	ret
 
+ENTRY(suword)
+	jmp	suword64
+
 ENTRY(suword32)
 	movq	PCPU(CURPCB),%rcx
 	movq	$fusufault,PCB_ONFAULT(%rcx)
@@ -462,9 +459,6 @@
 	movq	%rax,PCB_ONFAULT(%rcx)
 	ret
 
-ENTRY(suword)
-	jmp	suword32
-
 /*
  * suword16 - MP SAFE
  */

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

@@ -35,7 +35,7 @@
  * SUCH DAMAGE.
  *
  *	from: @(#)trap.c	7.4 (Berkeley) 5/13/91
- * $FreeBSD: src/sys/amd64/amd64/trap.c,v 1.256 2003/05/12 18:33:19 peter Exp $
+ * $FreeBSD: src/sys/amd64/amd64/trap.c,v 1.257 2003/05/14 04:10:48 peter Exp $
  */
 
 /*
@@ -91,7 +91,7 @@
 extern void trap(struct trapframe frame);
 extern void syscall(struct trapframe frame);
 
-static int trap_pfault(struct trapframe *, int, vm_offset_t);
+static int trap_pfault(struct trapframe *, int);
 static void trap_fatal(struct trapframe *, vm_offset_t);
 void dblfault_handler(void);
 
@@ -161,13 +161,13 @@
 	struct proc *p = td->td_proc;
 	u_int sticks = 0;
 	int i = 0, ucode = 0, type, code;
-	vm_offset_t eva;
 
 	atomic_add_int(&cnt.v_trap, 1);
 	type = frame.tf_trapno;
 
 #ifdef DDB
 	if (db_active) {
+		vm_offset_t eva;
 		eva = (type == T_PAGEFLT ? frame.tf_addr : 0);
 		trap_fatal(&frame, eva);
 		goto out;
@@ -202,7 +202,6 @@
 		}
 	}
 
-	eva = 0;
 	code = frame.tf_err;
 	if (type == T_PAGEFLT) {
 		/*
@@ -213,9 +212,8 @@
 		 * kernel can print out a useful trap message and even get
 		 * to the debugger.
 		 */
-		eva = frame.tf_addr;
 		if (PCPU_GET(spinlocks) != NULL)
-			trap_fatal(&frame, eva);
+			trap_fatal(&frame, frame.tf_addr);
 	}
 
 #ifdef	DEVICE_POLLING
@@ -261,7 +259,7 @@
 			break;
 
 		case T_PAGEFLT:		/* page fault */
-			i = trap_pfault(&frame, TRUE, eva);
+			i = trap_pfault(&frame, TRUE);
 			if (i == -1)
 				goto userout;
 			if (i == 0)
@@ -331,7 +329,7 @@
 		    ("kernel trap doesn't have ucred"));
 		switch (type) {
 		case T_PAGEFLT:			/* page fault */
-			(void) trap_pfault(&frame, FALSE, eva);
+			(void) trap_pfault(&frame, FALSE);
 			goto out;
 
 		case T_DNA:
@@ -430,7 +428,7 @@
 #endif /* DEV_ISA */
 		}
 
-		trap_fatal(&frame, eva);
+		trap_fatal(&frame, 0);
 		goto out;
 	}
 
@@ -445,7 +443,7 @@
 		uprintf("fatal process exception: %s",
 			trap_msg[type]);
 		if ((type == T_PAGEFLT) || (type == T_PROTFLT))
-			uprintf(", fault VA = 0x%lx", eva);
+			uprintf(", fault VA = 0x%lx", frame.tf_addr);
 		uprintf("\n");
 	}
 #endif
@@ -462,10 +460,9 @@
 }
 
 static int
-trap_pfault(frame, usermode, eva)
+trap_pfault(frame, usermode)
 	struct trapframe *frame;
 	int usermode;
-	vm_offset_t eva;
 {
 	vm_offset_t va;
 	struct vmspace *vm = NULL;
@@ -474,6 +471,7 @@
 	vm_prot_t ftype;
 	struct thread *td = curthread;
 	struct proc *p = td->td_proc;
+	vm_offset_t eva = frame->tf_addr;
 
 	va = trunc_page(eva);
 	if (va >= KERNBASE) {
@@ -813,4 +811,3 @@
 	mtx_assert(&sched_lock, MA_NOTOWNED);
 	mtx_assert(&Giant, MA_NOTOWNED);
 }
-

==== //depot/projects/smpng/sys/amd64/amd64/vm_machdep.c#2 (text+ko) ====

@@ -38,7 +38,7 @@
  *
  *	from: @(#)vm_machdep.c	7.3 (Berkeley) 5/13/91
  *	Utah $Hdr: vm_machdep.c 1.16.1.1 89/06/23$
- * $FreeBSD: src/sys/amd64/amd64/vm_machdep.c,v 1.207 2003/05/01 01:05:22 peter Exp $
+ * $FreeBSD: src/sys/amd64/amd64/vm_machdep.c,v 1.208 2003/05/14 04:10:48 peter Exp $
  */
 
 #include "opt_isa.h"
@@ -76,7 +76,6 @@
 #include <amd64/isa/isa.h>
 
 static void	cpu_reset_real(void);
-extern int	_ucodesel, _udatasel;
 
 /*
  * Finish a fork operation, with process p2 nearly set up.
@@ -143,6 +142,7 @@
 	 * pcb2->pcb_savefpu:	cloned above.
 	 * pcb2->pcb_flags:	cloned above.
 	 * pcb2->pcb_onfault:	cloned above (always NULL here?).
+	 * pcb2->pcb_[fg]sbase:	cloned above
 	 */
 
 	/*

==== //depot/projects/smpng/sys/amd64/conf/GENERIC#3 (text+ko) ====

@@ -16,12 +16,14 @@
 # If you are in doubt as to the purpose or necessity of a line, check first 
 # in NOTES.
 #
-# $FreeBSD: src/sys/amd64/conf/GENERIC,v 1.384 2003/05/09 18:26:06 peter Exp $
+# $FreeBSD: src/sys/amd64/conf/GENERIC,v 1.385 2003/05/14 04:10:48 peter Exp $
 
 machine		amd64
 cpu		HAMMER
 ident		GENERIC
 maxusers	0
+options 	IA32
+options 	COMPAT_FREEBSD4
 
 makeoptions	NO_MODULES=not_yet
 
@@ -41,6 +43,10 @@
 options 	INVARIANTS		#Enable calls of extra sanity checking
 options 	INVARIANT_SUPPORT	#Extra sanity checks of internal structures, required by INVARIANTS
 
+options 	SYSVMSG
+options 	SYSVSEM
+options 	SYSVSHM
+
 device		isa
 device		pci
 

==== //depot/projects/smpng/sys/amd64/include/cpufunc.h#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/include/cpufunc.h,v 1.134 2003/05/01 01:05:23 peter Exp $
+ * $FreeBSD: src/sys/amd64/include/cpufunc.h,v 1.135 2003/05/14 04:10:49 peter Exp $
  */
 
 /*
@@ -447,7 +447,6 @@
 	__asm __volatile("invlpg %0" : : "m" (*(char *)addr) : "memory");
 }
 
-/* XXX these are replaced with rdmsr/wrmsr */
 static __inline u_int
 rfs(void)
 {
@@ -465,6 +464,18 @@
 }
 
 static __inline void
+load_ds(u_int sel)
+{
+	__asm __volatile("movl %0,%%ds" : : "rm" (sel));
+}
+
+static __inline void
+load_es(u_int sel)
+{
+	__asm __volatile("movl %0,%%es" : : "rm" (sel));
+}
+
+static __inline void
 load_fs(u_int sel)
 {
 	__asm __volatile("movl %0,%%fs" : : "rm" (sel));

==== //depot/projects/smpng/sys/amd64/include/elf.h#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/include/elf.h,v 1.14 2003/05/01 01:05:23 peter Exp $
+ * $FreeBSD: src/sys/amd64/include/elf.h,v 1.15 2003/05/14 04:10:49 peter Exp $
  */
 
 #ifndef _MACHINE_ELF_H_
@@ -33,9 +33,12 @@
  * ELF definitions for the AMD64 architecture.
  */
 
-#include <sys/elf64.h>	/* Definitions common to all 64 bit architectures. */
 
+#ifndef __ELF_WORD_SIZE
 #define	__ELF_WORD_SIZE	64	/* Used by <sys/elf_generic.h> */
+#endif
+#include <sys/elf32.h>	/* Definitions common to all 32 bit architectures. */
+#include <sys/elf64.h>	/* Definitions common to all 64 bit architectures. */
 #include <sys/elf_generic.h>
 
 #define	ELF_ARCH	EM_X86_64
@@ -48,7 +51,14 @@
  * The i386 supplement to the SVR4 ABI specification names this "auxv_t",
  * but POSIX lays claim to all symbols ending with "_t".
  */
+typedef struct {	/* Auxiliary vector entry on initial stack */
+	int	a_type;			/* Entry type. */
+	union {
+		int	a_val;		/* Integer value. */
+	} a_un;
+} Elf32_Auxinfo;
 
+
 typedef struct {	/* Auxiliary vector entry on initial stack */
 	long	a_type;			/* Entry type. */
 	union {
@@ -118,7 +128,11 @@
 #define	R_X86_64_COUNT	16	/* Count of defined relocation types. */
 
 /* Define "machine" characteristics */
-#define	ELF_TARG_CLASS	ELFCLASS64
+#if __ELF_WORD_SIZE == 32
+#define ELF_TARG_CLASS  ELFCLASS32
+#else
+#define ELF_TARG_CLASS  ELFCLASS64
+#endif
 #define	ELF_TARG_DATA	ELFDATA2LSB
 #define	ELF_TARG_MACH	EM_X86_64
 #define	ELF_TARG_VER	1

==== //depot/projects/smpng/sys/amd64/include/md_var.h#3 (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/md_var.h,v 1.65 2003/05/11 22:53:43 peter Exp $
+ * $FreeBSD: src/sys/amd64/include/md_var.h,v 1.66 2003/05/14 04:10:49 peter Exp $
  */
 
 #ifndef _MACHINE_MD_VAR_H_
@@ -69,5 +69,6 @@
 int	is_physical_memory(vm_offset_t addr);
 void	setidt(int idx, alias_for_inthand_t *func, int typ, int dpl, int ist);
 void	swi_vm(void *);
+void	fpstate_drop(struct thread *td);
 
 #endif /* !_MACHINE_MD_VAR_H_ */

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

@@ -34,7 +34,7 @@
  * SUCH DAMAGE.
  *
  *	from: @(#)pcb.h	5.10 (Berkeley) 5/12/91
- * $FreeBSD: src/sys/amd64/include/pcb.h,v 1.51 2003/05/12 02:37:29 peter Exp $
+ * $FreeBSD: src/sys/amd64/include/pcb.h,v 1.52 2003/05/14 04:10:49 peter Exp $
  */
 
 #ifndef _I386_PCB_H_
@@ -59,6 +59,11 @@
 	register_t	pcb_rflags;
 	register_t	pcb_fsbase;
 	register_t	pcb_gsbase;
+	register_t	pcb_kgsbase;
+	u_int32_t	pcb_ds;
+	u_int32_t	pcb_es;
+	u_int32_t	pcb_fs;
+	u_int32_t	pcb_gs;
 
 	struct	savefpu	pcb_save;
 	u_long	pcb_flags;

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

@@ -35,7 +35,7 @@
  * SUCH DAMAGE.
  *
  *	from: @(#)segments.h	7.1 (Berkeley) 5/9/91
- * $FreeBSD: src/sys/amd64/include/segments.h,v 1.34 2003/05/01 01:05:23 peter Exp $
+ * $FreeBSD: src/sys/amd64/include/segments.h,v 1.35 2003/05/14 04:10:49 peter Exp $
  */
 
 #ifndef _MACHINE_SEGMENTS_H_
@@ -166,7 +166,7 @@
 /*
  * Size of IDT table
  */
-#define	NIDT	129		/* 32 reserved, 16 h/w, 0 s/w, linux's 0x80 */
+#define	NIDT	256		/* 32 reserved, 16 h/w, 0 s/w, linux's 0x80 */
 #define	NRSVIDT	32		/* reserved entries for cpu exceptions */
 
 /*

==== //depot/projects/smpng/sys/conf/files.amd64#2 (text+ko) ====

@@ -1,13 +1,26 @@
 # This file tells config what files go into building a kernel,
 # files marked standard are always included.
 #
-# $FreeBSD: src/sys/conf/files.amd64,v 1.13 2003/05/03 03:30:29 peter Exp $
+# $FreeBSD: src/sys/conf/files.amd64,v 1.14 2003/05/14 04:10:49 peter Exp $
 #
 # The long compile-with and dependency lines are required because of
 # limitations in config: backslash-newline doesn't work in strings, and
 # dependency lines other than the first are silently ignored.
 #
 
+ia32_genassym.o			optional	ia32			\
+	dependency 	"$S/amd64/ia32/ia32_genassym.c"			\
+	compile-with	"${CC} ${CFLAGS:N-fno-common} -c ${.IMPSRC}"	\
+	no-obj no-implicit-rule						\
+	clean		"ia32_genassym.o"
+#
+ia32_assym.h			optional	ia32			\
+	dependency 	"$S/kern/genassym.sh ia32_genassym.o"		\
+	compile-with	"sh $S/kern/genassym.sh ia32_genassym.o > ${.TARGET}" \
+	no-obj no-implicit-rule before-depend				\
+	clean		"ia32_assym.h"
+#
+
 dev/kbd/atkbd.c			optional	atkbd
 dev/kbd/atkbdc.c		optional	atkbdc
 dev/kbd/kbd.c			optional	atkbd
@@ -64,7 +77,14 @@
 amd64/pci/pci_cfgreg.c		optional	pci
 amd64/pci/pci_bus.c		optional	pci
 
-
+amd64/ia32/ia32_misc.c		optional	ia32
+amd64/ia32/ia32_sysent.c	optional	ia32
+amd64/ia32/ia32_sysvec.c	optional	ia32
+amd64/ia32/ia32_signal.c	optional	ia32
+amd64/ia32/ia32_sigtramp.S	optional	ia32
+amd64/ia32/ia32_exception.S	optional	ia32
+amd64/ia32/ia32_syscall.c	optional	ia32
+kern/imgact_elf32.c		optional	ia32
 
 # This file tells config what files go into building a kernel,
 # files marked standard are always included.

==== //depot/projects/smpng/sys/conf/options.amd64#2 (text+ko) ====

@@ -1,4 +1,4 @@
-# $FreeBSD: src/sys/conf/options.amd64,v 1.6 2003/05/01 02:59:24 peter Exp $
+# $FreeBSD: src/sys/conf/options.amd64,v 1.7 2003/05/14 04:10:49 peter Exp $
 # Options specific to the AMD x86-64 platform kernels
 
 MAXMEM
@@ -59,3 +59,4 @@
 PSM_HOOKRESUME		opt_psm.h
 PSM_RESETAFTERSUSPEND	opt_psm.h
 PSM_DEBUG		opt_psm.h
+IA32

==== //depot/projects/smpng/sys/dev/ata/atapi-cam.c#8 (text+ko) ====

@@ -25,7 +25,7 @@
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  *
- * $FreeBSD: src/sys/dev/ata/atapi-cam.c,v 1.15 2003/03/08 08:01:28 phk Exp $
+ * $FreeBSD: src/sys/dev/ata/atapi-cam.c,v 1.16 2003/05/14 14:20:22 thomas Exp $
  */
 
 #include <sys/param.h>
@@ -167,7 +167,14 @@
 void
 atapi_cam_reinit_bus(struct ata_channel *ata_ch) {
     struct atapi_xpt_softc *scp = get_softc(ata_ch);
-    reinit_bus(scp, RESET);
+
+    /*
+     * scp might be null if the bus is being reinitialised during
+     * the boot-up sequence, before the ATAPI bus is registered.
+     */
+
+    if (scp != NULL)
+	reinit_bus(scp, RESET);
 }
 
 static void

==== //depot/projects/smpng/sys/dev/puc/pucdata.c#14 (text+ko) ====

@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/puc/pucdata.c,v 1.20 2003/04/30 22:15:47 sobomax Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/puc/pucdata.c,v 1.21 2003/05/14 09:37:46 wilko Exp $");
 
 /*
  * PCI "universal" communications card driver configuration data (used to
@@ -891,6 +891,19 @@
 	    },
 	},
 
+	/* NetMos 4S0P PCI: 4S, 0P */
+	{   "NetMos NM9845 Quad UART",
+	    NULL,
+	    {	0x9710,	0x9845,	0,	0	},
+	    {	0xffff,	0xffff,	0,	0	},
+	    {
+		{ PUC_PORT_TYPE_COM, 0x10, 0x00, COM_FREQ },
+		{ PUC_PORT_TYPE_COM, 0x14, 0x00, COM_FREQ },
+		{ PUC_PORT_TYPE_COM, 0x18, 0x00, COM_FREQ },
+		{ PUC_PORT_TYPE_COM, 0x1c, 0x00, COM_FREQ },
+	    },
+	},
+
 	/*
 	 * This is the Middle Digital, Inc. PCI-Weasel, which
 	 * uses a PCI interface implemented in FPGA.

==== //depot/projects/smpng/sys/kern/tty.c#35 (text+ko) ====

@@ -44,7 +44,7 @@
  * SUCH DAMAGE.
  *
  *	@(#)tty.c	8.8 (Berkeley) 1/21/94
- * $FreeBSD: src/sys/kern/tty.c,v 1.200 2003/05/13 20:35:59 jhb Exp $
+ * $FreeBSD: src/sys/kern/tty.c,v 1.201 2003/05/14 00:03:55 ps Exp $
  */
 
 /*-
@@ -1601,7 +1601,7 @@
 		splx(s);
 		sx_slock(&proctree_lock);
 		PROC_LOCK(p);
-		if (SIGISMEMBER(p->p_sigignore, SIGTTIN) ||
+		if (SIGISMEMBER(p->p_sigacts->ps_sigignore, SIGTTIN) ||
 		    SIGISMEMBER(td->td_sigmask, SIGTTIN) ||
 		    (p->p_flag & P_PPWAIT) || p->p_pgrp->pg_jobc == 0) {
 			PROC_UNLOCK(p);

==== //depot/projects/smpng/sys/sys/signalvar.h#17 (text+ko) ====

@@ -31,12 +31,13 @@
  * SUCH DAMAGE.
  *
  *	@(#)signalvar.h	8.6 (Berkeley) 2/19/95
- * $FreeBSD: src/sys/sys/signalvar.h,v 1.61 2003/05/13 20:36:02 jhb Exp $
+ * $FreeBSD: src/sys/sys/signalvar.h,v 1.62 2003/05/14 15:00:24 jhb Exp $
  */
 
 #ifndef _SYS_SIGNALVAR_H_
 #define	_SYS_SIGNALVAR_H_
 
+#include <sys/queue.h>
 #include <sys/_lock.h>
 #include <sys/_mutex.h>
 #include <sys/signal.h>


More information about the p4-projects mailing list