PERFORCE change 34203 for review
John Baldwin
jhb at FreeBSD.org
Tue Jul 8 12:22:33 PDT 2003
http://perforce.freebsd.org/chv.cgi?CH=34203
Change 34203 by jhb at jhb_laptop on 2003/07/08 12:22:19
IFC @34201.
Affected files ...
.. //depot/projects/smpng/sys/alpha/alpha/busdma_machdep.c#19 integrate
.. //depot/projects/smpng/sys/alpha/alpha/mp_machdep.c#19 integrate
.. //depot/projects/smpng/sys/alpha/alpha/pmap.c#48 integrate
.. //depot/projects/smpng/sys/amd64/amd64/busdma_machdep.c#4 integrate
.. //depot/projects/smpng/sys/amd64/amd64/pmap.c#6 integrate
.. //depot/projects/smpng/sys/boot/efi/libefi/Makefile#8 integrate
.. //depot/projects/smpng/sys/boot/i386/libi386/Makefile#10 integrate
.. //depot/projects/smpng/sys/boot/ia64/libski/Makefile#6 integrate
.. //depot/projects/smpng/sys/boot/ia64/libski/pal_stub.S#1 branch
.. //depot/projects/smpng/sys/boot/ia64/libski/pal_stub.s#2 delete
.. //depot/projects/smpng/sys/boot/pc98/libpc98/Makefile#9 integrate
.. //depot/projects/smpng/sys/conf/NOTES#48 integrate
.. //depot/projects/smpng/sys/conf/files#81 integrate
.. //depot/projects/smpng/sys/conf/files.ia64#29 integrate
.. //depot/projects/smpng/sys/contrib/dev/ath/freebsd/i386-elf.hal.o.uu#2 integrate
.. //depot/projects/smpng/sys/dev/acpica/acpi.c#43 integrate
.. //depot/projects/smpng/sys/dev/acpica/acpi_isab.c#1 branch
.. //depot/projects/smpng/sys/dev/ata/ata-chipset.c#16 integrate
.. //depot/projects/smpng/sys/dev/ata/ata-pci.c#33 integrate
.. //depot/projects/smpng/sys/dev/ata/ata-pci.h#10 integrate
.. //depot/projects/smpng/sys/dev/em/if_em.h#15 integrate
.. //depot/projects/smpng/sys/dev/en/midway.c#17 integrate
.. //depot/projects/smpng/sys/dev/fatm/if_fatm.c#3 integrate
.. //depot/projects/smpng/sys/dev/firewire/fwdma.c#3 integrate
.. //depot/projects/smpng/sys/dev/firewire/fwohci.c#19 integrate
.. //depot/projects/smpng/sys/dev/firewire/fwohci_pci.c#15 integrate
.. //depot/projects/smpng/sys/dev/firewire/sbp.c#21 integrate
.. //depot/projects/smpng/sys/dev/fxp/if_fxp.c#40 integrate
.. //depot/projects/smpng/sys/dev/ips/ips_pci.c#4 integrate
.. //depot/projects/smpng/sys/dev/kbd/atkbd.c#8 integrate
.. //depot/projects/smpng/sys/dev/lge/if_lge.c#14 integrate
.. //depot/projects/smpng/sys/dev/nge/if_nge.c#24 integrate
.. //depot/projects/smpng/sys/dev/pccbb/pccbb.c#32 integrate
.. //depot/projects/smpng/sys/dev/pci/isa_pci.c#4 integrate
.. //depot/projects/smpng/sys/dev/ppc/ppc.c#1 branch
.. //depot/projects/smpng/sys/dev/ppc/ppcreg.h#1 branch
.. //depot/projects/smpng/sys/dev/random/randomdev.c#13 integrate
.. //depot/projects/smpng/sys/dev/sio/sio.c#32 integrate
.. //depot/projects/smpng/sys/dev/sound/pci/ich.c#21 integrate
.. //depot/projects/smpng/sys/dev/sound/pcm/feeder.c#8 integrate
.. //depot/projects/smpng/sys/dev/sound/pcm/feeder.h#3 integrate
.. //depot/projects/smpng/sys/dev/txp/if_txp.c#15 integrate
.. //depot/projects/smpng/sys/dev/usb/ehci_pci.c#3 integrate
.. //depot/projects/smpng/sys/dev/usb/hid.c#6 integrate
.. //depot/projects/smpng/sys/dev/usb/hid.h#3 integrate
.. //depot/projects/smpng/sys/dev/usb/if_axe.c#3 integrate
.. //depot/projects/smpng/sys/dev/usb/if_cue.c#14 integrate
.. //depot/projects/smpng/sys/dev/usb/ohci.c#22 integrate
.. //depot/projects/smpng/sys/dev/usb/ohcireg.h#4 integrate
.. //depot/projects/smpng/sys/dev/usb/ucom.c#10 integrate
.. //depot/projects/smpng/sys/dev/usb/udbp.c#8 integrate
.. //depot/projects/smpng/sys/dev/usb/udbp.h#3 integrate
.. //depot/projects/smpng/sys/dev/usb/ufm.c#6 integrate
.. //depot/projects/smpng/sys/dev/usb/uftdi.c#6 integrate
.. //depot/projects/smpng/sys/dev/usb/ugen.c#16 integrate
.. //depot/projects/smpng/sys/dev/usb/uhci.c#25 integrate
.. //depot/projects/smpng/sys/dev/usb/uhcireg.h#5 integrate
.. //depot/projects/smpng/sys/dev/usb/uhcivar.h#8 integrate
.. //depot/projects/smpng/sys/dev/usb/uhid.c#14 integrate
.. //depot/projects/smpng/sys/dev/usb/uhub.c#11 integrate
.. //depot/projects/smpng/sys/dev/usb/ukbd.c#10 integrate
.. //depot/projects/smpng/sys/dev/usb/umass.c#26 integrate
.. //depot/projects/smpng/sys/dev/usb/umct.c#2 integrate
.. //depot/projects/smpng/sys/dev/usb/ums.c#11 integrate
.. //depot/projects/smpng/sys/dev/usb/uplcom.c#6 integrate
.. //depot/projects/smpng/sys/dev/usb/urio.c#14 integrate
.. //depot/projects/smpng/sys/dev/usb/usb_mem.h#3 integrate
.. //depot/projects/smpng/sys/dev/usb/usb_port.h#15 integrate
.. //depot/projects/smpng/sys/dev/usb/usb_subr.c#14 integrate
.. //depot/projects/smpng/sys/dev/usb/usbdevs#35 integrate
.. //depot/projects/smpng/sys/dev/usb/usbdi.c#12 integrate
.. //depot/projects/smpng/sys/dev/usb/usbdi.h#9 integrate
.. //depot/projects/smpng/sys/dev/usb/usbdi_util.c#7 integrate
.. //depot/projects/smpng/sys/dev/usb/usbdi_util.h#5 integrate
.. //depot/projects/smpng/sys/dev/usb/usbdivar.h#10 integrate
.. //depot/projects/smpng/sys/dev/usb/uvisor.c#5 integrate
.. //depot/projects/smpng/sys/dev/usb/uvscom.c#8 integrate
.. //depot/projects/smpng/sys/dev/wi/if_wi.c#53 integrate
.. //depot/projects/smpng/sys/dev/wi/if_wi_pccard.c#19 integrate
.. //depot/projects/smpng/sys/dev/zs/zs.c#7 integrate
.. //depot/projects/smpng/sys/fs/msdosfs/msdosfs_vnops.c#19 integrate
.. //depot/projects/smpng/sys/geom/geom_ctl.c#16 integrate
.. //depot/projects/smpng/sys/i386/bios/apm.c#5 integrate
.. //depot/projects/smpng/sys/i386/i386/busdma_machdep.c#21 integrate
.. //depot/projects/smpng/sys/i386/i386/pmap.c#41 integrate
.. //depot/projects/smpng/sys/i386/i386/sys_machdep.c#30 integrate
.. //depot/projects/smpng/sys/i386/i386/vm_machdep.c#40 integrate
.. //depot/projects/smpng/sys/i386/isa/pcvt/pcvt_drv.c#10 integrate
.. //depot/projects/smpng/sys/ia64/ia64/busdma_machdep.c#18 integrate
.. //depot/projects/smpng/sys/ia64/ia64/context.S#1 branch
.. //depot/projects/smpng/sys/ia64/ia64/context.s#3 delete
.. //depot/projects/smpng/sys/ia64/ia64/db_trace.c#11 integrate
.. //depot/projects/smpng/sys/ia64/ia64/exception.S#1 branch
.. //depot/projects/smpng/sys/ia64/ia64/exception.s#26 delete
.. //depot/projects/smpng/sys/ia64/ia64/locore.S#1 branch
.. //depot/projects/smpng/sys/ia64/ia64/locore.s#20 delete
.. //depot/projects/smpng/sys/ia64/ia64/pal.S#1 branch
.. //depot/projects/smpng/sys/ia64/ia64/pal.s#5 delete
.. //depot/projects/smpng/sys/ia64/ia64/pmap.c#49 integrate
.. //depot/projects/smpng/sys/ia64/ia64/setjmp.S#1 branch
.. //depot/projects/smpng/sys/ia64/ia64/setjmp.s#2 delete
.. //depot/projects/smpng/sys/ia64/ia64/support.S#1 branch
.. //depot/projects/smpng/sys/ia64/ia64/support.s#13 delete
.. //depot/projects/smpng/sys/ia64/ia64/syscall.S#1 branch
.. //depot/projects/smpng/sys/ia64/ia64/syscall.s#4 delete
.. //depot/projects/smpng/sys/ia64/ia64/unwind.c#8 integrate
.. //depot/projects/smpng/sys/ia64/include/unwind.h#4 integrate
.. //depot/projects/smpng/sys/isa/atkbdc_isa.c#7 integrate
.. //depot/projects/smpng/sys/isa/fd.c#23 integrate
.. //depot/projects/smpng/sys/isa/isa_common.c#12 integrate
.. //depot/projects/smpng/sys/isa/isahint.c#3 integrate
.. //depot/projects/smpng/sys/isa/isavar.h#5 integrate
.. //depot/projects/smpng/sys/isa/psm.c#17 integrate
.. //depot/projects/smpng/sys/isa/syscons_isa.c#6 integrate
.. //depot/projects/smpng/sys/kern/kern_condvar.c#30 integrate
.. //depot/projects/smpng/sys/kern/kern_descrip.c#48 integrate
.. //depot/projects/smpng/sys/kern/kern_mutex.c#71 integrate
.. //depot/projects/smpng/sys/kern/kern_prot.c#72 integrate
.. //depot/projects/smpng/sys/kern/kern_sig.c#72 integrate
.. //depot/projects/smpng/sys/kern/kern_tc.c#22 integrate
.. //depot/projects/smpng/sys/kern/kern_thr.c#10 integrate
.. //depot/projects/smpng/sys/kern/kern_thread.c#39 integrate
.. //depot/projects/smpng/sys/kern/kern_umtx.c#5 integrate
.. //depot/projects/smpng/sys/kern/sched_ule.c#14 integrate
.. //depot/projects/smpng/sys/kern/subr_hints.c#6 integrate
.. //depot/projects/smpng/sys/kern/subr_param.c#12 integrate
.. //depot/projects/smpng/sys/kern/sys_pipe.c#29 integrate
.. //depot/projects/smpng/sys/kern/vfs_syscalls.c#59 integrate
.. //depot/projects/smpng/sys/modules/acpi/Makefile#12 integrate
.. //depot/projects/smpng/sys/modules/geom/geom_mbr/Makefile#2 integrate
.. //depot/projects/smpng/sys/net/if_vlan.c#17 integrate
.. //depot/projects/smpng/sys/netgraph/atm/ng_atm.c#2 integrate
.. //depot/projects/smpng/sys/netgraph/ng_tee.c#8 integrate
.. //depot/projects/smpng/sys/netinet/ip_fw.h#14 integrate
.. //depot/projects/smpng/sys/netinet/ip_fw2.c#16 integrate
.. //depot/projects/smpng/sys/nfsclient/nfs_nfsiod.c#9 integrate
.. //depot/projects/smpng/sys/nfsserver/nfs_syscalls.c#19 integrate
.. //depot/projects/smpng/sys/pc98/pc98/fd.c#24 integrate
.. //depot/projects/smpng/sys/pc98/pc98/pc98kbd.c#4 integrate
.. //depot/projects/smpng/sys/pc98/pc98/sio.c#29 integrate
.. //depot/projects/smpng/sys/pc98/pc98/syscons_pc98.c#6 integrate
.. //depot/projects/smpng/sys/pci/if_dc.c#40 integrate
.. //depot/projects/smpng/sys/pci/if_dcreg.h#15 integrate
.. //depot/projects/smpng/sys/pci/if_pcn.c#18 integrate
.. //depot/projects/smpng/sys/pci/if_rl.c#32 integrate
.. //depot/projects/smpng/sys/pci/if_sf.c#20 integrate
.. //depot/projects/smpng/sys/pci/if_sis.c#28 integrate
.. //depot/projects/smpng/sys/pci/if_sk.c#19 integrate
.. //depot/projects/smpng/sys/pci/if_ste.c#22 integrate
.. //depot/projects/smpng/sys/pci/if_vr.c#18 integrate
.. //depot/projects/smpng/sys/pci/if_wb.c#17 integrate
.. //depot/projects/smpng/sys/pci/if_xl.c#30 integrate
.. //depot/projects/smpng/sys/powerpc/powerpc/pmap.c#29 integrate
.. //depot/projects/smpng/sys/security/mac_bsdextended/mac_bsdextended.c#7 integrate
.. //depot/projects/smpng/sys/security/mac_ifoff/mac_ifoff.c#5 integrate
.. //depot/projects/smpng/sys/security/mac_lomac/mac_lomac.c#10 integrate
.. //depot/projects/smpng/sys/security/mac_test/mac_test.c#13 integrate
.. //depot/projects/smpng/sys/sparc64/sparc64/pmap.c#40 integrate
.. //depot/projects/smpng/sys/sys/bus.h#10 integrate
.. //depot/projects/smpng/sys/sys/param.h#44 integrate
.. //depot/projects/smpng/sys/sys/pipe.h#4 integrate
.. //depot/projects/smpng/sys/sys/signalvar.h#18 integrate
.. //depot/projects/smpng/sys/ufs/ufs/ufs_vnops.c#29 integrate
.. //depot/projects/smpng/sys/vm/pmap.h#20 integrate
.. //depot/projects/smpng/sys/vm/vm_contig.c#15 integrate
.. //depot/projects/smpng/sys/vm/vm_map.c#40 integrate
.. //depot/projects/smpng/sys/vm/vm_mmap.c#30 integrate
.. //depot/projects/smpng/sys/vm/vm_pageout.c#34 integrate
Differences ...
==== //depot/projects/smpng/sys/alpha/alpha/busdma_machdep.c#19 (text+ko) ====
@@ -25,7 +25,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/alpha/alpha/busdma_machdep.c,v 1.40 2003/07/01 15:51:50 scottl Exp $");
+__FBSDID("$FreeBSD: src/sys/alpha/alpha/busdma_machdep.c,v 1.42 2003/07/01 21:20:51 mux Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@@ -106,12 +106,21 @@
static void init_bounce_pages(void *dummy);
static int alloc_bounce_pages(bus_dma_tag_t dmat, u_int numpages);
-static int reserve_bounce_pages(bus_dma_tag_t dmat, bus_dmamap_t map);
-static vm_offset_t add_bounce_page(bus_dma_tag_t dmat, bus_dmamap_t map,
+static int reserve_bounce_pages(bus_dma_tag_t dmat, bus_dmamap_t map,
+ int commit);
+static bus_addr_t add_bounce_page(bus_dma_tag_t dmat, bus_dmamap_t map,
vm_offset_t vaddr, bus_size_t size);
static void free_bounce_page(bus_dma_tag_t dmat, struct bounce_page *bpage);
static __inline int run_filter(bus_dma_tag_t dmat, bus_addr_t paddr);
+/*
+ * Return true if a match is made.
+ *
+ * To find a match walk the chain of bus_dma_tag_t's looking for 'paddr'.
+ *
+ * If paddr is within the bounds of the dma tag then call the filter callback
+ * to check for a match, if there is no filter callback then assume a match.
+ */
static __inline int
run_filter(bus_dma_tag_t dmat, bus_addr_t paddr)
{
@@ -282,8 +291,14 @@
atomic_subtract_int(&dmat->ref_count, 1);
if (dmat->ref_count == 0) {
free(dmat, M_DEVBUF);
- }
- dmat = parent;
+ /*
+ * Last reference count, so
+ * release our reference
+ * count on our parent.
+ */
+ dmat = parent;
+ } else
+ dmat = NULL;
}
}
return (0);
@@ -379,16 +394,10 @@
sgmap_free_region(chipset.sgmap, map->sgmaphandle);
}
- if (map != NULL) {
+ if (map != NULL && map != &nobounce_dmamap) {
if (STAILQ_FIRST(&map->bpages) != NULL)
return (EBUSY);
- /*
- * The nobounce_dmamap map is not dynamically
- * allocated, thus we should on no account try to
- * free it.
- */
- if (map != &nobounce_dmamap)
- free(map, M_DEVBUF);
+ free(map, M_DEVBUF);
}
dmat->map_count--;
return (0);
@@ -430,7 +439,7 @@
/*
* Free a piece of memory and it's allociated dmamap, that was allocated
- * via bus_dmamem_alloc.
+ * via bus_dmamem_alloc. Make the same choice for free/contigfree.
*/
void
bus_dmamem_free(bus_dma_tag_t dmat, void *vaddr, bus_dmamap_t map)
@@ -525,18 +534,24 @@
/* Reserve Necessary Bounce Pages */
if (map->pagesneeded != 0) {
mtx_lock(&bounce_lock);
- if (reserve_bounce_pages(dmat, map) != 0) {
-
- /* Queue us for resources */
- map->dmat = dmat;
- map->buf = buf;
- map->buflen = buflen;
- map->callback = callback;
- map->callback_arg = callback_arg;
-
- STAILQ_INSERT_TAIL(&bounce_map_waitinglist, map, links);
- mtx_unlock(&bounce_lock);
- return (EINPROGRESS);
+ if (flags & BUS_DMA_NOWAIT) {
+ if (reserve_bounce_pages(dmat, map, 0) != 0) {
+ mtx_unlock(&bounce_lock);
+ return (ENOMEM);
+ }
+ } else {
+ if (reserve_bounce_pages(dmat, map, 1) != 0) {
+ /* Queue us for resources */
+ map->dmat = dmat;
+ map->buf = buf;
+ map->buflen = buflen;
+ map->callback = callback;
+ map->callback_arg = callback_arg;
+ STAILQ_INSERT_TAIL(&bounce_map_waitinglist,
+ map, links);
+ mtx_unlock(&bounce_lock);
+ return (EINPROGRESS);
+ }
}
mtx_unlock(&bounce_lock);
}
@@ -619,7 +634,7 @@
pmap = NULL;
lastaddr = *lastaddrp;
- bmask = ~(dmat->boundary - 1);
+ bmask = ~(dmat->boundary - 1);
for (seg = *segp; buflen > 0 ; ) {
/*
@@ -706,7 +721,7 @@
error = 0;
if (m0->m_pkthdr.len <= dmat->maxsize) {
int first = 1;
- vm_offset_t lastaddr = 0;
+ bus_addr_t lastaddr = 0;
struct mbuf *m;
for (m = m0; m != NULL && error == 0; m = m->m_next) {
@@ -742,7 +757,7 @@
bus_dmamap_callback2_t *callback, void *callback_arg,
int flags)
{
- vm_offset_t lastaddr;
+ bus_addr_t lastaddr;
#ifdef __GNUC__
bus_dma_segment_t dm_segments[dmat->nsegments];
#else
@@ -825,7 +840,6 @@
struct bounce_page *bpage;
if ((bpage = STAILQ_FIRST(&map->bpages)) != NULL) {
-
/*
* Handle data bouncing. We might also
* want to add support for invalidating
@@ -887,7 +901,7 @@
PAGE_SIZE,
dmat->boundary);
mtx_unlock(&Giant);
- if (bpage->vaddr == NULL) {
+ if (bpage->vaddr == 0) {
free(bpage, M_DEVBUF);
break;
}
@@ -904,12 +918,14 @@
}
static int
-reserve_bounce_pages(bus_dma_tag_t dmat, bus_dmamap_t map)
+reserve_bounce_pages(bus_dma_tag_t dmat, bus_dmamap_t map, int commit)
{
int pages;
mtx_assert(&bounce_lock, MA_OWNED);
pages = MIN(free_bpages, map->pagesneeded - map->pagesreserved);
+ if (commit == 0 && map->pagesneeded > (map->pagesreserved + pages))
+ return (map->pagesneeded - (map->pagesreserved + pages));
free_bpages -= pages;
reserved_bpages += pages;
map->pagesreserved += pages;
@@ -918,7 +934,7 @@
return (pages);
}
-static vm_offset_t
+static bus_addr_t
add_bounce_page(bus_dma_tag_t dmat, bus_dmamap_t map, vm_offset_t vaddr,
bus_size_t size)
{
@@ -961,7 +977,7 @@
free_bpages++;
active_bpages--;
if ((map = STAILQ_FIRST(&bounce_map_waitinglist)) != NULL) {
- if (reserve_bounce_pages(map->dmat, map) == 0) {
+ if (reserve_bounce_pages(map->dmat, map, 1) == 0) {
STAILQ_REMOVE_HEAD(&bounce_map_waitinglist, links);
STAILQ_INSERT_TAIL(&bounce_map_callbacklist,
map, links);
==== //depot/projects/smpng/sys/alpha/alpha/mp_machdep.c#19 (text+ko) ====
@@ -25,7 +25,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/alpha/alpha/mp_machdep.c,v 1.42 2003/06/10 16:50:43 obrien Exp $");
+__FBSDID("$FreeBSD: src/sys/alpha/alpha/mp_machdep.c,v 1.44 2003/07/03 14:33:17 jhb Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -349,7 +349,6 @@
mtx_init(&ap_boot_mtx, "ap boot", NULL, MTX_SPIN);
for (i = 0; i < hwrpb->rpb_pcs_cnt; i++) {
- int dv;
struct pcs *pcsp;
if (i == boot_cpu_id)
@@ -380,8 +379,7 @@
}
continue;
}
- dv = 0;
- if (resource_int_value("cpu", i, "disable", &dv) == 0 && dv) {
+ if (resource_disabled("cpu", i)) {
printf("CPU %d disabled by loader.\n", i);
continue;
}
==== //depot/projects/smpng/sys/alpha/alpha/pmap.c#48 (text+ko) ====
@@ -148,7 +148,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/alpha/alpha/pmap.c,v 1.128 2003/06/29 21:20:02 alc Exp $");
+__FBSDID("$FreeBSD: src/sys/alpha/alpha/pmap.c,v 1.130 2003/07/06 20:32:42 alc Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -993,7 +993,7 @@
if (m->wire_count == 0) {
vm_page_busy(m);
vm_page_free_zero(m);
- --cnt.v_wire_count;
+ atomic_subtract_int(&cnt.v_wire_count, 1);
}
return 1;
}
@@ -1181,7 +1181,7 @@
#endif
p->wire_count--;
- cnt.v_wire_count--;
+ atomic_subtract_int(&cnt.v_wire_count, 1);
vm_page_free_zero(p);
vm_page_unlock_queues();
return 1;
@@ -2070,7 +2070,6 @@
return (void *) ALPHA_PHYS_TO_K0SEG(pa - (i * PAGE_SIZE));
}
-#define MAX_INIT_PT (96)
/*
* pmap_object_init_pt preloads the ptes for a given object
* into the specified pmap. This eliminates the blast of soft
@@ -2079,112 +2078,12 @@
void
pmap_object_init_pt(pmap_t pmap, vm_offset_t addr,
vm_object_t object, vm_pindex_t pindex,
- vm_size_t size, int limit)
+ vm_size_t size)
{
- vm_offset_t tmpidx;
- int psize;
- vm_page_t p, mpte;
- int objpgs;
- if (pmap == NULL || object == NULL)
- return;
- VM_OBJECT_LOCK(object);
- psize = alpha_btop(size);
-
- if ((object->type != OBJT_VNODE) ||
- ((limit & MAP_PREFAULT_PARTIAL) && (psize > MAX_INIT_PT) &&
- (object->resident_page_count > MAX_INIT_PT))) {
- goto unlock_return;
- }
-
- if (psize + pindex > object->size) {
- if (object->size < pindex)
- goto unlock_return;
- psize = object->size - pindex;
- }
-
- mpte = NULL;
- /*
- * if we are processing a major portion of the object, then scan the
- * entire thing.
- */
- if (psize > (object->resident_page_count >> 2)) {
- objpgs = psize;
-
- for (p = TAILQ_FIRST(&object->memq);
- ((objpgs > 0) && (p != NULL));
- p = TAILQ_NEXT(p, listq)) {
-
- tmpidx = p->pindex;
- if (tmpidx < pindex) {
- continue;
- }
- tmpidx -= pindex;
- if (tmpidx >= psize) {
- continue;
- }
- /*
- * don't allow an madvise to blow away our really
- * free pages allocating pv entries.
- */
- if ((limit & MAP_PREFAULT_MADVISE) &&
- cnt.v_free_count < cnt.v_free_reserved) {
- break;
- }
- vm_page_lock_queues();
- if (((p->valid & VM_PAGE_BITS_ALL) == VM_PAGE_BITS_ALL) &&
- (p->busy == 0) &&
- (p->flags & (PG_BUSY | PG_FICTITIOUS)) == 0) {
- if ((p->queue - p->pc) == PQ_CACHE)
- vm_page_deactivate(p);
- vm_page_busy(p);
- vm_page_unlock_queues();
- VM_OBJECT_UNLOCK(object);
- mpte = pmap_enter_quick(pmap,
- addr + alpha_ptob(tmpidx), p, mpte);
- VM_OBJECT_LOCK(object);
- vm_page_lock_queues();
- vm_page_wakeup(p);
- }
- vm_page_unlock_queues();
- objpgs -= 1;
- }
- } else {
- /*
- * else lookup the pages one-by-one.
- */
- for (tmpidx = 0; tmpidx < psize; tmpidx += 1) {
- /*
- * don't allow an madvise to blow away our really
- * free pages allocating pv entries.
- */
- if ((limit & MAP_PREFAULT_MADVISE) &&
- cnt.v_free_count < cnt.v_free_reserved) {
- break;
- }
- p = vm_page_lookup(object, tmpidx + pindex);
- if (p == NULL)
- continue;
- vm_page_lock_queues();
- if ((p->valid & VM_PAGE_BITS_ALL) == VM_PAGE_BITS_ALL &&
- (p->busy == 0) &&
- (p->flags & (PG_BUSY | PG_FICTITIOUS)) == 0) {
- if ((p->queue - p->pc) == PQ_CACHE)
- vm_page_deactivate(p);
- vm_page_busy(p);
- vm_page_unlock_queues();
- VM_OBJECT_UNLOCK(object);
- mpte = pmap_enter_quick(pmap,
- addr + alpha_ptob(tmpidx), p, mpte);
- VM_OBJECT_LOCK(object);
- vm_page_lock_queues();
- vm_page_wakeup(p);
- }
- vm_page_unlock_queues();
- }
- }
-unlock_return:
- VM_OBJECT_UNLOCK(object);
+ VM_OBJECT_LOCK_ASSERT(object, MA_OWNED);
+ KASSERT(object->type == OBJT_DEVICE,
+ ("pmap_object_init_pt: non-device object"));
}
/*
==== //depot/projects/smpng/sys/amd64/amd64/busdma_machdep.c#4 (text+ko) ====
@@ -22,10 +22,11 @@
* LIABILITY, OR TORT (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/amd64/busdma_machdep.c,v 1.48 2003/07/01 16:54:54 mux Exp $
*/
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD: src/sys/amd64/amd64/busdma_machdep.c,v 1.49 2003/07/01 19:16:48 mux Exp $");
+
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/malloc.h>
@@ -76,6 +77,7 @@
int busdma_swi_pending;
+static struct mtx bounce_lock;
static STAILQ_HEAD(bp_list, bounce_page) bounce_page_list;
static int free_bpages;
static int reserved_bpages;
@@ -102,20 +104,17 @@
static void init_bounce_pages(void *dummy);
static int alloc_bounce_pages(bus_dma_tag_t dmat, u_int numpages);
static int reserve_bounce_pages(bus_dma_tag_t dmat, bus_dmamap_t map,
- int commit);
+ int commit);
static bus_addr_t add_bounce_page(bus_dma_tag_t dmat, bus_dmamap_t map,
vm_offset_t vaddr, bus_size_t size);
static void free_bounce_page(bus_dma_tag_t dmat, struct bounce_page *bpage);
static __inline int run_filter(bus_dma_tag_t dmat, bus_addr_t paddr);
-/* To protect all the the bounce pages related lists and data. */
-static struct mtx bounce_lock;
-
/*
* Return true if a match is made.
- *
+ *
* To find a match walk the chain of bus_dma_tag_t's looking for 'paddr'.
- *
+ *
* If paddr is within the bounds of the dma tag then call the filter callback
* to check for a match, if there is no filter callback then assume a match.
*/
@@ -372,7 +371,7 @@
int
bus_dmamap_destroy(bus_dma_tag_t dmat, bus_dmamap_t map)
{
- if (map != NULL) {
+ if (map != NULL && map != &nobounce_dmamap) {
if (STAILQ_FIRST(&map->bpages) != NULL)
return (EBUSY);
free(map, M_DEVBUF);
@@ -509,7 +508,7 @@
map->buf = buf;
map->buflen = buflen;
STAILQ_INSERT_TAIL(&bounce_map_waitinglist,
- map, links);
+ map, links);
mtx_unlock(&bounce_lock);
return (EINPROGRESS);
}
@@ -639,8 +638,7 @@
#endif
int nsegs, error;
- KASSERT(m0->m_flags & M_PKTHDR,
- ("bus_dmamap_load_mbuf: no packet header"));
+ M_ASSERTPKTHDR(m0);
flags |= BUS_DMA_NOWAIT;
nsegs = 0;
==== //depot/projects/smpng/sys/amd64/amd64/pmap.c#6 (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.418 2003/06/29 21:20:03 alc Exp $
+ * $FreeBSD: src/sys/amd64/amd64/pmap.c,v 1.419 2003/07/03 20:18:01 alc Exp $
*/
/*-
* Copyright (c) 2003 Networks Associates Technology, Inc.
@@ -2057,31 +2057,22 @@
return ((void *)crashdumpmap);
}
-#define MAX_INIT_PT (96)
/*
- * pmap_object_init_pt preloads the ptes for a given object
- * into the specified pmap. This eliminates the blast of soft
- * faults on process startup and immediately after an mmap.
+ * This code maps large physical mmap regions into the
+ * processor address space. Note that some shortcuts
+ * are taken, but the code works.
*/
void
pmap_object_init_pt(pmap_t pmap, vm_offset_t addr,
vm_object_t object, vm_pindex_t pindex,
- vm_size_t size, int limit)
+ vm_size_t size)
{
- vm_pindex_t tmpidx;
- int psize;
- vm_page_t p, mpte;
+ vm_page_t p;
- if (pmap == NULL || object == NULL)
- return;
- VM_OBJECT_LOCK(object);
- /*
- * This code maps large physical mmap regions into the
- * processor address space. Note that some shortcuts
- * are taken, but the code works.
- */
- if ((object->type == OBJT_DEVICE) &&
- ((addr & (NBPDR - 1)) == 0) && ((size & (NBPDR - 1)) == 0)) {
+ VM_OBJECT_LOCK_ASSERT(object, MA_OWNED);
+ KASSERT(object->type == OBJT_DEVICE,
+ ("pmap_object_init_pt: non-device object"));
+ if (((addr & (NBPDR - 1)) == 0) && ((size & (NBPDR - 1)) == 0)) {
int i;
vm_page_t m[1];
int npdes;
@@ -2089,7 +2080,7 @@
pde = pmap_pde(pmap, addr);
if (pde != 0 && (*pde & PG_V) != 0)
- goto unlock_return;
+ return;
retry:
p = vm_page_lookup(object, pindex);
if (p != NULL) {
@@ -2099,14 +2090,14 @@
} else {
p = vm_page_alloc(object, pindex, VM_ALLOC_NORMAL);
if (p == NULL)
- goto unlock_return;
+ return;
m[0] = p;
if (vm_pager_get_pages(object, m, 1, 0) != VM_PAGER_OK) {
vm_page_lock_queues();
vm_page_free(p);
vm_page_unlock_queues();
- goto unlock_return;
+ return;
}
p = vm_page_lookup(object, pindex);
@@ -2116,9 +2107,8 @@
vm_page_unlock_queues();
ptepa = VM_PAGE_TO_PHYS(p);
- if (ptepa & (NBPDR - 1)) {
- goto unlock_return;
- }
+ if (ptepa & (NBPDR - 1))
+ return;
p->valid = VM_PAGE_BITS_ALL;
@@ -2130,65 +2120,7 @@
pde++;
}
pmap_invalidate_all(kernel_pmap);
- goto unlock_return;
- }
-
- psize = amd64_btop(size);
-
- if ((object->type != OBJT_VNODE) ||
- ((limit & MAP_PREFAULT_PARTIAL) && (psize > MAX_INIT_PT) &&
- (object->resident_page_count > MAX_INIT_PT))) {
- goto unlock_return;
}
-
- if (psize + pindex > object->size) {
- if (object->size < pindex)
- goto unlock_return;
- psize = object->size - pindex;
- }
-
- mpte = NULL;
-
- if ((p = TAILQ_FIRST(&object->memq)) != NULL) {
- if (p->pindex < pindex) {
- p = vm_page_splay(pindex, object->root);
- if ((object->root = p)->pindex < pindex)
- p = TAILQ_NEXT(p, listq);
- }
- }
- /*
- * Assert: the variable p is either (1) the page with the
- * least pindex greater than or equal to the parameter pindex
- * or (2) NULL.
- */
- for (;
- p != NULL && (tmpidx = p->pindex - pindex) < psize;
- p = TAILQ_NEXT(p, listq)) {
- /*
- * don't allow an madvise to blow away our really
- * free pages allocating pv entries.
- */
- if ((limit & MAP_PREFAULT_MADVISE) &&
- cnt.v_free_count < cnt.v_free_reserved) {
- break;
- }
- vm_page_lock_queues();
- if ((p->valid & VM_PAGE_BITS_ALL) == VM_PAGE_BITS_ALL &&
- (p->busy == 0) &&
- (p->flags & (PG_BUSY | PG_FICTITIOUS)) == 0) {
- if ((p->queue - p->pc) == PQ_CACHE)
- vm_page_deactivate(p);
- vm_page_busy(p);
- vm_page_unlock_queues();
- mpte = pmap_enter_quick(pmap,
- addr + amd64_ptob(tmpidx), p, mpte);
- vm_page_lock_queues();
- vm_page_wakeup(p);
- }
- vm_page_unlock_queues();
- }
-unlock_return:
- VM_OBJECT_UNLOCK(object);
}
/*
==== //depot/projects/smpng/sys/boot/efi/libefi/Makefile#8 (text+ko) ====
@@ -1,4 +1,4 @@
-# $FreeBSD: src/sys/boot/efi/libefi/Makefile,v 1.11 2002/12/10 06:22:25 marcel Exp $
+# $FreeBSD: src/sys/boot/efi/libefi/Makefile,v 1.12 2003/07/02 11:53:55 ru Exp $
.PATH: ${.CURDIR}/../../../${MACHINE_ARCH}/${MACHINE_ARCH}
@@ -6,7 +6,7 @@
INTERNALLIB= true
SRCS= libefi.c efi_console.c time.c copy.c devicename.c module.c
-SRCS+= delay.c efifs.c efinet.c elf_freebsd.c bootinfo.c pal.s
+SRCS+= delay.c efifs.c efinet.c elf_freebsd.c bootinfo.c pal.S
.if ${MACHINE_ARCH} == "ia64"
SRCS+= efifpswa.c
==== //depot/projects/smpng/sys/boot/i386/libi386/Makefile#10 (text+ko) ====
@@ -1,4 +1,4 @@
-# $FreeBSD: src/sys/boot/i386/libi386/Makefile,v 1.31 2003/06/07 17:42:26 obrien Exp $
+# $FreeBSD: src/sys/boot/i386/libi386/Makefile,v 1.32 2003/07/02 12:45:45 ru Exp $
#
LIB= i386
INTERNALLIB= true
@@ -7,7 +7,7 @@
biospci.c biossmap.c bootinfo.c bootinfo32.c bootinfo64.c \
comconsole.c devicename.c elf32_freebsd.c \
elf64_freebsd.c gatea20.c \
- i386_copy.c i386_module.c nullconsole.c pxe.c \
+ i386_copy.c i386_module.c nullconsole.c pxe.c pxetramp.s \
time.c vidconsole.c amd64_tramp.S
CFLAGS+= -ffreestanding
@@ -45,8 +45,4 @@
.endif
-OBJS+= pxetramp.o
-pxetramp.o: pxetramp.s
- ${AS} ${AFLAGS} -o ${.TARGET} ${.ALLSRC:M*pxetramp*}
-
.include <bsd.lib.mk>
==== //depot/projects/smpng/sys/boot/ia64/libski/Makefile#6 (text+ko) ====
@@ -1,11 +1,11 @@
-# $FreeBSD: src/sys/boot/ia64/libski/Makefile,v 1.9 2003/02/01 22:50:08 marcel Exp $
+# $FreeBSD: src/sys/boot/ia64/libski/Makefile,v 1.10 2003/07/02 11:47:33 ru Exp $
LIB= ski
INTERNALLIB= true
SRCS= skiconsole.c time.c copy.c devicename.c module.c exit.c
SRCS+= delay.c skifs.c elf_freebsd.c bootinfo.c ssc.c
-SRCS+= acpi_stub.c efi_stub.c pal_stub.s sal_stub.c
+SRCS+= acpi_stub.c efi_stub.c pal_stub.S sal_stub.c
CFLAGS+= -ffreestanding -fpic -g
CFLAGS+= -I${.CURDIR}/../include
==== //depot/projects/smpng/sys/boot/pc98/libpc98/Makefile#9 (text+ko) ====
@@ -1,4 +1,4 @@
-# $FreeBSD: src/sys/boot/pc98/libpc98/Makefile,v 1.17 2003/06/08 03:16:59 nyan Exp $
+# $FreeBSD: src/sys/boot/pc98/libpc98/Makefile,v 1.18 2003/07/02 12:45:45 ru Exp $
#
LIB= pc98
INTERNALLIB= true
@@ -7,7 +7,7 @@
SRCS= bioscd.c biosdisk.c biosmem.c biospnp.c biospci.c biossmap.c \
bootinfo.c bootinfo32.c comconsole.c devicename.c elf32_freebsd.c \
- gatea20.c i386_copy.c i386_module.c nullconsole.c pxe.c \
+ gatea20.c i386_copy.c i386_module.c nullconsole.c pxe.c pxetramp.s \
time.c vidconsole.c
CFLAGS+= -ffreestanding
@@ -46,8 +46,4 @@
.endif
-OBJS+= pxetramp.o
-pxetramp.o: pxetramp.s
- ${AS} ${AFLAGS} -o ${.TARGET} ${.ALLSRC:M*pxetramp*}
-
.include <bsd.lib.mk>
==== //depot/projects/smpng/sys/conf/NOTES#48 (text+ko) ====
@@ -1,4 +1,4 @@
-# $FreeBSD: src/sys/conf/NOTES,v 1.1157 2003/06/28 05:47:34 scottl Exp $
+# $FreeBSD: src/sys/conf/NOTES,v 1.1161 2003/07/07 21:19:04 wollman Exp $
#
# NOTES -- Lines that can be cut/pasted into kernel and hints configs.
#
@@ -456,7 +456,7 @@
# The `ether' device provides generic code to handle
# Ethernets; it is MANDATORY when an Ethernet device driver is
# configured or token-ring is enabled.
-# The 'wlan' device provides generic code to support 802.11
+# The `wlan' device provides generic code to support 802.11
# drivers, including host AP mode; it is MANDATORY for the wi
# driver and will eventually be required by all 802.11 drivers.
# The `fddi' device provides generic code to support FDDI.
@@ -674,13 +674,13 @@
# One of these is mandatory:
options FFS #Fast filesystem
options NFSCLIENT #Network File System
-options NFSSERVER #Network File System
# The rest are optional:
options CD9660 #ISO 9660 filesystem
options FDESCFS #File descriptor filesystem
options HPFS #OS/2 File system
options MSDOSFS #MS DOS File System (FAT, FAT32)
+options NFSSERVER #Network File System
options NTFS #NT File System
options NULLFS #NULL filesystem
#options NWFS #NetWare filesystem
@@ -727,8 +727,8 @@
#
# In order to manage swap, the system must reserve bitmap space that
# scales with the largest mounted swap device multiplied by NSWAPDEV,
-# irregardless of whether other swap devices exist or not. So it
-# is not a good idea to make this value too large.
+# irrespective of whether other swap devices exist. So it is not a
+# good idea to make this value too large.
options NSWAPDEV=5
# Disk quotas are supported when this option is enabled.
@@ -848,14 +848,15 @@
# device drivers. The host adapters are listed in the ISA and PCI
# device configuration sections below.
#
-# Beginning with FreeBSD 2.0.5 you can wire down your SCSI devices so
-# that a given bus, target, and LUN always come on line as the same
-# device unit. In earlier versions the unit numbers were assigned
-# in the order that the devices were probed on the SCSI bus. This
-# means that if you removed a disk drive, you may have had to rewrite
-# your /etc/fstab file, and also that you had to be careful when adding
-# a new disk as it may have been probed earlier and moved your device
-# configuration around.
+# It is possible to wire down your SCSI devices so that a given bus,
+# target, and LUN always come on line as the same device unit. In
+# earlier versions the unit numbers were assigned in the order that
+# the devices were probed on the SCSI bus. This means that if you
+# removed a disk drive, you may have had to rewrite your /etc/fstab
+# file, and also that you had to be careful when adding a new disk
+# as it may have been probed earlier and moved your device configuration
+# around. (See also option GEOM_VOL for a different solution to this
+# problem.)
# This old behavior is maintained as the default behavior. The unit
# assignment begins with the first non-wired down unit for a device
==== //depot/projects/smpng/sys/conf/files#81 (text+ko) ====
@@ -1,4 +1,4 @@
-# $FreeBSD: src/sys/conf/files,v 1.801 2003/06/28 06:12:41 sam Exp $
+# $FreeBSD: src/sys/conf/files,v 1.802 2003/07/08 18:59:32 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,6 +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_lid.c optional acpi
dev/acpica/acpi_pci.c optional acpi pci
dev/acpica/acpi_pci_link.c optional acpi pci
==== //depot/projects/smpng/sys/conf/files.ia64#29 (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.ia64,v 1.52 2003/05/16 21:26:40 marcel Exp $
+# $FreeBSD: src/sys/conf/files.ia64,v 1.53 2003/07/02 12:57:06 ru Exp $
#
# The long compile-with and dependency lines are required because of
# limitations in config: backslash-newline doesn't work in strings, and
@@ -75,7 +75,7 @@
ia64/ia64/busdma_machdep.c standard
ia64/ia64/clock.c standard
ia64/ia64/clock_if.m standard
-ia64/ia64/context.s standard
+ia64/ia64/context.S standard
ia64/ia64/critical.c standard
ia64/ia64/db_disasm.c optional ddb
ia64/ia64/db_interface.c optional ddb
@@ -84,26 +84,26 @@
ia64/ia64/efi.c standard
ia64/ia64/eficlock.c standard
ia64/ia64/elf_machdep.c standard
-ia64/ia64/exception.s standard
+ia64/ia64/exception.S standard
ia64/ia64/ia64-gdbstub.c optional ddb
ia64/ia64/in_cksum.c optional inet
ia64/ia64/interrupt.c standard
-ia64/ia64/locore.s standard no-obj
+ia64/ia64/locore.S standard no-obj
ia64/ia64/machdep.c standard
ia64/ia64/mca.c standard
ia64/ia64/mem.c standard
>>> TRUNCATED FOR MAIL (1000 lines) <<<
More information about the p4-projects
mailing list