Date: Thu, 12 Jul 2012 02:07:22 +0000 (UTC) From: Attilio Rao <attilio@FreeBSD.org> To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r238387 - in user/attilio/vmcontention: bin/sh cddl/lib/libdtrace etc etc/defaults etc/rc.d lib/libc/i386/gen lib/libc/sys lib/libedit sbin/ifconfig sbin/ipfw share/man/man4 share/man/m... Message-ID: <201207120207.q6C27MCf078092@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: attilio Date: Thu Jul 12 02:07:21 2012 New Revision: 238387 URL: http://svn.freebsd.org/changeset/base/238387 Log: MFC Added: user/attilio/vmcontention/sys/arm/at91/at91soc.c - copied unchanged from r238386, head/sys/arm/at91/at91soc.c user/attilio/vmcontention/sys/arm/at91/at91soc.h - copied unchanged from r238386, head/sys/arm/at91/at91soc.h user/attilio/vmcontention/sys/contrib/dev/acpica/components/tables/tbxfload.c - copied unchanged from r238386, head/sys/contrib/dev/acpica/components/tables/tbxfload.c user/attilio/vmcontention/sys/contrib/dev/acpica/components/utilities/utexcep.c - copied unchanged from r238386, head/sys/contrib/dev/acpica/components/utilities/utexcep.c user/attilio/vmcontention/sys/kern/dtio_kdtrace.c - copied unchanged from r238386, head/sys/kern/dtio_kdtrace.c user/attilio/vmcontention/sys/modules/dtrace/dtio/ - copied from r238386, head/sys/modules/dtrace/dtio/ user/attilio/vmcontention/tools/test/upsdl/ - copied from r238386, head/tools/test/upsdl/ Modified: user/attilio/vmcontention/bin/sh/input.c user/attilio/vmcontention/cddl/lib/libdtrace/Makefile user/attilio/vmcontention/cddl/lib/libdtrace/io.d user/attilio/vmcontention/etc/defaults/rc.conf user/attilio/vmcontention/etc/devd.conf user/attilio/vmcontention/etc/rc.d/ipfw user/attilio/vmcontention/etc/rc.d/rarpd user/attilio/vmcontention/lib/libc/i386/gen/getcontextx.c user/attilio/vmcontention/lib/libc/sys/Symbol.map user/attilio/vmcontention/lib/libedit/editline.3 user/attilio/vmcontention/lib/libedit/el.h user/attilio/vmcontention/lib/libedit/read.c user/attilio/vmcontention/lib/libedit/sig.c user/attilio/vmcontention/lib/libedit/sig.h user/attilio/vmcontention/sbin/ifconfig/af_inet6.c user/attilio/vmcontention/sbin/ifconfig/ifconfig.8 user/attilio/vmcontention/sbin/ipfw/ipfw.8 user/attilio/vmcontention/share/man/man4/run.4 user/attilio/vmcontention/share/man/man5/rc.conf.5 user/attilio/vmcontention/sys/amd64/amd64/fpu.c user/attilio/vmcontention/sys/amd64/amd64/machdep.c user/attilio/vmcontention/sys/amd64/amd64/mem.c user/attilio/vmcontention/sys/amd64/include/cpufunc.h user/attilio/vmcontention/sys/arm/at91/at91.c user/attilio/vmcontention/sys/arm/at91/at91_machdep.c user/attilio/vmcontention/sys/arm/at91/at91_mci.c user/attilio/vmcontention/sys/arm/at91/at91_pit.c user/attilio/vmcontention/sys/arm/at91/at91_pitreg.h user/attilio/vmcontention/sys/arm/at91/at91_reset.S user/attilio/vmcontention/sys/arm/at91/at91_rst.c user/attilio/vmcontention/sys/arm/at91/at91_rstreg.h user/attilio/vmcontention/sys/arm/at91/at91_st.c user/attilio/vmcontention/sys/arm/at91/at91_streg.h user/attilio/vmcontention/sys/arm/at91/at91reg.h user/attilio/vmcontention/sys/arm/at91/at91rm9200.c user/attilio/vmcontention/sys/arm/at91/at91rm92reg.h user/attilio/vmcontention/sys/arm/at91/at91sam9260.c user/attilio/vmcontention/sys/arm/at91/at91sam9260reg.h user/attilio/vmcontention/sys/arm/at91/at91sam9g20.c user/attilio/vmcontention/sys/arm/at91/at91sam9g20reg.h user/attilio/vmcontention/sys/arm/at91/at91sam9x25.c user/attilio/vmcontention/sys/arm/at91/at91sam9x25reg.h user/attilio/vmcontention/sys/arm/at91/at91var.h user/attilio/vmcontention/sys/arm/at91/files.at91 user/attilio/vmcontention/sys/arm/at91/uart_bus_at91usart.c user/attilio/vmcontention/sys/arm/at91/uart_cpu_at91rm9200usart.c user/attilio/vmcontention/sys/arm/conf/KB920X user/attilio/vmcontention/sys/arm/econa/econa_machdep.c user/attilio/vmcontention/sys/arm/mv/mv_machdep.c user/attilio/vmcontention/sys/arm/s3c2xx0/s3c24x0_machdep.c user/attilio/vmcontention/sys/arm/sa11x0/assabet_machdep.c user/attilio/vmcontention/sys/arm/xscale/i80321/ep80219_machdep.c user/attilio/vmcontention/sys/arm/xscale/i80321/iq31244_machdep.c user/attilio/vmcontention/sys/arm/xscale/i8134x/crb_machdep.c user/attilio/vmcontention/sys/arm/xscale/ixp425/avila_machdep.c user/attilio/vmcontention/sys/arm/xscale/pxa/pxa_machdep.c user/attilio/vmcontention/sys/arm/xscale/std.xscale user/attilio/vmcontention/sys/cam/ata/ata_all.c user/attilio/vmcontention/sys/cam/ata/ata_da.c user/attilio/vmcontention/sys/cam/scsi/scsi_da.c user/attilio/vmcontention/sys/conf/files user/attilio/vmcontention/sys/contrib/dev/acpica/changes.txt (contents, props changed) user/attilio/vmcontention/sys/contrib/dev/acpica/compiler/aslmain.c user/attilio/vmcontention/sys/contrib/dev/acpica/components/debugger/dbcmds.c user/attilio/vmcontention/sys/contrib/dev/acpica/components/debugger/dbinput.c user/attilio/vmcontention/sys/contrib/dev/acpica/components/events/evxfgpe.c user/attilio/vmcontention/sys/contrib/dev/acpica/components/executer/exprep.c user/attilio/vmcontention/sys/contrib/dev/acpica/components/executer/exresolv.c user/attilio/vmcontention/sys/contrib/dev/acpica/components/executer/exstore.c user/attilio/vmcontention/sys/contrib/dev/acpica/components/executer/exutils.c user/attilio/vmcontention/sys/contrib/dev/acpica/components/hardware/hwsleep.c user/attilio/vmcontention/sys/contrib/dev/acpica/components/hardware/hwxfsleep.c user/attilio/vmcontention/sys/contrib/dev/acpica/components/namespace/nspredef.c user/attilio/vmcontention/sys/contrib/dev/acpica/components/parser/psxface.c user/attilio/vmcontention/sys/contrib/dev/acpica/components/resources/rscreate.c user/attilio/vmcontention/sys/contrib/dev/acpica/components/resources/rsutils.c user/attilio/vmcontention/sys/contrib/dev/acpica/components/tables/tbfadt.c user/attilio/vmcontention/sys/contrib/dev/acpica/components/tables/tbinstal.c user/attilio/vmcontention/sys/contrib/dev/acpica/components/tables/tbutils.c user/attilio/vmcontention/sys/contrib/dev/acpica/components/tables/tbxface.c user/attilio/vmcontention/sys/contrib/dev/acpica/components/tables/tbxfroot.c user/attilio/vmcontention/sys/contrib/dev/acpica/components/utilities/utdecode.c user/attilio/vmcontention/sys/contrib/dev/acpica/components/utilities/utglobal.c user/attilio/vmcontention/sys/contrib/dev/acpica/components/utilities/utmisc.c user/attilio/vmcontention/sys/contrib/dev/acpica/components/utilities/utobject.c user/attilio/vmcontention/sys/contrib/dev/acpica/components/utilities/utresrc.c user/attilio/vmcontention/sys/contrib/dev/acpica/components/utilities/utxferror.c user/attilio/vmcontention/sys/contrib/dev/acpica/include/acdebug.h user/attilio/vmcontention/sys/contrib/dev/acpica/include/acexcep.h user/attilio/vmcontention/sys/contrib/dev/acpica/include/acglobal.h user/attilio/vmcontention/sys/contrib/dev/acpica/include/acmacros.h user/attilio/vmcontention/sys/contrib/dev/acpica/include/acobject.h user/attilio/vmcontention/sys/contrib/dev/acpica/include/acoutput.h user/attilio/vmcontention/sys/contrib/dev/acpica/include/acpixf.h user/attilio/vmcontention/sys/contrib/dev/acpica/include/actbl1.h user/attilio/vmcontention/sys/contrib/dev/acpica/include/platform/acenv.h user/attilio/vmcontention/sys/dev/agp/agp_i810.c user/attilio/vmcontention/sys/dev/ath/ath_hal/ah.c user/attilio/vmcontention/sys/dev/ath/ath_hal/ah.h user/attilio/vmcontention/sys/dev/ath/ath_hal/ah_debug.h user/attilio/vmcontention/sys/dev/ath/ath_hal/ah_desc.h user/attilio/vmcontention/sys/dev/ath/ath_hal/ar5210/ar5210.h user/attilio/vmcontention/sys/dev/ath/ath_hal/ar5210/ar5210_recv.c user/attilio/vmcontention/sys/dev/ath/ath_hal/ar5211/ar5211.h user/attilio/vmcontention/sys/dev/ath/ath_hal/ar5211/ar5211_recv.c user/attilio/vmcontention/sys/dev/ath/ath_hal/ar5212/ar5212.h user/attilio/vmcontention/sys/dev/ath/ath_hal/ar5212/ar5212_recv.c user/attilio/vmcontention/sys/dev/ath/if_ath.c user/attilio/vmcontention/sys/dev/ath/if_ath_debug.c user/attilio/vmcontention/sys/dev/ath/if_ath_debug.h user/attilio/vmcontention/sys/dev/ath/if_ath_misc.h user/attilio/vmcontention/sys/dev/ath/if_ath_rx.c user/attilio/vmcontention/sys/dev/ath/if_ath_rx.h user/attilio/vmcontention/sys/dev/ath/if_ath_rx_edma.c user/attilio/vmcontention/sys/dev/ath/if_ath_tx.c user/attilio/vmcontention/sys/dev/ath/if_athvar.h user/attilio/vmcontention/sys/dev/cxgbe/t4_sge.c user/attilio/vmcontention/sys/dev/mfi/mfi_disk.c user/attilio/vmcontention/sys/dev/mfi/mfivar.h user/attilio/vmcontention/sys/dev/usb/usb_pf.c user/attilio/vmcontention/sys/dev/usb/usbdevs user/attilio/vmcontention/sys/dev/usb/wlan/if_run.c user/attilio/vmcontention/sys/dev/virtio/balloon/virtio_balloon.c user/attilio/vmcontention/sys/dev/virtio/block/virtio_blk.c user/attilio/vmcontention/sys/dev/virtio/network/if_vtnet.c user/attilio/vmcontention/sys/dev/virtio/pci/virtio_pci.c user/attilio/vmcontention/sys/dev/virtio/pci/virtio_pci.h user/attilio/vmcontention/sys/dev/virtio/virtio.c user/attilio/vmcontention/sys/dev/virtio/virtio.h user/attilio/vmcontention/sys/dev/virtio/virtio_ring.h user/attilio/vmcontention/sys/dev/virtio/virtqueue.c user/attilio/vmcontention/sys/dev/virtio/virtqueue.h user/attilio/vmcontention/sys/fs/ntfs/ntfs_subr.c user/attilio/vmcontention/sys/fs/ntfs/ntfs_subr.h user/attilio/vmcontention/sys/fs/ntfs/ntfs_vfsops.c user/attilio/vmcontention/sys/fs/ntfs/ntfs_vnops.c user/attilio/vmcontention/sys/i386/i386/machdep.c user/attilio/vmcontention/sys/i386/i386/mem.c user/attilio/vmcontention/sys/i386/include/cpufunc.h user/attilio/vmcontention/sys/i386/isa/npx.c user/attilio/vmcontention/sys/kern/kern_descrip.c user/attilio/vmcontention/sys/kern/kern_sig.c user/attilio/vmcontention/sys/kern/subr_devstat.c user/attilio/vmcontention/sys/kern/sys_process.c user/attilio/vmcontention/sys/mips/nlm/board.c user/attilio/vmcontention/sys/mips/nlm/dev/net/mdio.c user/attilio/vmcontention/sys/mips/nlm/hal/mdio.h user/attilio/vmcontention/sys/mips/nlm/xlp.h user/attilio/vmcontention/sys/mips/nlm/xlp_pci.c user/attilio/vmcontention/sys/modules/acpi/acpi/Makefile user/attilio/vmcontention/sys/modules/dtrace/Makefile user/attilio/vmcontention/sys/modules/dtrace/dtraceall/dtraceall.c user/attilio/vmcontention/sys/net/if_bridge.c user/attilio/vmcontention/sys/net/if_epair.c user/attilio/vmcontention/sys/netinet/ipfw/ip_fw_log.c user/attilio/vmcontention/sys/netinet/sctp_output.c user/attilio/vmcontention/sys/netinet6/nd6.h user/attilio/vmcontention/sys/netsmb/smb_trantcp.c user/attilio/vmcontention/sys/pc98/pc98/machdep.c user/attilio/vmcontention/sys/powerpc/aim/mmu_oea.c user/attilio/vmcontention/sys/powerpc/aim/mmu_oea64.c user/attilio/vmcontention/sys/powerpc/booke/pmap.c user/attilio/vmcontention/sys/powerpc/powerpc/mmu_if.m user/attilio/vmcontention/sys/sys/dtrace_bsd.h user/attilio/vmcontention/sys/vm/vm_object.c user/attilio/vmcontention/usr.sbin/acpi/acpidb/Makefile user/attilio/vmcontention/usr.sbin/acpi/acpidump/acpi.c user/attilio/vmcontention/usr.sbin/acpi/iasl/Makefile user/attilio/vmcontention/usr.sbin/ndp/ndp.8 user/attilio/vmcontention/usr.sbin/ndp/ndp.c user/attilio/vmcontention/usr.sbin/newsyslog/newsyslog.c user/attilio/vmcontention/usr.sbin/rarpd/Makefile user/attilio/vmcontention/usr.sbin/rarpd/rarpd.8 user/attilio/vmcontention/usr.sbin/rarpd/rarpd.c user/attilio/vmcontention/usr.sbin/usbdump/usbdump.c Directory Properties: user/attilio/vmcontention/ (props changed) user/attilio/vmcontention/lib/libc/ (props changed) user/attilio/vmcontention/sbin/ (props changed) user/attilio/vmcontention/sbin/ipfw/ (props changed) user/attilio/vmcontention/share/man/man4/ (props changed) user/attilio/vmcontention/sys/ (props changed) user/attilio/vmcontention/sys/conf/ (props changed) user/attilio/vmcontention/sys/contrib/dev/acpica/ (props changed) user/attilio/vmcontention/sys/contrib/dev/acpica/compiler/ (props changed) user/attilio/vmcontention/sys/contrib/dev/acpica/components/debugger/ (props changed) user/attilio/vmcontention/sys/contrib/dev/acpica/components/events/ (props changed) user/attilio/vmcontention/sys/contrib/dev/acpica/components/executer/ (props changed) user/attilio/vmcontention/sys/contrib/dev/acpica/components/hardware/ (props changed) user/attilio/vmcontention/sys/contrib/dev/acpica/components/namespace/ (props changed) user/attilio/vmcontention/sys/contrib/dev/acpica/components/parser/ (props changed) user/attilio/vmcontention/sys/contrib/dev/acpica/components/resources/ (props changed) user/attilio/vmcontention/sys/contrib/dev/acpica/components/tables/ (props changed) user/attilio/vmcontention/sys/contrib/dev/acpica/components/utilities/ (props changed) user/attilio/vmcontention/sys/contrib/dev/acpica/include/ (props changed) Modified: user/attilio/vmcontention/bin/sh/input.c ============================================================================== --- user/attilio/vmcontention/bin/sh/input.c Thu Jul 12 00:27:33 2012 (r238386) +++ user/attilio/vmcontention/bin/sh/input.c Thu Jul 12 02:07:21 2012 (r238387) @@ -186,7 +186,7 @@ retry: if (rl_cp == NULL) rl_cp = el_gets(el, &el_len); if (rl_cp == NULL) - nr = 0; + nr = el_len == 0 ? 0 : -1; else { nr = el_len; if (nr > BUFSIZ) Modified: user/attilio/vmcontention/cddl/lib/libdtrace/Makefile ============================================================================== --- user/attilio/vmcontention/cddl/lib/libdtrace/Makefile Thu Jul 12 00:27:33 2012 (r238386) +++ user/attilio/vmcontention/cddl/lib/libdtrace/Makefile Thu Jul 12 02:07:21 2012 (r238387) @@ -45,6 +45,7 @@ SRCS= dt_aggregate.c \ gmatch.c DSRCS= errno.d \ + io.d \ psinfo.d \ signal.d \ unistd.d Modified: user/attilio/vmcontention/cddl/lib/libdtrace/io.d ============================================================================== --- user/attilio/vmcontention/cddl/lib/libdtrace/io.d Thu Jul 12 00:27:33 2012 (r238386) +++ user/attilio/vmcontention/cddl/lib/libdtrace/io.d Thu Jul 12 02:07:21 2012 (r238387) @@ -27,114 +27,50 @@ #pragma ident "%Z%%M% %I% %E% SMI" -#pragma D depends_on module unix #pragma D depends_on provider io -inline int B_BUSY = B_BUSY; -#pragma D binding "1.0" B_BUSY -inline int B_DONE = 0x00000200; -#pragma D binding "1.0" B_DONE -inline int B_ERROR = B_ERROR; -#pragma D binding "1.0" B_ERROR -inline int B_PAGEIO = B_PAGEIO; -#pragma D binding "1.0" B_PAGEIO -inline int B_PHYS = B_PHYS; -#pragma D binding "1.0" B_PHYS -inline int B_READ = B_READ; -#pragma D binding "1.0" B_READ -inline int B_WRITE = B_WRITE; -#pragma D binding "1.0" B_WRITE -inline int B_ASYNC = 0x00000004; -#pragma D binding "1.0" B_ASYNC - -typedef struct bufinfo { - int b_flags; /* buffer status */ - size_t b_bcount; /* number of bytes */ - caddr_t b_addr; /* buffer address */ - uint64_t b_lblkno; /* block # on device */ - uint64_t b_blkno; /* expanded block # on device */ - size_t b_resid; /* # of bytes not transferred */ - size_t b_bufsize; /* size of allocated buffer */ - caddr_t b_iodone; /* I/O completion routine */ - int b_error; /* expanded error field */ - dev_t b_edev; /* extended device */ -} bufinfo_t; - -#pragma D binding "1.0" translator -translator bufinfo_t < struct buf *B > { - b_flags = B->b_flags; - b_addr = B->b_un.b_addr; - b_bcount = B->b_bcount; - b_lblkno = B->_b_blkno._f; - b_blkno = sizeof (long) == 8 ? B->_b_blkno._f : B->_b_blkno._p._l; - b_resid = B->b_resid; - b_bufsize = B->b_bufsize; - b_iodone = (caddr_t)B->b_iodone; - b_error = B->b_error; - b_edev = B->b_edev; -}; - typedef struct devinfo { - int dev_major; /* major number */ - int dev_minor; /* minor number */ - int dev_instance; /* instance number */ - string dev_name; /* name of device */ - string dev_statname; /* name of device + instance/minor */ - string dev_pathname; /* pathname of device */ + int dev_major; /* major number */ + int dev_minor; /* minor number */ + int dev_instance; /* instance number */ + string dev_name; /* name of device */ + string dev_statname; /* name of device + instance/minor */ + string dev_pathname; /* pathname of device */ } devinfo_t; #pragma D binding "1.0" translator -translator devinfo_t < struct buf *B > { - dev_major = B->b_dip != NULL ? getmajor(B->b_edev) : - getmajor(B->b_file->v_vfsp->vfs_dev); - dev_minor = B->b_dip != NULL ? getminor(B->b_edev) : - getminor(B->b_file->v_vfsp->vfs_dev); - dev_instance = B->b_dip == NULL ? - getminor(B->b_file->v_vfsp->vfs_dev) : - ((struct dev_info *)B->b_dip)->devi_instance; - dev_name = B->b_dip == NULL ? "nfs" : - stringof(`devnamesp[getmajor(B->b_edev)].dn_name); - dev_statname = strjoin(B->b_dip == NULL ? "nfs" : - stringof(`devnamesp[getmajor(B->b_edev)].dn_name), - lltostr(B->b_dip == NULL ? getminor(B->b_file->v_vfsp->vfs_dev) : - ((struct dev_info *)B->b_dip)->devi_instance == 0 && - ((struct dev_info *)B->b_dip)->devi_parent != NULL && - ((struct dev_info *)B->b_dip)->devi_parent->devi_node_name == - "pseudo" ? getminor(B->b_edev) : - ((struct dev_info *)B->b_dip)->devi_instance)); - dev_pathname = B->b_dip == NULL ? "<nfs>" : - ddi_pathname(B->b_dip, getminor(B->b_edev)); +translator devinfo_t < struct devstat *D > { + dev_major = D->device_number; + dev_minor = D->unit_number; + dev_instance = 0; + dev_name = stringof(D->device_name); + dev_statname = stringof(D->device_name); + dev_pathname = stringof(D->device_name); }; -typedef struct fileinfo { - string fi_name; /* name (basename of fi_pathname) */ - string fi_dirname; /* directory (dirname of fi_pathname) */ - string fi_pathname; /* full pathname */ - offset_t fi_offset; /* offset within file */ - string fi_fs; /* filesystem */ - string fi_mount; /* mount point of file system */ - int fi_oflags; /* open(2) flags for file descriptor */ -} fileinfo_t; +typedef struct bufinfo { + int b_flags; /* flags */ + long b_bcount; /* number of bytes */ + caddr_t b_addr; /* buffer address */ + uint64_t b_blkno; /* expanded block # on device */ + uint64_t b_lblkno; /* block # on device */ + size_t b_resid; /* # of bytes not transferred */ + size_t b_bufsize; /* size of allocated buffer */ +/* caddr_t b_iodone; I/O completion routine */ + int b_error; /* expanded error field */ +/* dev_t b_edev; extended device */ +} bufinfo_t; #pragma D binding "1.0" translator -translator fileinfo_t < struct buf *B > { - fi_name = B->b_file == NULL ? "<none>" : - B->b_file->v_path == NULL ? "<unknown>" : - basename(cleanpath(B->b_file->v_path)); - fi_dirname = B->b_file == NULL ? "<none>" : - B->b_file->v_path == NULL ? "<unknown>" : - dirname(cleanpath(B->b_file->v_path)); - fi_pathname = B->b_file == NULL ? "<none>" : - B->b_file->v_path == NULL ? "<unknown>" : - cleanpath(B->b_file->v_path); - fi_offset = B->b_offset; - fi_fs = B->b_file == NULL ? "<none>" : - stringof(B->b_file->v_op->vnop_name); - fi_mount = B->b_file == NULL ? "<none>" : - B->b_file->v_vfsp->vfs_vnodecovered == NULL ? "/" : - B->b_file->v_vfsp->vfs_vnodecovered->v_path == NULL ? "<unknown>" : - cleanpath(B->b_file->v_vfsp->vfs_vnodecovered->v_path); - fi_oflags = 0; +translator bufinfo_t < struct bio *B > { + b_flags = B->bio_flags; + b_bcount = B->bio_bcount; + b_addr = B->bio_data; + b_blkno = 0; + b_lblkno = 0; + b_resid = B->bio_resid; + b_bufsize = 0; /* XXX gnn */ + b_error = B->bio_error; }; /* @@ -158,63 +94,17 @@ inline int O_APPEND = 0x0008; #pragma D binding "1.1" O_APPEND inline int O_CREAT = 0x0200; #pragma D binding "1.1" O_CREAT -inline int O_DSYNC = O_DSYNC; -#pragma D binding "1.1" O_DSYNC inline int O_EXCL = 0x0800; #pragma D binding "1.1" O_EXCL -inline int O_LARGEFILE = O_LARGEFILE; -#pragma D binding "1.1" O_LARGEFILE inline int O_NOCTTY = 0x8000; #pragma D binding "1.1" O_NOCTTY inline int O_NONBLOCK = 0x0004; #pragma D binding "1.1" O_NONBLOCK inline int O_NDELAY = 0x0004; #pragma D binding "1.1" O_NDELAY -inline int O_RSYNC = O_RSYNC; -#pragma D binding "1.1" O_RSYNC inline int O_SYNC = 0x0080; #pragma D binding "1.1" O_SYNC inline int O_TRUNC = 0x0400; #pragma D binding "1.1" O_TRUNC -inline int O_XATTR = O_XATTR; -#pragma D binding "1.1" O_XATTR -#pragma D binding "1.1" translator -translator fileinfo_t < struct file *F > { - fi_name = F == NULL ? "<none>" : - F->f_vnode->v_path == NULL ? "<unknown>" : - basename(cleanpath(F->f_vnode->v_path)); - fi_dirname = F == NULL ? "<none>" : - F->f_vnode->v_path == NULL ? "<unknown>" : - dirname(cleanpath(F->f_vnode->v_path)); - fi_pathname = F == NULL ? "<none>" : - F->f_vnode->v_path == NULL ? "<unknown>" : - cleanpath(F->f_vnode->v_path); - fi_offset = F == NULL ? 0 : F->f_offset; - fi_fs = F == NULL ? "<none>" : stringof(F->f_vnode->v_op->vnop_name); - fi_mount = F == NULL ? "<none>" : - F->f_vnode->v_vfsp->vfs_vnodecovered == NULL ? "/" : - F->f_vnode->v_vfsp->vfs_vnodecovered->v_path == NULL ? "<unknown>" : - cleanpath(F->f_vnode->v_vfsp->vfs_vnodecovered->v_path); - fi_oflags = F == NULL ? 0 : F->f_flag + (int)FOPEN; -}; -inline fileinfo_t fds[int fd] = xlate <fileinfo_t> ( - fd >= 0 && fd < curthread->t_procp->p_user.u_finfo.fi_nfiles ? - curthread->t_procp->p_user.u_finfo.fi_list[fd].uf_file : NULL); - -#pragma D attributes Stable/Stable/Common fds -#pragma D binding "1.1" fds - -#pragma D binding "1.2" translator -translator fileinfo_t < struct vnode *V > { - fi_name = V->v_path == NULL ? "<unknown>" : - basename(cleanpath(V->v_path)); - fi_dirname = V->v_path == NULL ? "<unknown>" : - dirname(cleanpath(V->v_path)); - fi_pathname = V->v_path == NULL ? "<unknown>" : cleanpath(V->v_path); - fi_fs = stringof(V->v_op->vnop_name); - fi_mount = V->v_vfsp->vfs_vnodecovered == NULL ? "/" : - V->v_vfsp->vfs_vnodecovered->v_path == NULL ? "<unknown>" : - cleanpath(V->v_vfsp->vfs_vnodecovered->v_path); -}; Modified: user/attilio/vmcontention/etc/defaults/rc.conf ============================================================================== --- user/attilio/vmcontention/etc/defaults/rc.conf Thu Jul 12 00:27:33 2012 (r238386) +++ user/attilio/vmcontention/etc/defaults/rc.conf Thu Jul 12 02:07:21 2012 (r238387) @@ -123,6 +123,7 @@ firewall_script="/etc/rc.firewall" # Whi firewall_type="UNKNOWN" # Firewall type (see /etc/rc.firewall) firewall_quiet="NO" # Set to YES to suppress rule display firewall_logging="NO" # Set to YES to enable events logging +firewall_logif="NO" # Set to YES to create logging-pseudo interface firewall_flags="" # Flags passed to ipfw when type is a file firewall_coscripts="" # List of executables/scripts to run after # firewall starts/stops Modified: user/attilio/vmcontention/etc/devd.conf ============================================================================== --- user/attilio/vmcontention/etc/devd.conf Thu Jul 12 00:27:33 2012 (r238386) +++ user/attilio/vmcontention/etc/devd.conf Thu Jul 12 02:07:21 2012 (r238387) @@ -320,7 +320,7 @@ notify 10 { notify 0 { match "system" "RCTL"; match "rule" "user:70:swap:.*"; - action "/usr/local/etc/rc.d/postgresql restart" + action "/usr/local/etc/rc.d/postgresql restart"; }; */ Modified: user/attilio/vmcontention/etc/rc.d/ipfw ============================================================================== --- user/attilio/vmcontention/etc/rc.d/ipfw Thu Jul 12 00:27:33 2012 (r238386) +++ user/attilio/vmcontention/etc/rc.d/ipfw Thu Jul 12 02:07:21 2012 (r238387) @@ -57,6 +57,10 @@ ipfw_start() echo 'Firewall logging enabled.' sysctl net.inet.ip.fw.verbose=1 >/dev/null fi + if checkyesno firewall_logif; then + ifconfig ipfw0 create + echo 'Firewall logging pseudo-interface (ipfw0) created.' + fi } ipfw_poststart() Modified: user/attilio/vmcontention/etc/rc.d/rarpd ============================================================================== --- user/attilio/vmcontention/etc/rc.d/rarpd Thu Jul 12 00:27:33 2012 (r238386) +++ user/attilio/vmcontention/etc/rc.d/rarpd Thu Jul 12 02:07:21 2012 (r238387) @@ -13,8 +13,9 @@ name="rarpd" rcvar="rarpd_enable" command="/usr/sbin/${name}" -pidfile="/var/run/${name}.pid" required_files="/etc/ethers" load_rc_config $name +pidfile="${rarpd_pidfile:-/var/run/${name}.pid}" + run_rc_command "$1" Modified: user/attilio/vmcontention/lib/libc/i386/gen/getcontextx.c ============================================================================== --- user/attilio/vmcontention/lib/libc/i386/gen/getcontextx.c Thu Jul 12 00:27:33 2012 (r238386) +++ user/attilio/vmcontention/lib/libc/i386/gen/getcontextx.c Thu Jul 12 02:07:21 2012 (r238387) @@ -68,7 +68,7 @@ __getcontextx_size(void) " movl %%ebx,%1\n" " popl %%ebx\n" : "=a" (p[0]), "=r" (p[1]), "=c" (p[2]), "=d" (p[3]) - : "0" (0x0)); + : "0" (0x1)); if ((p[2] & CPUID2_OSXSAVE) != 0) { __asm __volatile( " pushl %%ebx\n" Modified: user/attilio/vmcontention/lib/libc/sys/Symbol.map ============================================================================== --- user/attilio/vmcontention/lib/libc/sys/Symbol.map Thu Jul 12 00:27:33 2012 (r238386) +++ user/attilio/vmcontention/lib/libc/sys/Symbol.map Thu Jul 12 02:07:21 2012 (r238387) @@ -365,9 +365,6 @@ FBSD_1.2 { cap_getmode; cap_new; cap_getrights; - ffclock_getcounter; - ffclock_getestimate; - ffclock_setestimate; getloginclass; pdfork; pdgetpid; @@ -382,6 +379,9 @@ FBSD_1.2 { }; FBSD_1.3 { + ffclock_getcounter; + ffclock_getestimate; + ffclock_setestimate; posix_fadvise; }; Modified: user/attilio/vmcontention/lib/libedit/editline.3 ============================================================================== --- user/attilio/vmcontention/lib/libedit/editline.3 Thu Jul 12 00:27:33 2012 (r238386) +++ user/attilio/vmcontention/lib/libedit/editline.3 Thu Jul 12 02:07:21 2012 (r238387) @@ -162,6 +162,11 @@ is modified to contain the number of cha Returns the line read if successful, or .Dv NULL if no characters were read or if an error occurred. +If an error occurred, +.Fa count +is set to \-1 and +.Dv errno +contains the error code that caused it. The return value may not remain valid across calls to .Fn el_gets and must be copied if the data is to be retained. Modified: user/attilio/vmcontention/lib/libedit/el.h ============================================================================== --- user/attilio/vmcontention/lib/libedit/el.h Thu Jul 12 00:27:33 2012 (r238386) +++ user/attilio/vmcontention/lib/libedit/el.h Thu Jul 12 02:07:21 2012 (r238387) @@ -115,6 +115,7 @@ struct editline { FILE *el_errfile; /* Stdio stuff */ int el_infd; /* Input file descriptor */ int el_flags; /* Various flags. */ + int el_errno; /* Local copy of errno */ coord_t el_cursor; /* Cursor location */ char **el_display; /* Real screen image = what is there */ char **el_vdisplay; /* Virtual screen image = what we see */ Modified: user/attilio/vmcontention/lib/libedit/read.c ============================================================================== --- user/attilio/vmcontention/lib/libedit/read.c Thu Jul 12 00:27:33 2012 (r238386) +++ user/attilio/vmcontention/lib/libedit/read.c Thu Jul 12 02:07:21 2012 (r238387) @@ -235,9 +235,12 @@ read_getcmd(EditLine *el, el_action_t *c el_action_t cmd; int num; + el->el_errno = 0; do { - if ((num = el_getc(el, ch)) != 1) /* if EOF or error */ + if ((num = el_getc(el, ch)) != 1) { /* if EOF or error */ + el->el_errno = num == 0 ? 0 : errno; return (num); + } #ifdef KANJI if ((*ch & 0200)) { @@ -289,14 +292,21 @@ read_char(EditLine *el, char *cp) ssize_t num_read; int tried = 0; - while ((num_read = read(el->el_infd, cp, 1)) == -1) + again: + el->el_signal->sig_no = 0; + while ((num_read = read(el->el_infd, cp, 1)) == -1) { + if (el->el_signal->sig_no == SIGCONT) { + sig_set(el); + el_set(el, EL_REFRESH); + goto again; + } if (!tried && read__fixio(el->el_infd, errno) == 0) tried = 1; else { *cp = '\0'; return (-1); } - + } return (int)num_read; } @@ -403,10 +413,13 @@ el_gets(EditLine *el, int *nread) int num; /* how many chars we have read at NL */ char ch; int crlf = 0; + int nrb; #ifdef FIONREAD c_macro_t *ma = &el->el_chared.c_macro; #endif /* FIONREAD */ + if (nread == NULL) + nread = &nrb; *nread = 0; if (el->el_flags & NO_TTY) { @@ -427,12 +440,13 @@ el_gets(EditLine *el, int *nread) if (cp[-1] == '\r' || cp[-1] == '\n') break; } + if (num == -1) + el->el_errno = errno; el->el_line.cursor = el->el_line.lastchar = cp; *cp = '\0'; - if (nread) - *nread = (int)(el->el_line.cursor - el->el_line.buffer); - return (*nread ? el->el_line.buffer : NULL); + *nread = (int)(el->el_line.cursor - el->el_line.buffer); + goto done; } @@ -443,8 +457,8 @@ el_gets(EditLine *el, int *nread) (void) ioctl(el->el_infd, FIONREAD, (ioctl_t) & chrs); if (chrs == 0) { if (tty_rawmode(el) < 0) { - if (nread) - *nread = 0; + errno = 0; + *nread = 0; return (NULL); } } @@ -457,6 +471,7 @@ el_gets(EditLine *el, int *nread) if (el->el_flags & EDIT_DISABLED) { char *cp; size_t idx; + if ((el->el_flags & UNBUFFERED) == 0) cp = el->el_line.buffer; else @@ -480,11 +495,13 @@ el_gets(EditLine *el, int *nread) break; } + if (num == -1) { + el->el_errno = errno; + } + el->el_line.cursor = el->el_line.lastchar = cp; *cp = '\0'; - if (nread) - *nread = (int)(el->el_line.cursor - el->el_line.buffer); - return (*nread ? el->el_line.buffer : NULL); + goto done; } for (num = OKCMD; num == OKCMD;) { /* while still editing this @@ -617,12 +634,17 @@ el_gets(EditLine *el, int *nread) /* make sure the tty is set up correctly */ if ((el->el_flags & UNBUFFERED) == 0) { read_finish(el); - if (nread) - *nread = num; + *nread = num != -1 ? num : 0; } else { - if (nread) - *nread = - (int)(el->el_line.lastchar - el->el_line.buffer); + *nread = (int)(el->el_line.lastchar - el->el_line.buffer); } - return (num ? el->el_line.buffer : NULL); +done: + if (*nread == 0) { + if (num == -1) { + *nread = -1; + errno = el->el_errno; + } + return NULL; + } else + return el->el_line.buffer; } Modified: user/attilio/vmcontention/lib/libedit/sig.c ============================================================================== --- user/attilio/vmcontention/lib/libedit/sig.c Thu Jul 12 00:27:33 2012 (r238386) +++ user/attilio/vmcontention/lib/libedit/sig.c Thu Jul 12 02:07:21 2012 (r238387) @@ -29,7 +29,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $NetBSD: sig.c,v 1.14 2009/02/18 15:04:40 christos Exp $ + * $NetBSD: sig.c,v 1.15 2009/02/19 15:20:22 christos Exp $ */ #if !defined(lint) && !defined(SCCSID) @@ -73,6 +73,8 @@ sig_handler(int signo) (void) sigaddset(&nset, signo); (void) sigprocmask(SIG_BLOCK, &nset, &oset); + sel->el_signal->sig_no = signo; + switch (signo) { case SIGCONT: tty_rawmode(sel); @@ -158,12 +160,12 @@ sig_set(EditLine *el) struct sigaction osa, nsa; nsa.sa_handler = sig_handler; + nsa.sa_flags = 0; sigemptyset(&nsa.sa_mask); (void) sigprocmask(SIG_BLOCK, &el->el_signal->sig_set, &oset); for (i = 0; sighdl[i] != -1; i++) { - nsa.sa_flags = SIGINT ? 0 : SA_RESTART; /* This could happen if we get interrupted */ if (sigaction(sighdl[i], &nsa, &osa) != -1 && osa.sa_handler != sig_handler) Modified: user/attilio/vmcontention/lib/libedit/sig.h ============================================================================== --- user/attilio/vmcontention/lib/libedit/sig.h Thu Jul 12 00:27:33 2012 (r238386) +++ user/attilio/vmcontention/lib/libedit/sig.h Thu Jul 12 02:07:21 2012 (r238387) @@ -30,7 +30,7 @@ * SUCH DAMAGE. * * @(#)sig.h 8.1 (Berkeley) 6/4/93 - * $NetBSD: sig.h,v 1.7 2009/02/15 21:25:01 christos Exp $ + * $NetBSD: sig.h,v 1.8 2009/02/19 15:20:22 christos Exp $ * $FreeBSD$ */ @@ -61,6 +61,7 @@ typedef struct { struct sigaction sig_action[ALLSIGSNO]; sigset_t sig_set; + volatile sig_atomic_t sig_no; } *el_signal_t; protected void sig_end(EditLine*); Modified: user/attilio/vmcontention/sbin/ifconfig/af_inet6.c ============================================================================== --- user/attilio/vmcontention/sbin/ifconfig/af_inet6.c Thu Jul 12 00:27:33 2012 (r238386) +++ user/attilio/vmcontention/sbin/ifconfig/af_inet6.c Thu Jul 12 02:07:21 2012 (r238387) @@ -509,8 +509,6 @@ static struct cmd inet6_cmds[] = { DEF_CMD("-ifdisabled", -ND6_IFF_IFDISABLED, setnd6flags), DEF_CMD("nud", ND6_IFF_PERFORMNUD, setnd6flags), DEF_CMD("-nud", -ND6_IFF_PERFORMNUD, setnd6flags), - DEF_CMD("prefer_source",ND6_IFF_PREFER_SOURCE, setnd6flags), - DEF_CMD("-prefer_source",-ND6_IFF_PREFER_SOURCE,setnd6flags), DEF_CMD("auto_linklocal",ND6_IFF_AUTO_LINKLOCAL,setnd6flags), DEF_CMD("-auto_linklocal",-ND6_IFF_AUTO_LINKLOCAL,setnd6flags), DEF_CMD_ARG("pltime", setip6pltime), Modified: user/attilio/vmcontention/sbin/ifconfig/ifconfig.8 ============================================================================== --- user/attilio/vmcontention/sbin/ifconfig/ifconfig.8 Thu Jul 12 00:27:33 2012 (r238386) +++ user/attilio/vmcontention/sbin/ifconfig/ifconfig.8 Thu Jul 12 02:07:21 2012 (r238387) @@ -28,7 +28,7 @@ .\" From: @(#)ifconfig.8 8.3 (Berkeley) 1/5/94 .\" $FreeBSD$ .\" -.Dd May 27, 2012 +.Dd July 9, 2012 .Dt IFCONFIG 8 .Os .Sh NAME @@ -716,12 +716,6 @@ Set a flag to enable Neighbor Unreachabi .It Cm -nud Clear a flag .Cm nud . -.It Cm prefer_source -Set a flag to prefer addresses on the interface as candidates of the -source address for outgoing packets. -.It Cm -prefer_source -Clear a flag -.Cm prefer_source . .El .Pp The following parameters are specific to cloning Modified: user/attilio/vmcontention/sbin/ipfw/ipfw.8 ============================================================================== --- user/attilio/vmcontention/sbin/ipfw/ipfw.8 Thu Jul 12 00:27:33 2012 (r238386) +++ user/attilio/vmcontention/sbin/ipfw/ipfw.8 Thu Jul 12 02:07:21 2012 (r238387) @@ -1,7 +1,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 3, 2012 +.Dd July 9, 2012 .Dt IPFW 8 .Os .Sh NAME @@ -560,7 +560,22 @@ is set to 0 (default), one can use .Xr bpf 4 attached to the .Li ipfw0 -pseudo interface. There is no overhead if no +pseudo interface. +This pseudo interface can be created after a boot +manually by using the following command: +.Bd -literal -offset indent +# ifconfig ipfw0 create +.Ed +.Pp +Or, automatically at boot time by adding the following +line to the +.Xr rc.conf 5 +file: +.Bd -literal -offset indent +firewall_logif="YES" +.Ed +.Pp +There is no overhead if no .Xr bpf 4 is attached to the pseudo interface. .Pp Modified: user/attilio/vmcontention/share/man/man4/run.4 ============================================================================== --- user/attilio/vmcontention/share/man/man4/run.4 Thu Jul 12 00:27:33 2012 (r238386) +++ user/attilio/vmcontention/share/man/man4/run.4 Thu Jul 12 02:07:21 2012 (r238387) @@ -16,7 +16,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 7, 2012 +.Dd July 9, 2012 .Dt RUN 4 .Os .Sh NAME @@ -122,6 +122,8 @@ driver supports the following wireless a .It Buffalo WLI-UC-G300N .It Buffalo WLI-UC-G301N .It Buffalo WLI-UC-GN +.It Buffalo WLI-UC-GNM +.It Buffalo WLI-UC-GNM2 .It Corega CG-WLUSB2GNL .It Corega CG-WLUSB2GNR .It Corega CG-WLUSB300AGN @@ -142,6 +144,7 @@ driver supports the following wireless a .It Hercules HWNU-300 .It Linksys WUSB54GC v3 .It Linksys WUSB600N +.It Logitec LAN-W150N/U2 .It Mvix Nubbin MS-811N .It Planex GW-USMicroN .It Planex GW-US300MiniS Modified: user/attilio/vmcontention/share/man/man5/rc.conf.5 ============================================================================== --- user/attilio/vmcontention/share/man/man5/rc.conf.5 Thu Jul 12 00:27:33 2012 (r238386) +++ user/attilio/vmcontention/share/man/man5/rc.conf.5 Thu Jul 12 02:07:21 2012 (r238387) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 6, 2012 +.Dd July 9, 2012 .Dt RC.CONF 5 .Os .Sh NAME @@ -501,6 +501,16 @@ to enable firewall event logging. This is equivalent to the .Dv IPFIREWALL_VERBOSE kernel option. +.It Va firewall_logif +.Pq Vt bool +Set to +.Dq Li YES +to create pseudo interface +.Li ipfw0 +for logging. +For more details, see +.Xr ipfw 8 +manual page. .It Va firewall_flags .Pq Vt str Flags passed to Modified: user/attilio/vmcontention/sys/amd64/amd64/fpu.c ============================================================================== --- user/attilio/vmcontention/sys/amd64/amd64/fpu.c Thu Jul 12 00:27:33 2012 (r238386) +++ user/attilio/vmcontention/sys/amd64/amd64/fpu.c Thu Jul 12 02:07:21 2012 (r238387) @@ -73,10 +73,6 @@ __FBSDID("$FreeBSD$"); #define fxrstor(addr) __asm __volatile("fxrstor %0" : : "m" (*(addr))) #define fxsave(addr) __asm __volatile("fxsave %0" : "=m" (*(addr))) #define ldmxcsr(csr) __asm __volatile("ldmxcsr %0" : : "m" (csr)) -#define start_emulating() __asm __volatile( \ - "smsw %%ax; orb %0,%%al; lmsw %%ax" \ - : : "n" (CR0_TS) : "ax") -#define stop_emulating() __asm __volatile("clts") static __inline void xrstor(char *addr, uint64_t mask) @@ -109,13 +105,14 @@ void fnstsw(caddr_t addr); void fxsave(caddr_t addr); void fxrstor(caddr_t addr); void ldmxcsr(u_int csr); -void start_emulating(void); -void stop_emulating(void); void xrstor(char *addr, uint64_t mask); void xsave(char *addr, uint64_t mask); #endif /* __GNUCLIKE_ASM && !lint */ +#define start_emulating() load_cr0(rcr0() | CR0_TS) +#define stop_emulating() clts() + #define GET_FPU_CW(thread) ((thread)->td_pcb->pcb_save->sv_env.en_cw) #define GET_FPU_SW(thread) ((thread)->td_pcb->pcb_save->sv_env.en_sw) Modified: user/attilio/vmcontention/sys/amd64/amd64/machdep.c ============================================================================== --- user/attilio/vmcontention/sys/amd64/amd64/machdep.c Thu Jul 12 00:27:33 2012 (r238386) +++ user/attilio/vmcontention/sys/amd64/amd64/machdep.c Thu Jul 12 02:07:21 2012 (r238387) @@ -74,6 +74,7 @@ __FBSDID("$FreeBSD$"); #include <sys/linker.h> #include <sys/lock.h> #include <sys/malloc.h> +#include <sys/memrange.h> #include <sys/msgbuf.h> #include <sys/mutex.h> #include <sys/pcpu.h> @@ -206,6 +207,8 @@ struct pcpu __pcpu[MAXCPU]; struct mtx icu_lock; +struct mem_range_softc mem_range_softc; + struct mtx dt_lock; /* lock for GDT and LDT */ static void Modified: user/attilio/vmcontention/sys/amd64/amd64/mem.c ============================================================================== --- user/attilio/vmcontention/sys/amd64/amd64/mem.c Thu Jul 12 00:27:33 2012 (r238386) +++ user/attilio/vmcontention/sys/amd64/amd64/mem.c Thu Jul 12 02:07:21 2012 (r238387) @@ -72,8 +72,6 @@ __FBSDID("$FreeBSD$"); */ MALLOC_DEFINE(M_MEMDESC, "memdesc", "memory range descriptors"); -struct mem_range_softc mem_range_softc; - /* ARGSUSED */ int memrw(struct cdev *dev, struct uio *uio, int flags) Modified: user/attilio/vmcontention/sys/amd64/include/cpufunc.h ============================================================================== --- user/attilio/vmcontention/sys/amd64/include/cpufunc.h Thu Jul 12 00:27:33 2012 (r238386) +++ user/attilio/vmcontention/sys/amd64/include/cpufunc.h Thu Jul 12 02:07:21 2012 (r238387) @@ -107,6 +107,13 @@ clflush(u_long addr) } static __inline void +clts(void) +{ + + __asm __volatile("clts"); +} + +static __inline void disable_intr(void) { __asm __volatile("cli" : : : "memory"); @@ -702,6 +709,9 @@ intr_restore(register_t rflags) int breakpoint(void); u_int bsfl(u_int mask); u_int bsrl(u_int mask); +void clflush(u_long addr); +void clts(void); +void cpuid_count(u_int ax, u_int cx, u_int *p); void disable_intr(void); void do_cpuid(u_int ax, u_int *p); void enable_intr(void); Modified: user/attilio/vmcontention/sys/arm/at91/at91.c ============================================================================== --- user/attilio/vmcontention/sys/arm/at91/at91.c Thu Jul 12 00:27:33 2012 (r238386) +++ user/attilio/vmcontention/sys/arm/at91/at91.c Thu Jul 12 02:07:21 2012 (r238387) @@ -270,10 +270,12 @@ at91_attach(device_t dev) } - /* Our device list will be added automatically by the cpu device + /* + * Our device list will be added automatically by the cpu device * e.g. at91rm9200.c when it is identified. To ensure that the * CPU and PMC are attached first any other "identified" devices - * call BUS_ADD_CHILD(9) with an "order" of at least 2. */ + * call BUS_ADD_CHILD(9) with an "order" of at least 2. + */ bus_generic_probe(dev); bus_generic_attach(dev); @@ -363,7 +365,7 @@ at91_setup_intr(device_t dev, device_t c struct at91_softc *sc = device_get_softc(dev); int error; - if (rman_get_start(ires) == sc->sc_irq_system && filt == NULL) + if (rman_get_start(ires) == AT91_IRQ_SYSTEM && filt == NULL) panic("All system interrupt ISRs must be FILTER"); error = BUS_SETUP_INTR(device_get_parent(dev), child, ires, flags, filt, intr, arg, cookiep); @@ -471,6 +473,41 @@ at91_eoi(void *unused) IC_EOICR, 0); } +void +at91_add_child(device_t dev, int prio, const char *name, int unit, + bus_addr_t addr, bus_size_t size, int irq0, int irq1, int irq2) +{ + device_t kid; + struct at91_ivar *ivar; + + kid = device_add_child_ordered(dev, prio, name, unit); + if (kid == NULL) { + printf("Can't add child %s%d ordered\n", name, unit); + return; + } + ivar = malloc(sizeof(*ivar), M_DEVBUF, M_NOWAIT | M_ZERO); + if (ivar == NULL) { + device_delete_child(dev, kid); + printf("Can't add alloc ivar\n"); + return; + } + device_set_ivars(kid, ivar); + resource_list_init(&ivar->resources); + if (irq0 != -1) { + bus_set_resource(kid, SYS_RES_IRQ, 0, irq0, 1); + if (irq0 != AT91_IRQ_SYSTEM) + at91_pmc_clock_add(device_get_nameunit(kid), irq0, 0); + } + if (irq1 != 0) + bus_set_resource(kid, SYS_RES_IRQ, 1, irq1, 1); + if (irq2 != 0) + bus_set_resource(kid, SYS_RES_IRQ, 2, irq2, 1); + if (addr != 0 && addr < AT91_BASE) + addr += AT91_BASE; + if (addr != 0) + bus_set_resource(kid, SYS_RES_MEMORY, 0, addr, size); +} + static device_method_t at91_methods[] = { DEVMETHOD(device_probe, at91_probe), DEVMETHOD(device_attach, at91_attach), Modified: user/attilio/vmcontention/sys/arm/at91/at91_machdep.c ============================================================================== --- user/attilio/vmcontention/sys/arm/at91/at91_machdep.c Thu Jul 12 00:27:33 2012 (r238386) +++ user/attilio/vmcontention/sys/arm/at91/at91_machdep.c Thu Jul 12 02:07:21 2012 (r238387) @@ -90,6 +90,8 @@ __FBSDID("$FreeBSD$"); #include <arm/at91/at91board.h> #include <arm/at91/at91var.h> +#include <arm/at91/at91soc.h> +#include <arm/at91/at91_usartreg.h> #include <arm/at91/at91rm92reg.h> #include <arm/at91/at91sam9g20reg.h> @@ -115,10 +117,6 @@ extern u_int undefined_handler_address; struct pv_addr kernel_pt_table[NUM_KERNEL_PTS]; -extern void *_end; - -extern int *end; - struct pcpu __pcpu; struct pcpu *pcpup = &__pcpu; @@ -126,7 +124,6 @@ struct pcpu *pcpup = &__pcpu; vm_paddr_t phys_avail[10]; vm_paddr_t dump_avail[4]; -vm_offset_t physical_pages; struct pv_addr systempage; struct pv_addr msgbufpv; @@ -282,7 +279,7 @@ static const char *soc_subtype_name[] = [AT91_ST_SAM9X35] = "at91sam9x35", }; -struct at91_soc_info soc_data; +struct at91_soc_info soc_info; /* * Read the SoC ID from the CIDR register and try to match it against the @@ -295,103 +292,117 @@ at91_try_id(uint32_t dbgu_base) { uint32_t socid; - soc_data.cidr = *(volatile uint32_t *)(AT91_BASE + dbgu_base + + soc_info.cidr = *(volatile uint32_t *)(AT91_BASE + dbgu_base + DBGU_C1R); - socid = soc_data.cidr & ~AT91_CPU_VERSION_MASK; + socid = soc_info.cidr & ~AT91_CPU_VERSION_MASK; - soc_data.type = AT91_T_NONE; - soc_data.subtype = AT91_ST_NONE; - soc_data.family = (soc_data.cidr & AT91_CPU_FAMILY_MASK) >> 20; - soc_data.exid = *(volatile uint32_t *)(AT91_BASE + dbgu_base + + soc_info.type = AT91_T_NONE; + soc_info.subtype = AT91_ST_NONE; + soc_info.family = (soc_info.cidr & AT91_CPU_FAMILY_MASK) >> 20; + soc_info.exid = *(volatile uint32_t *)(AT91_BASE + dbgu_base + DBGU_C2R); switch (socid) { case AT91_CPU_CAP9: - soc_data.type = AT91_T_CAP9; + soc_info.type = AT91_T_CAP9; break; case AT91_CPU_RM9200: - soc_data.type = AT91_T_RM9200; + soc_info.type = AT91_T_RM9200; break; case AT91_CPU_SAM9XE128: case AT91_CPU_SAM9XE256: case AT91_CPU_SAM9XE512: case AT91_CPU_SAM9260: - soc_data.type = AT91_T_SAM9260; - if (soc_data.family == AT91_FAMILY_SAM9XE) - soc_data.subtype = AT91_ST_SAM9XE; + soc_info.type = AT91_T_SAM9260; + if (soc_info.family == AT91_FAMILY_SAM9XE) + soc_info.subtype = AT91_ST_SAM9XE; break; case AT91_CPU_SAM9261: - soc_data.type = AT91_T_SAM9261; + soc_info.type = AT91_T_SAM9261; break; case AT91_CPU_SAM9263: - soc_data.type = AT91_T_SAM9263; + soc_info.type = AT91_T_SAM9263; break; case AT91_CPU_SAM9G10: - soc_data.type = AT91_T_SAM9G10; + soc_info.type = AT91_T_SAM9G10; break; case AT91_CPU_SAM9G20: - soc_data.type = AT91_T_SAM9G20; + soc_info.type = AT91_T_SAM9G20; break; case AT91_CPU_SAM9G45: - soc_data.type = AT91_T_SAM9G45; + soc_info.type = AT91_T_SAM9G45; break; case AT91_CPU_SAM9N12: - soc_data.type = AT91_T_SAM9N12; + soc_info.type = AT91_T_SAM9N12; break; case AT91_CPU_SAM9RL64: - soc_data.type = AT91_T_SAM9RL; + soc_info.type = AT91_T_SAM9RL; break; case AT91_CPU_SAM9X5: - soc_data.type = AT91_T_SAM9X5; + soc_info.type = AT91_T_SAM9X5; break; default: return (0); } - switch (soc_data.type) { + switch (soc_info.type) { case AT91_T_SAM9G45: - switch (soc_data.exid) { + switch (soc_info.exid) { case AT91_EXID_SAM9G45: - soc_data.subtype = AT91_ST_SAM9G45; + soc_info.subtype = AT91_ST_SAM9G45; break; case AT91_EXID_SAM9G46: - soc_data.subtype = AT91_ST_SAM9G46; + soc_info.subtype = AT91_ST_SAM9G46; break; case AT91_EXID_SAM9M10: - soc_data.subtype = AT91_ST_SAM9M10; + soc_info.subtype = AT91_ST_SAM9M10; break; case AT91_EXID_SAM9M11: - soc_data.subtype = AT91_ST_SAM9M11; + soc_info.subtype = AT91_ST_SAM9M11; break; } break; case AT91_T_SAM9X5: - switch (soc_data.exid) { + switch (soc_info.exid) { case AT91_EXID_SAM9G15: - soc_data.subtype = AT91_ST_SAM9G15; + soc_info.subtype = AT91_ST_SAM9G15; break; case AT91_EXID_SAM9G25: - soc_data.subtype = AT91_ST_SAM9G25; + soc_info.subtype = AT91_ST_SAM9G25; break; case AT91_EXID_SAM9G35: - soc_data.subtype = AT91_ST_SAM9G35; + soc_info.subtype = AT91_ST_SAM9G35; break; case AT91_EXID_SAM9X25: - soc_data.subtype = AT91_ST_SAM9X25; + soc_info.subtype = AT91_ST_SAM9X25; break; case AT91_EXID_SAM9X35: - soc_data.subtype = AT91_ST_SAM9X35; + soc_info.subtype = AT91_ST_SAM9X35; break; } break; default: break; } - snprintf(soc_data.name, sizeof(soc_data.name), "%s%s%s", - soc_type_name[soc_data.type], - soc_data.subtype == AT91_ST_NONE ? "" : " subtype ", - soc_data.subtype == AT91_ST_NONE ? "" : - soc_subtype_name[soc_data.subtype]); + /* + * Disable interrupts in the DBGU unit... + */ + *(volatile uint32_t *)(AT91_BASE + dbgu_base + USART_IDR) = 0xffffffff; + + /* + * Save the name for later... + */ + snprintf(soc_info.name, sizeof(soc_info.name), "%s%s%s", + soc_type_name[soc_info.type], + soc_info.subtype == AT91_ST_NONE ? "" : " subtype ", + soc_info.subtype == AT91_ST_NONE ? "" : + soc_subtype_name[soc_info.subtype]); + + /* + * try to get the matching CPU support. + */ + soc_info.soc_data = at91_match_soc(soc_info.type, soc_info.subtype); + return (1); } @@ -544,6 +555,9 @@ initarm(struct arm_boot_params *abp) cninit(); *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201207120207.q6C27MCf078092>