Date: Mon, 22 Nov 2004 20:02:11 GMT From: John Baldwin <jhb@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 65658 for review Message-ID: <200411222002.iAMK2BwX069256@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=65658 Change 65658 by jhb@jhb_slimer on 2004/11/22 20:01:11 IFC @65655. Affected files ... .. //depot/projects/smpng/sys/alpha/alpha/genassym.c#18 integrate .. //depot/projects/smpng/sys/alpha/alpha/machdep.c#73 integrate .. //depot/projects/smpng/sys/alpha/alpha/mp_machdep.c#31 integrate .. //depot/projects/smpng/sys/alpha/include/param.h#12 integrate .. //depot/projects/smpng/sys/amd64/amd64/busdma_machdep.c#14 integrate .. //depot/projects/smpng/sys/amd64/amd64/genassym.c#13 integrate .. //depot/projects/smpng/sys/amd64/amd64/machdep.c#32 integrate .. //depot/projects/smpng/sys/amd64/include/param.h#12 integrate .. //depot/projects/smpng/sys/arm/arm/db_interface.c#3 integrate .. //depot/projects/smpng/sys/arm/arm/db_trace.c#9 integrate .. //depot/projects/smpng/sys/arm/arm/exception.S#4 integrate .. //depot/projects/smpng/sys/arm/arm/genassym.c#4 integrate .. //depot/projects/smpng/sys/arm/arm/swtch.S#5 integrate .. //depot/projects/smpng/sys/arm/arm/trap.c#4 integrate .. //depot/projects/smpng/sys/arm/arm/undefined.c#2 integrate .. //depot/projects/smpng/sys/arm/arm/vm_machdep.c#7 integrate .. //depot/projects/smpng/sys/arm/include/cpufunc.h#5 integrate .. //depot/projects/smpng/sys/arm/include/db_machdep.h#3 integrate .. //depot/projects/smpng/sys/arm/include/kdb.h#2 integrate .. //depot/projects/smpng/sys/arm/include/param.h#7 integrate .. //depot/projects/smpng/sys/arm/sa11x0/assabet_machdep.c#6 integrate .. //depot/projects/smpng/sys/arm/xscale/i80321/iq31244_machdep.c#4 integrate .. //depot/projects/smpng/sys/arm/xscale/i80321/std.i80321#2 integrate .. //depot/projects/smpng/sys/arm/xscale/i80321/std.iq31244#2 integrate .. //depot/projects/smpng/sys/boot/efi/loader/main.c#14 integrate .. //depot/projects/smpng/sys/cam/cam_xpt.c#23 integrate .. //depot/projects/smpng/sys/compat/freebsd32/freebsd32_proto.h#13 integrate .. //depot/projects/smpng/sys/compat/freebsd32/freebsd32_syscall.h#13 integrate .. //depot/projects/smpng/sys/compat/freebsd32/freebsd32_syscalls.c#13 integrate .. //depot/projects/smpng/sys/compat/freebsd32/freebsd32_sysent.c#13 integrate .. //depot/projects/smpng/sys/compat/freebsd32/syscalls.master#13 integrate .. //depot/projects/smpng/sys/compat/pecoff/imgact_pecoff.c#21 integrate .. //depot/projects/smpng/sys/conf/NOTES#86 integrate .. //depot/projects/smpng/sys/conf/files#128 integrate .. //depot/projects/smpng/sys/conf/files.sparc64#46 integrate .. //depot/projects/smpng/sys/conf/kmod.mk#37 integrate .. //depot/projects/smpng/sys/ddb/db_ps.c#30 integrate .. //depot/projects/smpng/sys/ddb/db_run.c#8 integrate .. //depot/projects/smpng/sys/dev/aac/aac.c#45 integrate .. //depot/projects/smpng/sys/dev/aic7xxx/aic79xx.c#22 integrate .. //depot/projects/smpng/sys/dev/aic7xxx/aic79xx.h#19 integrate .. //depot/projects/smpng/sys/dev/aic7xxx/aic7xxx.c#22 integrate .. //depot/projects/smpng/sys/dev/aic7xxx/aic_osm_lib.h#4 integrate .. //depot/projects/smpng/sys/dev/bge/if_bge.c#50 integrate .. //depot/projects/smpng/sys/dev/ed/if_ed.c#26 integrate .. //depot/projects/smpng/sys/dev/fdc/fdc.c#15 integrate .. //depot/projects/smpng/sys/dev/hme/if_hme.c#19 integrate .. //depot/projects/smpng/sys/dev/hme/if_hme_pci.c#13 integrate .. //depot/projects/smpng/sys/dev/hme/if_hme_sbus.c#11 integrate .. //depot/projects/smpng/sys/dev/hme/if_hmevar.h#7 integrate .. //depot/projects/smpng/sys/dev/ic/ns16550.h#5 integrate .. //depot/projects/smpng/sys/dev/ic/sab82532.h#1 branch .. //depot/projects/smpng/sys/dev/ic/z8530.h#1 branch .. //depot/projects/smpng/sys/dev/mc146818/mc146818.c#1 branch .. //depot/projects/smpng/sys/dev/mc146818/mc146818reg.h#3 integrate .. //depot/projects/smpng/sys/dev/mc146818/mc146818var.h#1 branch .. //depot/projects/smpng/sys/dev/uart/uart_bus_isa.c#5 integrate .. //depot/projects/smpng/sys/dev/uart/uart_cpu.h#5 integrate .. //depot/projects/smpng/sys/dev/uart/uart_cpu_alpha.c#5 integrate .. //depot/projects/smpng/sys/dev/uart/uart_cpu_amd64.c#5 integrate .. //depot/projects/smpng/sys/dev/uart/uart_cpu_i386.c#5 integrate .. //depot/projects/smpng/sys/dev/uart/uart_cpu_ia64.c#5 integrate .. //depot/projects/smpng/sys/dev/uart/uart_cpu_pc98.c#6 integrate .. //depot/projects/smpng/sys/dev/uart/uart_cpu_sparc64.c#8 integrate .. //depot/projects/smpng/sys/dev/uart/uart_dev_i8251.c#3 delete .. //depot/projects/smpng/sys/dev/uart/uart_dev_i8251.h#2 delete .. //depot/projects/smpng/sys/dev/uart/uart_dev_ns8250.c#8 integrate .. //depot/projects/smpng/sys/dev/uart/uart_dev_ns8250.h#2 delete .. //depot/projects/smpng/sys/dev/uart/uart_dev_sab82532.c#5 integrate .. //depot/projects/smpng/sys/dev/uart/uart_dev_sab82532.h#2 delete .. //depot/projects/smpng/sys/dev/uart/uart_dev_z8530.c#5 integrate .. //depot/projects/smpng/sys/dev/uart/uart_dev_z8530.h#2 delete .. //depot/projects/smpng/sys/fs/fifofs/fifo_vnops.c#30 integrate .. //depot/projects/smpng/sys/geom/uzip/g_uzip.c#4 integrate .. //depot/projects/smpng/sys/i386/i386/busdma_machdep.c#32 integrate .. //depot/projects/smpng/sys/i386/i386/genassym.c#30 integrate .. //depot/projects/smpng/sys/i386/i386/locore.s#24 integrate .. //depot/projects/smpng/sys/i386/i386/machdep.c#83 integrate .. //depot/projects/smpng/sys/i386/include/param.h#15 integrate .. //depot/projects/smpng/sys/i386/linux/linux_sysvec.c#40 integrate .. //depot/projects/smpng/sys/ia64/ia64/genassym.c#26 integrate .. //depot/projects/smpng/sys/ia64/ia64/machdep.c#88 integrate .. //depot/projects/smpng/sys/ia64/ia64/pmap.c#65 integrate .. //depot/projects/smpng/sys/ia64/include/param.h#14 integrate .. //depot/projects/smpng/sys/ia64/include/pte.h#5 integrate .. //depot/projects/smpng/sys/kern/imgact_aout.c#23 integrate .. //depot/projects/smpng/sys/kern/init_main.c#51 integrate .. //depot/projects/smpng/sys/kern/init_sysent.c#48 integrate .. //depot/projects/smpng/sys/kern/kern_descrip.c#72 integrate .. //depot/projects/smpng/sys/kern/kern_fork.c#88 integrate .. //depot/projects/smpng/sys/kern/kern_kse.c#13 integrate .. //depot/projects/smpng/sys/kern/kern_ntptime.c#15 integrate .. //depot/projects/smpng/sys/kern/kern_proc.c#69 integrate .. //depot/projects/smpng/sys/kern/kern_switch.c#51 integrate .. //depot/projects/smpng/sys/kern/kern_thr.c#22 integrate .. //depot/projects/smpng/sys/kern/kern_thread.c#74 integrate .. //depot/projects/smpng/sys/kern/syscalls.c#48 integrate .. //depot/projects/smpng/sys/kern/syscalls.master#49 integrate .. //depot/projects/smpng/sys/kern/vfs_bio.c#71 integrate .. //depot/projects/smpng/sys/kern/vfs_default.c#31 integrate .. //depot/projects/smpng/sys/kern/vfs_mount.c#38 integrate .. //depot/projects/smpng/sys/kern/vfs_vnops.c#54 integrate .. //depot/projects/smpng/sys/modules/acpi/acpi_snc/Makefile#2 delete .. //depot/projects/smpng/sys/modules/sio/Makefile#4 integrate .. //depot/projects/smpng/sys/modules/uart/Makefile#7 integrate .. //depot/projects/smpng/sys/net/if.h#22 integrate .. //depot/projects/smpng/sys/netgraph/atm/sscop/ng_sscop_cust.h#3 integrate .. //depot/projects/smpng/sys/netgraph/bluetooth/drivers/bt3c/ng_bt3c_pccard.c#7 integrate .. //depot/projects/smpng/sys/netgraph/ng_one2many.c#10 integrate .. //depot/projects/smpng/sys/netinet/in.c#23 integrate .. //depot/projects/smpng/sys/netinet/ip_divert.c#42 integrate .. //depot/projects/smpng/sys/netinet/tcp_fsm.h#4 integrate .. //depot/projects/smpng/sys/netinet/tcp_input.c#62 integrate .. //depot/projects/smpng/sys/nfsclient/nfs_bio.c#34 integrate .. //depot/projects/smpng/sys/pc98/i386/machdep.c#74 integrate .. //depot/projects/smpng/sys/pci/if_sf.c#32 integrate .. //depot/projects/smpng/sys/pci/if_sfreg.h#5 integrate .. //depot/projects/smpng/sys/pci/if_sk.c#38 integrate .. //depot/projects/smpng/sys/powerpc/include/param.h#12 integrate .. //depot/projects/smpng/sys/powerpc/powerpc/genassym.c#24 integrate .. //depot/projects/smpng/sys/powerpc/powerpc/machdep.c#55 integrate .. //depot/projects/smpng/sys/sparc64/conf/GENERIC#50 integrate .. //depot/projects/smpng/sys/sparc64/conf/NOTES#12 integrate .. //depot/projects/smpng/sys/sparc64/include/param.h#15 integrate .. //depot/projects/smpng/sys/sparc64/sparc64/genassym.c#34 integrate .. //depot/projects/smpng/sys/sparc64/sparc64/machdep.c#68 integrate .. //depot/projects/smpng/sys/sparc64/sparc64/rtc.c#1 branch .. //depot/projects/smpng/sys/sys/buf.h#33 integrate .. //depot/projects/smpng/sys/sys/proc.h#134 integrate .. //depot/projects/smpng/sys/sys/syscall.h#48 integrate .. //depot/projects/smpng/sys/sys/syscall.mk#48 integrate .. //depot/projects/smpng/sys/sys/sysproto.h#50 integrate .. //depot/projects/smpng/sys/sys/systm.h#58 integrate .. //depot/projects/smpng/sys/sys/user.h#21 integrate .. //depot/projects/smpng/sys/ufs/ffs/ffs_vnops.c#36 integrate .. //depot/projects/smpng/sys/vm/swap_pager.c#53 integrate .. //depot/projects/smpng/sys/vm/vm_extern.h#26 integrate .. //depot/projects/smpng/sys/vm/vm_glue.c#51 integrate .. //depot/projects/smpng/sys/vm/vm_pageout.h#14 integrate Differences ... ==== //depot/projects/smpng/sys/alpha/alpha/genassym.c#18 (text+ko) ==== @@ -33,7 +33,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/alpha/alpha/genassym.c,v 1.44 2004/04/05 21:00:49 imp Exp $"); +__FBSDID("$FreeBSD: src/sys/alpha/alpha/genassym.c,v 1.45 2004/11/20 02:28:14 das Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -52,12 +52,12 @@ #include <sys/ktr.h> #include <machine/frame.h> #include <machine/chipset.h> +#include <machine/pcb.h> #include <sys/vmmeter.h> #include <vm/vm.h> #include <vm/vm_param.h> #include <vm/pmap.h> #include <vm/vm_map.h> -#include <sys/user.h> #include <net/if.h> #include <netinet/in.h> #include <nfs/nfsproto.h> ==== //depot/projects/smpng/sys/alpha/alpha/machdep.c#73 (text+ko) ==== @@ -88,7 +88,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/alpha/alpha/machdep.c,v 1.224 2004/11/05 19:16:43 jhb Exp $"); +__FBSDID("$FreeBSD: src/sys/alpha/alpha/machdep.c,v 1.225 2004/11/20 02:29:36 das Exp $"); #include "opt_compat.h" #include "opt_ddb.h" @@ -160,7 +160,6 @@ struct mtx icu_lock; -struct user *proc0uarea; vm_offset_t proc0kstack; char machine[] = "alpha"; @@ -848,11 +847,9 @@ proc_linkup(&proc0, &ksegrp0, &thread0); /* - * Init mapping for u page(s) for proc 0 + * Init mapping for kernel stack for proc 0 */ - proc0uarea = (struct user *)pmap_steal_memory(UAREA_PAGES * PAGE_SIZE); proc0kstack = pmap_steal_memory(KSTACK_PAGES * PAGE_SIZE); - proc0.p_uarea = proc0uarea; thread0.td_kstack = proc0kstack; thread0.td_pcb = (struct pcb *) (thread0.td_kstack + KSTACK_PAGES * PAGE_SIZE) - 1; @@ -861,7 +858,6 @@ * Setup the per-CPU data for the bootstrap cpu. */ { - /* This is not a 'struct user' */ size_t sz = round_page(KSTACK_PAGES * PAGE_SIZE); pcpup = (struct pcpu *) pmap_steal_memory(sz); pcpu_init(pcpup, 0, sz); ==== //depot/projects/smpng/sys/alpha/alpha/mp_machdep.c#31 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/alpha/alpha/mp_machdep.c,v 1.53 2004/11/05 19:16:43 jhb Exp $"); +__FBSDID("$FreeBSD: src/sys/alpha/alpha/mp_machdep.c,v 1.54 2004/11/20 02:29:36 das Exp $"); #include "opt_kstack_pages.h" @@ -233,7 +233,7 @@ if (bootverbose) printf("smp_start_secondary: starting cpu %d\n", pal_id); - sz = round_page((UAREA_PAGES + KSTACK_PAGES) * PAGE_SIZE); + sz = KSTACK_PAGES * PAGE_SIZE; pcpu = malloc(sz, M_TEMP, M_NOWAIT); if (!pcpu) { printf("smp_start_secondary: can't allocate memory\n"); ==== //depot/projects/smpng/sys/alpha/include/param.h#12 (text+ko) ==== @@ -1,4 +1,4 @@ -/* $FreeBSD: src/sys/alpha/include/param.h,v 1.36 2004/09/02 18:59:14 scottl Exp $ */ +/* $FreeBSD: src/sys/alpha/include/param.h,v 1.37 2004/11/20 02:29:49 das Exp $ */ /* From: NetBSD: param.h,v 1.20 1997/09/19 13:52:53 leo Exp */ /* @@ -117,7 +117,6 @@ #define KSTACK_PAGES 2 /* pages of kstack (with pcb) */ #endif #define KSTACK_GUARD_PAGES 1 /* pages of kstack guard; 0 disables */ -#define UAREA_PAGES 1 /* pages of u-area */ /* ==== //depot/projects/smpng/sys/amd64/amd64/busdma_machdep.c#14 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/amd64/amd64/busdma_machdep.c,v 1.60 2004/11/10 03:49:24 scottl Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/amd64/busdma_machdep.c,v 1.63 2004/11/21 06:28:09 scottl Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -40,7 +40,6 @@ #include <sys/mbuf.h> #include <sys/uio.h> #include <sys/sysctl.h> -#include <sys/ktr.h> #include <vm/vm.h> #include <vm/vm_page.h> @@ -87,6 +86,7 @@ struct bounce_zone { STAILQ_ENTRY(bounce_zone) links; STAILQ_HEAD(bp_list, bounce_page) bounce_page_list; + int total_bpages; int free_bpages; int reserved_bpages; int active_bpages; @@ -128,15 +128,14 @@ static struct bus_dmamap nobounce_dmamap; static void init_bounce_pages(void *dummy); -static struct bounce_zone * alloc_bounce_zone(bus_dma_tag_t dmat); +static int alloc_bounce_zone(bus_dma_tag_t dmat); 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); 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, - bus_size_t len); +static __inline int run_filter(bus_dma_tag_t dmat, bus_addr_t paddr); /* * Return true if a match is made. @@ -147,18 +146,15 @@ * 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, bus_size_t len) +run_filter(bus_dma_tag_t dmat, bus_addr_t paddr) { - bus_size_t bndy; int retval; retval = 0; - bndy = dmat->boundary; do { if (((paddr > dmat->lowaddr && paddr <= dmat->highaddr) - || ((paddr & (dmat->alignment - 1)) != 0) - || ((paddr & bndy) != ((paddr + len) & bndy))) + || ((paddr & (dmat->alignment - 1)) != 0)) && (dmat->filter == NULL || (*dmat->filter)(dmat->filterarg, paddr) != 0)) retval = 1; @@ -204,7 +200,8 @@ panic("driver error: busdma dflt_lock called"); } -#define BUS_DMA_MIN_ALLOC_COMP BUS_DMA_BUS4 +#define BUS_DMA_COULD_BOUNCE BUS_DMA_BUS3 +#define BUS_DMA_MIN_ALLOC_COMP BUS_DMA_BUS4 /* * Allocate a device specific dma_tag. */ @@ -278,11 +275,21 @@ if (newtag->parent != NULL) atomic_add_int(&parent->ref_count, 1); } - - if (newtag->lowaddr < ptoa((vm_paddr_t)Maxmem) && + + if (newtag->lowaddr < ptoa((vm_paddr_t)Maxmem) + || newtag->alignment > 1 || newtag->boundary > 0) + newtag->flags |= BUS_DMA_COULD_BOUNCE; + + if (((newtag->flags & BUS_DMA_COULD_BOUNCE) != 0) && (flags & BUS_DMA_ALLOCNOW) != 0) { + struct bounce_zone *bz; + /* Must bounce */ + if ((error = alloc_bounce_zone(newtag)) != 0) + return (error); + bz = newtag->bounce_zone; + if (lowaddr > bounce_lowaddr) { /* * Go through the pool and kill any pages @@ -291,10 +298,10 @@ panic("bus_dma_tag_create: page reallocation " "not implemented"); } - if (ptoa(total_bpages) < maxsize) { + if (ptoa(bz->total_bpages) < maxsize) { int pages; - pages = atop(maxsize) - total_bpages; + pages = atop(maxsize) - bz->total_bpages; /* Add pages to our bounce pool */ if (alloc_bounce_pages(newtag, pages) < pages) @@ -382,12 +389,16 @@ * exclusion region, a data alignment that is stricter than 1, and/or * an active address boundary. */ - if (dmat->lowaddr < ptoa((vm_paddr_t)Maxmem) - || dmat->alignment > 1 || dmat->boundary > 0) { + if (dmat->flags & BUS_DMA_COULD_BOUNCE) { /* Must bounce */ int maxpages; + if (dmat->bounce_zone == NULL) { + if ((error = alloc_bounce_zone(dmat)) != 0) + return (error); + } + *mapp = (bus_dmamap_t)malloc(sizeof(**mapp), M_DEVBUF, M_NOWAIT | M_ZERO); if (*mapp == NULL) { @@ -568,8 +579,7 @@ map = &nobounce_dmamap; if ((map != &nobounce_dmamap && map->pagesneeded == 0) - && (dmat->lowaddr < ptoa((vm_paddr_t)Maxmem) - || dmat->boundary > 0 || dmat->alignment > 1)) { + && ((dmat->flags & BUS_DMA_COULD_BOUNCE) != 0)) { vm_offset_t vendaddr; CTR4(KTR_BUSDMA, "lowaddr= %d Maxmem= %d, boundary= %d, " @@ -586,7 +596,7 @@ while (vaddr < vendaddr) { paddr = pmap_kextract(vaddr); - if (run_filter(dmat, paddr, 0) != 0) { + if (run_filter(dmat, paddr) != 0) { needbounce = 1; map->pagesneeded++; } @@ -647,7 +657,7 @@ sgsize = (baddr - curaddr); } - if (map->pagesneeded != 0 && run_filter(dmat, curaddr, sgsize)) + if (map->pagesneeded != 0 && run_filter(dmat, curaddr)) curaddr = add_bounce_page(dmat, map, vaddr, sgsize); /* @@ -902,14 +912,24 @@ return (bz->sysctl_tree_top); } -static struct bounce_zone * +static int alloc_bounce_zone(bus_dma_tag_t dmat) { struct bounce_zone *bz; + /* Check to see if we already have a suitable zone */ + STAILQ_FOREACH(bz, &bounce_zone_list, links) { + if ((dmat->alignment <= bz->alignment) + && (dmat->boundary <= bz->boundary) + && (dmat->lowaddr >= bz->lowaddr)) { + dmat->bounce_zone = bz; + return (0); + } + } + if ((bz = (struct bounce_zone *)malloc(sizeof(*bz), M_DEVBUF, M_NOWAIT | M_ZERO)) == NULL) - return (NULL); + return (ENOMEM); STAILQ_INIT(&bz->bounce_page_list); bz->free_bpages = 0; @@ -922,6 +942,7 @@ busdma_zonecount++; snprintf(bz->lowaddrid, 18, "%#jx", (uintmax_t)bz->lowaddr); STAILQ_INSERT_TAIL(&bounce_zone_list, bz, links); + dmat->bounce_zone = bz; sysctl_ctx_init(&bz->sysctl_tree); bz->sysctl_tree_top = SYSCTL_ADD_NODE(&bz->sysctl_tree, @@ -929,11 +950,15 @@ CTLFLAG_RD, 0, ""); if (bz->sysctl_tree_top == NULL) { sysctl_ctx_free(&bz->sysctl_tree); - return (bz); + return (0); /* XXX error code? */ } SYSCTL_ADD_INT(busdma_sysctl_tree(bz), SYSCTL_CHILDREN(busdma_sysctl_tree_top(bz)), OID_AUTO, + "total_bpages", CTLFLAG_RD, &bz->total_bpages, 0, + "Totoal bounce pages"); + SYSCTL_ADD_INT(busdma_sysctl_tree(bz), + SYSCTL_CHILDREN(busdma_sysctl_tree_top(bz)), OID_AUTO, "free_bpages", CTLFLAG_RD, &bz->free_bpages, 0, "Free bounce pages"); SYSCTL_ADD_INT(busdma_sysctl_tree(bz), @@ -962,7 +987,7 @@ SYSCTL_CHILDREN(busdma_sysctl_tree_top(bz)), OID_AUTO, "boundary", CTLFLAG_RD, &bz->boundary, 0, ""); - return (bz); + return (0); } static int @@ -972,21 +997,6 @@ int count; bz = dmat->bounce_zone; - if (bz == NULL) { - STAILQ_FOREACH(bz, &bounce_zone_list, links) { - if ((dmat->alignment <= bz->alignment) - && (dmat->boundary <= bz->boundary) - && (dmat->lowaddr >= bz->lowaddr)) - break; - } - - if (bz == NULL) { - if ((bz = alloc_bounce_zone(dmat)) == NULL) - return (ENOMEM); - } - dmat->bounce_zone = bz; - } - count = 0; while (numpages > 0) { struct bounce_page *bpage; @@ -1009,6 +1019,7 @@ mtx_lock(&bounce_lock); STAILQ_INSERT_TAIL(&bz->bounce_page_list, bpage, links); total_bpages++; + bz->total_bpages++; bz->free_bpages++; mtx_unlock(&bounce_lock); count++; ==== //depot/projects/smpng/sys/amd64/amd64/genassym.c#13 (text+ko) ==== @@ -33,7 +33,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/amd64/amd64/genassym.c,v 1.154 2004/05/16 22:43:57 peter Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/amd64/genassym.c,v 1.155 2004/11/20 02:30:59 das Exp $"); #include "opt_compat.h" #include "opt_kstack_pages.h" @@ -50,14 +50,12 @@ #include <sys/socket.h> #include <sys/resourcevar.h> #include <sys/ucontext.h> -#include <sys/user.h> #include <machine/tss.h> #include <sys/vmmeter.h> #include <vm/vm.h> #include <vm/vm_param.h> #include <vm/pmap.h> #include <vm/vm_map.h> -#include <sys/user.h> #include <sys/proc.h> #include <net/if.h> #include <netinet/in.h> @@ -67,6 +65,7 @@ #include <nfsclient/nfsdiskless.h> #include <machine/apicreg.h> #include <machine/cpu.h> +#include <machine/pcb.h> #include <machine/sigframe.h> #include <machine/proc.h> #include <machine/specialreg.h> @@ -76,7 +75,6 @@ ASSYM(VM_PMAP, offsetof(struct vmspace, vm_pmap)); ASSYM(PM_ACTIVE, offsetof(struct pmap, pm_active)); ASSYM(P_SFLAG, offsetof(struct proc, p_sflag)); -ASSYM(P_UAREA, offsetof(struct proc, p_uarea)); ASSYM(TD_FLAGS, offsetof(struct thread, td_flags)); ASSYM(TD_PCB, offsetof(struct thread, td_pcb)); @@ -88,7 +86,6 @@ ASSYM(V_TRAP, offsetof(struct vmmeter, v_trap)); ASSYM(V_SYSCALL, offsetof(struct vmmeter, v_syscall)); ASSYM(V_INTR, offsetof(struct vmmeter, v_intr)); -ASSYM(UAREA_PAGES, UAREA_PAGES); ASSYM(KSTACK_PAGES, KSTACK_PAGES); ASSYM(PAGE_SIZE, PAGE_SIZE); ASSYM(NPTEPG, NPTEPG); ==== //depot/projects/smpng/sys/amd64/amd64/machdep.c#32 (text+ko) ==== @@ -39,7 +39,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/amd64/amd64/machdep.c,v 1.622 2004/10/28 12:16:03 simokawa Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/amd64/machdep.c,v 1.623 2004/11/20 02:29:23 das Exp $"); #include "opt_atalk.h" #include "opt_atpic.h" @@ -1114,9 +1114,6 @@ #error "have you forgotten the isa device?"; #endif - proc0.p_uarea = (struct user *)(physfree + KERNBASE); - bzero(proc0.p_uarea, UAREA_PAGES * PAGE_SIZE); - physfree += UAREA_PAGES * PAGE_SIZE; thread0.td_kstack = physfree + KERNBASE; bzero((void *)thread0.td_kstack, KSTACK_PAGES * PAGE_SIZE); physfree += KSTACK_PAGES * PAGE_SIZE; ==== //depot/projects/smpng/sys/amd64/include/param.h#12 (text+ko) ==== @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)param.h 8.1 (Berkeley) 6/10/93 - * $FreeBSD: src/sys/amd64/include/param.h,v 1.14 2004/09/02 18:59:14 scottl Exp $ + * $FreeBSD: src/sys/amd64/include/param.h,v 1.15 2004/11/20 02:29:49 das Exp $ */ /* @@ -125,7 +125,6 @@ #define KSTACK_PAGES 4 /* pages of kstack (with pcb) */ #endif #define KSTACK_GUARD_PAGES 1 /* pages of kstack guard; 0 disables */ -#define UAREA_PAGES 1 /* holds struct user WITHOUT PCB (see def.) */ /* ==== //depot/projects/smpng/sys/arm/arm/db_interface.c#3 (text+ko) ==== @@ -35,7 +35,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/arm/arm/db_interface.c,v 1.2 2004/07/12 21:25:01 cognet Exp $"); +__FBSDID("$FreeBSD: src/sys/arm/arm/db_interface.c,v 1.3 2004/11/21 18:11:39 cognet Exp $"); #include "opt_ddb.h" #include <sys/param.h> @@ -43,6 +43,9 @@ #include <sys/reboot.h> #include <sys/systm.h> /* just for boothowto */ #include <sys/exec.h> +#ifdef KDB +#include <sys/kdb.h> +#endif #include <vm/vm.h> #include <vm/pmap.h> @@ -192,11 +195,6 @@ char *dst; size_t loop; - /* If any part is in kernel text, use db_write_text() */ - if (addr >= (vm_offset_t) btext && addr < (vm_offset_t) etext) { - return (-1); - } - dst = (char *)addr; if (db_validate_address((u_int)dst)) { db_printf("address %p is invalid\n", dst); @@ -229,4 +227,93 @@ } +static u_int +db_fetch_reg(int reg) +{ + + switch (reg) { + case 0: + return (kdb_frame->tf_r0); + case 1: + return (kdb_frame->tf_r1); + case 2: + return (kdb_frame->tf_r2); + case 3: + return (kdb_frame->tf_r3); + case 4: + return (kdb_frame->tf_r4); + case 5: + return (kdb_frame->tf_r5); + case 6: + return (kdb_frame->tf_r6); + case 7: + return (kdb_frame->tf_r7); + case 8: + return (kdb_frame->tf_r8); + case 9: + return (kdb_frame->tf_r9); + case 10: + return (kdb_frame->tf_r10); + case 11: + return (kdb_frame->tf_r11); + case 12: + return (kdb_frame->tf_r12); + case 13: + return (kdb_frame->tf_svc_sp); + case 14: + return (kdb_frame->tf_svc_lr); + case 15: + return (kdb_frame->tf_pc); + default: + panic("db_fetch_reg: botch"); + } +} + +u_int +branch_taken(u_int insn, db_addr_t pc) +{ + u_int addr, nregs; + + switch ((insn >> 24) & 0xf) { + case 0xa: /* b ... */ + case 0xb: /* bl ... */ + addr = ((insn << 2) & 0x03ffffff); + if (addr & 0x02000000) + addr |= 0xfc000000; + return (pc + 8 + addr); + case 0x7: /* ldr pc, [pc, reg, lsl #2] */ + addr = db_fetch_reg(insn & 0xf); + addr = pc + 8 + (addr << 2); + db_read_bytes(addr, 4, (char *)&addr); + return (addr); + case 0x1: /* mov pc, reg */ + addr = db_fetch_reg(insn & 0xf); + return (addr); + case 0x8: /* ldmxx reg, {..., pc} */ + case 0x9: + addr = db_fetch_reg((insn >> 16) & 0xf); + nregs = (insn & 0x5555) + ((insn >> 1) & 0x5555); + nregs = (nregs & 0x3333) + ((nregs >> 2) & 0x3333); + nregs = (nregs + (nregs >> 4)) & 0x0f0f; + nregs = (nregs + (nregs >> 8)) & 0x001f; + switch ((insn >> 23) & 0x3) { + case 0x0: /* ldmda */ + addr = addr - 0; + break; + case 0x1: /* ldmia */ + addr = addr + 0 + ((nregs - 1) << 2); + break; + case 0x2: /* ldmdb */ + addr = addr - 4; + break; + case 0x3: /* ldmib */ + addr = addr + 4 + ((nregs - 1) << 2); + break; + } + db_read_bytes(addr, 4, (char *)&addr); + return (addr); + default: + panic("branch_taken: botch"); + } +} ==== //depot/projects/smpng/sys/arm/arm/db_trace.c#9 (text+ko) ==== @@ -30,7 +30,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/arm/arm/db_trace.c,v 1.7 2004/11/01 22:15:13 jhb Exp $"); +__FBSDID("$FreeBSD: src/sys/arm/arm/db_trace.c,v 1.8 2004/11/21 19:41:27 cognet Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -87,53 +87,17 @@ #define FR_RFP (-3) static void -db_stack_trace_cmd(db_expr_t addr, int have_addr, db_expr_t count, char *modif) +db_stack_trace_cmd(db_expr_t addr, db_expr_t count) { u_int32_t *frame, *lastframe; c_db_sym_t sym; - char c, *cp = modif; const char *name; db_expr_t value; db_expr_t offset; boolean_t kernel_only = TRUE; - boolean_t trace_thread = FALSE; int scp_offset, quit; - if (kdb_frame == NULL && !have_addr) - return; - while (modif && ((c = *cp++) != 0)) { - if (c == 'u') - kernel_only = FALSE; - if (c == 't') - trace_thread = TRUE; - } - - if (!have_addr) - frame = (u_int32_t *)(kdb_frame->tf_r11); - else { - if (trace_thread) { - struct proc *p; - struct thread *td; - pid_t pid = (pid_t)addr; - LIST_FOREACH(p, &allproc, p_list) { - if (p->p_pid == pid) - break; - } - - if (p == NULL) { - db_printf("not found\n"); - return; - } - if (!(p->p_sflag & PS_INMEM)) { - db_printf("swapped out\n"); - return; - } - td = FIRST_THREAD_IN_PROC(p); - frame = (u_int32_t *)(td->td_pcb->un_32.pcb32_r11); - db_printf("at %p\n", frame); - } else - frame = (u_int32_t *)(addr); - } + frame = (u_int32_t *)addr; lastframe = NULL; scp_offset = -(get_pc_str_offset() >> 2); @@ -152,8 +116,6 @@ */ scp = frame[FR_SCP]; - db_printsym(scp, DB_STGY_PROC); - db_printf("\n\t"); sym = db_search_symbol(scp, DB_STGY_ANY, &offset); if (sym == C_DB_SYM_NULL) { value = 0; @@ -248,7 +210,7 @@ addr = (uint32_t)__builtin_frame_address(0); else addr = thr->td_pcb->un_32.pcb32_r11; - db_stack_trace_cmd(addr, 1, -1, NULL); + db_stack_trace_cmd(addr, -1); return (0); } ==== //depot/projects/smpng/sys/arm/arm/exception.S#4 (text+ko) ==== @@ -51,7 +51,7 @@ #include <machine/asm.h> #include <machine/armreg.h> #include <machine/asmacros.h> -__FBSDID("$FreeBSD: src/sys/arm/arm/exception.S,v 1.3 2004/09/23 22:05:39 cognet Exp $"); +__FBSDID("$FreeBSD: src/sys/arm/arm/exception.S,v 1.4 2004/11/20 16:52:30 cognet Exp $"); .text .align 0 @@ -206,122 +206,6 @@ * look like direct entry from the vector. */ ASENTRY_NP(undefined_entry) -#ifdef IPKDB -/* - * IPKDB must be hooked in at the earliest possible entry point. - * - */ -/* - * Make room for all registers saving real r0-r7 and r15. - * The remaining registers are updated later. - */ - stmfd sp!, {r0,r1} /* psr & spsr */ - stmfd sp!, {lr} /* pc */ - stmfd sp!, {r0-r14} /* r0-r7, r8-r14 */ -/* - * Get previous psr. - */ - mrs r7, cpsr_all - mrs r0, spsr_all - str r0, [sp, #(16*4)] -/* - * Test for user mode. - */ - tst r0, #0xf - bne .Lprenotuser_push - add r1, sp, #(8*4) - stmia r1,{r8-r14}^ /* store user mode r8-r14*/ - b .Lgoipkdb -/* - * Switch to previous mode to get r8-r13. - */ -.Lprenotuser_push: - orr r0, r0, #(I32_bit) /* disable interrupts */ - msr cpsr_all, r0 - mov r1, r8 - mov r2, r9 - mov r3, r10 - mov r4, r11 - mov r5, r12 - mov r6, r13 - msr cpsr_all, r7 /* back to undefined mode */ - add r8, sp, #(8*4) - stmia r8, {r1-r6} /* r8-r13 */ -/* - * Now back to previous mode to get r14 and spsr. - */ - msr cpsr_all, r0 - mov r1, r14 - mrs r2, spsr - msr cpsr_all, r7 /* back to undefined mode */ - str r1, [sp, #(14*4)] /* r14 */ - str r2, [sp, #(17*4)] /* spsr */ -/* - * Now to IPKDB. - */ -.Lgoipkdb: - mov r0, sp - bl _C_LABEL(ipkdb_trap_glue) - ldr r1, .Lipkdb_trap_return - str r0,[r1] - -/* - * Have to load all registers from the stack. - * - * Start with spsr and pc. - */ - ldr r0, [sp, #(16*4)] /* spsr */ - ldr r1, [sp, #(15*4)] /* r15 */ - msr spsr_all, r0 - mov r14, r1 -/* - * Test for user mode. - */ - tst r0, #0xf - bne .Lprenotuser_pull - add r1, sp, #(8*4) - ldmia r1, {r8-r14}^ /* load user mode r8-r14 */ - b .Lpull_r0r7 -.Lprenotuser_pull: -/* - * Now previous mode spsr and r14. - */ - ldr r1, [sp, #(17*4)] /* spsr */ - ldr r2, [sp, #(14*4)] /* r14 */ - orr r0, r0, #(I32_bit) - msr cpsr_all, r0 /* switch to previous mode */ - msr spsr_all, r1 - mov r14, r2 - msr cpsr_all, r7 /* back to undefined mode */ -/* - * Now r8-r13. - */ - add r8, sp, #(8*4) - ldmia r8, {r1-r6} /* r8-r13 */ - msr cpsr_all, r0 - mov r8, r1 - mov r9, r2 - mov r10, r3 - mov r11, r4 - mov r12, r5 - mov r13, r6 - msr cpsr_all, r7 -.Lpull_r0r7: -/* - * Now the rest of the registers. - */ - ldr r1,Lipkdb_trap_return - ldr r0,[r1] - tst r0,r0 - ldmfd sp!, {r0-r7} /* r0-r7 */ - add sp, sp, #(10*4) /* adjust sp */ - -/* - * Did IPKDB handle it? - */ - movnes pc, lr /* return */ - -#endif stmfd sp!, {r0, r1} ldr r0, Lundefined_handler_indirection ldr r1, [sp], #0x0004 @@ -330,10 +214,6 @@ str r1, [r0, #0x0004] ldmia r0, {r0, r1, pc} -#ifdef IPKDB -Lipkdb_trap_return: - .word Lipkdb_trap_return_data -#endif Lundefined_handler_indirection: .word Lundefined_handler_indirection_data ==== //depot/projects/smpng/sys/arm/arm/genassym.c#4 (text+ko) ==== @@ -26,12 +26,11 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/arm/arm/genassym.c,v 1.3 2004/11/12 21:49:05 cognet Exp $"); +__FBSDID("$FreeBSD: src/sys/arm/arm/genassym.c,v 1.4 2004/11/20 02:30:59 das Exp $"); #include <sys/param.h> #include <sys/systm.h> #include <sys/assym.h> #include <sys/proc.h> -#include <sys/user.h> #include <sys/mbuf.h> #include <sys/vmmeter.h> #include <vm/vm.h> @@ -42,6 +41,7 @@ #include <machine/cpu.h> #include <machine/proc.h> #include <machine/cpufunc.h> +#include <machine/pcb.h> #include <machine/pte.h> #include <machine/intr.h> #include <netinet/in.h> @@ -94,7 +94,6 @@ ASSYM(TF_R0, offsetof(struct trapframe, tf_r0)); ASSYM(TF_R1, offsetof(struct trapframe, tf_r1)); ASSYM(TF_PC, offsetof(struct trapframe, tf_pc)); -ASSYM(P_UAREA, offsetof(struct proc, p_uarea)); ASSYM(P_PID, offsetof(struct proc, p_pid)); ASSYM(P_FLAG, offsetof(struct proc, p_flag)); @@ -105,7 +104,6 @@ #endif ASSYM(TDF_ASTPENDING, TDF_ASTPENDING); ASSYM(TDF_NEEDRESCHED, TDF_NEEDRESCHED); -ASSYM(USER_SIZE, sizeof(struct user)); ASSYM(P_TRACED, P_TRACED); ASSYM(P_SIGEVENT, P_SIGEVENT); ASSYM(P_PROFIL, P_PROFIL); ==== //depot/projects/smpng/sys/arm/arm/swtch.S#5 (text+ko) ==== >>> TRUNCATED FOR MAIL (1000 lines) <<<
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200411222002.iAMK2BwX069256>