PERFORCE change 49868 for review

Robert Watson rwatson at FreeBSD.org
Sun Mar 28 18:33:30 PST 2004


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

Change 49868 by rwatson at rwatson_paprika on 2004/03/28 18:33:01

	sparc64/alpha kstack size fix.
	alpha linux madvise() support.
	More NDISability.
	mtx_lock(&Giant) -> NET_LOCK_GIANT() in socket fd operations; in the
	  IFC, this actually adds conditional locking back.
	mtx_unlock(&Giant) -> NET_UNLOCK_GIANT() in socket syscalls; in the
	  IFC, this actually adds conditional locking back.

Affected files ...

.. //depot/projects/netperf_socket/sys/alpha/alpha/vm_machdep.c#3 integrate
.. //depot/projects/netperf_socket/sys/alpha/linux/linux_dummy.c#2 integrate
.. //depot/projects/netperf_socket/sys/alpha/linux/linux_proto.h#4 integrate
.. //depot/projects/netperf_socket/sys/alpha/linux/linux_syscall.h#4 integrate
.. //depot/projects/netperf_socket/sys/alpha/linux/linux_sysent.c#4 integrate
.. //depot/projects/netperf_socket/sys/alpha/linux/syscalls.master#4 integrate
.. //depot/projects/netperf_socket/sys/compat/ndis/kern_ndis.c#9 integrate
.. //depot/projects/netperf_socket/sys/compat/ndis/ndis_var.h#4 integrate
.. //depot/projects/netperf_socket/sys/compat/ndis/ntoskrnl_var.h#6 integrate
.. //depot/projects/netperf_socket/sys/compat/ndis/resource_var.h#2 integrate
.. //depot/projects/netperf_socket/sys/conf/kern.pre.mk#9 integrate
.. //depot/projects/netperf_socket/sys/dev/if_ndis/if_ndis.c#7 integrate
.. //depot/projects/netperf_socket/sys/kern/sys_socket.c#4 integrate
.. //depot/projects/netperf_socket/sys/kern/uipc_syscalls.c#6 integrate
.. //depot/projects/netperf_socket/sys/sparc64/sparc64/vm_machdep.c#4 integrate

Differences ...

==== //depot/projects/netperf_socket/sys/alpha/alpha/vm_machdep.c#3 (text+ko) ====

@@ -67,9 +67,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/alpha/alpha/vm_machdep.c,v 1.100 2004/03/16 19:04:27 alc Exp $");
-
-#include "opt_kstack_pages.h"
+__FBSDID("$FreeBSD: src/sys/alpha/alpha/vm_machdep.c,v 1.101 2004/03/29 02:01:42 kensmith Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -137,7 +135,7 @@
 
 	p1 = td1->td_proc;
 	td2->td_pcb = (struct pcb *)
-	    (td2->td_kstack + KSTACK_PAGES * PAGE_SIZE) - 1;
+	    (td2->td_kstack + td2->td_kstack_pages * PAGE_SIZE) - 1;
 	td2->td_md.md_flags = td1->td_md.md_flags & MDTD_FPUSED;
 	PROC_LOCK(p2);
 	p2->p_md.md_uac = p1->p_md.md_uac;
@@ -276,7 +274,7 @@
 {
 
 	td->td_pcb =
-	    (struct pcb *)(td->td_kstack + KSTACK_PAGES * PAGE_SIZE) - 1;
+	    (struct pcb *)(td->td_kstack + td->td_kstack_pages * PAGE_SIZE) - 1;
 	td->td_md.md_pcbpaddr = (void*)vtophys((vm_offset_t)td->td_pcb);
 	td->td_frame = (struct trapframe *)((caddr_t)td->td_pcb) - 1;
 }

==== //depot/projects/netperf_socket/sys/alpha/linux/linux_dummy.c#2 (text+ko) ====

@@ -28,7 +28,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/alpha/linux/linux_dummy.c,v 1.37 2003/08/22 07:20:26 imp Exp $");
+__FBSDID("$FreeBSD: src/sys/alpha/linux/linux_dummy.c,v 1.38 2004/03/29 02:19:43 bms Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -66,7 +66,6 @@
 DUMMY(getdtablesize);
 DUMMY(gethostname);
 DUMMY(getpagesize);
-DUMMY(madvise);
 DUMMY(mincore);
 DUMMY(old_adjtimex);
 DUMMY(pciconfig_iobase);

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

@@ -2,7 +2,7 @@
  * System call prototypes.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * $FreeBSD: src/sys/alpha/linux/linux_proto.h,v 1.16 2004/03/15 22:44:35 jhb Exp $
+ * $FreeBSD: src/sys/alpha/linux/linux_proto.h,v 1.17 2004/03/29 02:19:43 bms Exp $
  * created from FreeBSD: src/sys/alpha/linux/syscalls.master,v 1.56 2004/03/15 22:43:48 jhb Exp 
  */
 
@@ -150,9 +150,6 @@
 	char len_l_[PADL_(l_size_t)]; l_size_t len; char len_r_[PADR_(l_size_t)];
 	char prot_l_[PADL_(l_ulong)]; l_ulong prot; char prot_r_[PADR_(l_ulong)];
 };
-struct linux_madvise_args {
-	register_t dummy;
-};
 struct linux_vhangup_args {
 	register_t dummy;
 };
@@ -612,7 +609,6 @@
 int	linux_mmap(struct thread *, struct linux_mmap_args *);
 int	linux_munmap(struct thread *, struct linux_munmap_args *);
 int	linux_mprotect(struct thread *, struct linux_mprotect_args *);
-int	linux_madvise(struct thread *, struct linux_madvise_args *);
 int	linux_vhangup(struct thread *, struct linux_vhangup_args *);
 int	linux_setgroups(struct thread *, struct linux_setgroups_args *);
 int	linux_getgroups(struct thread *, struct linux_getgroups_args *);

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

@@ -2,7 +2,7 @@
  * System call numbers.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * $FreeBSD: src/sys/alpha/linux/linux_syscall.h,v 1.14 2004/03/15 22:44:35 jhb Exp $
+ * $FreeBSD: src/sys/alpha/linux/linux_syscall.h,v 1.15 2004/03/29 02:19:43 bms Exp $
  * created from FreeBSD: src/sys/alpha/linux/syscalls.master,v 1.56 2004/03/15 22:43:48 jhb Exp 
  */
 
@@ -51,7 +51,7 @@
 #define	LINUX_SYS_linux_mmap	71
 #define	LINUX_SYS_linux_munmap	73
 #define	LINUX_SYS_linux_mprotect	74
-#define	LINUX_SYS_linux_madvise	75
+#define	LINUX_SYS_madvise	75
 #define	LINUX_SYS_linux_vhangup	76
 #define	LINUX_SYS_linux_setgroups	79
 #define	LINUX_SYS_linux_getgroups	80

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

@@ -2,7 +2,7 @@
  * System call switch table.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * $FreeBSD: src/sys/alpha/linux/linux_sysent.c,v 1.14 2004/03/15 22:44:35 jhb Exp $
+ * $FreeBSD: src/sys/alpha/linux/linux_sysent.c,v 1.15 2004/03/29 02:19:43 bms Exp $
  * created from FreeBSD: src/sys/alpha/linux/syscalls.master,v 1.56 2004/03/15 22:43:48 jhb Exp 
  */
 
@@ -92,7 +92,7 @@
 	{ 0, (sy_call_t *)nosys },			/* 72 =  */
 	{ AS(linux_munmap_args), (sy_call_t *)linux_munmap },	/* 73 = linux_munmap */
 	{ AS(linux_mprotect_args), (sy_call_t *)linux_mprotect },	/* 74 = linux_mprotect */
-	{ 0, (sy_call_t *)linux_madvise },		/* 75 = linux_madvise */
+	{ SYF_MPSAFE | AS(madvise_args), (sy_call_t *)madvise },	/* 75 = madvise */
 	{ 0, (sy_call_t *)linux_vhangup },		/* 76 = linux_vhangup */
 	{ 0, (sy_call_t *)nosys },			/* 77 =  */
 	{ 0, (sy_call_t *)nosys },			/* 78 =  */

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

@@ -1,4 +1,4 @@
- $FreeBSD: src/sys/alpha/linux/syscalls.master,v 1.56 2004/03/15 22:43:48 jhb Exp $
+ $FreeBSD: src/sys/alpha/linux/syscalls.master,v 1.57 2004/03/29 02:19:43 bms Exp $
 
 ;	@(#)syscalls.master	8.1 (Berkeley) 7/19/93
 ; System call name/number master file (or rather, slave, from LINUX).
@@ -114,7 +114,7 @@
 73	STD	{ int linux_munmap(l_ulong addr, l_size_t len); }
 74	STD	{ int linux_mprotect(l_ulong addr, l_size_t len, \
 				l_ulong prot); }
-75	STD	{ int linux_madvise(void); }
+75	MNOPROTO { int madvise(void *addr, size_t len, int behav); }
 76	STD	{ int linux_vhangup(void); }
 77	UNIMPL
 78	UNIMPL

==== //depot/projects/netperf_socket/sys/compat/ndis/kern_ndis.c#9 (text+ko) ====

@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/compat/ndis/kern_ndis.c,v 1.47 2004/03/25 18:31:52 wpaul Exp $");
+__FBSDID("$FreeBSD: src/sys/compat/ndis/kern_ndis.c,v 1.48 2004/03/29 02:15:29 wpaul Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -824,18 +824,28 @@
 			switch (brle->type) {
 			case SYS_RES_IOPORT:
 				prd->cprd_type = CmResourceTypePort;
+				prd->cprd_flags = CM_RESOURCE_PORT_IO;
+				prd->cprd_sharedisp =
+				    CmResourceShareDeviceExclusive;
 				prd->u.cprd_port.cprd_start.np_quad =
 				    brle->start;
 				prd->u.cprd_port.cprd_len = brle->count;
 				break;
 			case SYS_RES_MEMORY:
 				prd->cprd_type = CmResourceTypeMemory;
+				prd->cprd_flags =
+				    CM_RESOURCE_MEMORY_READ_WRITE;
+				prd->cprd_sharedisp =
+				    CmResourceShareDeviceExclusive;
 				prd->u.cprd_port.cprd_start.np_quad =
 				    brle->start;
 				prd->u.cprd_port.cprd_len = brle->count;
 				break;
 			case SYS_RES_IRQ:
 				prd->cprd_type = CmResourceTypeInterrupt;
+				prd->cprd_flags = 0;
+				prd->cprd_sharedisp =
+				    CmResourceShareDeviceExclusive;
 				prd->u.cprd_intr.cprd_level = brle->start;
 				prd->u.cprd_intr.cprd_vector = brle->start;
 				prd->u.cprd_intr.cprd_affinity = 0;

==== //depot/projects/netperf_socket/sys/compat/ndis/ndis_var.h#4 (text+ko) ====

@@ -29,7 +29,7 @@
  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
  * THE POSSIBILITY OF SUCH DAMAGE.
  *
- * $FreeBSD: src/sys/compat/ndis/ndis_var.h,v 1.22 2004/03/20 23:39:43 wpaul Exp $
+ * $FreeBSD: src/sys/compat/ndis/ndis_var.h,v 1.23 2004/03/29 02:15:29 wpaul Exp $
  */
 
 #ifndef _NDIS_VAR_H_
@@ -1512,6 +1512,7 @@
 extern int ndis_add_sysctl(void *, char *, char *, char *, int);
 extern int ndis_flush_sysctls(void *);
 extern int ndis_sched(void (*)(void *), void *, int);
+extern int ndis_unsched(void (*)(void *), void *, int);
 __END_DECLS
 
 #endif /* _NDIS_VAR_H_ */

==== //depot/projects/netperf_socket/sys/compat/ndis/ntoskrnl_var.h#6 (text+ko) ====

@@ -29,7 +29,7 @@
  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
  * THE POSSIBILITY OF SUCH DAMAGE.
  *
- * $FreeBSD: src/sys/compat/ndis/ntoskrnl_var.h,v 1.11 2004/03/22 00:41:41 wpaul Exp $
+ * $FreeBSD: src/sys/compat/ndis/ntoskrnl_var.h,v 1.12 2004/03/29 02:15:29 wpaul Exp $
  */
 
 #ifndef _NTOSKRNL_VAR_H_
@@ -261,7 +261,7 @@
 	void			*k_deferredctx;
 	void			*k_sysarg1;
 	void			*k_sysarg2;
-	uint32_t		*k_lock;
+	register_t		k_lock;
 };
 
 typedef struct kdpc kdpc;
@@ -480,6 +480,8 @@
 extern int ntoskrnl_libinit(void);
 extern int ntoskrnl_libfini(void);
 __stdcall extern void ntoskrnl_init_dpc(kdpc *, void *, void *);
+__stdcall extern uint8_t ntoskrnl_queue_dpc(kdpc *, void *, void *);
+__stdcall extern uint8_t ntoskrnl_dequeue_dpc(kdpc *);
 __stdcall extern void ntoskrnl_init_timer(ktimer *);
 __stdcall extern void ntoskrnl_init_timer_ex(ktimer *, uint32_t);
 __stdcall extern uint8_t ntoskrnl_set_timer(ktimer *, int64_t, kdpc *);  

==== //depot/projects/netperf_socket/sys/compat/ndis/resource_var.h#2 (text+ko) ====

@@ -1,6 +1,6 @@
 
 /*
- * $FreeBSD: src/sys/compat/ndis/resource_var.h,v 1.1 2003/12/11 22:34:37 wpaul Exp $
+ * $FreeBSD: src/sys/compat/ndis/resource_var.h,v 1.2 2004/03/29 02:15:29 wpaul Exp $
  */
 
 typedef int cm_resource_type;
@@ -97,6 +97,7 @@
 struct cm_partial_resource_desc {
 	uint8_t			cprd_type;
 	uint8_t			cprd_sharedisp;
+	uint16_t		cprd_flags;
 	union {
 		struct {
 			physaddr		cprd_start;

==== //depot/projects/netperf_socket/sys/conf/kern.pre.mk#9 (text+ko) ====

@@ -1,4 +1,4 @@
-# $FreeBSD: src/sys/conf/kern.pre.mk,v 1.49 2004/03/25 00:02:49 obrien Exp $
+# $FreeBSD: src/sys/conf/kern.pre.mk,v 1.50 2004/03/29 01:15:39 kensmith Exp $
 
 # Part of a unified Makefile for building kernels.  This part contains all
 # of the definitions that need to be before %BEFORE_DEPEND.
@@ -19,10 +19,12 @@
 .if ${CC} == "icc"
 COPTFLAGS?=-O
 .else
-. if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "sparc64"
+. if ${MACHINE_ARCH} == "amd64"
 COPTFLAGS?=-O2 -frename-registers -pipe
 . elif ${MACHINE_ARCH} == "ia64"
 COPTFLAGS?=-O2 -pipe
+. elif ${MACHINE_ARCH} == "sparc64"
+COPTFLAGS?=-O2 -pipe
 . else
 COPTFLAGS?=-O -pipe
 . endif

==== //depot/projects/netperf_socket/sys/dev/if_ndis/if_ndis.c#7 (text+ko) ====

@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/if_ndis/if_ndis.c,v 1.50 2004/03/24 05:35:03 wpaul Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/if_ndis/if_ndis.c,v 1.51 2004/03/29 02:15:29 wpaul Exp $");
 
 #include "opt_bdg.h"
 
@@ -153,6 +153,8 @@
 		return;
 	}
 
+	if (TAILQ_EMPTY(&ifp->if_multiaddrs))
+		return;
 
 	len = sizeof(mclistsz);
 	ndis_get_info(sc, OID_802_3_MAXIMUM_LIST_SIZE, &mclistsz, &len);

==== //depot/projects/netperf_socket/sys/kern/sys_socket.c#4 (text+ko) ====

@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/kern/sys_socket.c,v 1.55 2003/06/18 18:16:39 phk Exp $");
+__FBSDID("$FreeBSD: src/sys/kern/sys_socket.c,v 1.56 2004/03/29 01:55:32 rwatson Exp $");
 
 #include "opt_mac.h"
 
@@ -79,12 +79,16 @@
 	struct socket *so = fp->f_data;
 	int error;
 
+	NET_LOCK_GIANT();
 #ifdef MAC
 	error = mac_check_socket_receive(active_cred, so);
-	if (error)
+	if (error) {
+		NET_UNLOCK_GIANT();
 		return (error);
+	}
 #endif
 	error = so->so_proto->pr_usrreqs->pru_soreceive(so, 0, uio, 0, 0, 0);
+	NET_UNLOCK_GIANT();
 	return (error);
 }
 
@@ -100,13 +104,17 @@
 	struct socket *so = fp->f_data;
 	int error;
 
+	NET_LOCK_GIANT();
 #ifdef MAC
 	error = mac_check_socket_send(active_cred, so);
-	if (error)
+	if (error) {
+		NET_UNLOCK_GIANT();
 		return (error);
+	}
 #endif
 	error = so->so_proto->pr_usrreqs->pru_sosend(so, 0, uio, 0, 0, 0,
 						    uio->uio_td);
+	NET_UNLOCK_GIANT();
 	return (error);
 }
 

==== //depot/projects/netperf_socket/sys/kern/uipc_syscalls.c#6 (text+ko) ====

@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/kern/uipc_syscalls.c,v 1.175 2004/03/16 19:04:28 alc Exp $");
+__FBSDID("$FreeBSD: src/sys/kern/uipc_syscalls.c,v 1.177 2004/03/29 02:21:56 rwatson Exp $");
 
 #include "opt_compat.h"
 #include "opt_ktrace.h"
@@ -117,8 +117,10 @@
 	if (error)
 		return (error);
 	/* An extra reference on `fp' has been held for us by falloc(). */
+	NET_LOCK_GIANT();
 	error = socreate(uap->domain, &so, uap->type, uap->protocol,
 	    td->td_ucred, td);
+	NET_UNLOCK_GIANT();
 	FILEDESC_LOCK(fdp);
 	if (error) {
 		if (fdp->fd_ofiles[fd] == fp) {
@@ -172,6 +174,7 @@
 	struct socket *so;
 	int error;
 
+	NET_LOCK_GIANT();
 	if ((error = fgetsock(td, fd, &so, NULL)) != 0)
 		goto done2;
 #ifdef MAC
@@ -186,6 +189,7 @@
 #endif
 	fputsock(so);
 done2:
+	NET_UNLOCK_GIANT();
 	FREE(sa, M_SONAME);
 	return (error);
 }
@@ -205,6 +209,7 @@
 	struct socket *so;
 	int error;
 
+	NET_LOCK_GIANT();
 	if ((error = fgetsock(td, uap->s, &so, NULL)) == 0) {
 #ifdef MAC
 		/* XXXRW: MAC requires socket lock? */
@@ -218,6 +223,7 @@
 #endif
 		fputsock(so);
 	}
+	NET_UNLOCK_GIANT();
 	return(error);
 }
 
@@ -256,6 +262,7 @@
 			goto done3;
 		}
 	}
+	NET_LOCK_GIANT();
 	error = fgetsock(td, uap->s, &head, &fflag);
 	if (error)
 		goto done2;
@@ -411,6 +418,7 @@
 		fdrop(nfp, td);
 	fputsock(head);
 done2:
+	NET_UNLOCK_GIANT();
 done3:
 	return (error);
 }
@@ -475,6 +483,7 @@
 	int error, s;
 	int interrupted = 0;
 
+	NET_LOCK_GIANT();
 	if ((error = fgetsock(td, fd, &so, NULL)) != 0)
 		goto done2;
 	if (so->so_state & SS_ISCONNECTING) {
@@ -519,6 +528,7 @@
 done1:
 	fputsock(so);
 done2:
+	NET_UNLOCK_GIANT();
 	FREE(sa, M_SONAME);
 	return (error);
 }
@@ -541,6 +551,7 @@
 	struct socket *so1, *so2;
 	int fd, error, sv[2];
 
+	NET_LOCK_GIANT();
 	error = socreate(uap->domain, &so1, uap->type, uap->protocol,
 	    td->td_ucred, td);
 	if (error)
@@ -612,6 +623,7 @@
 free1:
 	(void)soclose(so1);
 done2:
+	NET_UNLOCK_GIANT();
 	return (error);
 }
 
@@ -697,6 +709,7 @@
 	int iovlen;
 #endif
 
+	NET_LOCK_GIANT();
 	if ((error = fgetsock(td, s, &so, NULL)) != 0)
 		goto bad2;
 
@@ -758,6 +771,7 @@
 bad:
 	fputsock(so);
 bad2:
+	NET_UNLOCK_GIANT();
 	return (error);
 }
 
@@ -937,7 +951,9 @@
 	int iovlen;
 #endif
 
+	NET_LOCK_GIANT();
 	if ((error = fgetsock(td, s, &so, NULL)) != 0) {
+		NET_UNLOCK_GIANT();
 		return (error);
 	}
 
@@ -946,6 +962,7 @@
 	error = mac_check_socket_receive(td->td_ucred, so);
 	if (error) {
 		fputsock(so);
+		NET_UNLOCK_GIANT();
 		return (error);
 	}
 #endif
@@ -961,6 +978,7 @@
 	for (i = 0; i < mp->msg_iovlen; i++, iov++) {
 		if ((auio.uio_resid += iov->iov_len) < 0) {
 			fputsock(so);
+			NET_UNLOCK_GIANT();
 			return (EINVAL);
 		}
 	}
@@ -1069,6 +1087,7 @@
 	}
 out:
 	fputsock(so);
+	NET_UNLOCK_GIANT();
 	if (fromsa)
 		FREE(fromsa, M_SONAME);
 	if (control)
@@ -1283,10 +1302,12 @@
 	struct socket *so;
 	int error;
 
+	NET_LOCK_GIANT();
 	if ((error = fgetsock(td, uap->s, &so, NULL)) == 0) {
 		error = soshutdown(so, uap->how);
 		fputsock(so);
 	}
+	NET_UNLOCK_GIANT();
 	return(error);
 }
 
@@ -1314,6 +1335,7 @@
 	if (uap->valsize < 0)
 		return (EINVAL);
 
+	NET_LOCK_GIANT();
 	if ((error = fgetsock(td, uap->s, &so, NULL)) == 0) {
 		sopt.sopt_dir = SOPT_SET;
 		sopt.sopt_level = uap->level;
@@ -1324,6 +1346,7 @@
 		error = sosetopt(so, &sopt);
 		fputsock(so);
 	}
+	NET_UNLOCK_GIANT();
 	return(error);
 }
 
@@ -1347,6 +1370,7 @@
 	struct  socket *so;
 	struct	sockopt sopt;
 
+	NET_LOCK_GIANT();
 	if ((error = fgetsock(td, uap->s, &so, NULL)) != 0)
 		goto done2;
 	if (uap->val) {
@@ -1376,6 +1400,7 @@
 done1:
 	fputsock(so);
 done2:
+	NET_UNLOCK_GIANT();
 	return (error);
 }
 
@@ -1400,6 +1425,7 @@
 	socklen_t len;
 	int error;
 
+	NET_LOCK_GIANT();
 	if ((error = fgetsock(td, uap->fdes, &so, NULL)) != 0)
 		goto done2;
 	error = copyin(uap->alen, &len, sizeof (len));
@@ -1433,6 +1459,7 @@
 done1:
 	fputsock(so);
 done2:
+	NET_UNLOCK_GIANT();
 	return (error);
 }
 
@@ -1483,6 +1510,7 @@
 	socklen_t len;
 	int error;
 
+	NET_LOCK_GIANT();
 	if ((error = fgetsock(td, uap->fdes, &so, NULL)) != 0)
 		goto done2;
 	if ((so->so_state & (SS_ISCONNECTED|SS_ISCONFIRMING)) == 0) {
@@ -1521,6 +1549,7 @@
 done1:
 	fputsock(so);
 done2:
+	NET_UNLOCK_GIANT();
 	return (error);
 }
 
@@ -1696,6 +1725,8 @@
 	int error, s, headersize = 0, headersent = 0;
 	struct iovec *hdr_iov = NULL;
 
+	NET_LOCK_GIANT();
+
 	hdtr_size = 0;
 
 	/*
@@ -2073,6 +2104,8 @@
 	if (m_header)
 		m_freem(m_header);
 
+	NET_UNLOCK_GIANT();
+
 	if (error == ERESTART)
 		error = EINTR;
 

==== //depot/projects/netperf_socket/sys/sparc64/sparc64/vm_machdep.c#4 (text+ko) ====

@@ -40,10 +40,9 @@
  *	from: @(#)vm_machdep.c	7.3 (Berkeley) 5/13/91
  *	Utah $Hdr: vm_machdep.c 1.16.1.1 89/06/23$
  * 	from: FreeBSD: src/sys/i386/i386/vm_machdep.c,v 1.167 2001/07/12
- * $FreeBSD: src/sys/sparc64/sparc64/vm_machdep.c,v 1.60 2004/03/23 23:12:02 tmm Exp $
+ * $FreeBSD: src/sys/sparc64/sparc64/vm_machdep.c,v 1.61 2004/03/29 01:24:13 kensmith Exp $
  */
 
-#include "opt_kstack_pages.h"
 #include "opt_pmap.h"
 
 #include <sys/param.h>
@@ -158,7 +157,7 @@
 {
 	struct pcb *pcb;
 
-	pcb = (struct pcb *)((td->td_kstack + KSTACK_PAGES * PAGE_SIZE -
+	pcb = (struct pcb *)((td->td_kstack + td->td_kstack_pages * PAGE_SIZE -
 	    sizeof(struct pcb)) & ~0x3fUL);
 	td->td_frame = (struct trapframe *)pcb - 1;
 	td->td_pcb = pcb;
@@ -240,8 +239,8 @@
 
 	/* The pcb must be aligned on a 64-byte boundary. */
 	pcb1 = td1->td_pcb;
-	pcb2 = (struct pcb *)((td2->td_kstack + KSTACK_PAGES * PAGE_SIZE -
-	    sizeof(struct pcb)) & ~0x3fUL);
+	pcb2 = (struct pcb *)((td2->td_kstack + td2->td_kstack_pages *
+	    PAGE_SIZE - sizeof(struct pcb)) & ~0x3fUL);
 	td2->td_pcb = pcb2;
 
 	/*


More information about the p4-projects mailing list