From owner-p4-projects@FreeBSD.ORG Wed Sep 24 21:12:18 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id C7E7216A4C0; Wed, 24 Sep 2003 21:12:17 -0700 (PDT) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A1D8516A4B3 for ; Wed, 24 Sep 2003 21:12:17 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3CE9C43F3F for ; Wed, 24 Sep 2003 21:12:16 -0700 (PDT) (envelope-from marcel@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.9/8.12.9) with ESMTP id h8P4CGXJ053125 for ; Wed, 24 Sep 2003 21:12:16 -0700 (PDT) (envelope-from marcel@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.9/8.12.9/Submit) id h8P4CFIu053122 for perforce@freebsd.org; Wed, 24 Sep 2003 21:12:15 -0700 (PDT) (envelope-from marcel@freebsd.org) Date: Wed, 24 Sep 2003 21:12:15 -0700 (PDT) Message-Id: <200309250412.h8P4CFIu053122@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to marcel@freebsd.org using -f From: Marcel Moolenaar To: Perforce Change Reviews Subject: PERFORCE change 38556 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Sep 2003 04:12:18 -0000 http://perforce.freebsd.org/chv.cgi?CH=38556 Change 38556 by marcel@marcel_nfs on 2003/09/24 21:12:09 IFC @38553 Affected files ... .. //depot/projects/uart/alpha/alpha/elf_machdep.c#3 integrate .. //depot/projects/uart/alpha/include/bus.h#4 integrate .. //depot/projects/uart/alpha/include/elf.h#2 integrate .. //depot/projects/uart/alpha/linux/linux_sysvec.c#3 integrate .. //depot/projects/uart/alpha/osf1/osf1_sysvec.c#3 integrate .. //depot/projects/uart/amd64/acpica/acpi_machdep.c#4 integrate .. //depot/projects/uart/amd64/amd64/busdma_machdep.c#5 integrate .. //depot/projects/uart/amd64/amd64/elf_machdep.c#4 integrate .. //depot/projects/uart/amd64/amd64/exception.S#3 integrate .. //depot/projects/uart/amd64/amd64/machdep.c#6 integrate .. //depot/projects/uart/amd64/amd64/trap.c#3 integrate .. //depot/projects/uart/amd64/amd64/tsc.c#3 integrate .. //depot/projects/uart/amd64/ia32/ia32_syscall.c#4 integrate .. //depot/projects/uart/amd64/include/acpica_machdep.h#2 integrate .. //depot/projects/uart/amd64/include/bus_amd64.h#2 integrate .. //depot/projects/uart/amd64/include/clock.h#2 integrate .. //depot/projects/uart/amd64/include/cpu.h#3 integrate .. //depot/projects/uart/amd64/include/elf.h#2 integrate .. //depot/projects/uart/amd64/include/endian.h#2 integrate .. //depot/projects/uart/amd64/include/legacyvar.h#2 integrate .. //depot/projects/uart/amd64/include/md_var.h#3 integrate .. //depot/projects/uart/amd64/include/pci_cfgreg.h#2 integrate .. //depot/projects/uart/amd64/include/segments.h#2 integrate .. //depot/projects/uart/amd64/include/specialreg.h#2 integrate .. //depot/projects/uart/amd64/include/vmparam.h#3 integrate .. //depot/projects/uart/amd64/isa/clock.c#3 integrate .. //depot/projects/uart/amd64/pci/pci_bus.c#5 integrate .. //depot/projects/uart/arm/include/elf.h#2 integrate .. //depot/projects/uart/cam/cam_periph.c#3 integrate .. //depot/projects/uart/cam/scsi/scsi_all.c#2 integrate .. //depot/projects/uart/compat/ia32/ia32_sysvec.c#2 integrate .. //depot/projects/uart/compat/ia32/ia32_util.h#2 integrate .. //depot/projects/uart/compat/linprocfs/linprocfs.c#6 integrate .. //depot/projects/uart/compat/pecoff/imgact_pecoff.c#2 integrate .. //depot/projects/uart/compat/svr4/svr4_sysvec.c#2 integrate .. //depot/projects/uart/conf/files.ia64#9 integrate .. //depot/projects/uart/contrib/ipfilter/netinet/ip_fil.c#2 integrate .. //depot/projects/uart/dev/acpica/acpi_button.c#4 integrate .. //depot/projects/uart/dev/ata/ata-lowlevel.c#9 integrate .. //depot/projects/uart/dev/ata/atapi-cam.c#7 integrate .. //depot/projects/uart/dev/ata/atapi-cd.c#8 integrate .. //depot/projects/uart/dev/ata/atapi-cd.h#5 integrate .. //depot/projects/uart/dev/bge/if_bge.c#10 integrate .. //depot/projects/uart/dev/ed/if_ed_pccard.c#6 integrate .. //depot/projects/uart/dev/em/if_em.c#5 integrate .. //depot/projects/uart/dev/em/if_em.h#7 integrate .. //depot/projects/uart/dev/exca/exca.c#5 integrate .. //depot/projects/uart/dev/ips/ips_disk.c#3 integrate .. //depot/projects/uart/dev/mii/e1000phy.c#3 integrate .. //depot/projects/uart/dev/mii/e1000phyreg.h#2 integrate .. //depot/projects/uart/dev/mii/miidevs#4 integrate .. //depot/projects/uart/dev/pccard/pccarddevs#9 integrate .. //depot/projects/uart/dev/pccard/pccarddevs.h#9 integrate .. //depot/projects/uart/dev/pccard/pccardvar.h#3 integrate .. //depot/projects/uart/dev/re/if_re.c#5 integrate .. //depot/projects/uart/dev/uart/uart.h#6 integrate .. //depot/projects/uart/dev/uart/uart_bus_pccard.c#3 integrate .. //depot/projects/uart/dev/uart/uart_core.c#31 integrate .. //depot/projects/uart/dev/uart/uart_cpu.h#12 integrate .. //depot/projects/uart/dev/uart/uart_cpu_alpha.c#7 integrate .. //depot/projects/uart/dev/uart/uart_cpu_amd64.c#5 integrate .. //depot/projects/uart/dev/uart/uart_cpu_i386.c#6 integrate .. //depot/projects/uart/dev/uart/uart_cpu_ia64.c#6 integrate .. //depot/projects/uart/dev/uart/uart_cpu_pc98.c#5 integrate .. //depot/projects/uart/dev/uart/uart_cpu_sparc64.c#15 integrate .. //depot/projects/uart/dev/uart/uart_dev_sab82532.c#30 integrate .. //depot/projects/uart/dev/uart/uart_dev_z8530.c#16 integrate .. //depot/projects/uart/dev/usb/umass.c#6 integrate .. //depot/projects/uart/dev/usb/usbdevs#7 integrate .. //depot/projects/uart/dev/usb/usbdevs.h#6 integrate .. //depot/projects/uart/dev/usb/usbdevs_data.h#6 integrate .. //depot/projects/uart/dev/wi/if_wi_pccard.c#10 integrate .. //depot/projects/uart/geom/geom_disk.c#3 integrate .. //depot/projects/uart/i386/acpica/acpi_wakeup.c#7 integrate .. //depot/projects/uart/i386/i386/elf_machdep.c#4 integrate .. //depot/projects/uart/i386/i386/pmap.c#18 integrate .. //depot/projects/uart/i386/ibcs2/ibcs2_sysvec.c#2 integrate .. //depot/projects/uart/i386/include/bus_at386.h#2 integrate .. //depot/projects/uart/i386/include/bus_pc98.h#2 integrate .. //depot/projects/uart/i386/include/clock.h#4 integrate .. //depot/projects/uart/i386/include/elf.h#2 integrate .. //depot/projects/uart/i386/include/endian.h#3 integrate .. //depot/projects/uart/i386/include/pmap.h#2 integrate .. //depot/projects/uart/i386/isa/clock.c#6 integrate .. //depot/projects/uart/i386/linux/linux_sysvec.c#2 integrate .. //depot/projects/uart/ia64/ia32/ia32_sysvec.c#3 integrate .. //depot/projects/uart/ia64/ia64/elf_machdep.c#4 integrate .. //depot/projects/uart/ia64/ia64/machdep.c#13 integrate .. //depot/projects/uart/ia64/ia64/pmap.c#11 integrate .. //depot/projects/uart/ia64/ia64/uma_machdep.c#1 branch .. //depot/projects/uart/ia64/include/bus.h#4 integrate .. //depot/projects/uart/ia64/include/elf.h#2 integrate .. //depot/projects/uart/kern/imgact_aout.c#2 integrate .. //depot/projects/uart/kern/imgact_elf.c#2 integrate .. //depot/projects/uart/kern/init_main.c#4 integrate .. //depot/projects/uart/kern/kern_exec.c#3 integrate .. //depot/projects/uart/kern/kern_linker.c#3 integrate .. //depot/projects/uart/kern/linker_if.m#2 integrate .. //depot/projects/uart/kern/vfs_bio.c#7 integrate .. //depot/projects/uart/modules/bridge/Makefile#2 integrate .. //depot/projects/uart/modules/ipfilter/Makefile#2 integrate .. //depot/projects/uart/net/bridge.c#4 integrate .. //depot/projects/uart/net/pfil.c#2 integrate .. //depot/projects/uart/net/pfil.h#2 integrate .. //depot/projects/uart/net/radix.c#2 integrate .. //depot/projects/uart/netinet/if_ether.c#2 integrate .. //depot/projects/uart/netinet/ip_input.c#4 integrate .. //depot/projects/uart/netinet/ip_output.c#6 integrate .. //depot/projects/uart/netinet/ip_var.h#4 integrate .. //depot/projects/uart/netinet6/ip6_forward.c#2 integrate .. //depot/projects/uart/netinet6/ip6_input.c#2 integrate .. //depot/projects/uart/netinet6/ip6_output.c#2 integrate .. //depot/projects/uart/netinet6/ip6_var.h#2 integrate .. //depot/projects/uart/netinet6/ip6protosw.h#2 integrate .. //depot/projects/uart/pc98/i386/busiosubr.c#2 integrate .. //depot/projects/uart/pci/if_sk.c#4 integrate .. //depot/projects/uart/pci/if_skreg.h#2 integrate .. //depot/projects/uart/pci/yukonreg.h#1 branch .. //depot/projects/uart/powerpc/include/elf.h#2 integrate .. //depot/projects/uart/powerpc/include/param.h#3 integrate .. //depot/projects/uart/powerpc/powermac/ata_macio.c#2 integrate .. //depot/projects/uart/powerpc/powerpc/elf_machdep.c#3 integrate .. //depot/projects/uart/powerpc/powerpc/pmap.c#7 integrate .. //depot/projects/uart/powerpc/psim/ata_iobus.c#2 integrate .. //depot/projects/uart/sparc64/include/bus.h#5 integrate .. //depot/projects/uart/sparc64/include/elf.h#3 integrate .. //depot/projects/uart/sparc64/sparc64/elf_machdep.c#3 integrate .. //depot/projects/uart/sparc64/sparc64/pmap.c#9 integrate .. //depot/projects/uart/sys/kobj.h#2 integrate .. //depot/projects/uart/sys/param.h#9 integrate .. //depot/projects/uart/sys/protosw.h#2 integrate .. //depot/projects/uart/sys/sysent.h#2 integrate .. //depot/projects/uart/vm/uma_core.c#11 integrate .. //depot/projects/uart/vm/vm_map.c#9 integrate .. //depot/projects/uart/vm/vm_mmap.c#5 integrate .. //depot/projects/uart/vm/vm_page.c#6 integrate Differences ... ==== //depot/projects/uart/alpha/alpha/elf_machdep.c#3 (text+ko) ==== @@ -24,7 +24,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/alpha/alpha/elf_machdep.c,v 1.15 2003/08/17 08:08:38 gordon Exp $"); +__FBSDID("$FreeBSD: src/sys/alpha/alpha/elf_machdep.c,v 1.16 2003/09/25 01:10:22 peter Exp $"); #include #include @@ -73,7 +73,8 @@ PS_STRINGS, VM_PROT_ALL, exec_copyout_strings, - exec_setregs + exec_setregs, + NULL }; static Elf64_Brandinfo freebsd_brand_info = { ==== //depot/projects/uart/alpha/include/bus.h#4 (text+ko) ==== @@ -67,7 +67,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* $FreeBSD: src/sys/alpha/include/bus.h,v 1.23 2003/07/27 13:52:09 mux Exp $ */ +/* $FreeBSD: src/sys/alpha/include/bus.h,v 1.24 2003/09/23 08:22:33 nyan Exp $ */ #ifndef _ALPHA_BUS_H_ #define _ALPHA_BUS_H_ @@ -91,6 +91,24 @@ #define BUS_SPACE_UNRESTRICTED (~0UL) /* + * Map a region of device bus space into CPU virtual address space. + */ + +static __inline int bus_space_map(bus_space_tag_t t, bus_addr_t addr, + bus_size_t size, int flags, + bus_space_handle_t *bshp); + +static __inline int +bus_space_map(bus_space_tag_t t __unused, bus_addr_t addr, + bus_size_t size __unused, int flags __unused, + bus_space_handle_t *bshp) +{ + + *bshp = addr; + return (0); +} + +/* * Unmap a region of device bus space. */ ==== //depot/projects/uart/alpha/include/elf.h#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/alpha/include/elf.h,v 1.13 2002/05/30 08:32:18 dfr Exp $ + * $FreeBSD: src/sys/alpha/include/elf.h,v 1.14 2003/09/25 01:10:22 peter Exp $ */ #ifndef _MACHINE_ELF_H_ @@ -135,16 +135,4 @@ #define ELF_TARG_MACH EM_ALPHA #define ELF_TARG_VER 1 -#ifdef _KERNEL - -/* - * On the Alpha we load the dynamic linker where a userland call - * to mmap(0, ...) would put it. The rationale behind this - * calculation is that it leaves room for the heap to grow to - * its maximum allowed size. - */ -#define ELF_RTLD_ADDR(vmspace) \ - (round_page((vm_offset_t)(vmspace)->vm_daddr + maxdsiz)) - -#endif #endif /* !_MACHINE_ELF_H_ */ ==== //depot/projects/uart/alpha/linux/linux_sysvec.c#3 (text+ko) ==== @@ -27,7 +27,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/alpha/linux/linux_sysvec.c,v 1.90 2003/08/22 07:20:26 imp Exp $"); +__FBSDID("$FreeBSD: src/sys/alpha/linux/linux_sysvec.c,v 1.91 2003/09/25 01:10:22 peter Exp $"); /* XXX we use functions that might not exist. */ #include "opt_compat.h" @@ -200,7 +200,8 @@ PS_STRINGS, VM_PROT_ALL, exec_copyout_strings, - exec_setregs + exec_setregs, + NULL }; static Elf64_Brandinfo linux_brand = { ==== //depot/projects/uart/alpha/osf1/osf1_sysvec.c#3 (text+ko) ==== @@ -30,7 +30,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/alpha/osf1/osf1_sysvec.c,v 1.10 2003/08/22 07:20:27 imp Exp $"); +__FBSDID("$FreeBSD: src/sys/alpha/osf1/osf1_sysvec.c,v 1.11 2003/09/25 01:10:22 peter Exp $"); /* XXX we use functions that might not exist. */ #include "opt_compat.h" @@ -87,7 +87,8 @@ PS_STRINGS, VM_PROT_ALL, exec_copyout_strings, - exec_setregs + exec_setregs, + NULL }; /* ==== //depot/projects/uart/amd64/acpica/acpi_machdep.c#4 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/amd64/acpica/acpi_machdep.c,v 1.11 2003/08/28 16:30:31 njl Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/acpica/acpi_machdep.c,v 1.12 2003/09/22 22:12:46 peter Exp $"); #include #include @@ -33,6 +33,8 @@ #include "acpi.h" #include +static int intr_model = ACPI_INTR_PIC; + int acpi_machdep_init(device_t dev) { @@ -43,5 +45,15 @@ acpi_install_wakeup_handler(sc); + if (intr_model != ACPI_INTR_PIC) + acpi_SetIntrModel(intr_model); + return (0); } + +void +acpi_SetDefaultIntrModel(int model) +{ + + intr_model = model; +} ==== //depot/projects/uart/amd64/amd64/busdma_machdep.c#5 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/amd64/amd64/busdma_machdep.c,v 1.51 2003/08/04 23:40:35 scottl Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/amd64/busdma_machdep.c,v 1.54 2003/09/22 23:11:42 peter Exp $"); #include #include @@ -65,6 +65,7 @@ int map_count; bus_dma_lock_t *lockfunc; void *lockfuncarg; + bus_dma_segment_t *segments; }; struct bounce_page { @@ -169,11 +170,7 @@ static void dflt_lock(void *arg, bus_dma_lock_op_t op) { -#ifdef INVARIANTS panic("driver error: busdma dflt_lock called"); -#else - printf("DRIVER_ERROR: busdma dflt_lock called\n"); -#endif } #define BUS_DMA_MIN_ALLOC_COMP BUS_DMA_BUS4 @@ -219,7 +216,8 @@ newtag->lockfunc = dflt_lock; newtag->lockfuncarg = NULL; } - + newtag->segments = NULL; + /* Take into account any restrictions imposed by our parent tag */ if (parent != NULL) { newtag->lowaddr = MIN(parent->lowaddr, newtag->lowaddr); @@ -289,6 +287,8 @@ parent = dmat->parent; atomic_subtract_int(&dmat->ref_count, 1); if (dmat->ref_count == 0) { + if (dmat->segments != NULL) + free(dmat->segments, M_DEVBUF); free(dmat, M_DEVBUF); /* * Last reference count, so @@ -314,6 +314,14 @@ error = 0; + if (dmat->segments == NULL) { + dmat->segments = (bus_dma_segment_t *)malloc( + sizeof(bus_dma_segment_t) * dmat->nsegments, M_DEVBUF, + M_NOWAIT); + if (dmat->segments == NULL) + return (ENOMEM); + } + if (dmat->lowaddr < ptoa((vm_paddr_t)Maxmem)) { /* Must bounce */ int maxpages; @@ -402,6 +410,14 @@ /* If we succeed, no mapping/bouncing will be required */ *mapp = NULL; + if (dmat->segments == NULL) { + dmat->segments = (bus_dma_segment_t *)malloc( + sizeof(bus_dma_segment_t) * dmat->nsegments, M_DEVBUF, + M_NOWAIT); + if (dmat->segments == NULL) + return (ENOMEM); + } + if ((dmat->maxsize <= PAGE_SIZE) && dmat->lowaddr >= ptoa((vm_paddr_t)Maxmem)) { *vaddr = malloc(dmat->maxsize, M_DEVBUF, mflags); @@ -452,7 +468,6 @@ static int _bus_dmamap_load_buffer(bus_dma_tag_t dmat, bus_dmamap_t map, - bus_dma_segment_t segs[], void *buf, bus_size_t buflen, struct thread *td, int flags, @@ -460,6 +475,7 @@ int *segp, int first) { + bus_dma_segment_t *segs; bus_size_t sgsize; bus_addr_t curaddr, lastaddr, baddr, bmask; vm_offset_t vaddr; @@ -468,6 +484,8 @@ int seg; pmap_t pmap; + segs = dmat->segments; + if (map == NULL) map = &nobounce_dmamap; @@ -589,8 +607,6 @@ return (buflen != 0 ? EFBIG : 0); /* XXX better return value here? */ } -#define BUS_DMAMAP_NSEGS ((64 * 1024) / PAGE_SIZE + 1) - /* * Map the buffer buf into bus space using the dmamap map. */ @@ -599,11 +615,6 @@ bus_size_t buflen, bus_dmamap_callback_t *callback, void *callback_arg, int flags) { -#ifdef __GNUC__ - bus_dma_segment_t dm_segments[dmat->nsegments]; -#else - bus_dma_segment_t dm_segments[BUS_DMAMAP_NSEGS]; -#endif bus_addr_t lastaddr = 0; int error, nsegs = 0; @@ -613,16 +624,16 @@ map->callback_arg = callback_arg; } - error = _bus_dmamap_load_buffer(dmat, map, dm_segments, buf, buflen, - NULL, flags, &lastaddr, &nsegs, 1); + error = _bus_dmamap_load_buffer(dmat, map, buf, buflen, NULL, flags, + &lastaddr, &nsegs, 1); if (error == EINPROGRESS) return (error); if (error) - (*callback)(callback_arg, dm_segments, 0, error); + (*callback)(callback_arg, dmat->segments, 0, error); else - (*callback)(callback_arg, dm_segments, nsegs + 1, 0); + (*callback)(callback_arg, dmat->segments, nsegs + 1, 0); return (0); } @@ -637,11 +648,6 @@ bus_dmamap_callback2_t *callback, void *callback_arg, int flags) { -#ifdef __GNUC__ - bus_dma_segment_t dm_segments[dmat->nsegments]; -#else - bus_dma_segment_t dm_segments[BUS_DMAMAP_NSEGS]; -#endif int nsegs, error; M_ASSERTPKTHDR(m0); @@ -657,7 +663,6 @@ for (m = m0; m != NULL && error == 0; m = m->m_next) { if (m->m_len > 0) { error = _bus_dmamap_load_buffer(dmat, map, - dm_segments, m->m_data, m->m_len, NULL, flags, &lastaddr, &nsegs, first); @@ -670,9 +675,9 @@ if (error) { /* force "no valid mappings" in callback */ - (*callback)(callback_arg, dm_segments, 0, 0, error); + (*callback)(callback_arg, dmat->segments, 0, 0, error); } else { - (*callback)(callback_arg, dm_segments, + (*callback)(callback_arg, dmat->segments, nsegs+1, m0->m_pkthdr.len, error); } return (error); @@ -688,11 +693,6 @@ int flags) { bus_addr_t lastaddr; -#ifdef __GNUC__ - bus_dma_segment_t dm_segments[dmat->nsegments]; -#else - bus_dma_segment_t dm_segments[BUS_DMAMAP_NSEGS]; -#endif int nsegs, error, first, i; bus_size_t resid; struct iovec *iov; @@ -722,7 +722,6 @@ if (minlen > 0) { error = _bus_dmamap_load_buffer(dmat, map, - dm_segments, addr, minlen, td, flags, &lastaddr, &nsegs, first); first = 0; @@ -733,9 +732,9 @@ if (error) { /* force "no valid mappings" in callback */ - (*callback)(callback_arg, dm_segments, 0, 0, error); + (*callback)(callback_arg, dmat->segments, 0, 0, error); } else { - (*callback)(callback_arg, dm_segments, + (*callback)(callback_arg, dmat->segments, nsegs+1, uio->uio_resid, error); } return (error); ==== //depot/projects/uart/amd64/amd64/elf_machdep.c#4 (text+ko) ==== @@ -24,7 +24,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/amd64/amd64/elf_machdep.c,v 1.17 2003/08/17 08:08:38 gordon Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/amd64/elf_machdep.c,v 1.18 2003/09/25 01:10:23 peter Exp $"); #include #include @@ -70,7 +70,8 @@ PS_STRINGS, VM_PROT_ALL, exec_copyout_strings, - exec_setregs + exec_setregs, + NULL }; static Elf64_Brandinfo freebsd_brand_info = { ==== //depot/projects/uart/amd64/amd64/exception.S#3 (text+ko) ==== @@ -31,7 +31,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/amd64/amd64/exception.S,v 1.111 2003/09/09 19:32:09 peter Exp $ + * $FreeBSD: src/sys/amd64/amd64/exception.S,v 1.112 2003/09/22 22:54:14 peter Exp $ */ #include @@ -332,7 +332,7 @@ doreti_ast: /* * Check for ASTs atomically with returning. Disabling CPU - * interrupts provides sufficient locking evein the SMP case, + * interrupts provides sufficient locking eve in the SMP case, * since we will be informed of any new ASTs by an IPI. */ cli ==== //depot/projects/uart/amd64/amd64/machdep.c#6 (text+ko) ==== @@ -38,7 +38,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/amd64/amd64/machdep.c,v 1.589 2003/09/09 19:32:09 peter Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/amd64/machdep.c,v 1.593 2003/09/23 00:45:55 peter Exp $"); #include "opt_atalk.h" #include "opt_compat.h" @@ -756,6 +756,8 @@ u_int32_t type; } __packed; +u_int basemem; + /* * Populate the (physmap) array with base/bound pairs describing the * available physical memory in the system, then test this memory and @@ -773,7 +775,7 @@ getmemsize(caddr_t kmdp, u_int64_t first) { int i, physmap_idx, pa_indx; - u_int basemem, extmem; + u_int extmem; vm_paddr_t pa, physmap[PHYSMAP_SIZE]; pt_entry_t *pte; char *cp; @@ -1166,32 +1168,31 @@ * under witness. */ mutex_init(); - mtx_init(&clock_lock, "clk", NULL, MTX_SPIN | MTX_RECURSE); + mtx_init(&clock_lock, "clk", NULL, MTX_SPIN); mtx_init(&icu_lock, "icu", NULL, MTX_SPIN | MTX_NOWITNESS); /* exceptions */ for (x = 0; x < NIDT; x++) setidt(x, &IDTVEC(rsvd), SDT_SYSIGT, SEL_KPL, 0); - setidt(0, &IDTVEC(div), SDT_SYSIGT, SEL_KPL, 0); - setidt(1, &IDTVEC(dbg), SDT_SYSIGT, SEL_KPL, 0); - setidt(2, &IDTVEC(nmi), SDT_SYSIGT, SEL_KPL, 0); - setidt(3, &IDTVEC(bpt), SDT_SYSIGT, SEL_UPL, 0); - setidt(4, &IDTVEC(ofl), SDT_SYSIGT, SEL_KPL, 0); - setidt(5, &IDTVEC(bnd), SDT_SYSIGT, SEL_KPL, 0); - setidt(6, &IDTVEC(ill), SDT_SYSIGT, SEL_KPL, 0); - setidt(7, &IDTVEC(dna), SDT_SYSIGT, SEL_KPL, 0); - setidt(8, &IDTVEC(dblfault), SDT_SYSIGT, SEL_KPL, 1); - setidt(9, &IDTVEC(fpusegm), SDT_SYSIGT, SEL_KPL, 0); - setidt(10, &IDTVEC(tss), SDT_SYSIGT, SEL_KPL, 0); - setidt(11, &IDTVEC(missing), SDT_SYSIGT, SEL_KPL, 0); - setidt(12, &IDTVEC(stk), SDT_SYSIGT, SEL_KPL, 0); - setidt(13, &IDTVEC(prot), SDT_SYSIGT, SEL_KPL, 0); - setidt(14, &IDTVEC(page), SDT_SYSIGT, SEL_KPL, 0); - setidt(15, &IDTVEC(rsvd), SDT_SYSIGT, SEL_KPL, 0); - setidt(16, &IDTVEC(fpu), SDT_SYSIGT, SEL_KPL, 0); - setidt(17, &IDTVEC(align), SDT_SYSIGT, SEL_KPL, 0); - setidt(18, &IDTVEC(mchk), SDT_SYSIGT, SEL_KPL, 0); - setidt(19, &IDTVEC(xmm), SDT_SYSIGT, SEL_KPL, 0); + setidt(IDT_DE, &IDTVEC(div), SDT_SYSIGT, SEL_KPL, 0); + setidt(IDT_DB, &IDTVEC(dbg), SDT_SYSIGT, SEL_KPL, 0); + setidt(IDT_NMI, &IDTVEC(nmi), SDT_SYSIGT, SEL_KPL, 0); + setidt(IDT_BP, &IDTVEC(bpt), SDT_SYSIGT, SEL_UPL, 0); + setidt(IDT_OF, &IDTVEC(ofl), SDT_SYSIGT, SEL_KPL, 0); + setidt(IDT_BR, &IDTVEC(bnd), SDT_SYSIGT, SEL_KPL, 0); + setidt(IDT_UD, &IDTVEC(ill), SDT_SYSIGT, SEL_KPL, 0); + setidt(IDT_NM, &IDTVEC(dna), SDT_SYSIGT, SEL_KPL, 0); + setidt(IDT_DF, &IDTVEC(dblfault), SDT_SYSIGT, SEL_KPL, 1); + setidt(IDT_FPUGP, &IDTVEC(fpusegm), SDT_SYSIGT, SEL_KPL, 0); + setidt(IDT_TS, &IDTVEC(tss), SDT_SYSIGT, SEL_KPL, 0); + setidt(IDT_NP, &IDTVEC(missing), SDT_SYSIGT, SEL_KPL, 0); + setidt(IDT_SS, &IDTVEC(stk), SDT_SYSIGT, SEL_KPL, 0); + setidt(IDT_GP, &IDTVEC(prot), SDT_SYSIGT, SEL_KPL, 0); + setidt(IDT_PF, &IDTVEC(page), SDT_SYSIGT, SEL_KPL, 0); + setidt(IDT_MF, &IDTVEC(fpu), SDT_SYSIGT, SEL_KPL, 0); + setidt(IDT_AC, &IDTVEC(align), SDT_SYSIGT, SEL_KPL, 0); + setidt(IDT_MC, &IDTVEC(mchk), SDT_SYSIGT, SEL_KPL, 0); + setidt(IDT_XF, &IDTVEC(xmm), SDT_SYSIGT, SEL_KPL, 0); r_idt.rd_limit = sizeof(idt0) - 1; r_idt.rd_base = (long) idt; ==== //depot/projects/uart/amd64/amd64/trap.c#3 (text+ko) ==== @@ -38,7 +38,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/amd64/amd64/trap.c,v 1.262 2003/07/25 21:15:44 obrien Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/amd64/trap.c,v 1.264 2003/09/22 22:52:46 peter Exp $"); /* * AMD64 Trap and System call handling @@ -88,8 +88,6 @@ #include -#include - extern void trap(struct trapframe frame); extern void syscall(struct trapframe frame); @@ -239,6 +237,7 @@ case T_BPTFLT: /* bpt instruction fault */ case T_TRCTRAP: /* trace trap */ + enable_intr(); frame.tf_rflags &= ~PSL_T; i = SIGTRAP; break; ==== //depot/projects/uart/amd64/amd64/tsc.c#3 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/amd64/amd64/tsc.c,v 1.201 2003/07/25 21:15:44 obrien Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/amd64/tsc.c,v 1.203 2003/09/23 00:18:45 peter Exp $"); #include "opt_clock.h" @@ -43,7 +43,6 @@ uint64_t tsc_freq; int tsc_is_broken; -u_int tsc_present = 1; #ifdef SMP static int smp_tsc; @@ -59,7 +58,8 @@ 0, /* no poll_pps */ ~0u, /* counter_mask */ 0, /* frequency */ - "TSC" /* name */ + "TSC", /* name */ + 800, /* quality (adjusted in code) */ }; void @@ -78,12 +78,17 @@ if (bootverbose) printf("TSC clock: %lu Hz\n", tsc_freq); + return; +} + +void +init_TSC_tc(void) +{ + if (tsc_freq != 0 && !tsc_is_broken) { tsc_timecounter.tc_frequency = tsc_freq; tc_init(&tsc_timecounter); } - - return; } static int ==== //depot/projects/uart/amd64/ia32/ia32_syscall.c#4 (text+ko) ==== @@ -36,7 +36,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/amd64/ia32/ia32_syscall.c,v 1.4 2003/08/23 00:04:53 peter Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/ia32/ia32_syscall.c,v 1.5 2003/09/22 22:09:02 peter Exp $"); /* * 386 Trap and System call handling @@ -263,14 +263,14 @@ ia32_syscall_enable(void *dummy) { - setidt(0x80, &IDTVEC(int0x80_syscall), SDT_SYSIGT, SEL_UPL, 0); + setidt(IDT_SYSCALL, &IDTVEC(int0x80_syscall), SDT_SYSIGT, SEL_UPL, 0); } static void ia32_syscall_disable(void *dummy) { - setidt(0x80, &IDTVEC(rsvd), SDT_SYSIGT, SEL_KPL, 0); + setidt(IDT_SYSCALL, &IDTVEC(rsvd), SDT_SYSIGT, SEL_KPL, 0); } SYSINIT(ia32_syscall, SI_SUB_EXEC, SI_ORDER_ANY, ia32_syscall_enable, NULL); ==== //depot/projects/uart/amd64/include/acpica_machdep.h#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/amd64/include/acpica_machdep.h,v 1.2 2003/05/31 06:43:55 peter Exp $ + * $FreeBSD: src/sys/amd64/include/acpica_machdep.h,v 1.3 2003/09/22 22:12:46 peter Exp $ */ /****************************************************************************** @@ -103,4 +103,6 @@ #define COMPILER_DEPENDENT_INT64 long #define COMPILER_DEPENDENT_UINT64 unsigned long +void acpi_SetDefaultIntrModel(int model); + #endif /* __ACPICA_MACHDEP_H__ */ ==== //depot/projects/uart/amd64/include/bus_amd64.h#2 (text+ko) ==== @@ -67,7 +67,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* $FreeBSD: src/sys/amd64/include/bus_amd64.h,v 1.25 2003/05/23 05:04:54 peter Exp $ */ +/* $FreeBSD: src/sys/amd64/include/bus_amd64.h,v 1.26 2003/09/23 08:22:33 nyan Exp $ */ #ifndef _AMD64_BUS_AMD64_H_ #define _AMD64_BUS_AMD64_H_ @@ -114,11 +114,19 @@ * Map a region of device bus space into CPU virtual address space. */ -#define BUS_SPACE_MAP_CACHEABLE 0x01 -#define BUS_SPACE_MAP_LINEAR 0x02 +static __inline int bus_space_map(bus_space_tag_t t, bus_addr_t addr, + bus_size_t size, int flags, + bus_space_handle_t *bshp); + +static __inline int +bus_space_map(bus_space_tag_t t __unused, bus_addr_t addr, + bus_size_t size __unused, int flags __unused, + bus_space_handle_t *bshp) +{ -int bus_space_map(bus_space_tag_t t, bus_addr_t addr, bus_size_t size, - int flags, bus_space_handle_t *bshp); + *bshp = addr; + return (0); +} /* * Unmap a region of device bus space. ==== //depot/projects/uart/amd64/include/clock.h#2 (text+ko) ==== @@ -3,7 +3,7 @@ * Garrett Wollman, September 1994. * This file is in the public domain. * - * $FreeBSD: src/sys/amd64/include/clock.h,v 1.45 2003/05/01 01:05:23 peter Exp $ + * $FreeBSD: src/sys/amd64/include/clock.h,v 1.46 2003/09/22 23:02:24 peter Exp $ */ #ifndef _MACHINE_CLOCK_H_ @@ -37,6 +37,7 @@ int rtcin(int val); int sysbeep(int pitch, int period); void init_TSC(void); +void init_TSC_tc(void); #endif /* _KERNEL */ ==== //depot/projects/uart/amd64/include/cpu.h#3 (text+ko) ==== @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * from: @(#)cpu.h 5.4 (Berkeley) 5/9/91 - * $FreeBSD: src/sys/amd64/include/cpu.h,v 1.69 2003/08/16 16:57:56 marcel Exp $ + * $FreeBSD: src/sys/amd64/include/cpu.h,v 1.70 2003/09/23 00:18:45 peter Exp $ */ #ifndef _MACHINE_CPU_H_ @@ -78,7 +78,6 @@ #ifdef _KERNEL extern char btext[]; extern char etext[]; -extern u_int tsc_present; void cpu_halt(void); void cpu_reset(void); ==== //depot/projects/uart/amd64/include/elf.h#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/amd64/include/elf.h,v 1.15 2003/05/14 04:10:49 peter Exp $ + * $FreeBSD: src/sys/amd64/include/elf.h,v 1.16 2003/09/25 01:10:23 peter Exp $ */ #ifndef _MACHINE_ELF_H_ @@ -137,16 +137,4 @@ #define ELF_TARG_MACH EM_X86_64 #define ELF_TARG_VER 1 -#ifdef _KERNEL - -/* - * On the i386 we load the dynamic linker where a userland call - * to mmap(0, ...) would put it. The rationale behind this - * calculation is that it leaves room for the heap to grow to - * its maximum allowed size. - */ -#define ELF_RTLD_ADDR(vmspace) \ - (round_page((vm_offset_t)(vmspace)->vm_daddr + maxdsiz)) - -#endif /* _KERNEL */ #endif /* !_MACHINE_ELF_H_ */ ==== //depot/projects/uart/amd64/include/endian.h#2 (text+ko) ==== @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)endian.h 7.8 (Berkeley) 4/3/91 - * $FreeBSD: src/sys/amd64/include/endian.h,v 1.4 2003/05/01 01:05:23 peter Exp $ + * $FreeBSD: src/sys/amd64/include/endian.h,v 1.5 2003/09/22 22:37:49 peter Exp $ */ #ifndef _MACHINE_ENDIAN_H_ @@ -69,26 +69,92 @@ #ifdef __GNUC__ -#define __word_swap_int(x) \ +#define __word_swap_int_var(x) \ __extension__ ({ register __uint32_t __X = (x); \ __asm ("rorl $16, %0" : "+r" (__X)); \ __X; }) -#define __byte_swap_int(x) \ +#ifdef __OPTIMIZE__ + +#define __word_swap_int_const(x) \ + ((((x) & 0xffff0000) >> 16) | \ + (((x) & 0x0000ffff) << 16)) +#define __word_swap_int(x) (__builtin_constant_p(x) ? \ + __word_swap_int_const(x) : __word_swap_int_var(x)) + +#else /* __OPTIMIZE__ */ + +#define __word_swap_int(x) __word_swap_int_var(x) + +#endif /* __OPTIMIZE__ */ + +#define __byte_swap_int_var(x) \ __extension__ ({ register __uint32_t __X = (x); \ __asm ("bswap %0" : "+r" (__X)); \ __X; }) -#define __byte_swap_long(x) \ +#ifdef __OPTIMIZE__ + +#define __byte_swap_int_const(x) \ + ((((x) & 0xff000000) >> 24) | \ + (((x) & 0x00ff0000) >> 8) | \ + (((x) & 0x0000ff00) << 8) | \ + (((x) & 0x000000ff) << 24)) +#define __byte_swap_int(x) (__builtin_constant_p(x) ? \ + __byte_swap_int_const(x) : __byte_swap_int_var(x)) + +#else /* __OPTIMIZE__ */ + +#define __byte_swap_int(x) __byte_swap_int_var(x) + +#endif /* __OPTIMIZE__ */ + +#define __byte_swap_long_var(x) \ __extension__ ({ register __uint64_t __X = (x); \ __asm ("bswap %0" : "+r" (__X)); \ __X; }) -#define __byte_swap_word(x) \ +#ifdef __OPTIMIZE__ + +#define __byte_swap_long_const(x) \ + (((x >> 56) | \ + ((x >> 40) & 0xff00) | \ + ((x >> 24) & 0xff0000) | \ + ((x >> 8) & 0xff000000) | \ + ((x << 8) & (0xfful << 32)) | \ + ((x << 24) & (0xfful << 40)) | \ + ((x << 40) & (0xfful << 48)) | \ + ((x << 56)))) + +#define __byte_swap_long(x) (__builtin_constant_p(x) ? \ + __byte_swap_long_const(x) : __byte_swap_long_var(x)) + +#else /* __OPTIMIZE__ */ + +#define __byte_swap_long(x) __byte_swap_long_var(x) + +#endif /* __OPTIMIZE__ */ + +#define __byte_swap_word_var(x) \ __extension__ ({ register __uint16_t __X = (x); \ __asm ("xchgb %h0, %b0" : "+Q" (__X)); \ __X; }) +#ifdef __OPTIMIZE__ + +#define __byte_swap_word_const(x) \ + ((((x) & 0xff00) >> 8) | \ + (((x) & 0x00ff) << 8)) + +#define __byte_swap_word(x) (__builtin_constant_p(x) ? \ + __byte_swap_word_const(x) : __byte_swap_word_var(x)) + +#else /* __OPTIMIZE__ */ + +#define __byte_swap_word(x) __byte_swap_word_var(x) + +#endif /* __OPTIMIZE__ */ + static __inline __uint64_t __bswap64(__uint64_t _x) { ==== //depot/projects/uart/amd64/include/legacyvar.h#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/amd64/include/legacyvar.h,v 1.3 2002/09/23 15:50:06 jhb Exp $ >>> TRUNCATED FOR MAIL (1000 lines) <<<