PERFORCE change 34289 for review
Marcel Moolenaar
marcel at FreeBSD.org
Wed Jul 9 22:08:19 PDT 2003
http://perforce.freebsd.org/chv.cgi?CH=34289
Change 34289 by marcel at marcel_nfs on 2003/07/09 22:07:17
IFC @34286
Affected files ...
.. //depot/projects/uart/amd64/amd64/pmap.c#5 integrate
.. //depot/projects/uart/amd64/include/pmap.h#2 integrate
.. //depot/projects/uart/amd64/include/vmparam.h#2 integrate
.. //depot/projects/uart/conf/files#5 integrate
.. //depot/projects/uart/conf/options.i386#2 integrate
.. //depot/projects/uart/conf/options.pc98#2 integrate
.. //depot/projects/uart/dev/aac/aac.c#3 integrate
.. //depot/projects/uart/dev/aac/aac_pci.c#3 integrate
.. //depot/projects/uart/dev/aac/aacvar.h#2 integrate
.. //depot/projects/uart/dev/acpica/acpi_isab.c#2 integrate
.. //depot/projects/uart/dev/firewire/firewire.c#3 integrate
.. //depot/projects/uart/dev/usb/uscanner.c#3 integrate
.. //depot/projects/uart/i386/i386/mp_machdep.c#2 integrate
.. //depot/projects/uart/i386/i386/pmap.c#5 integrate
.. //depot/projects/uart/i386/i386/swtch.s#2 integrate
.. //depot/projects/uart/i386/isa/apic_vector.s#2 integrate
.. //depot/projects/uart/kern/kern_synch.c#2 integrate
.. //depot/projects/uart/kern/subr_witness.c#2 integrate
.. //depot/projects/uart/kern/sys_pipe.c#3 integrate
.. //depot/projects/uart/pci/if_dc.c#4 integrate
.. //depot/projects/uart/pci/if_dcreg.h#3 integrate
.. //depot/projects/uart/sparc64/conf/GENERIC#3 integrate
.. //depot/projects/uart/sys/vnode.h#2 integrate
Differences ...
==== //depot/projects/uart/amd64/amd64/pmap.c#5 (text+ko) ====
@@ -39,7 +39,7 @@
* SUCH DAMAGE.
*
* from: @(#)pmap.c 7.7 (Berkeley) 5/12/91
- * $FreeBSD: src/sys/amd64/amd64/pmap.c,v 1.420 2003/07/08 19:40:34 alc Exp $
+ * $FreeBSD: src/sys/amd64/amd64/pmap.c,v 1.423 2003/07/09 22:59:45 peter Exp $
*/
/*-
* Copyright (c) 2003 Networks Associates Technology, Inc.
@@ -330,6 +330,8 @@
pde = pmap_pde(pmap, va);
if (pde == NULL || (*pde & PG_V) == 0)
return NULL;
+ if ((*pde & PG_PS) != 0) /* compat with i386 pmap_pte() */
+ return ((pt_entry_t *)pde);
pte = (pt_entry_t *)PHYS_TO_DMAP(*pde & PG_FRAME);
return (&pte[pmap_pte_index(va)]);
}
@@ -386,14 +388,12 @@
((pd_entry_t *)KPDphys)[i] |= PG_RW | PG_V;
}
-#if 0
/* Map from zero to end of allocations under 2M pages */
/* This replaces some of the KPTphys entries above */
for (i = 0; (i << PDRSHIFT) < avail_start; i++) {
((pd_entry_t *)KPDphys)[i] = i << PDRSHIFT;
((pd_entry_t *)KPDphys)[i] |= PG_RW | PG_V | PG_PS;
}
-#endif
/* And connect up the PD to the PDP */
for (i = 0; i < NKPDPE; i++) {
@@ -890,6 +890,7 @@
if (m->hold_count == 0) {
vm_offset_t pteva;
+
/*
* unmap the page table page
*/
@@ -914,9 +915,11 @@
}
--pmap->pm_stats.resident_count;
if (m->pindex < NUPDE) {
- /* Unhold the PD page */
+ /* We just released a PT, unhold the matching PD */
vm_page_t pdpg;
- pdpg = vm_page_lookup(pmap->pm_pteobj, NUPDE + pmap_pdpe_index(va));
+
+ pdpg = vm_page_lookup(pmap->pm_pteobj, NUPDE +
+ ((va >> PDPSHIFT) & (NUPDPE - 1)));
while (vm_page_sleep_if_busy(pdpg, FALSE, "pulook"))
vm_page_lock_queues();
vm_page_unhold(pdpg);
@@ -924,9 +927,11 @@
_pmap_unwire_pte_hold(pmap, va, pdpg);
}
if (m->pindex >= NUPDE && m->pindex < (NUPDE + NUPDPE)) {
- /* Unhold the PDP page */
+ /* We just released a PD, unhold the matching PDP */
vm_page_t pdppg;
- pdppg = vm_page_lookup(pmap->pm_pteobj, NUPDE + NUPDPE + pmap_pml4e_index(va));
+
+ pdppg = vm_page_lookup(pmap->pm_pteobj, NUPDE + NUPDPE +
+ ((va >> PML4SHIFT) & (NUPML4E - 1)));
while (vm_page_sleep_if_busy(pdppg, FALSE, "pulooK"))
vm_page_lock_queues();
vm_page_unhold(pdppg);
@@ -1124,7 +1129,8 @@
_pmap_allocpte(pmap, NUPDE + NUPDPE + pml4index);
} else {
/* Add reference to pdp page */
- pdppg = pmap_page_lookup(pmap->pm_pteobj, NUPDE + NUPDPE + pml4index);
+ pdppg = pmap_page_lookup(pmap->pm_pteobj,
+ NUPDE + NUPDPE + pml4index);
pdppg->hold_count++;
}
pdp = (pdp_entry_t *)PHYS_TO_DMAP(*pml4 & PG_FRAME);
@@ -1150,16 +1156,17 @@
/* Have to allocate a new pd, recurse */
_pmap_allocpte(pmap, NUPDE + pdpindex);
pdp = (pdp_entry_t *)PHYS_TO_DMAP(*pml4 & PG_FRAME);
- pdp = &pdp[pdpindex];
+ pdp = &pdp[pdpindex & ((1ul << NPDPEPGSHIFT) - 1)];
} else {
pdp = (pdp_entry_t *)PHYS_TO_DMAP(*pml4 & PG_FRAME);
- pdp = &pdp[pdpindex];
+ pdp = &pdp[pdpindex & ((1ul << NPDPEPGSHIFT) - 1)];
if ((*pdp & PG_V) == 0) {
/* Have to allocate a new pd, recurse */
_pmap_allocpte(pmap, NUPDE + pdpindex);
} else {
/* Add reference to the pd page */
- pdpg = pmap_page_lookup(pmap->pm_pteobj, NUPDE + pdpindex);
+ pdpg = pmap_page_lookup(pmap->pm_pteobj,
+ NUPDE + pdpindex);
pdpg->hold_count++;
}
}
@@ -1239,7 +1246,7 @@
/***************************************************
-* Pmap allocation/deallocation routines.
+ * Pmap allocation/deallocation routines.
***************************************************/
/*
==== //depot/projects/uart/amd64/include/pmap.h#2 (text+ko) ====
@@ -42,7 +42,7 @@
*
* from: hp300: @(#)pmap.h 7.2 (Berkeley) 12/16/90
* from: @(#)pmap.h 7.4 (Berkeley) 5/12/91
- * $FreeBSD: src/sys/amd64/include/pmap.h,v 1.104 2003/06/22 13:02:45 simokawa Exp $
+ * $FreeBSD: src/sys/amd64/include/pmap.h,v 1.105 2003/07/09 23:04:23 peter Exp $
*/
#ifndef _MACHINE_PMAP_H_
@@ -86,14 +86,18 @@
* Pte related macros. This is complicated by having to deal with
* the sign extension of the 48th bit.
*/
-#define VADDR_SIGN(l4) \
- ((l4) >= NPML4EPG/2 ? ((unsigned long)-1 << 47) : 0ul)
-#define VADDR(l4, l3, l2, l1) ( \
- ((unsigned long)(l4) << PML4SHIFT) | VADDR_SIGN(l4) | \
+#define KVADDR(l4, l3, l2, l1) ( \
+ ((unsigned long)-1 << 47) | \
+ ((unsigned long)(l4) << PML4SHIFT) | \
((unsigned long)(l3) << PDPSHIFT) | \
((unsigned long)(l2) << PDRSHIFT) | \
((unsigned long)(l1) << PAGE_SHIFT))
+#define UVADDR(l4, l3, l2, l1) ( \
+ ((unsigned long)(l4) << PML4SHIFT) | \
+ ((unsigned long)(l3) << PDPSHIFT) | \
+ ((unsigned long)(l2) << PDRSHIFT) | \
+ ((unsigned long)(l1) << PAGE_SHIFT))
#ifndef NKPT
#define NKPT 120 /* initial number of kernel page tables */
@@ -103,7 +107,7 @@
#define NKPDPE 1 /* number of kernel PDP slots */
#define NKPDE (NKPDPE*NPDEPG) /* number of kernel PD slots */
-#define NUPML4E 1 /* number of userland PML4 pages */
+#define NUPML4E (NPML4EPG/2) /* number of userland PML4 pages */
#define NUPDPE (NUPML4E*NPDPEPG)/* number of userland PDP pages */
#define NUPDE (NUPDPE*NPDEPG) /* number of userland PD entries */
@@ -149,10 +153,10 @@
* in the page tables and the evil overlapping.
*/
#ifdef _KERNEL
-#define addr_PTmap (VADDR(PML4PML4I, 0, 0, 0))
-#define addr_PDmap (VADDR(PML4PML4I, PML4PML4I, 0, 0))
-#define addr_PDPmap (VADDR(PML4PML4I, PML4PML4I, PML4PML4I, 0))
-#define addr_PML4map (VADDR(PML4PML4I, PML4PML4I, PML4PML4I, PML4PML4I))
+#define addr_PTmap (KVADDR(PML4PML4I, 0, 0, 0))
+#define addr_PDmap (KVADDR(PML4PML4I, PML4PML4I, 0, 0))
+#define addr_PDPmap (KVADDR(PML4PML4I, PML4PML4I, PML4PML4I, 0))
+#define addr_PML4map (KVADDR(PML4PML4I, PML4PML4I, PML4PML4I, PML4PML4I))
#define addr_PML4pml4e (addr_PML4map + (PML4PML4I * sizeof(pml4_entry_t)))
#define PTmap ((pt_entry_t *)(addr_PTmap))
#define PDmap ((pd_entry_t *)(addr_PDmap))
==== //depot/projects/uart/amd64/include/vmparam.h#2 (text+ko) ====
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* from: @(#)vmparam.h 5.9 (Berkeley) 5/12/91
- * $FreeBSD: src/sys/amd64/include/vmparam.h,v 1.38 2003/05/23 06:36:46 peter Exp $
+ * $FreeBSD: src/sys/amd64/include/vmparam.h,v 1.39 2003/07/09 23:04:23 peter Exp $
*/
@@ -92,18 +92,18 @@
* messy at times, but hey, we'll do anything to save a page :-)
*/
-#define VM_MAX_KERNEL_ADDRESS VADDR(KPML4I, NPDPEPG-1, NKPDE-1, NPTEPG-1)
-#define VM_MIN_KERNEL_ADDRESS VADDR(KPML4I, KPDPI, 0, 0)
+#define VM_MAX_KERNEL_ADDRESS KVADDR(KPML4I, NPDPEPG-1, NKPDE-1, NPTEPG-1)
+#define VM_MIN_KERNEL_ADDRESS KVADDR(KPML4I, KPDPI, 0, 0)
-#define DMAP_MIN_ADDRESS VADDR(DMPML4I, 0, 0, 0)
-#define DMAP_MAX_ADDRESS VADDR(DMPML4I+1, 0, 0, 0)
+#define DMAP_MIN_ADDRESS KVADDR(DMPML4I, 0, 0, 0)
+#define DMAP_MAX_ADDRESS KVADDR(DMPML4I+1, 0, 0, 0)
-#define KERNBASE VADDR(KPML4I, KPDPI, 0, 0)
+#define KERNBASE KVADDR(KPML4I, KPDPI, 0, 0)
-#define UPT_MAX_ADDRESS VADDR(PML4PML4I, PML4PML4I, PML4PML4I, PML4PML4I)
-#define UPT_MIN_ADDRESS VADDR(PML4PML4I, 0, 0, 0)
+#define UPT_MAX_ADDRESS KVADDR(PML4PML4I, PML4PML4I, PML4PML4I, PML4PML4I)
+#define UPT_MIN_ADDRESS KVADDR(PML4PML4I, 0, 0, 0)
-#define VM_MAXUSER_ADDRESS VADDR(NUPML4E, 0, 0, 0)
+#define VM_MAXUSER_ADDRESS UVADDR(NUPML4E, 0, 0, 0)
#define USRSTACK VM_MAXUSER_ADDRESS
==== //depot/projects/uart/conf/files#5 (text+ko) ====
@@ -1,4 +1,4 @@
-# $FreeBSD: src/sys/conf/files,v 1.802 2003/07/08 18:59:32 jhb Exp $
+# $FreeBSD: src/sys/conf/files,v 1.803 2003/07/09 16:14:10 jhb Exp $
#
# The long compile-with and dependency lines are required because of
# limitations in config: backslash-newline doesn't work in strings, and
@@ -241,7 +241,7 @@
dev/acpica/acpi_cmbat.c optional acpi
dev/acpica/acpi_cpu.c optional acpi
dev/acpica/acpi_ec.c optional acpi
-dev/acpica/acpi_isab.c optional acpi
+dev/acpica/acpi_isab.c optional acpi isa
dev/acpica/acpi_lid.c optional acpi
dev/acpica/acpi_pci.c optional acpi pci
dev/acpica/acpi_pci_link.c optional acpi pci
@@ -544,10 +544,10 @@
dev/pccard/pccard_cis_quirks.c optional pccard
dev/pccard/power_if.m standard
dev/pccbb/pccbb.c optional cbb
-dev/pci/eisa_pci.c optional pci
+dev/pci/eisa_pci.c optional pci eisa
dev/pci/fixup_pci.c optional pci
dev/pci/ignore_pci.c optional pci
-dev/pci/isa_pci.c optional pci
+dev/pci/isa_pci.c optional pci isa
dev/pci/pci.c optional pci
dev/pci/pci_if.m standard
dev/pci/pci_pci.c optional pci
==== //depot/projects/uart/conf/options.i386#2 (text+ko) ====
@@ -1,4 +1,4 @@
-# $FreeBSD: src/sys/conf/options.i386,v 1.193 2003/06/27 22:39:13 peter Exp $
+# $FreeBSD: src/sys/conf/options.i386,v 1.194 2003/07/10 01:02:58 peter Exp $
# Options specific to the i386 platform kernels
MATH_EMULATE opt_math_emulate.h
@@ -6,7 +6,6 @@
DISABLE_PSE opt_pmap.h
PMAP_SHPGPERPROC opt_pmap.h
DISABLE_PG_G opt_pmap.h
-LAZY_SWITCH opt_swtch.h
PPC_PROBE_CHIPSET opt_ppc.h
PPC_DEBUG opt_ppc.h
MAXMEM
==== //depot/projects/uart/conf/options.pc98#2 (text+ko) ====
@@ -1,4 +1,4 @@
-# $FreeBSD: src/sys/conf/options.pc98,v 1.165 2003/06/27 22:39:13 peter Exp $
+# $FreeBSD: src/sys/conf/options.pc98,v 1.166 2003/07/10 01:02:58 peter Exp $
# Options specific to the pc98 platform kernels
MATH_EMULATE opt_math_emulate.h
@@ -6,7 +6,6 @@
DISABLE_PSE opt_pmap.h
PMAP_SHPGPERPROC opt_pmap.h
DISABLE_PG_G opt_pmap.h
-LAZY_SWITCH opt_swtch.h
PPC_PROBE_CHIPSET opt_ppc.h
PPC_DEBUG opt_ppc.h
MAXMEM
==== //depot/projects/uart/dev/aac/aac.c#3 (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/aac/aac.c,v 1.70 2003/07/01 15:51:51 scottl Exp $
+ * $FreeBSD: src/sys/dev/aac/aac.c,v 1.73 2003/07/09 21:16:23 scottl Exp $
*/
/*
@@ -67,7 +67,7 @@
/* Command Processing */
static void aac_timeout(struct aac_softc *sc);
-static int aac_start(struct aac_command *cm);
+static int aac_map_command(struct aac_command *cm);
static void aac_complete(void *context, int pending);
static int aac_bio_command(struct aac_softc *sc, struct aac_command **cmp);
static void aac_bio_complete(struct aac_command *cm);
@@ -75,11 +75,12 @@
static void aac_command_thread(struct aac_softc *sc);
/* Command Buffer Management */
+static void aac_map_command_sg(void *arg, bus_dma_segment_t *segs,
+ int nseg, int error);
static void aac_map_command_helper(void *arg, bus_dma_segment_t *segs,
int nseg, int error);
static int aac_alloc_commands(struct aac_softc *sc);
static void aac_free_commands(struct aac_softc *sc);
-static void aac_map_command(struct aac_command *cm);
static void aac_unmap_command(struct aac_command *cm);
/* Hardware Interface */
@@ -667,6 +668,9 @@
debug_called(2);
+ if (sc->flags & AAC_QUEUE_FRZN)
+ return;
+
for (;;) {
/*
* Try to get a command that's been put off for lack of
@@ -686,7 +690,7 @@
break;
/* try to give the command to the controller */
- if (aac_start(cm) == EBUSY) {
+ if (aac_map_command(cm) == EBUSY) {
/* put it on the ready queue for later */
aac_requeue_ready(cm);
break;
@@ -699,7 +703,7 @@
* last moment when possible.
*/
static int
-aac_start(struct aac_command *cm)
+aac_map_command(struct aac_command *cm)
{
struct aac_softc *sc;
int error;
@@ -707,22 +711,23 @@
debug_called(2);
sc = cm->cm_sc;
+ error = 0;
- /* get the command mapped */
- aac_map_command(cm);
+ /* don't map more than once */
+ if (cm->cm_flags & AAC_CMD_MAPPED)
+ return (0);
- /* Fix up the address values in the FIB. Use the command array index
- * instead of a pointer since these fields are only 32 bits. Shift
- * the SenderFibAddress over to make room for the fast response bit.
- */
- cm->cm_fib->Header.SenderFibAddress = (cm->cm_index << 1);
- cm->cm_fib->Header.ReceiverFibAddress = cm->cm_fibphys;
-
- /* save a pointer to the command for speedy reverse-lookup */
- cm->cm_fib->Header.SenderData = cm->cm_index;
- /* put the FIB on the outbound queue */
- error = aac_enqueue_fib(sc, cm->cm_queue, cm);
- return(error);
+ if (cm->cm_datalen != 0) {
+ error = bus_dmamap_load(sc->aac_buffer_dmat, cm->cm_datamap,
+ cm->cm_data, cm->cm_datalen,
+ aac_map_command_sg, cm, 0);
+ if (error == EINPROGRESS) {
+ debug(1, "freezing queue\n");
+ sc->flags |= AAC_QUEUE_FRZN;
+ error = 0;
+ }
+ }
+ return (error);
}
/*
@@ -859,6 +864,7 @@
}
/* see if we can start some more I/O */
+ sc->flags &= ~AAC_QUEUE_FRZN;
aac_startio(sc);
AAC_LOCK_RELEASE(&sc->aac_io_lock);
@@ -1158,9 +1164,10 @@
return (ENOMEM);
}
- bus_dmamap_load(sc->aac_fib_dmat, fm->aac_fibmap, fm->aac_fibs,
- AAC_FIB_COUNT * sizeof(struct aac_fib),
- aac_map_command_helper, &fibphys, 0);
+ /* Ignore errors since this doesn't bounce */
+ (void)bus_dmamap_load(sc->aac_fib_dmat, fm->aac_fibmap, fm->aac_fibs,
+ AAC_FIB_COUNT * sizeof(struct aac_fib),
+ aac_map_command_helper, &fibphys, 0);
/* initialise constant fields in the command structure */
bzero(fm->aac_fibs, AAC_FIB_COUNT * sizeof(struct aac_fib));
@@ -1227,6 +1234,7 @@
static void
aac_map_command_sg(void *arg, bus_dma_segment_t *segs, int nseg, int error)
{
+ struct aac_softc *sc;
struct aac_command *cm;
struct aac_fib *fib;
int i;
@@ -1234,6 +1242,7 @@
debug_called(3);
cm = (struct aac_command *)arg;
+ sc = cm->cm_sc;
fib = cm->cm_fib;
/* copy into the FIB */
@@ -1260,37 +1269,30 @@
fib->Header.Size += nseg*sizeof(struct aac_sg_entry64);
}
}
-}
-/*
- * Map a command into controller-visible space.
- */
-static void
-aac_map_command(struct aac_command *cm)
-{
- struct aac_softc *sc;
+ /* Fix up the address values in the FIB. Use the command array index
+ * instead of a pointer since these fields are only 32 bits. Shift
+ * the SenderFibAddress over to make room for the fast response bit.
+ */
+ cm->cm_fib->Header.SenderFibAddress = (cm->cm_index << 1);
+ cm->cm_fib->Header.ReceiverFibAddress = cm->cm_fibphys;
- debug_called(2);
+ /* save a pointer to the command for speedy reverse-lookup */
+ cm->cm_fib->Header.SenderData = cm->cm_index;
- sc = cm->cm_sc;
+ if (cm->cm_flags & AAC_CMD_DATAIN)
+ bus_dmamap_sync(sc->aac_buffer_dmat, cm->cm_datamap,
+ BUS_DMASYNC_PREREAD);
+ if (cm->cm_flags & AAC_CMD_DATAOUT)
+ bus_dmamap_sync(sc->aac_buffer_dmat, cm->cm_datamap,
+ BUS_DMASYNC_PREWRITE);
+ cm->cm_flags |= AAC_CMD_MAPPED;
- /* don't map more than once */
- if (cm->cm_flags & AAC_CMD_MAPPED)
- return;
+ /* put the FIB on the outbound queue */
+ if (aac_enqueue_fib(sc, cm->cm_queue, cm) == EBUSY)
+ aac_requeue_ready(cm);
- if (cm->cm_datalen != 0) {
- bus_dmamap_load(sc->aac_buffer_dmat, cm->cm_datamap,
- cm->cm_data, cm->cm_datalen,
- aac_map_command_sg, cm, 0);
-
- if (cm->cm_flags & AAC_CMD_DATAIN)
- bus_dmamap_sync(sc->aac_buffer_dmat, cm->cm_datamap,
- BUS_DMASYNC_PREREAD);
- if (cm->cm_flags & AAC_CMD_DATAOUT)
- bus_dmamap_sync(sc->aac_buffer_dmat, cm->cm_datamap,
- BUS_DMASYNC_PREWRITE);
- }
- cm->cm_flags |= AAC_CMD_MAPPED;
+ return;
}
/*
@@ -1386,7 +1388,8 @@
sc->flags |= AAC_FLAGS_4GB_WINDOW;
if (options & AAC_SUPPORTED_NONDASD)
sc->flags |= AAC_FLAGS_ENABLE_CAM;
- if ((options & AAC_SUPPORTED_SGMAP_HOST64) != 0 && (sizeof(bus_addr_t) > 4)) {
+ if ((options & AAC_SUPPORTED_SGMAP_HOST64) != 0
+ && (sizeof(bus_addr_t) > 4)) {
device_printf(sc->aac_dev, "Enabling 64-bit address support\n");
sc->flags |= AAC_FLAGS_SG_64BIT;
}
@@ -1510,7 +1513,7 @@
* XXX If the padding is not needed, can it be put to use instead
* of ignored?
*/
- bus_dmamap_load(sc->aac_common_dmat, sc->aac_common_dmamap,
+ (void)bus_dmamap_load(sc->aac_common_dmat, sc->aac_common_dmamap,
sc->aac_common, 8192 + sizeof(*sc->aac_common),
aac_common_map, sc, 0);
@@ -1549,8 +1552,17 @@
offsetof(struct aac_common, ac_printf);
ip->PrintfBufferSize = AAC_PRINTF_BUFSIZE;
- /* The adapter assumes that pages are 4K in size */
+ /*
+ * The adapter assumes that pages are 4K in size, except on some
+ * broken firmware versions that do the page->byte conversion twice,
+ * therefore 'assuming' that this value is in 16MB units (2^24).
+ * Round up since the granularity is so high.
+ */
ip->HostPhysMemPages = ctob(physmem) / AAC_PAGE_SIZE;
+ if (sc->flags & AAC_FLAGS_BROKEN_MEMMAP) {
+ ip->HostPhysMemPages =
+ (ip->HostPhysMemPages + AAC_PAGE_SIZE) / AAC_PAGE_SIZE;
+ }
ip->HostElapsedSeconds = time_second; /* reset later if invalid */
/*
==== //depot/projects/uart/dev/aac/aac_pci.c#3 (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/aac/aac_pci.c,v 1.35 2003/07/01 15:51:51 scottl Exp $
+ * $FreeBSD: src/sys/dev/aac/aac_pci.c,v 1.36 2003/07/09 19:19:16 scottl Exp $
*/
/*
@@ -114,8 +114,8 @@
"Dell PERC 3/Di"},
{0x1011, 0x0046, 0x9005, 0x0364, AAC_HWIF_STRONGARM, 0,
"Adaptec AAC-364"},
- {0x1011, 0x0046, 0x9005, 0x0365, AAC_HWIF_STRONGARM, 0,
- "Adaptec SCSI RAID 5400S"},
+ {0x1011, 0x0046, 0x9005, 0x0365, AAC_HWIF_STRONGARM,
+ AAC_FLAGS_BROKEN_MEMMAP, "Adaptec SCSI RAID 5400S"},
{0x1011, 0x0046, 0x9005, 0x1364, AAC_HWIF_STRONGARM, AAC_FLAGS_PERC2QC,
"Dell PERC 2/QC"},
{0x1011, 0x0046, 0x103c, 0x10c2, AAC_HWIF_STRONGARM, 0,
==== //depot/projects/uart/dev/aac/aacvar.h#2 (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/aac/aacvar.h,v 1.33 2003/04/01 15:06:22 phk Exp $
+ * $FreeBSD: src/sys/dev/aac/aacvar.h,v 1.35 2003/07/09 21:16:23 scottl Exp $
*/
#include <sys/bio.h>
@@ -167,6 +167,8 @@
#define AAC_ON_AACQ_BUSY (1<<7)
#define AAC_ON_AACQ_COMPLETE (1<<8)
#define AAC_ON_AACQ_MASK ((1<<5)|(1<<6)|(1<<7)|(1<<8))
+#define AAC_QUEUE_FRZN (1<<9) /* Freeze the processing of
+ * commands on the queue. */
void (* cm_complete)(struct aac_command *cm);
void *cm_private;
@@ -369,6 +371,7 @@
* 2GB-4GB range */
#define AAC_FLAGS_NO4GB (1 << 6) /* Can't access host mem >2GB */
#define AAC_FLAGS_256FIBS (1 << 7) /* Can only do 256 commands */
+#define AAC_FLAGS_BROKEN_MEMMAP (1 << 8) /* Broken HostPhysMemPages */
u_int32_t supported_options;
int aac_max_fibs;
==== //depot/projects/uart/dev/acpica/acpi_isab.c#2 (text+ko) ====
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $FreeBSD: src/sys/dev/acpica/acpi_isab.c,v 1.1 2003/07/08 18:59:32 jhb Exp $
+ * $FreeBSD: src/sys/dev/acpica/acpi_isab.c,v 1.2 2003/07/09 18:28:53 jhb Exp $
*/
/*
@@ -93,7 +93,8 @@
{
if ((acpi_get_type(dev) == ACPI_TYPE_DEVICE) &&
- !acpi_disabled("isa ") &&
+ !acpi_disabled("isa") &&
+ devclass_get_device(isab_devclass, 0) == NULL &&
(acpi_MatchHid(dev, "PNP0A05") || acpi_MatchHid(dev, "PNP0A06"))) {
device_set_desc(dev, "ACPI Generic ISA bridge");
return(0);
==== //depot/projects/uart/dev/firewire/firewire.c#3 (text+ko) ====
@@ -31,7 +31,7 @@
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
- * $FreeBSD: src/sys/dev/firewire/firewire.c,v 1.55 2003/06/30 06:33:18 simokawa Exp $
+ * $FreeBSD: src/sys/dev/firewire/firewire.c,v 1.56 2003/07/09 13:07:35 simokawa Exp $
*
*/
@@ -596,7 +596,7 @@
src->businfo.cyc_clk_acc = 100;
src->businfo.max_rec = fc->maxrec;
src->businfo.max_rom = MAXROM_4;
- src->businfo.generation = 0;
+ src->businfo.generation = 1;
src->businfo.link_spd = fc->speed;
src->businfo.eui64.hi = fc->eui.hi;
@@ -622,7 +622,6 @@
src = fc->crom_src;
root = fc->crom_root;
- src->businfo.generation ++;
STAILQ_INIT(&src->chunk_list);
bzero(root, sizeof(struct crom_chunk));
@@ -642,7 +641,9 @@
fw_busreset(struct firewire_comm *fc)
{
struct firewire_dev_comm *fdc;
+ struct crom_src *src;
device_t *devlistp;
+ void *newrom;
int i, devcnt;
switch(fc->status){
@@ -666,7 +667,19 @@
free(devlistp, M_TEMP);
}
- crom_load(&fc->crom_src_buf->src, fc->config_rom, CROMSIZE);
+ newrom = malloc(CROMSIZE, M_FW, M_NOWAIT | M_ZERO);
+ src = &fc->crom_src_buf->src;
+ crom_load(src, (u_int32_t *)newrom, CROMSIZE);
+ if (bcmp(newrom, fc->config_rom, CROMSIZE) != 0) {
+ /* bump generation and reload */
+ src->businfo.generation ++;
+ /* generation must be between 0x2 and 0xF */
+ if (src->businfo.generation < 2)
+ src->businfo.generation ++;
+ crom_load(src, (u_int32_t *)newrom, CROMSIZE);
+ bcopy(newrom, (void *)fc->config_rom, CROMSIZE);
+ }
+ free(newrom, M_FW);
}
/* Call once after reboot */
@@ -1307,12 +1320,11 @@
break;
if(fwdev != NULL){
fwdev->dst = fc->ongonode;
- fwdev->status = FWDEVATTACHED;
- fc->ongonode++;
+ fwdev->status = FWDEVINIT;
+ fc->ongodev = fwdev;
fc->ongoaddr = CSRROMOFF;
- fc->ongodev = NULL;
- fc->ongoeui.hi = 0xffffffff; fc->ongoeui.lo = 0xffffffff;
- goto loop;
+ addr = 0xf0000000 | fc->ongoaddr;
+ goto dorequest;
}
fwdev = malloc(sizeof(struct fw_device), M_FW,
M_NOWAIT | M_ZERO);
@@ -1348,6 +1360,7 @@
}else{
addr = 0xf0000000 | fc->ongoaddr;
}
+dorequest:
#if 0
xfer = asyreqq(fc, FWSPD_S100, 0, 0,
((FWLOCALBUS | fc->ongonode) << 16) | 0xffff , addr,
@@ -1512,6 +1525,11 @@
fc->ongoaddr = CSRROMOFF;
}
}else{
+ if (fc->ongoaddr == CSRROMOFF &&
+ fc->ongodev->csrrom[0] == ntohl(rfp->mode.rresq.data)) {
+ fc->ongodev->status = FWDEVATTACHED;
+ goto nextnode;
+ }
fc->ongodev->csrrom[(fc->ongoaddr - CSRROMOFF)/4] = ntohl(rfp->mode.rresq.data);
if(fc->ongoaddr > fc->ongodev->rommax){
fc->ongodev->rommax = fc->ongoaddr;
==== //depot/projects/uart/dev/usb/uscanner.c#3 (text+ko) ====
@@ -1,5 +1,5 @@
/* $NetBSD: uscanner.c,v 1.30 2002/07/11 21:14:36 augustss Exp$ */
-/* $FreeBSD: src/sys/dev/usb/uscanner.c,v 1.40 2003/07/01 12:16:46 joe Exp $ */
+/* $FreeBSD: src/sys/dev/usb/uscanner.c,v 1.41 2003/07/09 17:05:59 ache Exp $ */
/*
* Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -192,6 +192,7 @@
{{ USB_VENDOR_UMAX, USB_PRODUCT_UMAX_ASTRA1220U }, 0 },
{{ USB_VENDOR_UMAX, USB_PRODUCT_UMAX_ASTRA1236U }, 0 },
{{ USB_VENDOR_UMAX, USB_PRODUCT_UMAX_ASTRA2000U }, 0 },
+ {{ USB_VENDOR_UMAX, USB_PRODUCT_UMAX_ASTRA2100U }, 0 },
{{ USB_VENDOR_UMAX, USB_PRODUCT_UMAX_ASTRA2200U }, 0 },
{{ USB_VENDOR_UMAX, USB_PRODUCT_UMAX_ASTRA3400 }, 0 },
==== //depot/projects/uart/i386/i386/mp_machdep.c#2 (text+ko) ====
@@ -25,11 +25,10 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/i386/i386/mp_machdep.c,v 1.210 2003/06/28 22:07:42 jeff Exp $");
+__FBSDID("$FreeBSD: src/sys/i386/i386/mp_machdep.c,v 1.211 2003/07/10 01:02:59 peter Exp $");
#include "opt_cpu.h"
#include "opt_kstack_pages.h"
-#include "opt_swtch.h"
#ifdef SMP
#include <machine/smptests.h>
@@ -644,11 +643,9 @@
setidt(XSTATCLOCK_OFFSET, Xstatclock,
SDT_SYS386IGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL));
-#ifdef LAZY_SWITCH
/* install an inter-CPU IPI for lazy pmap release */
setidt(XLAZYPMAP_OFFSET, Xlazypmap,
SDT_SYS386IGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL));
-#endif
/* install an inter-CPU IPI for all-CPU rendezvous */
setidt(XRENDEZVOUS_OFFSET, Xrendezvous,
==== //depot/projects/uart/i386/i386/pmap.c#5 (text+ko) ====
@@ -42,7 +42,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/i386/i386/pmap.c,v 1.417 2003/07/08 19:40:35 alc Exp $");
+__FBSDID("$FreeBSD: src/sys/i386/i386/pmap.c,v 1.418 2003/07/10 01:02:59 peter Exp $");
/*-
* Copyright (c) 2003 Networks Associates Technology, Inc.
* All rights reserved.
@@ -104,7 +104,6 @@
#include "opt_pmap.h"
#include "opt_msgbuf.h"
#include "opt_kstack_pages.h"
-#include "opt_swtch.h"
#include <sys/param.h>
#include <sys/systm.h>
@@ -187,7 +186,7 @@
LIST_HEAD(pmaplist, pmap);
static struct pmaplist allpmaps;
static struct mtx allpmaps_lock;
-#if defined(SMP) && defined(LAZY_SWITCH)
+#ifdef SMP
static struct mtx lazypmap_lock;
#endif
@@ -340,7 +339,7 @@
kernel_pmap->pm_active = -1; /* don't allow deactivation */
TAILQ_INIT(&kernel_pmap->pm_pvlist);
LIST_INIT(&allpmaps);
-#if defined(SMP) && defined(LAZY_SWITCH)
+#ifdef SMP
mtx_init(&lazypmap_lock, "lazypmap", NULL, MTX_SPIN);
#endif
mtx_init(&allpmaps_lock, "allpmaps", NULL, MTX_SPIN);
@@ -1285,7 +1284,6 @@
* Pmap allocation/deallocation routines.
***************************************************/
-#ifdef LAZY_SWITCH
#ifdef SMP
/*
* Deal with a SMP shootdown of other users of the pmap that we are
@@ -1374,7 +1372,6 @@
}
}
#endif /* SMP */
-#endif /* LAZY_SWITCH */
/*
* Release any resources held by the given physical map.
@@ -1397,9 +1394,7 @@
("pmap_release: pmap resident count %ld != 0",
pmap->pm_stats.resident_count));
-#ifdef LAZY_SWITCH
pmap_lazyfix(pmap);
-#endif
mtx_lock_spin(&allpmaps_lock);
LIST_REMOVE(pmap, pm_list);
mtx_unlock_spin(&allpmaps_lock);
==== //depot/projects/uart/i386/i386/swtch.s#2 (text+ko) ====
@@ -33,11 +33,10 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $FreeBSD: src/sys/i386/i386/swtch.s,v 1.141 2003/06/27 22:39:13 peter Exp $
+ * $FreeBSD: src/sys/i386/i386/swtch.s,v 1.142 2003/07/10 01:02:59 peter Exp $
*/
#include "opt_npx.h"
-#include "opt_swtch.h"
#include <machine/asmacros.h>
@@ -162,14 +161,12 @@
/* switch address space */
movl PCB_CR3(%edx),%eax
-#ifdef LAZY_SWITCH
#ifdef PAE
cmpl %eax,IdlePDPT /* Kernel address space? */
#else
cmpl %eax,IdlePTD /* Kernel address space? */
#endif
je sw1
-#endif
movl %cr3,%ebx /* The same address space? */
cmpl %ebx,%eax
je sw1
==== //depot/projects/uart/i386/isa/apic_vector.s#2 (text+ko) ====
@@ -1,10 +1,8 @@
/*
* from: vector.s, 386BSD 0.1 unknown origin
- * $FreeBSD: src/sys/i386/isa/apic_vector.s,v 1.88 2003/06/06 17:45:25 jhb Exp $
+ * $FreeBSD: src/sys/i386/isa/apic_vector.s,v 1.89 2003/07/10 01:02:59 peter Exp $
*/
-#include "opt_swtch.h"
-
#include <machine/apic.h>
#include <machine/smp.h>
@@ -643,7 +641,6 @@
POP_FRAME
iret
-#ifdef LAZY_SWITCH
/*
* Clean up when we lose out on the lazy context switch optimization.
* ie: when we are about to release a PTD but a cpu is still borrowing it.
@@ -662,7 +659,6 @@
movl $0, lapic+LA_EOI /* End Of Interrupt to APIC */
POP_FRAME
iret
-#endif
#endif /* SMP */
.data
==== //depot/projects/uart/kern/kern_synch.c#2 (text+ko) ====
@@ -39,13 +39,10 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/kern/kern_synch.c,v 1.228 2003/06/28 08:29:04 davidxu Exp $");
+__FBSDID("$FreeBSD: src/sys/kern/kern_synch.c,v 1.229 2003/07/10 01:02:59 peter Exp $");
#include "opt_ddb.h"
#include "opt_ktrace.h"
-#ifdef __i386__
-#include "opt_swtch.h"
-#endif
#include <sys/param.h>
#include <sys/systm.h>
==== //depot/projects/uart/kern/subr_witness.c#2 (text+ko) ====
@@ -82,13 +82,10 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/kern/subr_witness.c,v 1.155 2003/06/11 00:56:57 obrien Exp $");
+__FBSDID("$FreeBSD: src/sys/kern/subr_witness.c,v 1.156 2003/07/10 01:02:59 peter Exp $");
#include "opt_ddb.h"
#include "opt_witness.h"
-#ifdef __i386__
-#include "opt_swtch.h"
-#endif
#include <sys/param.h>
#include <sys/bus.h>
@@ -301,7 +298,7 @@
#if defined(__i386__) && defined(APIC_IO)
{ "tlb", &lock_class_mtx_spin },
#endif
-#if defined(__i386__) && defined(LAZY_SWITCH)
+#ifdef __i386__
{ "lazypmap", &lock_class_mtx_spin },
#endif
#ifdef __sparc64__
==== //depot/projects/uart/kern/sys_pipe.c#3 (text+ko) ====
@@ -70,7 +70,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/kern/sys_pipe.c,v 1.138 2003/07/08 04:02:31 silby Exp $");
+__FBSDID("$FreeBSD: src/sys/kern/sys_pipe.c,v 1.139 2003/07/09 21:59:48 silby Exp $");
#include "opt_mac.h"
@@ -183,13 +183,15 @@
SYSCTL_DECL(_kern_ipc);
SYSCTL_INT(_kern_ipc, OID_AUTO, maxpipes, CTLFLAG_RW,
- &maxpipes, 0, "");
+ &maxpipes, 0, "Max # of pipes");
SYSCTL_INT(_kern_ipc, OID_AUTO, maxpipekva, CTLFLAG_RW,
&maxpipekva, 0, "Pipe KVA limit");
SYSCTL_INT(_kern_ipc, OID_AUTO, maxpipekvawired, CTLFLAG_RW,
&maxpipekvawired, 0, "Pipe KVA wired limit");
SYSCTL_INT(_kern_ipc, OID_AUTO, pipes, CTLFLAG_RD,
- &amountpipes, 0, "");
+ &amountpipes, 0, "Current # of pipes");
+SYSCTL_INT(_kern_ipc, OID_AUTO, bigpipes, CTLFLAG_RD,
+ &nbigpipe, 0, "Current # of big pipes");
SYSCTL_INT(_kern_ipc, OID_AUTO, pipekva, CTLFLAG_RD,
&amountpipekva, 0, "Pipe KVA usage");
SYSCTL_INT(_kern_ipc, OID_AUTO, pipekvawired, CTLFLAG_RD,
@@ -962,7 +964,7 @@
if ((error = pipelock(wpipe, 1)) == 0) {
PIPE_GET_GIANT(wpipe);
if (pipespace(wpipe, BIG_PIPE_SIZE) == 0)
- nbigpipe++;
+ atomic_add_int(&nbigpipe, 1);
PIPE_DROP_GIANT(wpipe);
pipeunlock(wpipe);
}
@@ -1000,8 +1002,7 @@
*/
if ((uio->uio_iov->iov_len >= PIPE_MINDIRECT) &&
(fp->f_flag & FNONBLOCK) == 0 &&
- amountpipekvawired < maxpipekvawired &&
- (uio->uio_iov->iov_len >= PIPE_MINDIRECT)) {
+ amountpipekvawired < maxpipekvawired) {
error = pipe_direct_write(wpipe, uio);
if (error)
break;
@@ -1405,7 +1406,7 @@
if (cpipe->pipe_buffer.buffer != NULL) {
if (cpipe->pipe_buffer.size > PIPE_SIZE)
- --nbigpipe;
+ atomic_subtract_int(&nbigpipe, 1);
atomic_subtract_int(&amountpipekva, cpipe->pipe_buffer.size);
atomic_subtract_int(&amountpipes, 1);
kmem_free(kernel_map,
==== //depot/projects/uart/pci/if_dc.c#4 (text+ko) ====
@@ -89,9 +89,10 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/pci/if_dc.c,v 1.115 2003/07/06 21:45:31 mux Exp $");
+__FBSDID("$FreeBSD: src/sys/pci/if_dc.c,v 1.116 2003/07/09 15:03:10 mux Exp $");
#include <sys/param.h>
+#include <sys/endian.h>
#include <sys/systm.h>
#include <sys/sockio.h>
>>> TRUNCATED FOR MAIL (1000 lines) <<<
More information about the p4-projects
mailing list