PERFORCE change 54125 for review
Robert Watson
rwatson at FreeBSD.org
Fri Jun 4 03:52:20 GMT 2004
http://perforce.freebsd.org/chv.cgi?CH=54125
Change 54125 by rwatson at rwatson_tislabs on 2004/06/03 20:51:24
Integrate netperf_socket from FreeBSD CVS head.
Affected files ...
.. //depot/projects/netperf_socket/sys/alpha/alpha/mem.c#4 integrate
.. //depot/projects/netperf_socket/sys/alpha/alpha/uio_machdep.c#3 integrate
.. //depot/projects/netperf_socket/sys/amd64/acpica/madt.c#4 integrate
.. //depot/projects/netperf_socket/sys/amd64/amd64/identcpu.c#5 integrate
.. //depot/projects/netperf_socket/sys/amd64/amd64/io_apic.c#3 integrate
.. //depot/projects/netperf_socket/sys/amd64/amd64/legacy.c#3 integrate
.. //depot/projects/netperf_socket/sys/amd64/amd64/mem.c#4 integrate
.. //depot/projects/netperf_socket/sys/amd64/amd64/mptable.c#3 integrate
.. //depot/projects/netperf_socket/sys/amd64/amd64/nexus.c#3 integrate
.. //depot/projects/netperf_socket/sys/amd64/amd64/uio_machdep.c#3 integrate
.. //depot/projects/netperf_socket/sys/amd64/conf/GENERIC#7 integrate
.. //depot/projects/netperf_socket/sys/amd64/include/cputypes.h#2 integrate
.. //depot/projects/netperf_socket/sys/amd64/isa/atpic.c#5 integrate
.. //depot/projects/netperf_socket/sys/amd64/isa/clock.c#4 integrate
.. //depot/projects/netperf_socket/sys/amd64/pci/pci_bus.c#4 integrate
.. //depot/projects/netperf_socket/sys/arm/arm/uio_machdep.c#2 integrate
.. //depot/projects/netperf_socket/sys/dev/adlink/adlink.c#5 integrate
.. //depot/projects/netperf_socket/sys/dev/ata/ata-cbus.c#4 integrate
.. //depot/projects/netperf_socket/sys/dev/fb/tga.c#2 integrate
.. //depot/projects/netperf_socket/sys/dev/fxp/if_fxp.c#10 integrate
.. //depot/projects/netperf_socket/sys/dev/fxp/if_fxpvar.h#3 integrate
.. //depot/projects/netperf_socket/sys/dev/gem/if_gem.c#5 integrate
.. //depot/projects/netperf_socket/sys/dev/gem/if_gem_pci.c#4 integrate
.. //depot/projects/netperf_socket/sys/dev/hme/if_hme.c#6 integrate
.. //depot/projects/netperf_socket/sys/dev/hme/if_hme_pci.c#3 integrate
.. //depot/projects/netperf_socket/sys/dev/hme/if_hme_sbus.c#4 integrate
.. //depot/projects/netperf_socket/sys/dev/isp/isp_sbus.c#4 integrate
.. //depot/projects/netperf_socket/sys/dev/ixgb/if_ixgb.h#2 integrate
.. //depot/projects/netperf_socket/sys/dev/lnc/if_lnc_cbus.c#3 integrate
.. //depot/projects/netperf_socket/sys/dev/puc/puc_ebus.c#2 integrate
.. //depot/projects/netperf_socket/sys/dev/puc/puc_sbus.c#3 integrate
.. //depot/projects/netperf_socket/sys/dev/sab/sab.c#4 integrate
.. //depot/projects/netperf_socket/sys/dev/tga/tga_pci.c#3 integrate
.. //depot/projects/netperf_socket/sys/dev/uart/uart_bus_ebus.c#3 integrate
.. //depot/projects/netperf_socket/sys/dev/zs/zs_sbus.c#3 integrate
.. //depot/projects/netperf_socket/sys/i386/i386/bios.c#3 integrate
.. //depot/projects/netperf_socket/sys/i386/i386/geode.c#4 integrate
.. //depot/projects/netperf_socket/sys/i386/i386/identcpu.c#7 integrate
.. //depot/projects/netperf_socket/sys/i386/i386/uio_machdep.c#4 integrate
.. //depot/projects/netperf_socket/sys/i386/i386/vm_machdep.c#13 integrate
.. //depot/projects/netperf_socket/sys/i386/include/cputypes.h#3 integrate
.. //depot/projects/netperf_socket/sys/i386/include/pc/bios.h#2 integrate
.. //depot/projects/netperf_socket/sys/ia64/ia64/mem.c#4 integrate
.. //depot/projects/netperf_socket/sys/ia64/ia64/uio_machdep.c#3 integrate
.. //depot/projects/netperf_socket/sys/kern/kern_lock.c#2 integrate
.. //depot/projects/netperf_socket/sys/kern/kern_subr.c#4 integrate
.. //depot/projects/netperf_socket/sys/kern/subr_bus.c#6 integrate
.. //depot/projects/netperf_socket/sys/kern/subr_witness.c#4 integrate
.. //depot/projects/netperf_socket/sys/net/ethernet.h#2 integrate
.. //depot/projects/netperf_socket/sys/net/if_ethersubr.c#14 integrate
.. //depot/projects/netperf_socket/sys/netinet/raw_ip.c#6 integrate
.. //depot/projects/netperf_socket/sys/pc98/pc98/pmc.c#2 integrate
.. //depot/projects/netperf_socket/sys/powerpc/powerpc/uio_machdep.c#3 integrate
.. //depot/projects/netperf_socket/sys/sparc64/central/central.c#2 integrate
.. //depot/projects/netperf_socket/sys/sparc64/ebus/ebus.c#5 integrate
.. //depot/projects/netperf_socket/sys/sparc64/fhc/fhc_central.c#2 integrate
.. //depot/projects/netperf_socket/sys/sparc64/fhc/fhc_nexus.c#2 integrate
.. //depot/projects/netperf_socket/sys/sparc64/pci/apb.c#3 integrate
.. //depot/projects/netperf_socket/sys/sparc64/sparc64/mem.c#4 integrate
.. //depot/projects/netperf_socket/sys/sparc64/sparc64/uio_machdep.c#4 integrate
.. //depot/projects/netperf_socket/sys/sys/proc.h#10 integrate
.. //depot/projects/netperf_socket/sys/ufs/ffs/ffs_rawread.c#2 integrate
Differences ...
==== //depot/projects/netperf_socket/sys/alpha/alpha/mem.c#4 (text+ko) ====
@@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/alpha/alpha/mem.c,v 1.48 2004/04/05 21:00:49 imp Exp $");
+__FBSDID("$FreeBSD: src/sys/alpha/alpha/mem.c,v 1.49 2004/06/03 05:58:27 phk Exp $");
/*
* Memory special file
@@ -48,9 +48,10 @@
#include <sys/fcntl.h>
#include <sys/kernel.h>
#include <sys/lock.h>
-#include <sys/mutex.h>
#include <sys/malloc.h>
#include <sys/memrange.h>
+#include <sys/module.h>
+#include <sys/mutex.h>
#include <sys/proc.h>
#include <sys/msgbuf.h>
#include <sys/systm.h>
==== //depot/projects/netperf_socket/sys/alpha/alpha/uio_machdep.c#3 (text+ko) ====
@@ -36,7 +36,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/alpha/alpha/uio_machdep.c,v 1.2 2004/04/05 21:00:49 imp Exp $");
+__FBSDID("$FreeBSD: src/sys/alpha/alpha/uio_machdep.c,v 1.4 2004/06/03 10:22:45 tjr Exp $");
#include <sys/param.h>
#include <sys/kernel.h>
@@ -70,12 +70,8 @@
("uiomove_fromphys: mode"));
KASSERT(uio->uio_segflg != UIO_USERSPACE || uio->uio_td == curthread,
("uiomove_fromphys proc"));
- if (td != NULL) {
- mtx_lock_spin(&sched_lock);
- save = td->td_flags & TDF_DEADLKTREAT;
- td->td_flags |= TDF_DEADLKTREAT;
- mtx_unlock_spin(&sched_lock);
- }
+ save = td->td_pflags & TDP_DEADLKTREAT;
+ td->td_pflags |= TDP_DEADLKTREAT;
while (n > 0 && uio->uio_resid) {
iov = uio->uio_iov;
cnt = iov->iov_len;
@@ -119,10 +115,7 @@
n -= cnt;
}
out:
- if (td != NULL && save == 0) {
- mtx_lock_spin(&sched_lock);
- td->td_flags &= ~TDF_DEADLKTREAT;
- mtx_unlock_spin(&sched_lock);
- }
+ if (save == 0)
+ td->td_pflags &= ~TDP_DEADLKTREAT;
return (error);
}
==== //depot/projects/netperf_socket/sys/amd64/acpica/madt.c#4 (text+ko) ====
@@ -28,7 +28,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/acpica/madt.c,v 1.12 2004/05/16 20:30:46 peter Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/acpica/madt.c,v 1.13 2004/06/03 20:25:04 peter Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -67,8 +67,8 @@
struct lapic_info {
u_int la_present:1;
u_int la_enabled:1;
- u_int la_apic_id:8;
-} lapics[NLAPICS + 1];
+ u_int la_acpi_id:8;
+} lapics[NLAPICS];
static int madt_found_sci_override;
static MULTIPLE_APIC_TABLE *madt;
@@ -447,14 +447,14 @@
printf("MADT: Found CPU APIC ID %d ACPI ID %d: %s\n",
proc->LocalApicId, proc->ProcessorId,
proc->ProcessorEnabled ? "enabled" : "disabled");
- if (proc->ProcessorId > NLAPICS)
+ if (proc->LocalApicId >= NLAPICS)
panic("%s: CPU ID %d too high", __func__,
- proc->ProcessorId);
- la = &lapics[proc->ProcessorId];
+ proc->LocalApicId);
+ la = &lapics[proc->LocalApicId];
KASSERT(la->la_present == 0,
- ("Duplicate local ACPI ID %d", proc->ProcessorId));
+ ("Duplicate local APIC ID %d", proc->LocalApicId));
la->la_present = 1;
- la->la_apic_id = proc->LocalApicId;
+ la->la_acpi_id = proc->ProcessorId;
if (proc->ProcessorEnabled) {
la->la_enabled = 1;
lapic_create(proc->LocalApicId, 0);
@@ -545,14 +545,20 @@
static int
madt_find_cpu(u_int acpi_id, u_int *apic_id)
{
+ int i;
- if (!lapics[acpi_id].la_present)
- return (ENOENT);
- *apic_id = lapics[acpi_id].la_apic_id;
- if (lapics[acpi_id].la_enabled)
- return (0);
- else
- return (ENXIO);
+ for (i = 0; i < NLAPICS; i++) {
+ if (!lapics[i].la_present)
+ continue;
+ if (lapics[i].la_acpi_id != acpi_id)
+ continue;
+ *apic_id = i;
+ if (lapics[i].la_enabled)
+ return (0);
+ else
+ return (ENXIO);
+ }
+ return (ENOENT);
}
/*
@@ -752,8 +758,9 @@
static void
madt_set_ids(void *dummy)
{
+ struct lapic_info *la;
struct pcpu *pc;
- u_int i, j;
+ u_int i;
if (madt == NULL)
return;
@@ -762,19 +769,14 @@
continue;
pc = pcpu_find(i);
KASSERT(pc != NULL, ("no pcpu data for CPU %d", i));
- for (j = 0; j < NLAPICS + 1; j++) {
- if (!lapics[j].la_present || !lapics[j].la_enabled)
- continue;
- if (lapics[j].la_apic_id == pc->pc_apic_id) {
- pc->pc_acpi_id = j;
- if (bootverbose)
- printf("APIC: CPU %u has ACPI ID %u\n",
- i, j);
- break;
- }
- }
- if (j == NLAPICS + 1)
- panic("Unable to find ACPI ID for CPU %d", i);
+ la = &lapics[pc->pc_apic_id];
+ if (!la->la_present || !la->la_enabled)
+ panic("APIC: CPU with APIC ID %u is not enabled",
+ pc->pc_apic_id);
+ pc->pc_acpi_id = la->la_acpi_id;
+ if (bootverbose)
+ printf("APIC: CPU %u has ACPI ID %u\n", i,
+ la->la_acpi_id);
}
}
SYSINIT(madt_set_ids, SI_SUB_CPU, SI_ORDER_ANY, madt_set_ids, NULL)
==== //depot/projects/netperf_socket/sys/amd64/amd64/identcpu.c#5 (text+ko) ====
@@ -41,7 +41,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/amd64/identcpu.c,v 1.131 2004/04/07 00:44:15 peter Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/amd64/identcpu.c,v 1.132 2004/06/03 20:18:15 peter Exp $");
#include "opt_cpu.h"
@@ -90,7 +90,10 @@
static char cpu_brand[48];
-static struct cpu_nameclass amd64_cpus[] = {
+static struct {
+ char *cpu_name;
+ int cpu_class;
+} amd64_cpus[] = {
{ "Clawhammer", CPUCLASS_K8 }, /* CPU_CLAWHAMMER */
{ "Sledgehammer", CPUCLASS_K8 }, /* CPU_SLEDGEHAMMER */
};
==== //depot/projects/netperf_socket/sys/amd64/amd64/io_apic.c#3 (text+ko) ====
@@ -28,7 +28,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/amd64/io_apic.c,v 1.8 2004/05/16 20:30:46 peter Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/amd64/io_apic.c,v 1.9 2004/06/03 20:25:05 peter Exp $");
#include "opt_atpic.h"
#include "opt_isa.h"
@@ -126,6 +126,7 @@
static void ioapic_suspend(struct intsrc *isrc);
static void ioapic_resume(struct intsrc *isrc);
static void ioapic_program_destination(struct ioapic_intsrc *intpin);
+static void ioapic_program_intpin(struct ioapic_intsrc *intpin);
static void ioapic_setup_mixed_mode(struct ioapic_intsrc *intpin);
static STAILQ_HEAD(,ioapic) ioapic_list = STAILQ_HEAD_INITIALIZER(ioapic_list);
@@ -135,7 +136,7 @@
ioapic_suspend, ioapic_resume,
ioapic_config_intr };
-static int current_cluster, logical_clusters, next_ioapic_base;
+static int bsp_id, current_cluster, logical_clusters, next_ioapic_base;
static u_int mixed_mode_enabled, next_id, program_logical_dest;
#if defined(NO_MIXED_MODE) || !defined(DEV_ATPIC)
static int mixed_mode_active = 0;
@@ -208,13 +209,88 @@
}
/*
+ * Completely program an intpin based on the data in its interrupt source
+ * structure.
+ */
+static void
+ioapic_program_intpin(struct ioapic_intsrc *intpin)
+{
+ struct ioapic *io = (struct ioapic *)intpin->io_intsrc.is_pic;
+ uint32_t low, high, value;
+
+ /*
+ * For pins routed via mixed mode or disabled, just ensure that
+ * they are masked.
+ */
+ if (intpin->io_dest == DEST_EXTINT ||
+ intpin->io_vector == VECTOR_DISABLED) {
+ low = ioapic_read(io->io_addr,
+ IOAPIC_REDTBL_LO(intpin->io_intpin));
+ if ((low & IOART_INTMASK) == IOART_INTMCLR)
+ ioapic_write(io->io_addr,
+ IOAPIC_REDTBL_LO(intpin->io_intpin),
+ low | IOART_INTMSET);
+ return;
+ }
+
+ /* Set the destination. */
+ if (intpin->io_dest == DEST_NONE) {
+ low = IOART_DESTPHY;
+ high = bsp_id << APIC_ID_SHIFT;
+ } else {
+ low = IOART_DESTLOG;
+ high = (intpin->io_dest << APIC_ID_CLUSTER_SHIFT |
+ APIC_ID_CLUSTER_ID) << APIC_ID_SHIFT;
+ }
+
+ /* Program the rest of the low word. */
+ if (intpin->io_edgetrigger)
+ low |= IOART_TRGREDG;
+ else
+ low |= IOART_TRGRLVL;
+ if (intpin->io_activehi)
+ low |= IOART_INTAHI;
+ else
+ low |= IOART_INTALO;
+ if (intpin->io_masked)
+ low |= IOART_INTMSET;
+ switch (intpin->io_vector) {
+ case VECTOR_EXTINT:
+ KASSERT(intpin->io_edgetrigger,
+ ("EXTINT not edge triggered"));
+ low |= IOART_DELEXINT;
+ break;
+ case VECTOR_NMI:
+ KASSERT(intpin->io_edgetrigger,
+ ("NMI not edge triggered"));
+ low |= IOART_DELNMI;
+ break;
+ case VECTOR_SMI:
+ KASSERT(intpin->io_edgetrigger,
+ ("SMI not edge triggered"));
+ low |= IOART_DELSMI;
+ break;
+ default:
+ low |= IOART_DELLOPRI | apic_irq_to_idt(intpin->io_vector);
+ }
+
+ /* Write the values to the APIC. */
+ mtx_lock_spin(&icu_lock);
+ ioapic_write(io->io_addr, IOAPIC_REDTBL_LO(intpin->io_intpin), low);
+ value = ioapic_read(io->io_addr, IOAPIC_REDTBL_HI(intpin->io_intpin));
+ value &= ~IOART_DEST;
+ value |= high;
+ ioapic_write(io->io_addr, IOAPIC_REDTBL_HI(intpin->io_intpin), value);
+ mtx_unlock_spin(&icu_lock);
+}
+
+/*
* Program an individual intpin's logical destination.
*/
static void
ioapic_program_destination(struct ioapic_intsrc *intpin)
{
struct ioapic *io = (struct ioapic *)intpin->io_intsrc.is_pic;
- uint32_t value;
KASSERT(intpin->io_dest != DEST_NONE,
("intpin not assigned to a cluster"));
@@ -229,17 +305,7 @@
printf("IRQ %u", intpin->io_vector);
printf(") to cluster %u\n", intpin->io_dest);
}
- mtx_lock_spin(&icu_lock);
- value = ioapic_read(io->io_addr, IOAPIC_REDTBL_LO(intpin->io_intpin));
- value &= ~IOART_DESTMOD;
- value |= IOART_DESTLOG;
- ioapic_write(io->io_addr, IOAPIC_REDTBL_LO(intpin->io_intpin), value);
- value = ioapic_read(io->io_addr, IOAPIC_REDTBL_HI(intpin->io_intpin));
- value &= ~IOART_DEST;
- value |= (intpin->io_dest << APIC_ID_CLUSTER_SHIFT |
- APIC_ID_CLUSTER_ID) << APIC_ID_SHIFT;
- ioapic_write(io->io_addr, IOAPIC_REDTBL_HI(intpin->io_intpin), value);
- mtx_unlock_spin(&icu_lock);
+ ioapic_program_intpin(intpin);
}
static void
@@ -339,7 +405,7 @@
ioapic_resume(struct intsrc *isrc)
{
- TODO;
+ ioapic_program_intpin((struct ioapic_intsrc *)isrc);
}
/*
@@ -631,6 +697,7 @@
printf("ioapic%u <Version %u.%u> irqs %u-%u on motherboard\n",
io->io_id, flags >> 4, flags & 0xf, io->io_intbase,
io->io_intbase + io->io_numintr - 1);
+ bsp_id = PCPU_GET(apic_id);
for (i = 0, pin = io->io_pins; i < io->io_numintr; i++, pin++) {
/*
* Finish initializing the pins by programming the vectors
@@ -638,63 +705,18 @@
*/
if (pin->io_vector == VECTOR_DISABLED)
continue;
- flags = IOART_DESTPHY;
- if (pin->io_edgetrigger)
- flags |= IOART_TRGREDG;
- else
- flags |= IOART_TRGRLVL;
- if (pin->io_activehi)
- flags |= IOART_INTAHI;
- else
- flags |= IOART_INTALO;
- if (pin->io_masked)
- flags |= IOART_INTMSET;
- switch (pin->io_vector) {
- case VECTOR_EXTINT:
- KASSERT(pin->io_edgetrigger,
- ("EXTINT not edge triggered"));
- flags |= IOART_DELEXINT;
- break;
- case VECTOR_NMI:
- KASSERT(pin->io_edgetrigger,
- ("NMI not edge triggered"));
- flags |= IOART_DELNMI;
- break;
- case VECTOR_SMI:
- KASSERT(pin->io_edgetrigger,
- ("SMI not edge triggered"));
- flags |= IOART_DELSMI;
- break;
- default:
- flags |= IOART_DELLOPRI |
- apic_irq_to_idt(pin->io_vector);
- }
- mtx_lock_spin(&icu_lock);
- ioapic_write(apic, IOAPIC_REDTBL_LO(i), flags);
-
+ ioapic_program_intpin(pin);
+ if (pin->io_vector >= NUM_IO_INTS)
+ continue;
/*
- * Route interrupts to the BSP by default using physical
- * addressing. Vectored interrupts get readdressed using
- * logical IDs to CPU clusters when they are enabled.
+ * Route IRQ0 via the 8259A using mixed mode if mixed mode
+ * is available and turned on.
*/
- flags = ioapic_read(apic, IOAPIC_REDTBL_HI(i));
- flags &= ~IOART_DEST;
- flags |= PCPU_GET(apic_id) << APIC_ID_SHIFT;
- ioapic_write(apic, IOAPIC_REDTBL_HI(i), flags);
- mtx_unlock_spin(&icu_lock);
- if (pin->io_vector < NUM_IO_INTS) {
-
- /*
- * Route IRQ0 via the 8259A using mixed mode if
- * mixed mode is available and turned on.
- */
- if (pin->io_vector == 0 && mixed_mode_active &&
- mixed_mode_enabled)
- ioapic_setup_mixed_mode(pin);
- else
- intr_register_source(&pin->io_intsrc);
- }
-
+ if (pin->io_vector == 0 && mixed_mode_active &&
+ mixed_mode_enabled)
+ ioapic_setup_mixed_mode(pin);
+ else
+ intr_register_source(&pin->io_intsrc);
}
}
==== //depot/projects/netperf_socket/sys/amd64/amd64/legacy.c#3 (text+ko) ====
@@ -28,7 +28,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/amd64/legacy.c,v 1.53 2004/05/16 20:30:46 peter Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/amd64/legacy.c,v 1.55 2004/06/03 20:25:05 peter Exp $");
/*
* This code implements a system driver for legacy systems that do not
@@ -40,6 +40,7 @@
#include <sys/bus.h>
#include <sys/kernel.h>
#include <sys/malloc.h>
+#include <sys/module.h>
#include <machine/bus.h>
#include <sys/pcpu.h>
#include <sys/rman.h>
@@ -221,17 +222,19 @@
atdev = malloc(sizeof(struct legacy_device), M_LEGACYDEV,
M_NOWAIT | M_ZERO);
- if (!atdev)
- return(0);
+ if (atdev == NULL)
+ return(NULL);
resource_list_init(&atdev->lg_resources);
atdev->lg_pcibus = -1;
- child = device_add_child_ordered(bus, order, name, unit);
+ child = device_add_child_ordered(bus, order, name, unit);
+ if (child == NULL)
+ free(atdev, M_LEGACYDEV);
+ else
+ /* should we free this in legacy_child_detached? */
+ device_set_ivars(child, atdev);
- /* should we free this in legacy_child_detached? */
- device_set_ivars(child, atdev);
-
- return(child);
+ return (child);
}
static int
==== //depot/projects/netperf_socket/sys/amd64/amd64/mem.c#4 (text+ko) ====
@@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/amd64/mem.c,v 1.114 2004/04/05 21:25:51 imp Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/amd64/mem.c,v 1.115 2004/06/03 05:58:30 phk Exp $");
/*
* Memory special file
@@ -51,6 +51,7 @@
#include <sys/lock.h>
#include <sys/malloc.h>
#include <sys/memrange.h>
+#include <sys/module.h>
#include <sys/mutex.h>
#include <sys/proc.h>
#include <sys/signalvar.h>
==== //depot/projects/netperf_socket/sys/amd64/amd64/mptable.c#3 (text+ko) ====
@@ -25,7 +25,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/amd64/mptable.c,v 1.230 2004/05/16 20:30:46 peter Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/amd64/mptable.c,v 1.231 2004/06/03 20:25:05 peter Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -544,15 +544,10 @@
KASSERT(src_bus <= mptable_maxbusid, ("bus id %d too large", src_bus));
switch (busses[src_bus].bus_type) {
case ISA:
+ case EISA:
return (INTR_POLARITY_HIGH);
case PCI:
return (INTR_POLARITY_LOW);
- case EISA:
- KASSERT(src_bus_irq < 16, ("Invalid EISA IRQ %d", src_bus_irq));
- if (elcr_read_trigger(src_bus_irq) == INTR_TRIGGER_LEVEL)
- return (INTR_POLARITY_LOW);
- else
- return (INTR_POLARITY_HIGH);
default:
panic("%s: unknown bus type %d", __func__,
busses[src_bus].bus_type);
==== //depot/projects/netperf_socket/sys/amd64/amd64/nexus.c#3 (text+ko) ====
@@ -28,7 +28,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/amd64/nexus.c,v 1.59 2004/05/16 20:30:46 peter Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/amd64/nexus.c,v 1.60 2004/06/03 20:22:48 peter Exp $");
/*
* This code implements a `root nexus' for Intel Architecture
@@ -481,8 +481,6 @@
struct resource_list_entry *rle;
rle = resource_list_find(rl, type, rid);
- device_printf(child, "type %d rid %d startp %p countp %p - got %p\n",
- type, rid, startp, countp, rle);
if (!rle)
return(ENOENT);
if (startp)
==== //depot/projects/netperf_socket/sys/amd64/amd64/uio_machdep.c#3 (text+ko) ====
@@ -36,7 +36,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/amd64/uio_machdep.c,v 1.3 2004/04/05 21:15:52 imp Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/amd64/uio_machdep.c,v 1.5 2004/06/03 10:22:45 tjr Exp $");
#include <sys/param.h>
#include <sys/kernel.h>
@@ -70,12 +70,8 @@
("uiomove_fromphys: mode"));
KASSERT(uio->uio_segflg != UIO_USERSPACE || uio->uio_td == curthread,
("uiomove_fromphys proc"));
- if (td != NULL) {
- mtx_lock_spin(&sched_lock);
- save = td->td_flags & TDF_DEADLKTREAT;
- td->td_flags |= TDF_DEADLKTREAT;
- mtx_unlock_spin(&sched_lock);
- }
+ save = td->td_pflags & TDP_DEADLKTREAT;
+ td->td_pflags |= TDP_DEADLKTREAT;
while (n > 0 && uio->uio_resid) {
iov = uio->uio_iov;
cnt = iov->iov_len;
@@ -118,10 +114,7 @@
n -= cnt;
}
out:
- if (td != NULL && save == 0) {
- mtx_lock_spin(&sched_lock);
- td->td_flags &= ~TDF_DEADLKTREAT;
- mtx_unlock_spin(&sched_lock);
- }
+ if (save == 0)
+ td->td_pflags &= ~TDP_DEADLKTREAT;
return (error);
}
==== //depot/projects/netperf_socket/sys/amd64/conf/GENERIC#7 (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.409 2004/05/17 22:13:14 peter Exp $
+# $FreeBSD: src/sys/amd64/conf/GENERIC,v 1.410 2004/06/03 21:40:41 peter Exp $
machine amd64
cpu HAMMER
@@ -176,6 +176,7 @@
# PCI Ethernet NICs.
device de # DEC/Intel DC21x4x (``Tulip'')
device em # Intel PRO/1000 adapter Gigabit Ethernet Card
+device ixgb # Intel PRO/10GbE Ethernet Card
device txp # 3Com 3cR990 (``Typhoon'')
device vx # 3Com 3c590, 3c595 (``Vortex'')
==== //depot/projects/netperf_socket/sys/amd64/include/cputypes.h#2 (text+ko) ====
@@ -24,7 +24,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $FreeBSD: src/sys/amd64/include/cputypes.h,v 1.17 2003/05/01 01:05:23 peter Exp $
+ * $FreeBSD: src/sys/amd64/include/cputypes.h,v 1.18 2004/06/03 20:18:15 peter Exp $
*/
#ifndef _MACHINE_CPUTYPES_H_
@@ -44,11 +44,6 @@
#define CPU_SLEDGEHAMMER 2 /* AMD Sledgehammer */
#ifndef LOCORE
-struct cpu_nameclass {
- char *cpu_name;
- int cpu_class;
-};
-
extern int cpu;
extern int cpu_class;
#endif
==== //depot/projects/netperf_socket/sys/amd64/isa/atpic.c#5 (text+ko) ====
@@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/isa/atpic.c,v 1.11 2004/05/16 20:30:47 peter Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/isa/atpic.c,v 1.12 2004/06/03 05:58:30 phk Exp $");
#include "opt_auto_eoi.h"
#include "opt_isa.h"
@@ -43,6 +43,7 @@
#include <sys/interrupt.h>
#include <sys/kernel.h>
#include <sys/lock.h>
+#include <sys/module.h>
#include <sys/mutex.h>
#include <sys/proc.h>
==== //depot/projects/netperf_socket/sys/amd64/isa/clock.c#4 (text+ko) ====
@@ -33,7 +33,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/isa/clock.c,v 1.209 2004/05/16 20:30:47 peter Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/isa/clock.c,v 1.211 2004/06/03 20:21:30 peter Exp $");
/*
* Routines to handle clock hardware.
@@ -59,6 +59,7 @@
#include <sys/timetc.h>
#include <sys/kernel.h>
#include <sys/limits.h>
+#include <sys/module.h>
#include <sys/sysctl.h>
#include <sys/cons.h>
#include <sys/power.h>
==== //depot/projects/netperf_socket/sys/amd64/pci/pci_bus.c#4 (text+ko) ====
@@ -25,7 +25,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/pci/pci_bus.c,v 1.108 2004/05/16 20:30:47 peter Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/pci/pci_bus.c,v 1.109 2004/06/03 05:58:30 phk Exp $");
#include "opt_cpu.h"
@@ -34,6 +34,7 @@
#include <sys/bus.h>
#include <sys/kernel.h>
#include <sys/malloc.h>
+#include <sys/module.h>
#include <dev/pci/pcivar.h>
#include <dev/pci/pcireg.h>
==== //depot/projects/netperf_socket/sys/arm/arm/uio_machdep.c#2 (text+ko) ====
@@ -40,7 +40,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/arm/arm/uio_machdep.c,v 1.1 2004/05/14 11:46:42 cognet Exp $");
+__FBSDID("$FreeBSD: src/sys/arm/arm/uio_machdep.c,v 1.3 2004/06/03 10:22:46 tjr Exp $");
#include <sys/param.h>
#include <sys/kernel.h>
@@ -74,12 +74,8 @@
("uiomove_fromphys: mode"));
KASSERT(uio->uio_segflg != UIO_USERSPACE || uio->uio_td == curthread,
("uiomove_fromphys proc"));
- if (td != NULL) {
- mtx_lock_spin(&sched_lock);
- save = td->td_flags & TDF_DEADLKTREAT;
- td->td_flags |= TDF_DEADLKTREAT;
- mtx_unlock_spin(&sched_lock);
- }
+ save = td->td_pflags & TDP_DEADLKTREAT;
+ td->td_pflags |= TDP_DEADLKTREAT;
while (n > 0 && uio->uio_resid) {
iov = uio->uio_iov;
cnt = iov->iov_len;
@@ -122,10 +118,7 @@
n -= cnt;
}
out:
- if (td != NULL && save == 0) {
- mtx_lock_spin(&sched_lock);
- td->td_flags &= ~TDF_DEADLKTREAT;
- mtx_unlock_spin(&sched_lock);
- }
+ if (save == 0)
+ td->td_pflags &= ~TDP_DEADLKTREAT;
return (error);
}
==== //depot/projects/netperf_socket/sys/dev/adlink/adlink.c#5 (text+ko) ====
@@ -28,13 +28,14 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/adlink/adlink.c,v 1.9 2004/03/17 17:50:24 njl Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/adlink/adlink.c,v 1.10 2004/06/03 06:09:58 phk Exp $");
#ifdef _KERNEL
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/malloc.h>
#include <sys/kernel.h>
+#include <sys/module.h>
#include <sys/kthread.h>
#include <sys/conf.h>
#include <sys/bus.h>
==== //depot/projects/netperf_socket/sys/dev/ata/ata-cbus.c#4 (text+ko) ====
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/ata/ata-cbus.c,v 1.12 2004/04/13 09:44:20 sos Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/ata/ata-cbus.c,v 1.13 2004/06/03 06:09:58 phk Exp $");
#include "opt_ata.h"
#include <sys/param.h>
@@ -36,6 +36,7 @@
#include <sys/ata.h>
#include <sys/bus.h>
#include <sys/malloc.h>
+#include <sys/module.h>
#include <sys/sema.h>
#include <sys/taskqueue.h>
#include <vm/uma.h>
==== //depot/projects/netperf_socket/sys/dev/fb/tga.c#2 (text+ko) ====
@@ -26,7 +26,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/fb/tga.c,v 1.4 2003/08/24 17:46:06 obrien Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/fb/tga.c,v 1.5 2004/06/03 06:09:58 phk Exp $");
/*
* Copyright (c) 1995, 1996 Carnegie-Mellon University.
* All rights reserved.
@@ -55,13 +55,14 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/fb/tga.c,v 1.4 2003/08/24 17:46:06 obrien Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/fb/tga.c,v 1.5 2004/06/03 06:09:58 phk Exp $");
#include <machine/stdarg.h>
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/kernel.h>
+#include <sys/module.h>
#include <sys/conf.h>
#include <sys/proc.h>
#include <sys/fcntl.h>
==== //depot/projects/netperf_socket/sys/dev/fxp/if_fxp.c#10 (text+ko) ====
@@ -28,7 +28,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/fxp/if_fxp.c,v 1.212 2004/05/30 20:08:32 phk Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/fxp/if_fxp.c,v 1.214 2004/06/02 22:59:57 mux Exp $");
/*
* Intel EtherExpress Pro/100B PCI Fast Ethernet driver
@@ -281,13 +281,6 @@
DRIVER_MODULE(fxp, cardbus, fxp_driver, fxp_devclass, 0, 0);
DRIVER_MODULE(miibus, fxp, miibus_driver, miibus_devclass, 0, 0);
-static int fxp_rnr;
-SYSCTL_INT(_hw, OID_AUTO, fxp_rnr, CTLFLAG_RW, &fxp_rnr, 0, "fxp rnr events");
-
-static int fxp_noflow;
-SYSCTL_INT(_hw, OID_AUTO, fxp_noflow, CTLFLAG_RW, &fxp_noflow, 0, "fxp flow control disabled");
-TUNABLE_INT("hw.fxp_noflow", &fxp_noflow);
-
/*
* Wait for the previous command to be accepted (but not necessarily
* completed).
@@ -412,7 +405,6 @@
sc->dev = dev;
callout_init(&sc->stat_ch, CALLOUT_MPSAFE);
- sysctl_ctx_init(&sc->sysctl_ctx);
mtx_init(&sc->sc_mtx, device_get_nameunit(dev), MTX_NETWORK_LOCK,
MTX_DEF);
ifmedia_init(&sc->sc_media, 0, fxp_serial_ifmedia_upd,
@@ -496,34 +488,38 @@
(data & FXP_PHY_SERIAL_ONLY))
sc->flags |= FXP_FLAG_SERIAL_MEDIA;
- /*
- * Create the sysctl tree
- */
- sc->sysctl_tree = SYSCTL_ADD_NODE(&sc->sysctl_ctx,
- SYSCTL_STATIC_CHILDREN(_hw), OID_AUTO,
- device_get_nameunit(dev), CTLFLAG_RD, 0, "");
- if (sc->sysctl_tree == NULL) {
- error = ENXIO;
- goto fail;
- }
- SYSCTL_ADD_PROC(&sc->sysctl_ctx, SYSCTL_CHILDREN(sc->sysctl_tree),
+ SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev),
+ SYSCTL_CHILDREN(device_get_sysctl_tree(dev)),
OID_AUTO, "int_delay", CTLTYPE_INT | CTLFLAG_RW,
&sc->tunable_int_delay, 0, sysctl_hw_fxp_int_delay, "I",
"FXP driver receive interrupt microcode bundling delay");
- SYSCTL_ADD_PROC(&sc->sysctl_ctx, SYSCTL_CHILDREN(sc->sysctl_tree),
+ SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev),
+ SYSCTL_CHILDREN(device_get_sysctl_tree(dev)),
OID_AUTO, "bundle_max", CTLTYPE_INT | CTLFLAG_RW,
&sc->tunable_bundle_max, 0, sysctl_hw_fxp_bundle_max, "I",
"FXP driver receive interrupt microcode bundle size limit");
+ SYSCTL_ADD_INT(device_get_sysctl_ctx(dev),
+ SYSCTL_CHILDREN(device_get_sysctl_tree(dev)),
+ OID_AUTO, "rnr", CTLFLAG_RD, &sc->rnr, 0,
+ "FXP RNR events");
+ SYSCTL_ADD_INT(device_get_sysctl_ctx(dev),
+ SYSCTL_CHILDREN(device_get_sysctl_tree(dev)),
+ OID_AUTO, "noflow", CTLFLAG_RW, &sc->tunable_noflow, 0,
+ "FXP flow control disabled");
/*
* Pull in device tunables.
*/
sc->tunable_int_delay = TUNABLE_INT_DELAY;
sc->tunable_bundle_max = TUNABLE_BUNDLE_MAX;
+ sc->tunable_noflow = 0;
(void) resource_int_value(device_get_name(dev), device_get_unit(dev),
"int_delay", &sc->tunable_int_delay);
(void) resource_int_value(device_get_name(dev), device_get_unit(dev),
"bundle_max", &sc->tunable_bundle_max);
+ (void) resource_int_value(device_get_name(dev), device_get_unit(dev),
+ "noflow", &sc->tunable_noflow);
+ sc->rnr = 0;
/*
* Find out the chip revision; lump all 82557 revs together.
@@ -867,7 +863,7 @@
struct fxp_tx *txp;
int i;
- mtx_assert(&sc->sc_mtx, MA_NOTOWNED);
+ FXP_LOCK_ASSERT(sc, MA_NOTOWNED);
KASSERT(sc->ih == NULL,
("fxp_release() called with intr handle still active"));
if (sc->miibus)
@@ -923,8 +919,6 @@
if (sc->mcs_tag)
bus_dma_tag_destroy(sc->mcs_tag);
- sysctl_ctx_free(&sc->sysctl_ctx);
-
mtx_destroy(&sc->sc_mtx);
}
@@ -1301,7 +1295,7 @@
struct mbuf *mb_head;
int error;
- mtx_assert(&sc->sc_mtx, MA_OWNED);
+ FXP_LOCK_ASSERT(sc, MA_OWNED);
/*
* See if we need to suspend xmit until the multicast filter
* has been reprogrammed (which can only be done at the head
@@ -1640,9 +1634,9 @@
struct fxp_rfa *rfa;
int rnr = (statack & FXP_SCB_STATACK_RNR) ? 1 : 0;
- mtx_assert(&sc->sc_mtx, MA_OWNED);
+ FXP_LOCK_ASSERT(sc, MA_OWNED);
if (rnr)
- fxp_rnr++;
+ sc->rnr++;
#ifdef DEVICE_POLLING
/* Pick up a deferred RNR condition if `count' ran out last time. */
if (sc->flags & FXP_FLAG_DEFERRED_RNR) {
@@ -1999,7 +1993,7 @@
struct fxp_cb_mcs *mcsp;
int i, prm, s;
- mtx_assert(&sc->sc_mtx, MA_OWNED);
+ FXP_LOCK_ASSERT(sc, MA_OWNED);
s = splimp();
/*
* Cancel any pending I/O
@@ -2129,7 +2123,7 @@
cbp->mc_all = sc->flags & FXP_FLAG_ALL_MCAST ? 1 : 0;
>>> TRUNCATED FOR MAIL (1000 lines) <<<
More information about the p4-projects
mailing list