Date: Mon, 11 Jan 2010 18:48:45 +0000 (UTC) From: Ed Schouten <ed@FreeBSD.org> To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r202102 - in user/ed/utmpx: . contrib/opie/libopie lib/libc/stdio lib/libusb share/man/man5 sys/amd64/amd64 sys/amd64/conf sys/amd64/include sys/conf sys/dev/ae sys/dev/ahci sys/dev/cfe... Message-ID: <201001111848.o0BImjbE044998@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: ed Date: Mon Jan 11 18:48:45 2010 New Revision: 202102 URL: http://svn.freebsd.org/changeset/base/202102 Log: Merge HEAD to remove conflicts. This should be the final merge before importing it into HEAD. Added: user/ed/utmpx/sys/dev/cfe/cfe_env.c - copied unchanged from r202100, head/sys/dev/cfe/cfe_env.c user/ed/utmpx/sys/dev/siba/siba_cc.c - copied unchanged from r202100, head/sys/dev/siba/siba_cc.c user/ed/utmpx/sys/ia64/ia64/iodev_machdep.c - copied unchanged from r202100, head/sys/ia64/ia64/iodev_machdep.c user/ed/utmpx/sys/ia64/include/iodev.h - copied unchanged from r202100, head/sys/ia64/include/iodev.h - copied from r202100, head/sys/mips/alchemy/ user/ed/utmpx/sys/mips/conf/ALCHEMY - copied unchanged from r202100, head/sys/mips/conf/ALCHEMY user/ed/utmpx/sys/mips/include/cdefs.h - copied unchanged from r202100, head/sys/mips/include/cdefs.h user/ed/utmpx/sys/mips/include/fls64.h - copied unchanged from r202100, head/sys/mips/include/fls64.h user/ed/utmpx/sys/mips/mips/bus_space_generic.c - copied unchanged from r202100, head/sys/mips/mips/bus_space_generic.c user/ed/utmpx/sys/mips/mips/elf_trampoline.c - copied unchanged from r202100, head/sys/mips/mips/elf_trampoline.c user/ed/utmpx/sys/mips/mips/inckern.S - copied unchanged from r202100, head/sys/mips/mips/inckern.S user/ed/utmpx/sys/mips/mips/sys_machdep.c - copied unchanged from r202100, head/sys/mips/mips/sys_machdep.c user/ed/utmpx/sys/modules/epic/ - copied from r202100, head/sys/modules/epic/ user/ed/utmpx/sys/sparc64/ebus/epic.c - copied unchanged from r202100, head/sys/sparc64/ebus/epic.c Directory Properties: user/ed/utmpx/sys/mips/alchemy/ (props changed) Deleted: user/ed/utmpx/sys/mips/include/bus_octeon.h user/ed/utmpx/sys/mips/include/intr.h user/ed/utmpx/sys/mips/include/pltfm.h Modified: user/ed/utmpx/Makefile user/ed/utmpx/contrib/opie/libopie/login.c user/ed/utmpx/lib/libc/stdio/fread.c user/ed/utmpx/lib/libc/stdio/fwrite.c user/ed/utmpx/lib/libusb/libusb20.c user/ed/utmpx/share/man/man5/devfs.rules.5 user/ed/utmpx/sys/amd64/amd64/io.c user/ed/utmpx/sys/amd64/amd64/mp_machdep.c user/ed/utmpx/sys/amd64/amd64/pmap.c user/ed/utmpx/sys/amd64/conf/GENERIC user/ed/utmpx/sys/amd64/include/iodev.h user/ed/utmpx/sys/conf/files.ia64 user/ed/utmpx/sys/conf/files.sparc64 user/ed/utmpx/sys/dev/ae/if_ae.c user/ed/utmpx/sys/dev/ahci/ahci.c user/ed/utmpx/sys/dev/cfe/cfe_api.c user/ed/utmpx/sys/dev/ic/ns16550.h user/ed/utmpx/sys/dev/io/iodev.c user/ed/utmpx/sys/dev/usb/serial/u3g.c user/ed/utmpx/sys/dev/usb/usbdevs user/ed/utmpx/sys/i386/conf/GENERIC user/ed/utmpx/sys/i386/i386/io.c user/ed/utmpx/sys/i386/i386/locore.s user/ed/utmpx/sys/i386/i386/pmap.c user/ed/utmpx/sys/i386/include/iodev.h user/ed/utmpx/sys/i386/xen/mp_machdep.c user/ed/utmpx/sys/i386/xen/xen_machdep.c user/ed/utmpx/sys/ia64/conf/DEFAULTS user/ed/utmpx/sys/ia64/conf/GENERIC user/ed/utmpx/sys/ia64/ia64/sys_machdep.c user/ed/utmpx/sys/ia64/include/sysarch.h user/ed/utmpx/sys/kern/kern_environment.c user/ed/utmpx/sys/mips/adm5120/adm5120_machdep.c user/ed/utmpx/sys/mips/adm5120/files.adm5120 user/ed/utmpx/sys/mips/adm5120/if_admsw.c user/ed/utmpx/sys/mips/adm5120/obio.c user/ed/utmpx/sys/mips/adm5120/uart_cpu_adm5120.c user/ed/utmpx/sys/mips/cavium/dev/rgmii/octeon_fau.c user/ed/utmpx/sys/mips/cavium/dev/rgmii/octeon_fpa.c user/ed/utmpx/sys/mips/cavium/dev/rgmii/octeon_ipd.c user/ed/utmpx/sys/mips/cavium/dev/rgmii/octeon_pko.c user/ed/utmpx/sys/mips/cavium/dev/rgmii/octeon_rgmx.c user/ed/utmpx/sys/mips/cavium/files.octeon1 (contents, props changed) user/ed/utmpx/sys/mips/cavium/obio.c user/ed/utmpx/sys/mips/cavium/octeon_ebt3000_cf.c user/ed/utmpx/sys/mips/cavium/octeon_machdep.c user/ed/utmpx/sys/mips/cavium/std.octeon1 (contents, props changed) user/ed/utmpx/sys/mips/cavium/uart_bus_octeonusart.c user/ed/utmpx/sys/mips/cavium/uart_cpu_octeonusart.c user/ed/utmpx/sys/mips/cavium/uart_dev_oct16550.c user/ed/utmpx/sys/mips/conf/MALTA user/ed/utmpx/sys/mips/conf/OCTEON1 (contents, props changed) user/ed/utmpx/sys/mips/conf/OCTEON1-32 (contents, props changed) user/ed/utmpx/sys/mips/conf/SENTRY5 user/ed/utmpx/sys/mips/idt/files.idt user/ed/utmpx/sys/mips/idt/idt_machdep.c user/ed/utmpx/sys/mips/idt/obio.c user/ed/utmpx/sys/mips/idt/uart_bus_rc32434.c user/ed/utmpx/sys/mips/idt/uart_cpu_rc32434.c user/ed/utmpx/sys/mips/include/_align.h user/ed/utmpx/sys/mips/include/_bus.h user/ed/utmpx/sys/mips/include/_types.h user/ed/utmpx/sys/mips/include/asm.h user/ed/utmpx/sys/mips/include/atomic.h user/ed/utmpx/sys/mips/include/bus.h user/ed/utmpx/sys/mips/include/cache.h user/ed/utmpx/sys/mips/include/cache_mipsNN.h user/ed/utmpx/sys/mips/include/cpu.h user/ed/utmpx/sys/mips/include/cpufunc.h user/ed/utmpx/sys/mips/include/cpuinfo.h user/ed/utmpx/sys/mips/include/cpuregs.h user/ed/utmpx/sys/mips/include/db_machdep.h user/ed/utmpx/sys/mips/include/elf.h user/ed/utmpx/sys/mips/include/endian.h user/ed/utmpx/sys/mips/include/float.h user/ed/utmpx/sys/mips/include/hwfunc.h user/ed/utmpx/sys/mips/include/intr_machdep.h user/ed/utmpx/sys/mips/include/kdb.h user/ed/utmpx/sys/mips/include/locore.h user/ed/utmpx/sys/mips/include/md_var.h user/ed/utmpx/sys/mips/include/param.h user/ed/utmpx/sys/mips/include/pcb.h user/ed/utmpx/sys/mips/include/pmap.h user/ed/utmpx/sys/mips/include/proc.h user/ed/utmpx/sys/mips/include/profile.h user/ed/utmpx/sys/mips/include/psl.h user/ed/utmpx/sys/mips/include/pte.h user/ed/utmpx/sys/mips/include/regdef.h user/ed/utmpx/sys/mips/include/regnum.h user/ed/utmpx/sys/mips/include/trap.h user/ed/utmpx/sys/mips/include/ucontext.h user/ed/utmpx/sys/mips/malta/files.malta user/ed/utmpx/sys/mips/malta/gt_pci.c user/ed/utmpx/sys/mips/malta/malta_machdep.c user/ed/utmpx/sys/mips/malta/maltareg.h user/ed/utmpx/sys/mips/malta/obio.c user/ed/utmpx/sys/mips/malta/std.malta user/ed/utmpx/sys/mips/malta/uart_bus_maltausart.c user/ed/utmpx/sys/mips/malta/uart_cpu_maltausart.c user/ed/utmpx/sys/mips/malta/yamon.h user/ed/utmpx/sys/mips/mips/busdma_machdep.c user/ed/utmpx/sys/mips/mips/cache.c user/ed/utmpx/sys/mips/mips/cache_mipsNN.c user/ed/utmpx/sys/mips/mips/copystr.S user/ed/utmpx/sys/mips/mips/cpu.c user/ed/utmpx/sys/mips/mips/db_trace.c user/ed/utmpx/sys/mips/mips/elf_machdep.c user/ed/utmpx/sys/mips/mips/exception.S user/ed/utmpx/sys/mips/mips/fp.S user/ed/utmpx/sys/mips/mips/gdb_machdep.c user/ed/utmpx/sys/mips/mips/genassym.c user/ed/utmpx/sys/mips/mips/in_cksum.c user/ed/utmpx/sys/mips/mips/intr_machdep.c user/ed/utmpx/sys/mips/mips/locore.S user/ed/utmpx/sys/mips/mips/machdep.c user/ed/utmpx/sys/mips/mips/mainbus.c user/ed/utmpx/sys/mips/mips/mem.c user/ed/utmpx/sys/mips/mips/nexus.c user/ed/utmpx/sys/mips/mips/pm_machdep.c user/ed/utmpx/sys/mips/mips/pmap.c user/ed/utmpx/sys/mips/mips/psraccess.S user/ed/utmpx/sys/mips/mips/support.S user/ed/utmpx/sys/mips/mips/swtch.S user/ed/utmpx/sys/mips/mips/tick.c user/ed/utmpx/sys/mips/mips/tlb.S user/ed/utmpx/sys/mips/mips/trap.c user/ed/utmpx/sys/mips/mips/vm_machdep.c user/ed/utmpx/sys/mips/rmi/dev/sec/rmilib.c (contents, props changed) user/ed/utmpx/sys/mips/rmi/dev/sec/rmilib.h (contents, props changed) user/ed/utmpx/sys/mips/rmi/dev/sec/rmisec.c (contents, props changed) user/ed/utmpx/sys/mips/rmi/dev/xlr/rge.c (contents, props changed) user/ed/utmpx/sys/mips/rmi/files.xlr (contents, props changed) user/ed/utmpx/sys/mips/rmi/iodi.c (contents, props changed) user/ed/utmpx/sys/mips/sentry5/files.sentry5 user/ed/utmpx/sys/mips/sentry5/obio.c user/ed/utmpx/sys/mips/sentry5/s5_machdep.c user/ed/utmpx/sys/mips/sentry5/uart_bus_sbusart.c user/ed/utmpx/sys/mips/sentry5/uart_cpu_sbusart.c user/ed/utmpx/sys/mips/sibyte/sb_zbbus.c user/ed/utmpx/sys/mips/sibyte/sb_zbpci.c user/ed/utmpx/sys/modules/Makefile user/ed/utmpx/sys/pc98/conf/GENERIC user/ed/utmpx/sys/powerpc/conf/GENERIC user/ed/utmpx/sys/sparc64/conf/GENERIC user/ed/utmpx/sys/sparc64/pci/fire.c user/ed/utmpx/sys/sun4v/conf/GENERIC user/ed/utmpx/sys/sys/systm.h user/ed/utmpx/usr.bin/lastcomm/lastcomm.c user/ed/utmpx/usr.bin/make/job.c user/ed/utmpx/usr.bin/netstat/if.c user/ed/utmpx/usr.bin/netstat/main.c user/ed/utmpx/usr.bin/netstat/netstat.1 user/ed/utmpx/usr.bin/netstat/netstat.h user/ed/utmpx/usr.sbin/usbconfig/usbconfig.c Directory Properties: user/ed/utmpx/ (props changed) user/ed/utmpx/contrib/one-true-awk/ (props changed) user/ed/utmpx/sys/conf/ldscript.mips.mips64 (props changed) user/ed/utmpx/sys/conf/ldscript.mips.octeon1.32 (props changed) user/ed/utmpx/sys/conf/ldscript.mips.octeon1.64 (props changed) user/ed/utmpx/sys/conf/ldscript.mips.octeon1.n32 (props changed) user/ed/utmpx/sys/dev/flash/mx25l.c (props changed) user/ed/utmpx/sys/dev/flash/mx25lreg.h (props changed) user/ed/utmpx/sys/dev/siba/siba/ (props changed) user/ed/utmpx/sys/mips/atheros/ (props changed) user/ed/utmpx/sys/mips/cavium/ (props changed) user/ed/utmpx/sys/mips/conf/AR71XX (props changed) user/ed/utmpx/sys/mips/conf/AR71XX.hints (props changed) user/ed/utmpx/sys/mips/conf/MALTA64 (props changed) user/ed/utmpx/sys/mips/conf/OCTEON1.hints (props changed) user/ed/utmpx/sys/mips/conf/SWARM (props changed) user/ed/utmpx/sys/mips/conf/SWARM.hints (props changed) user/ed/utmpx/sys/mips/conf/XLR (props changed) user/ed/utmpx/sys/mips/mips/ptrace_machdep.c (props changed) user/ed/utmpx/sys/mips/rmi/ (props changed) user/ed/utmpx/sys/mips/rmi/Makefile.msgring (props changed) user/ed/utmpx/sys/mips/rmi/board.c (props changed) user/ed/utmpx/sys/mips/rmi/board.h (props changed) user/ed/utmpx/sys/mips/rmi/bus_space_rmi.c (props changed) user/ed/utmpx/sys/mips/rmi/clock.c (props changed) user/ed/utmpx/sys/mips/rmi/clock.h (props changed) user/ed/utmpx/sys/mips/rmi/debug.h (props changed) user/ed/utmpx/sys/mips/rmi/dev/ (props changed) user/ed/utmpx/sys/mips/rmi/dev/sec/desc.h (props changed) user/ed/utmpx/sys/mips/rmi/dev/sec/stats.h (props changed) user/ed/utmpx/sys/mips/rmi/dev/xlr/atx_cpld.h (props changed) user/ed/utmpx/sys/mips/rmi/dev/xlr/rge.h (props changed) user/ed/utmpx/sys/mips/rmi/dev/xlr/xgmac_mdio.h (props changed) user/ed/utmpx/sys/mips/sibyte/ (props changed) Modified: user/ed/utmpx/Makefile ============================================================================== --- user/ed/utmpx/Makefile Mon Jan 11 18:44:41 2010 (r202101) +++ user/ed/utmpx/Makefile Mon Jan 11 18:48:45 2010 (r202102) @@ -321,8 +321,9 @@ universe_${target}: @echo ">> ${target} completed on `LC_ALL=C date`" .endfor universe_kernels: universe_kernconfs -XMACHINE!= uname -m -TARGET?= ${XMACHINE} +.if !defined(TARGET) +TARGET!= uname -m +.endif KERNCONFS!= cd ${.CURDIR}/sys/${TARGET}/conf && \ find [A-Z0-9]*[A-Z0-9] -type f -maxdepth 0 \ ! -name DEFAULTS ! -name NOTES Modified: user/ed/utmpx/contrib/opie/libopie/login.c ============================================================================== --- user/ed/utmpx/contrib/opie/libopie/login.c Mon Jan 11 18:44:41 2010 (r202101) +++ user/ed/utmpx/contrib/opie/libopie/login.c Mon Jan 11 18:48:45 2010 (r202102) @@ -21,13 +21,14 @@ you didn't get a copy, you may request o #include "opie_cfg.h" #include <stdio.h> #include <sys/types.h> -#include <utmp.h> #if DOUTMPX #include <utmpx.h> #define pututline(x) pututxline(x) #define endutent endutxent #define utmp utmpx +#else +#include <utmp.h> #endif /* DOUTMPX */ #if HAVE_STRING_H Modified: user/ed/utmpx/lib/libc/stdio/fread.c ============================================================================== --- user/ed/utmpx/lib/libc/stdio/fread.c Mon Jan 11 18:44:41 2010 (r202101) +++ user/ed/utmpx/lib/libc/stdio/fread.c Mon Jan 11 18:48:45 2010 (r202102) @@ -37,6 +37,8 @@ static char sccsid[] = "@(#)fread.c 8.2 __FBSDID("$FreeBSD$"); #include "namespace.h" +#include <errno.h> +#include <stdint.h> #include <stdio.h> #include <string.h> #include "un-namespace.h" @@ -69,8 +71,27 @@ __fread(void * __restrict buf, size_t si /* * ANSI and SUSv2 require a return value of 0 if size or count are 0. */ - if ((resid = count * size) == 0) + if ((count == 0) || (size == 0)) return (0); + + /* + * Check for integer overflow. As an optimization, first check that + * at least one of {count, size} is at least 2^16, since if both + * values are less than that, their product can't possible overflow + * (size_t is always at least 32 bits on FreeBSD). + */ + if (((count | size) > 0xFFFF) && + (count > SIZE_MAX / size)) { + errno = EINVAL; + fp->_flags |= __SERR; + return (0); + } + + /* + * Compute the (now required to not overflow) number of bytes to + * read and actually do the work. + */ + resid = count * size; ORIENT(fp, -1); if (fp->_r < 0) fp->_r = 0; Modified: user/ed/utmpx/lib/libc/stdio/fwrite.c ============================================================================== --- user/ed/utmpx/lib/libc/stdio/fwrite.c Mon Jan 11 18:44:41 2010 (r202101) +++ user/ed/utmpx/lib/libc/stdio/fwrite.c Mon Jan 11 18:48:45 2010 (r202102) @@ -37,6 +37,8 @@ static char sccsid[] = "@(#)fwrite.c 8.1 __FBSDID("$FreeBSD$"); #include "namespace.h" +#include <errno.h> +#include <stdint.h> #include <stdio.h> #include "un-namespace.h" #include "local.h" @@ -60,10 +62,24 @@ fwrite(buf, size, count, fp) /* * ANSI and SUSv2 require a return value of 0 if size or count are 0. */ - n = count * size; - if (n == 0) + if ((count == 0) || (size == 0)) return (0); + /* + * Check for integer overflow. As an optimization, first check that + * at least one of {count, size} is at least 2^16, since if both + * values are less than that, their product can't possible overflow + * (size_t is always at least 32 bits on FreeBSD). + */ + if (((count | size) > 0xFFFF) && + (count > SIZE_MAX / size)) { + errno = EINVAL; + fp->_flags |= __SERR; + return (0); + } + + n = count * size; + iov.iov_base = (void *)buf; uio.uio_resid = iov.iov_len = n; uio.uio_iov = &iov; Modified: user/ed/utmpx/lib/libusb/libusb20.c ============================================================================== --- user/ed/utmpx/lib/libusb/libusb20.c Mon Jan 11 18:44:41 2010 (r202101) +++ user/ed/utmpx/lib/libusb/libusb20.c Mon Jan 11 18:48:45 2010 (r202102) @@ -130,8 +130,19 @@ libusb20_tr_close(struct libusb20_transf if (xfer->ppBuffer) { free(xfer->ppBuffer); } - /* clear some fields */ + /* reset variable fields in case the transfer is opened again */ + xfer->priv_sc0 = 0; + xfer->priv_sc1 = 0; xfer->is_opened = 0; + xfer->is_pending = 0; + xfer->is_cancel = 0; + xfer->is_draining = 0; + xfer->is_restart = 0; + xfer->status = 0; + xfer->flags = 0; + xfer->nFrames = 0; + xfer->aFrames = 0; + xfer->timeout = 0; xfer->maxFrames = 0; xfer->maxTotalLength = 0; xfer->maxPacketLen = 0; Modified: user/ed/utmpx/share/man/man5/devfs.rules.5 ============================================================================== --- user/ed/utmpx/share/man/man5/devfs.rules.5 Mon Jan 11 18:44:41 2010 (r202101) +++ user/ed/utmpx/share/man/man5/devfs.rules.5 Mon Jan 11 18:48:45 2010 (r202102) @@ -100,13 +100,15 @@ The first line declares and starts a new .Va localrules and the number 10. .Pp -To make all the -.Xr ulpt 4 -devices accessible to their owner and the +To give +.Xr usbconfig 8 +and +.Xr libusb 3 +enabled applications permission to all usb devices for their owner and the .Dq Li usb group, a similar rule may be used: .Pp -.Dl "add path 'ulpt*' mode 0660 group usb" +.Dl "add path 'usb/*' mode 0660 group usb" .Sh SEE ALSO .Xr glob 3 , .Xr devfs 5 , Modified: user/ed/utmpx/sys/amd64/amd64/io.c ============================================================================== --- user/ed/utmpx/sys/amd64/amd64/io.c Mon Jan 11 18:44:41 2010 (r202101) +++ user/ed/utmpx/sys/amd64/amd64/io.c Mon Jan 11 18:48:45 2010 (r202102) @@ -76,3 +76,12 @@ ioclose(struct cdev *dev __unused, int f return (0); } + +/* ARGSUSED */ +int +ioioctl(struct cdev *dev __unused, u_long cmd __unused, caddr_t data __unused, + int fflag __unused, struct thread *td __unused) +{ + + return (ENXIO); +} Modified: user/ed/utmpx/sys/amd64/amd64/mp_machdep.c ============================================================================== --- user/ed/utmpx/sys/amd64/amd64/mp_machdep.c Mon Jan 11 18:44:41 2010 (r202101) +++ user/ed/utmpx/sys/amd64/amd64/mp_machdep.c Mon Jan 11 18:48:45 2010 (r202102) @@ -98,12 +98,6 @@ char *doublefault_stack; char *nmi_stack; void *dpcpu; -/* Hotwire a 0->4MB V==P mapping */ -extern pt_entry_t *KPTphys; - -/* SMP page table page */ -extern pt_entry_t *SMPpt; - struct pcb stoppcbs[MAXCPU]; struct xpcb **stopxpcbs = NULL; Modified: user/ed/utmpx/sys/amd64/amd64/pmap.c ============================================================================== --- user/ed/utmpx/sys/amd64/amd64/pmap.c Mon Jan 11 18:44:41 2010 (r202101) +++ user/ed/utmpx/sys/amd64/amd64/pmap.c Mon Jan 11 18:48:45 2010 (r202102) @@ -664,7 +664,6 @@ pmap_page_init(vm_page_t m) void pmap_init(void) { - pd_entry_t *pd; vm_page_t mpte; vm_size_t s; int i, pv_npg; @@ -673,18 +672,13 @@ pmap_init(void) * Initialize the vm page array entries for the kernel pmap's * page table pages. */ - pd = pmap_pde(kernel_pmap, KERNBASE); for (i = 0; i < NKPT; i++) { - if ((pd[i] & (PG_PS | PG_V)) == (PG_PS | PG_V)) - continue; - KASSERT((pd[i] & PG_V) != 0, - ("pmap_init: page table page is missing")); - mpte = PHYS_TO_VM_PAGE(pd[i] & PG_FRAME); + mpte = PHYS_TO_VM_PAGE(KPTphys + (i << PAGE_SHIFT)); KASSERT(mpte >= vm_page_array && mpte < &vm_page_array[vm_page_array_size], ("pmap_init: page table page is out of range")); mpte->pindex = pmap_pde_pindex(KERNBASE) + i; - mpte->phys_addr = pd[i] & PG_FRAME; + mpte->phys_addr = KPTphys + (i << PAGE_SHIFT); } /* Modified: user/ed/utmpx/sys/amd64/conf/GENERIC ============================================================================== --- user/ed/utmpx/sys/amd64/conf/GENERIC Mon Jan 11 18:44:41 2010 (r202101) +++ user/ed/utmpx/sys/amd64/conf/GENERIC Mon Jan 11 18:48:45 2010 (r202102) @@ -75,6 +75,7 @@ options MAC # TrustedBSD MAC Framewor options FLOWTABLE # per-cpu routing cache #options KDTRACE_FRAME # Ensure frames are compiled in #options KDTRACE_HOOKS # Kernel DTrace hooks +options INCLUDE_CONFIG_FILE # Include this file in kernel # Debugging for use in -current options KDB # Enable kernel debugger support. Modified: user/ed/utmpx/sys/amd64/include/iodev.h ============================================================================== --- user/ed/utmpx/sys/amd64/include/iodev.h Mon Jan 11 18:44:41 2010 (r202101) +++ user/ed/utmpx/sys/amd64/include/iodev.h Mon Jan 11 18:48:45 2010 (r202102) @@ -28,3 +28,4 @@ d_open_t ioopen; d_close_t ioclose; +d_ioctl_t ioioctl; Modified: user/ed/utmpx/sys/conf/files.ia64 ============================================================================== --- user/ed/utmpx/sys/conf/files.ia64 Mon Jan 11 18:44:41 2010 (r202101) +++ user/ed/utmpx/sys/conf/files.ia64 Mon Jan 11 18:48:45 2010 (r202102) @@ -54,6 +54,7 @@ dev/atkbdc/psm.c optional psm atkbdc dev/fb/fb.c optional fb | vga dev/fb/vga.c optional vga dev/hwpmc/hwpmc_ia64.c optional hwpmc +dev/io/iodev.c optional io dev/kbd/kbd.c optional atkbd | sc | ukbd | usb2_input_kbd dev/syscons/scterm-teken.c optional sc dev/syscons/scvgarndr.c optional sc vga @@ -86,6 +87,7 @@ ia64/ia64/gdb_machdep.c optional gdb ia64/ia64/highfp.c standard ia64/ia64/in_cksum.c optional inet ia64/ia64/interrupt.c standard +ia64/ia64/iodev_machdep.c optional io ia64/ia64/locore.S standard no-obj ia64/ia64/machdep.c standard ia64/ia64/mca.c standard Modified: user/ed/utmpx/sys/conf/files.sparc64 ============================================================================== --- user/ed/utmpx/sys/conf/files.sparc64 Mon Jan 11 18:44:41 2010 (r202101) +++ user/ed/utmpx/sys/conf/files.sparc64 Mon Jan 11 18:48:45 2010 (r202102) @@ -67,12 +67,14 @@ libkern/flsl.c standard libkern/memmove.c standard sparc64/central/central.c optional central sparc64/ebus/ebus.c optional ebus +sparc64/ebus/epic.c optional epic ebus sparc64/fhc/clkbrd.c optional fhc sparc64/fhc/fhc.c optional fhc sparc64/isa/isa.c optional isa sparc64/isa/isa_dma.c optional isa sparc64/isa/ofw_isa.c optional ebus | isa sparc64/pci/apb.c optional pci +sparc64/pci/fire.c optional pci sparc64/pci/ofw_pcib.c optional pci sparc64/pci/ofw_pcib_subr.c optional pci sparc64/pci/ofw_pcibus.c optional pci Modified: user/ed/utmpx/sys/dev/ae/if_ae.c ============================================================================== --- user/ed/utmpx/sys/dev/ae/if_ae.c Mon Jan 11 18:44:41 2010 (r202101) +++ user/ed/utmpx/sys/dev/ae/if_ae.c Mon Jan 11 18:48:45 2010 (r202102) @@ -367,6 +367,7 @@ ae_attach(device_t dev) if (ifp == NULL) { device_printf(dev, "could not allocate ifnet structure.\n"); error = ENXIO; + goto fail; } ifp->if_softc = sc; Modified: user/ed/utmpx/sys/dev/ahci/ahci.c ============================================================================== --- user/ed/utmpx/sys/dev/ahci/ahci.c Mon Jan 11 18:44:41 2010 (r202101) +++ user/ed/utmpx/sys/dev/ahci/ahci.c Mon Jan 11 18:48:45 2010 (r202102) @@ -570,6 +570,12 @@ ahci_setup_interrupt(device_t dev) device_printf(dev, "unable to setup interrupt\n"); return ENXIO; } + if (ctlr->numirqs > 1) { + bus_describe_intr(dev, ctlr->irqs[i].r_irq, + ctlr->irqs[i].handle, + ctlr->irqs[i].mode == AHCI_IRQ_MODE_ONE ? + "ch%d" : "%d", i); + } } return (0); } @@ -622,8 +628,14 @@ ahci_intr_one(void *data) int unit; unit = irq->r_irq_rid - 1; + /* Some controllers have edge triggered IS. */ + if (ctlr->quirks & AHCI_Q_EDGEIS) + ATA_OUTL(ctlr->r_mem, AHCI_IS, 1 << unit); if ((arg = ctlr->interrupt[unit].argument)) ctlr->interrupt[unit].function(arg); + /* AHCI declares level triggered IS. */ + if (!(ctlr->quirks & AHCI_Q_EDGEIS)) + ATA_OUTL(ctlr->r_mem, AHCI_IS, 1 << unit); } static struct resource * Modified: user/ed/utmpx/sys/dev/cfe/cfe_api.c ============================================================================== --- user/ed/utmpx/sys/dev/cfe/cfe_api.c Mon Jan 11 18:44:41 2010 (r202101) +++ user/ed/utmpx/sys/dev/cfe/cfe_api.c Mon Jan 11 18:48:45 2010 (r202102) @@ -160,7 +160,7 @@ cfe_enumenv(int idx, char *name, int nam { cfe_xiocb_t xiocb; - xiocb.xiocb_fcode = CFE_CMD_ENV_SET; + xiocb.xiocb_fcode = CFE_CMD_ENV_ENUM; xiocb.xiocb_status = 0; xiocb.xiocb_handle = 0; xiocb.xiocb_flags = 0; Copied: user/ed/utmpx/sys/dev/cfe/cfe_env.c (from r202100, head/sys/dev/cfe/cfe_env.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/ed/utmpx/sys/dev/cfe/cfe_env.c Mon Jan 11 18:48:45 2010 (r202102, copy of r202100, head/sys/dev/cfe/cfe_env.c) @@ -0,0 +1,74 @@ +/*- + * Copyright (c) 2009 Neelkanth Natu + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * 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. + */ + +#include <sys/param.h> +#include <sys/kernel.h> +#include <sys/systm.h> + +#include <dev/cfe/cfe_api.h> + +__FBSDID("$FreeBSD$"); + +#ifndef CFE_ENV_SIZE +#define CFE_ENV_SIZE PAGE_SIZE /* default is one page */ +#endif + +extern void cfe_env_init(void); + +static char cfe_env_buf[CFE_ENV_SIZE]; + +void +cfe_env_init(void) +{ + int idx, len; + char name[64], val[128], *cp, *cplim; + + cp = cfe_env_buf; + cplim = cp + CFE_ENV_SIZE; + + idx = 0; + while (1) { + if (cfe_enumenv(idx, name, sizeof(name), val, sizeof(val)) != 0) + break; + + if (bootverbose) + printf("Importing CFE env: \"%s=%s\"\n", name, val); + + /* + * name=val\0\0 + */ + len = strlen(name) + 1 + strlen(val) + 1 + 1; + if (cplim - cp < len) + printf("No space to store CFE env: \"%s=%s\"\n", + name, val); + else + cp += sprintf(cp, "%s=%s", name, val) + 1; + ++idx; + } + *cp++ = '\0'; + + kern_envp = cfe_env_buf; +} Modified: user/ed/utmpx/sys/dev/ic/ns16550.h ============================================================================== --- user/ed/utmpx/sys/dev/ic/ns16550.h Mon Jan 11 18:44:41 2010 (r202101) +++ user/ed/utmpx/sys/dev/ic/ns16550.h Mon Jan 11 18:48:45 2010 (r202102) @@ -52,6 +52,7 @@ #define REG_IIR com_iir #define IIR_IMASK 0xf #define IIR_RXTOUT 0xc +#define IIR_BUSY 0x7 #define IIR_RLS 0x6 #define IIR_RXRDY 0x4 #define IIR_TXRDY 0x2 @@ -181,6 +182,10 @@ #define com_xoff1 6 /* XOFF 1 character (R/W) */ #define com_xoff2 7 /* XOFF 2 character (R/W) */ +#define com_usr 39 /* Octeon 16750/16550 Uart Status Reg */ +#define REG_USR com_usr +#define USR_TXFIFO_NOTFULL 2 /* Uart TX FIFO Not full */ + /* 16950 register #1. Access enabled by ACR[7]. Also requires !LCR[7]. */ #define com_asr 1 /* additional status register (R[0-7]/W[0-1]) */ Modified: user/ed/utmpx/sys/dev/io/iodev.c ============================================================================== --- user/ed/utmpx/sys/dev/io/iodev.c Mon Jan 11 18:44:41 2010 (r202101) +++ user/ed/utmpx/sys/dev/io/iodev.c Mon Jan 11 18:48:45 2010 (r202102) @@ -41,8 +41,6 @@ __FBSDID("$FreeBSD$"); #include <sys/systm.h> #include <sys/uio.h> -#include <machine/specialreg.h> - #include <vm/vm.h> #include <vm/pmap.h> @@ -54,6 +52,7 @@ static struct cdevsw io_cdevsw = { .d_version = D_VERSION, .d_open = ioopen, .d_close = ioclose, + .d_ioctl = ioioctl, .d_name = "io", }; Copied: user/ed/utmpx/sys/dev/siba/siba_cc.c (from r202100, head/sys/dev/siba/siba_cc.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/ed/utmpx/sys/dev/siba/siba_cc.c Mon Jan 11 18:48:45 2010 (r202102, copy of r202100, head/sys/dev/siba/siba_cc.c) @@ -0,0 +1,154 @@ +/*- + * Copyright (c) 2007 Bruce M. Simpson. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * 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. + */ + +/* + * Child driver for ChipCommon core. + * This is not MI code at the moment. + * Two 16C550 compatible UARTs live here. On the WGT634U, uart1 is the + * system console, and uart0 is not pinned out. + * Because their presence is conditional, they should probably + * be attached from here. + * GPIO lives here. + * The hardware watchdog lives here. + * Clock control registers live here. + * You don't need to read them to determine the clock speed on the 5365, + * which is always 200MHz and thus may be hardcoded (for now). + * Flash config registers live here. There may or may not be system flash. + * The external interface bus lives here (conditionally). + * There is a JTAG interface here which may be used to attach probes to + * the SoC for debugging. + */ + +#include <sys/cdefs.h> +__FBSDID("$FreeBSD$"); + +#include <sys/param.h> +#include <sys/systm.h> +#include <sys/bus.h> +#include <sys/kernel.h> +#include <sys/module.h> +#include <sys/rman.h> +#include <sys/malloc.h> + +#include <machine/bus.h> + +#include <dev/siba/sibavar.h> +#include <dev/siba/sibareg.h> +#include <dev/siba/siba_ids.h> + +static int siba_cc_attach(device_t); +static int siba_cc_probe(device_t); +static void siba_cc_intr(void *v); + +static int +siba_cc_probe(device_t dev) +{ + + if (siba_get_vendor(dev) == SIBA_VID_BROADCOM && + siba_get_device(dev) == SIBA_DEVID_CHIPCOMMON) { + device_set_desc(dev, "ChipCommon core"); + return (BUS_PROBE_DEFAULT); + } + + return (ENXIO); +} + +struct siba_cc_softc { + void *notused; +}; + +static int +siba_cc_attach(device_t dev) +{ + //struct siba_cc_softc *sc = device_get_softc(dev); + struct resource *mem; + struct resource *irq; + int rid; + + /* + * Allocate the resources which the parent bus has already + * determined for us. + * TODO: interrupt routing + */ +#define MIPS_MEM_RID 0x20 + rid = MIPS_MEM_RID; + mem = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE); + if (mem == NULL) { + device_printf(dev, "unable to allocate memory\n"); + return (ENXIO); + } + + rid = 0; + irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, 0); + if (irq == NULL) { + device_printf(dev, "unable to allocate irq\n"); + return (ENXIO); + } + + /* now setup the interrupt */ + /* may be fast, exclusive or mpsafe at a later date */ + + /* + * XXX is this interrupt line in ChipCommon used for anything + * other than the uart? in that case we shouldn't hog it ourselves + * and let uart claim it to avoid polled mode. + */ + int err; + void *cookie; + err = bus_setup_intr(dev, irq, INTR_TYPE_TTY, NULL, siba_cc_intr, NULL, + &cookie); + if (err != 0) { + device_printf(dev, "unable to setup intr\n"); + return (ENXIO); + } + + /* TODO: attach uart child */ + + return (0); +} + +static void +siba_cc_intr(void *v) +{ + +} + +static device_method_t siba_cc_methods[] = { + /* Device interface */ + DEVMETHOD(device_attach, siba_cc_attach), + DEVMETHOD(device_probe, siba_cc_probe), + + {0, 0}, +}; + +static driver_t siba_cc_driver = { + "siba_cc", + siba_cc_methods, + sizeof(struct siba_softc), +}; +static devclass_t siba_cc_devclass; + +DRIVER_MODULE(siba_cc, siba, siba_cc_driver, siba_cc_devclass, 0, 0); Modified: user/ed/utmpx/sys/dev/usb/serial/u3g.c ============================================================================== --- user/ed/utmpx/sys/dev/usb/serial/u3g.c Mon Jan 11 18:44:41 2010 (r202101) +++ user/ed/utmpx/sys/dev/usb/serial/u3g.c Mon Jan 11 18:48:45 2010 (r202102) @@ -316,6 +316,7 @@ static const struct usb_device_id u3g_de U3G_DEV(OPTION, E7041, 0), U3G_DEV(OPTION, E7061, 0), U3G_DEV(OPTION, E7100, 0), + U3G_DEV(OPTION, GE40X, 0), U3G_DEV(OPTION, GT3G, 0), U3G_DEV(OPTION, GT3GPLUS, 0), U3G_DEV(OPTION, GT3GQUAD, 0), Modified: user/ed/utmpx/sys/dev/usb/usbdevs ============================================================================== --- user/ed/utmpx/sys/dev/usb/usbdevs Mon Jan 11 18:44:41 2010 (r202101) +++ user/ed/utmpx/sys/dev/usb/usbdevs Mon Jan 11 18:48:45 2010 (r202102) @@ -2099,6 +2099,7 @@ product OPTION E7041 0x7041 3G modem product OPTION E7061 0x7061 3G modem product OPTION E7100 0x7100 3G modem product OPTION GTM380 0x7201 3G modem +product OPTION GE40X 0x7601 Globetrotter HSUPA /* OQO */ product OQO WIFI01 0x0002 model 01 WiFi interface Modified: user/ed/utmpx/sys/i386/conf/GENERIC ============================================================================== --- user/ed/utmpx/sys/i386/conf/GENERIC Mon Jan 11 18:44:41 2010 (r202101) +++ user/ed/utmpx/sys/i386/conf/GENERIC Mon Jan 11 18:48:45 2010 (r202102) @@ -75,6 +75,7 @@ options AUDIT # Security event auditi options MAC # TrustedBSD MAC Framework options FLOWTABLE # per-cpu routing cache #options KDTRACE_HOOKS # Kernel DTrace hooks +options INCLUDE_CONFIG_FILE # Include this file in kernel # Debugging for use in -current options KDB # Enable kernel debugger support. Modified: user/ed/utmpx/sys/i386/i386/io.c ============================================================================== --- user/ed/utmpx/sys/i386/i386/io.c Mon Jan 11 18:44:41 2010 (r202101) +++ user/ed/utmpx/sys/i386/i386/io.c Mon Jan 11 18:48:45 2010 (r202102) @@ -76,3 +76,12 @@ ioclose(struct cdev *dev __unused, int f return (0); } + +/* ARGSUSED */ +int +ioioctl(struct cdev *dev __unused, u_long cmd __unused, caddr_t data __unused, + int fflag __unused, struct thread *td __unused) +{ + + return (ENXIO); +} Modified: user/ed/utmpx/sys/i386/i386/locore.s ============================================================================== --- user/ed/utmpx/sys/i386/i386/locore.s Mon Jan 11 18:44:41 2010 (r202101) +++ user/ed/utmpx/sys/i386/i386/locore.s Mon Jan 11 18:48:45 2010 (r202102) @@ -104,9 +104,7 @@ IdlePTD: .long 0 /* phys addr of kernel IdlePDPT: .long 0 /* phys addr of kernel PDPT */ #endif -#ifdef SMP .globl KPTphys -#endif KPTphys: .long 0 /* phys addr of kernel page tables */ .globl proc0kstack Modified: user/ed/utmpx/sys/i386/i386/pmap.c ============================================================================== --- user/ed/utmpx/sys/i386/i386/pmap.c Mon Jan 11 18:44:41 2010 (r202101) +++ user/ed/utmpx/sys/i386/i386/pmap.c Mon Jan 11 18:48:45 2010 (r202102) @@ -206,6 +206,7 @@ int pseflag = 0; /* PG_PS or-in */ static int nkpt; vm_offset_t kernel_vm_end; extern u_int32_t KERNend; +extern u_int32_t KPTphys; #ifdef PAE pt_entry_t pg_nx; @@ -659,13 +660,13 @@ pmap_init(void) * Initialize the vm page array entries for the kernel pmap's * page table pages. */ - for (i = 0; i < nkpt; i++) { - mpte = PHYS_TO_VM_PAGE(PTD[i + KPTDI] & PG_FRAME); + for (i = 0; i < NKPT; i++) { + mpte = PHYS_TO_VM_PAGE(KPTphys + (i << PAGE_SHIFT)); KASSERT(mpte >= vm_page_array && mpte < &vm_page_array[vm_page_array_size], ("pmap_init: page table page is out of range")); mpte->pindex = i + KPTDI; - mpte->phys_addr = PTD[i + KPTDI] & PG_FRAME; + mpte->phys_addr = KPTphys + (i << PAGE_SHIFT); } /* Modified: user/ed/utmpx/sys/i386/include/iodev.h ============================================================================== --- user/ed/utmpx/sys/i386/include/iodev.h Mon Jan 11 18:44:41 2010 (r202101) +++ user/ed/utmpx/sys/i386/include/iodev.h Mon Jan 11 18:48:45 2010 (r202102) @@ -28,3 +28,4 @@ d_open_t ioopen; d_close_t ioclose; +d_ioctl_t ioioctl; Modified: user/ed/utmpx/sys/i386/xen/mp_machdep.c ============================================================================== --- user/ed/utmpx/sys/i386/xen/mp_machdep.c Mon Jan 11 18:44:41 2010 (r202101) +++ user/ed/utmpx/sys/i386/xen/mp_machdep.c Mon Jan 11 18:48:45 2010 (r202102) @@ -105,9 +105,6 @@ static char callfunc_name[NR_CPUS][15]; /* Free these after use */ void *bootstacks[MAXCPU]; -/* Hotwire a 0->4MB V==P mapping */ -extern pt_entry_t *KPTphys; - struct pcb stoppcbs[MAXCPU]; /* Variables needed for SMP tlb shootdown. */ Modified: user/ed/utmpx/sys/i386/xen/xen_machdep.c ============================================================================== --- user/ed/utmpx/sys/i386/xen/xen_machdep.c Mon Jan 11 18:44:41 2010 (r202101) +++ user/ed/utmpx/sys/i386/xen/xen_machdep.c Mon Jan 11 18:48:45 2010 (r202102) @@ -715,9 +715,6 @@ xen_destroy_contiguous_region(void *addr balloon_unlock(flags); } -extern unsigned long cpu0prvpage; -extern unsigned long *SMPpt; -extern struct user *proc0uarea; extern vm_offset_t proc0kstack; extern int vm86paddr, vm86phystk; char *bootmem_start, *bootmem_current, *bootmem_end; Modified: user/ed/utmpx/sys/ia64/conf/DEFAULTS ============================================================================== --- user/ed/utmpx/sys/ia64/conf/DEFAULTS Mon Jan 11 18:44:41 2010 (r202101) +++ user/ed/utmpx/sys/ia64/conf/DEFAULTS Mon Jan 11 18:48:45 2010 (r202102) @@ -9,6 +9,7 @@ machine ia64 device acpi # ACPI support # Pseudo devices. +device io # I/O & EFI runtime device device mem # Memory and kernel memory devices # UART chips on this platform Modified: user/ed/utmpx/sys/ia64/conf/GENERIC ============================================================================== --- user/ed/utmpx/sys/ia64/conf/GENERIC Mon Jan 11 18:44:41 2010 (r202101) +++ user/ed/utmpx/sys/ia64/conf/GENERIC Mon Jan 11 18:48:45 2010 (r202102) @@ -67,6 +67,7 @@ options WITNESS # Enable checks to det options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed options _KPOSIX_PRIORITY_SCHEDULING # Posix P1003_1B RT extensions options HWPMC_HOOKS # Necessary kernel hooks for hwpmc(4) +options INCLUDE_CONFIG_FILE # Include this file in kernel # Various "busses" device firewire # FireWire bus code Copied: user/ed/utmpx/sys/ia64/ia64/iodev_machdep.c (from r202100, head/sys/ia64/ia64/iodev_machdep.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/ed/utmpx/sys/ia64/ia64/iodev_machdep.c Mon Jan 11 18:48:45 2010 (r202102, copy of r202100, head/sys/ia64/ia64/iodev_machdep.c) @@ -0,0 +1,160 @@ +/*- + * Copyright (c) 2010 Marcel Moolenaar + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * 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. + */ + +#include <sys/cdefs.h> +__FBSDID("$FreeBSD$"); + +#include <sys/param.h> +#include <sys/conf.h> +#include <sys/fcntl.h> +#include <sys/ioccom.h> +#include <sys/priv.h> +#include <sys/proc.h> +#include <sys/systm.h> + +#include <machine/bus.h> +#include <machine/iodev.h> + +static int iodev_pio_read(struct iodev_pio_req *req); +static int iodev_pio_write(struct iodev_pio_req *req); + +/* ARGSUSED */ +int +ioopen(struct cdev *dev __unused, int flags __unused, int fmt __unused, + struct thread *td) +{ + int error; + + error = priv_check(td, PRIV_IO); + if (error == 0) + error = securelevel_gt(td->td_ucred, 0); + + return (error); +} + +/* ARGSUSED */ +int +ioclose(struct cdev *dev __unused, int flags __unused, int fmt __unused, + struct thread *td __unused) +{ + + return (0); +} + +/* ARGSUSED */ +int +ioioctl(struct cdev *dev __unused, u_long cmd, caddr_t data, + int fflag __unused, struct thread *td __unused) +{ + struct iodev_pio_req *pio_req; + int error; + + error = ENOIOCTL; + switch (cmd) { + case IODEV_PIO: + pio_req = (struct iodev_pio_req *)data; + switch (pio_req->access) { + case IODEV_PIO_READ: + error = iodev_pio_read(pio_req); + break; + case IODEV_PIO_WRITE: + error = iodev_pio_write(pio_req); + break; + default: + error = EINVAL; + break; + } + break; + } + + return (error); +} + +static int +iodev_pio_read(struct iodev_pio_req *req) +{ + + switch (req->width) { + case 1: + req->val = bus_space_read_io_1(req->port); + break; + case 2: + if (req->port & 1) { + req->val = bus_space_read_io_1(req->port); + req->val |= bus_space_read_io_1(req->port + 1) << 8; + } else + req->val = bus_space_read_io_2(req->port); + break; + case 4: + if (req->port & 1) { + req->val = bus_space_read_io_1(req->port); + req->val |= bus_space_read_io_2(req->port + 1) << 8; + req->val |= bus_space_read_io_1(req->port + 3) << 24; + } else if (req->port & 2) { + req->val = bus_space_read_io_2(req->port); + req->val |= bus_space_read_io_2(req->port + 2) << 16; + } else + req->val = bus_space_read_io_4(req->port); + break; + default: + return (EINVAL); + } + + return (0); +} + +static int +iodev_pio_write(struct iodev_pio_req *req) +{ + + switch (req->width) { + case 1: + bus_space_write_io_1(req->port, req->val); + break; + case 2: + if (req->port & 1) { + bus_space_write_io_1(req->port, req->val); + bus_space_write_io_1(req->port + 1, req->val >> 8); + } else + bus_space_write_io_2(req->port, req->val); + break; + case 4: + if (req->port & 1) { + bus_space_write_io_1(req->port, req->val); + bus_space_write_io_2(req->port + 1, req->val >> 8); + bus_space_write_io_1(req->port + 3, req->val >> 24); + } else if (req->port & 2) { + bus_space_write_io_2(req->port, req->val); + bus_space_write_io_2(req->port + 2, req->val >> 16); + } else + bus_space_write_io_4(req->port, req->val); + break; + default: + return (EINVAL); + } + + return (0); +} Modified: user/ed/utmpx/sys/ia64/ia64/sys_machdep.c ============================================================================== --- user/ed/utmpx/sys/ia64/ia64/sys_machdep.c Mon Jan 11 18:44:41 2010 (r202101) +++ user/ed/utmpx/sys/ia64/ia64/sys_machdep.c Mon Jan 11 18:48:45 2010 (r202102) @@ -49,72 +49,9 @@ struct sysarch_args { int sysarch(struct thread *td, struct sysarch_args *uap) { - struct ia64_iodesc iod; int error; - error = 0; switch(uap->op) { - case IA64_IORD: - copyin(uap->parms, &iod, sizeof(iod)); - switch (iod.width) { - case 1: - iod.val = inb(iod.port); - break; - case 2: - if (iod.port & 1) { - iod.val = inb(iod.port); - iod.val |= inb(iod.port + 1) << 8; - } else - iod.val = inw(iod.port); - break; - case 4: - if (iod.port & 3) { - if (iod.port & 1) { - iod.val = inb(iod.port); - iod.val |= inw(iod.port + 1) << 8; - iod.val |= inb(iod.port + 3) << 24; - } else { - iod.val = inw(iod.port); - iod.val |= inw(iod.port + 2) << 16; - } - } else - iod.val = inl(iod.port); - break; - default: - error = EINVAL; - } - copyout(&iod, uap->parms, sizeof(iod)); - break; - case IA64_IOWR: - copyin(uap->parms, &iod, sizeof(iod)); - switch (iod.width) { - case 1: - outb(iod.port, iod.val); - break; - case 2: - if (iod.port & 1) { - outb(iod.port, iod.val); - outb(iod.port + 1, iod.val >> 8); - } else - outw(iod.port, iod.val); - break; - case 4: - if (iod.port & 3) { - if (iod.port & 1) { - outb(iod.port, iod.val); - outw(iod.port + 1, iod.val >> 8); - outb(iod.port + 3, iod.val >> 24); - } else { - outw(iod.port, iod.val); - outw(iod.port + 2, iod.val >> 16); - } - } else - outl(iod.port, iod.val); - break; - default: - error = EINVAL; - } - break; default: error = EINVAL; break; Copied: user/ed/utmpx/sys/ia64/include/iodev.h (from r202100, head/sys/ia64/include/iodev.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/ed/utmpx/sys/ia64/include/iodev.h Mon Jan 11 18:48:45 2010 (r202102, copy of r202100, head/sys/ia64/include/iodev.h) @@ -0,0 +1,51 @@ +/*- + * Copyright (c) 2010 Marcel Moolenaar + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * 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$ + */ + +#ifndef _MACHINE_IODEV_H_ +#define _MACHINE_IODEV_H_ + *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201001111848.o0BImjbE044998>