Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 12 Jul 2002 01:26:51 -0700 (PDT)
From:      Peter Wemm <peter@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 14134 for review
Message-ID:  <200207120826.g6C8Qpwl058932@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://people.freebsd.org/~peter/p4db/chv.cgi?CH=14134

Change 14134 by peter@peter_daintree on 2002/07/12 01:25:56

	IFC @14133 (run the merge-o-matic)

Affected files ...

.. //depot/projects/pmap/sys/conf/options#6 integrate
.. //depot/projects/pmap/sys/conf/options.i386#9 integrate
.. //depot/projects/pmap/sys/conf/options.pc98#9 integrate
.. //depot/projects/pmap/sys/i386/conf/GENERIC#4 integrate
.. //depot/projects/pmap/sys/i386/conf/NOTES#6 integrate
.. //depot/projects/pmap/sys/i386/i386/bios.c#9 integrate
.. //depot/projects/pmap/sys/i386/i386/db_interface.c#5 integrate
.. //depot/projects/pmap/sys/i386/i386/locore.s#10 integrate
.. //depot/projects/pmap/sys/i386/i386/mp_machdep.c#22 integrate
.. //depot/projects/pmap/sys/i386/i386/mpapic.c#8 integrate
.. //depot/projects/pmap/sys/i386/i386/pmap.c#24 integrate
.. //depot/projects/pmap/sys/i386/i386/support.s#7 integrate
.. //depot/projects/pmap/sys/i386/i386/vm86.c#5 integrate
.. //depot/projects/pmap/sys/i386/include/cpufunc.h#12 integrate
.. //depot/projects/pmap/sys/i386/include/pmap.h#11 integrate
.. //depot/projects/pmap/sys/i386/include/smp.h#9 integrate
.. //depot/projects/pmap/sys/i386/isa/apic_vector.s#11 integrate
.. //depot/projects/pmap/sys/i386/isa/intr_machdep.h#8 integrate
.. //depot/projects/pmap/sys/kern/init_sysent.c#5 integrate
.. //depot/projects/pmap/sys/kern/kern_subr.c#5 integrate
.. //depot/projects/pmap/sys/kern/makesyscalls.sh#4 integrate
.. //depot/projects/pmap/sys/kern/subr_witness.c#12 integrate
.. //depot/projects/pmap/sys/kern/syscalls.c#5 integrate
.. //depot/projects/pmap/sys/kern/syscalls.master#5 integrate
.. //depot/projects/pmap/sys/kern/uipc_syscalls.c#7 integrate
.. //depot/projects/pmap/sys/netinet/udp_usrreq.c#5 integrate
.. //depot/projects/pmap/sys/sys/syscall.h#5 integrate
.. //depot/projects/pmap/sys/sys/syscall.mk#5 integrate
.. //depot/projects/pmap/sys/sys/sysproto.h#5 integrate
.. //depot/projects/pmap/sys/vm/device_pager.c#3 integrate
.. //depot/projects/pmap/sys/vm/vm_contig.c#4 integrate
.. //depot/projects/pmap/sys/vm/vm_glue.c#9 integrate

Differences ...

==== //depot/projects/pmap/sys/conf/options#6 (text+ko) ====

@@ -1,4 +1,4 @@
-# $FreeBSD: src/sys/conf/options,v 1.330 2002/07/11 04:15:53 ken Exp $
+# $FreeBSD: src/sys/conf/options,v 1.331 2002/07/12 06:38:33 alfred Exp $
 #
 #        On the handling of kernel options
 #
@@ -66,6 +66,7 @@
 
 ADAPTIVE_MUTEXES
 COMPAT_43	opt_compat.h
+COMPAT_FREEBSD4	opt_compat.h
 COMPAT_SUNOS	opt_compat.h
 COMPILING_LINT	opt_global.h
 CY_PCI_FASTINTR

==== //depot/projects/pmap/sys/conf/options.i386#9 (text+ko) ====

@@ -1,4 +1,4 @@
-# $FreeBSD: src/sys/conf/options.i386,v 1.171 2002/06/18 21:30:36 n_hibma Exp $
+# $FreeBSD: src/sys/conf/options.i386,v 1.172 2002/07/12 07:56:07 peter Exp $
 # Options specific to the i386 platform kernels
 
 MATH_EMULATE		opt_math_emulate.h

==== //depot/projects/pmap/sys/conf/options.pc98#9 (text+ko) ====

@@ -1,4 +1,4 @@
-# $FreeBSD: src/sys/conf/options.pc98,v 1.146 2002/06/18 21:30:37 n_hibma Exp $
+# $FreeBSD: src/sys/conf/options.pc98,v 1.147 2002/07/12 07:56:07 peter Exp $
 # Options specific to the pc98 platform kernels
 
 MATH_EMULATE		opt_math_emulate.h

==== //depot/projects/pmap/sys/i386/conf/GENERIC#4 (text+ko) ====

@@ -15,7 +15,7 @@
 # device lines is also present in the NOTES configuration file. If you are
 # in doubt as to the purpose or necessity of a line, check first in NOTES.
 #
-# $FreeBSD: src/sys/i386/conf/GENERIC,v 1.348 2002/07/08 11:56:44 markm Exp $
+# $FreeBSD: src/sys/i386/conf/GENERIC,v 1.349 2002/07/12 06:38:34 alfred Exp $
 
 machine		i386
 cpu		I486_CPU
@@ -43,6 +43,7 @@
 options 	PROCFS			#Process filesystem (requires PSEUDOFS)
 options 	PSEUDOFS		#Pseudo-filesystem framework
 options 	COMPAT_43		#Compatible with BSD 4.3 [KEEP THIS!]
+options 	COMPAT_FREEBSD4		#Compatible with FreeBSD4
 options 	SCSI_DELAY=15000	#Delay (in ms) before probing SCSI
 options 	KTRACE			#ktrace(1) support
 options 	SYSVSHM			#SYSV-style shared memory

==== //depot/projects/pmap/sys/i386/conf/NOTES#6 (text+ko) ====

@@ -4,7 +4,7 @@
 # This file contains machine dependent kernel configuration notes.  For
 # machine independent notes, look in /sys/conf/NOTES.
 #
-# $FreeBSD: src/sys/i386/conf/NOTES,v 1.1020 2002/05/06 00:45:27 jedgar Exp $
+# $FreeBSD: src/sys/i386/conf/NOTES,v 1.1021 2002/07/12 06:38:34 alfred Exp $
 #
 
 #
@@ -874,6 +874,9 @@
 # and PSEUDOFS)
 options 	LINPROCFS
 
+# Enable FreeBSD4 compatibility syscalls
+options		COMPAT_FREEBSD4
+
 #
 # SysVR4 ABI emulation
 #

==== //depot/projects/pmap/sys/i386/i386/bios.c#9 (text+ko) ====

@@ -24,7 +24,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $FreeBSD: src/sys/i386/i386/bios.c,v 1.53 2002/05/13 14:34:47 bde Exp $
+ * $FreeBSD: src/sys/i386/i386/bios.c,v 1.54 2002/07/12 07:56:08 peter Exp $
  */
 
 /*

==== //depot/projects/pmap/sys/i386/i386/db_interface.c#5 (text+ko) ====

@@ -23,7 +23,7 @@
  * any improvements or extensions that they make and grant Carnegie the
  * rights to redistribute these changes.
  *
- * $FreeBSD: src/sys/i386/i386/db_interface.c,v 1.65 2002/03/20 08:56:31 alfred Exp $
+ * $FreeBSD: src/sys/i386/i386/db_interface.c,v 1.66 2002/07/12 07:56:08 peter Exp $
  */
 
 /*

==== //depot/projects/pmap/sys/i386/i386/locore.s#10 (text+ko) ====

@@ -34,7 +34,7 @@
  * SUCH DAMAGE.
  *
  *	from: @(#)locore.s	7.3 (Berkeley) 5/13/91
- * $FreeBSD: src/sys/i386/i386/locore.s,v 1.157 2002/07/10 19:36:04 obrien Exp $
+ * $FreeBSD: src/sys/i386/i386/locore.s,v 1.158 2002/07/12 07:56:08 peter Exp $
  *
  *		originally from: locore.s, by William F. Jolitz
  *

==== //depot/projects/pmap/sys/i386/i386/mp_machdep.c#22 (text+ko) ====

@@ -22,7 +22,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $FreeBSD: src/sys/i386/i386/mp_machdep.c,v 1.187 2002/07/11 08:31:10 peter Exp $
+ * $FreeBSD: src/sys/i386/i386/mp_machdep.c,v 1.188 2002/07/12 07:56:08 peter Exp $
  */
 
 #include "opt_cpu.h"
@@ -2285,6 +2285,22 @@
  * Both of these latter forms do some very strange things on gcc-3.1 with
  * -mcpu=pentiumpro and/or -march=pentiumpro and/or -O or -O2.
  * There is probably an SSE or MMX popcnt instruction.
+ *
+ * I wonder if this should be in libkern?
+ *
+ * XXX Stop the presses!  Another one:
+ * static __inline u_int32_t
+ * popcnt1(u_int32_t v)
+ * {
+ *	v -= ((v >> 1) & 0x55555555);
+ *	v = (v & 0x33333333) + ((v >> 2) & 0x33333333);
+ *	v = (v + (v >> 4)) & 0x0F0F0F0F;
+ *	return (v * 0x01010101) >> 24;
+ * }
+ * The downside is that it has a multiply.  With a pentium3 with
+ * -mcpu=pentiumpro and -march=pentiumpro then gcc-3.1 will use
+ * an imull, and in that case it is faster.  In most other cases
+ * it appears slightly slower.
  */
 static __inline u_int32_t
 popcnt(u_int32_t m)

==== //depot/projects/pmap/sys/i386/i386/mpapic.c#8 (text+ko) ====

@@ -22,7 +22,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $FreeBSD: src/sys/i386/i386/mpapic.c,v 1.58 2002/03/27 05:39:19 dillon Exp $
+ * $FreeBSD: src/sys/i386/i386/mpapic.c,v 1.59 2002/07/12 07:56:08 peter Exp $
  */
 
 #include <sys/param.h>

==== //depot/projects/pmap/sys/i386/i386/pmap.c#24 (text+ko) ====

@@ -39,7 +39,7 @@
  * SUCH DAMAGE.
  *
  *	from:	@(#)pmap.c	7.7 (Berkeley)	5/12/91
- * $FreeBSD: src/sys/i386/i386/pmap.c,v 1.335 2002/07/08 04:24:25 peter Exp $
+ * $FreeBSD: src/sys/i386/i386/pmap.c,v 1.337 2002/07/12 07:56:09 peter Exp $
  */
 
 /*
@@ -84,7 +84,7 @@
 #include <sys/user.h>
 #include <sys/vmmeter.h>
 #include <sys/sysctl.h>
-#if defined(SMP)
+#ifdef SMP
 #include <sys/smp.h>
 #endif
 
@@ -572,15 +572,54 @@
 		return 0;
 }
 
+#ifdef I386_CPU
+/*
+ * i386 only has "invalidate everything" and no SMP to worry about.
+ */
+PMAP_INLINE void
+pmap_invalidate_page(pmap_t pmap, vm_offset_t va)
+{
+
+	if (pmap == kernel_pmap || pmap->pm_active)
+		invltlb();
+}
+
+PMAP_INLINE void
+pmap_invalidate_range(pmap_t pmap, vm_offset_t sva, vm_offset_t eva)
+{
+
+	if (pmap == kernel_pmap || pmap->pm_active)
+		invltlb();
+}
+#endif
+
 #ifdef SMP
 void
+pmap_invalidate_range(pmap_t pmap, vm_offset_t sva, vm_offset_t eva)
+{
+	u_int cpumask;
+	u_int other_cpus;
+	struct thread *td;
+	vm_offset_t addr;
+
+PMAP_INLINE void
+pmap_invalidate_all(pmap_t pmap)
+{
+
+	if (pmap == kernel_pmap || pmap->pm_active)
+		invltlb();
+}
+#else /* !I386_CPU */
+#ifdef SMP
+/*
+ * For SMP, these functions have to use the IPI mechanism for coherence.
+ */
+void
 pmap_invalidate_page(pmap_t pmap, vm_offset_t va)
 {
 	u_int cpumask;
 	u_int other_cpus;
-	struct thread *td;
 
-	td = curthread;
 	critical_enter();
 	/*
 	 * We need to disable interrupt preemption but MUST NOT have
@@ -600,31 +639,14 @@
 	}
 	critical_exit();
 }
-#else
-PMAP_INLINE void
-pmap_invalidate_page(pmap_t pmap, vm_offset_t va)
-{
-
-#ifndef I386_CPU
-	if (pmap == kernel_pmap || pmap->pm_active)
-		invlpg(va);
-#else
-	if (pmap == kernel_pmap || pmap->pm_active)
-		invltlb();
-#endif
-}
-#endif
 
-#ifdef SMP
 void
 pmap_invalidate_range(pmap_t pmap, vm_offset_t sva, vm_offset_t eva)
 {
 	u_int cpumask;
 	u_int other_cpus;
-	struct thread *td;
 	vm_offset_t addr;
 
-	td = curthread;
 	critical_enter();
 	/*
 	 * We need to disable interrupt preemption but MUST NOT have
@@ -647,32 +669,13 @@
 	}
 	critical_exit();
 }
-#else
-PMAP_INLINE void
-pmap_invalidate_range(pmap_t pmap, vm_offset_t sva, vm_offset_t eva)
-{
-#ifndef I386_CPU
-	vm_offset_t addr;
-
-	if (pmap == kernel_pmap || pmap->pm_active)
-		for (addr = sva; addr < eva; addr += PAGE_SIZE)
-			invlpg(addr);
-#else
-	if (pmap == kernel_pmap || pmap->pm_active)
-		invltlb();
-#endif
-}
-#endif
 
-#ifdef SMP
 void
 pmap_invalidate_all(pmap_t pmap)
 {
 	u_int cpumask;
 	u_int other_cpus;
-	struct thread *td;
 
-	td = curthread;
 	critical_enter();
 	/*
 	 * We need to disable interrupt preemption but MUST NOT have
@@ -692,7 +695,30 @@
 	}
 	critical_exit();
 }
-#else
+#else /* !SMP */
+/*
+ * Normal, non-SMP, 486+ invalidation functions.
+ * We inline these within pmap.c for speed.
+ */
+PMAP_INLINE void
+pmap_invalidate_page(pmap_t pmap, vm_offset_t va)
+{
+
+	if (pmap == kernel_pmap || pmap->pm_active)
+		invlpg(va);
+}
+
+PMAP_INLINE void
+pmap_invalidate_range(pmap_t pmap, vm_offset_t sva, vm_offset_t eva)
+{
+	vm_offset_t addr;
+
+	if (pmap == kernel_pmap || pmap->pm_active)
+		for (addr = sva; addr < eva; addr += PAGE_SIZE)
+			invlpg(addr);
+}
+#endif
+
 PMAP_INLINE void
 pmap_invalidate_all(pmap_t pmap)
 {
@@ -700,7 +726,8 @@
 	if (pmap == kernel_pmap || pmap->pm_active)
 		invltlb();
 }
-#endif
+#endif /* !SMP */
+#endif /* !I386_CPU */
 
 /*
  * Return an address which is the base of the Virtual mapping of
@@ -753,7 +780,7 @@
 		newpf = pde & PG_FRAME;
 		if (((*PMAP1) & PG_FRAME) != newpf) {
 			*PMAP1 = newpf | PG_RW | PG_V;
-			pmap_invalidate_page(kernel_pmap, (vm_offset_t) PADDR1);
+			pmap_invalidate_page(kernel_pmap, (vm_offset_t)PADDR1);
 		}
 		return PADDR1 + (index & (NPTEPG - 1));
 	}
@@ -798,7 +825,8 @@
  ***************************************************/
 
 /*
- * add a wired page to the kva
+ * Add a wired page to the kva.
+ * Note: not SMP coherent.
  */
 PMAP_INLINE void 
 pmap_kenter(vm_offset_t va, vm_offset_t pa)
@@ -810,7 +838,8 @@
 }
 
 /*
- * remove a page from the kernel pagetables
+ * Remove a page from the kernel pagetables.
+ * Note: not SMP coherent.
  */
 PMAP_INLINE void
 pmap_kremove(vm_offset_t va)
@@ -857,6 +886,7 @@
  * page modification or references recorded.
  * Note that old mappings are simply written
  * over.  The page *must* be wired.
+ * Note: SMP coherent.  Uses a ranged shootdown IPI.
  */
 void
 pmap_qenter(vm_offset_t sva, vm_page_t *m, int count)
@@ -873,8 +903,9 @@
 }
 
 /*
- * this routine jerks page mappings from the
+ * This routine tears out page mappings from the
  * kernel -- it is meant only for temporary mappings.
+ * Note: SMP coherent.  Uses a ranged shootdown IPI.
  */
 void
 pmap_qremove(vm_offset_t sva, int count)
@@ -893,6 +924,7 @@
 pmap_page_lookup(vm_object_t object, vm_pindex_t pindex)
 {
 	vm_page_t m;
+
 retry:
 	m = vm_page_lookup(object, pindex);
 	if (m && vm_page_sleep_busy(m, FALSE, "pplookp"))
@@ -1440,7 +1472,7 @@
 {
 	unsigned long ksize = VM_MAX_KERNEL_ADDRESS - KERNBASE;
 
-        return sysctl_handle_long(oidp, &ksize, 0, req);
+	return sysctl_handle_long(oidp, &ksize, 0, req);
 }
 SYSCTL_PROC(_vm, OID_AUTO, kvm_size, CTLTYPE_LONG|CTLFLAG_RD, 
     0, 0, kvm_size, "IU", "Size of KVM");
@@ -1450,7 +1482,7 @@
 {
 	unsigned long kfree = VM_MAX_KERNEL_ADDRESS - kernel_vm_end;
 
-        return sysctl_handle_long(oidp, &kfree, 0, req);
+	return sysctl_handle_long(oidp, &kfree, 0, req);
 }
 SYSCTL_PROC(_vm, OID_AUTO, kvm_free, CTLTYPE_LONG|CTLFLAG_RD, 
     0, 0, kvm_free, "IU", "Amount of KVM free");
@@ -2769,7 +2801,7 @@
 	 * that to save an IPI on SMP systems.
 	 */
 	pmap_invalidate_range(kernel_pmap, (vm_offset_t)CADDR1,
-	    (vm_offset_t)CADDR2);
+	    (vm_offset_t)CADDR2 + PAGE_SIZE);
 	bcopy(CADDR1, CADDR2, PAGE_SIZE);
 	*CMAP1 = 0;
 	*CMAP2 = 0;

==== //depot/projects/pmap/sys/i386/i386/support.s#7 (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/i386/i386/support.s,v 1.90 2002/06/20 07:13:33 peter Exp $
+ * $FreeBSD: src/sys/i386/i386/support.s,v 1.91 2002/07/12 07:56:09 peter Exp $
  */
 
 #include "opt_npx.h"

==== //depot/projects/pmap/sys/i386/i386/vm86.c#5 (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/i386/i386/vm86.c,v 1.46 2002/06/20 07:23:08 peter Exp $
+ * $FreeBSD: src/sys/i386/i386/vm86.c,v 1.48 2002/07/12 08:15:42 peter Exp $
  */
 
 #include <sys/param.h>
@@ -483,10 +483,10 @@
 
 	for (i = 0; i < vmc->npages; i++)
 		if (vmc->pmap[i].pte_num == pagenum)
-			goto bad;
+			goto overlap;
 
 	if (vmc->npages == VM86_PMAPSIZE)
-		goto bad;			/* XXX grow map? */
+		goto full;			/* XXX grow map? */
 
 	if (kva == 0) {
 		kva = (vm_offset_t)malloc(PAGE_SIZE, M_TEMP, M_WAITOK);
@@ -498,8 +498,10 @@
 	vmc->pmap[i].kva = kva;
 	vmc->pmap[i].pte_num = pagenum;
 	return (kva);
-bad:
-	panic("vm86_addpage: not enough room, or overlap");
+overlap:
+	panic("vm86_addpage: overlap");
+full:
+	panic("vm86_addpage: not enough room");
 }
 
 static void

==== //depot/projects/pmap/sys/i386/include/cpufunc.h#12 (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/i386/include/cpufunc.h,v 1.125 2002/05/22 20:32:39 jhb Exp $
+ * $FreeBSD: src/sys/i386/include/cpufunc.h,v 1.126 2002/07/12 07:56:10 peter Exp $
  */
 
 /*

==== //depot/projects/pmap/sys/i386/include/pmap.h#11 (text+ko) ====

@@ -42,7 +42,7 @@
  *
  *	from: hp300: @(#)pmap.h	7.2 (Berkeley) 12/16/90
  *	from: @(#)pmap.h	7.4 (Berkeley) 5/12/91
- * $FreeBSD: src/sys/i386/include/pmap.h,v 1.79 2002/07/08 08:14:28 peter Exp $
+ * $FreeBSD: src/sys/i386/include/pmap.h,v 1.80 2002/07/12 07:56:10 peter Exp $
  */
 
 #ifndef _MACHINE_PMAP_H_

==== //depot/projects/pmap/sys/i386/include/smp.h#9 (text+ko) ====

@@ -6,7 +6,7 @@
  * this stuff is worth it, you can buy me a beer in return.   Poul-Henning Kamp
  * ----------------------------------------------------------------------------
  *
- * $FreeBSD: src/sys/i386/include/smp.h,v 1.70 2002/03/23 15:09:35 bde Exp $
+ * $FreeBSD: src/sys/i386/include/smp.h,v 1.71 2002/07/12 07:56:10 peter Exp $
  *
  */
 

==== //depot/projects/pmap/sys/i386/isa/apic_vector.s#11 (text+ko) ====

@@ -1,6 +1,6 @@
 /*
  *	from: vector.s, 386BSD 0.1 unknown origin
- * $FreeBSD: src/sys/i386/isa/apic_vector.s,v 1.83 2002/07/11 08:31:10 peter Exp $
+ * $FreeBSD: src/sys/i386/isa/apic_vector.s,v 1.84 2002/07/12 07:56:10 peter Exp $
  */
 
 
@@ -310,7 +310,6 @@
 	mov	%ax, %fs
 	movl	PCPU(CPUID), %eax
 	popl	%fs
-	ss
 	incl	xhits_pg(,%eax,4)
 #endif /* COUNT_XINVLTLB_HITS */
 

==== //depot/projects/pmap/sys/i386/isa/intr_machdep.h#8 (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/i386/isa/intr_machdep.h,v 1.41 2002/06/29 02:32:33 peter Exp $
+ * $FreeBSD: src/sys/i386/isa/intr_machdep.h,v 1.42 2002/07/12 07:56:10 peter Exp $
  */
 
 #ifndef _I386_ISA_INTR_MACHDEP_H_

==== //depot/projects/pmap/sys/kern/init_sysent.c#5 (text+ko) ====

@@ -2,8 +2,8 @@
  * System call switch table.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * $FreeBSD: src/sys/kern/init_sysent.c,v 1.125 2002/06/29 17:26:18 julian Exp $
- * created from FreeBSD: src/sys/kern/syscalls.master,v 1.113 2002/06/13 23:43:53 rwatson Exp 
+ * $FreeBSD: src/sys/kern/init_sysent.c,v 1.126 2002/07/12 06:52:43 alfred Exp $
+ * created from FreeBSD: src/sys/kern/syscalls.master,v 1.114 2002/06/29 17:26:19 julian Exp 
  */
 
 #include "opt_compat.h"
@@ -20,6 +20,12 @@
 #define compat(n, name) 0, (sy_call_t *)nosys
 #endif
 
+#ifdef COMPAT_FREEBSD4
+#define compat4(n, name) n, (sy_call_t *)__CONCAT(freebsd4_,name)
+#else
+#define compat4(n, name) 0, (sy_call_t *)nosys
+#endif
+
 /* The casts are bogus but will do for now. */
 struct sysent sysent[] = {
 	{ 0, (sy_call_t *)nosys },			/* 0 = syscall */
@@ -358,7 +364,7 @@
 	{ SYF_MPSAFE | AS(sched_get_priority_min_args), (sy_call_t *)sched_get_priority_min },	/* 333 = sched_get_priority_min */
 	{ SYF_MPSAFE | AS(sched_rr_get_interval_args), (sy_call_t *)sched_rr_get_interval },	/* 334 = sched_rr_get_interval */
 	{ AS(utrace_args), (sy_call_t *)utrace },	/* 335 = utrace */
-	{ SYF_MPSAFE | AS(sendfile_args), (sy_call_t *)sendfile },	/* 336 = sendfile */
+	{ compat4(SYF_MPSAFE | AS(freebsd4_sendfile_args),sendfile) },	/* 336 = old sendfile */
 	{ AS(kldsym_args), (sy_call_t *)kldsym },	/* 337 = kldsym */
 	{ SYF_MPSAFE | AS(jail_args), (sy_call_t *)jail },	/* 338 = jail */
 	{ 0, (sy_call_t *)nosys },			/* 339 = pioctl */
@@ -415,4 +421,5 @@
 	{ AS(kenv_args), (sy_call_t *)kenv },		/* 390 = kenv */
 	{ AS(lchflags_args), (sy_call_t *)lchflags },	/* 391 = lchflags */
 	{ AS(uuidgen_args), (sy_call_t *)uuidgen },	/* 392 = uuidgen */
+	{ SYF_MPSAFE | AS(sendfile_args), (sy_call_t *)sendfile },	/* 393 = sendfile */
 };

==== //depot/projects/pmap/sys/kern/kern_subr.c#5 (text+ko) ====

@@ -36,7 +36,7 @@
  * SUCH DAMAGE.
  *
  *	@(#)kern_subr.c	8.3 (Berkeley) 1/21/94
- * $FreeBSD: src/sys/kern/kern_subr.c,v 1.57 2002/06/30 02:07:26 iedowse Exp $
+ * $FreeBSD: src/sys/kern/kern_subr.c,v 1.58 2002/07/12 02:23:55 ken Exp $
  */
 
 #include "opt_zero.h"
@@ -56,32 +56,27 @@
 #include <vm/vm.h>
 #include <vm/vm_page.h>
 #include <vm/vm_map.h>
+#ifdef ZERO_COPY_SOCKETS
+#include <vm/vm_param.h>
+#endif
+#if defined(ZERO_COPY_SOCKETS) || defined(ENABLE_VFS_IOOPT)
+#include <vm/vm_object.h>
+#endif
 
 SYSCTL_INT(_kern, KERN_IOV_MAX, iov_max, CTLFLAG_RD, NULL, UIO_MAXIOV, 
 	"Maximum number of elements in an I/O vector; sysconf(_SC_IOV_MAX)");
 
+#if defined(ZERO_COPY_SOCKETS) || defined(ENABLE_VFS_IOOPT)
+static int userspaceco(caddr_t cp, u_int cnt, struct uio *uio,
+		       struct vm_object *obj, int disposable);
+#endif
+
 #ifdef ZERO_COPY_SOCKETS
-#include <vm/vm.h>
-#include <vm/vm_param.h>
-#include <sys/lock.h>
-#include <vm/pmap.h>
-#include <vm/vm_map.h>
-#include <vm/vm_page.h>
-#include <vm/vm_object.h>
-#include <vm/vm_pager.h>
-#include <vm/vm_kern.h>
-#include <vm/vm_extern.h>
-#include <vm/swap_pager.h>
-#include <sys/mbuf.h>
-#include <machine/cpu.h>
-
 /* Declared in uipc_socket.c */
 extern int so_zero_copy_receive;
 
 static int vm_pgmoveco(vm_map_t mapa, vm_object_t srcobj, vm_offset_t kaddr,
 		       vm_offset_t uaddr);
-static int userspaceco(caddr_t cp, u_int cnt, struct uio *uio,
-			    struct vm_object *obj, int disposable);
 
 static int
 vm_pgmoveco(mapa, srcobj,  kaddr, uaddr)

==== //depot/projects/pmap/sys/kern/makesyscalls.sh#4 (text+ko) ====

@@ -1,11 +1,12 @@
 #! /bin/sh -
 #	@(#)makesyscalls.sh	8.1 (Berkeley) 6/10/93
-# $FreeBSD: src/sys/kern/makesyscalls.sh,v 1.55 2002/04/22 13:44:34 des Exp $
+# $FreeBSD: src/sys/kern/makesyscalls.sh,v 1.56 2002/07/12 06:38:34 alfred Exp $
 
 set -e
 
-# name of compat option:
+# name of compat options:
 compat=COMPAT_43
+compat4=COMPAT_FREEBSD4
 
 # output files:
 sysnames="syscalls.c"
@@ -22,13 +23,16 @@
 sysdcl="sysent.dcl.$$"
 syscompat="sysent.compat.$$"
 syscompatdcl="sysent.compatdcl.$$"
+syscompat4="sysent.compat4.$$"
+syscompat4dcl="sysent.compat4dcl.$$"
 sysent="sysent.switch.$$"
 sysinc="sysinc.switch.$$"
 sysarg="sysarg.switch.$$"
+sysprotoend="sysprotoend.$$"
 
-trap "rm $sysdcl $syscompat $syscompatdcl $sysent $sysinc $sysarg" 0
+trap "rm $sysdcl $syscompat $syscompatdcl $syscompat4 $syscompat4dcl $sysent $sysinc $sysarg $sysprotoend" 0
 
-touch $sysdcl $syscompat $syscompatdcl $sysent $sysinc $sysarg
+touch $sysdcl $syscompat $syscompatdcl $syscompat4 $syscompat4dcl $sysent $sysinc $sysarg $sysprotoend
 
 case $# in
     0)	echo "usage: $0 input-file <config-file>" 1>&2
@@ -56,9 +60,12 @@
 	BEGIN {
 		sysdcl = \"$sysdcl\"
 		sysproto = \"$sysproto\"
+		sysprotoend = \"$sysprotoend\"
 		sysproto_h = \"$sysproto_h\"
 		syscompat = \"$syscompat\"
 		syscompatdcl = \"$syscompatdcl\"
+		syscompat4 = \"$syscompat4\"
+		syscompat4dcl = \"$syscompat4dcl\"
 		sysent = \"$sysent\"
 		syssw = \"$syssw\"
 		sysinc = \"$sysinc\"
@@ -67,6 +74,7 @@
 		syshdr = \"$syshdr\"
 		sysmk = \"$sysmk\"
 		compat = \"$compat\"
+		compat4 = \"$compat4\"
 		syscallprefix = \"$syscallprefix\"
 		switchname = \"$switchname\"
 		namesname = \"$namesname\"
@@ -82,6 +90,7 @@
 		printf " * $%s$\n", "FreeBSD" > sysarg
 
 		printf "\n#ifdef %s\n\n", compat > syscompat
+		printf "\n#ifdef %s\n\n", compat4 > syscompat4
 
 		printf "/*\n * System call names.\n *\n" > sysnames
 		printf " * DO NOT EDIT-- this file is automatically generated.\n" > sysnames
@@ -141,6 +150,7 @@
 		print > sysdcl
 		print > sysarg
 		print > syscompat
+		print > syscompat4
 		print > sysnames
 		savesyscall = syscall
 		next
@@ -150,6 +160,7 @@
 		print > sysdcl
 		print > sysarg
 		print > syscompat
+		print > syscompat4
 		print > sysnames
 		syscall = savesyscall
 		next
@@ -159,6 +170,7 @@
 		print > sysdcl
 		print > sysarg
 		print > syscompat
+		print > syscompat4
 		print > sysnames
 		next
 	}
@@ -224,6 +236,8 @@
 			argalias = funcname "_args"
 			if ($2 == "COMPAT")
 				argalias = "o" argalias
+			if ($2 == "COMPAT4")
+				argalias = "freebsd4_" argalias
 		}
 		f++
 
@@ -280,6 +294,8 @@
 			$2 = "NOSTD";
 		} else if ($2 == "MCOMPAT") {
 			$2 = "COMPAT";
+		} else if ($2 == "MCOMPAT4") {
+			$2 = "COMPAT4";
 		} else if ($2 == "MCPT_NOA") {
 			$2 = "CPT_NOA";
 		} else if ($2 == "MLIBCOMPAT") {
@@ -348,26 +364,38 @@
 		syscall++
 		next
 	}
-	$2 == "COMPAT" || $2 == "CPT_NOA" {
-		ncompat++
+	$2 == "COMPAT" || $2 == "COMPAT4" || $2 == "CPT_NOA" {
+		if ($2 == "COMPAT" || $2 == "CPT_NOA") {
+			ncompat++
+			out = syscompat
+			outdcl = syscompatdcl
+			wrap = "compat"
+			prefix = "o"
+		} else if ($2 == "COMPAT4") {
+			ncompat4++
+			out = syscompat4
+			outdcl = syscompat4dcl
+			wrap = "compat4"
+			prefix = "freebsd4_"
+		}
 		parseline()
 		if (argc != 0 && $2 != "CPT_NOA") {
-			printf("struct %s {\n", argalias) > syscompat
+			printf("struct %s {\n", argalias) > out
 			for (i = 1; i <= argc; i++)
 				printf("\tchar %s_l_[PADL_(%s)]; %s %s; " \
 				    "char %s_r_[PADR_(%s)];\n",
 				    argname[i], argtype[i],
 				    argtype[i], argname[i],
-				    argname[i], argtype[i]) > syscompat
-			printf("};\n") > syscompat
+				    argname[i], argtype[i]) > out
+			printf("};\n") > out
 		}
 		else if($2 != "CPT_NOA")
 			printf("struct %s {\n\tregister_t dummy;\n};\n",
 			    argalias) > sysarg
-		printf("%s\to%s(struct thread *, struct %s *);\n",
-		    rettype, funcname, argalias) > syscompatdcl
-		printf("\t{ compat(%s%s,%s) },",
-		    mpsafe, argssize, funcname) > sysent
+		printf("%s\t%s%s(struct thread *, struct %s *);\n",
+		    rettype, prefix, funcname, argalias) > outdcl
+		printf("\t{ %s(%s%s,%s) },",
+		    wrap, mpsafe, argssize, funcname) > sysent
 		align_sysent_comment(8 + 9 + length(mpsafe) + \
 		    length(argssize) + 1 + length(funcname) + 4)
 		printf("/* %d = old %s */\n", syscall, funcalias) > sysent
@@ -420,8 +448,11 @@
 	}
 	END {
 		printf "\n#define AS(name) (sizeof(struct name) / sizeof(register_t))\n" > sysinc
+
+		if (ncompat != 0 || ncompat4 != 0)
+			printf "#include \"opt_compat.h\"\n\n" > syssw
+
 		if (ncompat != 0) {
-			printf "#include \"opt_compat.h\"\n\n" > syssw
 			printf "\n#ifdef %s\n", compat > sysinc
 			printf "#define compat(n, name) n, (sy_call_t *)__CONCAT(o,name)\n" > sysinc
 			printf "#else\n" > sysinc
@@ -429,11 +460,22 @@
 			printf "#endif\n" > sysinc
 		}
 
+		if (ncompat4 != 0) {
+			printf "\n#ifdef %s\n", compat4 > sysinc
+			printf "#define compat4(n, name) n, (sy_call_t *)__CONCAT(freebsd4_,name)\n" > sysinc
+			printf "#else\n" > sysinc
+			printf "#define compat4(n, name) 0, (sy_call_t *)nosys\n" > sysinc
+			printf "#endif\n" > sysinc
+		}
+
 		printf("\n#endif /* %s */\n\n", compat) > syscompatdcl
-		printf("#undef PAD_\n") > syscompatdcl
-		printf("#undef PADL_\n") > syscompatdcl
-		printf("#undef PADR_\n") > syscompatdcl
-		printf("\n#endif /* !%s */\n", sysproto_h) > syscompatdcl
+
+		printf("\n#endif /* %s */\n\n", compat4) > syscompat4dcl
+
+		printf("#undef PAD_\n") > sysprotoend
+		printf("#undef PADL_\n") > sysprotoend
+		printf("#undef PADR_\n") > sysprotoend
+		printf("\n#endif /* !%s */\n", sysproto_h) > sysprotoend
 
 		printf("\n") > sysmk
 		printf("};\n") > sysent
@@ -443,4 +485,8 @@
 	} '
 
 cat $sysinc $sysent >> $syssw
-cat $sysarg $sysdcl $syscompat $syscompatdcl > $sysproto
+cat $sysarg $sysdcl \
+	$syscompat $syscompatdcl \
+	$syscompat4 $syscompat4dcl \
+	$sysprotoend > $sysproto
+

==== //depot/projects/pmap/sys/kern/subr_witness.c#12 (text+ko) ====

@@ -27,7 +27,7 @@
  *
  *	from BSDI $Id: mutex_witness.c,v 1.1.2.20 2000/04/27 03:10:27 cp Exp $
  *	and BSDI $Id: synch_machdep.c,v 2.3.2.39 2000/04/27 03:10:25 cp Exp $
- * $FreeBSD: src/sys/kern/subr_witness.c,v 1.120 2002/07/04 22:07:37 alc Exp $
+ * $FreeBSD: src/sys/kern/subr_witness.c,v 1.121 2002/07/12 07:56:11 peter Exp $
  */
 
 /*

==== //depot/projects/pmap/sys/kern/syscalls.c#5 (text+ko) ====

@@ -2,8 +2,8 @@
  * System call names.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * $FreeBSD: src/sys/kern/syscalls.c,v 1.111 2002/06/13 23:44:50 rwatson Exp $
- * created from FreeBSD: src/sys/kern/syscalls.master,v 1.113 2002/06/13 23:43:53 rwatson Exp 
+ * $FreeBSD: src/sys/kern/syscalls.c,v 1.112 2002/07/12 06:52:43 alfred Exp $
+ * created from FreeBSD: src/sys/kern/syscalls.master,v 1.114 2002/06/29 17:26:19 julian Exp 
  */
 
 char *syscallnames[] = {
@@ -343,7 +343,7 @@
 	"sched_get_priority_min",			/* 333 = sched_get_priority_min */
 	"sched_rr_get_interval",			/* 334 = sched_rr_get_interval */
 	"utrace",			/* 335 = utrace */
-	"sendfile",			/* 336 = sendfile */
+	"old.sendfile",		/* 336 = old sendfile */
 	"kldsym",			/* 337 = kldsym */
 	"jail",			/* 338 = jail */
 	"#339",			/* 339 = pioctl */
@@ -400,4 +400,5 @@
 	"kenv",			/* 390 = kenv */
 	"lchflags",			/* 391 = lchflags */
 	"uuidgen",			/* 392 = uuidgen */
+	"sendfile",			/* 393 = sendfile */
 };

==== //depot/projects/pmap/sys/kern/syscalls.master#5 (text+ko) ====

@@ -1,4 +1,4 @@
- $FreeBSD: src/sys/kern/syscalls.master,v 1.114 2002/06/29 17:26:19 julian Exp $
+ $FreeBSD: src/sys/kern/syscalls.master,v 1.115 2002/07/12 06:51:57 alfred Exp $
 ;	from: @(#)syscalls.master	8.2 (Berkeley) 1/13/94
 ;
 ; System call name/number master file.
@@ -8,7 +8,7 @@
 ;	number	system call number, must be in order
 ;	type	one of [M]STD, [M]OBSOL, [M]UNIMPL, [M]COMPAT, [M]CPT_NOA,
 ;		[M]LIBCOMPAT, [M]NODEF,  [M]NOARGS,  [M]NOPROTO,  [M]NOIMPL,
-;		[M]NOSTD
+;		[M]NOSTD, [M]COMPAT4
 ;	namespc one of POSIX, BSD, NOHIDE
 ;	name	psuedo-prototype of syscall routine
 ;		If one of the following alts is different, then all appear:
@@ -23,6 +23,7 @@
 ;		lock for the syscall.
 ;	STD	always included
 ;	COMPAT	included on COMPAT #ifdef
+;	COMPAT4	included on COMPAT4 #ifdef (FreeBSD 4 compat)
 ;	LIBCOMPAT included on COMPAT #ifdef, and placed in syscall.h
 ;	OBSOL	obsolete, not included in system, only specifies name
 ;	UNIMPL	not implemented, placeholder only
@@ -479,7 +480,7 @@
 333     MSTD     POSIX   { int sched_get_priority_min (int policy); }
 334     MSTD     POSIX   { int sched_rr_get_interval (pid_t pid, struct timespec *interval); }
 335	STD	BSD	{ int utrace(const void *addr, size_t len); }
-336	MSTD	BSD	{ int sendfile(int fd, int s, off_t offset, size_t nbytes, \
+336	MCOMPAT4	BSD	{ int sendfile(int fd, int s, off_t offset, size_t nbytes, \
 				struct sf_hdtr *hdtr, off_t *sbytes, int flags); }
 337	STD	BSD	{ int kldsym(int fileid, int cmd, void *data); }
 338	MSTD	BSD	{ int jail(struct jail *jail); }
@@ -563,3 +564,5 @@
 			    int len); }
 391	STD	BSD	{ int lchflags(const char *path, int flags); }
 392	STD	BSD	{ int uuidgen(struct uuid *store, int count); }
+393	MSTD	BSD	{ int sendfile(int fd, int s, off_t offset, size_t nbytes, \
+				struct sf_hdtr *hdtr, off_t *sbytes, int flags); }

==== //depot/projects/pmap/sys/kern/uipc_syscalls.c#7 (text+ko) ====

@@ -34,7 +34,7 @@
  * SUCH DAMAGE.
  *
  *	@(#)uipc_syscalls.c	8.4 (Berkeley) 2/21/94
- * $FreeBSD: src/sys/kern/uipc_syscalls.c,v 1.116 2002/06/29 00:02:01 alfred Exp $
+ * $FreeBSD: src/sys/kern/uipc_syscalls.c,v 1.117 2002/07/12 06:51:57 alfred Exp $
  */
 
 #include "opt_compat.h"
@@ -81,6 +81,7 @@
 static int recvit(struct thread *td, int s, struct msghdr *mp, void *namelenp);
   
 static int accept1(struct thread *td, struct accept_args *uap, int compat);
+static int do_sendfile(struct thread *td, struct sendfile_args *uap, int compat);
 static int getsockname1(struct thread *td, struct getsockname_args *uap,
 			int compat);
 static int getpeername1(struct thread *td, struct getpeername_args *uap,
@@ -1637,6 +1638,31 @@
 int
 sendfile(struct thread *td, struct sendfile_args *uap)
 {
+
+	return (do_sendfile(td, uap, 0));
+}
+
+#ifdef COMPAT_FREEBSD4

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

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe p4-projects" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200207120826.g6C8Qpwl058932>