Date: Tue, 6 Mar 2012 15:05:59 +0000 (UTC) From: Andre Oppermann <andre@FreeBSD.org> To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r232611 - in user/andre/tcp_workqueue/sys: amd64/amd64 amd64/conf amd64/include arm/arm arm/mv boot/fdt/dts boot/i386/boot2 cam/ctl compat/freebsd32 compat/ndis conf dev/acpica dev/ahci... Message-ID: <201203061505.q26F5xNn045635@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: andre Date: Tue Mar 6 15:05:59 2012 New Revision: 232611 URL: http://svn.freebsd.org/changeset/base/232611 Log: Integrate from HEAD up to r232610. Added: user/andre/tcp_workqueue/sys/mips/include/tls.h - copied unchanged from r232610, head/sys/mips/include/tls.h user/andre/tcp_workqueue/sys/mips/mips/freebsd32_machdep.c - copied unchanged from r232610, head/sys/mips/mips/freebsd32_machdep.c user/andre/tcp_workqueue/sys/modules/usb/dwc_otg/ - copied from r232610, head/sys/modules/usb/dwc_otg/ user/andre/tcp_workqueue/sys/x86/include/float.h - copied unchanged from r232610, head/sys/x86/include/float.h user/andre/tcp_workqueue/sys/x86/include/ptrace.h - copied unchanged from r232610, head/sys/x86/include/ptrace.h user/andre/tcp_workqueue/sys/x86/include/trap.h - copied unchanged from r232610, head/sys/x86/include/trap.h Modified: user/andre/tcp_workqueue/sys/amd64/amd64/ptrace_machdep.c user/andre/tcp_workqueue/sys/amd64/conf/GENERIC user/andre/tcp_workqueue/sys/amd64/include/float.h user/andre/tcp_workqueue/sys/amd64/include/ptrace.h user/andre/tcp_workqueue/sys/amd64/include/trap.h user/andre/tcp_workqueue/sys/arm/arm/busdma_machdep.c user/andre/tcp_workqueue/sys/arm/mv/mvreg.h user/andre/tcp_workqueue/sys/boot/fdt/dts/db78100.dts user/andre/tcp_workqueue/sys/boot/i386/boot2/boot2.c user/andre/tcp_workqueue/sys/cam/ctl/ctl.c user/andre/tcp_workqueue/sys/cam/ctl/ctl.h user/andre/tcp_workqueue/sys/cam/ctl/ctl_backend.h user/andre/tcp_workqueue/sys/cam/ctl/ctl_backend_block.c user/andre/tcp_workqueue/sys/cam/ctl/ctl_backend_ramdisk.c user/andre/tcp_workqueue/sys/cam/ctl/ctl_error.c user/andre/tcp_workqueue/sys/cam/ctl/ctl_ioctl.h user/andre/tcp_workqueue/sys/compat/freebsd32/freebsd32.h user/andre/tcp_workqueue/sys/compat/freebsd32/freebsd32_misc.c user/andre/tcp_workqueue/sys/compat/freebsd32/freebsd32_proto.h user/andre/tcp_workqueue/sys/compat/freebsd32/freebsd32_syscall.h user/andre/tcp_workqueue/sys/compat/freebsd32/freebsd32_syscalls.c user/andre/tcp_workqueue/sys/compat/freebsd32/freebsd32_sysent.c user/andre/tcp_workqueue/sys/compat/freebsd32/freebsd32_systrace_args.c user/andre/tcp_workqueue/sys/compat/freebsd32/syscalls.master user/andre/tcp_workqueue/sys/compat/ndis/subr_hal.c user/andre/tcp_workqueue/sys/conf/files.mips user/andre/tcp_workqueue/sys/conf/kern.pre.mk user/andre/tcp_workqueue/sys/conf/options.mips user/andre/tcp_workqueue/sys/dev/acpica/acpi_pci.c user/andre/tcp_workqueue/sys/dev/ahci/ahci.c user/andre/tcp_workqueue/sys/dev/ata/ata-pci.h user/andre/tcp_workqueue/sys/dev/ata/chipsets/ata-ahci.c user/andre/tcp_workqueue/sys/dev/ata/chipsets/ata-marvell.c user/andre/tcp_workqueue/sys/dev/ath/if_ath.c user/andre/tcp_workqueue/sys/dev/cardbus/cardbus.c user/andre/tcp_workqueue/sys/dev/e1000/if_igb.c user/andre/tcp_workqueue/sys/dev/fdt/fdt_common.c user/andre/tcp_workqueue/sys/dev/fdt/fdt_common.h user/andre/tcp_workqueue/sys/dev/hwpmc/hwpmc_core.c user/andre/tcp_workqueue/sys/dev/hwpmc/hwpmc_intel.c user/andre/tcp_workqueue/sys/dev/hwpmc/hwpmc_uncore.c user/andre/tcp_workqueue/sys/dev/hwpmc/hwpmc_uncore.h user/andre/tcp_workqueue/sys/dev/hwpmc/pmc_events.h user/andre/tcp_workqueue/sys/dev/iicbus/ds1775.c user/andre/tcp_workqueue/sys/dev/iicbus/iicbb.c user/andre/tcp_workqueue/sys/dev/iicbus/iicbb_if.m user/andre/tcp_workqueue/sys/dev/mge/if_mge.c user/andre/tcp_workqueue/sys/dev/mge/if_mgevar.h user/andre/tcp_workqueue/sys/dev/mpt/mpt_pci.c user/andre/tcp_workqueue/sys/dev/oce/oce_hw.c user/andre/tcp_workqueue/sys/dev/pci/hostb_pci.c user/andre/tcp_workqueue/sys/dev/pci/pci.c user/andre/tcp_workqueue/sys/dev/pci/pci_if.m user/andre/tcp_workqueue/sys/dev/pci/pci_private.h user/andre/tcp_workqueue/sys/dev/pci/pcivar.h user/andre/tcp_workqueue/sys/dev/pci/vga_pci.c user/andre/tcp_workqueue/sys/dev/siba/siba_bwn.c user/andre/tcp_workqueue/sys/dev/tsec/if_tsec.c user/andre/tcp_workqueue/sys/dev/tsec/if_tsec.h user/andre/tcp_workqueue/sys/dev/tsec/if_tsec_fdt.c user/andre/tcp_workqueue/sys/dev/usb/controller/dwc_otg.c user/andre/tcp_workqueue/sys/dev/usb/controller/dwc_otg.h user/andre/tcp_workqueue/sys/dev/usb/controller/dwc_otg_atmelarm.c user/andre/tcp_workqueue/sys/dev/usb/controller/usb_controller.c user/andre/tcp_workqueue/sys/dev/usb/storage/umass.c user/andre/tcp_workqueue/sys/dev/virtio/pci/virtio_pci.c user/andre/tcp_workqueue/sys/fs/cd9660/cd9660_vfsops.c user/andre/tcp_workqueue/sys/fs/cd9660/cd9660_vnops.c user/andre/tcp_workqueue/sys/fs/hpfs/hpfs_vfsops.c user/andre/tcp_workqueue/sys/fs/msdosfs/msdosfs_vfsops.c user/andre/tcp_workqueue/sys/fs/nfsclient/nfs_clrpcops.c user/andre/tcp_workqueue/sys/fs/nfsclient/nfs_clvnops.c user/andre/tcp_workqueue/sys/fs/nfsserver/nfs_nfsdport.c user/andre/tcp_workqueue/sys/fs/ntfs/ntfs_vfsops.c user/andre/tcp_workqueue/sys/fs/nullfs/null_subr.c user/andre/tcp_workqueue/sys/fs/pseudofs/pseudofs_vnops.c user/andre/tcp_workqueue/sys/fs/tmpfs/tmpfs_vnops.c user/andre/tcp_workqueue/sys/i386/conf/GENERIC user/andre/tcp_workqueue/sys/i386/conf/XBOX user/andre/tcp_workqueue/sys/i386/include/float.h user/andre/tcp_workqueue/sys/i386/include/ptrace.h user/andre/tcp_workqueue/sys/i386/include/trap.h user/andre/tcp_workqueue/sys/ia64/ia64/busdma_machdep.c user/andre/tcp_workqueue/sys/kern/kern_jail.c user/andre/tcp_workqueue/sys/kern/kern_lock.c user/andre/tcp_workqueue/sys/kern/kern_malloc.c user/andre/tcp_workqueue/sys/kern/kern_proc.c user/andre/tcp_workqueue/sys/kern/kern_racct.c user/andre/tcp_workqueue/sys/kern/kern_tc.c user/andre/tcp_workqueue/sys/kern/sched_ule.c user/andre/tcp_workqueue/sys/kern/sys_generic.c user/andre/tcp_workqueue/sys/kern/sys_pipe.c user/andre/tcp_workqueue/sys/kern/vfs_bio.c user/andre/tcp_workqueue/sys/kern/vfs_cache.c user/andre/tcp_workqueue/sys/mips/cavium/octeon_machdep.c user/andre/tcp_workqueue/sys/mips/cavium/octopci_bus_space.c user/andre/tcp_workqueue/sys/mips/conf/OCTEON1 user/andre/tcp_workqueue/sys/mips/include/elf.h user/andre/tcp_workqueue/sys/mips/include/md_var.h user/andre/tcp_workqueue/sys/mips/include/param.h user/andre/tcp_workqueue/sys/mips/include/proc.h user/andre/tcp_workqueue/sys/mips/include/reg.h user/andre/tcp_workqueue/sys/mips/include/sigframe.h user/andre/tcp_workqueue/sys/mips/include/ucontext.h user/andre/tcp_workqueue/sys/mips/include/vmparam.h user/andre/tcp_workqueue/sys/mips/mips/bus_space_generic.c user/andre/tcp_workqueue/sys/mips/mips/busdma_machdep.c user/andre/tcp_workqueue/sys/mips/mips/genassym.c user/andre/tcp_workqueue/sys/mips/mips/pm_machdep.c user/andre/tcp_workqueue/sys/mips/mips/swtch.S user/andre/tcp_workqueue/sys/mips/mips/trap.c user/andre/tcp_workqueue/sys/mips/mips/vm_machdep.c user/andre/tcp_workqueue/sys/modules/dtrace/dtrace/Makefile user/andre/tcp_workqueue/sys/modules/usb/Makefile user/andre/tcp_workqueue/sys/net/bpf.c user/andre/tcp_workqueue/sys/net/if_ethersubr.c user/andre/tcp_workqueue/sys/net80211/ieee80211.h user/andre/tcp_workqueue/sys/net80211/ieee80211_action.c user/andre/tcp_workqueue/sys/net80211/ieee80211_alq.c user/andre/tcp_workqueue/sys/net80211/ieee80211_alq.h user/andre/tcp_workqueue/sys/net80211/ieee80211_hwmp.c user/andre/tcp_workqueue/sys/net80211/ieee80211_input.c user/andre/tcp_workqueue/sys/net80211/ieee80211_mesh.c user/andre/tcp_workqueue/sys/net80211/ieee80211_mesh.h user/andre/tcp_workqueue/sys/net80211/ieee80211_output.c user/andre/tcp_workqueue/sys/net80211/ieee80211_scan.c user/andre/tcp_workqueue/sys/netinet/icmp6.h user/andre/tcp_workqueue/sys/netinet/ip_mroute.c user/andre/tcp_workqueue/sys/netinet6/ip6_input.c user/andre/tcp_workqueue/sys/netinet6/nd6.c user/andre/tcp_workqueue/sys/nfsclient/nfs_vnops.c user/andre/tcp_workqueue/sys/pc98/include/float.h user/andre/tcp_workqueue/sys/pc98/include/ptrace.h user/andre/tcp_workqueue/sys/pc98/include/trap.h user/andre/tcp_workqueue/sys/powerpc/include/asm.h user/andre/tcp_workqueue/sys/powerpc/ofw/ofw_pcibus.c user/andre/tcp_workqueue/sys/powerpc/powermac/smu.c user/andre/tcp_workqueue/sys/powerpc/powerpc/busdma_machdep.c user/andre/tcp_workqueue/sys/powerpc/powerpc/iommu_if.m user/andre/tcp_workqueue/sys/powerpc/ps3/ps3bus.c user/andre/tcp_workqueue/sys/sparc64/include/bus_dma.h user/andre/tcp_workqueue/sys/sparc64/pci/ofw_pcibus.c user/andre/tcp_workqueue/sys/sparc64/sparc64/bus_machdep.c user/andre/tcp_workqueue/sys/sys/buf.h user/andre/tcp_workqueue/sys/sys/bus_dma.h user/andre/tcp_workqueue/sys/sys/cdefs.h user/andre/tcp_workqueue/sys/sys/malloc.h user/andre/tcp_workqueue/sys/sys/pmc.h user/andre/tcp_workqueue/sys/sys/racct.h user/andre/tcp_workqueue/sys/sys/sysctl.h user/andre/tcp_workqueue/sys/sys/vnode.h user/andre/tcp_workqueue/sys/ufs/ffs/ffs_extern.h user/andre/tcp_workqueue/sys/ufs/ffs/ffs_inode.c user/andre/tcp_workqueue/sys/ufs/ffs/ffs_snapshot.c user/andre/tcp_workqueue/sys/ufs/ffs/ffs_softdep.c user/andre/tcp_workqueue/sys/ufs/ffs/ffs_vnops.c user/andre/tcp_workqueue/sys/ufs/ufs/inode.h user/andre/tcp_workqueue/sys/ufs/ufs/ufs_vnops.c user/andre/tcp_workqueue/sys/vm/vm_mmap.c user/andre/tcp_workqueue/sys/x86/include/_stdint.h user/andre/tcp_workqueue/sys/x86/x86/busdma_machdep.c Directory Properties: user/andre/tcp_workqueue/sys/ (props changed) user/andre/tcp_workqueue/sys/boot/ (props changed) user/andre/tcp_workqueue/sys/conf/ (props changed) Modified: user/andre/tcp_workqueue/sys/amd64/amd64/ptrace_machdep.c ============================================================================== --- user/andre/tcp_workqueue/sys/amd64/amd64/ptrace_machdep.c Tue Mar 6 15:02:18 2012 (r232610) +++ user/andre/tcp_workqueue/sys/amd64/amd64/ptrace_machdep.c Tue Mar 6 15:05:59 2012 (r232611) @@ -126,6 +126,12 @@ cpu_ptrace(struct thread *td, int req, v return (cpu32_ptrace(td, req, addr, data)); #endif + /* Support old values of PT_GETXSTATE and PT_SETXSTATE. */ + if (req == PT_FIRSTMACH + 0) + req = PT_GETXSTATE; + if (req == PT_FIRSTMACH + 1) + req = PT_SETXSTATE; + switch (req) { case PT_GETXSTATE: case PT_SETXSTATE: Modified: user/andre/tcp_workqueue/sys/amd64/conf/GENERIC ============================================================================== --- user/andre/tcp_workqueue/sys/amd64/conf/GENERIC Tue Mar 6 15:02:18 2012 (r232610) +++ user/andre/tcp_workqueue/sys/amd64/conf/GENERIC Tue Mar 6 15:05:59 2012 (r232611) @@ -168,6 +168,7 @@ device psm # PS/2 mouse device kbdmux # keyboard multiplexer device vga # VGA video card driver +options VESA # Add support for VESA BIOS Extensions (VBE) device splash # Splash screen and screen saver support @@ -302,39 +303,8 @@ device ohci # OHCI PCI->USB interface device ehci # EHCI PCI->USB interface (USB 2.0) device xhci # XHCI PCI->USB interface (USB 3.0) device usb # USB Bus (required) -#device udbp # USB Double Bulk Pipe devices (needs netgraph) -device uhid # "Human Interface Devices" device ukbd # Keyboard -device ulpt # Printer device umass # Disks/Mass storage - Requires scbus and da -device ums # Mouse -device urio # Diamond Rio 500 MP3 player -# USB Serial devices -device u3g # USB-based 3G modems (Option, Huawei, Sierra) -device uark # Technologies ARK3116 based serial adapters -device ubsa # Belkin F5U103 and compatible serial adapters -device uftdi # For FTDI usb serial adapters -device uipaq # Some WinCE based devices -device uplcom # Prolific PL-2303 serial adapters -device uslcom # SI Labs CP2101/CP2102 serial adapters -device uvisor # Visor and Palm devices -device uvscom # USB serial support for DDI pocket's PHS -# USB Ethernet, requires miibus -device aue # ADMtek USB Ethernet -device axe # ASIX Electronics USB Ethernet -device cdce # Generic USB over Ethernet -device cue # CATC USB Ethernet -device kue # Kawasaki LSI USB Ethernet -device rue # RealTek RTL8150 USB Ethernet -device udav # Davicom DM9601E USB -# USB Wireless -device rum # Ralink Technology RT2501USB wireless NICs -device run # Ralink Technology RT2700/RT2800/RT3000 NICs. -device uath # Atheros AR5523 wireless NICs -device upgt # Conexant/Intersil PrismGT wireless NICs. -device ural # Ralink Technology RT2500USB wireless NICs -device urtw # Realtek RTL8187B/L wireless NICs -device zyd # ZyDAS zd1211/zd1211b wireless NICs # FireWire support device firewire # FireWire bus code @@ -350,7 +320,6 @@ device sound # Generic sound driver (r device snd_es137x # Ensoniq AudioPCI ES137x device snd_hda # Intel High Definition Audio device snd_ich # Intel, NVidia and other ICH AC'97 Audio -device snd_uaudio # USB Audio device snd_via8233 # VIA VT8233x Audio # MMC/SD Modified: user/andre/tcp_workqueue/sys/amd64/include/float.h ============================================================================== --- user/andre/tcp_workqueue/sys/amd64/include/float.h Tue Mar 6 15:02:18 2012 (r232610) +++ user/andre/tcp_workqueue/sys/amd64/include/float.h Tue Mar 6 15:05:59 2012 (r232611) @@ -1,94 +1,6 @@ /*- - * Copyright (c) 1989 Regents of the University of California. - * 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. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. - * - * from: @(#)float.h 7.1 (Berkeley) 5/8/90 - * $FreeBSD$ + * This file is in the public domain. */ +/* $FreeBSD$ */ -#ifndef _MACHINE_FLOAT_H_ -#define _MACHINE_FLOAT_H_ 1 - -#include <sys/cdefs.h> - -__BEGIN_DECLS -extern int __flt_rounds(void); -__END_DECLS - -#define FLT_RADIX 2 /* b */ -#define FLT_ROUNDS __flt_rounds() -#if __ISO_C_VISIBLE >= 1999 -#define FLT_EVAL_METHOD 0 /* no promotions */ -#define DECIMAL_DIG 21 /* max precision in decimal digits */ -#endif - -#define FLT_MANT_DIG 24 /* p */ -#define FLT_EPSILON 1.19209290E-07F /* b**(1-p) */ -#define FLT_DIG 6 /* floor((p-1)*log10(b))+(b == 10) */ -#define FLT_MIN_EXP (-125) /* emin */ -#define FLT_MIN 1.17549435E-38F /* b**(emin-1) */ -#define FLT_MIN_10_EXP (-37) /* ceil(log10(b**(emin-1))) */ -#define FLT_MAX_EXP 128 /* emax */ -#define FLT_MAX 3.40282347E+38F /* (1-b**(-p))*b**emax */ -#define FLT_MAX_10_EXP 38 /* floor(log10((1-b**(-p))*b**emax)) */ -#if __ISO_C_VISIBLE >= 2011 -#define FLT_TRUE_MIN 1.40129846E-45F /* b**(emin-p) */ -#define FLT_DECIMAL_DIG 9 /* ceil(1+p*log10(b)) */ -#define FLT_HAS_SUBNORM 1 -#endif /* __ISO_C_VISIBLE >= 2011 */ - -#define DBL_MANT_DIG 53 -#define DBL_EPSILON 2.2204460492503131E-16 -#define DBL_DIG 15 -#define DBL_MIN_EXP (-1021) -#define DBL_MIN 2.2250738585072014E-308 -#define DBL_MIN_10_EXP (-307) -#define DBL_MAX_EXP 1024 -#define DBL_MAX 1.7976931348623157E+308 -#define DBL_MAX_10_EXP 308 -#if __ISO_C_VISIBLE >= 2011 -#define DBL_TRUE_MIN 4.9406564584124654E-324 -#define DBL_DECIMAL_DIG 17 -#define DBL_HAS_SUBNORM 1 -#endif /* __ISO_C_VISIBLE >= 2011 */ - -#define LDBL_MANT_DIG 64 -#define LDBL_EPSILON 1.0842021724855044340E-19L -#define LDBL_DIG 18 -#define LDBL_MIN_EXP (-16381) -#define LDBL_MIN 3.3621031431120935063E-4932L -#define LDBL_MIN_10_EXP (-4931) -#define LDBL_MAX_EXP 16384 -#define LDBL_MAX 1.1897314953572317650E+4932L -#define LDBL_MAX_10_EXP 4932 -#if __ISO_C_VISIBLE >= 2011 -#define LDBL_TRUE_MIN 3.6451995318824746025E-4951L -#define LDBL_DECIMAL_DIG 21 -#define LDBL_HAS_SUBNORM 1 -#endif /* __ISO_C_VISIBLE >= 2011 */ - -#endif /* _MACHINE_FLOAT_H_ */ +#include <x86/float.h> Modified: user/andre/tcp_workqueue/sys/amd64/include/ptrace.h ============================================================================== --- user/andre/tcp_workqueue/sys/amd64/include/ptrace.h Tue Mar 6 15:02:18 2012 (r232610) +++ user/andre/tcp_workqueue/sys/amd64/include/ptrace.h Tue Mar 6 15:05:59 2012 (r232611) @@ -1,41 +1,6 @@ /*- - * Copyright (c) 1992, 1993 - * The Regents of the University of California. 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. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. - * - * @(#)ptrace.h 8.1 (Berkeley) 6/11/93 - * $FreeBSD$ + * This file is in the public domain. */ +/* $FreeBSD$ */ -#ifndef _MACHINE_PTRACE_H_ -#define _MACHINE_PTRACE_H_ - -#define __HAVE_PTRACE_MACHDEP - -#define PT_GETXSTATE (PT_FIRSTMACH + 0) -#define PT_SETXSTATE (PT_FIRSTMACH + 1) - -#endif +#include <x86/ptrace.h> Modified: user/andre/tcp_workqueue/sys/amd64/include/trap.h ============================================================================== --- user/andre/tcp_workqueue/sys/amd64/include/trap.h Tue Mar 6 15:02:18 2012 (r232610) +++ user/andre/tcp_workqueue/sys/amd64/include/trap.h Tue Mar 6 15:05:59 2012 (r232611) @@ -1,95 +1,6 @@ /*- - * Copyright (c) 1990 The Regents of the University of California. - * All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * William Jolitz. - * - * 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. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. - * - * from: @(#)trap.h 5.4 (Berkeley) 5/9/91 - * $FreeBSD$ + * This file is in the public domain. */ +/* $FreeBSD$ */ -#ifndef _MACHINE_TRAP_H_ -#define _MACHINE_TRAP_H_ - -/* - * Trap type values - * also known in trap.c for name strings - */ - -#define T_PRIVINFLT 1 /* privileged instruction */ -#define T_BPTFLT 3 /* breakpoint instruction */ -#define T_ARITHTRAP 6 /* arithmetic trap */ -#define T_PROTFLT 9 /* protection fault */ -#define T_TRCTRAP 10 /* debug exception (sic) */ -#define T_PAGEFLT 12 /* page fault */ -#define T_ALIGNFLT 14 /* alignment fault */ - -#define T_DIVIDE 18 /* integer divide fault */ -#define T_NMI 19 /* non-maskable trap */ -#define T_OFLOW 20 /* overflow trap */ -#define T_BOUND 21 /* bound instruction fault */ -#define T_DNA 22 /* device not available fault */ -#define T_DOUBLEFLT 23 /* double fault */ -#define T_FPOPFLT 24 /* fp coprocessor operand fetch fault */ -#define T_TSSFLT 25 /* invalid tss fault */ -#define T_SEGNPFLT 26 /* segment not present fault */ -#define T_STKFLT 27 /* stack fault */ -#define T_MCHK 28 /* machine check trap */ -#define T_XMMFLT 29 /* SIMD floating-point exception */ -#define T_RESERVED 30 /* reserved (unknown) */ -#define T_DTRACE_RET 32 /* DTrace pid return */ -#define T_DTRACE_PROBE 33 /* DTrace fasttrap probe */ - -/* XXX most of the following codes aren't used, but could be. */ - -/* definitions for <sys/signal.h> */ -#define ILL_RESAD_FAULT T_RESADFLT -#define ILL_PRIVIN_FAULT T_PRIVINFLT -#define ILL_RESOP_FAULT T_RESOPFLT -#define ILL_ALIGN_FAULT T_ALIGNFLT -#define ILL_FPOP_FAULT T_FPOPFLT /* coprocessor operand fault */ - -/* old FreeBSD macros, deprecated */ -#define FPE_INTOVF_TRAP 0x1 /* integer overflow */ -#define FPE_INTDIV_TRAP 0x2 /* integer divide by zero */ -#define FPE_FLTDIV_TRAP 0x3 /* floating/decimal divide by zero */ -#define FPE_FLTOVF_TRAP 0x4 /* floating overflow */ -#define FPE_FLTUND_TRAP 0x5 /* floating underflow */ -#define FPE_FPU_NP_TRAP 0x6 /* floating point unit not present */ -#define FPE_SUBRNG_TRAP 0x7 /* subrange out of bounds */ - -/* codes for SIGBUS */ -#define BUS_PAGE_FAULT T_PAGEFLT /* page fault protection base */ -#define BUS_SEGNP_FAULT T_SEGNPFLT /* segment not present */ -#define BUS_STK_FAULT T_STKFLT /* stack segment */ -#define BUS_SEGM_FAULT T_RESERVED /* segment protection base */ - -/* Trap's coming from user mode */ -#define T_USER 0x100 - -#endif /* !_MACHINE_TRAP_H_ */ +#include <x86/trap.h> Modified: user/andre/tcp_workqueue/sys/arm/arm/busdma_machdep.c ============================================================================== --- user/andre/tcp_workqueue/sys/arm/arm/busdma_machdep.c Tue Mar 6 15:02:18 2012 (r232610) +++ user/andre/tcp_workqueue/sys/arm/arm/busdma_machdep.c Tue Mar 6 15:05:59 2012 (r232611) @@ -68,7 +68,7 @@ struct bounce_zone; struct bus_dma_tag { bus_dma_tag_t parent; bus_size_t alignment; - bus_size_t boundary; + bus_addr_t boundary; bus_addr_t lowaddr; bus_addr_t highaddr; bus_dma_filter_t *filter; @@ -332,7 +332,7 @@ _busdma_free_dmamap(bus_dmamap_t map) int bus_dma_tag_create(bus_dma_tag_t parent, bus_size_t alignment, - bus_size_t boundary, bus_addr_t lowaddr, + bus_addr_t boundary, bus_addr_t lowaddr, bus_addr_t highaddr, bus_dma_filter_t *filter, void *filterarg, bus_size_t maxsize, int nsegments, bus_size_t maxsegsz, int flags, bus_dma_lock_t *lockfunc, @@ -378,12 +378,12 @@ bus_dma_tag_create(bus_dma_tag_t parent, * Take into account any restrictions imposed by our parent tag */ if (parent != NULL) { - newtag->lowaddr = min(parent->lowaddr, newtag->lowaddr); - newtag->highaddr = max(parent->highaddr, newtag->highaddr); + newtag->lowaddr = MIN(parent->lowaddr, newtag->lowaddr); + newtag->highaddr = MAX(parent->highaddr, newtag->highaddr); if (newtag->boundary == 0) newtag->boundary = parent->boundary; else if (parent->boundary != 0) - newtag->boundary = min(parent->boundary, + newtag->boundary = MIN(parent->boundary, newtag->boundary); if ((newtag->filter != NULL) || ((parent->flags & BUS_DMA_COULD_BOUNCE) != 0)) Modified: user/andre/tcp_workqueue/sys/arm/mv/mvreg.h ============================================================================== --- user/andre/tcp_workqueue/sys/arm/mv/mvreg.h Tue Mar 6 15:02:18 2012 (r232610) +++ user/andre/tcp_workqueue/sys/arm/mv/mvreg.h Tue Mar 6 15:05:59 2012 (r232611) @@ -34,132 +34,6 @@ #ifndef _MVREG_H_ #define _MVREG_H_ -/* - * Interrupt sources - */ -#if defined(SOC_MV_ORION) - -#define MV_INT_BRIDGE 0 /* AHB-MBus Bridge Interrupt */ -#define MV_INT_UART0 3 /* UART0 Interrupt */ -#define MV_INT_UART1 4 -#define MV_INT_GPIO7_0 6 /* GPIO[7:0] Interrupt */ -#define MV_INT_GPIO15_8 7 /* GPIO[15:8] Interrupt */ -#define MV_INT_GPIO23_16 8 /* GPIO[23:16] Interrupt */ -#define MV_INT_GPIO31_24 9 /* GPIO[31:24] Interrupt */ -#define MV_INT_PEX0_ERR 10 /* PCI Express Error */ -#define MV_INT_PEX0 11 /* PCI Express INTA,B,C,D Message */ -#define MV_INT_PCI_ERR 15 /* PCI Error */ -#define MV_INT_USB_BERR 16 /* USB Bridge Error */ -#define MV_INT_USB_CI 17 /* USB Controller interrupt */ -#define MV_INT_GBERX 18 /* GbE receive interrupt */ -#define MV_INT_GBETX 19 /* GbE transmit interrupt */ -#define MV_INT_GBEMISC 20 /* GbE misc. interrupt */ -#define MV_INT_GBESUM 21 /* GbE summary interrupt */ -#define MV_INT_GBEERR 22 /* GbE error interrupt */ -#define MV_INT_IDMA_ERR 23 /* DMA error interrupt */ -#define MV_INT_IDMA0 24 /* IDMA chan. 0 completion interrupt */ -#define MV_INT_IDMA1 25 /* IDMA chan. 1 completion interrupt */ -#define MV_INT_IDMA2 26 /* IDMA chan. 2 completion interrupt */ -#define MV_INT_IDMA3 27 /* IDMA chan. 3 completion interrupt */ -#define MV_INT_SATA 29 /* Serial-ATA Interrupt */ - -#elif defined(SOC_MV_KIRKWOOD) - -#define MV_INT_BRIDGE 1 /* AHB-MBus Bridge Interrupt */ -#define MV_INT_XOR0_CHAN0 5 /* XOR engine 0 channel 0 Interrupt */ -#define MV_INT_XOR0_CHAN1 6 /* XOR engine 0 channel 1 Interrupt */ -#define MV_INT_XOR1_CHAN0 7 /* XOR engine 1 channel 0 Interrupt */ -#define MV_INT_XOR1_CHAN1 8 /* XOR engine 1 channel 1 Interrupt */ -#define MV_INT_PEX0 9 /* PCI Express INTA,B,C,D Message */ -#define MV_INT_GBESUM 11 /* GbE0 summary interrupt */ -#define MV_INT_GBERX 12 /* GbE0 receive interrupt */ -#define MV_INT_GBETX 13 /* GbE0 transmit interrupt */ -#define MV_INT_GBEMISC 14 /* GbE0 misc. interrupt */ -#define MV_INT_GBE1SUM 15 /* GbE1 summary interrupt */ -#define MV_INT_GBE1RX 16 /* GbE1 receive interrupt */ -#define MV_INT_GBE1TX 17 /* GbE1 transmit interrupt */ -#define MV_INT_GBE1MISC 18 /* GbE1 misc. interrupt */ -#define MV_INT_USB_CI 19 /* USB Controller interrupt */ -#define MV_INT_SATA 21 /* Serial-ATA Interrupt */ -#define MV_INT_CESA 22 /* Security engine completion int. */ -#define MV_INT_IDMA_ERR 23 /* DMA error interrupt */ -#define MV_INT_UART0 33 /* UART0 Interrupt */ -#define MV_INT_UART1 34 -#define MV_INT_GPIO7_0 35 /* GPIO[7:0] Interrupt */ -#define MV_INT_GPIO15_8 36 /* GPIO[15:8] Interrupt */ -#define MV_INT_GPIO23_16 37 /* GPIO[23:16] Interrupt */ -#define MV_INT_GPIO31_24 38 /* GPIO[31:24] Interrupt */ -#define MV_INT_GPIOHI7_0 39 /* GPIOHI[7:0] Interrupt */ -#define MV_INT_GPIOHI15_8 40 /* GPIOHI[15:8] Interrupt */ -#define MV_INT_GPIOHI23_16 41 /* GPIOHI[23:16] Interrupt */ -#define MV_INT_XOR0_ERR 42 /* XOR engine 0 error Interrupt */ -#define MV_INT_XOR1_ERR 43 /* XOR engine 1 error Interrupt */ -#define MV_INT_PEX0_ERR 44 /* PCI Express Error */ -#define MV_INT_GBEERR 46 /* GbE0 error interrupt */ -#define MV_INT_GBE1ERR 47 /* GbE1 error interrupt */ -#define MV_INT_USB_BERR 48 /* USB Bridge Error */ - -#elif defined(SOC_MV_DISCOVERY) - -#define MV_INT_ERRSUM 0 /* Summary of error interrupts */ -#define MV_INT_SPI 1 /* SPI interrupt */ -#define MV_INT_TWSI0 2 /* TWSI0 interrupt */ -#define MV_INT_TWSI1 3 /* TWSI1 interrupt */ -#define MV_INT_IDMA0 4 /* IDMA Channel0 completion */ -#define MV_INT_IDMA1 5 /* IDMA Channel0 completion */ -#define MV_INT_IDMA2 6 /* IDMA Channel0 completion */ -#define MV_INT_IDMA3 7 /* IDMA Channel0 completion */ -#define MV_INT_TIMER0 8 /* Timer0 interrupt */ -#define MV_INT_TIMER1 9 /* Timer1 interrupt */ -#define MV_INT_TIMER2 10 /* Timer2 interrupt */ -#define MV_INT_TIMER3 11 /* Timer3 interrupt */ -#define MV_INT_UART0 12 /* UART0 interrupt */ -#define MV_INT_UART1 13 /* UART1 interrupt */ -#define MV_INT_UART2 14 /* UART2 interrupt */ -#define MV_INT_UART3 15 /* UART3 interrupt */ -#define MV_INT_USB0 16 /* USB0 interrupt */ -#define MV_INT_USB1 17 /* USB1 interrupt */ -#define MV_INT_USB2 18 /* USB2 interrupt */ -#define MV_INT_CESA 19 /* Crypto engine completion interrupt */ -#define MV_INT_XOR0 22 /* XOR engine 0 completion interrupt */ -#define MV_INT_XOR1 23 /* XOR engine 1 completion interrupt */ -#define MV_INT_SATA 26 /* SATA interrupt */ -#define MV_INT_PEX00 32 /* PCI Express port 0.0 INTA/B/C/D */ -#define MV_INT_PEX01 33 /* PCI Express port 0.1 INTA/B/C/D */ -#define MV_INT_PEX02 34 /* PCI Express port 0.2 INTA/B/C/D */ -#define MV_INT_PEX03 35 /* PCI Express port 0.3 INTA/B/C/D */ -#define MV_INT_PEX10 36 /* PCI Express port 1.0 INTA/B/C/D */ -#define MV_INT_PEX11 37 /* PCI Express port 1.1 INTA/B/C/D */ -#define MV_INT_PEX12 38 /* PCI Express port 1.2 INTA/B/C/D */ -#define MV_INT_PEX13 39 /* PCI Express port 1.3 INTA/B/C/D */ -#define MV_INT_GBESUM 40 /* Gigabit Ethernet Port 0 summary */ -#define MV_INT_GBERX 41 /* Gigabit Ethernet Port 0 Rx summary */ -#define MV_INT_GBETX 42 /* Gigabit Ethernet Port 0 Tx summary */ -#define MV_INT_GBEMISC 43 /* Gigabit Ethernet Port 0 Misc summ. */ -#define MV_INT_GBE1SUM 44 /* Gigabit Ethernet Port 1 summary */ -#define MV_INT_GBE1RX 45 /* Gigabit Ethernet Port 1 Rx summary */ -#define MV_INT_GBE1TX 46 /* Gigabit Ethernet Port 1 Tx summary */ -#define MV_INT_GBE1MISC 47 /* Gigabit Ethernet Port 1 Misc summ. */ -#define MV_INT_GPIO7_0 56 /* GPIO[7:0] Interrupt */ -#define MV_INT_GPIO15_8 57 /* GPIO[15:8] Interrupt */ -#define MV_INT_GPIO23_16 58 /* GPIO[23:16] Interrupt */ -#define MV_INT_GPIO31_24 59 /* GPIO[31:24] Interrupt */ -#define MV_INT_DB_IN 60 /* Inbound Doorbell Cause reg Summary */ -#define MV_INT_DB_OUT 61 /* Outbound Doorbell Cause reg Summ. */ -#define MV_INT_CRYPT_ERR 64 /* Crypto engine error */ -#define MV_INT_DEV_ERR 65 /* Device bus error */ -#define MV_INT_IDMA_ERR 66 /* DMA error */ -#define MV_INT_CPU_ERR 67 /* CPU error */ -#define MV_INT_PEX0_ERR 68 /* PCI-Express port0 error */ -#define MV_INT_PEX1_ERR 69 /* PCI-Express port1 error */ -#define MV_INT_GBE_ERR 70 /* Gigabit Ethernet error */ -#define MV_INT_USB_ERR 72 /* USB error */ -#define MV_INT_DRAM_ERR 73 /* DRAM ECC error */ -#define MV_INT_XOR_ERR 74 /* XOR engine error */ -#define MV_INT_WD 79 /* WD Timer interrupt */ - -#endif /* SOC_MV_ORION */ - #define BRIDGE_IRQ_CAUSE 0x10 #define BRIGDE_IRQ_MASK 0x14 Modified: user/andre/tcp_workqueue/sys/boot/fdt/dts/db78100.dts ============================================================================== --- user/andre/tcp_workqueue/sys/boot/fdt/dts/db78100.dts Tue Mar 6 15:02:18 2012 (r232610) +++ user/andre/tcp_workqueue/sys/boot/fdt/dts/db78100.dts Tue Mar 6 15:05:59 2012 (r232611) @@ -221,6 +221,9 @@ phy0: ethernet-phy@0 { reg = <0x8>; }; + phy1: ethernet-phy@1 { + reg = <0x9>; + }; }; }; @@ -234,17 +237,7 @@ local-mac-address = [ 00 00 00 00 00 00 ]; interrupts = <45 46 47 44 70>; interrupt-parent = <&PIC>; - phy-handle = <&phy0>; - - mdio@0 { - #address-cells = <1>; - #size-cells = <0>; - compatible = "mrvl,mdio"; - - phy0: ethernet-phy@0 { - reg = <0x9>; - }; - }; + phy-handle = <&phy1>; }; serial0: serial@12000 { Modified: user/andre/tcp_workqueue/sys/boot/i386/boot2/boot2.c ============================================================================== --- user/andre/tcp_workqueue/sys/boot/i386/boot2/boot2.c Tue Mar 6 15:02:18 2012 (r232610) +++ user/andre/tcp_workqueue/sys/boot/i386/boot2/boot2.c Tue Mar 6 15:05:59 2012 (r232611) @@ -128,7 +128,7 @@ static struct dsk { unsigned start; int init; } dsk; -static char cmd[512], cmddup[512]; +static char cmd[512], cmddup[512], knamebuf[1024]; static const char *kname; static uint32_t opts; static int comspeed = SIOSPD; @@ -223,7 +223,9 @@ main(void) { uint8_t autoboot; ino_t ino; + size_t nbyte; + opts = 0; kname = NULL; dmadat = (void *)(roundup2(__base + (int32_t)&_end, 0x10000) - __base); v86.ctl = V86_FLAGS; @@ -240,8 +242,10 @@ main(void) autoboot = 1; if ((ino = lookup(PATH_CONFIG)) || - (ino = lookup(PATH_DOTCONFIG))) - fsread(ino, cmd, sizeof(cmd)); + (ino = lookup(PATH_DOTCONFIG))) { + nbyte = fsread(ino, cmd, sizeof(cmd) - 1); + cmd[nbyte] = '\0'; + } if (*cmd) { memcpy(cmddup, cmd, sizeof(cmd)); @@ -258,9 +262,9 @@ main(void) * or in case of failure, try to load a kernel directly instead. */ - if (autoboot && !kname) { + if (!kname) { kname = PATH_BOOT3; - if (!keyhit(3*SECOND)) { + if (autoboot && !keyhit(3*SECOND)) { load(); kname = PATH_KERNEL; } @@ -457,7 +461,12 @@ parse() ? DRV_HARD : 0) + drv; dsk_meta = 0; } - kname = arg; + if ((i = ep - arg)) { + if ((size_t)i >= sizeof(knamebuf)) + return -1; + memcpy(knamebuf, arg, i + 1); + kname = knamebuf; + } } arg = p; } Modified: user/andre/tcp_workqueue/sys/cam/ctl/ctl.c ============================================================================== --- user/andre/tcp_workqueue/sys/cam/ctl/ctl.c Tue Mar 6 15:02:18 2012 (r232610) +++ user/andre/tcp_workqueue/sys/cam/ctl/ctl.c Tue Mar 6 15:05:59 2012 (r232611) @@ -1,7 +1,11 @@ /*- * Copyright (c) 2003-2009 Silicon Graphics International Corp. + * Copyright (c) 2012 The FreeBSD Foundation * All rights reserved. * + * Portions of this software were developed by Edward Tomasz Napierala + * under sponsorship from the FreeBSD Foundation. + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -4797,6 +4801,25 @@ ctl_lun_power_lock(struct ctl_be_lun *be return (0); } +void +ctl_lun_capacity_changed(struct ctl_be_lun *be_lun) +{ + struct ctl_lun *lun; + struct ctl_softc *softc; + int i; + + softc = control_softc; + + mtx_lock(&softc->ctl_lock); + + lun = (struct ctl_lun *)be_lun->ctl_lun; + + for (i = 0; i < CTL_MAX_INITIATORS; i++) + lun->pending_sense[i].ua_pending |= CTL_UA_CAPACITY_CHANGED; + + mtx_unlock(&softc->ctl_lock); +} + /* * Backend "memory move is complete" callback for requests that never * make it down to say RAIDCore's configuration code. Modified: user/andre/tcp_workqueue/sys/cam/ctl/ctl.h ============================================================================== --- user/andre/tcp_workqueue/sys/cam/ctl/ctl.h Tue Mar 6 15:02:18 2012 (r232610) +++ user/andre/tcp_workqueue/sys/cam/ctl/ctl.h Tue Mar 6 15:05:59 2012 (r232611) @@ -120,7 +120,8 @@ typedef enum { CTL_UA_RES_PREEMPT = 0x0200, CTL_UA_RES_RELEASE = 0x0400, CTL_UA_REG_PREEMPT = 0x0800, - CTL_UA_ASYM_ACC_CHANGE = 0x1000 + CTL_UA_ASYM_ACC_CHANGE = 0x1000, + CTL_UA_CAPACITY_CHANGED = 0x2000 } ctl_ua_type; #ifdef _KERNEL Modified: user/andre/tcp_workqueue/sys/cam/ctl/ctl_backend.h ============================================================================== --- user/andre/tcp_workqueue/sys/cam/ctl/ctl_backend.h Tue Mar 6 15:02:18 2012 (r232610) +++ user/andre/tcp_workqueue/sys/cam/ctl/ctl_backend.h Tue Mar 6 15:05:59 2012 (r232611) @@ -280,6 +280,11 @@ int ctl_lun_power_lock(struct ctl_be_lun int ctl_lun_offline(struct ctl_be_lun *be_lun); int ctl_lun_online(struct ctl_be_lun *be_lun); +/* + * Let the backend notify the initiator about changed capacity. + */ +void ctl_lun_capacity_changed(struct ctl_be_lun *be_lun); + #endif /* _KERNEL */ #endif /* _CTL_BACKEND_H_ */ Modified: user/andre/tcp_workqueue/sys/cam/ctl/ctl_backend_block.c ============================================================================== --- user/andre/tcp_workqueue/sys/cam/ctl/ctl_backend_block.c Tue Mar 6 15:02:18 2012 (r232610) +++ user/andre/tcp_workqueue/sys/cam/ctl/ctl_backend_block.c Tue Mar 6 15:05:59 2012 (r232611) @@ -1,8 +1,12 @@ /*- * Copyright (c) 2003 Silicon Graphics International Corp. * Copyright (c) 2009-2011 Spectra Logic Corporation + * Copyright (c) 2012 The FreeBSD Foundation * All rights reserved. * + * Portions of this software were developed by Edward Tomasz Napierala + * under sponsorship from the FreeBSD Foundation. + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -250,6 +254,12 @@ static int ctl_be_block_create(struct ct struct ctl_lun_req *req); static int ctl_be_block_rm(struct ctl_be_block_softc *softc, struct ctl_lun_req *req); +static int ctl_be_block_modify_file(struct ctl_be_block_lun *be_lun, + struct ctl_lun_req *req); +static int ctl_be_block_modify_dev(struct ctl_be_block_lun *be_lun, + struct ctl_lun_req *req); +static int ctl_be_block_modify(struct ctl_be_block_softc *softc, + struct ctl_lun_req *req); static void ctl_be_block_lun_shutdown(void *be_lun); static void ctl_be_block_lun_config_status(void *be_lun, ctl_lun_config_status status); @@ -1263,6 +1273,9 @@ ctl_be_block_ioctl(struct cdev *dev, u_l case CTL_LUNREQ_RM: error = ctl_be_block_rm(softc, lun_req); break; + case CTL_LUNREQ_MODIFY: + error = ctl_be_block_modify(softc, lun_req); + break; default: lun_req->status = CTL_LUN_ERROR; snprintf(lun_req->error_str, sizeof(lun_req->error_str), @@ -1321,7 +1334,10 @@ ctl_be_block_open_file(struct ctl_be_blo file_data->cred = crhold(curthread->td_ucred); - be_lun->size_bytes = vattr.va_size; + if (params->lun_size_bytes != 0) + be_lun->size_bytes = params->lun_size_bytes; + else + be_lun->size_bytes = vattr.va_size; /* * We set the multi thread flag for file operations because all * filesystems (in theory) are capable of allowing multiple readers @@ -1446,15 +1462,27 @@ ctl_be_block_open_dev(struct ctl_be_bloc curthread); if (error) { snprintf(req->error_str, sizeof(req->error_str), - "%s: error %d returned for DIOCGMEDIASIZE ioctl " - "on %s!", __func__, error, be_lun->dev_path); + "%s: error %d returned for DIOCGMEDIASIZE " + " ioctl on %s!", __func__, error, + be_lun->dev_path); return (error); } - return (0); + if (params->lun_size_bytes != 0) { + if (params->lun_size_bytes > be_lun->size_bytes) { + snprintf(req->error_str, sizeof(req->error_str), + "%s: requested LUN size %ju > backing device " + "size %ju", __func__, + (uintmax_t)params->lun_size_bytes, + (uintmax_t)be_lun->size_bytes); + return (EINVAL); + } -} + be_lun->size_bytes = params->lun_size_bytes; + } + return (0); +} static int ctl_be_block_close(struct ctl_be_block_lun *be_lun) @@ -1599,7 +1627,6 @@ ctl_be_block_open(struct ctl_be_block_so be_lun->size_blocks = be_lun->size_bytes >> be_lun->blocksize_shift; return (0); - } static int @@ -2007,6 +2034,155 @@ bailout_error: return (0); } +static int +ctl_be_block_modify_file(struct ctl_be_block_lun *be_lun, + struct ctl_lun_req *req) +{ + struct vattr vattr; + int error; + struct ctl_lun_modify_params *params; + + params = &req->reqdata.modify; + + if (params->lun_size_bytes != 0) { + be_lun->size_bytes = params->lun_size_bytes; + } else { + error = VOP_GETATTR(be_lun->vn, &vattr, curthread->td_ucred); + if (error != 0) { + snprintf(req->error_str, sizeof(req->error_str), + "error calling VOP_GETATTR() for file %s", + be_lun->dev_path); + return (error); + } + + be_lun->size_bytes = vattr.va_size; + } + + return (0); +} + +static int +ctl_be_block_modify_dev(struct ctl_be_block_lun *be_lun, + struct ctl_lun_req *req) +{ + struct cdev *dev; + struct cdevsw *devsw; + int error; + struct ctl_lun_modify_params *params; + uint64_t size_bytes; + + params = &req->reqdata.modify; + + dev = be_lun->vn->v_rdev; + devsw = dev->si_devsw; + if (!devsw->d_ioctl) { + snprintf(req->error_str, sizeof(req->error_str), + "%s: no d_ioctl for device %s!", __func__, + be_lun->dev_path); + return (ENODEV); + } + + error = devsw->d_ioctl(dev, DIOCGMEDIASIZE, + (caddr_t)&size_bytes, FREAD, + curthread); + if (error) { + snprintf(req->error_str, sizeof(req->error_str), + "%s: error %d returned for DIOCGMEDIASIZE ioctl " + "on %s!", __func__, error, be_lun->dev_path); + return (error); + } + + if (params->lun_size_bytes != 0) { + if (params->lun_size_bytes > size_bytes) { + snprintf(req->error_str, sizeof(req->error_str), + "%s: requested LUN size %ju > backing device " + "size %ju", __func__, + (uintmax_t)params->lun_size_bytes, + (uintmax_t)size_bytes); + return (EINVAL); + } + + be_lun->size_bytes = params->lun_size_bytes; + } else { + be_lun->size_bytes = size_bytes; + } + + return (0); +} + +static int +ctl_be_block_modify(struct ctl_be_block_softc *softc, struct ctl_lun_req *req) +{ + struct ctl_lun_modify_params *params; + struct ctl_be_block_lun *be_lun; + int vfs_is_locked, error; + + params = &req->reqdata.modify; + + mtx_lock(&softc->lock); + + be_lun = NULL; + + STAILQ_FOREACH(be_lun, &softc->lun_list, links) { + if (be_lun->ctl_be_lun.lun_id == params->lun_id) + break; + } + mtx_unlock(&softc->lock); + + if (be_lun == NULL) { + snprintf(req->error_str, sizeof(req->error_str), + "%s: LUN %u is not managed by the block backend", + __func__, params->lun_id); + goto bailout_error; + } + + if (params->lun_size_bytes != 0) { + if (params->lun_size_bytes < be_lun->blocksize) { + snprintf(req->error_str, sizeof(req->error_str), + "%s: LUN size %ju < blocksize %u", __func__, + params->lun_size_bytes, be_lun->blocksize); + goto bailout_error; + } + } + + vfs_is_locked = VFS_LOCK_GIANT(be_lun->vn->v_mount); + vn_lock(be_lun->vn, LK_SHARED | LK_RETRY); + + if (be_lun->vn->v_type == VREG) + error = ctl_be_block_modify_file(be_lun, req); + else + error = ctl_be_block_modify_dev(be_lun, req); + + VOP_UNLOCK(be_lun->vn, 0); + VFS_UNLOCK_GIANT(vfs_is_locked); + + if (error != 0) + goto bailout_error; + + be_lun->size_blocks = be_lun->size_bytes >> be_lun->blocksize_shift; + + /* + * The maximum LBA is the size - 1. + * + * XXX: Note that this field is being updated without locking, + * which might cause problems on 32-bit architectures. + */ + be_lun->ctl_be_lun.maxlba = be_lun->size_blocks - 1; + ctl_lun_capacity_changed(&be_lun->ctl_be_lun); + + /* Tell the user the exact size we ended up using */ + params->lun_size_bytes = be_lun->size_bytes; + + req->status = CTL_LUN_OK; + + return (0); + +bailout_error: + req->status = CTL_LUN_ERROR; + + return (0); +} + static void ctl_be_block_lun_shutdown(void *be_lun) { Modified: user/andre/tcp_workqueue/sys/cam/ctl/ctl_backend_ramdisk.c ============================================================================== --- user/andre/tcp_workqueue/sys/cam/ctl/ctl_backend_ramdisk.c Tue Mar 6 15:02:18 2012 (r232610) +++ user/andre/tcp_workqueue/sys/cam/ctl/ctl_backend_ramdisk.c Tue Mar 6 15:05:59 2012 (r232611) @@ -1,7 +1,11 @@ /*- * Copyright (c) 2003, 2008 Silicon Graphics International Corp. + * Copyright (c) 2012 The FreeBSD Foundation * All rights reserved. * + * Portions of this software were developed by Edward Tomasz Napierala + * under sponsorship from the FreeBSD Foundation. + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -102,6 +106,8 @@ static int ctl_backend_ramdisk_rm(struct struct ctl_lun_req *req); static int ctl_backend_ramdisk_create(struct ctl_be_ramdisk_softc *softc, struct ctl_lun_req *req, int do_wait); +static int ctl_backend_ramdisk_modify(struct ctl_be_ramdisk_softc *softc, + struct ctl_lun_req *req); static void ctl_backend_ramdisk_lun_shutdown(void *be_lun); static void ctl_backend_ramdisk_lun_config_status(void *be_lun, ctl_lun_config_status status); @@ -376,6 +382,9 @@ ctl_backend_ramdisk_ioctl(struct cdev *d case CTL_LUNREQ_RM: retval = ctl_backend_ramdisk_rm(softc, lun_req); break; + case CTL_LUNREQ_MODIFY: + retval = ctl_backend_ramdisk_modify(softc, lun_req); + break; default: lun_req->status = CTL_LUN_ERROR; snprintf(lun_req->error_str, sizeof(lun_req->error_str), @@ -666,6 +675,73 @@ bailout_error: return (retval); } +static int +ctl_backend_ramdisk_modify(struct ctl_be_ramdisk_softc *softc, + struct ctl_lun_req *req) +{ + struct ctl_be_ramdisk_lun *be_lun; + struct ctl_lun_modify_params *params; + uint32_t blocksize; + + params = &req->reqdata.modify; + + be_lun = NULL; + + mtx_lock(&softc->lock); + STAILQ_FOREACH(be_lun, &softc->lun_list, links) { + if (be_lun->ctl_be_lun.lun_id == params->lun_id) + break; + } + mtx_unlock(&softc->lock); + + if (be_lun == NULL) { + snprintf(req->error_str, sizeof(req->error_str), + "%s: LUN %u is not managed by the ramdisk backend", + __func__, params->lun_id); + goto bailout_error; + } + + if (params->lun_size_bytes == 0) { + snprintf(req->error_str, sizeof(req->error_str), + "%s: LUN size \"auto\" not supported " + "by the ramdisk backend", __func__); + goto bailout_error; + } + + blocksize = be_lun->ctl_be_lun.blocksize; + + if (params->lun_size_bytes < blocksize) { + snprintf(req->error_str, sizeof(req->error_str), + "%s: LUN size %ju < blocksize %u", __func__, + params->lun_size_bytes, blocksize); + goto bailout_error; + } + + be_lun->size_blocks = params->lun_size_bytes / blocksize; + be_lun->size_bytes = be_lun->size_blocks * blocksize; + + /* + * The maximum LBA is the size - 1. + * + * XXX: Note that this field is being updated without locking, + * which might cause problems on 32-bit architectures. + */ + be_lun->ctl_be_lun.maxlba = be_lun->size_blocks - 1; + ctl_lun_capacity_changed(&be_lun->ctl_be_lun); + + /* Tell the user the exact size we ended up using */ + params->lun_size_bytes = be_lun->size_bytes; + + req->status = CTL_LUN_OK; + + return (0); + +bailout_error: + req->status = CTL_LUN_ERROR; + + return (0); +} + static void *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201203061505.q26F5xNn045635>