PERFORCE change 49841 for review
Robert Watson
rwatson at FreeBSD.org
Sun Mar 28 06:59:14 PST 2004
http://perforce.freebsd.org/chv.cgi?CH=49841
Change 49841 by rwatson at rwatson_paprika on 2004/03/28 06:58:50
Integ netperf_socket:
On alpha, pin interrupt threads to a particular CPU so that PAL
access is performed consistently from the same CPU.
amd64 feature mask printing.
Kernel stack size fixes across various platforms.
libthr uses thr_wake() and thr_suspend().
More NDIS hackery.
More ACPI hackery.
More cpumask changes.
Pipe performance optimizations.
in_pcb*() accepts creds not threads.
Additional IPv6 option handling.
Affected files ...
.. //depot/projects/netperf_socket/sys/alpha/alpha/interrupt.c#2 integrate
.. //depot/projects/netperf_socket/sys/amd64/amd64/identcpu.c#3 integrate
.. //depot/projects/netperf_socket/sys/amd64/amd64/vm_machdep.c#4 integrate
.. //depot/projects/netperf_socket/sys/amd64/conf/GENERIC#4 integrate
.. //depot/projects/netperf_socket/sys/boot/alpha/common/conf.c#2 integrate
.. //depot/projects/netperf_socket/sys/boot/i386/boot0/boot0ext.s#1 branch
.. //depot/projects/netperf_socket/sys/boot/i386/boot0ext/Makefile#1 branch
.. //depot/projects/netperf_socket/sys/compat/freebsd32/freebsd32_proto.h#3 integrate
.. //depot/projects/netperf_socket/sys/compat/freebsd32/freebsd32_syscall.h#3 integrate
.. //depot/projects/netperf_socket/sys/compat/freebsd32/freebsd32_syscalls.c#3 integrate
.. //depot/projects/netperf_socket/sys/compat/freebsd32/freebsd32_sysent.c#3 integrate
.. //depot/projects/netperf_socket/sys/compat/freebsd32/syscalls.master#3 integrate
.. //depot/projects/netperf_socket/sys/compat/ndis/kern_ndis.c#8 integrate
.. //depot/projects/netperf_socket/sys/compat/ndis/subr_ndis.c#6 integrate
.. //depot/projects/netperf_socket/sys/compat/ndis/subr_ntoskrnl.c#9 integrate
.. //depot/projects/netperf_socket/sys/conf/files.i386#10 integrate
.. //depot/projects/netperf_socket/sys/conf/files.powerpc#3 integrate
.. //depot/projects/netperf_socket/sys/conf/kern.pre.mk#8 integrate
.. //depot/projects/netperf_socket/sys/contrib/dev/acpica/acfreebsd.h#4 integrate
.. //depot/projects/netperf_socket/sys/dev/acpica/acpi.c#8 integrate
.. //depot/projects/netperf_socket/sys/dev/acpica/acpi_pcib.c#4 integrate
.. //depot/projects/netperf_socket/sys/dev/firewire/firewire.c#3 integrate
.. //depot/projects/netperf_socket/sys/dev/firewire/firewire.h#2 integrate
.. //depot/projects/netperf_socket/sys/dev/firewire/firewirereg.h#2 integrate
.. //depot/projects/netperf_socket/sys/dev/firewire/fwcrom.c#2 integrate
.. //depot/projects/netperf_socket/sys/dev/firewire/fwdev.c#3 integrate
.. //depot/projects/netperf_socket/sys/dev/firewire/fwdma.c#2 integrate
.. //depot/projects/netperf_socket/sys/dev/firewire/fwmem.c#2 integrate
.. //depot/projects/netperf_socket/sys/dev/firewire/fwohci.c#3 integrate
.. //depot/projects/netperf_socket/sys/dev/firewire/fwohci_pci.c#4 integrate
.. //depot/projects/netperf_socket/sys/dev/firewire/fwohcivar.h#2 integrate
.. //depot/projects/netperf_socket/sys/dev/firewire/if_fwe.c#2 integrate
.. //depot/projects/netperf_socket/sys/dev/firewire/sbp.c#2 integrate
.. //depot/projects/netperf_socket/sys/dev/firewire/sbp_targ.c#3 integrate
.. //depot/projects/netperf_socket/sys/dev/if_ndis/if_ndis.c#6 integrate
.. //depot/projects/netperf_socket/sys/dev/ips/ips.h#4 integrate
.. //depot/projects/netperf_socket/sys/dev/isp/isp_sbus.c#3 integrate
.. //depot/projects/netperf_socket/sys/dev/pccard/pccarddevs#3 integrate
.. //depot/projects/netperf_socket/sys/dev/pccard/pccarddevs.h#3 integrate
.. //depot/projects/netperf_socket/sys/dev/twe/twe.c#3 integrate
.. //depot/projects/netperf_socket/sys/dev/twe/twe_freebsd.c#4 integrate
.. //depot/projects/netperf_socket/sys/dev/twe/twevar.h#3 integrate
.. //depot/projects/netperf_socket/sys/dev/usb/ohci.c#2 integrate
.. //depot/projects/netperf_socket/sys/dev/wi/if_wi_pccard.c#2 integrate
.. //depot/projects/netperf_socket/sys/ia64/ia64/vm_machdep.c#3 integrate
.. //depot/projects/netperf_socket/sys/kern/init_sysent.c#5 integrate
.. //depot/projects/netperf_socket/sys/kern/kern_thr.c#2 integrate
.. //depot/projects/netperf_socket/sys/kern/kern_umtx.c#2 integrate
.. //depot/projects/netperf_socket/sys/kern/sched_ule.c#4 integrate
.. //depot/projects/netperf_socket/sys/kern/subr_bus.c#3 integrate
.. //depot/projects/netperf_socket/sys/kern/subr_param.c#3 integrate
.. //depot/projects/netperf_socket/sys/kern/subr_smp.c#6 integrate
.. //depot/projects/netperf_socket/sys/kern/subr_witness.c#3 integrate
.. //depot/projects/netperf_socket/sys/kern/sys_pipe.c#3 integrate
.. //depot/projects/netperf_socket/sys/kern/sys_process.c#4 integrate
.. //depot/projects/netperf_socket/sys/kern/syscalls.c#5 integrate
.. //depot/projects/netperf_socket/sys/kern/syscalls.master#5 integrate
.. //depot/projects/netperf_socket/sys/kern/vfs_mount.c#5 integrate
.. //depot/projects/netperf_socket/sys/modules/Makefile#6 integrate
.. //depot/projects/netperf_socket/sys/modules/netgraph/sppp/Makefile#1 branch
.. //depot/projects/netperf_socket/sys/netgraph/ng_sppp.c#1 branch
.. //depot/projects/netperf_socket/sys/netgraph/ng_sppp.h#1 branch
.. //depot/projects/netperf_socket/sys/netgraph/ng_tee.c#3 integrate
.. //depot/projects/netperf_socket/sys/netinet/in_pcb.c#4 integrate
.. //depot/projects/netperf_socket/sys/netinet/in_pcb.h#2 integrate
.. //depot/projects/netperf_socket/sys/netinet/ip6.h#2 integrate
.. //depot/projects/netperf_socket/sys/netinet/ip_divert.c#4 integrate
.. //depot/projects/netperf_socket/sys/netinet/ip_output.c#6 integrate
.. //depot/projects/netperf_socket/sys/netinet/raw_ip.c#3 integrate
.. //depot/projects/netperf_socket/sys/netinet/tcp_syncache.c#5 integrate
.. //depot/projects/netperf_socket/sys/netinet/tcp_usrreq.c#4 integrate
.. //depot/projects/netperf_socket/sys/netinet/udp_usrreq.c#4 integrate
.. //depot/projects/netperf_socket/sys/netinet6/in6_pcb.c#4 integrate
.. //depot/projects/netperf_socket/sys/netinet6/in6_pcb.h#3 integrate
.. //depot/projects/netperf_socket/sys/netinet6/in6_src.c#3 integrate
.. //depot/projects/netperf_socket/sys/netinet6/ip6_output.c#3 integrate
.. //depot/projects/netperf_socket/sys/netinet6/raw_ip6.c#3 integrate
.. //depot/projects/netperf_socket/sys/netinet6/udp6_output.c#3 integrate
.. //depot/projects/netperf_socket/sys/netinet6/udp6_usrreq.c#3 integrate
.. //depot/projects/netperf_socket/sys/nfs4client/nfs4_dev.h#2 integrate
.. //depot/projects/netperf_socket/sys/nfsclient/nfs.h#4 integrate
.. //depot/projects/netperf_socket/sys/nfsclient/nfs_socket.c#4 integrate
.. //depot/projects/netperf_socket/sys/nfsclient/nfs_subs.c#3 integrate
.. //depot/projects/netperf_socket/sys/pc98/conf/NOTES#5 integrate
.. //depot/projects/netperf_socket/sys/pc98/i386/machdep.c#2 integrate
.. //depot/projects/netperf_socket/sys/pc98/pc98/fd.c#5 integrate
.. //depot/projects/netperf_socket/sys/pci/if_ste.c#5 integrate
.. //depot/projects/netperf_socket/sys/powerpc/powerpc/uio_machdep.c#1 branch
.. //depot/projects/netperf_socket/sys/rpc/rpcclnt.c#4 integrate
.. //depot/projects/netperf_socket/sys/sparc64/ebus/ebus.c#2 integrate
.. //depot/projects/netperf_socket/sys/sparc64/sbus/sbus.c#2 integrate
.. //depot/projects/netperf_socket/sys/sparc64/sparc64/iommu.c#2 integrate
.. //depot/projects/netperf_socket/sys/sparc64/sparc64/vm_machdep.c#3 integrate
.. //depot/projects/netperf_socket/sys/sys/param.h#6 integrate
.. //depot/projects/netperf_socket/sys/sys/pcpu.h#3 integrate
.. //depot/projects/netperf_socket/sys/sys/pipe.h#3 integrate
.. //depot/projects/netperf_socket/sys/sys/proc.h#3 integrate
.. //depot/projects/netperf_socket/sys/sys/smp.h#2 integrate
.. //depot/projects/netperf_socket/sys/sys/syscall.h#5 integrate
.. //depot/projects/netperf_socket/sys/sys/syscall.mk#5 integrate
.. //depot/projects/netperf_socket/sys/sys/sysproto.h#5 integrate
.. //depot/projects/netperf_socket/sys/sys/thr.h#2 integrate
.. //depot/projects/netperf_socket/sys/sys/tree.h#3 integrate
.. //depot/projects/netperf_socket/sys/vm/vm_map.c#4 integrate
Differences ...
==== //depot/projects/netperf_socket/sys/alpha/alpha/interrupt.c#2 (text+ko) ====
@@ -35,7 +35,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
/* __KERNEL_RCSID(0, "$NetBSD: interrupt.c,v 1.23 1998/02/24 07:38:01 thorpej Exp $");*/
-__FBSDID("$FreeBSD: src/sys/alpha/alpha/interrupt.c,v 1.76 2003/11/17 06:10:14 peter Exp $");
+__FBSDID("$FreeBSD: src/sys/alpha/alpha/interrupt.c,v 1.77 2004/03/23 22:28:16 jhb Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -47,6 +47,7 @@
#include <sys/malloc.h>
#include <sys/mutex.h>
#include <sys/proc.h>
+#include <sys/sched.h>
#include <sys/smp.h>
#include <sys/unistd.h>
#include <sys/vmmeter.h>
@@ -447,8 +448,16 @@
"alpha_dispatch_intr: disabling vector 0x%x", i->vector);
ithd->it_disable(ithd->it_vector);
}
- error = ithread_schedule(ithd, 0 /* !cold */);
+
+ /*
+ * It seems that we need to return from an interrupt back to PAL
+ * on the same CPU that received the interrupt, so pin the interrupted
+ * thread to the current CPU until we return from the interrupt.
+ */
+ sched_pin();
+ error = ithread_schedule(ithd, !cold);
KASSERT(error == 0, ("got an impossible stray interrupt"));
+ sched_unpin();
}
static void
==== //depot/projects/netperf_socket/sys/amd64/amd64/identcpu.c#3 (text+ko) ====
@@ -41,7 +41,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/amd64/identcpu.c,v 1.129 2004/03/06 00:51:30 peter Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/amd64/identcpu.c,v 1.130 2004/03/25 03:38:31 peter Exp $");
#include "opt_cpu.h"
@@ -73,6 +73,7 @@
static void print_AMD_info(void);
static void print_AMD_assoc(int i);
+int cpu_feature2; /* XXX change cpu_feature to long? */
int cpu_class;
u_int cpu_exthigh; /* Highest arg to extended CPUID */
char machine[] = "amd64";
@@ -218,6 +219,44 @@
"\040PBE" /* Pending Break Enable */
);
+ if (cpu_feature2 != 0) {
+ printf("\n Features2=0x%b", cpu_feature2,
+ "\020"
+ "\001SSE3" /* SSE3 */
+ "\002<b1>"
+ "\003RSVD2>" /* "Reserved" bit 2 */
+ "\004MON" /* MONITOR/MWAIT Instructions */
+ "\005DS_CPL" /* CPL Qualified Debug Store */
+ "\006<b5>" /* Machine specific registers */
+ "\007<b6>" /* Physical address extension */
+ "\010EST" /* Enhanced SpeedStep */
+ "\011TM2" /* Thermal Monitor 2 */
+ "\012<b9>"
+ "\013CNTX-ID" /* L1 context ID available */
+ "\014<b11>"
+ "\015<b12>"
+ "\016CX16" /* CMPXCHG16B Instruction */
+ "\017<b14>"
+ "\020<b15>"
+ "\021<b16>"
+ "\022<b17>"
+ "\023<b18>"
+ "\024<b19>"
+ "\025<b20>"
+ "\026<b21>"
+ "\027<b22>"
+ "\030<b23>"
+ "\031<b24>"
+ "\032<b25>"
+ "\033<b26>"
+ "\034<b27>"
+ "\035<b28>"
+ "\036<b29>"
+ "\037<b30>"
+ "\040<b31>"
+ );
+ }
+
/*
* If this CPU supports hyperthreading then mention
* the number of logical CPU's it contains.
@@ -227,10 +266,8 @@
printf("\n Hyperthreading: %d logical CPUs",
(cpu_procinfo & CPUID_HTT_CORES) >> 16);
}
- if (strcmp(cpu_vendor, "AuthenticAMD") == 0 &&
- cpu_exthigh >= 0x80000001)
+ if (cpu_exthigh >= 0x80000001)
print_AMD_features();
- } else if (strcmp(cpu_vendor, "CyrixInstead") == 0) {
}
/* Avoid ugly blank lines: only print newline when we have to. */
if (*cpu_vendor || cpu_id)
@@ -285,6 +322,7 @@
cpu_id = regs[0];
cpu_procinfo = regs[1];
cpu_feature = regs[3];
+ cpu_feature2 = regs[2];
/* XXX */
cpu = CPU_CLAWHAMMER;
@@ -339,7 +377,7 @@
* http://www.amd.com/products/cpg/athlon/techdocs/pdf/20734.pdf
*/
do_cpuid(0x80000001, regs);
- printf("\n AMD Features=0x%b", regs[3] &~ cpu_feature,
+ printf("\n AMD Features=0x%b", regs[3] & ~(cpu_feature & 0x0183f3ff),
"\020" /* in hex */
"\001FPU" /* Integral FPU */
"\002VME" /* Extended VM86 mode support */
@@ -356,7 +394,7 @@
"\015MTRR" /* Memory Type Range Registers */
"\016PGE" /* PG_G (global bit) support */
"\017MCA" /* Machine Check Architecture */
- "\020ICMOV" /* CMOV instruction */
+ "\020CMOV" /* CMOV instruction */
"\021PAT" /* Page attributes table */
"\022PGE36" /* 36 bit address space support */
"\023RSVD" /* Reserved, unknown */
==== //depot/projects/netperf_socket/sys/amd64/amd64/vm_machdep.c#4 (text+ko) ====
@@ -41,7 +41,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/amd64/vm_machdep.c,v 1.229 2004/03/16 19:04:27 alc Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/amd64/vm_machdep.c,v 1.230 2004/03/25 03:39:38 peter Exp $");
#include "opt_isa.h"
#include "opt_kstack_pages.h"
@@ -124,7 +124,8 @@
fpuexit(td1);
/* Point the pcb to the top of the stack */
- pcb2 = (struct pcb *)(td2->td_kstack + KSTACK_PAGES * PAGE_SIZE) - 1;
+ pcb2 = (struct pcb *)(td2->td_kstack +
+ td2->td_kstack_pages * PAGE_SIZE) - 1;
td2->td_pcb = pcb2;
/* Copy p1's pcb */
@@ -247,8 +248,8 @@
cpu_thread_setup(struct thread *td)
{
- td->td_pcb =
- (struct pcb *)(td->td_kstack + KSTACK_PAGES * PAGE_SIZE) - 1;
+ td->td_pcb = (struct pcb *)(td->td_kstack +
+ td->td_kstack_pages * PAGE_SIZE) - 1;
td->td_frame = (struct trapframe *)td->td_pcb - 1;
}
==== //depot/projects/netperf_socket/sys/amd64/conf/GENERIC#4 (text+ko) ====
@@ -16,7 +16,7 @@
# 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.404 2004/03/15 00:49:39 obrien Exp $
+# $FreeBSD: src/sys/amd64/conf/GENERIC,v 1.405 2004/03/25 03:19:28 obrien Exp $
machine amd64
cpu HAMMER
@@ -39,6 +39,7 @@
options NFSCLIENT # Network Filesystem Client
options NFSSERVER # Network Filesystem Server
options NFS_ROOT # NFS usable as /, requires NFSCLIENT
+options NTFS # NT File System
options MSDOSFS # MSDOS Filesystem
options CD9660 # ISO 9660 Filesystem
options PROCFS # Process filesystem (requires PSEUDOFS)
==== //depot/projects/netperf_socket/sys/boot/alpha/common/conf.c#2 (text+ko) ====
@@ -25,7 +25,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/boot/alpha/common/conf.c,v 1.5 2004/01/04 23:21:01 obrien Exp $");
+__FBSDID("$FreeBSD: src/sys/boot/alpha/common/conf.c,v 1.6 2004/03/25 20:36:57 jhb Exp $");
#include <stand.h>
#include "libalpha/libalpha.h"
@@ -67,6 +67,7 @@
&nfs_fsops,
#endif
&gzipfs_fsops,
+ &splitfs_fsops,
NULL
};
==== //depot/projects/netperf_socket/sys/compat/freebsd32/freebsd32_proto.h#3 (text+ko) ====
@@ -2,8 +2,8 @@
* System call prototypes.
*
* DO NOT EDIT-- this file is automatically generated.
- * $FreeBSD: src/sys/compat/freebsd32/freebsd32_proto.h,v 1.22 2004/02/21 23:38:57 peter Exp $
- * created from FreeBSD: src/sys/compat/freebsd32/syscalls.master,v 1.35 2004/02/21 23:37:33 peter Exp
+ * $FreeBSD: src/sys/compat/freebsd32/freebsd32_proto.h,v 1.23 2004/03/27 14:34:17 mtm Exp $
+ * created from FreeBSD: src/sys/compat/freebsd32/syscalls.master,v 1.36 2004/03/27 14:30:42 mtm Exp
*/
#ifndef _FREEBSD32_SYSPROTO_H_
==== //depot/projects/netperf_socket/sys/compat/freebsd32/freebsd32_syscall.h#3 (text+ko) ====
@@ -2,8 +2,8 @@
* System call numbers.
*
* DO NOT EDIT-- this file is automatically generated.
- * $FreeBSD: src/sys/compat/freebsd32/freebsd32_syscall.h,v 1.22 2004/02/21 23:38:57 peter Exp $
- * created from FreeBSD: src/sys/compat/freebsd32/syscalls.master,v 1.35 2004/02/21 23:37:33 peter Exp
+ * $FreeBSD: src/sys/compat/freebsd32/freebsd32_syscall.h,v 1.23 2004/03/27 14:34:17 mtm Exp $
+ * created from FreeBSD: src/sys/compat/freebsd32/syscalls.master,v 1.36 2004/03/27 14:30:42 mtm Exp
*/
#define FREEBSD32_SYS_syscall 0
@@ -295,4 +295,6 @@
#define FREEBSD32_SYS__umtx_lock 434
#define FREEBSD32_SYS__umtx_unlock 435
#define FREEBSD32_SYS_jail_attach 436
-#define FREEBSD32_SYS_MAXSYSCALL 442
+#define FREEBSD32_SYS_thr_suspend 442
+#define FREEBSD32_SYS_thr_wake 443
+#define FREEBSD32_SYS_MAXSYSCALL 444
==== //depot/projects/netperf_socket/sys/compat/freebsd32/freebsd32_syscalls.c#3 (text+ko) ====
@@ -2,8 +2,8 @@
* System call names.
*
* DO NOT EDIT-- this file is automatically generated.
- * $FreeBSD: src/sys/compat/freebsd32/freebsd32_syscalls.c,v 1.13 2004/02/21 23:38:58 peter Exp $
- * created from FreeBSD: src/sys/compat/freebsd32/syscalls.master,v 1.35 2004/02/21 23:37:33 peter Exp
+ * $FreeBSD: src/sys/compat/freebsd32/freebsd32_syscalls.c,v 1.14 2004/03/27 14:34:17 mtm Exp $
+ * created from FreeBSD: src/sys/compat/freebsd32/syscalls.master,v 1.36 2004/03/27 14:30:42 mtm Exp
*/
const char *freebsd32_syscallnames[] = {
@@ -449,4 +449,6 @@
"#439", /* 439 = extattr_list_link */
"#440", /* 440 = kse_switchin */
"#441", /* 441 = ksem_timedwait */
+ "thr_suspend", /* 442 = thr_suspend */
+ "thr_wake", /* 443 = thr_wake */
};
==== //depot/projects/netperf_socket/sys/compat/freebsd32/freebsd32_sysent.c#3 (text+ko) ====
@@ -2,8 +2,8 @@
* System call switch table.
*
* DO NOT EDIT-- this file is automatically generated.
- * $FreeBSD: src/sys/compat/freebsd32/freebsd32_sysent.c,v 1.23 2004/02/21 23:38:58 peter Exp $
- * created from FreeBSD: src/sys/compat/freebsd32/syscalls.master,v 1.35 2004/02/21 23:37:33 peter Exp
+ * $FreeBSD: src/sys/compat/freebsd32/freebsd32_sysent.c,v 1.24 2004/03/27 14:34:17 mtm Exp $
+ * created from FreeBSD: src/sys/compat/freebsd32/syscalls.master,v 1.36 2004/03/27 14:30:42 mtm Exp
*/
#include "opt_compat.h"
@@ -467,4 +467,6 @@
{ 0, (sy_call_t *)nosys }, /* 439 = extattr_list_link */
{ 0, (sy_call_t *)nosys }, /* 440 = kse_switchin */
{ 0, (sy_call_t *)nosys }, /* 441 = ksem_timedwait */
+ { SYF_MPSAFE | AS(thr_suspend_args), (sy_call_t *)thr_suspend }, /* 442 = thr_suspend */
+ { SYF_MPSAFE | AS(thr_wake_args), (sy_call_t *)thr_wake }, /* 443 = thr_wake */
};
==== //depot/projects/netperf_socket/sys/compat/freebsd32/syscalls.master#3 (text+ko) ====
@@ -1,4 +1,4 @@
- $FreeBSD: src/sys/compat/freebsd32/syscalls.master,v 1.35 2004/02/21 23:37:33 peter Exp $
+ $FreeBSD: src/sys/compat/freebsd32/syscalls.master,v 1.36 2004/03/27 14:30:42 mtm Exp $
; from: @(#)syscalls.master 8.2 (Berkeley) 1/13/94
; from: src/sys/kern/syscalls.master 1.107
;
@@ -604,3 +604,5 @@
439 UNIMPL extattr_list_link
440 UNIMPL kse_switchin
441 UNIMPL ksem_timedwait
+442 MNOPROTO { int thr_suspend(const struct timespec *timeout); }
+443 MNOPROTO { int thr_wake(thr_id_t id); }
==== //depot/projects/netperf_socket/sys/compat/ndis/kern_ndis.c#8 (text+ko) ====
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/compat/ndis/kern_ndis.c,v 1.44 2004/03/22 00:41:41 wpaul Exp $");
+__FBSDID("$FreeBSD: src/sys/compat/ndis/kern_ndis.c,v 1.47 2004/03/25 18:31:52 wpaul Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -150,7 +150,7 @@
case MOD_SHUTDOWN:
/* stop kthreads */
ndis_destroy_kthreads();
- if (TAILQ_FIRST(&ndis_devhead) != NULL) {
+ if (TAILQ_FIRST(&ndis_devhead) == NULL) {
/* Shut down subsystems */
ndis_libfini();
ntoskrnl_libfini();
@@ -403,6 +403,39 @@
}
int
+ndis_unsched(func, arg, t)
+ void (*func)(void *);
+ void *arg;
+ int t;
+{
+ struct ndis_req *r;
+ struct ndisqhead *q;
+ struct proc *p;
+
+ if (t == NDIS_TASKQUEUE) {
+ q = &ndis_ttodo;
+ p = ndis_tproc.np_p;
+ } else {
+ q = &ndis_itodo;
+ p = ndis_iproc.np_p;
+ }
+
+ mtx_pool_lock(ndis_mtxpool, ndis_thr_mtx);
+ STAILQ_FOREACH(r, q, link) {
+ if (r->nr_func == func && r->nr_arg == arg) {
+ STAILQ_REMOVE(q, r, ndis_req, link);
+ STAILQ_INSERT_HEAD(&ndis_free, r, link);
+ mtx_pool_unlock(ndis_mtxpool, ndis_thr_mtx);
+ return(0);
+ }
+ }
+
+ mtx_pool_unlock(ndis_mtxpool, ndis_thr_mtx);
+
+ return(ENOENT);
+}
+
+int
ndis_sched(func, arg, t)
void (*func)(void *);
void *arg;
@@ -738,7 +771,9 @@
ndis_miniport_block *block;
device_t dev;
struct resource_list *brl;
- struct resource_list_entry *brle;
+ struct resource_list brl_rev;
+ struct resource_list_entry *brle, *n;
+ int error = 0;
sc = arg;
block = &sc->ndis_block;
@@ -758,7 +793,34 @@
brl = BUS_GET_RESOURCE_LIST(device_get_parent(dev), dev);
if (brl != NULL) {
+
+ /*
+ * We have a small problem. Some PCI devices have
+ * multiple I/O ranges. Windows orders them starting
+ * from lowest numbered BAR to highest. We discover
+ * them in that order too, but insert them into a singly
+ * linked list head first, which means when time comes
+ * to traverse the list, we enumerate them in reverse
+ * order. This screws up some drivers which expect the
+ * BARs to be in ascending order so that they can choose
+ * the "first" one as their register space. Unfortunately,
+ * in order to fix this, we have to create our own
+ * temporary list with the entries in reverse order.
+ */
+ SLIST_INIT(&brl_rev);
SLIST_FOREACH(brle, brl, link) {
+ n = malloc(sizeof(struct resource_list_entry),
+ M_TEMP, M_NOWAIT);
+ if (n == NULL) {
+ error = ENOMEM;
+ goto bad;
+ }
+ bcopy((char *)brle, (char *)n,
+ sizeof(struct resource_list_entry));
+ SLIST_INSERT_HEAD(&brl_rev, n, link);
+ }
+
+ SLIST_FOREACH(brle, &brl_rev, link) {
switch (brle->type) {
case SYS_RES_IOPORT:
prd->cprd_type = CmResourceTypePort;
@@ -787,7 +849,15 @@
block->nmb_rlist = rl;
- return(0);
+bad:
+
+ while (!SLIST_EMPTY(&brl_rev)) {
+ n = SLIST_FIRST(&brl_rev);
+ SLIST_REMOVE_HEAD(&brl_rev, link);
+ free (n, M_TEMP);
+ }
+
+ return(error);
}
/*
==== //depot/projects/netperf_socket/sys/compat/ndis/subr_ndis.c#6 (text+ko) ====
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/compat/ndis/subr_ndis.c,v 1.52 2004/03/20 23:39:43 wpaul Exp $");
+__FBSDID("$FreeBSD: src/sys/compat/ndis/subr_ndis.c,v 1.53 2004/03/25 18:31:52 wpaul Exp $");
/*
* This file implements a translation layer between the BSD networking
@@ -1906,12 +1906,12 @@
ndis_event *event;
{
/*
- * NDIS events are always synchronization
+ * NDIS events are always notification
* events, and should be initialized to the
* not signaled state.
*/
- ntoskrnl_init_event(&event->ne_event, EVENT_TYPE_SYNC, FALSE);
+ ntoskrnl_init_event(&event->ne_event, EVENT_TYPE_NOTIFY, FALSE);
return;
}
==== //depot/projects/netperf_socket/sys/compat/ndis/subr_ntoskrnl.c#9 (text+ko) ====
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/compat/ndis/subr_ntoskrnl.c,v 1.30 2004/03/22 00:41:41 wpaul Exp $");
+__FBSDID("$FreeBSD: src/sys/compat/ndis/subr_ntoskrnl.c,v 1.33 2004/03/27 20:38:43 wpaul Exp $");
#include <sys/ctype.h>
#include <sys/unistd.h>
@@ -85,7 +85,7 @@
int64_t *, wait_block *);
static void ntoskrnl_wakeup(void *);
static void ntoskrnl_timercall(void *);
-static void ntoskrnl_timersched(void *);
+static void ntoskrnl_run_dpc(void *);
__stdcall static void ntoskrnl_writereg_ushort(uint16_t *, uint16_t);
__stdcall static uint16_t ntoskrnl_readreg_ushort(uint16_t *);
__stdcall static void ntoskrnl_writereg_ulong(uint32_t *, uint32_t);
@@ -147,6 +147,7 @@
uint32_t, uint32_t *);
static int atoi (const char *);
static long atol (const char *);
+static int rand(void);
static void ntoskrnl_time(uint64_t *);
__stdcall static uint8_t ntoskrnl_wdmver(uint8_t, uint8_t);
static void ntoskrnl_thrfunc(void *);
@@ -1355,6 +1356,16 @@
return strtol(str, (char **)NULL, 10);
}
+static int
+rand(void)
+{
+ struct timeval tv;
+
+ microtime(&tv);
+ srandom(tv.tv_usec);
+ return((int)random());
+}
+
__stdcall static uint8_t
ntoskrnl_wdmver(major, minor)
uint8_t major;
@@ -1617,7 +1628,6 @@
ntoskrnl_kth--;
- mtx_lock(&Giant);
kthread_exit(0);
return(0); /* notreached */
}
@@ -1642,31 +1652,14 @@
return;
}
-/*
- * We run all timer callouts in the ndis swi thread to take
- * advantage of its larger stack size. If we don't do this,
- * the callout will run in the clock ithread context.
- */
-
-static void
-ntoskrnl_timersched(arg)
- void *arg;
-{
- ndis_sched(ntoskrnl_timercall, arg, NDIS_SWI);
- return;
-}
-
static void
ntoskrnl_timercall(arg)
void *arg;
{
ktimer *timer;
- __stdcall kdpc_func timerfunc;
- kdpc *dpc;
struct timeval tv;
timer = arg;
- dpc = timer->k_dpc;
/*
* If this is a periodic timer, re-arm it
@@ -1681,14 +1674,11 @@
tv.tv_sec = 0;
tv.tv_usec = timer->k_period * 1000;
timer->k_handle =
- timeout(ntoskrnl_timersched, timer, tvtohz(&tv));
+ timeout(ntoskrnl_timercall, timer, tvtohz(&tv));
}
- if (dpc != NULL) {
- timerfunc = (kdpc_func)dpc->k_deferedfunc;
- timerfunc(dpc, dpc->k_deferredctx,
- dpc->k_sysarg1, dpc->k_sysarg2);
- }
+ if (timer->k_dpc != NULL)
+ ntoskrnl_queue_dpc(timer->k_dpc, NULL, NULL);
ntoskrnl_wakeup(&timer->k_header);
@@ -1728,6 +1718,25 @@
return;
}
+/*
+ * This is a wrapper for Windows deferred procedure calls that
+ * have been placed on an NDIS thread work queue. We need it
+ * since the DPC could be a _stdcall function.
+ */
+static void
+ntoskrnl_run_dpc(arg)
+ void *arg;
+{
+ __stdcall kdpc_func dpcfunc;
+ kdpc *dpc;
+
+ dpc = arg;
+ dpcfunc = (kdpc_func)dpc->k_deferedfunc;
+ dpcfunc(dpc, dpc->k_deferredctx, dpc->k_sysarg1, dpc->k_sysarg2);
+
+ return;
+}
+
__stdcall void
ntoskrnl_init_dpc(dpc, dpcfunc, dpcctx)
kdpc *dpc;
@@ -1744,6 +1753,30 @@
}
__stdcall uint8_t
+ntoskrnl_queue_dpc(dpc, sysarg1, sysarg2)
+ kdpc *dpc;
+ void *sysarg1;
+ void *sysarg2;
+{
+ dpc->k_sysarg1 = sysarg1;
+ dpc->k_sysarg2 = sysarg2;
+ if (ndis_sched(ntoskrnl_run_dpc, dpc, NDIS_SWI))
+ return(FALSE);
+
+ return(TRUE);
+}
+
+__stdcall uint8_t
+ntoskrnl_dequeue_dpc(dpc)
+ kdpc *dpc;
+{
+ if (ndis_unsched(ntoskrnl_run_dpc, dpc, NDIS_SWI))
+ return(FALSE);
+
+ return(TRUE);
+}
+
+__stdcall uint8_t
ntoskrnl_set_timer_ex(timer, duetime, period, dpc)
ktimer *timer;
int64_t duetime;
@@ -1759,7 +1792,7 @@
if (timer->k_handle.callout != NULL &&
callout_pending(timer->k_handle.callout)) {
- untimeout(ntoskrnl_timersched, timer, timer->k_handle);
+ untimeout(ntoskrnl_timercall, timer, timer->k_handle);
pending = TRUE;
} else
pending = FALSE;
@@ -1784,7 +1817,7 @@
}
}
- timer->k_handle = timeout(ntoskrnl_timersched, timer, tvtohz(&tv));
+ timer->k_handle = timeout(ntoskrnl_timercall, timer, tvtohz(&tv));
return(pending);
}
@@ -1813,7 +1846,7 @@
else
pending = FALSE;
- untimeout(ntoskrnl_timersched, timer, timer->k_handle);
+ untimeout(ntoskrnl_timercall, timer, timer->k_handle);
return(pending);
}
@@ -1886,6 +1919,7 @@
{ "_aullshl", (FUNC)_aullshl },
{ "atoi", (FUNC)atoi },
{ "atol", (FUNC)atol },
+ { "rand", (FUNC)rand },
{ "WRITE_REGISTER_USHORT", (FUNC)ntoskrnl_writereg_ushort },
{ "READ_REGISTER_USHORT", (FUNC)ntoskrnl_readreg_ushort },
{ "WRITE_REGISTER_ULONG", (FUNC)ntoskrnl_writereg_ulong },
@@ -1926,11 +1960,13 @@
{ "KeReadStateEvent", (FUNC)ntoskrnl_read_event },
{ "KeInitializeTimer", (FUNC)ntoskrnl_init_timer },
{ "KeInitializeTimerEx", (FUNC)ntoskrnl_init_timer_ex },
- { "KeInitializeDpc", (FUNC)ntoskrnl_init_dpc },
{ "KeSetTimer", (FUNC)ntoskrnl_set_timer },
{ "KeSetTimerEx", (FUNC)ntoskrnl_set_timer_ex },
{ "KeCancelTimer", (FUNC)ntoskrnl_cancel_timer },
{ "KeReadStateTimer", (FUNC)ntoskrnl_read_timer },
+ { "KeInitializeDpc", (FUNC)ntoskrnl_init_dpc },
+ { "KeInsertQueueDpc", (FUNC)ntoskrnl_queue_dpc },
+ { "KeRemoveQueueDpc", (FUNC)ntoskrnl_dequeue_dpc },
{ "ObReferenceObjectByHandle", (FUNC)ntoskrnl_objref },
{ "ObfDereferenceObject", (FUNC)ntoskrnl_objderef },
{ "ZwClose", (FUNC)ntoskrnl_zwclose },
==== //depot/projects/netperf_socket/sys/conf/files.i386#10 (text+ko) ====
@@ -1,7 +1,7 @@
# This file tells config what files go into building a kernel,
# files marked standard are always included.
#
-# $FreeBSD: src/sys/conf/files.i386,v 1.480 2004/03/21 20:28:36 alc Exp $
+# $FreeBSD: src/sys/conf/files.i386,v 1.481 2004/03/22 18:00:39 wpaul Exp $
#
# The long compile-with and dependency lines are required because of
# limitations in config: backslash-newline doesn't work in strings, and
@@ -137,8 +137,9 @@
dev/fb/splash.c optional splash
dev/fb/vga.c optional vga
dev/fe/if_fe_isa.c optional fe isa
-dev/if_ndis/if_ndis.c optional ndis pci pccard
+dev/if_ndis/if_ndis.c optional ndis
dev/if_ndis/if_ndis_pci.c optional ndis pci
+dev/if_ndis/if_ndis_pci.c optional ndis cardbus
dev/if_ndis/if_ndis_pccard.c optional ndis card
dev/if_ndis/if_ndis_pccard.c optional ndis pccard
dev/kbd/atkbd.c optional atkbd
==== //depot/projects/netperf_socket/sys/conf/files.powerpc#3 (text+ko) ====
@@ -1,7 +1,7 @@
# This file tells config what files go into building a kernel,
# files marked standard are always included.
#
-# $FreeBSD: src/sys/conf/files.powerpc,v 1.36 2004/02/12 09:17:15 grehan Exp $
+# $FreeBSD: src/sys/conf/files.powerpc,v 1.37 2004/03/23 18:26:02 alc Exp $
#
# The long compile-with and dependency lines are required because of
# limitations in config: backslash-newline doesn't work in strings, and
@@ -58,6 +58,7 @@
powerpc/powerpc/sys_machdep.c standard
powerpc/powerpc/swtch.S standard
powerpc/powerpc/trap.c standard
+powerpc/powerpc/uio_machdep.c standard
powerpc/powerpc/uma_machdep.c standard
powerpc/powerpc/vm_machdep.c standard
==== //depot/projects/netperf_socket/sys/conf/kern.pre.mk#8 (text+ko) ====
@@ -1,4 +1,4 @@
-# $FreeBSD: src/sys/conf/kern.pre.mk,v 1.48 2004/03/21 05:10:34 marcel Exp $
+# $FreeBSD: src/sys/conf/kern.pre.mk,v 1.49 2004/03/25 00:02:49 obrien Exp $
# Part of a unified Makefile for building kernels. This part contains all
# of the definitions that need to be before %BEFORE_DEPEND.
@@ -19,7 +19,7 @@
.if ${CC} == "icc"
COPTFLAGS?=-O
.else
-. if ${MACHINE_ARCH} == "amd64"
+. if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "sparc64"
COPTFLAGS?=-O2 -frename-registers -pipe
. elif ${MACHINE_ARCH} == "ia64"
COPTFLAGS?=-O2 -pipe
==== //depot/projects/netperf_socket/sys/contrib/dev/acpica/acfreebsd.h#4 (text+ko) ====
@@ -119,17 +119,10 @@
/*
* Some systems' ASL may have problems because they look for names
- * of Microsoft operating systems. We default to "Microsoft Windows NT"
- * (aka NT5 or Windows 2000) because it is most similar to our
- * implementation and also most prevalent.
- *
- * To override this, set hw.acpi.os_name to the appropriate string.
+ * of Microsoft operating systems. To override this, set hw.acpi.os_name
+ * to the appropriate string.
*/
-#ifndef ACPICA_PEDANTIC
-#define ACPI_OS_NAME "Microsoft Windows NT"
-#else
#define ACPI_OS_NAME "FreeBSD"
-#endif
/* FreeBSD uses GCC */
==== //depot/projects/netperf_socket/sys/dev/acpica/acpi.c#8 (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/dev/acpica/acpi.c,v 1.128 2004/03/19 07:05:01 njl Exp $
+ * $FreeBSD: src/sys/dev/acpica/acpi.c,v 1.129 2004/03/27 16:26:00 takawata Exp $
*/
#include "opt_acpi.h"
@@ -140,7 +140,51 @@
static int acpi_supported_sleep_state_sysctl(SYSCTL_HANDLER_ARGS);
static int acpi_sleep_state_sysctl(SYSCTL_HANDLER_ARGS);
static int acpi_pm_func(u_long cmd, void *arg, ...);
+static int acpi_child_location_str_method(device_t acdev, device_t child,
+ char *buf, size_t buflen);
+static int acpi_child_pnpinfo_str_method(device_t acdev, device_t child,
+ char *buf, size_t buflen);
+
+int
+acpi_child_location_str_method(device_t cbdev, device_t child, char *buf,
+ size_t buflen)
+{
+ struct acpi_device *dinfo= device_get_ivars(child);
+
+ dinfo = device_get_ivars(child);
+ if(dinfo->ad_handle)
+ snprintf(buf, buflen, "path=%s", acpi_name(dinfo->ad_handle));
+ else
+ snprintf(buf, buflen, "magic=unknown");
+ return (0);
+}
+
+int
+acpi_child_pnpinfo_str_method(device_t cbdev, device_t child, char *buf,
+ size_t buflen)
+{
+ struct acpi_device *dinfo = device_get_ivars(child);
+ ACPI_DEVICE_INFO adinfo;
+ ACPI_BUFFER adbuf = {sizeof(adinfo), &adinfo};
+ char * end;
+ int error;
+
+ dinfo = device_get_ivars(child);
+ error = AcpiGetObjectInfo(dinfo->ad_handle, &adbuf);
+
+ if(error)
+ snprintf(buf, buflen, "Unknown");
+ else
+ snprintf(buf, buflen, "_HID=%s _UID=%u",
+ (adinfo.Valid & ACPI_VALID_HID)?
+ adinfo.HardwareId.Value : "UNKNOWN",
+ (unsigned int)((adinfo.Valid & ACPI_VALID_UID)?
+ strtoul(adinfo.UniqueId.Value, &end, 10):0 ));
+ return (0);
+}
+
+
static device_method_t acpi_methods[] = {
/* Device interface */
DEVMETHOD(device_identify, acpi_identify),
@@ -160,6 +204,8 @@
DEVMETHOD(bus_get_resource, acpi_get_resource),
DEVMETHOD(bus_alloc_resource, acpi_alloc_resource),
DEVMETHOD(bus_release_resource, acpi_release_resource),
+ DEVMETHOD(bus_child_pnpinfo_str, acpi_child_pnpinfo_str_method),
+ DEVMETHOD(bus_child_location_str, acpi_child_location_str_method),
DEVMETHOD(bus_driver_added, bus_generic_driver_added),
DEVMETHOD(bus_activate_resource, bus_generic_activate_resource),
DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource),
==== //depot/projects/netperf_socket/sys/dev/acpica/acpi_pcib.c#4 (text+ko) ====
@@ -26,7 +26,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/acpica/acpi_pcib.c,v 1.38 2004/03/20 20:47:08 njl Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/acpica/acpi_pcib.c,v 1.41 2004/03/22 20:39:20 njl Exp $");
#include "opt_acpi.h"
#include <sys/param.h>
@@ -35,7 +35,6 @@
#include <sys/kernel.h>
#include "acpi.h"
-
#include <dev/acpica/acpivar.h>
#include <dev/acpica/acpi_pcibvar.h>
@@ -44,9 +43,7 @@
#include <dev/pci/pcib_private.h>
#include "pcib_if.h"
-/*
- * Hooks for the ACPI CA debugging infrastructure
- */
+/* Hooks for the ACPI CA debugging infrastructure. */
#define _COMPONENT ACPI_BUS
ACPI_MODULE_NAME("PCI")
@@ -68,12 +65,12 @@
return_VALUE(ENXIO);
/*
- * Get the PCI interrupt routing table for this bus.
+ * Get the PCI interrupt routing table for this bus. If we can't
+ * get it, this is not an error but may reduce functionality.
*/
prt->Length = ACPI_ALLOCATE_BUFFER;
status = AcpiGetIrqRoutingTable(acpi_get_handle(dev), prt);
>>> TRUNCATED FOR MAIL (1000 lines) <<<
More information about the p4-projects
mailing list