PERFORCE change 60437 for review

Julian Elischer julian at FreeBSD.org
Wed Aug 25 18:18:03 PDT 2004


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

Change 60437 by julian at julian_ref on 2004/08/26 01:17:35

	IFC @60433

Affected files ...

.. //depot/projects/nsched/sys/alpha/linux/linux_proto.h#3 integrate
.. //depot/projects/nsched/sys/alpha/linux/linux_syscall.h#3 integrate
.. //depot/projects/nsched/sys/alpha/linux/linux_sysent.c#3 integrate
.. //depot/projects/nsched/sys/alpha/linux/syscalls.master#3 integrate
.. //depot/projects/nsched/sys/alpha/osf1/osf1_misc.c#3 integrate
.. //depot/projects/nsched/sys/alpha/osf1/osf1_proto.h#2 integrate
.. //depot/projects/nsched/sys/alpha/osf1/osf1_syscall.h#2 integrate
.. //depot/projects/nsched/sys/alpha/osf1/osf1_sysent.c#2 integrate
.. //depot/projects/nsched/sys/alpha/osf1/syscalls.master#2 integrate
.. //depot/projects/nsched/sys/amd64/amd64/machdep.c#8 integrate
.. //depot/projects/nsched/sys/amd64/amd64/mp_machdep.c#5 integrate
.. //depot/projects/nsched/sys/amd64/amd64/nexus.c#6 integrate
.. //depot/projects/nsched/sys/amd64/amd64/pmap.c#15 integrate
.. //depot/projects/nsched/sys/amd64/linux32/linux32_machdep.c#2 integrate
.. //depot/projects/nsched/sys/compat/linux/linux_socket.c#5 integrate
.. //depot/projects/nsched/sys/compat/svr4/svr4_fcntl.c#2 integrate
.. //depot/projects/nsched/sys/compat/svr4/svr4_proto.h#2 integrate
.. //depot/projects/nsched/sys/compat/svr4/svr4_stream.c#5 integrate
.. //depot/projects/nsched/sys/compat/svr4/svr4_syscall.h#2 integrate
.. //depot/projects/nsched/sys/compat/svr4/svr4_syscallnames.c#2 integrate
.. //depot/projects/nsched/sys/compat/svr4/svr4_sysent.c#2 integrate
.. //depot/projects/nsched/sys/compat/svr4/syscalls.master#2 integrate
.. //depot/projects/nsched/sys/conf/ldscript.ia64#3 integrate
.. //depot/projects/nsched/sys/dev/acpica/acpi_lid.c#7 integrate
.. //depot/projects/nsched/sys/dev/ata/ata-all.c#8 integrate
.. //depot/projects/nsched/sys/dev/ata/ata-chipset.c#8 integrate
.. //depot/projects/nsched/sys/dev/ata/atapi-cd.c#5 integrate
.. //depot/projects/nsched/sys/dev/mpt/mpt_freebsd.c#3 integrate
.. //depot/projects/nsched/sys/dev/uart/uart_bus_isa.c#3 integrate
.. //depot/projects/nsched/sys/geom/mirror/g_mirror.c#2 integrate
.. //depot/projects/nsched/sys/geom/raid3/g_raid3.c#3 integrate
.. //depot/projects/nsched/sys/geom/stripe/g_stripe.c#5 integrate
.. //depot/projects/nsched/sys/i386/acpica/acpi_panasonic.c#2 integrate
.. //depot/projects/nsched/sys/i386/i386/mp_machdep.c#5 integrate
.. //depot/projects/nsched/sys/i386/i386/pmap.c#13 integrate
.. //depot/projects/nsched/sys/i386/ibcs2/ibcs2_fcntl.c#2 integrate
.. //depot/projects/nsched/sys/i386/ibcs2/ibcs2_proto.h#2 integrate
.. //depot/projects/nsched/sys/i386/ibcs2/ibcs2_syscall.h#2 integrate
.. //depot/projects/nsched/sys/i386/ibcs2/ibcs2_sysent.c#3 integrate
.. //depot/projects/nsched/sys/i386/ibcs2/syscalls.master#2 integrate
.. //depot/projects/nsched/sys/i386/include/in_cksum.h#3 integrate
.. //depot/projects/nsched/sys/i386/linux/linux_machdep.c#2 integrate
.. //depot/projects/nsched/sys/i386/linux/linux_proto.h#2 integrate
.. //depot/projects/nsched/sys/i386/linux/linux_syscall.h#2 integrate
.. //depot/projects/nsched/sys/i386/linux/linux_sysent.c#2 integrate
.. //depot/projects/nsched/sys/i386/linux/syscalls.master#2 integrate
.. //depot/projects/nsched/sys/ia64/conf/GENERIC#5 integrate
.. //depot/projects/nsched/sys/ia64/ia64/nexus.c#3 integrate
.. //depot/projects/nsched/sys/ia64/ia64/support.S#2 integrate
.. //depot/projects/nsched/sys/ia64/include/asm.h#2 integrate
.. //depot/projects/nsched/sys/ia64/include/cpu.h#6 integrate
.. //depot/projects/nsched/sys/ia64/include/profile.h#3 integrate
.. //depot/projects/nsched/sys/kern/kern_kse.c#24 integrate
.. //depot/projects/nsched/sys/kern/subr_bus.c#7 integrate
.. //depot/projects/nsched/sys/kern/subr_smp.c#4 integrate
.. //depot/projects/nsched/sys/kern/uipc_socket.c#12 integrate
.. //depot/projects/nsched/sys/kern/uipc_usrreq.c#11 integrate
.. //depot/projects/nsched/sys/net/if_fwsubr.c#4 integrate
.. //depot/projects/nsched/sys/net/rtsock.c#7 integrate
.. //depot/projects/nsched/sys/netinet/ip_dummynet.c#5 integrate
.. //depot/projects/nsched/sys/nfsclient/nfs_socket.c#6 integrate
.. //depot/projects/nsched/sys/nfsserver/nfs_serv.c#6 integrate
.. //depot/projects/nsched/sys/pci/if_dc.c#8 integrate
.. //depot/projects/nsched/sys/sys/smp.h#2 integrate

Differences ...

==== //depot/projects/nsched/sys/alpha/linux/linux_proto.h#3 (text+ko) ====

@@ -2,8 +2,8 @@
  * System call prototypes.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * $FreeBSD: src/sys/alpha/linux/linux_proto.h,v 1.18 2004/06/04 13:52:51 jhb Exp $
- * created from FreeBSD: src/sys/alpha/linux/syscalls.master,v 1.58 2004/06/04 13:52:23 jhb Exp 
+ * $FreeBSD: src/sys/alpha/linux/linux_proto.h,v 1.19 2004/08/24 20:24:33 jhb Exp $
+ * created from FreeBSD: src/sys/alpha/linux/syscalls.master,v 1.59 2004/08/24 20:21:21 jhb Exp 
  */
 
 #ifndef _LINUX_SYSPROTO_H_

==== //depot/projects/nsched/sys/alpha/linux/linux_syscall.h#3 (text+ko) ====

@@ -2,8 +2,8 @@
  * System call numbers.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * $FreeBSD: src/sys/alpha/linux/linux_syscall.h,v 1.16 2004/06/04 13:52:51 jhb Exp $
- * created from FreeBSD: src/sys/alpha/linux/syscalls.master,v 1.58 2004/06/04 13:52:23 jhb Exp 
+ * $FreeBSD: src/sys/alpha/linux/linux_syscall.h,v 1.17 2004/08/24 20:24:33 jhb Exp $
+ * created from FreeBSD: src/sys/alpha/linux/syscalls.master,v 1.59 2004/08/24 20:21:21 jhb Exp 
  */
 
 #define	LINUX_SYS_exit	1

==== //depot/projects/nsched/sys/alpha/linux/linux_sysent.c#3 (text+ko) ====

@@ -2,8 +2,8 @@
  * System call switch table.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * $FreeBSD: src/sys/alpha/linux/linux_sysent.c,v 1.16 2004/06/04 13:52:51 jhb Exp $
- * created from FreeBSD: src/sys/alpha/linux/syscalls.master,v 1.58 2004/06/04 13:52:23 jhb Exp 
+ * $FreeBSD: src/sys/alpha/linux/linux_sysent.c,v 1.17 2004/08/24 20:24:33 jhb Exp $
+ * created from FreeBSD: src/sys/alpha/linux/syscalls.master,v 1.59 2004/08/24 20:21:21 jhb Exp 
  */
 
 #include "opt_compat.h"
@@ -109,7 +109,7 @@
 	{ 0, (sy_call_t *)linux_getdtablesize },	/* 89 = linux_getdtablesize */
 	{ SYF_MPSAFE | AS(dup2_args), (sy_call_t *)dup2 },	/* 90 = dup2 */
 	{ AS(linux_newfstat_args), (sy_call_t *)linux_newfstat },	/* 91 = linux_newfstat */
-	{ AS(linux_fcntl_args), (sy_call_t *)linux_fcntl },	/* 92 = linux_fcntl */
+	{ SYF_MPSAFE | AS(linux_fcntl_args), (sy_call_t *)linux_fcntl },	/* 92 = linux_fcntl */
 	{ AS(osf1_select_args), (sy_call_t *)osf1_select },	/* 93 = osf1_select */
 	{ AS(poll_args), (sy_call_t *)poll },		/* 94 = poll */
 	{ AS(fsync_args), (sy_call_t *)fsync },		/* 95 = fsync */

==== //depot/projects/nsched/sys/alpha/linux/syscalls.master#3 (text+ko) ====

@@ -1,4 +1,4 @@
- $FreeBSD: src/sys/alpha/linux/syscalls.master,v 1.58 2004/06/04 13:52:23 jhb Exp $
+ $FreeBSD: src/sys/alpha/linux/syscalls.master,v 1.59 2004/08/24 20:21:21 jhb Exp $
 
 ;	@(#)syscalls.master	8.1 (Berkeley) 7/19/93
 ; System call name/number master file (or rather, slave, from LINUX).
@@ -133,7 +133,7 @@
 89	STD	{ int linux_getdtablesize(void); }
 90	MNOPROTO { int dup2(u_int from, u_int to); }
 91	STD	{ int linux_newfstat(l_uint fd, struct l_newstat *buf); }
-92	STD	{ int linux_fcntl(l_uint fd, l_uint cmd, l_ulong arg); }
+92	MSTD	{ int linux_fcntl(l_uint fd, l_uint cmd, l_ulong arg); }
 93	STD	{ int osf1_select(u_int nd, fd_set *in, fd_set *ou, \
 				fd_set *ex, struct timeval *tv); }
 94	NOPROTO	{ int poll(struct pollfd*, unsigned int nfds, long timeout); }

==== //depot/projects/nsched/sys/alpha/osf1/osf1_misc.c#3 (text+ko) ====

@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/alpha/osf1/osf1_misc.c,v 1.47 2004/07/26 07:24:01 cperciva Exp $");
+__FBSDID("$FreeBSD: src/sys/alpha/osf1/osf1_misc.c,v 1.48 2004/08/24 20:21:21 jhb Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -60,6 +60,7 @@
 #include <sys/socket.h>
 #include <sys/socketvar.h>
 #include <sys/stat.h>
+#include <sys/syscallsubr.h>
 #include <sys/sysctl.h>
 #include <sys/sysent.h>
 #include <sys/sysproto.h>
@@ -758,19 +759,14 @@
 {
 	int error;
 	long tmp;
-	caddr_t oarg, sg;
-	struct fcntl_args a;
 	struct osf1_flock osf_flock;
 	struct flock bsd_flock;
-	struct flock *nflock;
 
 	error = 0;
 
 	switch (uap->cmd) {
 
 	case F_SETFL:
-		a.fd = uap->fd;
-		a.cmd = F_SETFL;
 		/* need to translate flags here */
 		tmp = 0;
 		if ((long)uap->arg & OSF1_FNONBLOCK)
@@ -791,8 +787,7 @@
 			tmp |= FNDELAY;
 		if ((long)uap->arg & OSF1_FSYNC)
 			tmp |= FFSYNC;
-		a.arg = tmp;
-		error = fcntl(td, &a);
+		error = kern_fcntl(td, uap->fd, F_SETFL, tmp);
 		break;
 
 	case F_SETLK:
@@ -803,20 +798,15 @@
 		 *  the BSD one, but all else is the same.  We must
 		 *  reorder the one we've gotten so that flock() groks it.
 		 */
-		if ((error = copyin(uap->arg, &osf_flock, sizeof(osf_flock))))
-			return error;
+		error = copyin(uap->arg, &osf_flock, sizeof(osf_flock));
+		if (error)
+			return (error);
 		bsd_flock.l_type = osf_flock.l_type;
 		bsd_flock.l_whence = osf_flock.l_whence;
 		bsd_flock.l_start = osf_flock.l_start;
 		bsd_flock.l_len = osf_flock.l_len;
 		bsd_flock.l_pid = osf_flock.l_pid;
-		sg = stackgap_init();
-		nflock = stackgap_alloc(&sg, sizeof(struct flock));
-		if ((error = copyout(&bsd_flock, nflock, sizeof(bsd_flock))) != 0)
-			return error;
-		oarg = uap->arg;
-		uap->arg = nflock;
-		error = fcntl(td, (struct fcntl_args *) uap);
+		error = kern_fcntl(td, uap->fd, uap->cmd, (intptr_t)&bsd_flock);
 /*		if (error) {
 			printf("fcntl called with cmd=%d, args=0x%lx\n returns %d\n",uap->cmd,(long)uap->arg,error);
 			printf("bsd_flock.l_type = 0x%x\n", bsd_flock.l_type);
@@ -827,14 +817,17 @@
 		}
 */
 		if ((uap->cmd == F_GETLK) && !error) {
+			/*
+			 * XXX: Why are we hardcoding F_UNLCK here instead of
+			 * copying the structure members from bsd_flock?
+			 */
 			osf_flock.l_type = F_UNLCK;
-			if ((error = copyout(&osf_flock, oarg,
-			    sizeof(osf_flock))))
-				return error;
+			error = copyout(&osf_flock, uap->arg,
+			    sizeof(osf_flock));
 		}
 		break;
 	default:
-		error = fcntl(td, (struct fcntl_args *) uap);
+		error = kern_fcntl(td, uap->fd, uap->cmd, (intptr_t)uap->arg);
 
 		if ((uap->cmd == OSF1_F_GETFL) && !error ) {
 			tmp = td->td_retval[0] & O_ACCMODE;

==== //depot/projects/nsched/sys/alpha/osf1/osf1_proto.h#2 (text+ko) ====

@@ -2,8 +2,8 @@
  * System call prototypes.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * $FreeBSD: src/sys/alpha/osf1/osf1_proto.h,v 1.10 2004/03/15 22:44:35 jhb Exp $
- * created from;	FreeBSD: src/sys/alpha/osf1/syscalls.master,v 1.9 2004/03/15 22:43:49 jhb Exp 
+ * $FreeBSD: src/sys/alpha/osf1/osf1_proto.h,v 1.11 2004/08/24 20:24:33 jhb Exp $
+ * created from;	FreeBSD: src/sys/alpha/osf1/syscalls.master,v 1.10 2004/08/24 20:21:21 jhb Exp 
  */
 
 #ifndef _OSF1_SYSPROTO_H_

==== //depot/projects/nsched/sys/alpha/osf1/osf1_syscall.h#2 (text+ko) ====

@@ -2,8 +2,8 @@
  * System call numbers.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * $FreeBSD: src/sys/alpha/osf1/osf1_syscall.h,v 1.9 2004/03/15 22:44:35 jhb Exp $
- * created from;	FreeBSD: src/sys/alpha/osf1/syscalls.master,v 1.9 2004/03/15 22:43:49 jhb Exp 
+ * $FreeBSD: src/sys/alpha/osf1/osf1_syscall.h,v 1.10 2004/08/24 20:24:33 jhb Exp $
+ * created from;	FreeBSD: src/sys/alpha/osf1/syscalls.master,v 1.10 2004/08/24 20:21:21 jhb Exp 
  */
 
 #define	OSF1_SYS_nosys	0

==== //depot/projects/nsched/sys/alpha/osf1/osf1_sysent.c#2 (text+ko) ====

@@ -2,8 +2,8 @@
  * System call switch table.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * $FreeBSD: src/sys/alpha/osf1/osf1_sysent.c,v 1.9 2004/03/15 22:44:35 jhb Exp $
- * created from;	FreeBSD: src/sys/alpha/osf1/syscalls.master,v 1.9 2004/03/15 22:43:49 jhb Exp 
+ * $FreeBSD: src/sys/alpha/osf1/osf1_sysent.c,v 1.10 2004/08/24 20:24:33 jhb Exp $
+ * created from;	FreeBSD: src/sys/alpha/osf1/syscalls.master,v 1.10 2004/08/24 20:21:21 jhb Exp 
  */
 
 #include "opt_compat.h"
@@ -110,7 +110,7 @@
 	{ SYF_MPSAFE | 0, (sy_call_t *)getdtablesize },	/* 89 = getdtablesize */
 	{ SYF_MPSAFE | AS(dup2_args), (sy_call_t *)dup2 },	/* 90 = dup2 */
 	{ AS(osf1_fstat_args), (sy_call_t *)osf1_fstat },	/* 91 = osf1_fstat */
-	{ AS(osf1_fcntl_args), (sy_call_t *)osf1_fcntl },	/* 92 = osf1_fcntl */
+	{ SYF_MPSAFE | AS(osf1_fcntl_args), (sy_call_t *)osf1_fcntl },	/* 92 = osf1_fcntl */
 	{ AS(osf1_select_args), (sy_call_t *)osf1_select },	/* 93 = osf1_select */
 	{ AS(poll_args), (sy_call_t *)poll },		/* 94 = poll */
 	{ AS(fsync_args), (sy_call_t *)fsync },		/* 95 = fsync */

==== //depot/projects/nsched/sys/alpha/osf1/syscalls.master#2 (text+ko) ====

@@ -1,4 +1,4 @@
-;	$FreeBSD: src/sys/alpha/osf1/syscalls.master,v 1.9 2004/03/15 22:43:49 jhb Exp $
+;	$FreeBSD: src/sys/alpha/osf1/syscalls.master,v 1.10 2004/08/24 20:21:21 jhb Exp $
 
 ;       @(#)syscalls.master     8.1 (Berkeley) 7/19/93
 ; System call name/number master file (or rather, slave, from OSF1).
@@ -135,7 +135,7 @@
 89	MNOPROTO { int getdtablesize(void); }
 90	MNOPROTO { int dup2(u_int from, u_int to); }
 91	STD	{ int osf1_fstat(int fd, void *sb); }
-92	STD	{ int osf1_fcntl(int fd, int cmd, void *arg); }
+92	MSTD	{ int osf1_fcntl(int fd, int cmd, void *arg); }
 93	STD	{ int osf1_select(u_int nd, fd_set *in, fd_set *ou, \
                     fd_set *ex, struct timeval *tv); }
 94	NOPROTO	{ int poll(struct pollfd *fds, u_int nfds, int timeout); }

==== //depot/projects/nsched/sys/amd64/amd64/machdep.c#8 (text+ko) ====

@@ -39,7 +39,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/amd64/machdep.c,v 1.618 2004/08/16 22:57:47 peter Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/amd64/machdep.c,v 1.619 2004/08/24 00:16:43 peter Exp $");
 
 #include "opt_atalk.h"
 #include "opt_atpic.h"
@@ -498,6 +498,10 @@
 cpu_idle(void)
 {
 
+#ifdef SMP
+	if (mp_grab_cpu_hlt())
+		return;
+#endif
 	if (cpu_idle_hlt) {
 		disable_intr();
   		if (sched_runnable())

==== //depot/projects/nsched/sys/amd64/amd64/mp_machdep.c#5 (text+ko) ====

@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/amd64/mp_machdep.c,v 1.242 2004/08/13 22:30:55 ambrisko Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/amd64/mp_machdep.c,v 1.243 2004/08/23 21:39:28 peter Exp $");
 
 #include "opt_cpu.h"
 #include "opt_kstack_pages.h"
@@ -103,7 +103,6 @@
 vm_offset_t smp_tlb_addr1;
 vm_offset_t smp_tlb_addr2;
 volatile int smp_tlb_wait;
-struct mtx smp_tlb_mtx;
 
 extern inthand_t IDTVEC(fast_syscall), IDTVEC(fast_syscall32);
 
@@ -319,8 +318,6 @@
 	/* Install an inter-CPU IPI for CPU stop/restart */
 	setidt(IPI_STOP, IDTVEC(cpustop), SDT_SYSIGT, SEL_KPL, 0);
 
-	mtx_init(&smp_tlb_mtx, "tlb", NULL, MTX_SPIN);
-
 	/* Set boot_cpu_id if needed. */
 	if (boot_cpu_id == -1) {
 		boot_cpu_id = PCPU_GET(apic_id);
@@ -711,7 +708,7 @@
 	ncpu = mp_ncpus - 1;	/* does not shootdown self */
 	if (ncpu < 1)
 		return;		/* no other cpus */
-	mtx_assert(&smp_tlb_mtx, MA_OWNED);
+	mtx_assert(&smp_rv_mtx, MA_OWNED);
 	smp_tlb_addr1 = addr1;
 	smp_tlb_addr2 = addr2;
 	atomic_store_rel_int(&smp_tlb_wait, 0);
@@ -797,7 +794,7 @@
 		if (ncpu < 1)
 			return;
 	}
-	mtx_assert(&smp_tlb_mtx, MA_OWNED);
+	mtx_assert(&smp_rv_mtx, MA_OWNED);
 	smp_tlb_addr1 = addr1;
 	smp_tlb_addr2 = addr2;
 	atomic_store_rel_int(&smp_tlb_wait, 0);

==== //depot/projects/nsched/sys/amd64/amd64/nexus.c#6 (text+ko) ====

@@ -28,7 +28,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/amd64/nexus.c,v 1.62 2004/07/08 01:34:24 peter Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/amd64/nexus.c,v 1.63 2004/08/24 19:22:54 njl Exp $");
 
 /*
  * This code implements a `root nexus' for Intel Architecture
@@ -97,6 +97,7 @@
 			     void (*)(void *), void *, void **);
 static	int nexus_teardown_intr(device_t, device_t, struct resource *,
 				void *);
+static struct resource_list *nexus_get_reslist(device_t dev, device_t child);
 static	int nexus_set_resource(device_t, device_t, int, int, u_long, u_long);
 static	int nexus_get_resource(device_t, device_t, int, int, u_long *, u_long *);
 static void nexus_delete_resource(device_t, device_t, int, int);
@@ -120,6 +121,7 @@
 	DEVMETHOD(bus_setup_intr,	nexus_setup_intr),
 	DEVMETHOD(bus_teardown_intr,	nexus_teardown_intr),
 	DEVMETHOD(bus_config_intr,	nexus_config_intr),
+	DEVMETHOD(bus_get_resource_list, nexus_get_reslist),
 	DEVMETHOD(bus_set_resource,	nexus_set_resource),
 	DEVMETHOD(bus_get_resource,	nexus_get_resource),
 	DEVMETHOD(bus_delete_resource,	nexus_delete_resource),
@@ -464,6 +466,14 @@
 	return (intr_config_intr(irq, trig, pol));
 }
 
+static struct resource_list *
+nexus_get_reslist(device_t dev, device_t child)
+{
+	struct nexus_device *ndev = DEVTONX(child);
+
+	return (&ndev->nx_resources);
+}
+
 static int
 nexus_set_resource(device_t dev, device_t child, int type, int rid, u_long start, u_long count)
 {

==== //depot/projects/nsched/sys/amd64/amd64/pmap.c#15 (text+ko) ====

@@ -75,7 +75,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/amd64/pmap.c,v 1.491 2004/08/08 00:31:58 alc Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/amd64/pmap.c,v 1.493 2004/08/24 00:17:52 peter Exp $");
 
 /*
  *	Manages physical address maps.
@@ -631,7 +631,7 @@
 	if (smp_started) {
 		if (!(read_rflags() & PSL_I))
 			panic("%s: interrupts disabled", __func__);
-		mtx_lock_spin(&smp_tlb_mtx);
+		mtx_lock_spin(&smp_rv_mtx);
 	} else
 		critical_enter();
 	/*
@@ -652,7 +652,7 @@
 			smp_masked_invlpg(pmap->pm_active & other_cpus, va);
 	}
 	if (smp_started)
-		mtx_unlock_spin(&smp_tlb_mtx);
+		mtx_unlock_spin(&smp_rv_mtx);
 	else
 		critical_exit();
 }
@@ -667,7 +667,7 @@
 	if (smp_started) {
 		if (!(read_rflags() & PSL_I))
 			panic("%s: interrupts disabled", __func__);
-		mtx_lock_spin(&smp_tlb_mtx);
+		mtx_lock_spin(&smp_rv_mtx);
 	} else
 		critical_enter();
 	/*
@@ -691,7 +691,7 @@
 			    sva, eva);
 	}
 	if (smp_started)
-		mtx_unlock_spin(&smp_tlb_mtx);
+		mtx_unlock_spin(&smp_rv_mtx);
 	else
 		critical_exit();
 }
@@ -705,7 +705,7 @@
 	if (smp_started) {
 		if (!(read_rflags() & PSL_I))
 			panic("%s: interrupts disabled", __func__);
-		mtx_lock_spin(&smp_tlb_mtx);
+		mtx_lock_spin(&smp_rv_mtx);
 	} else
 		critical_enter();
 	/*
@@ -726,7 +726,7 @@
 			smp_masked_invltlb(pmap->pm_active & other_cpus);
 	}
 	if (smp_started)
-		mtx_unlock_spin(&smp_tlb_mtx);
+		mtx_unlock_spin(&smp_rv_mtx);
 	else
 		critical_exit();
 }
@@ -1048,9 +1048,7 @@
 
 	if (va >= VM_MAXUSER_ADDRESS)
 		return 0;
-/* XXX this should be an error, all cases should be caught now */
-	if (ptepde == 0)
-		ptepde = *pmap_pde(pmap, va);
+	KASSERT(ptepde != 0, ("pmap_unuse_pt: ptepde != 0"));
 	mpte = PHYS_TO_VM_PAGE(ptepde & PG_FRAME);
 	return pmap_unwire_pte_hold(pmap, va, mpte);
 }

==== //depot/projects/nsched/sys/amd64/linux32/linux32_machdep.c#2 (text+ko) ====

@@ -29,7 +29,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/linux32/linux32_machdep.c,v 1.2 2004/08/16 10:54:25 obrien Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/linux32/linux32_machdep.c,v 1.3 2004/08/24 20:52:52 jhb Exp $");
 
 #include <sys/param.h>
 #include <sys/kernel.h>
@@ -849,8 +849,8 @@
 		ss.ss_size = lss.ss_size;
 		ss.ss_flags = linux_to_bsd_sigaltstack(lss.ss_flags);
 	}
-	error = kern_sigaltstack(td, (uap->uoss != NULL) ? &oss : NULL,
-	    (uap->uss != NULL) ? &ss : NULL);
+	error = kern_sigaltstack(td, (uap->uss != NULL) ? &ss : NULL,
+	    (uap->uoss != NULL) ? &oss : NULL);
 	if (!error && uap->uoss != NULL) {
 		lss.ss_sp = PTROUT(oss.ss_sp);
 		lss.ss_size = oss.ss_size;

==== //depot/projects/nsched/sys/compat/linux/linux_socket.c#5 (text+ko) ====

@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/compat/linux/linux_socket.c,v 1.52 2004/08/23 12:41:29 des Exp $");
+__FBSDID("$FreeBSD: src/sys/compat/linux/linux_socket.c,v 1.53 2004/08/24 20:21:21 jhb Exp $");
 
 /* XXX we use functions that might not exist. */
 #include "opt_compat.h"
@@ -674,12 +674,7 @@
 	struct close_args /* {
 		int     fd;
 	} */ c_args;
-	struct fcntl_args /* {
-		int	fd;
-		int	cmd;
-		long	arg;
-	} */ f_args;
-	int error;
+	int error, fd;
 
 	if ((error = copyin(args, &linux_args, sizeof(linux_args))))
 		return (error);
@@ -705,11 +700,9 @@
 	 * accepted one, so we must clear the flags in the new descriptor.
 	 * Ignore any errors, because we already have an open fd.
 	 */
-	f_args.fd = td->td_retval[0];
-	f_args.cmd = F_SETFL;
-	f_args.arg = 0;
-	(void)fcntl(td, &f_args);
-	td->td_retval[0] = f_args.fd;
+	fd = td->td_retval[0];
+	(void)kern_fcntl(td, fd, F_SETFL, 0);
+	td->td_retval[0] = fd;
 	return (0);
 }
 

==== //depot/projects/nsched/sys/compat/svr4/svr4_fcntl.c#2 (text+ko) ====

@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/compat/svr4/svr4_fcntl.c,v 1.32 2003/06/22 08:41:41 phk Exp $");
+__FBSDID("$FreeBSD: src/sys/compat/svr4/svr4_fcntl.c,v 1.33 2004/08/24 20:21:21 jhb Exp $");
 
 #include "opt_mac.h"
 
@@ -46,6 +46,7 @@
 #include <sys/namei.h>
 #include <sys/proc.h>
 #include <sys/stat.h>
+#include <sys/syscallsubr.h>
 #include <sys/unistd.h>
 #include <sys/vnode.h>
 
@@ -580,29 +581,24 @@
 	register struct thread *td;
 	struct svr4_sys_fcntl_args *uap;
 {
-	int				error;
-	struct fcntl_args		fa;
-	int                             *retval;
+	int cmd, error, *retval;
 
 	retval = td->td_retval;
 
-	fa.fd = uap->fd;
-	fa.cmd = svr4_to_bsd_cmd(uap->cmd);
+	cmd = svr4_to_bsd_cmd(uap->cmd);
 
-	switch (fa.cmd) {
+	switch (cmd) {
 	case F_DUPFD:
 	case F_GETFD:
 	case F_SETFD:
-		fa.arg = (long) uap->arg;
-		return fcntl(td, &fa);
+		return (kern_fcntl(td, uap->fd, cmd, (intptr_t)uap->arg));
 
 	case F_GETFL:
-		fa.arg = (long) uap->arg;
-		error = fcntl(td, &fa);
+		error = kern_fcntl(td, uap->fd, cmd, (intptr_t)uap->arg);
 		if (error)
-			return error;
+			return (error);
 		*retval = bsd_to_svr4_flags(*retval);
-		return error;
+		return (error);
 
 	case F_SETFL:
 		{
@@ -610,55 +606,39 @@
 			 * we must save the O_ASYNC flag, as that is
 			 * handled by ioctl(_, I_SETSIG, _) emulation.
 			 */
-			long cmd;
 			int flags;
 
 			DPRINTF(("Setting flags %p\n", uap->arg));
-			cmd = fa.cmd; /* save it for a while */
 
-			fa.cmd = F_GETFL;
-			if ((error = fcntl(td, &fa)) != 0)
-				return error;
+			error = kern_fcntl(td, uap->fd, F_GETFL, 0);
+			if (error)
+				return (error);
 			flags = *retval;
 			flags &= O_ASYNC;
 			flags |= svr4_to_bsd_flags((u_long) uap->arg);
-			fa.cmd = cmd;
-			fa.arg = (long) flags;
-			return fcntl(td, &fa);
+			return (kern_fcntl(td, uap->fd, F_SETFL, flags));
 		}
 
 	case F_GETLK:
 	case F_SETLK:
 	case F_SETLKW:
 		{
-			struct svr4_flock	 ifl;
-			struct flock		*flp, fl;
-			caddr_t sg = stackgap_init();
+			struct svr4_flock	ifl;
+			struct flock		fl;
 
-			flp = stackgap_alloc(&sg, sizeof(struct flock));
-			fa.arg = (long) flp;
-
-			error = copyin(uap->arg, &ifl, sizeof ifl);
+			error = copyin(uap->arg, &ifl, sizeof (ifl));
 			if (error)
-				return error;
+				return (error);
 
 			svr4_to_bsd_flock(&ifl, &fl);
 
-			error = copyout(&fl, flp, sizeof fl);
-			if (error)
-				return error;
+			error = kern_fcntl(td, uap->fd, cmd, (intptr_t)&fl);
+			if (error || cmd != F_GETLK)
+				return (error);
 
-			error = fcntl(td, &fa);
-			if (error || fa.cmd != F_GETLK)
-				return error;
-
-			error = copyin(flp, &fl, sizeof fl);
-			if (error)
-				return error;
-
 			bsd_to_svr4_flock(&fl, &ifl);
 
-			return copyout(&ifl, uap->arg, sizeof ifl);
+			return (copyout(&ifl, uap->arg, sizeof (ifl)));
 		}
 	case -1:
 		switch (uap->cmd) {
@@ -692,36 +672,36 @@
 		case SVR4_F_SETLK64:
 		case SVR4_F_SETLKW64:
 			{
-				struct svr4_flock64	 ifl;
-				struct flock		*flp, fl;
-				caddr_t sg = stackgap_init();
+				struct svr4_flock64	ifl;
+				struct flock		fl;
 
-				flp = stackgap_alloc(&sg, sizeof(struct flock));
-				fa.arg = (long) flp;
-
+				switch (uap->cmd) {
+				case SVR4_F_GETLK64:
+					cmd = F_GETLK;
+					break;
+				case SVR4_F_SETLK64:
+					cmd = F_SETLK;
+					break;					
+				case SVR4_F_SETLKW64:
+					cmd = F_SETLKW;
+					break;
+				}
 				error = copyin(uap->arg, &ifl,
-				    sizeof ifl);
+				    sizeof (ifl));
 				if (error)
-					return error;
+					return (error);
 
 				svr4_to_bsd_flock64(&ifl, &fl);
 
-				error = copyout(&fl, flp, sizeof fl);
-				if (error)
-					return error;
+				error = kern_fcntl(td, uap->fd, cmd,
+				    (intptr_t)&fl);
+				if (error || cmd != F_GETLK)
+					return (error);
 
-				error = fcntl(td, &fa);
-				if (error || fa.cmd != F_GETLK)
-					return error;
-
-				error = copyin(flp, &fl, sizeof fl);
-				if (error)
-					return error;
-
 				bsd_to_svr4_flock64(&fl, &ifl);
 
-				return copyout(&ifl, uap->arg,
-				    sizeof ifl);
+				return (copyout(&ifl, uap->arg,
+				    sizeof (ifl)));
 			}
 
 		case SVR4_F_FREESP64:

==== //depot/projects/nsched/sys/compat/svr4/svr4_proto.h#2 (text+ko) ====

@@ -2,8 +2,8 @@
  * System call prototypes.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * $FreeBSD: src/sys/compat/svr4/svr4_proto.h,v 1.15 2004/02/06 20:21:18 jhb Exp $
- * created from FreeBSD: src/sys/compat/svr4/syscalls.master,v 1.15 2004/02/06 20:07:33 jhb Exp 
+ * $FreeBSD: src/sys/compat/svr4/svr4_proto.h,v 1.16 2004/08/24 20:24:33 jhb Exp $
+ * created from FreeBSD: src/sys/compat/svr4/syscalls.master,v 1.16 2004/08/24 20:21:21 jhb Exp 
  */
 
 #ifndef _SVR4_SYSPROTO_H_

==== //depot/projects/nsched/sys/compat/svr4/svr4_stream.c#5 (text+ko) ====

@@ -36,7 +36,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/compat/svr4/svr4_stream.c,v 1.49 2004/07/10 15:42:16 phk Exp $");
+__FBSDID("$FreeBSD: src/sys/compat/svr4/svr4_stream.c,v 1.50 2004/08/24 20:21:21 jhb Exp $");
 
 #define COMPAT_43 1
 
@@ -60,6 +60,7 @@
 #include <sys/socket.h>
 #include <sys/socketvar.h>
 #include <sys/stat.h>
+#include <sys/syscallsubr.h>
 #include <sys/sysproto.h>
 #include <sys/uio.h>
 #include <sys/ktrace.h>		/* Must come after sys/uio.h */
@@ -1473,7 +1474,6 @@
 	 * We alse have to fix the O_ASYNC fcntl bit, so the
 	 * process will get SIGPOLLs.
 	 */
-	struct fcntl_args fa;
 	int error;
 	register_t oflags, flags;
 	struct svr4_strm *st = svr4_stream_get(fp);
@@ -1483,10 +1483,9 @@
 		return EINVAL;
 	}
 	/* get old status flags */
-	fa.fd = fd;
-	fa.cmd = F_GETFL;
-	if ((error = fcntl(td, &fa)) != 0)
-		return error;
+	error = kern_fcntl(td, fd, F_GETFL, 0);
+	if (error)
+		return (error);
 
 	oflags = td->td_retval[0];
 
@@ -1512,19 +1511,15 @@
 
 	/* set the new flags, if changed */
 	if (flags != oflags) {
-		fa.cmd = F_SETFL;
-		fa.arg = (long) flags;
-		if ((error = fcntl(td, &fa)) != 0)
-			  return error;
+		error = kern_fcntl(td, fd, F_SETFL, flags);
+		if (error)
+			return (error);
 		flags = td->td_retval[0];
 	}
 
 	/* set up SIGIO receiver if needed */
-	if (dat != NULL) {
-		fa.cmd = F_SETOWN;
-		fa.arg = (long) td->td_proc->p_pid;
-		return fcntl(td, &fa);
-	}
+	if (dat != NULL)
+		return (kern_fcntl(td, fd, F_SETOWN, td->td_proc->p_pid));
 	return 0;
 }
 

==== //depot/projects/nsched/sys/compat/svr4/svr4_syscall.h#2 (text+ko) ====

@@ -2,8 +2,8 @@
  * System call numbers.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * $FreeBSD: src/sys/compat/svr4/svr4_syscall.h,v 1.13 2004/02/06 20:21:18 jhb Exp $
- * created from FreeBSD: src/sys/compat/svr4/syscalls.master,v 1.15 2004/02/06 20:07:33 jhb Exp 
+ * $FreeBSD: src/sys/compat/svr4/svr4_syscall.h,v 1.14 2004/08/24 20:24:33 jhb Exp $
+ * created from FreeBSD: src/sys/compat/svr4/syscalls.master,v 1.16 2004/08/24 20:21:21 jhb Exp 
  */
 
 #define	SVR4_SYS_exit	1

==== //depot/projects/nsched/sys/compat/svr4/svr4_syscallnames.c#2 (text+ko) ====

@@ -2,8 +2,8 @@
  * System call names.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * $FreeBSD: src/sys/compat/svr4/svr4_syscallnames.c,v 1.13 2004/02/06 20:21:18 jhb Exp $
- * created from FreeBSD: src/sys/compat/svr4/syscalls.master,v 1.15 2004/02/06 20:07:33 jhb Exp 
+ * $FreeBSD: src/sys/compat/svr4/svr4_syscallnames.c,v 1.14 2004/08/24 20:24:33 jhb Exp $
+ * created from FreeBSD: src/sys/compat/svr4/syscalls.master,v 1.16 2004/08/24 20:21:21 jhb Exp 
  */
 
 const char *svr4_syscallnames[] = {

==== //depot/projects/nsched/sys/compat/svr4/svr4_sysent.c#2 (text+ko) ====

@@ -2,8 +2,8 @@
  * System call switch table.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * $FreeBSD: src/sys/compat/svr4/svr4_sysent.c,v 1.14 2004/02/06 20:21:18 jhb Exp $
- * created from FreeBSD: src/sys/compat/svr4/syscalls.master,v 1.15 2004/02/06 20:07:33 jhb Exp 
+ * $FreeBSD: src/sys/compat/svr4/svr4_sysent.c,v 1.15 2004/08/24 20:24:33 jhb Exp $
+ * created from FreeBSD: src/sys/compat/svr4/syscalls.master,v 1.16 2004/08/24 20:21:21 jhb Exp 
  */
 
 #include <sys/types.h>
@@ -85,7 +85,7 @@
 	{ AS(svr4_sys_execve_args), (sy_call_t *)svr4_sys_execve },	/* 59 = svr4_sys_execve */
 	{ SYF_MPSAFE | AS(umask_args), (sy_call_t *)umask },	/* 60 = umask */
 	{ AS(chroot_args), (sy_call_t *)chroot },	/* 61 = chroot */
-	{ AS(svr4_sys_fcntl_args), (sy_call_t *)svr4_sys_fcntl },	/* 62 = svr4_sys_fcntl */
+	{ SYF_MPSAFE | AS(svr4_sys_fcntl_args), (sy_call_t *)svr4_sys_fcntl },	/* 62 = svr4_sys_fcntl */
 	{ SYF_MPSAFE | AS(svr4_sys_ulimit_args), (sy_call_t *)svr4_sys_ulimit },	/* 63 = svr4_sys_ulimit */
 	{ 0, (sy_call_t *)nosys },			/* 64 = reserved */
 	{ 0, (sy_call_t *)nosys },			/* 65 = reserved */

==== //depot/projects/nsched/sys/compat/svr4/syscalls.master#2 (text+ko) ====

@@ -1,4 +1,4 @@
- $FreeBSD: src/sys/compat/svr4/syscalls.master,v 1.15 2004/02/06 20:07:33 jhb Exp $
+ $FreeBSD: src/sys/compat/svr4/syscalls.master,v 1.16 2004/08/24 20:21:21 jhb Exp $
 ;	from: @(#)syscalls.master	8.1 (Berkeley) 7/19/93
 ;
 ; System call name/number master file (or rather, slave, from SVR4).
@@ -100,7 +100,7 @@
 59	STD	{ int svr4_sys_execve(char *path, char **argp, char **envp); }
 60	MNOPROTO { int umask(int newmask); }
 61	NOPROTO	{ int chroot(char *path); }
-62	STD	{ int svr4_sys_fcntl(int fd, int cmd, char *arg); }
+62	MSTD	{ int svr4_sys_fcntl(int fd, int cmd, char *arg); }
 63	MSTD	{ int svr4_sys_ulimit(int cmd, long newlimit); }
 64	UNIMPL	reserved
 65	UNIMPL	reserved

==== //depot/projects/nsched/sys/conf/ldscript.ia64#3 (text+ko) ====

@@ -1,4 +1,4 @@
-/* $FreeBSD: src/sys/conf/ldscript.ia64,v 1.11 2004/06/20 22:32:19 marcel Exp $ */
+/* $FreeBSD: src/sys/conf/ldscript.ia64,v 1.12 2004/08/25 07:43:28 marcel Exp $ */
 OUTPUT_FORMAT("elf64-ia64-little", "elf64-ia64-little", "elf64-ia64-little")
 OUTPUT_ARCH(ia64)
 ENTRY(__start)
@@ -30,6 +30,7 @@
   .rela.bss       : { *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) }
   .rela.plt       : { *(.rela.plt) }
   .rela.IA_64.pltoff   : { *(.rela.IA_64.pltoff) }
+  PROVIDE (btext = .);
   .init           :
   {
     *(.init)

==== //depot/projects/nsched/sys/dev/acpica/acpi_lid.c#7 (text+ko) ====

@@ -28,7 +28,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/acpica/acpi_lid.c,v 1.26 2004/08/13 06:21:55 njl Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/acpica/acpi_lid.c,v 1.27 2004/08/25 20:09:15 njl Exp $");
 
 #include "opt_acpi.h"
 #include <sys/param.h>
@@ -103,7 +103,6 @@
     sc = device_get_softc(dev);
     sc->lid_dev = dev;
     sc->lid_handle = acpi_get_handle(dev);
-    sc->lid_status = -1;
 
     /*
      * If a system does not get lid events, it may make sense to change
@@ -117,10 +116,6 @@
     acpi_wake_init(dev, ACPI_GPE_TYPE_WAKE_RUN);
     acpi_wake_set_enable(dev, 1);
 
-    /* Attempt to get the initial lid switch state. */
-    AcpiOsQueueForExecution(OSD_PRIORITY_LO, acpi_lid_notify_status_changed,
-	sc);
-
     return (0);
 }
 
@@ -142,42 +137,34 @@
     struct acpi_lid_softc	*sc;
     struct acpi_softc		*acpi_sc;
     ACPI_STATUS			status;
-    int				lid_status, old_status;
 
     ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__);
 
     sc = (struct acpi_lid_softc *)arg;
+    ACPI_SERIAL_BEGIN(lid);
 
     /*
      * Evaluate _LID and check the return value, update lid status.
      *	Zero:		The lid is closed
      *	Non-zero:	The lid is open
      */
-    status = acpi_GetInteger(sc->lid_handle, "_LID", &lid_status);
+    status = acpi_GetInteger(sc->lid_handle, "_LID", &sc->lid_status);
     if (ACPI_FAILURE(status))
-	return_VOID;
+	goto out;
+
+    acpi_sc = acpi_device_get_parent_softc(sc->lid_dev);
+    if (acpi_sc == NULL)
+	goto out;
 
-    ACPI_SERIAL_BEGIN(lid);
-    if (lid_status != sc->lid_status) {
-	old_status = sc->lid_status;
-	sc->lid_status = lid_status;
+    ACPI_VPRINT(sc->lid_dev, acpi_sc, "Lid %s\n",
+		sc->lid_status ? "opened" : "closed");
 
-	/* If this is the initialization pass, skip the notification. */
-	if (old_status == -1)
-	    goto out;
+    acpi_UserNotify("Lid", sc->lid_handle, sc->lid_status);
 
-	/* Since the status has changed, notify the system. */
-	acpi_sc = acpi_device_get_parent_softc(sc->lid_dev);
-	if (acpi_sc == NULL)
-	    goto out;
-	ACPI_VPRINT(sc->lid_dev, acpi_sc, "Lid %s\n",
-	    lid_status ? "opened" : "closed");
-	acpi_UserNotify("Lid", sc->lid_handle, lid_status);
-	if (lid_status == 0)
-	    EVENTHANDLER_INVOKE(acpi_sleep_event, acpi_sc->acpi_lid_switch_sx);
-	else
-	    EVENTHANDLER_INVOKE(acpi_wakeup_event, acpi_sc->acpi_lid_switch_sx);
-    }
+    if (sc->lid_status == 0)
+	EVENTHANDLER_INVOKE(acpi_sleep_event, acpi_sc->acpi_lid_switch_sx);
+    else
+	EVENTHANDLER_INVOKE(acpi_wakeup_event, acpi_sc->acpi_lid_switch_sx);
 
 out:
     ACPI_SERIAL_END(lid);


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


More information about the p4-projects mailing list