From owner-svn-src-projects@FreeBSD.ORG Sun Dec 12 20:48:08 2010 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 92715106566B; Sun, 12 Dec 2010 20:48:08 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7F6108FC17; Sun, 12 Dec 2010 20:48:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBCKm8w3056947; Sun, 12 Dec 2010 20:48:08 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBCKm80G056936; Sun, 12 Dec 2010 20:48:08 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201012122048.oBCKm80G056936@svn.freebsd.org> From: Sean Bruno Date: Sun, 12 Dec 2010 20:48:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216396 - in projects/stable_7_xen/sys: conf i386/conf i386/include i386/include/xen i386/xen xen/evtchn X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Dec 2010 20:48:08 -0000 Author: sbruno Date: Sun Dec 12 20:48:08 2010 New Revision: 216396 URL: http://svn.freebsd.org/changeset/base/216396 Log: Add non-compiling Xen DomU code here. I love it when I get in over my head. Added: projects/stable_7_xen/sys/i386/conf/XEN projects/stable_7_xen/sys/i386/include/xen/ projects/stable_7_xen/sys/i386/include/xen/features.h projects/stable_7_xen/sys/i386/include/xen/hypercall.h projects/stable_7_xen/sys/i386/include/xen/synch_bitops.h projects/stable_7_xen/sys/i386/include/xen/xen-os.h projects/stable_7_xen/sys/i386/include/xen/xen_clock_util.h projects/stable_7_xen/sys/i386/include/xen/xenfunc.h projects/stable_7_xen/sys/i386/include/xen/xenpmap.h projects/stable_7_xen/sys/i386/include/xen/xenstored.h projects/stable_7_xen/sys/i386/include/xen/xenvar.h projects/stable_7_xen/sys/i386/xen/ projects/stable_7_xen/sys/i386/xen/clock.c projects/stable_7_xen/sys/i386/xen/exception.s projects/stable_7_xen/sys/i386/xen/locore.s projects/stable_7_xen/sys/i386/xen/mp_machdep.c projects/stable_7_xen/sys/i386/xen/mptable.c projects/stable_7_xen/sys/i386/xen/pmap.c projects/stable_7_xen/sys/i386/xen/xen_clock_util.c projects/stable_7_xen/sys/i386/xen/xen_machdep.c projects/stable_7_xen/sys/i386/xen/xen_rtc.c Modified: projects/stable_7_xen/sys/conf/options.i386 projects/stable_7_xen/sys/i386/include/atomic.h projects/stable_7_xen/sys/i386/include/pcpu.h projects/stable_7_xen/sys/i386/include/pmap.h projects/stable_7_xen/sys/xen/evtchn/evtchn.c Modified: projects/stable_7_xen/sys/conf/options.i386 ============================================================================== --- projects/stable_7_xen/sys/conf/options.i386 Sun Dec 12 16:56:16 2010 (r216395) +++ projects/stable_7_xen/sys/conf/options.i386 Sun Dec 12 20:48:08 2010 (r216396) @@ -149,3 +149,6 @@ STOP_NMI opt_cpu.h # BPF just-in-time compiler BPF_JITTER opt_bpf.h + +# Xen DomU Support +XEN opt_global.h Added: projects/stable_7_xen/sys/i386/conf/XEN ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/stable_7_xen/sys/i386/conf/XEN Sun Dec 12 20:48:08 2010 (r216396) @@ -0,0 +1,89 @@ +# +# XEN -- Kernel configuration for i386 XEN DomU +# +# $FreeBSD: stable/8/sys/i386/conf/XEN 216008 2010-11-28 16:25:16Z cperciva $ + +cpu I686_CPU +ident XEN + +makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols +makeoptions MODULES_OVERRIDE="" + +options SCHED_ULE # ULE scheduler +options PREEMPTION # Enable kernel thread preemption +#options SCHED_4BSD + +options INET # InterNETworking +options INET6 # IPv6 communications protocols +options SCTP # Stream Control Transmission Protocol +options FFS # Berkeley Fast Filesystem +options SOFTUPDATES # Enable FFS soft updates support +options UFS_ACL # Support for access control lists +options UFS_DIRHASH # Improve performance on big directories +options UFS_GJOURNAL # Enable gjournal-based UFS journaling +options NFSCLIENT # Network Filesystem Client +options NFSSERVER # Network Filesystem Server +options NFSLOCKD # Network Lock Manager +options NFS_ROOT # NFS usable as /, requires NFSCLIENT +options MSDOSFS # MSDOS Filesystem +options CD9660 # ISO 9660 Filesystem +options PROCFS # Process filesystem (requires PSEUDOFS) +options PSEUDOFS # Pseudo-filesystem framework +options GEOM_PART_GPT # GUID Partition Tables. +options GEOM_LABEL # Provides labelization +options COMPAT_43TTY # BSD 4.3 TTY compat (sgtty) +options COMPAT_FREEBSD4 # Compatible with FreeBSD4 +options COMPAT_FREEBSD5 # Compatible with FreeBSD5 +options COMPAT_FREEBSD6 # Compatible with FreeBSD6 +options KTRACE # ktrace(1) support +options STACK # stack(9) support +options SYSVSHM # SYSV-style shared memory +options SYSVMSG # SYSV-style message queues +options SYSVSEM # SYSV-style semaphores +options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions +options KBD_INSTALL_CDEV # install a CDEV entry in /dev +options AUDIT # Security event auditing + +# Debugging for use in -current +options KDB # Enable kernel debugger support. +options DDB # Support DDB. +options GDB # Support remote GDB. +options INVARIANTS # Enable calls of extra sanity checking +options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS +options WITNESS # Enable checks to detect deadlocks and cycles +options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed + +options PAE +nooption NATIVE +option XEN +nodevice atpic +nodevice isa +options MCLSHIFT=12 + +# To make an SMP kernel, the next two lines are needed +options SMP # Symmetric MultiProcessor Kernel +device apic # I/O APIC + + +#device atkbdc # AT keyboard controller +#device atkbd # AT keyboard +device psm # PS/2 mouse +device pci + +#device kbdmux # keyboard multiplexer + +# Pseudo devices. +device loop # Network loopback +device random # Entropy device +device ether # Ethernet support +device tun # Packet tunnel. +device pty # Pseudo-ttys (telnet etc) +device md # Memory "disks" +device gif # IPv6 and IPv4 tunneling +device faith # IPv6-to-IPv4 relaying (translation) + +# The `bpf' device enables the Berkeley Packet Filter. +# Be aware of the administrative consequences of enabling this! +# Note that 'bpf' is required for DHCP. +device bpf # Berkeley packet filter + Modified: projects/stable_7_xen/sys/i386/include/atomic.h ============================================================================== --- projects/stable_7_xen/sys/i386/include/atomic.h Sun Dec 12 16:56:16 2010 (r216395) +++ projects/stable_7_xen/sys/i386/include/atomic.h Sun Dec 12 20:48:08 2010 (r216396) @@ -32,6 +32,10 @@ #error this file needs sys/cdefs.h as a prerequisite #endif +#define mb() __asm __volatile("lock; addl $0,(%%esp)" : : : "memory") +#define wmb() __asm __volatile("lock; addl $0,(%%esp)" : : : "memory") +#define rmb() __asm __volatile("lock; addl $0,(%%esp)" : : : "memory") + /* * Various simple operations on memory, each of which is atomic in the * presence of interrupts and multiple processors. Modified: projects/stable_7_xen/sys/i386/include/pcpu.h ============================================================================== --- projects/stable_7_xen/sys/i386/include/pcpu.h Sun Dec 12 16:56:16 2010 (r216395) +++ projects/stable_7_xen/sys/i386/include/pcpu.h Sun Dec 12 20:48:08 2010 (r216396) @@ -43,6 +43,39 @@ * to each CPU's data can be set up for things like "check curproc on all * other processors" */ + +#ifdef XEN +#ifndef NR_VIRQS +#define NR_VIRQS 24 +#endif +#ifndef NR_IPIS +#define NR_IPIS 2 +#endif + +/* These are peridically updated in shared_info, and then copied here. */ +struct shadow_time_info { + uint64_t tsc_timestamp; /* TSC at last update of time vals. */ + uint64_t system_timestamp; /* Time, in nanosecs, since boot. */ + uint32_t tsc_to_nsec_mul; + uint32_t tsc_to_usec_mul; + int tsc_shift; + uint32_t version; +}; + +#define PCPU_XEN_FIELDS \ + ; \ + u_int pc_cr3; /* track cr3 for R1/R3*/ \ + vm_paddr_t *pc_pdir_shadow; \ + uint64_t pc_processed_system_time; \ + struct shadow_time_info pc_shadow_time; \ + int pc_resched_irq; \ + int pc_callfunc_irq; \ + int pc_virq_to_irq[NR_VIRQS]; \ + int pc_ipi_to_irq[NR_IPIS] +#else +#define PCPU_XEN_FIELDS +#endif + #define PCPU_MD_FIELDS \ struct pcpu *pc_prvspace; /* Self-reference */ \ struct pmap *pc_curpmap; \ @@ -55,6 +88,7 @@ u_int pc_apic_id; \ int pc_private_tss; /* Flag indicating private tss*/\ u_int pc_cmci_mask /* MCx banks for CMCI */ \ + PCPU_XEN_FIELDS #ifdef _KERNEL Modified: projects/stable_7_xen/sys/i386/include/pmap.h ============================================================================== --- projects/stable_7_xen/sys/i386/include/pmap.h Sun Dec 12 16:56:16 2010 (r216395) +++ projects/stable_7_xen/sys/i386/include/pmap.h Sun Dec 12 20:48:08 2010 (r216396) @@ -189,9 +189,7 @@ extern pd_entry_t PTDpde[]; extern pdpt_entry_t *IdlePDPT; #endif extern pd_entry_t *IdlePTD; /* physical address of "Idle" state directory */ -#endif -#ifdef _KERNEL /* * Translate a virtual address to the kernel virtual address of its page table * entry (PTE). This can be used recursively. If the address of a PTE as @@ -210,6 +208,72 @@ extern pd_entry_t *IdlePTD; /* physical */ #define vtophys(va) pmap_kextract((vm_offset_t)(va)) +#ifdef XEN +#include +#include +#include +#include + +extern pt_entry_t pg_nx; + +#define PG_KERNEL (PG_V | PG_A | PG_RW | PG_M) + +#define MACH_TO_VM_PAGE(ma) PHYS_TO_VM_PAGE(xpmap_mtop((ma))) +#define VM_PAGE_TO_MACH(m) xpmap_ptom(VM_PAGE_TO_PHYS((m))) + +static __inline vm_paddr_t +pmap_kextract_ma(vm_offset_t va) +{ + vm_paddr_t ma; + if ((ma = PTD[va >> PDRSHIFT]) & PG_PS) { + ma = (ma & ~(NBPDR - 1)) | (va & (NBPDR - 1)); + } else { + ma = (*vtopte(va) & PG_FRAME) | (va & PAGE_MASK); + } + return ma; +} + +static __inline vm_paddr_t +pmap_kextract(vm_offset_t va) +{ + return xpmap_mtop(pmap_kextract_ma(va)); +} +#define vtomach(va) pmap_kextract_ma(((vm_offset_t) (va))) + +vm_paddr_t pmap_extract_ma(struct pmap *pmap, vm_offset_t va); + +void pmap_kenter_ma(vm_offset_t va, vm_paddr_t pa); +void pmap_map_readonly(struct pmap *pmap, vm_offset_t va, int len); +void pmap_map_readwrite(struct pmap *pmap, vm_offset_t va, int len); + +static __inline pt_entry_t +pte_load_store(pt_entry_t *ptep, pt_entry_t v) +{ + pt_entry_t r; + + v = xpmap_ptom(v); + r = *ptep; + PT_SET_VA(ptep, v, TRUE); + return (r); +} + +static __inline pt_entry_t +pte_load_store_ma(pt_entry_t *ptep, pt_entry_t v) +{ + pt_entry_t r; + + r = *ptep; + PT_SET_VA_MA(ptep, v, TRUE); + return (r); +} + +#define pte_load_clear(ptep) pte_load_store((ptep), (pt_entry_t)0ULL) + +#define pte_store(ptep, pte) pte_load_store((ptep), (pt_entry_t)pte) +#define pte_store_ma(ptep, pte) pte_load_store_ma((ptep), (pt_entry_t)pte) +#define pde_store_ma(ptep, pte) pte_load_store_ma((ptep), (pt_entry_t)pte) + +#elif !defined(XEN) /* * KPTmap is a linear mapping of the kernel page table. It differs from the @@ -251,7 +315,10 @@ pmap_kextract(vm_offset_t va) return (pa); } -#ifdef PAE +#define PT_UPDATES_FLUSH() +#endif + +#if defined(PAE) && !defined(XEN) #define pde_cmpset(pdep, old, new) \ atomic_cmpset_64((pdep), (old), (new)) @@ -310,7 +377,7 @@ atomic_cmpset_64(volatile uint64_t *dst, extern pt_entry_t pg_nx; -#else /* PAE */ +#elif !defined(PAE) && !defined (XEN) #define pde_cmpset(pdep, old, new) \ atomic_cmpset_int((pdep), (old), (new)) Added: projects/stable_7_xen/sys/i386/include/xen/features.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/stable_7_xen/sys/i386/include/xen/features.h Sun Dec 12 20:48:08 2010 (r216396) @@ -0,0 +1,22 @@ +/****************************************************************************** + * features.h + * + * Query the features reported by Xen. + * + * Copyright (c) 2006, Ian Campbell + * + * $FreeBSD: stable/8/sys/i386/include/xen/features.h 181638 2008-08-12 19:41:11Z kmacy $ + */ + +#ifndef __ASM_XEN_FEATURES_H__ +#define __ASM_XEN_FEATURES_H__ + +#include + +extern void setup_xen_features(void); + +extern uint8_t xen_features[XENFEAT_NR_SUBMAPS * 32]; + +#define xen_feature(flag) (xen_features[flag]) + +#endif /* __ASM_XEN_FEATURES_H__ */ Added: projects/stable_7_xen/sys/i386/include/xen/hypercall.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/stable_7_xen/sys/i386/include/xen/hypercall.h Sun Dec 12 20:48:08 2010 (r216396) @@ -0,0 +1,405 @@ +/****************************************************************************** + * hypercall.h + * + * Linux-specific hypervisor handling. + * + * Copyright (c) 2002-2004, K A Fraser + * + * This file may be distributed separately from the Linux kernel, or + * incorporated into other software packages, subject to the following license: + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this source file (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, copy, modify, + * merge, publish, distribute, sublicense, and/or sell copies of the Software, + * and to permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + */ + +#ifndef __HYPERCALL_H__ +#define __HYPERCALL_H__ + +#include +#include +#include + +#define __STR(x) #x +#define STR(x) __STR(x) +#define ENOXENSYS 38 +#define CONFIG_XEN_COMPAT 0x030002 + + +#if defined(XEN) +#define HYPERCALL_STR(name) \ + "call hypercall_page + ("STR(__HYPERVISOR_##name)" * 32)" +#else +#define HYPERCALL_STR(name) \ + "mov hypercall_stubs,%%eax; " \ + "add $("STR(__HYPERVISOR_##name)" * 32),%%eax; " \ + "call *%%eax" +#endif + +#define _hypercall0(type, name) \ +({ \ + long __res; \ + __asm__ volatile ( \ + HYPERCALL_STR(name) \ + : "=a" (__res) \ + : \ + : "memory" ); \ + (type)__res; \ +}) + +#define _hypercall1(type, name, a1) \ +({ \ + long __res, __ign1; \ + __asm__ volatile ( \ + HYPERCALL_STR(name) \ + : "=a" (__res), "=b" (__ign1) \ + : "1" ((long)(a1)) \ + : "memory" ); \ + (type)__res; \ +}) + +#define _hypercall2(type, name, a1, a2) \ +({ \ + long __res, __ign1, __ign2; \ + __asm__ volatile ( \ + HYPERCALL_STR(name) \ + : "=a" (__res), "=b" (__ign1), "=c" (__ign2) \ + : "1" ((long)(a1)), "2" ((long)(a2)) \ + : "memory" ); \ + (type)__res; \ +}) + +#define _hypercall3(type, name, a1, a2, a3) \ +({ \ + long __res, __ign1, __ign2, __ign3; \ + __asm__ volatile ( \ + HYPERCALL_STR(name) \ + : "=a" (__res), "=b" (__ign1), "=c" (__ign2), \ + "=d" (__ign3) \ + : "1" ((long)(a1)), "2" ((long)(a2)), \ + "3" ((long)(a3)) \ + : "memory" ); \ + (type)__res; \ +}) + +#define _hypercall4(type, name, a1, a2, a3, a4) \ +({ \ + long __res, __ign1, __ign2, __ign3, __ign4; \ + __asm__ volatile ( \ + HYPERCALL_STR(name) \ + : "=a" (__res), "=b" (__ign1), "=c" (__ign2), \ + "=d" (__ign3), "=S" (__ign4) \ + : "1" ((long)(a1)), "2" ((long)(a2)), \ + "3" ((long)(a3)), "4" ((long)(a4)) \ + : "memory" ); \ + (type)__res; \ +}) + +#define _hypercall5(type, name, a1, a2, a3, a4, a5) \ +({ \ + long __res, __ign1, __ign2, __ign3, __ign4, __ign5; \ + __asm__ volatile ( \ + HYPERCALL_STR(name) \ + : "=a" (__res), "=b" (__ign1), "=c" (__ign2), \ + "=d" (__ign3), "=S" (__ign4), "=D" (__ign5) \ + : "1" ((long)(a1)), "2" ((long)(a2)), \ + "3" ((long)(a3)), "4" ((long)(a4)), \ + "5" ((long)(a5)) \ + : "memory" ); \ + (type)__res; \ +}) + +static inline int +HYPERVISOR_set_trap_table( + trap_info_t *table) +{ + return _hypercall1(int, set_trap_table, table); +} + +static inline int +HYPERVISOR_mmu_update( + mmu_update_t *req, int count, int *success_count, domid_t domid) +{ + return _hypercall4(int, mmu_update, req, count, success_count, domid); +} + +static inline int +HYPERVISOR_mmuext_op( + mmuext_op_t *op, int count, int *success_count, domid_t domid) +{ + return _hypercall4(int, mmuext_op, op, count, success_count, domid); +} + +static inline int +HYPERVISOR_set_gdt( + unsigned long *frame_list, int entries) +{ + return _hypercall2(int, set_gdt, frame_list, entries); +} + +static inline int +HYPERVISOR_stack_switch( + unsigned long ss, unsigned long esp) +{ + return _hypercall2(int, stack_switch, ss, esp); +} + +static inline int +HYPERVISOR_set_callbacks( + unsigned long event_selector, unsigned long event_address, + unsigned long failsafe_selector, unsigned long failsafe_address) +{ + return _hypercall4(int, set_callbacks, + event_selector, event_address, + failsafe_selector, failsafe_address); +} + +static inline int +HYPERVISOR_fpu_taskswitch( + int set) +{ + return _hypercall1(int, fpu_taskswitch, set); +} + +static inline int +HYPERVISOR_sched_op_compat( + int cmd, unsigned long arg) +{ + return _hypercall2(int, sched_op_compat, cmd, arg); +} + +static inline int +HYPERVISOR_sched_op( + int cmd, void *arg) +{ + return _hypercall2(int, sched_op, cmd, arg); +} + +static inline long +HYPERVISOR_set_timer_op( + uint64_t timeout) +{ + unsigned long timeout_hi = (unsigned long)(timeout>>32); + unsigned long timeout_lo = (unsigned long)timeout; + return _hypercall2(long, set_timer_op, timeout_lo, timeout_hi); +} +#if 0 +static inline int +HYPERVISOR_platform_op( + struct xen_platform_op *platform_op) +{ + platform_op->interface_version = XENPF_INTERFACE_VERSION; + return _hypercall1(int, platform_op, platform_op); +} +#endif +static inline int +HYPERVISOR_set_debugreg( + int reg, unsigned long value) +{ + return _hypercall2(int, set_debugreg, reg, value); +} + +static inline unsigned long +HYPERVISOR_get_debugreg( + int reg) +{ + return _hypercall1(unsigned long, get_debugreg, reg); +} + +static inline int +HYPERVISOR_update_descriptor( + uint64_t ma, uint64_t desc) +{ + return _hypercall4(int, update_descriptor, ma, ma>>32, desc, desc>>32); +} + +static inline int +HYPERVISOR_memory_op( + unsigned int cmd, void *arg) +{ + return _hypercall2(int, memory_op, cmd, arg); +} + +static inline int +HYPERVISOR_multicall( + void *call_list, int nr_calls) +{ + return _hypercall2(int, multicall, call_list, nr_calls); +} + +static inline int +HYPERVISOR_update_va_mapping( + unsigned long va, uint64_t new_val, unsigned long flags) +{ + uint32_t hi, lo; + + lo = (uint32_t)(new_val & 0xffffffff); + hi = (uint32_t)(new_val >> 32); + + return _hypercall4(int, update_va_mapping, va, + lo, hi, flags); +} + +static inline int +HYPERVISOR_event_channel_op( + int cmd, void *arg) +{ + int rc = _hypercall2(int, event_channel_op, cmd, arg); + +#if CONFIG_XEN_COMPAT <= 0x030002 + if (__predict_false(rc == -ENOXENSYS)) { + struct evtchn_op op; + op.cmd = cmd; + memcpy(&op.u, arg, sizeof(op.u)); + rc = _hypercall1(int, event_channel_op_compat, &op); + memcpy(arg, &op.u, sizeof(op.u)); + } +#endif + return (rc); +} + +static inline int +HYPERVISOR_xen_version( + int cmd, void *arg) +{ + return _hypercall2(int, xen_version, cmd, arg); +} + +static inline int +HYPERVISOR_console_io( + int cmd, int count, char *str) +{ + return _hypercall3(int, console_io, cmd, count, str); +} + +static inline int +HYPERVISOR_physdev_op( + int cmd, void *arg) +{ + int rc = _hypercall2(int, physdev_op, cmd, arg); +#if CONFIG_XEN_COMPAT <= 0x030002 + if (__predict_false(rc == -ENOXENSYS)) { + struct physdev_op op; + op.cmd = cmd; + memcpy(&op.u, arg, sizeof(op.u)); + rc = _hypercall1(int, physdev_op_compat, &op); + memcpy(arg, &op.u, sizeof(op.u)); + } +#endif + return (rc); +} + +static inline int +HYPERVISOR_grant_table_op( + unsigned int cmd, void *uop, unsigned int count) +{ + return _hypercall3(int, grant_table_op, cmd, uop, count); +} + +static inline int +HYPERVISOR_update_va_mapping_otherdomain( + unsigned long va, uint64_t new_val, unsigned long flags, domid_t domid) +{ + uint32_t hi, lo; + + lo = (uint32_t)(new_val & 0xffffffff); + hi = (uint32_t)(new_val >> 32); + + return _hypercall5(int, update_va_mapping_otherdomain, va, + lo, hi, flags, domid); +} + +static inline int +HYPERVISOR_vm_assist( + unsigned int cmd, unsigned int type) +{ + return _hypercall2(int, vm_assist, cmd, type); +} + +static inline int +HYPERVISOR_vcpu_op( + int cmd, int vcpuid, void *extra_args) +{ + return _hypercall3(int, vcpu_op, cmd, vcpuid, extra_args); +} + +static inline int +HYPERVISOR_suspend( + unsigned long srec) +{ + struct sched_shutdown sched_shutdown = { + .reason = SHUTDOWN_suspend + }; + int rc = _hypercall3(int, sched_op, SCHEDOP_shutdown, + &sched_shutdown, srec); +#if CONFIG_XEN_COMPAT <= 0x030002 + if (rc == -ENOXENSYS) + rc = _hypercall3(int, sched_op_compat, SCHEDOP_shutdown, + SHUTDOWN_suspend, srec); +#endif + return (rc); +} + +#if CONFIG_XEN_COMPAT <= 0x030002 +static inline int +HYPERVISOR_nmi_op( + unsigned long op, void *arg) +{ + return _hypercall2(int, nmi_op, op, arg); +} +#endif + +static inline int +HYPERVISOR_callback_op( + int cmd, void *arg) +{ + return _hypercall2(int, callback_op, cmd, arg); +} + +#ifndef CONFIG_XEN +static inline unsigned long +HYPERVISOR_hvm_op( + int op, void *arg) +{ + return _hypercall2(unsigned long, hvm_op, op, arg); +} +#endif + +static inline int +HYPERVISOR_xenoprof_op( + int op, void *arg) +{ + return _hypercall2(int, xenoprof_op, op, arg); +} + +static inline int +HYPERVISOR_kexec_op( + unsigned long op, void *args) +{ + return _hypercall2(int, kexec_op, op, args); +} +#endif /* __HYPERCALL_H__ */ + +/* + * Local variables: + * c-file-style: "linux" + * indent-tabs-mode: t + * c-indent-level: 8 + * c-basic-offset: 8 + * tab-width: 8 + * End: + */ Added: projects/stable_7_xen/sys/i386/include/xen/synch_bitops.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/stable_7_xen/sys/i386/include/xen/synch_bitops.h Sun Dec 12 20:48:08 2010 (r216396) @@ -0,0 +1,139 @@ +#ifndef __XEN_SYNCH_BITOPS_H__ +#define __XEN_SYNCH_BITOPS_H__ + +/* + * Copyright 1992, Linus Torvalds. + * Heavily modified to provide guaranteed strong synchronisation + * when communicating with Xen or other guest OSes running on other CPUs. + */ + + +#define ADDR (*(volatile long *) addr) + +static __inline__ void synch_set_bit(int nr, volatile void * addr) +{ + __asm__ __volatile__ ( + "lock btsl %1,%0" + : "=m" (ADDR) : "Ir" (nr) : "memory" ); +} + +static __inline__ void synch_clear_bit(int nr, volatile void * addr) +{ + __asm__ __volatile__ ( + "lock btrl %1,%0" + : "=m" (ADDR) : "Ir" (nr) : "memory" ); +} + +static __inline__ void synch_change_bit(int nr, volatile void * addr) +{ + __asm__ __volatile__ ( + "lock btcl %1,%0" + : "=m" (ADDR) : "Ir" (nr) : "memory" ); +} + +static __inline__ int synch_test_and_set_bit(int nr, volatile void * addr) +{ + int oldbit; + __asm__ __volatile__ ( + "lock btsl %2,%1\n\tsbbl %0,%0" + : "=r" (oldbit), "=m" (ADDR) : "Ir" (nr) : "memory"); + return oldbit; +} + +static __inline__ int synch_test_and_clear_bit(int nr, volatile void * addr) +{ + int oldbit; + __asm__ __volatile__ ( + "lock btrl %2,%1\n\tsbbl %0,%0" + : "=r" (oldbit), "=m" (ADDR) : "Ir" (nr) : "memory"); + return oldbit; +} + +static __inline__ int synch_test_and_change_bit(int nr, volatile void * addr) +{ + int oldbit; + + __asm__ __volatile__ ( + "lock btcl %2,%1\n\tsbbl %0,%0" + : "=r" (oldbit), "=m" (ADDR) : "Ir" (nr) : "memory"); + return oldbit; +} + +struct __synch_xchg_dummy { unsigned long a[100]; }; +#define __synch_xg(x) ((volatile struct __synch_xchg_dummy *)(x)) + +#define synch_cmpxchg(ptr, old, new) \ +((__typeof__(*(ptr)))__synch_cmpxchg((ptr),\ + (unsigned long)(old), \ + (unsigned long)(new), \ + sizeof(*(ptr)))) + +static inline unsigned long __synch_cmpxchg(volatile void *ptr, + unsigned long old, + unsigned long new, int size) +{ + unsigned long prev; + switch (size) { + case 1: + __asm__ __volatile__("lock; cmpxchgb %b1,%2" + : "=a"(prev) + : "q"(new), "m"(*__synch_xg(ptr)), + "0"(old) + : "memory"); + return prev; + case 2: + __asm__ __volatile__("lock; cmpxchgw %w1,%2" + : "=a"(prev) + : "q"(new), "m"(*__synch_xg(ptr)), + "0"(old) + : "memory"); + return prev; +#ifdef CONFIG_X86_64 + case 4: + __asm__ __volatile__("lock; cmpxchgl %k1,%2" + : "=a"(prev) + : "q"(new), "m"(*__synch_xg(ptr)), + "0"(old) + : "memory"); + return prev; + case 8: + __asm__ __volatile__("lock; cmpxchgq %1,%2" + : "=a"(prev) + : "q"(new), "m"(*__synch_xg(ptr)), + "0"(old) + : "memory"); + return prev; +#else + case 4: + __asm__ __volatile__("lock; cmpxchgl %1,%2" + : "=a"(prev) + : "q"(new), "m"(*__synch_xg(ptr)), + "0"(old) + : "memory"); + return prev; +#endif + } + return old; +} + +static __inline__ int synch_const_test_bit(int nr, const volatile void * addr) +{ + return ((1UL << (nr & 31)) & + (((const volatile unsigned int *) addr)[nr >> 5])) != 0; +} + +static __inline__ int synch_var_test_bit(int nr, volatile void * addr) +{ + int oldbit; + __asm__ __volatile__ ( + "btl %2,%1\n\tsbbl %0,%0" + : "=r" (oldbit) : "m" (ADDR), "Ir" (nr) ); + return oldbit; +} + +#define synch_test_bit(nr,addr) \ +(__builtin_constant_p(nr) ? \ + synch_const_test_bit((nr),(addr)) : \ + synch_var_test_bit((nr),(addr))) + +#endif /* __XEN_SYNCH_BITOPS_H__ */ Added: projects/stable_7_xen/sys/i386/include/xen/xen-os.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/stable_7_xen/sys/i386/include/xen/xen-os.h Sun Dec 12 20:48:08 2010 (r216396) @@ -0,0 +1,353 @@ +/****************************************************************************** + * os.h + * + * random collection of macros and definition + */ + +#ifndef _XEN_OS_H_ +#define _XEN_OS_H_ +#include + +#ifdef PAE +#define CONFIG_X86_PAE +#endif + +#if defined(XEN) && !defined(__XEN_INTERFACE_VERSION__) +/* + * Can update to a more recent version when we implement + * the hypercall page + */ +#define __XEN_INTERFACE_VERSION__ 0x00030204 +#endif + +#include + +/* Force a proper event-channel callback from Xen. */ +void force_evtchn_callback(void); + +#define likely(x) __builtin_expect((x),1) +#define unlikely(x) __builtin_expect((x),0) + +#ifndef vtophys +#include +#include +#include +#endif + +extern int gdtset; +#ifdef SMP +#include /* XXX for pcpu.h */ +#include /* XXX for PCPU_GET */ +static inline int +smp_processor_id(void) +{ + if (likely(gdtset)) + return PCPU_GET(cpuid); + return 0; +} + +#else +#define smp_processor_id() 0 +#endif + +#ifndef NULL +#define NULL (void *)0 +#endif + +#ifndef PANIC_IF +#define PANIC_IF(exp) if (unlikely(exp)) {printk("panic - %s: %s:%d\n",#exp, __FILE__, __LINE__); panic("%s: %s:%d", #exp, __FILE__, __LINE__);} +#endif + +extern shared_info_t *HYPERVISOR_shared_info; + +/* Somewhere in the middle of the GCC 2.96 development cycle, we implemented + a mechanism by which the user can annotate likely branch directions and + expect the blocks to be reordered appropriately. Define __builtin_expect + to nothing for earlier compilers. */ + +/* REP NOP (PAUSE) is a good thing to insert into busy-wait loops. */ +static inline void rep_nop(void) +{ + __asm__ __volatile__ ( "rep;nop" : : : "memory" ); +} +#define cpu_relax() rep_nop() + + +#if __GNUC__ == 2 && __GNUC_MINOR__ < 96 +#define __builtin_expect(x, expected_value) (x) +#endif + +#define per_cpu(var, cpu) (pcpu_find((cpu))->pc_ ## var) + +/* crude memory allocator for memory allocation early in + * boot + */ +void *bootmem_alloc(unsigned int size); +void bootmem_free(void *ptr, unsigned int size); + + +/* Everything below this point is not included by assembler (.S) files. */ +#ifndef __ASSEMBLY__ +#include + +void printk(const char *fmt, ...); + +/* some function prototypes */ +void trap_init(void); + +/* + * STI/CLI equivalents. These basically set and clear the virtual + * event_enable flag in teh shared_info structure. Note that when + * the enable bit is set, there may be pending events to be handled. + * We may therefore call into do_hypervisor_callback() directly. + */ + + +#define __cli() \ +do { \ + vcpu_info_t *_vcpu; \ + _vcpu = &HYPERVISOR_shared_info->vcpu_info[smp_processor_id()]; \ + _vcpu->evtchn_upcall_mask = 1; \ + barrier(); \ +} while (0) + +#define __sti() \ +do { \ + vcpu_info_t *_vcpu; \ + barrier(); \ + _vcpu = &HYPERVISOR_shared_info->vcpu_info[smp_processor_id()]; \ + _vcpu->evtchn_upcall_mask = 0; \ + barrier(); /* unmask then check (avoid races) */ \ + if ( unlikely(_vcpu->evtchn_upcall_pending) ) \ + force_evtchn_callback(); \ +} while (0) + +#define __restore_flags(x) \ +do { \ + vcpu_info_t *_vcpu; \ + barrier(); \ + _vcpu = &HYPERVISOR_shared_info->vcpu_info[smp_processor_id()]; \ + if ((_vcpu->evtchn_upcall_mask = (x)) == 0) { \ + barrier(); /* unmask then check (avoid races) */ \ + if ( unlikely(_vcpu->evtchn_upcall_pending) ) \ + force_evtchn_callback(); \ + } \ +} while (0) + +/* + * Add critical_{enter, exit}? + * + */ +#define __save_and_cli(x) \ +do { \ + vcpu_info_t *_vcpu; \ + _vcpu = &HYPERVISOR_shared_info->vcpu_info[smp_processor_id()]; \ + (x) = _vcpu->evtchn_upcall_mask; \ + _vcpu->evtchn_upcall_mask = 1; \ + barrier(); \ +} while (0) + + +#define cli() __cli() +#define sti() __sti() *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-projects@FreeBSD.ORG Tue Dec 14 20:06:56 2010 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4CD18106564A; Tue, 14 Dec 2010 20:06:56 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 217EC8FC15; Tue, 14 Dec 2010 20:06:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBEK6uR9028929; Tue, 14 Dec 2010 20:06:56 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBEK6unM028928; Tue, 14 Dec 2010 20:06:56 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201012142006.oBEK6unM028928@svn.freebsd.org> From: Warner Losh Date: Tue, 14 Dec 2010 20:06:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216442 - projects/graid X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Dec 2010 20:06:56 -0000 Author: imp Date: Tue Dec 14 20:06:55 2010 New Revision: 216442 URL: http://svn.freebsd.org/changeset/base/216442 Log: Software RAID framework to replace ataraid's lost fucntionality. Added: projects/graid/ - copied from r216441, head/ Directory Properties: projects/graid/head/ (props changed) From owner-svn-src-projects@FreeBSD.ORG Tue Dec 14 20:10:29 2010 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C0575106567A; Tue, 14 Dec 2010 20:10:29 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9527A8FC19; Tue, 14 Dec 2010 20:10:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBEKATXC029104; Tue, 14 Dec 2010 20:10:29 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBEKATiS029103; Tue, 14 Dec 2010 20:10:29 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201012142010.oBEKATiS029103@svn.freebsd.org> From: Warner Losh Date: Tue, 14 Dec 2010 20:10:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216444 - projects/graid/8 X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Dec 2010 20:10:29 -0000 Author: imp Date: Tue Dec 14 20:10:29 2010 New Revision: 216444 URL: http://svn.freebsd.org/changeset/base/216444 Log: graid backport to 8. This will be merged into 8 when the time is right. There may be ABI changes that cannot be merged, which may mean reduced functionality relative to -current. This branch also will serve as a place for people to grab up-to-date versions of the complete work if they want a version of 8 with all of the features included. For 8.x, it is anticipated there will be very few of these kinds of changes. Added: - copied from r216442, stable/8/ Directory Properties: projects/graid/8/ (props changed) From owner-svn-src-projects@FreeBSD.ORG Tue Dec 14 20:13:30 2010 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5F6FC106566B; Tue, 14 Dec 2010 20:13:30 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4E6818FC0C; Tue, 14 Dec 2010 20:13:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBEKDUTu029217; Tue, 14 Dec 2010 20:13:30 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBEKDUod029216; Tue, 14 Dec 2010 20:13:30 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201012142013.oBEKDUod029216@svn.freebsd.org> From: Warner Losh Date: Tue, 14 Dec 2010 20:13:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216445 - projects/graid/7 X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Dec 2010 20:13:30 -0000 Author: imp Date: Tue Dec 14 20:13:30 2010 New Revision: 216445 URL: http://svn.freebsd.org/changeset/base/216445 Log: graid backport to 7. Some of this may be merged into 7 when the time is right. There are ABI changes that cannot be merged (due to CAM changes back ported for the cam ata/ada stuff). This branch also will serve as a place for people to grab up-to-date versions of the complete work if they want a version of 7 with all of the features included. Unfortunately, it isn't clear how much of this functionality can be merged due to dependency issues. Added: - copied from r216444, stable/7/ Directory Properties: projects/graid/7/ (props changed) From owner-svn-src-projects@FreeBSD.ORG Wed Dec 15 01:08:19 2010 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5B85C106566B; Wed, 15 Dec 2010 01:08:19 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 48C7B8FC18; Wed, 15 Dec 2010 01:08:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBF18JlB036410; Wed, 15 Dec 2010 01:08:19 GMT (envelope-from jeff@svn.freebsd.org) Received: (from jeff@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBF18JYg036405; Wed, 15 Dec 2010 01:08:19 GMT (envelope-from jeff@svn.freebsd.org) Message-Id: <201012150108.oBF18JYg036405@svn.freebsd.org> From: Jeff Roberson Date: Wed, 15 Dec 2010 01:08:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216450 - projects/ofed/head/sys/ofed/drivers/infiniband/ulp/sdp X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Dec 2010 01:08:19 -0000 Author: jeff Date: Wed Dec 15 01:08:19 2010 New Revision: 216450 URL: http://svn.freebsd.org/changeset/base/216450 Log: Initial port and rewrite of Sockets Direct Protocol (IB socket layer) - sdp_main.c was GPL polluted as a result of copy & paste code from linux tcp sources. It was rewritten from BSD tcp sources and copyrights were properly retained. - Remaining files are dual BSD/GPL licensed and appear to be free of unsafe copy & paste code. Most linuxisms removed although the wrapper layer is still included as it must be for the rdma/* includes. Sponsored by: Isilon Systems, iX Systems, and Panasas. Modified: projects/ofed/head/sys/ofed/drivers/infiniband/ulp/sdp/sdp.h projects/ofed/head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_bcopy.c projects/ofed/head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_cma.c projects/ofed/head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_dbg.h projects/ofed/head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c projects/ofed/head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_rx.c projects/ofed/head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_tx.c projects/ofed/head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_zcopy.c Modified: projects/ofed/head/sys/ofed/drivers/infiniband/ulp/sdp/sdp.h ============================================================================== --- projects/ofed/head/sys/ofed/drivers/infiniband/ulp/sdp/sdp.h Tue Dec 14 21:33:17 2010 (r216449) +++ projects/ofed/head/sys/ofed/drivers/infiniband/ulp/sdp/sdp.h Wed Dec 15 01:08:19 2010 (r216450) @@ -1,16 +1,66 @@ #ifndef _SDP_H_ #define _SDP_H_ +#include "opt_ddb.h" +#include "opt_inet.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef DDB +#include +#endif + +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include +#include +#include #include #include -#include -#include /* For urgent data flags */ +#include +#include +#include + #include -#include #include #include +#include +#include + +#define CONFIG_INFINIBAND_SDP_DEBUG 1 +#define CONFIG_INFINIBAND_SDP_DEBUG_DATA 1 + #include "sdp_dbg.h" +#undef LIST_HEAD +/* From sys/queue.h */ +#define LIST_HEAD(name, type) \ +struct name { \ + struct type *lh_first; /* first element */ \ +} + /* Interval between sucessive polls in the Tx routine when polling is used instead of interrupts (in per-core Tx rings) - should be power of 2 */ #define SDP_TX_POLL_MODER 16 @@ -40,12 +90,13 @@ #define SDP_MAX_SEND_SGES 9 /* same as above */ /* mb inlined data len - rest will be rx'ed into frags */ -#define SDP_SKB_HEAD_SIZE (0x500 + sizeof(struct sdp_bsdh)) +#define SDP_HEAD_SIZE (sizeof(struct sdp_bsdh)) /* limit tx payload len, if the sink supports bigger buffers than the source * can handle. * or rx fragment size (limited by sge->length size) */ -#define SDP_MAX_PAYLOAD ((1 << 16) - SDP_SKB_HEAD_SIZE) +#define SDP_MAX_PACKET (1 << 16) +#define SDP_MAX_PAYLOAD (SDP_MAX_PACKET - SDP_HEAD_SIZE) #define SDP_NUM_WC 4 @@ -66,13 +117,14 @@ struct sdp_mb_cb { __u32 seq; /* Starting sequence number */ - __u32 end_seq; /* SEQ + FIN + SYN + datalen */ - __u8 flags; /* TCP header flags. */ struct bzcopy_state *bz; struct rx_srcavail_state *rx_sa; struct tx_srcavail_state *tx_sa; }; +#define M_PUSH M_PROTO1 /* Do a 'push'. */ +#define M_URG M_PROTO2 /* Mark as urgent (oob). */ + #define SDP_SKB_CB(__mb) ((struct sdp_mb_cb *)&((__mb)->cb[0])) #define BZCOPY_STATE(mb) (SDP_SKB_CB(mb)->bz) #define RX_SRCAVAIL_STATE(mb) (SDP_SKB_CB(mb)->rx_sa) @@ -87,29 +139,17 @@ struct sdp_mb_cb { #define ring_posted(ring) (ring_head(ring) - ring_tail(ring)) #define rx_ring_posted(ssk) ring_posted(ssk->rx_ring) +#ifdef SDP_ZCOPY #define tx_ring_posted(ssk) (ring_posted(ssk->tx_ring) + \ (ssk->tx_ring.rdma_inflight ? ssk->tx_ring.rdma_inflight->busy : 0)) - -#define posts_handler(ssk) atomic_read(&ssk->somebody_is_doing_posts) -#define posts_handler_get(ssk) atomic_inc(&ssk->somebody_is_doing_posts) -#define posts_handler_put(ssk) do {\ - atomic_dec(&ssk->somebody_is_doing_posts); \ - sdp_do_posts(ssk); \ -} while (0) +#else +#define tx_ring_posted(ssk) ring_posted(ssk->tx_ring) +#endif extern int sdp_zcopy_thresh; -extern struct workqueue_struct *sdp_wq; -extern struct list_head sock_list; -extern spinlock_t sock_list_lock; extern int rcvbuf_initial_size; -extern struct proto sdp_proto; extern struct workqueue_struct *rx_comp_wq; -extern atomic_t sdp_current_mem_usage; -extern spinlock_t sdp_large_sockets_lock; extern struct ib_client sdp_client; -#ifdef SDPSTATS_ON -DECLARE_PER_CPU(struct sdpstats, sdpstats); -#endif enum sdp_mid { SDP_MID_HELLO = 0x0, @@ -264,7 +304,9 @@ struct tx_srcavail_state { }; struct sdp_tx_ring { +#ifdef SDP_ZCOPY struct rx_srcavail_state *rdma_inflight; +#endif struct sdp_buf *buffer; atomic_t head; atomic_t tail; @@ -274,8 +316,7 @@ struct sdp_tx_ring { atomic_t credits; #define tx_credits(ssk) (atomic_read(&ssk->tx_ring.credits)) - struct timer_list timer; - struct tasklet_struct tasklet; + struct callout timer; u16 poll_cnt; }; @@ -286,9 +327,7 @@ struct sdp_rx_ring { struct ib_cq *cq; int destroyed; - rwlock_t destroyed_lock; - - struct tasklet_struct tasklet; + struct rwlock destroyed_lock; }; struct sdp_device { @@ -318,68 +357,49 @@ struct sdp_moderation { int moder_time; }; +#define SDP_TIMEWAIT 0x0001 /* In ssk timewait state. */ +#define SDP_DROPPED 0x0002 /* Socket has been dropped. */ +#define SDP_SOCKREF 0x0004 /* Holding a sockref for close. */ +#define SDP_NODELAY 0x0008 /* Disble nagle. */ +#define SDP_NEEDFIN 0x0010 /* Send a fin on the next tx. */ +#define SDP_DREQWAIT 0x0020 /* Waiting on DREQ. */ +#define SDP_HAVEOOB 0x0040 /* Have OOB data. */ +#define SDP_HADOOB 0x0080 /* Had OOB data. */ +#define SDP_DESTROY 0x0100 /* Being destroyed. */ + struct sdp_sock { - /* sk has to be the first member of inet_sock */ - struct inet_sock isk; - struct list_head sock_list; - struct list_head accept_queue; - struct list_head backlog_queue; - struct mbuf_head rx_ctl_q; - struct socket *parent; + LIST_ENTRY(sdp_sock) list; + struct socket *socket; + struct rdma_cm_id *id; + struct ib_device *ib_device; struct sdp_device *sdp_dev; - - int qp_active; - struct tx_srcavail_state *tx_sa; - struct rx_srcavail_state *rx_sa; - spinlock_t tx_sa_lock; - struct delayed_work srcavail_cancel_work; - int srcavail_cancel_mseq; - + struct ib_qp *qp; + struct ucred *cred; + struct callout keep2msl; /* 2msl and keepalive timer. */ + struct callout nagle_timer; /* timeout waiting for ack */ struct ib_ucontext context; - - int max_sge; - - struct work_struct rx_comp_work; - wait_queue_head_t wq; - - struct delayed_work dreq_wait_work; - struct work_struct destroy_work; - - int tx_compl_pending; - atomic_t somebody_is_doing_posts; - - /* Like tcp_sock */ - u16 urg_data; - u32 urg_seq; - u32 copied_seq; -#define rcv_nxt(ssk) atomic_read(&(ssk->rcv_nxt)) - atomic_t rcv_nxt; - - int write_seq; - int pushed_seq; + in_port_t lport; + in_addr_t laddr; + in_port_t fport; + in_addr_t faddr; + int flags; + int state; + int softerror; + int recv_bytes; /* Bytes per recv. buf including header */ int xmit_size_goal; - int nonagle; - - int dreq_wait_timeout; - - unsigned keepalive_time; - - spinlock_t lock; - - /* tx_head/rx_head when keepalive timer started */ - unsigned keepalive_tx_head; - unsigned keepalive_rx_head; - - int destructed_already; - int sdp_disconnect; - int destruct_in_process; + char iobc; struct sdp_rx_ring rx_ring; struct sdp_tx_ring tx_ring; + struct rwlock lock; + struct mbuf *rx_ctl_q; + struct mbuf *rx_ctl_tail; - /* Data below will be reset on error */ - struct rdma_cm_id *id; - struct ib_device *ib_device; + int qp_active; /* XXX Flag. */ + int max_sge; + struct work_struct rx_comp_work; +#define rcv_nxt(ssk) atomic_read(&(ssk->rcv_nxt)) + atomic_t rcv_nxt; /* SDP specific */ atomic_t mseq_ack; @@ -388,39 +408,42 @@ struct sdp_sock { unsigned min_bufs; /* Low water mark to wake senders */ unsigned long nagle_last_unacked; /* mseq of lastest unacked packet */ - struct timer_list nagle_timer; /* timeout waiting for ack */ atomic_t remote_credits; #define remote_credits(ssk) (atomic_read(&ssk->remote_credits)) int poll_cq; - /* rdma specific */ - struct ib_qp *qp; - /* SDP slow start */ - int rcvbuf_scale; /* local recv buf scale for each socket */ - int sent_request_head; /* mark the tx_head of the last send resize - request */ - int sent_request; /* 0 - not sent yet, 1 - request pending - -1 - resize done succesfully */ int recv_request_head; /* mark the rx_head when the resize request was recieved */ - int recv_request; /* flag if request to resize was recieved */ - int recv_frags; /* max mb frags in recv packets */ - int send_frags; /* max mb frags in send packets */ + int recv_request; /* XXX flag if request to resize was recieved */ unsigned long tx_packets; unsigned long rx_packets; unsigned long tx_bytes; unsigned long rx_bytes; struct sdp_moderation auto_mod; - +#ifdef SDP_ZCOPY + struct tx_srcavail_state *tx_sa; + struct rx_srcavail_state *rx_sa; + spinlock_t tx_sa_lock; + struct delayed_work srcavail_cancel_work; + int srcavail_cancel_mseq; /* ZCOPY data: -1:use global; 0:disable zcopy; >0: zcopy threshold */ int zcopy_thresh; - - int last_bind_err; +#endif }; +#define sdp_sk(so) ((struct sdp_sock *)(so->so_pcb)) + +#define SDP_RLOCK(ssk) rw_rlock(&(ssk)->lock) +#define SDP_WLOCK(ssk) rw_wlock(&(ssk)->lock) +#define SDP_RUNLOCK(ssk) rw_runlock(&(ssk)->lock) +#define SDP_WUNLOCK(ssk) rw_wunlock(&(ssk)->lock) +#define SDP_WLOCK_ASSERT(ssk) rw_assert(&(ssk)->lock, RA_WLOCKED) +#define SDP_RLOCK_ASSERT(ssk) rw_assert(&(ssk)->lock, RA_RLOCKED) +#define SDP_LOCK_ASSERT(ssk) rw_assert(&(ssk)->lock, RA_LOCKED) + static inline void tx_sa_reset(struct tx_srcavail_state *tx_sa) { memset((void *)&tx_sa->busy, 0, @@ -429,12 +452,12 @@ static inline void tx_sa_reset(struct tx static inline void rx_ring_unlock(struct sdp_rx_ring *rx_ring) { - read_unlock_bh(&rx_ring->destroyed_lock); + rw_runlock(&rx_ring->destroyed_lock); } static inline int rx_ring_trylock(struct sdp_rx_ring *rx_ring) { - read_lock_bh(&rx_ring->destroyed_lock); + rw_rlock(&rx_ring->destroyed_lock); if (rx_ring->destroyed) { rx_ring_unlock(rx_ring); return 0; @@ -444,76 +467,26 @@ static inline int rx_ring_trylock(struct static inline void rx_ring_destroy_lock(struct sdp_rx_ring *rx_ring) { - write_lock_bh(&rx_ring->destroyed_lock); + rw_wlock(&rx_ring->destroyed_lock); rx_ring->destroyed = 1; - write_unlock_bh(&rx_ring->destroyed_lock); -} - -static inline struct sdp_sock *sdp_sk(const struct socket *sk) -{ - return (struct sdp_sock *)sk; -} - -static inline int _sdp_exch_state(const char *func, int line, struct socket *sk, - int from_states, int state) -{ - unsigned long flags; - int old; - - spin_lock_irqsave(&sdp_sk(sk)->lock, flags); - - sdp_dbg(sk, "%s:%d - set state: %s -> %s 0x%x\n", func, line, - sdp_state_str(sk->sk_state), - sdp_state_str(state), from_states); - - if ((1 << sk->sk_state) & ~from_states) { - sdp_warn(sk, "trying to exchange state from unexpected state " - "%s to state %s. expected states: 0x%x\n", - sdp_state_str(sk->sk_state), sdp_state_str(state), - from_states); - } - - old = sk->sk_state; - sk->sk_state = state; - - spin_unlock_irqrestore(&sdp_sk(sk)->lock, flags); - - return old; -} -#define sdp_exch_state(sk, from_states, state) \ - _sdp_exch_state(__func__, __LINE__, sk, from_states, state) - -static inline void sdp_set_error(struct socket *sk, int err) -{ - int ib_teardown_states = TCPF_FIN_WAIT1 | TCPF_CLOSE_WAIT - | TCPF_LAST_ACK; - sk->sk_err = -err; - if (sk->sk_socket) - sk->sk_socket->state = SS_DISCONNECTING; - - if ((1 << sk->sk_state) & ib_teardown_states) - sdp_exch_state(sk, ib_teardown_states, TCPS_TIME_WAIT); - else - sdp_exch_state(sk, ~0, TCPS_CLOSED); - - sk->sk_error_report(sk); + rw_wunlock(&rx_ring->destroyed_lock); } -static inline void sdp_arm_rx_cq(struct socket *sk) +static inline void sdp_arm_rx_cq(struct sdp_sock *ssk) { - sdp_prf(sk, NULL, "Arming RX cq"); - sdp_dbg_data(sk, "Arming RX cq\n"); + sdp_prf(ssk->socket, NULL, "Arming RX cq"); + sdp_dbg_data(ssk->socket, "Arming RX cq\n"); - ib_req_notify_cq(sdp_sk(sk)->rx_ring.cq, IB_CQ_NEXT_COMP); + ib_req_notify_cq(ssk->rx_ring.cq, IB_CQ_NEXT_COMP); } -static inline void sdp_arm_tx_cq(struct socket *sk) +static inline void sdp_arm_tx_cq(struct sdp_sock *ssk) { - sdp_prf(sk, NULL, "Arming TX cq"); - sdp_dbg_data(sk, "Arming TX cq. credits: %d, posted: %d\n", - tx_credits(sdp_sk(sk)), tx_ring_posted(sdp_sk(sk))); + sdp_prf(ssk->socket, NULL, "Arming TX cq"); + sdp_dbg_data(ssk->socket, "Arming TX cq. credits: %d, posted: %d\n", + tx_credits(ssk), tx_ring_posted(ssk)); - ib_req_notify_cq(sdp_sk(sk)->tx_ring.cq, IB_CQ_NEXT_COMP); + ib_req_notify_cq(ssk->tx_ring.cq, IB_CQ_NEXT_COMP); } /* return the min of: @@ -557,90 +530,68 @@ static inline char *mid2str(int mid) return mid2str[mid]; } -static inline struct mbuf *sdp_stream_alloc_mb(struct socket *sk, int size, - gfp_t gfp) -{ - struct mbuf *mb; - - /* The TCP header must be at least 32-bit aligned. */ - size = ALIGN(size, 4); - - mb = alloc_mb_fclone(size + sk->sk_prot->max_header, gfp); - if (mb) { - if (sk_wmem_schedule(sk, mb->truesize)) { - /* - * Make sure that we have exactly size bytes - * available to the caller, no more, no less. - */ - mb_reserve(mb, mb_tailroom(mb) - size); - return mb; - } - m_freem(mb); - } else { - sk->sk_prot->enter_memory_pressure(sk); - sk_stream_moderate_sndbuf(sk); - } - return NULL; -} - -static inline struct mbuf *sdp_alloc_mb(struct socket *sk, u8 mid, int size, - gfp_t gfp) +static inline struct mbuf * +sdp_alloc_mb(struct socket *sk, u8 mid, int size, int wait) { struct sdp_bsdh *h; struct mbuf *mb; - if (!gfp) { - if (unlikely(sk->sk_allocation)) - gfp = sk->sk_allocation; - else - gfp = GFP_KERNEL; - } - - mb = sdp_stream_alloc_mb(sk, sizeof(struct sdp_bsdh) + size, gfp); - BUG_ON(!mb); - - mb_header_release(mb); - - h = (struct sdp_bsdh *)mb_push(mb, sizeof *h); + MGETHDR(mb, wait, MT_DATA); + if (mb == NULL) + return (NULL); + mb->m_pkthdr.len = mb->m_len = sizeof(struct sdp_bsdh); + h = mtod(mb, struct sdp_bsdh *); h->mid = mid; - mb_reset_transport_header(mb); - return mb; } -static inline struct mbuf *sdp_alloc_mb_data(struct socket *sk, gfp_t gfp) +static inline struct mbuf * +sdp_alloc_mb_data(struct socket *sk, int wait) { - return sdp_alloc_mb(sk, SDP_MID_DATA, 0, gfp); + return sdp_alloc_mb(sk, SDP_MID_DATA, 0, wait); } -static inline struct mbuf *sdp_alloc_mb_disconnect(struct socket *sk, - gfp_t gfp) +static inline struct mbuf * +sdp_alloc_mb_disconnect(struct socket *sk, int wait) { - return sdp_alloc_mb(sk, SDP_MID_DISCONN, 0, gfp); + return sdp_alloc_mb(sk, SDP_MID_DISCONN, 0, wait); } -static inline struct mbuf *sdp_alloc_mb_chrcvbuf_ack(struct socket *sk, - int size, gfp_t gfp) +static inline void * +mb_put(struct mbuf *mb, int len) +{ + uint8_t *data; + + data = mb->m_data; + data += mb->m_len; + mb->m_len += len; + return (void *)data; +} + +static inline struct mbuf * +sdp_alloc_mb_chrcvbuf_ack(struct socket *sk, int size, int wait) { struct mbuf *mb; struct sdp_chrecvbuf *resp_size; - mb = sdp_alloc_mb(sk, SDP_MID_CHRCVBUF_ACK, sizeof(*resp_size), gfp); - + mb = sdp_alloc_mb(sk, SDP_MID_CHRCVBUF_ACK, sizeof(*resp_size), wait); + if (mb == NULL) + return (NULL); resp_size = (struct sdp_chrecvbuf *)mb_put(mb, sizeof *resp_size); resp_size->size = htonl(size); return mb; } -static inline struct mbuf *sdp_alloc_mb_srcavail(struct socket *sk, - u32 len, u32 rkey, u64 vaddr, gfp_t gfp) +static inline struct mbuf * +sdp_alloc_mb_srcavail(struct socket *sk, u32 len, u32 rkey, u64 vaddr, int wait) { struct mbuf *mb; struct sdp_srcah *srcah; - mb = sdp_alloc_mb(sk, SDP_MID_SRCAVAIL, sizeof(*srcah), gfp); - + mb = sdp_alloc_mb(sk, SDP_MID_SRCAVAIL, sizeof(*srcah), wait); + if (mb == NULL) + return (NULL); srcah = (struct sdp_srcah *)mb_put(mb, sizeof(*srcah)); srcah->len = htonl(len); srcah->rkey = htonl(rkey); @@ -649,29 +600,31 @@ static inline struct mbuf *sdp_alloc_mb_ return mb; } -static inline struct mbuf *sdp_alloc_mb_srcavail_cancel(struct socket *sk, - gfp_t gfp) +static inline struct mbuf * +sdp_alloc_mb_srcavail_cancel(struct socket *sk, int wait) { - return sdp_alloc_mb(sk, SDP_MID_SRCAVAIL_CANCEL, 0, gfp); + return sdp_alloc_mb(sk, SDP_MID_SRCAVAIL_CANCEL, 0, wait); } -static inline struct mbuf *sdp_alloc_mb_rdmardcompl(struct socket *sk, - u32 len, gfp_t gfp) +static inline struct mbuf * +sdp_alloc_mb_rdmardcompl(struct socket *sk, u32 len, int wait) { struct mbuf *mb; struct sdp_rrch *rrch; - mb = sdp_alloc_mb(sk, SDP_MID_RDMARDCOMPL, sizeof(*rrch), gfp); - + mb = sdp_alloc_mb(sk, SDP_MID_RDMARDCOMPL, sizeof(*rrch), wait); + if (mb == NULL) + return (NULL); rrch = (struct sdp_rrch *)mb_put(mb, sizeof(*rrch)); rrch->len = htonl(len); return mb; } -static inline struct mbuf *sdp_alloc_mb_sendsm(struct socket *sk, gfp_t gfp) +static inline struct mbuf * +sdp_alloc_mb_sendsm(struct socket *sk, int wait) { - return sdp_alloc_mb(sk, SDP_MID_SENDSM, 0, gfp); + return sdp_alloc_mb(sk, SDP_MID_SENDSM, 0, wait); } static inline int sdp_tx_ring_slots_left(struct sdp_sock *ssk) { @@ -691,98 +644,33 @@ static inline int credit_update_needed(s } -#ifdef SDPSTATS_ON - -#define SDPSTATS_MAX_HIST_SIZE 256 -struct sdpstats { - u32 post_send[256]; - u32 sendmsg_bcopy_segment; - u32 sendmsg_bzcopy_segment; - u32 sendmsg_zcopy_segment; - u32 sendmsg; - u32 post_send_credits; - u32 sendmsg_nagle_skip; - u32 sendmsg_seglen[25]; - u32 send_size[25]; - u32 post_recv; - u32 rx_int_count; - u32 tx_int_count; - u32 bzcopy_poll_miss; - u32 send_wait_for_mem; - u32 send_miss_no_credits; - u32 rx_poll_miss; - u32 tx_poll_miss; - u32 tx_poll_hit; - u32 tx_poll_busy; - u32 memcpy_count; - u32 credits_before_update[64]; - u32 zcopy_tx_timeout; - u32 zcopy_cross_send; - u32 zcopy_tx_aborted; - u32 zcopy_tx_error; -}; - -static inline void sdpstats_hist(u32 *h, u32 val, u32 maxidx, int is_log) -{ - int idx = is_log ? ilog2(val) : val; - if (idx > maxidx) - idx = maxidx; - - h[idx]++; -} - -#define SDPSTATS_COUNTER_INC(stat) do { __get_cpu_var(sdpstats).stat++; } while (0) -#define SDPSTATS_COUNTER_ADD(stat, val) do { __get_cpu_var(sdpstats).stat += val; } while (0) -#define SDPSTATS_COUNTER_MID_INC(stat, mid) do { __get_cpu_var(sdpstats).stat[mid]++; } \ - while (0) -#define SDPSTATS_HIST(stat, size) \ - sdpstats_hist(__get_cpu_var(sdpstats).stat, size, ARRAY_SIZE(__get_cpu_var(sdpstats).stat) - 1, 1) - -#define SDPSTATS_HIST_LINEAR(stat, size) \ - sdpstats_hist(__get_cpu_var(sdpstats).stat, size, ARRAY_SIZE(__get_cpu_var(sdpstats).stat) - 1, 0) - -#else #define SDPSTATS_COUNTER_INC(stat) #define SDPSTATS_COUNTER_ADD(stat, val) #define SDPSTATS_COUNTER_MID_INC(stat, mid) #define SDPSTATS_HIST_LINEAR(stat, size) #define SDPSTATS_HIST(stat, size) -#endif -static inline void sdp_cleanup_sdp_buf(struct sdp_sock *ssk, struct sdp_buf *sbuf, - size_t head_size, enum dma_data_direction dir) +static inline void +sdp_cleanup_sdp_buf(struct sdp_sock *ssk, struct sdp_buf *sbuf, + enum dma_data_direction dir) { - int i; + struct ib_device *dev; struct mbuf *mb; - struct ib_device *dev = ssk->ib_device; - - mb = sbuf->mb; - - ib_dma_unmap_single(dev, sbuf->mapping[0], head_size, dir); + int i; - for (i = 0; i < mb_shinfo(mb)->nr_frags; i++) { - ib_dma_unmap_page(dev, sbuf->mapping[i + 1], - mb_shinfo(mb)->frags[i].size, - dir); - } + dev = ssk->ib_device; + for (i = 0, mb = sbuf->mb; mb != NULL; mb = mb->m_next, i++) + ib_dma_unmap_single(dev, sbuf->mapping[i], mb->m_len, dir); } /* sdp_main.c */ void sdp_set_default_moderation(struct sdp_sock *ssk); -int sdp_init_sock(struct socket *sk); void sdp_start_keepalive_timer(struct socket *sk); -void sdp_remove_sock(struct sdp_sock *ssk); -void sdp_add_sock(struct sdp_sock *ssk); void sdp_urg(struct sdp_sock *ssk, struct mbuf *mb); void sdp_cancel_dreq_wait_timeout(struct sdp_sock *ssk); -void sdp_reset_sk(struct socket *sk, int rc); -void sdp_reset(struct socket *sk); -int sdp_tx_wait_memory(struct sdp_sock *ssk, long *timeo_p, int *credits_needed); -void mb_entail(struct socket *sk, struct sdp_sock *ssk, struct mbuf *mb); - -/* sdp_proc.c */ -int __init sdp_proc_init(void); -void sdp_proc_unregister(void); +void sdp_abort(struct socket *sk); +struct sdp_sock *sdp_notify(struct sdp_sock *ssk, int error); + /* sdp_cma.c */ int sdp_cma_handler(struct rdma_cm_id *, struct rdma_cm_event *); @@ -792,8 +680,7 @@ int sdp_tx_ring_create(struct sdp_sock * void sdp_tx_ring_destroy(struct sdp_sock *ssk); int sdp_xmit_poll(struct sdp_sock *ssk, int force); void sdp_post_send(struct sdp_sock *ssk, struct mbuf *mb); -void sdp_post_sends(struct sdp_sock *ssk, gfp_t gfp); -void sdp_nagle_timeout(unsigned long data); +void sdp_post_sends(struct sdp_sock *ssk, int wait); void sdp_post_keepalive(struct sdp_sock *ssk); /* sdp_rx.c */ @@ -804,8 +691,6 @@ int sdp_resize_buffers(struct sdp_sock * int sdp_init_buffers(struct sdp_sock *ssk, u32 new_size); void sdp_do_posts(struct sdp_sock *ssk); void sdp_rx_comp_full(struct sdp_sock *ssk); -void sdp_remove_large_sock(struct sdp_sock *ssk); -void sdp_handle_disconn(struct socket *sk); /* sdp_zcopy.c */ int sdp_sendmsg_zcopy(struct kiocb *iocb, struct socket *sk, struct iovec *iov); Modified: projects/ofed/head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_bcopy.c ============================================================================== --- projects/ofed/head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_bcopy.c Tue Dec 14 21:33:17 2010 (r216449) +++ projects/ofed/head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_bcopy.c Wed Dec 15 01:08:19 2010 (r216450) @@ -33,6 +33,8 @@ */ #include "sdp.h" +static void sdp_nagle_timeout(void *data); + #ifdef CONFIG_INFINIBAND_SDP_DEBUG_DATA void _dump_packet(const char *func, int line, struct socket *sk, char *str, struct mbuf *mb, const struct sdp_bsdh *h) @@ -85,7 +87,7 @@ void _dump_packet(const char *func, int srcah = (struct sdp_srcah *)(h+1); len += snprintf(buf + len, 255-len, " | payload: 0x%lx, " - "len: 0x%x, rkey: 0x%x, vaddr: 0x%llx |", + "len: 0x%x, rkey: 0x%x, vaddr: 0x%jx |", ntohl(h->len) - sizeof(struct sdp_bsdh) - sizeof(struct sdp_srcah), ntohl(srcah->len), ntohl(srcah->rkey), @@ -99,95 +101,79 @@ void _dump_packet(const char *func, int } #endif -static inline void update_send_head(struct socket *sk, struct mbuf *mb) +static inline int +sdp_nagle_off(struct sdp_sock *ssk, struct mbuf *mb) { - struct page *page; - sk->sk_send_head = mb->next; - if (sk->sk_send_head == (struct mbuf *)&sk->sk_write_queue) { - sk->sk_send_head = NULL; - page = sk->sk_sndmsg_page; - if (page) { - put_page(page); - sk->sk_sndmsg_page = NULL; - } - } -} -static inline int sdp_nagle_off(struct sdp_sock *ssk, struct mbuf *mb) -{ - struct sdp_bsdh *h = (struct sdp_bsdh *)mb_transport_header(mb); + struct sdp_bsdh *h; + + h = mtod(mb, struct sdp_bsdh *); int send_now = +#ifdef SDP_ZCOPY BZCOPY_STATE(mb) || +#endif unlikely(h->mid != SDP_MID_DATA) || - (ssk->nonagle & TCP_NAGLE_OFF) || + (ssk->flags & SDP_NODELAY) || !ssk->nagle_last_unacked || - mb->next != (struct mbuf *)&ssk->isk.sk.sk_write_queue || - mb->len + sizeof(struct sdp_bsdh) >= ssk->xmit_size_goal || - (SDP_SKB_CB(mb)->flags & TCPCB_FLAG_PSH); + mb->m_pkthdr.len >= ssk->xmit_size_goal || + (mb->m_flags & M_PUSH); if (send_now) { unsigned long mseq = ring_head(ssk->tx_ring); ssk->nagle_last_unacked = mseq; } else { - if (!timer_pending(&ssk->nagle_timer)) { - mod_timer(&ssk->nagle_timer, - jiffies + SDP_NAGLE_TIMEOUT); - sdp_dbg_data(&ssk->isk.sk, "Starting nagle timer\n"); + if (!callout_pending(&ssk->nagle_timer)) { + callout_reset(&ssk->nagle_timer, SDP_NAGLE_TIMEOUT, + sdp_nagle_timeout, ssk); + sdp_dbg_data(ssk->socket, "Starting nagle timer\n"); } } - sdp_dbg_data(&ssk->isk.sk, "send_now = %d last_unacked = %ld\n", + sdp_dbg_data(ssk->socket, "send_now = %d last_unacked = %ld\n", send_now, ssk->nagle_last_unacked); return send_now; } -void sdp_nagle_timeout(unsigned long data) +static void +sdp_nagle_timeout(void *data) { struct sdp_sock *ssk = (struct sdp_sock *)data; - struct socket *sk = &ssk->isk.sk; + struct socket *sk = ssk->socket; sdp_dbg_data(sk, "last_unacked = %ld\n", ssk->nagle_last_unacked); - if (!ssk->nagle_last_unacked) - goto out2; + if (!callout_active(&ssk->nagle_timer)) + return; + callout_deactivate(&ssk->nagle_timer); - /* Only process if the socket is not in use */ - bh_lock_sock(sk); - if (sock_owned_by_user(sk)) { - sdp_dbg_data(sk, "socket is busy - will try later\n"); + if (!ssk->nagle_last_unacked) goto out; - } - - if (sk->sk_state == TCPS_CLOSED) { - bh_unlock_sock(sk); + if (ssk->state == TCPS_CLOSED) return; - } - ssk->nagle_last_unacked = 0; - sdp_post_sends(ssk, GFP_ATOMIC); + sdp_post_sends(ssk, M_DONTWAIT); - if (sk->sk_sleep && waitqueue_active(sk->sk_sleep)) - sk_stream_write_space(&ssk->isk.sk); + sowwakeup(ssk->socket); out: - bh_unlock_sock(sk); -out2: - if (sk->sk_send_head) /* If has pending sends - rearm */ - mod_timer(&ssk->nagle_timer, jiffies + SDP_NAGLE_TIMEOUT); + if (sk->so_snd.sb_sndptr) + callout_reset(&ssk->nagle_timer, SDP_NAGLE_TIMEOUT, + sdp_nagle_timeout, ssk); } -void sdp_post_sends(struct sdp_sock *ssk, gfp_t gfp) +void +sdp_post_sends(struct sdp_sock *ssk, int wait) { /* TODO: nonagle? */ struct mbuf *mb; int post_count = 0; - struct socket *sk = &ssk->isk.sk; + struct socket *sk; + sk = ssk->socket; if (unlikely(!ssk->id)) { - if (ssk->isk.sk.sk_send_head) { - sdp_dbg(&ssk->isk.sk, + if (sk->so_snd.sb_sndptr) { + sdp_dbg(ssk->socket, "Send on socket without cmid ECONNRESET.\n"); - /* TODO: flush send queue? */ - sdp_reset(&ssk->isk.sk); + sdp_notify(ssk, ECONNRESET); } return; } @@ -199,39 +185,42 @@ void sdp_post_sends(struct sdp_sock *ssk ring_tail(ssk->rx_ring) >= ssk->recv_request_head && tx_credits(ssk) >= SDP_MIN_TX_CREDITS && sdp_tx_ring_slots_left(ssk)) { + mb = sdp_alloc_mb_chrcvbuf_ack(sk, + ssk->recv_bytes - SDP_HEAD_SIZE, wait); + if (mb == NULL) + goto allocfail; ssk->recv_request = 0; - - mb = sdp_alloc_mb_chrcvbuf_ack(sk, - ssk->recv_frags * PAGE_SIZE, gfp); - sdp_post_send(ssk, mb); post_count++; } if (tx_credits(ssk) <= SDP_MIN_TX_CREDITS && - sdp_tx_ring_slots_left(ssk) && - ssk->isk.sk.sk_send_head && - sdp_nagle_off(ssk, ssk->isk.sk.sk_send_head)) { + sdp_tx_ring_slots_left(ssk) && sk->so_snd.sb_sndptr && + sdp_nagle_off(ssk, sk->so_snd.sb_sndptr)) { SDPSTATS_COUNTER_INC(send_miss_no_credits); } while (tx_credits(ssk) > SDP_MIN_TX_CREDITS && - sdp_tx_ring_slots_left(ssk) && - (mb = ssk->isk.sk.sk_send_head) && - sdp_nagle_off(ssk, mb)) { - update_send_head(&ssk->isk.sk, mb); - __mb_dequeue(&ssk->isk.sk.sk_write_queue); - + sdp_tx_ring_slots_left(ssk) && (mb = sk->so_snd.sb_sndptr) && + sdp_nagle_off(ssk, mb)) { + struct mbuf *n; + + SOCKBUF_LOCK(&sk->so_snd); + sk->so_snd.sb_sndptr = mb->m_nextpkt; + sk->so_snd.sb_mb = mb->m_nextpkt; + for (n = mb; n != NULL; n = mb->m_next) + sbfree(&sk->so_snd, mb); + SB_EMPTY_FIXUP(&sk->so_snd); + SOCKBUF_UNLOCK(&sk->so_snd); sdp_post_send(ssk, mb); - post_count++; } - if (credit_update_needed(ssk) && - likely((1 << ssk->isk.sk.sk_state) & - (TCPF_ESTABLISHED | TCPF_FIN_WAIT1))) { - - mb = sdp_alloc_mb_data(&ssk->isk.sk, gfp); + if (credit_update_needed(ssk) && ssk->state >= TCPS_ESTABLISHED && + ssk->state < TCPS_FIN_WAIT_2) { + mb = sdp_alloc_mb_data(ssk->socket, wait); + if (mb == NULL) + goto allocfail; sdp_post_send(ssk, mb); SDPSTATS_COUNTER_INC(post_send_credits); @@ -243,17 +232,21 @@ void sdp_post_sends(struct sdp_sock *ssk * If one credit is available, an implementation shall only send SDP * messages that provide additional credits and also do not contain ULP * payload. */ - if (unlikely(ssk->sdp_disconnect) && - !ssk->isk.sk.sk_send_head && - tx_credits(ssk) > 1) { - ssk->sdp_disconnect = 0; - - mb = sdp_alloc_mb_disconnect(sk, gfp); + if ((ssk->flags & SDP_NEEDFIN) && !sk->so_snd.sb_sndptr && + tx_credits(ssk) > 1) { + mb = sdp_alloc_mb_disconnect(sk, wait); + if (mb == NULL) + goto allocfail; + ssk->flags &= ~SDP_NEEDFIN; sdp_post_send(ssk, mb); - post_count++; } - if (post_count) sdp_xmit_poll(ssk, 0); + return; + +allocfail: + ssk->nagle_last_unacked = -1; + callout_reset(&ssk->nagle_timer, 1, sdp_nagle_timeout, ssk); + return; } Modified: projects/ofed/head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_cma.c ============================================================================== --- projects/ofed/head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_cma.c Tue Dec 14 21:33:17 2010 (r216449) +++ projects/ofed/head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_cma.c Wed Dec 15 01:08:19 2010 (r216450) @@ -31,19 +31,6 @@ * * $Id$ */ -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include #include "sdp.h" #define SDP_MAJV_MINV 0x22 @@ -56,11 +43,13 @@ enum { SDP_HAH_SIZE = 180, }; -static void sdp_qp_event_handler(struct ib_event *event, void *data) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-projects@FreeBSD.ORG Wed Dec 15 01:19:15 2010 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3EBF4106566C; Wed, 15 Dec 2010 01:19:15 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2D8078FC0A; Wed, 15 Dec 2010 01:19:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBF1JF3H036653; Wed, 15 Dec 2010 01:19:15 GMT (envelope-from jeff@svn.freebsd.org) Received: (from jeff@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBF1JFWj036651; Wed, 15 Dec 2010 01:19:15 GMT (envelope-from jeff@svn.freebsd.org) Message-Id: <201012150119.oBF1JFWj036651@svn.freebsd.org> From: Jeff Roberson Date: Wed, 15 Dec 2010 01:19:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216451 - projects/ofed/head/sys/amd64/conf X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Dec 2010 01:19:15 -0000 Author: jeff Date: Wed Dec 15 01:19:14 2010 New Revision: 216451 URL: http://svn.freebsd.org/changeset/base/216451 Log: - Add sdp to the config options Sponsored by: Isilon Systems, iX Systems, and Panasas. Modified: projects/ofed/head/sys/amd64/conf/GENERIC Modified: projects/ofed/head/sys/amd64/conf/GENERIC ============================================================================== --- projects/ofed/head/sys/amd64/conf/GENERIC Wed Dec 15 01:08:19 2010 (r216450) +++ projects/ofed/head/sys/amd64/conf/GENERIC Wed Dec 15 01:19:14 2010 (r216451) @@ -76,6 +76,7 @@ options INVARIANTS # Enable calls of e options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS options WITNESS # Enable checks to detect deadlocks and cycles options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed +options ALT_BREAK_TO_DEBUGGER # Make an SMP-capable kernel by default options SMP # Symmetric MultiProcessor Kernel @@ -92,6 +93,7 @@ device infiniband device ipoib device mlx4 device mthca +device sdp # Floppy drives device fdc From owner-svn-src-projects@FreeBSD.ORG Fri Dec 17 21:03:12 2010 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5B638106564A; Fri, 17 Dec 2010 21:03:12 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 456978FC0A; Fri, 17 Dec 2010 21:03:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBHL3CJn013792; Fri, 17 Dec 2010 21:03:12 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBHL3BZG013758; Fri, 17 Dec 2010 21:03:11 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201012172103.oBHL3BZG013758@svn.freebsd.org> From: Dimitry Andric Date: Fri, 17 Dec 2010 21:03:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216507 - in projects/binutils-2.17: . bin/sh contrib/bsnmp/lib contrib/top etc/rc.d lib/csu/ia64 lib/libc/posix1e lib/libc/powerpc64/sys lib/libipsec lib/libproc lib/libusb libexec/rtl... X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Dec 2010 21:03:12 -0000 Author: dim Date: Fri Dec 17 21:03:10 2010 New Revision: 216507 URL: http://svn.freebsd.org/changeset/base/216507 Log: Sync: merge r216339 through r216505 from ^/head. Added: projects/binutils-2.17/share/man/man4/xen.4 - copied unchanged from r216505, head/share/man/man4/xen.4 projects/binutils-2.17/sys/contrib/dev/acpica/events/evxfgpe.c - copied unchanged from r216505, head/sys/contrib/dev/acpica/events/evxfgpe.c projects/binutils-2.17/sys/mips/rmi/dev/iic/ - copied from r216505, head/sys/mips/rmi/dev/iic/ projects/binutils-2.17/tools/regression/acltools/tools-nfs4-psarc.test - copied unchanged from r216505, head/tools/regression/acltools/tools-nfs4-psarc.test projects/binutils-2.17/tools/regression/bin/sh/expansion/arith7.0 - copied unchanged from r216505, head/tools/regression/bin/sh/expansion/arith7.0 projects/binutils-2.17/tools/regression/bin/sh/expansion/cmdsubst3.0 - copied unchanged from r216505, head/tools/regression/bin/sh/expansion/cmdsubst3.0 Modified: projects/binutils-2.17/Makefile projects/binutils-2.17/ObsoleteFiles.inc projects/binutils-2.17/bin/sh/expand.c projects/binutils-2.17/bin/sh/jobs.c projects/binutils-2.17/bin/sh/memalloc.c projects/binutils-2.17/bin/sh/memalloc.h projects/binutils-2.17/bin/sh/output.c projects/binutils-2.17/bin/sh/parser.c projects/binutils-2.17/contrib/bsnmp/lib/snmp.c projects/binutils-2.17/contrib/bsnmp/lib/snmpcrypto.c projects/binutils-2.17/contrib/bsnmp/lib/snmppriv.h projects/binutils-2.17/etc/rc.d/pf projects/binutils-2.17/lib/csu/ia64/Makefile projects/binutils-2.17/lib/libc/posix1e/acl_is_trivial_np.3 projects/binutils-2.17/lib/libc/powerpc64/sys/cerror.S projects/binutils-2.17/lib/libc/powerpc64/sys/ptrace.S projects/binutils-2.17/lib/libipsec/ipsec_dump_policy.c projects/binutils-2.17/lib/libproc/proc_create.c projects/binutils-2.17/lib/libusb/libusb20_compat01.c projects/binutils-2.17/libexec/rtld-elf/rtld.c projects/binutils-2.17/release/powerpc/mkisoimages.sh projects/binutils-2.17/sbin/camcontrol/camcontrol.c projects/binutils-2.17/sbin/geom/Makefile.inc projects/binutils-2.17/sbin/geom/class/Makefile.inc projects/binutils-2.17/sbin/geom/class/cache/Makefile projects/binutils-2.17/sbin/geom/class/concat/Makefile projects/binutils-2.17/sbin/geom/class/eli/Makefile projects/binutils-2.17/sbin/geom/class/journal/Makefile projects/binutils-2.17/sbin/geom/class/label/Makefile projects/binutils-2.17/sbin/geom/class/mirror/Makefile projects/binutils-2.17/sbin/geom/class/mountver/Makefile projects/binutils-2.17/sbin/geom/class/multipath/Makefile projects/binutils-2.17/sbin/geom/class/nop/Makefile projects/binutils-2.17/sbin/geom/class/part/Makefile projects/binutils-2.17/sbin/geom/class/raid3/Makefile projects/binutils-2.17/sbin/geom/class/sched/Makefile projects/binutils-2.17/sbin/geom/class/shsec/Makefile projects/binutils-2.17/sbin/geom/class/stripe/Makefile projects/binutils-2.17/sbin/geom/class/virstor/Makefile projects/binutils-2.17/sbin/geom/core/Makefile projects/binutils-2.17/sbin/geom/core/geom.c projects/binutils-2.17/sbin/hastd/hastd.c projects/binutils-2.17/sbin/hastd/primary.c projects/binutils-2.17/sbin/ifconfig/ifmedia.c projects/binutils-2.17/sbin/mount/mount_fs.c projects/binutils-2.17/sbin/newfs/newfs.c projects/binutils-2.17/sbin/ping6/ping6.c projects/binutils-2.17/sbin/savecore/savecore.c projects/binutils-2.17/share/man/man4/Makefile projects/binutils-2.17/share/man/man4/uplcom.4 projects/binutils-2.17/share/misc/committers-ports.dot projects/binutils-2.17/sys/amd64/amd64/fpu.c projects/binutils-2.17/sys/amd64/amd64/legacy.c projects/binutils-2.17/sys/amd64/amd64/machdep.c projects/binutils-2.17/sys/amd64/conf/XENHVM projects/binutils-2.17/sys/cam/cam_periph.c projects/binutils-2.17/sys/cam/scsi/scsi_pass.c projects/binutils-2.17/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c projects/binutils-2.17/sys/cddl/dev/cyclic/i386/cyclic_machdep.c projects/binutils-2.17/sys/conf/Makefile.mips projects/binutils-2.17/sys/conf/NOTES projects/binutils-2.17/sys/conf/files projects/binutils-2.17/sys/contrib/dev/acpica/changes.txt projects/binutils-2.17/sys/contrib/dev/acpica/common/dmtable.c projects/binutils-2.17/sys/contrib/dev/acpica/common/dmtbinfo.c projects/binutils-2.17/sys/contrib/dev/acpica/compiler/aslanalyze.c projects/binutils-2.17/sys/contrib/dev/acpica/compiler/aslerror.c projects/binutils-2.17/sys/contrib/dev/acpica/compiler/aslmessages.h projects/binutils-2.17/sys/contrib/dev/acpica/compiler/dtutils.c projects/binutils-2.17/sys/contrib/dev/acpica/debugger/dbcmds.c projects/binutils-2.17/sys/contrib/dev/acpica/debugger/dbdisply.c projects/binutils-2.17/sys/contrib/dev/acpica/debugger/dbexec.c projects/binutils-2.17/sys/contrib/dev/acpica/dispatcher/dswexec.c projects/binutils-2.17/sys/contrib/dev/acpica/events/evevent.c projects/binutils-2.17/sys/contrib/dev/acpica/events/evgpe.c projects/binutils-2.17/sys/contrib/dev/acpica/events/evgpeblk.c projects/binutils-2.17/sys/contrib/dev/acpica/events/evgpeinit.c projects/binutils-2.17/sys/contrib/dev/acpica/events/evgpeutil.c projects/binutils-2.17/sys/contrib/dev/acpica/events/evxface.c projects/binutils-2.17/sys/contrib/dev/acpica/events/evxfevnt.c projects/binutils-2.17/sys/contrib/dev/acpica/executer/exconfig.c projects/binutils-2.17/sys/contrib/dev/acpica/include/acdebug.h projects/binutils-2.17/sys/contrib/dev/acpica/include/acdisasm.h projects/binutils-2.17/sys/contrib/dev/acpica/include/acevents.h projects/binutils-2.17/sys/contrib/dev/acpica/include/acglobal.h projects/binutils-2.17/sys/contrib/dev/acpica/include/aclocal.h projects/binutils-2.17/sys/contrib/dev/acpica/include/acpixf.h projects/binutils-2.17/sys/contrib/dev/acpica/include/actypes.h projects/binutils-2.17/sys/contrib/dev/acpica/tools/acpiexec/aecommon.h projects/binutils-2.17/sys/contrib/dev/acpica/utilities/utglobal.c projects/binutils-2.17/sys/contrib/dev/acpica/utilities/utxface.c projects/binutils-2.17/sys/contrib/octeon-sdk/cvmx-app-init.h projects/binutils-2.17/sys/contrib/octeon-sdk/cvmx-helper-board.c projects/binutils-2.17/sys/contrib/octeon-sdk/cvmx-helper-rgmii.c projects/binutils-2.17/sys/contrib/octeon-sdk/cvmx-pcie.c projects/binutils-2.17/sys/dev/acpi_support/acpi_fujitsu.c projects/binutils-2.17/sys/dev/acpica/acpi.c projects/binutils-2.17/sys/dev/acpica/acpi_battery.c projects/binutils-2.17/sys/dev/acpica/acpi_button.c projects/binutils-2.17/sys/dev/acpica/acpi_cmbat.c projects/binutils-2.17/sys/dev/acpica/acpi_cpu.c projects/binutils-2.17/sys/dev/acpica/acpi_ec.c projects/binutils-2.17/sys/dev/acpica/acpi_hpet.c projects/binutils-2.17/sys/dev/acpica/acpi_smbat.c projects/binutils-2.17/sys/dev/acpica/acpiio.h projects/binutils-2.17/sys/dev/alc/if_alc.c projects/binutils-2.17/sys/dev/ale/if_ale.c projects/binutils-2.17/sys/dev/atkbdc/atkbd_atkbdc.c projects/binutils-2.17/sys/dev/atkbdc/atkbdc_isa.c projects/binutils-2.17/sys/dev/atkbdc/atkbdcreg.h projects/binutils-2.17/sys/dev/atkbdc/psm.c projects/binutils-2.17/sys/dev/cxgb/ulp/tom/cxgb_tom.c projects/binutils-2.17/sys/dev/drm/drm_irq.c projects/binutils-2.17/sys/dev/ieee488/ibfoo.c projects/binutils-2.17/sys/dev/if_ndis/if_ndis_pccard.c projects/binutils-2.17/sys/dev/if_ndis/if_ndis_pci.c projects/binutils-2.17/sys/dev/iicbus/ds1775.c projects/binutils-2.17/sys/dev/jme/if_jme.c projects/binutils-2.17/sys/dev/le/if_le_pci.c projects/binutils-2.17/sys/dev/mps/mps.c projects/binutils-2.17/sys/dev/mps/mps_sas.c projects/binutils-2.17/sys/dev/mps/mpsvar.h projects/binutils-2.17/sys/fs/devfs/devfs_devs.c projects/binutils-2.17/sys/fs/devfs/devfs_rule.c projects/binutils-2.17/sys/fs/devfs/devfs_vnops.c projects/binutils-2.17/sys/i386/i386/legacy.c projects/binutils-2.17/sys/i386/i386/machdep.c projects/binutils-2.17/sys/i386/isa/npx.c projects/binutils-2.17/sys/i386/xen/clock.c projects/binutils-2.17/sys/kern/kern_conf.c projects/binutils-2.17/sys/kern/kern_fork.c projects/binutils-2.17/sys/kern/kern_resource.c projects/binutils-2.17/sys/kern/kern_umtx.c projects/binutils-2.17/sys/kern/subr_acl_nfs4.c projects/binutils-2.17/sys/kern/subr_clock.c projects/binutils-2.17/sys/kern/uipc_syscalls.c projects/binutils-2.17/sys/mips/cavium/octe/ethernet-common.c projects/binutils-2.17/sys/mips/conf/SWARM projects/binutils-2.17/sys/mips/conf/SWARM64 projects/binutils-2.17/sys/mips/conf/SWARM64_SMP projects/binutils-2.17/sys/mips/conf/SWARM_SMP projects/binutils-2.17/sys/mips/conf/XLR projects/binutils-2.17/sys/mips/mips/elf_trampoline.c projects/binutils-2.17/sys/mips/mips/inckern.S projects/binutils-2.17/sys/mips/rmi/board.c projects/binutils-2.17/sys/mips/rmi/board.h projects/binutils-2.17/sys/mips/rmi/dev/xlr/rge.c projects/binutils-2.17/sys/mips/rmi/files.xlr projects/binutils-2.17/sys/mips/rmi/iodi.c projects/binutils-2.17/sys/mips/rmi/xlr_i2c.c projects/binutils-2.17/sys/modules/acpi/acpi/Makefile projects/binutils-2.17/sys/netinet/if_atm.c projects/binutils-2.17/sys/netinet/sctp_indata.c projects/binutils-2.17/sys/netinet/sctp_input.c projects/binutils-2.17/sys/netinet/sctputil.c projects/binutils-2.17/sys/nfsserver/nfs_serv.c projects/binutils-2.17/sys/powerpc/aim/mmu_oea64.c projects/binutils-2.17/sys/powerpc/aim/moea64_native.c projects/binutils-2.17/sys/sys/sleepqueue.h projects/binutils-2.17/sys/sys/turnstile.h projects/binutils-2.17/sys/vm/memguard.c projects/binutils-2.17/sys/x86/isa/atrtc.c projects/binutils-2.17/sys/xen/xenstore/xenstore.c projects/binutils-2.17/tools/regression/acltools/02.t projects/binutils-2.17/tools/regression/bin/sh/errors/bad-keyword1.0 projects/binutils-2.17/tools/regression/bin/sh/execution/func3.0 projects/binutils-2.17/tools/regression/sockets/sendfile/sendfile.c projects/binutils-2.17/usr.bin/apply/apply.1 projects/binutils-2.17/usr.bin/apply/apply.c projects/binutils-2.17/usr.bin/banner/banner.6 projects/binutils-2.17/usr.bin/banner/banner.c projects/binutils-2.17/usr.bin/basename/basename.1 projects/binutils-2.17/usr.bin/basename/basename.c projects/binutils-2.17/usr.bin/biff/biff.1 projects/binutils-2.17/usr.bin/biff/biff.c projects/binutils-2.17/usr.bin/calendar/calendars/calendar.freebsd projects/binutils-2.17/usr.bin/cap_mkdb/cap_mkdb.1 projects/binutils-2.17/usr.bin/cap_mkdb/cap_mkdb.c projects/binutils-2.17/usr.bin/checknr/checknr.1 projects/binutils-2.17/usr.bin/checknr/checknr.c projects/binutils-2.17/usr.bin/chpass/chpass.1 projects/binutils-2.17/usr.bin/chpass/table.c projects/binutils-2.17/usr.bin/cksum/cksum.1 projects/binutils-2.17/usr.bin/cksum/cksum.c projects/binutils-2.17/usr.bin/cksum/crc.c projects/binutils-2.17/usr.bin/cksum/extern.h projects/binutils-2.17/usr.bin/cksum/print.c projects/binutils-2.17/usr.bin/cksum/sum1.c projects/binutils-2.17/usr.bin/cksum/sum2.c projects/binutils-2.17/usr.bin/cmp/cmp.1 projects/binutils-2.17/usr.bin/cmp/cmp.c projects/binutils-2.17/usr.bin/cmp/extern.h projects/binutils-2.17/usr.bin/cmp/misc.c projects/binutils-2.17/usr.bin/cmp/regular.c projects/binutils-2.17/usr.bin/cmp/special.c projects/binutils-2.17/usr.bin/col/col.1 projects/binutils-2.17/usr.bin/col/col.c projects/binutils-2.17/usr.bin/colcrt/colcrt.1 projects/binutils-2.17/usr.bin/colcrt/colcrt.c projects/binutils-2.17/usr.bin/colrm/colrm.1 projects/binutils-2.17/usr.bin/colrm/colrm.c projects/binutils-2.17/usr.bin/column/column.1 projects/binutils-2.17/usr.bin/column/column.c projects/binutils-2.17/usr.bin/comm/comm.1 projects/binutils-2.17/usr.bin/comm/comm.c projects/binutils-2.17/usr.bin/compress/compress.1 projects/binutils-2.17/usr.bin/compress/compress.c projects/binutils-2.17/usr.bin/compress/zopen.3 projects/binutils-2.17/usr.bin/compress/zopen.c projects/binutils-2.17/usr.bin/csup/fnmatch.c projects/binutils-2.17/usr.bin/csup/fnmatch.h projects/binutils-2.17/usr.bin/ctags/C.c projects/binutils-2.17/usr.bin/ctags/ctags.1 projects/binutils-2.17/usr.bin/ctags/ctags.c projects/binutils-2.17/usr.bin/ctags/ctags.h projects/binutils-2.17/usr.bin/ctags/fortran.c projects/binutils-2.17/usr.bin/ctags/lisp.c projects/binutils-2.17/usr.bin/ctags/print.c projects/binutils-2.17/usr.bin/ctags/tree.c projects/binutils-2.17/usr.bin/ctags/yacc.c projects/binutils-2.17/usr.bin/cut/cut.1 projects/binutils-2.17/usr.bin/cut/cut.c projects/binutils-2.17/usr.bin/dirname/dirname.c projects/binutils-2.17/usr.bin/du/du.1 projects/binutils-2.17/usr.bin/du/du.c projects/binutils-2.17/usr.bin/env/env.1 projects/binutils-2.17/usr.bin/env/env.c projects/binutils-2.17/usr.bin/expand/expand.1 projects/binutils-2.17/usr.bin/expand/expand.c projects/binutils-2.17/usr.bin/false/false.1 projects/binutils-2.17/usr.bin/false/false.c projects/binutils-2.17/usr.bin/find/extern.h projects/binutils-2.17/usr.bin/find/find.1 projects/binutils-2.17/usr.bin/find/find.c projects/binutils-2.17/usr.bin/find/find.h projects/binutils-2.17/usr.bin/find/function.c projects/binutils-2.17/usr.bin/find/ls.c projects/binutils-2.17/usr.bin/find/main.c projects/binutils-2.17/usr.bin/find/misc.c projects/binutils-2.17/usr.bin/find/operator.c projects/binutils-2.17/usr.bin/find/option.c projects/binutils-2.17/usr.bin/finger/extern.h projects/binutils-2.17/usr.bin/finger/finger.1 projects/binutils-2.17/usr.bin/finger/finger.c projects/binutils-2.17/usr.bin/finger/finger.h projects/binutils-2.17/usr.bin/finger/lprint.c projects/binutils-2.17/usr.bin/finger/net.c projects/binutils-2.17/usr.bin/finger/sprint.c projects/binutils-2.17/usr.bin/finger/util.c projects/binutils-2.17/usr.bin/fmt/fmt.1 projects/binutils-2.17/usr.bin/fold/fold.1 projects/binutils-2.17/usr.bin/fold/fold.c projects/binutils-2.17/usr.bin/from/from.1 projects/binutils-2.17/usr.bin/from/from.c projects/binutils-2.17/usr.bin/fstat/fstat.1 projects/binutils-2.17/usr.bin/fstat/fstat.c projects/binutils-2.17/usr.bin/fstat/fstat.h projects/binutils-2.17/usr.bin/gcore/extern.h projects/binutils-2.17/usr.bin/gcore/gcore.1 projects/binutils-2.17/usr.bin/gcore/gcore.c projects/binutils-2.17/usr.bin/gprof/amd64.h projects/binutils-2.17/usr.bin/gprof/aout.c projects/binutils-2.17/usr.bin/gprof/arcs.c projects/binutils-2.17/usr.bin/gprof/arm.h projects/binutils-2.17/usr.bin/gprof/dfn.c projects/binutils-2.17/usr.bin/gprof/elf.c projects/binutils-2.17/usr.bin/gprof/gprof.1 projects/binutils-2.17/usr.bin/gprof/gprof.c projects/binutils-2.17/usr.bin/gprof/gprof.h projects/binutils-2.17/usr.bin/gprof/hertz.c projects/binutils-2.17/usr.bin/gprof/i386.h projects/binutils-2.17/usr.bin/gprof/ia64.h projects/binutils-2.17/usr.bin/gprof/lookup.c projects/binutils-2.17/usr.bin/gprof/pathnames.h projects/binutils-2.17/usr.bin/gprof/powerpc.h projects/binutils-2.17/usr.bin/gprof/printgprof.c projects/binutils-2.17/usr.bin/gprof/printlist.c projects/binutils-2.17/usr.bin/gprof/sparc64.h projects/binutils-2.17/usr.bin/head/head.1 projects/binutils-2.17/usr.bin/head/head.c projects/binutils-2.17/usr.bin/hexdump/conv.c projects/binutils-2.17/usr.bin/hexdump/display.c projects/binutils-2.17/usr.bin/hexdump/hexdump.1 projects/binutils-2.17/usr.bin/hexdump/hexdump.c projects/binutils-2.17/usr.bin/hexdump/hexdump.h projects/binutils-2.17/usr.bin/hexdump/hexsyntax.c projects/binutils-2.17/usr.bin/hexdump/od.1 projects/binutils-2.17/usr.bin/hexdump/odsyntax.c projects/binutils-2.17/usr.bin/hexdump/parse.c projects/binutils-2.17/usr.bin/id/groups.1 projects/binutils-2.17/usr.bin/id/id.1 projects/binutils-2.17/usr.bin/id/id.c projects/binutils-2.17/usr.bin/id/whoami.1 projects/binutils-2.17/usr.bin/join/join.1 projects/binutils-2.17/usr.bin/join/join.c projects/binutils-2.17/usr.bin/jot/jot.1 projects/binutils-2.17/usr.bin/jot/jot.c projects/binutils-2.17/usr.bin/kdump/kdump.1 projects/binutils-2.17/usr.bin/kdump/kdump.c projects/binutils-2.17/usr.bin/ktrace/ktrace.1 projects/binutils-2.17/usr.bin/ktrace/ktrace.c projects/binutils-2.17/usr.bin/ktrace/ktrace.h projects/binutils-2.17/usr.bin/ktrace/subr.c projects/binutils-2.17/usr.bin/lam/lam.1 projects/binutils-2.17/usr.bin/lam/lam.c projects/binutils-2.17/usr.bin/last/last.1 projects/binutils-2.17/usr.bin/last/last.c projects/binutils-2.17/usr.bin/lastcomm/lastcomm.1 projects/binutils-2.17/usr.bin/lastcomm/lastcomm.c projects/binutils-2.17/usr.bin/lastcomm/pathnames.h projects/binutils-2.17/usr.bin/leave/leave.1 projects/binutils-2.17/usr.bin/leave/leave.c projects/binutils-2.17/usr.bin/lock/lock.1 projects/binutils-2.17/usr.bin/lock/lock.c projects/binutils-2.17/usr.bin/logger/logger.1 projects/binutils-2.17/usr.bin/logger/logger.c projects/binutils-2.17/usr.bin/login/login.1 projects/binutils-2.17/usr.bin/login/pathnames.h projects/binutils-2.17/usr.bin/logname/logname.1 projects/binutils-2.17/usr.bin/logname/logname.c projects/binutils-2.17/usr.bin/look/look.1 projects/binutils-2.17/usr.bin/look/look.c projects/binutils-2.17/usr.bin/look/pathnames.h projects/binutils-2.17/usr.bin/lorder/lorder.1 projects/binutils-2.17/usr.bin/lorder/lorder.sh projects/binutils-2.17/usr.bin/m4/TEST/ack.m4 projects/binutils-2.17/usr.bin/m4/TEST/hanoi.m4 projects/binutils-2.17/usr.bin/m4/TEST/hash.m4 projects/binutils-2.17/usr.bin/m4/TEST/sqroot.m4 projects/binutils-2.17/usr.bin/m4/TEST/string.m4 projects/binutils-2.17/usr.bin/m4/TEST/test.m4 projects/binutils-2.17/usr.bin/m4/eval.c projects/binutils-2.17/usr.bin/m4/expr.c projects/binutils-2.17/usr.bin/m4/extern.h projects/binutils-2.17/usr.bin/m4/look.c projects/binutils-2.17/usr.bin/m4/main.c projects/binutils-2.17/usr.bin/m4/mdef.h projects/binutils-2.17/usr.bin/m4/misc.c projects/binutils-2.17/usr.bin/m4/pathnames.h projects/binutils-2.17/usr.bin/m4/stdd.h projects/binutils-2.17/usr.bin/mail/cmd1.c projects/binutils-2.17/usr.bin/mail/cmd2.c projects/binutils-2.17/usr.bin/mail/cmd3.c projects/binutils-2.17/usr.bin/mail/cmdtab.c projects/binutils-2.17/usr.bin/mail/collect.c projects/binutils-2.17/usr.bin/mail/def.h projects/binutils-2.17/usr.bin/mail/edit.c projects/binutils-2.17/usr.bin/mail/extern.h projects/binutils-2.17/usr.bin/mail/fio.c projects/binutils-2.17/usr.bin/mail/getname.c projects/binutils-2.17/usr.bin/mail/glob.h projects/binutils-2.17/usr.bin/mail/head.c projects/binutils-2.17/usr.bin/mail/lex.c projects/binutils-2.17/usr.bin/mail/list.c projects/binutils-2.17/usr.bin/mail/mail.1 projects/binutils-2.17/usr.bin/mail/main.c projects/binutils-2.17/usr.bin/mail/names.c projects/binutils-2.17/usr.bin/mail/pathnames.h projects/binutils-2.17/usr.bin/mail/popen.c projects/binutils-2.17/usr.bin/mail/quit.c projects/binutils-2.17/usr.bin/mail/rcv.h projects/binutils-2.17/usr.bin/mail/send.c projects/binutils-2.17/usr.bin/mail/strings.c projects/binutils-2.17/usr.bin/mail/temp.c projects/binutils-2.17/usr.bin/mail/tty.c projects/binutils-2.17/usr.bin/mail/util.c projects/binutils-2.17/usr.bin/mail/v7.local.c projects/binutils-2.17/usr.bin/mail/vars.c projects/binutils-2.17/usr.bin/mail/version.c projects/binutils-2.17/usr.bin/man/man.sh projects/binutils-2.17/usr.bin/mesg/mesg.1 projects/binutils-2.17/usr.bin/mkdep/mkdep.1 projects/binutils-2.17/usr.bin/mkdep/mkdep.gcc.sh projects/binutils-2.17/usr.bin/mkdep/mkdep.sh projects/binutils-2.17/usr.bin/mkfifo/mkfifo.1 projects/binutils-2.17/usr.bin/mkfifo/mkfifo.c projects/binutils-2.17/usr.bin/mklocale/extern.h projects/binutils-2.17/usr.bin/mklocale/ldef.h projects/binutils-2.17/usr.bin/mklocale/lex.l projects/binutils-2.17/usr.bin/mklocale/mklocale.1 projects/binutils-2.17/usr.bin/mklocale/yacc.y projects/binutils-2.17/usr.bin/mkstr/mkstr.1 projects/binutils-2.17/usr.bin/mkstr/mkstr.c projects/binutils-2.17/usr.bin/mktemp/mktemp.1 projects/binutils-2.17/usr.bin/msgs/msgs.1 projects/binutils-2.17/usr.bin/msgs/msgs.c projects/binutils-2.17/usr.bin/msgs/pathnames.h projects/binutils-2.17/usr.bin/mt/mt.1 projects/binutils-2.17/usr.bin/mt/mt.c projects/binutils-2.17/usr.bin/netstat/atalk.c projects/binutils-2.17/usr.bin/netstat/if.c projects/binutils-2.17/usr.bin/netstat/inet.c projects/binutils-2.17/usr.bin/netstat/inet6.c projects/binutils-2.17/usr.bin/netstat/ipsec.c projects/binutils-2.17/usr.bin/netstat/main.c projects/binutils-2.17/usr.bin/netstat/netstat.1 projects/binutils-2.17/usr.bin/netstat/netstat.h projects/binutils-2.17/usr.bin/netstat/pfkey.c projects/binutils-2.17/usr.bin/netstat/route.c projects/binutils-2.17/usr.bin/netstat/unix.c projects/binutils-2.17/usr.bin/nfsstat/nfsstat.1 projects/binutils-2.17/usr.bin/nfsstat/nfsstat.c projects/binutils-2.17/usr.bin/nice/nice.1 projects/binutils-2.17/usr.bin/nice/nice.c projects/binutils-2.17/usr.bin/nohup/nohup.1 projects/binutils-2.17/usr.bin/nohup/nohup.c projects/binutils-2.17/usr.bin/pagesize/pagesize.1 projects/binutils-2.17/usr.bin/pagesize/pagesize.sh projects/binutils-2.17/usr.bin/passwd/passwd.1 projects/binutils-2.17/usr.bin/paste/paste.1 projects/binutils-2.17/usr.bin/paste/paste.c projects/binutils-2.17/usr.bin/printenv/printenv.1 projects/binutils-2.17/usr.bin/printenv/printenv.c projects/binutils-2.17/usr.bin/printf/printf.1 projects/binutils-2.17/usr.bin/printf/printf.c projects/binutils-2.17/usr.bin/quota/quota.1 projects/binutils-2.17/usr.bin/quota/quota.c projects/binutils-2.17/usr.bin/renice/renice.8 projects/binutils-2.17/usr.bin/renice/renice.c projects/binutils-2.17/usr.bin/rev/rev.1 projects/binutils-2.17/usr.bin/rev/rev.c projects/binutils-2.17/usr.bin/rlogin/rlogin.1 projects/binutils-2.17/usr.bin/rs/rs.1 projects/binutils-2.17/usr.bin/rs/rs.c projects/binutils-2.17/usr.bin/rsh/rsh.1 projects/binutils-2.17/usr.bin/rup/rup.1 projects/binutils-2.17/usr.bin/ruptime/ruptime.1 projects/binutils-2.17/usr.bin/ruptime/ruptime.c projects/binutils-2.17/usr.bin/rusers/rusers.1 projects/binutils-2.17/usr.bin/rwall/rwall.1 projects/binutils-2.17/usr.bin/rwho/rwho.1 projects/binutils-2.17/usr.bin/rwho/rwho.c projects/binutils-2.17/usr.bin/script/script.1 projects/binutils-2.17/usr.bin/script/script.c projects/binutils-2.17/usr.bin/shar/shar.1 projects/binutils-2.17/usr.bin/shar/shar.sh projects/binutils-2.17/usr.bin/showmount/showmount.8 projects/binutils-2.17/usr.bin/showmount/showmount.c projects/binutils-2.17/usr.bin/split/split.1 projects/binutils-2.17/usr.bin/split/split.c projects/binutils-2.17/usr.bin/stat/stat.c projects/binutils-2.17/usr.bin/su/su.1 projects/binutils-2.17/usr.bin/su/su.c projects/binutils-2.17/usr.bin/systat/cmds.c projects/binutils-2.17/usr.bin/systat/cmdtab.c projects/binutils-2.17/usr.bin/systat/devs.c projects/binutils-2.17/usr.bin/systat/extern.h projects/binutils-2.17/usr.bin/systat/fetch.c projects/binutils-2.17/usr.bin/systat/icmp.c projects/binutils-2.17/usr.bin/systat/icmp6.c projects/binutils-2.17/usr.bin/systat/iostat.c projects/binutils-2.17/usr.bin/systat/ip.c projects/binutils-2.17/usr.bin/systat/ip6.c projects/binutils-2.17/usr.bin/systat/keyboard.c projects/binutils-2.17/usr.bin/systat/main.c projects/binutils-2.17/usr.bin/systat/mbufs.c projects/binutils-2.17/usr.bin/systat/netcmds.c projects/binutils-2.17/usr.bin/systat/netstat.c projects/binutils-2.17/usr.bin/systat/pigs.c projects/binutils-2.17/usr.bin/systat/swap.c projects/binutils-2.17/usr.bin/systat/systat.1 projects/binutils-2.17/usr.bin/systat/systat.h projects/binutils-2.17/usr.bin/systat/tcp.c projects/binutils-2.17/usr.bin/systat/vmstat.c projects/binutils-2.17/usr.bin/tail/extern.h projects/binutils-2.17/usr.bin/tail/forward.c projects/binutils-2.17/usr.bin/tail/misc.c projects/binutils-2.17/usr.bin/tail/read.c projects/binutils-2.17/usr.bin/tail/reverse.c projects/binutils-2.17/usr.bin/tail/tail.1 projects/binutils-2.17/usr.bin/tail/tail.c projects/binutils-2.17/usr.bin/talk/ctl.c projects/binutils-2.17/usr.bin/talk/ctl_transact.c projects/binutils-2.17/usr.bin/talk/display.c projects/binutils-2.17/usr.bin/talk/get_addrs.c projects/binutils-2.17/usr.bin/talk/get_names.c projects/binutils-2.17/usr.bin/talk/init_disp.c projects/binutils-2.17/usr.bin/talk/invite.c projects/binutils-2.17/usr.bin/talk/io.c projects/binutils-2.17/usr.bin/talk/look_up.c projects/binutils-2.17/usr.bin/talk/msgs.c projects/binutils-2.17/usr.bin/talk/talk.1 projects/binutils-2.17/usr.bin/talk/talk.c projects/binutils-2.17/usr.bin/talk/talk.h projects/binutils-2.17/usr.bin/talk/talk_ctl.h projects/binutils-2.17/usr.bin/tcopy/tcopy.1 projects/binutils-2.17/usr.bin/tcopy/tcopy.c projects/binutils-2.17/usr.bin/tee/tee.1 projects/binutils-2.17/usr.bin/tee/tee.c projects/binutils-2.17/usr.bin/tftp/main.c projects/binutils-2.17/usr.bin/tftp/tftp.1 projects/binutils-2.17/usr.bin/tftp/tftp.c projects/binutils-2.17/usr.bin/tftp/tftp.h projects/binutils-2.17/usr.bin/time/time.1 projects/binutils-2.17/usr.bin/time/time.c projects/binutils-2.17/usr.bin/touch/touch.1 projects/binutils-2.17/usr.bin/touch/touch.c projects/binutils-2.17/usr.bin/tput/clear.sh projects/binutils-2.17/usr.bin/tput/tput.1 projects/binutils-2.17/usr.bin/tput/tput.c projects/binutils-2.17/usr.bin/tr/extern.h projects/binutils-2.17/usr.bin/tr/str.c projects/binutils-2.17/usr.bin/tr/tr.1 projects/binutils-2.17/usr.bin/tr/tr.c projects/binutils-2.17/usr.bin/true/true.1 projects/binutils-2.17/usr.bin/true/true.c projects/binutils-2.17/usr.bin/tset/extern.h projects/binutils-2.17/usr.bin/tset/map.c projects/binutils-2.17/usr.bin/tset/misc.c projects/binutils-2.17/usr.bin/tset/set.c projects/binutils-2.17/usr.bin/tset/term.c projects/binutils-2.17/usr.bin/tset/tset.1 projects/binutils-2.17/usr.bin/tset/tset.c projects/binutils-2.17/usr.bin/tset/wrterm.c projects/binutils-2.17/usr.bin/tsort/tsort.1 projects/binutils-2.17/usr.bin/tsort/tsort.c projects/binutils-2.17/usr.bin/tty/tty.1 projects/binutils-2.17/usr.bin/tty/tty.c projects/binutils-2.17/usr.bin/ul/ul.1 projects/binutils-2.17/usr.bin/ul/ul.c projects/binutils-2.17/usr.bin/uname/uname.1 projects/binutils-2.17/usr.bin/unexpand/unexpand.c projects/binutils-2.17/usr.bin/uniq/uniq.1 projects/binutils-2.17/usr.bin/uniq/uniq.c projects/binutils-2.17/usr.bin/unvis/unvis.1 projects/binutils-2.17/usr.bin/unvis/unvis.c projects/binutils-2.17/usr.bin/users/users.1 projects/binutils-2.17/usr.bin/users/users.c projects/binutils-2.17/usr.bin/uudecode/uudecode.c projects/binutils-2.17/usr.bin/uuencode/uuencode.1 projects/binutils-2.17/usr.bin/uuencode/uuencode.c projects/binutils-2.17/usr.bin/uuencode/uuencode.format.5 projects/binutils-2.17/usr.bin/vgrind/RETEST/retest.c projects/binutils-2.17/usr.bin/vgrind/extern.h projects/binutils-2.17/usr.bin/vgrind/pathnames.h projects/binutils-2.17/usr.bin/vgrind/regexp.c projects/binutils-2.17/usr.bin/vgrind/vfontedpr.c projects/binutils-2.17/usr.bin/vgrind/vgrind.1 projects/binutils-2.17/usr.bin/vgrind/vgrind.sh projects/binutils-2.17/usr.bin/vgrind/vgrindefs.5 projects/binutils-2.17/usr.bin/vgrind/vgrindefs.c projects/binutils-2.17/usr.bin/vgrind/vgrindefs.src projects/binutils-2.17/usr.bin/vis/extern.h projects/binutils-2.17/usr.bin/vis/foldit.c projects/binutils-2.17/usr.bin/vis/vis.1 projects/binutils-2.17/usr.bin/vis/vis.c projects/binutils-2.17/usr.bin/vmstat/vmstat.8 projects/binutils-2.17/usr.bin/vmstat/vmstat.c projects/binutils-2.17/usr.bin/w/extern.h projects/binutils-2.17/usr.bin/w/pr_time.c projects/binutils-2.17/usr.bin/w/proc_compare.c projects/binutils-2.17/usr.bin/w/uptime.1 projects/binutils-2.17/usr.bin/w/w.1 projects/binutils-2.17/usr.bin/w/w.c projects/binutils-2.17/usr.bin/wall/ttymsg.c projects/binutils-2.17/usr.bin/wall/wall.1 projects/binutils-2.17/usr.bin/wall/wall.c projects/binutils-2.17/usr.bin/wc/wc.1 projects/binutils-2.17/usr.bin/wc/wc.c projects/binutils-2.17/usr.bin/what/what.1 projects/binutils-2.17/usr.bin/what/what.c projects/binutils-2.17/usr.bin/who/who.1 projects/binutils-2.17/usr.bin/whois/whois.1 projects/binutils-2.17/usr.bin/whois/whois.c projects/binutils-2.17/usr.bin/write/write.1 projects/binutils-2.17/usr.bin/write/write.c projects/binutils-2.17/usr.bin/xargs/pathnames.h projects/binutils-2.17/usr.bin/xargs/xargs.1 projects/binutils-2.17/usr.bin/xargs/xargs.c projects/binutils-2.17/usr.bin/xinstall/install.1 projects/binutils-2.17/usr.bin/xinstall/xinstall.c projects/binutils-2.17/usr.bin/xstr/pathnames.h projects/binutils-2.17/usr.bin/xstr/xstr.1 projects/binutils-2.17/usr.bin/xstr/xstr.c projects/binutils-2.17/usr.bin/yacc/closure.c projects/binutils-2.17/usr.bin/yacc/defs.h projects/binutils-2.17/usr.bin/yacc/error.c projects/binutils-2.17/usr.bin/yacc/lalr.c projects/binutils-2.17/usr.bin/yacc/lr0.c projects/binutils-2.17/usr.bin/yacc/main.c projects/binutils-2.17/usr.bin/yacc/mkpar.c projects/binutils-2.17/usr.bin/yacc/output.c projects/binutils-2.17/usr.bin/yacc/reader.c projects/binutils-2.17/usr.bin/yacc/skeleton.c projects/binutils-2.17/usr.bin/yacc/symtab.c projects/binutils-2.17/usr.bin/yacc/verbose.c projects/binutils-2.17/usr.bin/yacc/warshall.c projects/binutils-2.17/usr.bin/yacc/yacc.1 projects/binutils-2.17/usr.bin/yacc/yyfix.1 projects/binutils-2.17/usr.bin/yacc/yyfix.sh projects/binutils-2.17/usr.bin/yes/yes.1 projects/binutils-2.17/usr.bin/yes/yes.c projects/binutils-2.17/usr.sbin/acpi/acpidb/Makefile projects/binutils-2.17/usr.sbin/bsnmpd/bsnmpd/Makefile projects/binutils-2.17/usr.sbin/bsnmpd/tools/libbsnmptools/Makefile projects/binutils-2.17/usr.sbin/config/config.y projects/binutils-2.17/usr.sbin/gpioctl/gpioctl.8 projects/binutils-2.17/usr.sbin/iostat/iostat.8 projects/binutils-2.17/usr.sbin/iostat/iostat.c projects/binutils-2.17/usr.sbin/lpr/common_source/displayq.c projects/binutils-2.17/usr.sbin/lpr/common_source/lp.h projects/binutils-2.17/usr.sbin/lpr/common_source/lp.local.h projects/binutils-2.17/usr.sbin/lpr/common_source/pathnames.h projects/binutils-2.17/usr.sbin/lpr/common_source/rmjob.c projects/binutils-2.17/usr.sbin/lpr/common_source/startdaemon.c projects/binutils-2.17/usr.sbin/lpr/filters/lpf.c projects/binutils-2.17/usr.sbin/lpr/lpc/cmds.c projects/binutils-2.17/usr.sbin/lpr/lpc/cmdtab.c projects/binutils-2.17/usr.sbin/lpr/lpc/extern.h projects/binutils-2.17/usr.sbin/lpr/lpc/lpc.8 projects/binutils-2.17/usr.sbin/lpr/lpc/lpc.c projects/binutils-2.17/usr.sbin/lpr/lpc/lpc.h projects/binutils-2.17/usr.sbin/lpr/lpd/extern.h projects/binutils-2.17/usr.sbin/lpr/lpd/lpd.8 projects/binutils-2.17/usr.sbin/lpr/lpd/lpd.c projects/binutils-2.17/usr.sbin/lpr/lpd/lpdchar.c projects/binutils-2.17/usr.sbin/lpr/lpd/modes.c projects/binutils-2.17/usr.sbin/lpr/lpd/printjob.c projects/binutils-2.17/usr.sbin/lpr/lpd/recvjob.c projects/binutils-2.17/usr.sbin/lpr/lpq/lpq.1 projects/binutils-2.17/usr.sbin/lpr/lpq/lpq.c projects/binutils-2.17/usr.sbin/lpr/lpr/lpr.1 projects/binutils-2.17/usr.sbin/lpr/lpr/printcap.5 projects/binutils-2.17/usr.sbin/lpr/lprm/lprm.1 projects/binutils-2.17/usr.sbin/lpr/lprm/lprm.c projects/binutils-2.17/usr.sbin/lpr/lptest/lptest.1 projects/binutils-2.17/usr.sbin/lpr/lptest/lptest.c projects/binutils-2.17/usr.sbin/lpr/pac/pac.8 projects/binutils-2.17/usr.sbin/lpr/pac/pac.c projects/binutils-2.17/usr.sbin/sysinstall/media.c projects/binutils-2.17/usr.sbin/timed/timed/acksend.c projects/binutils-2.17/usr.sbin/timed/timed/byteorder.c projects/binutils-2.17/usr.sbin/timed/timed/candidate.c projects/binutils-2.17/usr.sbin/timed/timed/cksum.c projects/binutils-2.17/usr.sbin/timed/timed/correct.c projects/binutils-2.17/usr.sbin/timed/timed/extern.h projects/binutils-2.17/usr.sbin/timed/timed/globals.h projects/binutils-2.17/usr.sbin/timed/timed/master.c projects/binutils-2.17/usr.sbin/timed/timed/measure.c projects/binutils-2.17/usr.sbin/timed/timed/networkdelta.c projects/binutils-2.17/usr.sbin/timed/timed/pathnames.h projects/binutils-2.17/usr.sbin/timed/timed/readmsg.c projects/binutils-2.17/usr.sbin/timed/timed/slave.c projects/binutils-2.17/usr.sbin/timed/timed/timed.8 projects/binutils-2.17/usr.sbin/timed/timed/timed.c projects/binutils-2.17/usr.sbin/timed/timedc/cmds.c projects/binutils-2.17/usr.sbin/timed/timedc/cmdtab.c projects/binutils-2.17/usr.sbin/timed/timedc/extern.h projects/binutils-2.17/usr.sbin/timed/timedc/timedc.8 projects/binutils-2.17/usr.sbin/timed/timedc/timedc.c projects/binutils-2.17/usr.sbin/timed/timedc/timedc.h projects/binutils-2.17/usr.sbin/traceroute6/traceroute6.c Directory Properties: projects/binutils-2.17/ (props changed) projects/binutils-2.17/cddl/contrib/opensolaris/ (props changed) projects/binutils-2.17/contrib/bind9/ (props changed) projects/binutils-2.17/contrib/binutils/ (props changed) projects/binutils-2.17/contrib/bzip2/ (props changed) projects/binutils-2.17/contrib/ee/ (props changed) projects/binutils-2.17/contrib/expat/ (props changed) projects/binutils-2.17/contrib/file/ (props changed) projects/binutils-2.17/contrib/gdb/ (props changed) projects/binutils-2.17/contrib/gdtoa/ (props changed) projects/binutils-2.17/contrib/gnu-sort/ (props changed) projects/binutils-2.17/contrib/groff/ (props changed) projects/binutils-2.17/contrib/less/ (props changed) projects/binutils-2.17/contrib/libpcap/ (props changed) projects/binutils-2.17/contrib/llvm/ (props changed) projects/binutils-2.17/contrib/llvm/tools/clang/ (props changed) projects/binutils-2.17/contrib/ncurses/ (props changed) projects/binutils-2.17/contrib/netcat/ (props changed) projects/binutils-2.17/contrib/ntp/ (props changed) projects/binutils-2.17/contrib/one-true-awk/ (props changed) projects/binutils-2.17/contrib/openbsm/ (props changed) projects/binutils-2.17/contrib/openpam/ (props changed) projects/binutils-2.17/contrib/pf/ (props changed) projects/binutils-2.17/contrib/sendmail/ (props changed) projects/binutils-2.17/contrib/tcpdump/ (props changed) projects/binutils-2.17/contrib/tcsh/ (props changed) projects/binutils-2.17/contrib/top/ (props changed) projects/binutils-2.17/contrib/top/install-sh (props changed) projects/binutils-2.17/contrib/tzcode/stdtime/ (props changed) projects/binutils-2.17/contrib/tzcode/zic/ (props changed) projects/binutils-2.17/contrib/tzdata/ (props changed) projects/binutils-2.17/contrib/wpa/ (props changed) projects/binutils-2.17/contrib/xz/ (props changed) projects/binutils-2.17/crypto/openssh/ (props changed) projects/binutils-2.17/crypto/openssl/ (props changed) projects/binutils-2.17/lib/libc/ (props changed) projects/binutils-2.17/lib/libc/stdtime/ (props changed) projects/binutils-2.17/lib/libutil/ (props changed) projects/binutils-2.17/lib/libz/ (props changed) projects/binutils-2.17/sbin/ (props changed) projects/binutils-2.17/sbin/ipfw/ (props changed) projects/binutils-2.17/share/mk/bsd.arch.inc.mk (props changed) projects/binutils-2.17/share/zoneinfo/ (props changed) projects/binutils-2.17/sys/ (props changed) projects/binutils-2.17/sys/amd64/include/xen/ (props changed) projects/binutils-2.17/sys/cddl/contrib/opensolaris/ (props changed) projects/binutils-2.17/sys/contrib/dev/acpica/ (props changed) projects/binutils-2.17/sys/contrib/octeon-sdk/ (props changed) projects/binutils-2.17/sys/contrib/pf/ (props changed) projects/binutils-2.17/sys/contrib/x86emu/ (props changed) projects/binutils-2.17/usr.bin/calendar/ (props changed) projects/binutils-2.17/usr.bin/csup/ (props changed) projects/binutils-2.17/usr.bin/procstat/ (props changed) projects/binutils-2.17/usr.sbin/zic/ (props changed) Modified: projects/binutils-2.17/Makefile ============================================================================== --- projects/binutils-2.17/Makefile Fri Dec 17 19:48:54 2010 (r216506) +++ projects/binutils-2.17/Makefile Fri Dec 17 21:03:10 2010 (r216507) @@ -271,7 +271,7 @@ make: .PHONY tinderbox: cd ${.CURDIR} && \ - DOING_TINDERBOX=YES ${MAKE} ${JFLAG} universe + DOING_TINDERBOX=YES ${MAKE} JFLAG=${JFLAG} universe # # universe Modified: projects/binutils-2.17/ObsoleteFiles.inc ============================================================================== --- projects/binutils-2.17/ObsoleteFiles.inc Fri Dec 17 19:48:54 2010 (r216506) +++ projects/binutils-2.17/ObsoleteFiles.inc Fri Dec 17 21:03:10 2010 (r216507) @@ -284,6 +284,8 @@ OLD_FILES+=usr/share/man/man9/ieee80211_ OLD_FILES+=usr/share/man/man9/ieee80211_wep_crypt.9.gz # 20090801: vimage.h removed in favour of vnet.h OLD_FILES+=usr/include/sys/vimage.h +# 20101208: libbsnmp was moved to usr/lib +OLD_LIBS+=lib/libbsnmp.so.5 # 20090719: library version bump for 8.0 OLD_LIBS+=lib/libalias.so.6 OLD_LIBS+=lib/libavl.so.1 Modified: projects/binutils-2.17/bin/sh/expand.c ============================================================================== --- projects/binutils-2.17/bin/sh/expand.c Fri Dec 17 19:48:54 2010 (r216506) +++ projects/binutils-2.17/bin/sh/expand.c Fri Dec 17 21:03:10 2010 (r216507) @@ -132,11 +132,22 @@ collate_range_cmp(int c1, int c2) void expandhere(union node *arg, int fd) { - herefd = fd; expandarg(arg, (struct arglist *)NULL, 0); xwrite(fd, stackblock(), expdest - stackblock()); } +static char * +stputs_quotes(const char *data, const char *syntax, char *p) +{ + while (*data) { + CHECKSTRSPACE(2, p); + if (syntax[(int)*data] == CCTL) + USTPUTC(CTLESC, p); + USTPUTC(*data++, p); + } + return (p); +} +#define STPUTS_QUOTES(data, syntax, p) p = stputs_quotes((data), syntax, p) /* * Perform expansions on an argument, placing the resulting list of arguments @@ -334,11 +345,10 @@ done: if (*home == '\0') goto lose; *p = c; - while ((c = *home++) != '\0') { - if (quotes && SQSYNTAX[(int)c] == CCTL) - STPUTC(CTLESC, expdest); - STPUTC(c, expdest); - } + if (quotes) + STPUTS_QUOTES(home, SQSYNTAX, expdest); + else + STPUTS(home, expdest); return (p); lose: *p = c; @@ -458,7 +468,6 @@ expbackq(union node *cmd, int quoted, in char lastc; int startloc = dest - stackblock(); char const *syntax = quoted? DQSYNTAX : BASESYNTAX; - int saveherefd; int quotes = flag & (EXP_FULL | EXP_CASE | EXP_REDIR); int nnl; @@ -466,15 +475,12 @@ expbackq(union node *cmd, int quoted, in saveifs = ifsfirst; savelastp = ifslastp; saveargbackq = argbackq; - saveherefd = herefd; - herefd = -1; p = grabstackstr(dest); evalbackcmd(cmd, &in); ungrabstackstr(p, dest); ifsfirst = saveifs; ifslastp = savelastp; argbackq = saveargbackq; - herefd = saveherefd; p = in.buf; lastc = '\0'; @@ -493,8 +499,6 @@ expbackq(union node *cmd, int quoted, in } lastc = *p++; if (lastc != '\0') { - if (quotes && syntax[(int)lastc] == CCTL) - STPUTC(CTLESC, dest); if (lastc == '\n') { nnl++; } else { @@ -502,6 +506,8 @@ expbackq(union node *cmd, int quoted, in nnl--; STPUTC('\n', dest); } + if (quotes && syntax[(int)lastc] == CCTL) + STPUTC(CTLESC, dest); STPUTC(lastc, dest); } } @@ -533,16 +539,13 @@ subevalvar(char *p, char *str, int strlo char *loc = NULL; char *q; int c = 0; - int saveherefd = herefd; struct nodelist *saveargbackq = argbackq; int amount; - herefd = -1; argstr(p, (subtype == VSTRIMLEFT || subtype == VSTRIMLEFTMAX || subtype == VSTRIMRIGHT || subtype == VSTRIMRIGHTMAX ? EXP_CASE : 0) | EXP_TILDE); STACKSTRNUL(expdest); - herefd = saveherefd; argbackq = saveargbackq; startp = stackblock() + startloc; if (str == NULL) @@ -723,12 +726,10 @@ again: /* jump here after setting a vari varlen++; } else { - while (*val) { - if (quotes && - syntax[(int)*val] == CCTL) - STPUTC(CTLESC, expdest); - STPUTC(*val++, expdest); - } + if (quotes) + STPUTS_QUOTES(val, syntax, expdest); + else + STPUTS(val, expdest); } } @@ -877,7 +878,14 @@ varisset(char *name, int nulok) return 1; } - +static void +strtodest(const char *p, int flag, int subtype, int quoted) +{ + if (flag & (EXP_FULL | EXP_CASE) && subtype != VSLENGTH) + STPUTS_QUOTES(p, quoted ? DQSYNTAX : BASESYNTAX, expdest); + else + STPUTS(p, expdest); +} /* * Add the value of a specialized variable to the stack string. @@ -891,21 +899,6 @@ varvalue(char *name, int quoted, int sub int i; char sep; char **ap; - char const *syntax; - -#define STRTODEST(p) \ - do {\ - if (flag & (EXP_FULL | EXP_CASE) && subtype != VSLENGTH) { \ - syntax = quoted? DQSYNTAX : BASESYNTAX; \ - while (*p) { \ - if (syntax[(int)*p] == CCTL) \ - STPUTC(CTLESC, expdest); \ - STPUTC(*p++, expdest); \ - } \ - } else \ - STPUTS(p, expdest); \ - } while (0) - switch (*name) { case '$': @@ -931,7 +924,7 @@ numvar: case '@': if (flag & EXP_FULL && quoted) { for (ap = shellparam.p ; (p = *ap++) != NULL ; ) { - STRTODEST(p); + strtodest(p, flag, subtype, quoted); if (*ap) STPUTC('\0', expdest); } @@ -944,21 +937,21 @@ numvar: else sep = ' '; for (ap = shellparam.p ; (p = *ap++) != NULL ; ) { - STRTODEST(p); + strtodest(p, flag, subtype, quoted); if (*ap && sep) STPUTC(sep, expdest); } break; case '0': p = arg0; - STRTODEST(p); + strtodest(p, flag, subtype, quoted); break; default: if (is_digit(*name)) { num = atoi(name); if (num > 0 && num <= shellparam.nparam) { p = shellparam.p[num - 1]; - STRTODEST(p); + strtodest(p, flag, subtype, quoted); } } break; Modified: projects/binutils-2.17/bin/sh/jobs.c ============================================================================== --- projects/binutils-2.17/bin/sh/jobs.c Fri Dec 17 19:48:54 2010 (r216506) +++ projects/binutils-2.17/bin/sh/jobs.c Fri Dec 17 21:03:10 2010 (r216507) @@ -153,10 +153,8 @@ out: out2fmt_flush("sh: can't access mflag = 0; return; } - if (initialpgrp == -1) - initialpgrp = getpgrp(); - else if (initialpgrp != getpgrp()) { - killpg(0, SIGTTIN); + if (initialpgrp != getpgrp()) { + kill(0, SIGTTIN); continue; } } while (0); @@ -222,7 +220,6 @@ fgcmd(int argc __unused, char **argv) int bgcmd(int argc, char **argv) { - char s[64]; struct job *jp; do { @@ -233,8 +230,7 @@ bgcmd(int argc, char **argv) continue; restartjob(jp); jp->foreground = 0; - fmtstr(s, 64, "[%td] ", jp - jobtab + 1); - out1str(s); + out1fmt("[%td] ", jp - jobtab + 1); printjobcmd(jp); } while (--argc > 1); return 0; @@ -251,7 +247,7 @@ restartjob(struct job *jp) return; setcurjob(jp); INTOFF; - killpg(jp->ps[0].pid, SIGCONT); + kill(-jp->ps[0].pid, SIGCONT); for (ps = jp->ps, i = jp->nprocs ; --i >= 0 ; ps++) { if (WIFSTOPPED(ps->status)) { ps->status = -1; @@ -951,9 +947,7 @@ waitforjob(struct job *jp, int *origstat if (! JOBS || jp->state == JOBDONE) freejob(jp); if (int_pending()) { - if (WIFSIGNALED(status) && WTERMSIG(status) == SIGINT) - kill(getpid(), SIGINT); - else + if (!WIFSIGNALED(status) || WTERMSIG(status) != SIGINT) CLEAR_PENDING_INT; } #if JOBS Modified: projects/binutils-2.17/bin/sh/memalloc.c ============================================================================== --- projects/binutils-2.17/bin/sh/memalloc.c Fri Dec 17 19:48:54 2010 (r216506) +++ projects/binutils-2.17/bin/sh/memalloc.c Fri Dec 17 21:03:10 2010 (r216507) @@ -128,7 +128,6 @@ static struct stackmark *markp; char *stacknxt; int stacknleft; int sstrnleft; -int herefd = -1; static void @@ -309,11 +308,6 @@ growstackstr(void) int len; len = stackblocksize(); - if (herefd >= 0 && len >= 1024) { - xwrite(herefd, stackblock(), len); - sstrnleft = len; - return stackblock(); - } return growstrstackblock(len); } Modified: projects/binutils-2.17/bin/sh/memalloc.h ============================================================================== --- projects/binutils-2.17/bin/sh/memalloc.h Fri Dec 17 19:48:54 2010 (r216506) +++ projects/binutils-2.17/bin/sh/memalloc.h Fri Dec 17 21:03:10 2010 (r216507) @@ -46,7 +46,6 @@ struct stackmark { extern char *stacknxt; extern int stacknleft; extern int sstrnleft; -extern int herefd; pointer ckmalloc(size_t); pointer ckrealloc(pointer, int); Modified: projects/binutils-2.17/bin/sh/output.c ============================================================================== --- projects/binutils-2.17/bin/sh/output.c Fri Dec 17 19:48:54 2010 (r216506) +++ projects/binutils-2.17/bin/sh/output.c Fri Dec 17 21:03:10 2010 (r216507) @@ -64,8 +64,7 @@ __FBSDID("$FreeBSD$"); #define OUTBUFSIZ BUFSIZ -#define BLOCK_OUT -2 /* output to a fixed block of memory */ -#define MEM_OUT -3 /* output to dynamically allocated memory */ +#define MEM_OUT -2 /* output to dynamically allocated memory */ #define OUTPUT_ERR 01 /* error occurred on output */ static int doformat_wr(void *, const char *, int); @@ -180,18 +179,12 @@ outbin(const void *data, size_t len, str outc(*p++, file); } -static char out_junk[16]; - void emptyoutbuf(struct output *dest) { int offset; - if (dest->fd == BLOCK_OUT) { - dest->nextc = out_junk; - dest->nleft = sizeof out_junk; - dest->flags |= OUTPUT_ERR; - } else if (dest->buf == NULL) { + if (dest->buf == NULL) { INTOFF; dest->buf = ckmalloc(dest->bufsize); dest->nextc = dest->buf; @@ -282,18 +275,12 @@ void fmtstr(char *outbuf, int length, const char *fmt, ...) { va_list ap; - struct output strout; - strout.nextc = outbuf; - strout.nleft = length; - strout.fd = BLOCK_OUT; - strout.flags = 0; + INTOFF; va_start(ap, fmt); - doformat(&strout, fmt, ap); + vsnprintf(outbuf, length, fmt, ap); va_end(ap); - outc('\0', &strout); - if (strout.flags & OUTPUT_ERR) - outbuf[length - 1] = '\0'; + INTON; } static int Modified: projects/binutils-2.17/bin/sh/parser.c ============================================================================== --- projects/binutils-2.17/bin/sh/parser.c Fri Dec 17 19:48:54 2010 (r216506) +++ projects/binutils-2.17/bin/sh/parser.c Fri Dec 17 21:03:10 2010 (r216507) @@ -887,8 +887,6 @@ xxreadtoken(void) startlinno = plinno; for (;;) { /* until token or start of word found */ c = pgetc_macro(); - if (c == ' ' || c == '\t') - continue; /* quick check for white space first */ switch (c) { case ' ': case '\t': continue; Modified: projects/binutils-2.17/contrib/bsnmp/lib/snmp.c ============================================================================== --- projects/binutils-2.17/contrib/bsnmp/lib/snmp.c Fri Dec 17 19:48:54 2010 (r216506) +++ projects/binutils-2.17/contrib/bsnmp/lib/snmp.c Fri Dec 17 21:03:10 2010 (r216507) @@ -640,7 +640,7 @@ snmp_pdu_decode_secmode(struct asn_buf * (pdu->flags & SNMP_MSG_AUTH_FLAG) == 0) return (SNMP_CODE_BADSECLEVEL); - if ((code = snmp_pdu_calc_digest(b, pdu, digest)) != + if ((code = snmp_pdu_calc_digest(pdu, digest)) != SNMP_CODE_OK) return (SNMP_CODE_FAILED); @@ -659,7 +659,7 @@ snmp_pdu_decode_secmode(struct asn_buf * (pdu->flags & SNMP_MSG_PRIV_FLAG) == 0) return (SNMP_CODE_BADSECLEVEL); - if ((code = snmp_pdu_decrypt(b, pdu)) != SNMP_CODE_OK) + if ((code = snmp_pdu_decrypt(pdu)) != SNMP_CODE_OK) return (SNMP_CODE_FAILED); return (code); @@ -869,7 +869,7 @@ snmp_fix_encoding(struct asn_buf *b, str if (pdu->security_model != SNMP_SECMODEL_USM) return (SNMP_CODE_FAILED); - if (snmp_pdu_encrypt(b, pdu) != SNMP_CODE_OK) + if (snmp_pdu_encrypt(pdu) != SNMP_CODE_OK) return (SNMP_CODE_FAILED); if (pdu->user.priv_proto != SNMP_PRIV_NOPRIV && @@ -884,7 +884,7 @@ snmp_fix_encoding(struct asn_buf *b, str pdu->digest_ptr -= moved; if (pdu->version == SNMP_V3) { - if ((code = snmp_pdu_calc_digest(b, pdu, pdu->msg_digest)) != + if ((code = snmp_pdu_calc_digest(pdu, pdu->msg_digest)) != SNMP_CODE_OK) return (SNMP_CODE_FAILED); Modified: projects/binutils-2.17/contrib/bsnmp/lib/snmpcrypto.c ============================================================================== --- projects/binutils-2.17/contrib/bsnmp/lib/snmpcrypto.c Fri Dec 17 19:48:54 2010 (r216506) +++ projects/binutils-2.17/contrib/bsnmp/lib/snmpcrypto.c Fri Dec 17 21:03:10 2010 (r216507) @@ -87,8 +87,7 @@ snmp_digest_init(const struct snmp_user } enum snmp_code -snmp_pdu_calc_digest(struct asn_buf *b, const struct snmp_pdu *pdu, - uint8_t *digest) +snmp_pdu_calc_digest(const struct snmp_pdu *pdu, uint8_t *digest) { uint8_t md[EVP_MAX_MD_SIZE], extkey[SNMP_EXTENDED_KEY_SIZ]; uint8_t key1[SNMP_EXTENDED_KEY_SIZ], key2[SNMP_EXTENDED_KEY_SIZ]; @@ -140,7 +139,7 @@ failed: static int32_t snmp_pdu_cipher_init(const struct snmp_pdu *pdu, int32_t len, - EVP_CIPHER_CTX *ctx, const EVP_CIPHER **ctype, uint8_t *piv) + const EVP_CIPHER **ctype, uint8_t *piv) { int i; uint32_t netint; @@ -172,14 +171,14 @@ snmp_pdu_cipher_init(const struct snmp_p } enum snmp_code -snmp_pdu_encrypt(struct asn_buf *b, const struct snmp_pdu *pdu) +snmp_pdu_encrypt(const struct snmp_pdu *pdu) { int32_t err, olen; uint8_t iv[SNMP_PRIV_AES_IV_SIZ]; const EVP_CIPHER *ctype; EVP_CIPHER_CTX ctx; - err = snmp_pdu_cipher_init(pdu, pdu->scoped_len, &ctx, &ctype, iv); + err = snmp_pdu_cipher_init(pdu, pdu->scoped_len, &ctype, iv); if (err < 0) return (SNMP_CODE_EDECRYPT); else if (err == 0) @@ -200,14 +199,14 @@ snmp_pdu_encrypt(struct asn_buf *b, cons } enum snmp_code -snmp_pdu_decrypt(struct asn_buf *b, const struct snmp_pdu *pdu) +snmp_pdu_decrypt(const struct snmp_pdu *pdu) { int32_t err, olen; uint8_t iv[SNMP_PRIV_AES_IV_SIZ]; const EVP_CIPHER *ctype; EVP_CIPHER_CTX ctx; - err = snmp_pdu_cipher_init(pdu, pdu->scoped_len, &ctx, &ctype, iv); + err = snmp_pdu_cipher_init(pdu, pdu->scoped_len, &ctype, iv); if (err < 0) return (SNMP_CODE_EDECRYPT); else if (err == 0) @@ -310,8 +309,8 @@ snmp_get_local_keys(struct snmp_user *us enum snmp_code snmp_calc_keychange(struct snmp_user *user, uint8_t *keychange) { - int32_t i, err, rvalue[SNMP_AUTH_HMACSHA_KEY_SIZ / 4]; - uint32_t keylen, olen; + int32_t err, rvalue[SNMP_AUTH_HMACSHA_KEY_SIZ / 4]; + uint32_t i, keylen, olen; const EVP_MD *dtype; EVP_MD_CTX ctx; @@ -340,8 +339,7 @@ snmp_calc_keychange(struct snmp_user *us #else /* !HAVE_LIBCRYPTO */ enum snmp_code -snmp_pdu_calc_digest(struct asn_buf *b __unused, const struct snmp_pdu *pdu, - uint8_t *digest __unused) +snmp_pdu_calc_digest(const struct snmp_pdu *pdu, uint8_t *digest __unused) { if (pdu->user.auth_proto != SNMP_AUTH_NOAUTH) return (SNMP_CODE_BADSECLEVEL); @@ -351,7 +349,7 @@ snmp_pdu_calc_digest(struct asn_buf *b _ } enum snmp_code -snmp_pdu_encrypt(struct asn_buf *b __unused, const struct snmp_pdu *pdu) +snmp_pdu_encrypt(const struct snmp_pdu *pdu) { if (pdu->user.priv_proto != SNMP_PRIV_NOPRIV) return (SNMP_CODE_BADSECLEVEL); @@ -360,7 +358,7 @@ snmp_pdu_encrypt(struct asn_buf *b __unu } enum snmp_code -snmp_pdu_decrypt(struct asn_buf *b __unused, const struct snmp_pdu *pdu) +snmp_pdu_decrypt(const struct snmp_pdu *pdu) { if (pdu->user.priv_proto != SNMP_PRIV_NOPRIV) return (SNMP_CODE_BADSECLEVEL); Modified: projects/binutils-2.17/contrib/bsnmp/lib/snmppriv.h ============================================================================== --- projects/binutils-2.17/contrib/bsnmp/lib/snmppriv.h Fri Dec 17 19:48:54 2010 (r216506) +++ projects/binutils-2.17/contrib/bsnmp/lib/snmppriv.h Fri Dec 17 21:03:10 2010 (r216507) @@ -41,10 +41,9 @@ enum asn_err snmp_parse_pdus_hdr(struct void snmp_pdu_init_secparams(struct snmp_pdu *, struct snmp_engine *, struct snmp_user *); -enum snmp_code snmp_pdu_calc_digest(struct asn_buf *, const struct snmp_pdu *, - uint8_t *); -enum snmp_code snmp_pdu_encrypt(struct asn_buf *, const struct snmp_pdu *); -enum snmp_code snmp_pdu_decrypt(struct asn_buf *, const struct snmp_pdu *); +enum snmp_code snmp_pdu_calc_digest(const struct snmp_pdu *, uint8_t *); +enum snmp_code snmp_pdu_encrypt(const struct snmp_pdu *); +enum snmp_code snmp_pdu_decrypt(const struct snmp_pdu *); #define DEFAULT_HOST "localhost" #define DEFAULT_PORT "snmp" Modified: projects/binutils-2.17/etc/rc.d/pf ============================================================================== --- projects/binutils-2.17/etc/rc.d/pf Fri Dec 17 19:48:54 2010 (r216506) +++ projects/binutils-2.17/etc/rc.d/pf Fri Dec 17 21:03:10 2010 (r216507) @@ -29,7 +29,7 @@ pf_start() $pf_program -F all > /dev/null 2>&1 $pf_program -f "$pf_rules" $pf_flags if ! $pf_program -s info | grep -q "Enabled" ; then - $pf_program -e + $pf_program -eq fi check_startmsgs && echo '.' } @@ -38,7 +38,7 @@ pf_stop() { if $pf_program -s info | grep -q "Enabled" ; then echo -n 'Disabling pf' - $pf_program -d + $pf_program -dq echo '.' fi } Modified: projects/binutils-2.17/lib/csu/ia64/Makefile ============================================================================== --- projects/binutils-2.17/lib/csu/ia64/Makefile Fri Dec 17 19:48:54 2010 (r216506) +++ projects/binutils-2.17/lib/csu/ia64/Makefile Fri Dec 17 21:03:10 2010 (r216507) @@ -2,21 +2,42 @@ .PATH: ${.CURDIR}/../common -SRCS= crt1.S crti.S crtn.S +SRCS= crti.S crtn.S OBJS= ${SRCS:N*.h:R:S/$/.o/g} -OBJS+= Scrt1.o gcrt1.o -CFLAGS+= -I${.CURDIR}/../common \ - -I${.CURDIR}/../../libc/include +OBJS+= crt1.o gcrt1.o Scrt1.o all: ${OBJS} CLEANFILES= ${OBJS} +CLEANFILES+= crt1_.o gcrt1_.o Scrt1_.o +CLEANFILES+= crtbrand.o gcrtbrand.o Scrtbrand.o -gcrt1.o: crt1.S - ${CC} ${CFLAGS} -DGCRT -c -o gcrt1.o ${.ALLSRC} +crt1_.o: crt1.S + ${CC} ${CFLAGS} -c -o ${.TARGET} ${.ALLSRC} -Scrt1.o: crt1.S - ${CC} ${CFLAGS} -fPIC -DPIC -c -o Scrt1.o ${.ALLSRC} +crtbrand.o: crtbrand.c + ${CC} ${CFLAGS} -c -o ${.TARGET} ${.ALLSRC} + +crt1.o: crt1_.o crtbrand.o + ${LD} ${LDFLAGS} -r -o ${.TARGET} crt1_.o crtbrand.o + +gcrt1_.o: crt1.S + ${CC} ${CFLAGS} -DGCRT -c -o ${.TARGET} ${.ALLSRC} + +gcrtbrand.o: crtbrand.c + ${CC} ${CFLAGS} -DGCRT -c -o ${.TARGET} ${.ALLSRC} + +gcrt1.o: gcrt1_.o gcrtbrand.o + ${LD} ${LDFLAGS} -r -o ${.TARGET} ${.ALLSRC} + +Scrt1_.o: crt1.S + ${CC} ${CFLAGS} -fPIC -DPIC -c -o ${.TARGET} ${.ALLSRC} + +Scrtbrand.o: crtbrand.c + ${CC} ${CFLAGS} -fPIC -DPIC -c -o ${.TARGET} ${.ALLSRC} + +Scrt1.o: Scrt1_.o Scrtbrand.o + ${LD} ${LDFLAGS} -r -o ${.TARGET} ${.ALLSRC} realinstall: ${INSTALL} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ Modified: projects/binutils-2.17/lib/libc/posix1e/acl_is_trivial_np.3 ============================================================================== --- projects/binutils-2.17/lib/libc/posix1e/acl_is_trivial_np.3 Fri Dec 17 19:48:54 2010 (r216506) +++ projects/binutils-2.17/lib/libc/posix1e/acl_is_trivial_np.3 Fri Dec 17 21:03:10 2010 (r216507) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 25, 2009 +.Dd December 13, 2010 .Dt ACL_STRIP_NP 3 .Os .Sh NAME @@ -56,7 +56,9 @@ ACL is trivial if it can be fully expres any access rules. For POSIX.1e ACLs, ACL is trivial if it has the three required entries, one for owner, one for owning group, and one for other. -For NFSv4 ACLs, ACL is trivial if it has the "canonical six" entries. +For NFSv4 ACLs, ACL is trivial if is identical to the ACL generated by +.Fn acl_strip_np 3 +from the file mode. Files that have non-trivial ACL have a plus sign appended after mode bits in "ls -l" output. .Sh RETURN VALUES Modified: projects/binutils-2.17/lib/libc/powerpc64/sys/cerror.S ============================================================================== --- projects/binutils-2.17/lib/libc/powerpc64/sys/cerror.S Fri Dec 17 19:48:54 2010 (r216506) +++ projects/binutils-2.17/lib/libc/powerpc64/sys/cerror.S Fri Dec 17 21:03:10 2010 (r216507) @@ -41,7 +41,7 @@ __FBSDID("$FreeBSD$"); ENTRY(HIDENAME(cerror)) mflr %r0 std %r0,16(%r1) /* save lr */ - stdu %r1,-56(%r1) /* allocate new stack frame */ + stdu %r1,-64(%r1) /* allocate new stack frame */ std %r31,48(%r1) mr %r31,%r3 /* stash errval in callee-saved register */ Modified: projects/binutils-2.17/lib/libc/powerpc64/sys/ptrace.S ============================================================================== --- projects/binutils-2.17/lib/libc/powerpc64/sys/ptrace.S Fri Dec 17 19:48:54 2010 (r216506) +++ projects/binutils-2.17/lib/libc/powerpc64/sys/ptrace.S Fri Dec 17 21:03:10 2010 (r216507) @@ -32,8 +32,8 @@ __FBSDID("$FreeBSD$"); ENTRY(ptrace) mflr %r0 - stdu %r1,-68(%r1) - std %r0,84(%r1) + std %r0,16(%r1) + stdu %r1,-80(%r1) stw %r3,48(%r1) stw %r4,52(%r1) std %r5,56(%r1) @@ -47,10 +47,10 @@ ENTRY(ptrace) lwz %r3,48(%r1) lwz %r4,52(%r1) ld %r5,56(%r1) - ld %r0,84(%r1) lwz %r6,64(%r1) - mtlr %r0 ld %r1,0(%r1) + ld %r0,16(%r1) + mtlr %r0 li %r0,SYS_ptrace sc bso 1f Modified: projects/binutils-2.17/lib/libipsec/ipsec_dump_policy.c ============================================================================== --- projects/binutils-2.17/lib/libipsec/ipsec_dump_policy.c Fri Dec 17 19:48:54 2010 (r216506) +++ projects/binutils-2.17/lib/libipsec/ipsec_dump_policy.c Fri Dec 17 21:03:10 2010 (r216507) @@ -162,7 +162,8 @@ ipsec_dump_policy(policy, delimiter) return NULL; } buf = newbuf; - snprintf(buf, buflen, "%s%s%s", buf, delimiter, isrbuf); + snprintf(buf + strlen(buf), buflen - strlen(buf), + "%s%s", delimiter, isrbuf); off += xisr->sadb_x_ipsecrequest_len; } Modified: projects/binutils-2.17/lib/libproc/proc_create.c ============================================================================== --- projects/binutils-2.17/lib/libproc/proc_create.c Fri Dec 17 19:48:54 2010 (r216506) +++ projects/binutils-2.17/lib/libproc/proc_create.c Fri Dec 17 21:03:10 2010 (r216507) @@ -84,7 +84,7 @@ proc_attach(pid_t pid, int flags, struct else *pphdl = phdl; out: - + proc_free(phdl); return (error); } Modified: projects/binutils-2.17/lib/libusb/libusb20_compat01.c ============================================================================== --- projects/binutils-2.17/lib/libusb/libusb20_compat01.c Fri Dec 17 19:48:54 2010 (r216506) +++ projects/binutils-2.17/lib/libusb/libusb20_compat01.c Fri Dec 17 21:03:10 2010 (r216507) @@ -457,6 +457,11 @@ usb_parse_configuration(struct usb_confi /* allocate memory for our configuration */ ptr = malloc(a + b + c + d); + if (ptr == NULL) { + /* free config structure */ + free(ps.a.currcfg); + return (-1); + } /* "currifcw" must be first, hence this pointer is freed */ ps.b.currifcw = (void *)(ptr); Modified: projects/binutils-2.17/libexec/rtld-elf/rtld.c ============================================================================== --- projects/binutils-2.17/libexec/rtld-elf/rtld.c Fri Dec 17 19:48:54 2010 (r216506) +++ projects/binutils-2.17/libexec/rtld-elf/rtld.c Fri Dec 17 21:03:10 2010 (r216507) @@ -110,7 +110,7 @@ static int load_needed_objects(Obj_Entry static int load_preload_objects(void); static Obj_Entry *load_object(const char *, const Obj_Entry *, int); static Obj_Entry *obj_from_addr(const void *); -static void objlist_call_fini(Objlist *, bool, int *); +static void objlist_call_fini(Objlist *, Obj_Entry *, int *); static void objlist_call_init(Objlist *, int *); static void objlist_clear(Objlist *); static Objlist_Entry *objlist_find(Objlist *, const Obj_Entry *); @@ -1609,36 +1609,56 @@ obj_from_addr(const void *addr) /* * Call the finalization functions for each of the objects in "list" - * which are unreferenced. All of the objects are expected to have - * non-NULL fini functions. + * belonging to the DAG of "root" and referenced once. If NULL "root" + * is specified, every finalization function will be called regardless + * of the reference count and the list elements won't be freed. All of + * the objects are expected to have non-NULL fini functions. */ static void -objlist_call_fini(Objlist *list, bool force, int *lockstate) +objlist_call_fini(Objlist *list, Obj_Entry *root, int *lockstate) { - Objlist_Entry *elm, *elm_tmp; + Objlist_Entry *elm; char *saved_msg; + assert(root == NULL || root->refcount == 1); + /* * Preserve the current error message since a fini function might * call into the dynamic linker and overwrite it. */ saved_msg = errmsg_save(); - STAILQ_FOREACH_SAFE(elm, list, link, elm_tmp) { - if (elm->obj->refcount == 0 || force) { + do { + STAILQ_FOREACH(elm, list, link) { + if (root != NULL && (elm->obj->refcount != 1 || + objlist_find(&root->dagmembers, elm->obj) == NULL)) + continue; dbg("calling fini function for %s at %p", elm->obj->path, (void *)elm->obj->fini); LD_UTRACE(UTRACE_FINI_CALL, elm->obj, (void *)elm->obj->fini, 0, 0, elm->obj->path); /* Remove object from fini list to prevent recursive invocation. */ STAILQ_REMOVE(list, elm, Struct_Objlist_Entry, link); + /* + * XXX: If a dlopen() call references an object while the + * fini function is in progress, we might end up trying to + * unload the referenced object in dlclose() or the object + * won't be unloaded although its fini function has been + * called. + */ wlock_release(rtld_bind_lock, *lockstate); call_initfini_pointer(elm->obj, elm->obj->fini); *lockstate = wlock_acquire(rtld_bind_lock); /* No need to free anything if process is going down. */ - if (!force) + if (root != NULL) free(elm); + /* + * We must restart the list traversal after every fini call + * because a dlclose() call from the fini function or from + * another thread might have modified the reference counts. + */ + break; } - } + } while (elm != NULL); errmsg_restore(saved_msg); } @@ -1826,7 +1846,7 @@ rtld_exit(void) lockstate = wlock_acquire(rtld_bind_lock); dbg("rtld_exit()"); - objlist_call_fini(&list_fini, true, &lockstate); + objlist_call_fini(&list_fini, NULL, &lockstate); /* No need to remove the items from the list, since we are exiting. */ if (!libmap_disable) lm_fini(); @@ -1939,20 +1959,22 @@ dlclose(void *handle) /* Unreference the object and its dependencies. */ root->dl_refcount--; - unref_dag(root); - - if (root->refcount == 0) { + if (root->refcount == 1) { /* - * The object is no longer referenced, so we must unload it. + * The object will be no longer referenced, so we must unload it. * First, call the fini functions. */ - objlist_call_fini(&list_fini, false, &lockstate); + objlist_call_fini(&list_fini, root, &lockstate); + + unref_dag(root); /* Finish cleaning up the newly-unreferenced objects. */ GDB_STATE(RT_DELETE,&root->linkmap); unload_object(root); GDB_STATE(RT_CONSISTENT,NULL); - } + } else + unref_dag(root); + LD_UTRACE(UTRACE_DLCLOSE_STOP, handle, NULL, 0, 0, NULL); wlock_release(rtld_bind_lock, lockstate); return 0; Modified: projects/binutils-2.17/release/powerpc/mkisoimages.sh ============================================================================== --- projects/binutils-2.17/release/powerpc/mkisoimages.sh Fri Dec 17 19:48:54 2010 (r216506) +++ projects/binutils-2.17/release/powerpc/mkisoimages.sh Fri Dec 17 21:03:10 2010 (r216507) @@ -25,7 +25,7 @@ if [ "x$1" = "x-b" ]; then cp /usr/src/release/powerpc/boot.tbxi ${4}/boot - bootable="-hfs-bless ${4}/boot -map /usr/src/release/powerpc/hfs.map" + bootable="-hfs -hfs-bless ${4}/boot -map /usr/src/release/powerpc/hfs.map -hide-hfs ${4}/usr/share/man" shift else bootable="" @@ -54,4 +54,4 @@ fi LABEL=$1; shift NAME=$1; shift -mkisofs $bootable -r -hfs -part -no-desktop -hfs-volid $LABEL -l -J -allow-leading-dots -o $NAME $* +mkisofs $bootable -l -r -part -no-desktop -V $LABEL -o $NAME $* Modified: projects/binutils-2.17/sbin/camcontrol/camcontrol.c ============================================================================== --- projects/binutils-2.17/sbin/camcontrol/camcontrol.c Fri Dec 17 19:48:54 2010 (r216506) +++ projects/binutils-2.17/sbin/camcontrol/camcontrol.c Fri Dec 17 21:03:10 2010 (r216507) @@ -5026,14 +5026,7 @@ getdevid(struct cam_devitem *item) goto bailout; } - item->device_id_len = CAM_SCSI_DEVID_MAXLEN; - item->device_id = malloc(item->device_id_len); - if (item->device_id == NULL) { - warn("%s: unable to allocate %d bytes", __func__, - item->device_id_len); - retval = 1; - goto bailout; - } + item->device_id_len = 0; ccb = cam_getccb(dev); if (ccb == NULL) { @@ -5044,12 +5037,19 @@ getdevid(struct cam_devitem *item) bzero(&(&ccb->ccb_h)[1], sizeof(union ccb) - sizeof(struct ccb_hdr)); + + /* + * On the first try, we just probe for the size of the data, and + * then allocate that much memory and try again. + */ +retry: ccb->ccb_h.func_code = XPT_GDEV_ADVINFO; ccb->ccb_h.flags = CAM_DIR_IN; ccb->cgdai.flags = CGDAI_FLAG_PROTO; ccb->cgdai.buftype = CGDAI_TYPE_SCSI_DEVID; ccb->cgdai.bufsiz = item->device_id_len; - ccb->cgdai.buf = (uint8_t *)item->device_id; + if (item->device_id_len != 0) + ccb->cgdai.buf = (uint8_t *)item->device_id; if (cam_send_ccb(dev, ccb) < 0) { warn("%s: error sending XPT_GDEV_ADVINFO CCB", __func__); @@ -5063,6 +5063,29 @@ getdevid(struct cam_devitem *item) goto bailout; } + if (item->device_id_len == 0) { + /* + * This is our first time through. Allocate the buffer, + * and then go back to get the data. + */ + if (ccb->cgdai.provsiz == 0) { + warnx("%s: invalid .provsiz field returned with " + "XPT_GDEV_ADVINFO CCB", __func__); + retval = 1; + goto bailout; + } + item->device_id_len = ccb->cgdai.provsiz; + item->device_id = malloc(item->device_id_len); + if (item->device_id == NULL) { + warn("%s: unable to allocate %d bytes", __func__, + item->device_id_len); + retval = 1; + goto bailout; + } + ccb->ccb_h.status = CAM_REQ_INPROG; + goto retry; + } + bailout: if (dev != NULL) cam_close_device(dev); @@ -5158,9 +5181,8 @@ buildbusdevlist(struct cam_devlist *devl dev_result = &ccb.cdm.matches[i].result.device_result; - if ((dev_result->flags - & DEV_RESULT_UNCONFIGURED) - && ((arglist & CAM_ARG_VERBOSE) == 0)) { + if (dev_result->flags & + DEV_RESULT_UNCONFIGURED) { skip_device = 1; break; } else Modified: projects/binutils-2.17/sbin/geom/Makefile.inc ============================================================================== --- projects/binutils-2.17/sbin/geom/Makefile.inc Fri Dec 17 19:48:54 2010 (r216506) +++ projects/binutils-2.17/sbin/geom/Makefile.inc Fri Dec 17 21:03:10 2010 (r216507) @@ -1,5 +1,5 @@ # $FreeBSD$ -CLASS_DIR?=/lib/geom +GEOM_CLASS_DIR?=/lib/geom .include "../Makefile.inc" Modified: projects/binutils-2.17/sbin/geom/class/Makefile.inc ============================================================================== --- projects/binutils-2.17/sbin/geom/class/Makefile.inc Fri Dec 17 19:48:54 2010 (r216506) +++ projects/binutils-2.17/sbin/geom/class/Makefile.inc Fri Dec 17 21:03:10 2010 (r216507) @@ -1,10 +1,10 @@ # $FreeBSD$ -SHLIBDIR?=${CLASS_DIR} -SHLIB_NAME?=geom_${CLASS}.so -LINKS= ${BINDIR}/geom ${BINDIR}/g${CLASS} -MAN= g${CLASS}.8 -SRCS+= geom_${CLASS}.c subr.c +SHLIBDIR?=${GEOM_CLASS_DIR} +SHLIB_NAME?=geom_${GEOM_CLASS}.so +LINKS= ${BINDIR}/geom ${BINDIR}/g${GEOM_CLASS} +MAN= g${GEOM_CLASS}.8 +SRCS+= geom_${GEOM_CLASS}.c subr.c CFLAGS+= -I${.CURDIR}/../.. Modified: projects/binutils-2.17/sbin/geom/class/cache/Makefile ============================================================================== --- projects/binutils-2.17/sbin/geom/class/cache/Makefile Fri Dec 17 19:48:54 2010 (r216506) +++ projects/binutils-2.17/sbin/geom/class/cache/Makefile Fri Dec 17 21:03:10 2010 (r216507) @@ -2,6 +2,6 @@ .PATH: ${.CURDIR}/../../misc -CLASS= cache +GEOM_CLASS= cache .include Modified: projects/binutils-2.17/sbin/geom/class/concat/Makefile ============================================================================== --- projects/binutils-2.17/sbin/geom/class/concat/Makefile Fri Dec 17 19:48:54 2010 (r216506) +++ projects/binutils-2.17/sbin/geom/class/concat/Makefile Fri Dec 17 21:03:10 2010 (r216507) @@ -2,6 +2,6 @@ .PATH: ${.CURDIR}/../../misc -CLASS= concat +GEOM_CLASS= concat .include Modified: projects/binutils-2.17/sbin/geom/class/eli/Makefile ============================================================================== --- projects/binutils-2.17/sbin/geom/class/eli/Makefile Fri Dec 17 19:48:54 2010 (r216506) +++ projects/binutils-2.17/sbin/geom/class/eli/Makefile Fri Dec 17 21:03:10 2010 (r216507) @@ -2,7 +2,7 @@ .PATH: ${.CURDIR}/../../misc ${.CURDIR}/../../../../sys/geom/eli ${.CURDIR}/../../../../sys/crypto/sha2 -CLASS= eli +GEOM_CLASS= eli SRCS= g_eli_crypto.c SRCS+= g_eli_key.c SRCS+= pkcs5v2.c Modified: projects/binutils-2.17/sbin/geom/class/journal/Makefile ============================================================================== --- projects/binutils-2.17/sbin/geom/class/journal/Makefile Fri Dec 17 19:48:54 2010 (r216506) +++ projects/binutils-2.17/sbin/geom/class/journal/Makefile Fri Dec 17 21:03:10 2010 (r216507) @@ -1,8 +1,8 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../../misc +.PATH: ${.CURDIR}/../../misc -CLASS= journal +GEOM_CLASS= journal SRCS+= geom_journal_ufs.c DPADD= ${LIBMD} ${LIBUFS} Modified: projects/binutils-2.17/sbin/geom/class/label/Makefile ============================================================================== --- projects/binutils-2.17/sbin/geom/class/label/Makefile Fri Dec 17 19:48:54 2010 (r216506) +++ projects/binutils-2.17/sbin/geom/class/label/Makefile Fri Dec 17 21:03:10 2010 (r216507) @@ -2,6 +2,6 @@ .PATH: ${.CURDIR}/../../misc -CLASS= label +GEOM_CLASS= label .include Modified: projects/binutils-2.17/sbin/geom/class/mirror/Makefile ============================================================================== --- projects/binutils-2.17/sbin/geom/class/mirror/Makefile Fri Dec 17 19:48:54 2010 (r216506) +++ projects/binutils-2.17/sbin/geom/class/mirror/Makefile Fri Dec 17 21:03:10 2010 (r216507) @@ -1,8 +1,8 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../../misc +.PATH: ${.CURDIR}/../../misc -CLASS= mirror +GEOM_CLASS= mirror DPADD= ${LIBMD} LDADD= -lmd Modified: projects/binutils-2.17/sbin/geom/class/mountver/Makefile ============================================================================== --- projects/binutils-2.17/sbin/geom/class/mountver/Makefile Fri Dec 17 19:48:54 2010 (r216506) +++ projects/binutils-2.17/sbin/geom/class/mountver/Makefile Fri Dec 17 21:03:10 2010 (r216507) @@ -2,6 +2,6 @@ .PATH: ${.CURDIR}/../../misc -CLASS= mountver +GEOM_CLASS= mountver .include Modified: projects/binutils-2.17/sbin/geom/class/multipath/Makefile ============================================================================== --- projects/binutils-2.17/sbin/geom/class/multipath/Makefile Fri Dec 17 19:48:54 2010 (r216506) +++ projects/binutils-2.17/sbin/geom/class/multipath/Makefile Fri Dec 17 21:03:10 2010 (r216507) @@ -1,8 +1,9 @@ # $FreeBSD$ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-projects@FreeBSD.ORG Sat Dec 18 06:51:49 2010 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 34DAA106564A; Sat, 18 Dec 2010 06:51:49 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1F3CC8FC19; Sat, 18 Dec 2010 06:51:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBI6pnIx059435; Sat, 18 Dec 2010 06:51:49 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBI6pmb5059424; Sat, 18 Dec 2010 06:51:48 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201012180651.oBI6pmb5059424@svn.freebsd.org> From: Alexander Motin Date: Sat, 18 Dec 2010 06:51:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216514 - in projects/graid/7: etc/mtree include lib/libcam sbin/atacontrol sbin/camcontrol share/man/man4 sys/cam sys/cam/ata sys/cam/scsi sys/conf sys/dev/ahci sys/dev/asr sys/dev/ata... X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Dec 2010 06:51:49 -0000 Author: mav Date: Sat Dec 18 06:51:48 2010 New Revision: 216514 URL: http://svn.freebsd.org/changeset/base/216514 Log: Sync CAM, ata(4), ahci(4), siis(4) and mvs(4) with HEAD around 2010-10. This should give people still using 7.x branch possibility to use new more reliable and functional CAM-based ATA instead of legacy ata(4). Some SCSI/RAID drivers were also updated to reflect CAM changes in bus scanning and support of the different transports/protocols, but not all of them. Due to many API/ABI changes this unlikely to be committed to 7-STABLE. Sponsored by: Cisco Added: projects/graid/7/share/man/man4/ada.4 (contents, props changed) projects/graid/7/share/man/man4/ahci.4 (contents, props changed) projects/graid/7/share/man/man4/mvs.4 (contents, props changed) projects/graid/7/share/man/man4/siis.4 (contents, props changed) projects/graid/7/sys/cam/ata/ projects/graid/7/sys/cam/ata/ata_all.c (contents, props changed) projects/graid/7/sys/cam/ata/ata_all.h (contents, props changed) projects/graid/7/sys/cam/ata/ata_da.c (contents, props changed) projects/graid/7/sys/cam/ata/ata_pmp.c (contents, props changed) projects/graid/7/sys/cam/ata/ata_xpt.c (contents, props changed) projects/graid/7/sys/cam/cam_xpt_internal.h (contents, props changed) projects/graid/7/sys/cam/scsi/scsi_xpt.c (contents, props changed) projects/graid/7/sys/dev/ahci/ projects/graid/7/sys/dev/ahci/ahci.c (contents, props changed) projects/graid/7/sys/dev/ahci/ahci.h (contents, props changed) projects/graid/7/sys/dev/ata/ata-sata.c (contents, props changed) projects/graid/7/sys/dev/ata/chipsets/ projects/graid/7/sys/dev/ata/chipsets/ata-acard.c (contents, props changed) projects/graid/7/sys/dev/ata/chipsets/ata-acerlabs.c (contents, props changed) projects/graid/7/sys/dev/ata/chipsets/ata-adaptec.c (contents, props changed) projects/graid/7/sys/dev/ata/chipsets/ata-ahci.c (contents, props changed) projects/graid/7/sys/dev/ata/chipsets/ata-amd.c (contents, props changed) projects/graid/7/sys/dev/ata/chipsets/ata-ati.c (contents, props changed) projects/graid/7/sys/dev/ata/chipsets/ata-cenatek.c (contents, props changed) projects/graid/7/sys/dev/ata/chipsets/ata-cypress.c (contents, props changed) projects/graid/7/sys/dev/ata/chipsets/ata-cyrix.c (contents, props changed) projects/graid/7/sys/dev/ata/chipsets/ata-highpoint.c (contents, props changed) projects/graid/7/sys/dev/ata/chipsets/ata-intel.c (contents, props changed) projects/graid/7/sys/dev/ata/chipsets/ata-ite.c (contents, props changed) projects/graid/7/sys/dev/ata/chipsets/ata-jmicron.c (contents, props changed) projects/graid/7/sys/dev/ata/chipsets/ata-marvell.c (contents, props changed) projects/graid/7/sys/dev/ata/chipsets/ata-micron.c (contents, props changed) projects/graid/7/sys/dev/ata/chipsets/ata-national.c (contents, props changed) projects/graid/7/sys/dev/ata/chipsets/ata-netcell.c (contents, props changed) projects/graid/7/sys/dev/ata/chipsets/ata-nvidia.c (contents, props changed) projects/graid/7/sys/dev/ata/chipsets/ata-promise.c (contents, props changed) projects/graid/7/sys/dev/ata/chipsets/ata-serverworks.c (contents, props changed) projects/graid/7/sys/dev/ata/chipsets/ata-siliconimage.c (contents, props changed) projects/graid/7/sys/dev/ata/chipsets/ata-sis.c (contents, props changed) projects/graid/7/sys/dev/ata/chipsets/ata-via.c (contents, props changed) projects/graid/7/sys/dev/mvs/ projects/graid/7/sys/dev/mvs/mvs.c (contents, props changed) projects/graid/7/sys/dev/mvs/mvs.h (contents, props changed) projects/graid/7/sys/dev/mvs/mvs_if.m (contents, props changed) projects/graid/7/sys/dev/mvs/mvs_pci.c (contents, props changed) projects/graid/7/sys/dev/mvs/mvs_soc.c (contents, props changed) projects/graid/7/sys/dev/siis/ projects/graid/7/sys/dev/siis/siis.c (contents, props changed) projects/graid/7/sys/dev/siis/siis.h (contents, props changed) projects/graid/7/sys/modules/ahci/ projects/graid/7/sys/modules/ahci/Makefile (contents, props changed) projects/graid/7/sys/modules/ata/atacore/ projects/graid/7/sys/modules/ata/atacore/Makefile (contents, props changed) projects/graid/7/sys/modules/ata/atadevel/ projects/graid/7/sys/modules/ata/atadevel/Makefile (contents, props changed) projects/graid/7/sys/modules/ata/atadevel/ata-devel.c (contents, props changed) projects/graid/7/sys/modules/ata/atapci/Makefile.inc (contents, props changed) projects/graid/7/sys/modules/ata/atapci/chipsets/ projects/graid/7/sys/modules/ata/atapci/chipsets/Makefile (contents, props changed) projects/graid/7/sys/modules/ata/atapci/chipsets/Makefile.inc (contents, props changed) projects/graid/7/sys/modules/ata/atapci/chipsets/ataacard/ projects/graid/7/sys/modules/ata/atapci/chipsets/ataacard/Makefile (contents, props changed) projects/graid/7/sys/modules/ata/atapci/chipsets/ataacerlabs/ projects/graid/7/sys/modules/ata/atapci/chipsets/ataacerlabs/Makefile (contents, props changed) projects/graid/7/sys/modules/ata/atapci/chipsets/ataadaptec/ projects/graid/7/sys/modules/ata/atapci/chipsets/ataadaptec/Makefile (contents, props changed) projects/graid/7/sys/modules/ata/atapci/chipsets/ataahci/ projects/graid/7/sys/modules/ata/atapci/chipsets/ataahci/Makefile (contents, props changed) projects/graid/7/sys/modules/ata/atapci/chipsets/ataamd/ projects/graid/7/sys/modules/ata/atapci/chipsets/ataamd/Makefile (contents, props changed) projects/graid/7/sys/modules/ata/atapci/chipsets/ataati/ projects/graid/7/sys/modules/ata/atapci/chipsets/ataati/Makefile (contents, props changed) projects/graid/7/sys/modules/ata/atapci/chipsets/atacenatek/ projects/graid/7/sys/modules/ata/atapci/chipsets/atacenatek/Makefile (contents, props changed) projects/graid/7/sys/modules/ata/atapci/chipsets/atacypress/ projects/graid/7/sys/modules/ata/atapci/chipsets/atacypress/Makefile (contents, props changed) projects/graid/7/sys/modules/ata/atapci/chipsets/atacyrix/ projects/graid/7/sys/modules/ata/atapci/chipsets/atacyrix/Makefile (contents, props changed) projects/graid/7/sys/modules/ata/atapci/chipsets/atahighpoint/ projects/graid/7/sys/modules/ata/atapci/chipsets/atahighpoint/Makefile (contents, props changed) projects/graid/7/sys/modules/ata/atapci/chipsets/ataintel/ projects/graid/7/sys/modules/ata/atapci/chipsets/ataintel/Makefile (contents, props changed) projects/graid/7/sys/modules/ata/atapci/chipsets/ataite/ projects/graid/7/sys/modules/ata/atapci/chipsets/ataite/Makefile (contents, props changed) projects/graid/7/sys/modules/ata/atapci/chipsets/atajmicron/ projects/graid/7/sys/modules/ata/atapci/chipsets/atajmicron/Makefile (contents, props changed) projects/graid/7/sys/modules/ata/atapci/chipsets/atamarvell/ projects/graid/7/sys/modules/ata/atapci/chipsets/atamarvell/Makefile (contents, props changed) projects/graid/7/sys/modules/ata/atapci/chipsets/atamicron/ projects/graid/7/sys/modules/ata/atapci/chipsets/atamicron/Makefile (contents, props changed) projects/graid/7/sys/modules/ata/atapci/chipsets/atanational/ projects/graid/7/sys/modules/ata/atapci/chipsets/atanational/Makefile (contents, props changed) projects/graid/7/sys/modules/ata/atapci/chipsets/atanetcell/ projects/graid/7/sys/modules/ata/atapci/chipsets/atanetcell/Makefile (contents, props changed) projects/graid/7/sys/modules/ata/atapci/chipsets/atanvidia/ projects/graid/7/sys/modules/ata/atapci/chipsets/atanvidia/Makefile (contents, props changed) projects/graid/7/sys/modules/ata/atapci/chipsets/atapromise/ projects/graid/7/sys/modules/ata/atapci/chipsets/atapromise/Makefile (contents, props changed) projects/graid/7/sys/modules/ata/atapci/chipsets/ataserverworks/ projects/graid/7/sys/modules/ata/atapci/chipsets/ataserverworks/Makefile (contents, props changed) projects/graid/7/sys/modules/ata/atapci/chipsets/atasiliconimage/ projects/graid/7/sys/modules/ata/atapci/chipsets/atasiliconimage/Makefile (contents, props changed) projects/graid/7/sys/modules/ata/atapci/chipsets/atasis/ projects/graid/7/sys/modules/ata/atapci/chipsets/atasis/Makefile (contents, props changed) projects/graid/7/sys/modules/ata/atapci/chipsets/atavia/ projects/graid/7/sys/modules/ata/atapci/chipsets/atavia/Makefile (contents, props changed) projects/graid/7/sys/modules/mvs/ projects/graid/7/sys/modules/mvs/Makefile (contents, props changed) projects/graid/7/sys/modules/siis/ projects/graid/7/sys/modules/siis/Makefile (contents, props changed) projects/graid/7/sys/powerpc/powermac/ata_dbdma.c (contents, props changed) projects/graid/7/sys/powerpc/powermac/ata_dbdma.h (contents, props changed) Deleted: projects/graid/7/sys/dev/ata/ata-chipset.c projects/graid/7/sys/dev/ata/ata-usb.c projects/graid/7/sys/modules/ata/ata/ projects/graid/7/sys/modules/ata/atausb/ Modified: projects/graid/7/etc/mtree/BSD.include.dist projects/graid/7/include/Makefile projects/graid/7/lib/libcam/Makefile projects/graid/7/lib/libcam/cam.3 projects/graid/7/lib/libcam/cam_cdbparse.3 projects/graid/7/lib/libcam/camlib.c projects/graid/7/sbin/atacontrol/atacontrol.c projects/graid/7/sbin/camcontrol/camcontrol.8 projects/graid/7/sbin/camcontrol/camcontrol.c projects/graid/7/sbin/camcontrol/modeedit.c projects/graid/7/share/man/man4/Makefile projects/graid/7/share/man/man4/ata.4 projects/graid/7/share/man/man4/scsi.4 projects/graid/7/sys/cam/cam.c projects/graid/7/sys/cam/cam.h projects/graid/7/sys/cam/cam_ccb.h projects/graid/7/sys/cam/cam_debug.h projects/graid/7/sys/cam/cam_periph.c projects/graid/7/sys/cam/cam_periph.h projects/graid/7/sys/cam/cam_queue.c projects/graid/7/sys/cam/cam_queue.h projects/graid/7/sys/cam/cam_sim.c projects/graid/7/sys/cam/cam_xpt.c projects/graid/7/sys/cam/cam_xpt.h projects/graid/7/sys/cam/cam_xpt_periph.h projects/graid/7/sys/cam/cam_xpt_sim.h projects/graid/7/sys/cam/scsi/scsi_all.c projects/graid/7/sys/cam/scsi/scsi_all.h projects/graid/7/sys/cam/scsi/scsi_cd.c projects/graid/7/sys/cam/scsi/scsi_ch.c projects/graid/7/sys/cam/scsi/scsi_ch.h projects/graid/7/sys/cam/scsi/scsi_da.c projects/graid/7/sys/cam/scsi/scsi_low.c projects/graid/7/sys/cam/scsi/scsi_pass.c projects/graid/7/sys/cam/scsi/scsi_pt.c projects/graid/7/sys/cam/scsi/scsi_sa.c projects/graid/7/sys/cam/scsi/scsi_ses.c projects/graid/7/sys/cam/scsi/scsi_sg.c projects/graid/7/sys/cam/scsi/scsi_targ_bh.c projects/graid/7/sys/cam/scsi/scsi_target.c projects/graid/7/sys/conf/files projects/graid/7/sys/conf/files.powerpc projects/graid/7/sys/conf/options projects/graid/7/sys/dev/asr/asr.c projects/graid/7/sys/dev/ata/ata-all.c projects/graid/7/sys/dev/ata/ata-all.h projects/graid/7/sys/dev/ata/ata-card.c projects/graid/7/sys/dev/ata/ata-cbus.c projects/graid/7/sys/dev/ata/ata-disk.c projects/graid/7/sys/dev/ata/ata-disk.h projects/graid/7/sys/dev/ata/ata-dma.c projects/graid/7/sys/dev/ata/ata-isa.c projects/graid/7/sys/dev/ata/ata-lowlevel.c projects/graid/7/sys/dev/ata/ata-pci.c projects/graid/7/sys/dev/ata/ata-pci.h projects/graid/7/sys/dev/ata/ata-queue.c projects/graid/7/sys/dev/ata/ata-raid.c projects/graid/7/sys/dev/ata/ata_if.m projects/graid/7/sys/dev/ata/atapi-cam.c projects/graid/7/sys/dev/ata/atapi-cd.c projects/graid/7/sys/dev/ata/atapi-fd.c projects/graid/7/sys/dev/ata/atapi-tape.c projects/graid/7/sys/dev/ciss/ciss.c projects/graid/7/sys/dev/hptiop/hptiop.c projects/graid/7/sys/dev/hptrr/hptrr_osm_bsd.c projects/graid/7/sys/dev/hptrr/os_bsd.h projects/graid/7/sys/dev/iscsi/initiator/isc_cam.c projects/graid/7/sys/dev/mly/mly.c projects/graid/7/sys/dev/mpt/mpt_cam.h projects/graid/7/sys/dev/mpt/mpt_raid.c projects/graid/7/sys/dev/ppbus/vpo.c projects/graid/7/sys/dev/trm/trm.c projects/graid/7/sys/dev/twa/tw_osl_cam.c projects/graid/7/sys/dev/usb/umass.c projects/graid/7/sys/geom/geom_disk.c projects/graid/7/sys/geom/geom_disk.h projects/graid/7/sys/modules/Makefile projects/graid/7/sys/modules/ata/Makefile projects/graid/7/sys/modules/ata/atapci/Makefile projects/graid/7/sys/modules/cam/Makefile projects/graid/7/sys/pc98/include/md_var.h projects/graid/7/sys/pc98/pc98/pc98_machdep.c projects/graid/7/sys/powerpc/powermac/ata_kauai.c projects/graid/7/sys/powerpc/powermac/ata_macio.c projects/graid/7/sys/powerpc/psim/ata_iobus.c projects/graid/7/sys/sparc64/include/md_var.h projects/graid/7/sys/sparc64/sparc64/ata_machdep.c projects/graid/7/sys/sys/ata.h projects/graid/7/sys/sys/bio.h Modified: projects/graid/7/etc/mtree/BSD.include.dist ============================================================================== --- projects/graid/7/etc/mtree/BSD.include.dist Sat Dec 18 02:54:51 2010 (r216513) +++ projects/graid/7/etc/mtree/BSD.include.dist Sat Dec 18 06:51:48 2010 (r216514) @@ -78,6 +78,8 @@ .. .. cam + ata + .. scsi .. .. Modified: projects/graid/7/include/Makefile ============================================================================== --- projects/graid/7/include/Makefile Sat Dec 18 02:54:51 2010 (r216513) +++ projects/graid/7/include/Makefile Sat Dec 18 06:51:48 2010 (r216514) @@ -41,7 +41,7 @@ LDIRS= bsm cam geom net net80211 netatal nfs nfsclient nfsserver \ pccard sys vm -LSUBDIRS= cam/scsi \ +LSUBDIRS= cam/ata cam/scsi \ dev/acpica dev/an dev/bktr dev/firewire dev/hwpmc \ dev/ic dev/iicbus ${_dev_ieee488} dev/lmc dev/mfi dev/ofw \ dev/pbio ${_dev_powermac_nvram} dev/ppbus dev/smbus \ Modified: projects/graid/7/lib/libcam/Makefile ============================================================================== --- projects/graid/7/lib/libcam/Makefile Sat Dec 18 02:54:51 2010 (r216513) +++ projects/graid/7/lib/libcam/Makefile Sat Dec 18 06:51:48 2010 (r216514) @@ -2,7 +2,8 @@ LIB= cam SHLIBDIR?= /lib -SRCS= camlib.c scsi_cmdparse.c scsi_all.c scsi_da.c scsi_sa.c cam.c +SRCS= camlib.c scsi_cmdparse.c scsi_all.c scsi_da.c scsi_sa.c cam.c \ + ata_all.c INCS= camlib.h DPADD= ${LIBSBUF} @@ -10,6 +11,7 @@ LDADD= -lsbuf MAN= cam.3 cam_cdbparse.3 +WARNS?= 2 MLINKS+= cam.3 cam_open_device.3 \ cam.3 cam_open_spec_device.3 \ @@ -34,7 +36,8 @@ MLINKS+= cam.3 cam_open_device.3 \ cam_cdbparse.3 csio_encode_visit.3 \ cam_cdbparse.3 buff_encode_visit.3 -.PATH: ${.CURDIR}/../../sys/cam/scsi ${.CURDIR}/../../sys/cam +.PATH: ${.CURDIR}/../../sys/cam/scsi ${.CURDIR}/../../sys/cam/ata \ + ${.CURDIR}/../../sys/cam SDIR= ${.CURDIR}/../../sys CFLAGS+= -I${.CURDIR} -I${SDIR} Modified: projects/graid/7/lib/libcam/cam.3 ============================================================================== --- projects/graid/7/lib/libcam/cam.3 Sat Dec 18 02:54:51 2010 (r216513) +++ projects/graid/7/lib/libcam/cam.3 Sat Dec 18 06:51:48 2010 (r216514) @@ -28,8 +28,8 @@ .\" $FreeBSD$ .\" .Dd October 10, 1998 -.Os .Dt CAM 3 +.Os .Sh NAME .Nm cam_open_device , .Nm cam_open_spec_device , @@ -190,12 +190,6 @@ into a device name and unit number. Once the device name and unit number are determined, a lookup is performed to determine the passthrough device that corresponds to the given device. -.Fn cam_open_device -is rather simple to use, but it is not really suitable for general use -because its behavior is not necessarily deterministic. -Programmers writing -new applications should make the extra effort to use one of the other open -routines documented below. .Pp .Fn cam_open_spec_device opens the @@ -354,19 +348,15 @@ respectively. can handle strings of the following forms, at least: .Pp .Bl -tag -width 1234 -compact -.It /dev/foo0a -.It /dev/foo1s2c +.It /dev/foo1 .It foo0 -.It foo0a -.It nfoo0 +.It nsa2 .El .Pp .Fn cam_get_device is provided as a convenience function for applications that need to provide functionality similar to .Fn cam_open_device . -Programmers are encouraged to use more deterministic methods of obtaining -device names and unit numbers if possible. .Sh RETURN VALUES .Fn cam_open_device , .Fn cam_open_spec_device , @@ -382,7 +372,7 @@ returns an allocated and partially initi of the CCB failed. .Pp .Fn cam_send_ccb -returns a value of -1 if an error occured, and +returns a value of -1 if an error occurred, and .Va errno is set to indicate the error. .Pp Modified: projects/graid/7/lib/libcam/cam_cdbparse.3 ============================================================================== --- projects/graid/7/lib/libcam/cam_cdbparse.3 Sat Dec 18 02:54:51 2010 (r216513) +++ projects/graid/7/lib/libcam/cam_cdbparse.3 Sat Dec 18 06:51:48 2010 (r216514) @@ -62,8 +62,8 @@ .\" .\" .Dd October 13, 1998 -.Os .Dt CAM_CDBPARSE 3 +.Os .Sh NAME .Nm csio_build , .Nm csio_build_visit , @@ -258,7 +258,6 @@ typedef enum { Multiple flags should be ORed together. Any of the CCB flags may be used, although it is worth noting several important ones here: -.Pp .Bl -tag -width CAM_PASS_ERR_RECOVER .It Dv CAM_DIR_IN This indicates that the operation in question is a read operation. Modified: projects/graid/7/lib/libcam/camlib.c ============================================================================== --- projects/graid/7/lib/libcam/camlib.c Sat Dec 18 02:54:51 2010 (r216513) +++ projects/graid/7/lib/libcam/camlib.c Sat Dec 18 06:51:48 2010 (r216514) @@ -42,14 +42,9 @@ __FBSDID("$FreeBSD$"); #include #include "camlib.h" -struct cam_devequiv { - char *given_dev; - char *real_dev; -}; -struct cam_devequiv devmatchtable[] = { - {"sd", "da"}, - {"st", "sa"} +static const char *nonrewind_devs[] = { + "sa" }; char cam_errbuf[CAM_ERRBUF_SIZE]; @@ -103,19 +98,14 @@ cam_freeccb(union ccb *ccb) /* * Take a device name or path passed in by the user, and attempt to figure * out the device name and unit number. Some possible device name formats are: - * /dev/foo0a - * /dev/rfoo0a - * /dev/rfoos2c + * /dev/foo0 * foo0 - * foo0a - * rfoo0 - * rfoo0a - * nrfoo0 - * - * If the caller passes in an old style device name like 'sd' or 'st', - * it will be converted to the new style device name based upon devmatchtable - * above. + * nfoo0 * + * Some peripheral drivers create separate device nodes with 'n' prefix for + * non-rewind operations. Currently only sa(4) tape driver has this feature. + * We extract pure peripheral name as device name for this special case. + * * Input parameters: device name/path, length of devname string * Output: device name, unit number * Return values: returns 0 for success, -1 for failure @@ -127,7 +117,7 @@ cam_get_device(const char *path, char *d char *tmpstr, *tmpstr2; char *newpath; int unit_offset; - int i, found = 0; + int i; if (path == NULL) { @@ -142,10 +132,6 @@ cam_get_device(const char *path, char *d newpath = (char *)strdup(path); tmpstr = newpath; - /* Get rid of any leading white space */ - while (isspace(*tmpstr) && (*tmpstr != '\0')) - tmpstr++; - /* * Check to see whether we have an absolute pathname. */ @@ -166,61 +152,22 @@ cam_get_device(const char *path, char *d * Check to see whether the user has given us a nonrewound tape * device. */ - if (*tmpstr == 'n') - tmpstr++; - - if (*tmpstr == '\0') { - sprintf(cam_errbuf, "%s: no text after leading 'n'", func_name); - free(newpath); - return(-1); - } - - /* - * See if the user has given us a character device. - */ - if (*tmpstr == 'r') - tmpstr++; - - if (*tmpstr == '\0') { - sprintf(cam_errbuf, "%s: no text after leading 'r'", func_name); - free(newpath); - return(-1); - } - - /* - * Try to get rid of any trailing white space or partition letters. - */ - tmpstr2 = &tmpstr[strlen(tmpstr) - 1]; - - while ((*tmpstr2 != '\0') && (tmpstr2 > tmpstr) &&(!isdigit(*tmpstr2))){ - *tmpstr2 = '\0'; - tmpstr2--; - } - - /* - * Check to see whether we have been given a partition with a slice - * name. If so, get rid of the slice name/number. - */ - if (strlen(tmpstr) > 3) { - /* - * Basically, we're looking for a string that ends in the - * following general manner: 1s1 -- a number, the letter - * s, and then another number. This indicates that the - * user has given us a slice. We substitute nulls for the - * s and the slice number. - */ - if ((isdigit(tmpstr[strlen(tmpstr) - 1])) - && (tmpstr[strlen(tmpstr) - 2] == 's') - && (isdigit(tmpstr[strlen(tmpstr) - 3]))) { - tmpstr[strlen(tmpstr) - 1] = '\0'; - tmpstr[strlen(tmpstr) - 1] = '\0'; + if (*tmpstr == 'n' || *tmpstr == 'e') { + for (i = 0; i < sizeof(nonrewind_devs)/sizeof(char *); i++) { + int len = strlen(nonrewind_devs[i]); + if (strncmp(tmpstr + 1, nonrewind_devs[i], len) == 0) { + if (isdigit(tmpstr[len + 1])) { + tmpstr++; + break; + } + } } } /* - * After we nuke off the slice, we should have just a device name - * and unit number. That means there must be at least 2 - * characters. If we only have 1, we don't have a valid device name. + * We should now have just a device name and unit number. + * That means that there must be at least 2 characters. + * If we only have 1, we don't have a valid device name. */ if (strlen(tmpstr) < 2) { sprintf(cam_errbuf, @@ -281,20 +228,7 @@ cam_get_device(const char *path, char *d */ tmpstr[strlen(tmpstr) - unit_offset] = '\0'; - /* - * Look through our equivalency table and see if the device name - * the user gave us is an old style device name. If so, translate - * it to the new style device name. - */ - for (i = 0;i < (sizeof(devmatchtable)/sizeof(struct cam_devequiv));i++){ - if (strcmp(tmpstr, devmatchtable[i].given_dev) == 0) { - strlcpy(dev_name,devmatchtable[i].real_dev, devnamelen); - found = 1; - break; - } - } - if (found == 0) - strlcpy(dev_name, tmpstr, devnamelen); + strlcpy(dev_name, tmpstr, devnamelen); /* Clean up allocated memory */ free(newpath); Modified: projects/graid/7/sbin/atacontrol/atacontrol.c ============================================================================== --- projects/graid/7/sbin/atacontrol/atacontrol.c Sat Dec 18 02:54:51 2010 (r216513) +++ projects/graid/7/sbin/atacontrol/atacontrol.c Sat Dec 18 06:51:48 2010 (r216514) @@ -42,7 +42,7 @@ static const char * mode2str(int mode) { - switch (mode) { + switch (mode & 0xff) { case ATA_PIO: return "BIOSPIO"; case ATA_PIO0: return "PIO0"; case ATA_PIO1: return "PIO1"; @@ -59,16 +59,24 @@ mode2str(int mode) case ATA_UDMA4: return "UDMA66"; case ATA_UDMA5: return "UDMA100"; case ATA_UDMA6: return "UDMA133"; - case ATA_SA150: return "SATA150"; - case ATA_SA300: return "SATA300"; - case ATA_USB: return "USB"; - case ATA_USB1: return "USB1"; - case ATA_USB2: return "USB2"; case ATA_DMA: return "BIOSDMA"; default: return "???"; } } +static const char * +satarev2str(int mode) +{ + switch ((mode & 0xff00) >> 8) { + case 0: return ""; + case 1: return "SATA 1.5Gb/s"; + case 2: return "SATA 3Gb/s"; + case 3: return "SATA 6Gb/s"; + case 0xff: return "SATA"; + default: return "???"; + } +} + static int str2mode(char *str) { @@ -82,7 +90,9 @@ str2mode(char *str) if (!strcasecmp(str, "WDMA1")) return ATA_WDMA1; if (!strcasecmp(str, "WDMA2")) return ATA_WDMA2; if (!strcasecmp(str, "UDMA0")) return ATA_UDMA0; + if (!strcasecmp(str, "UDMA16")) return ATA_UDMA0; if (!strcasecmp(str, "UDMA1")) return ATA_UDMA1; + if (!strcasecmp(str, "UDMA25")) return ATA_UDMA1; if (!strcasecmp(str, "UDMA2")) return ATA_UDMA2; if (!strcasecmp(str, "UDMA33")) return ATA_UDMA2; if (!strcasecmp(str, "UDMA3")) return ATA_UDMA3; @@ -93,11 +103,6 @@ str2mode(char *str) if (!strcasecmp(str, "UDMA100")) return ATA_UDMA5; if (!strcasecmp(str, "UDMA6")) return ATA_UDMA6; if (!strcasecmp(str, "UDMA133")) return ATA_UDMA6; - if (!strcasecmp(str, "SATA150")) return ATA_SA150; - if (!strcasecmp(str, "SATA300")) return ATA_SA300; - if (!strcasecmp(str, "USB")) return ATA_USB; - if (!strcasecmp(str, "USB1")) return ATA_USB1; - if (!strcasecmp(str, "USB2")) return ATA_USB2; if (!strcasecmp(str, "BIOSDMA")) return ATA_DMA; return -1; } @@ -388,7 +393,8 @@ main(int argc, char **argv) if (argc == 3 || argc == 4) { if (ioctl(fd, IOCATAGMODE, &mode) < 0) err(1, "ioctl(IOCATAGMODE)"); - printf("current mode = %s\n", mode2str(mode)); + printf("current mode = %s %s\n", + mode2str(mode), satarev2str(mode)); } exit(EX_OK); } Modified: projects/graid/7/sbin/camcontrol/camcontrol.8 ============================================================================== --- projects/graid/7/sbin/camcontrol/camcontrol.8 Sat Dec 18 02:54:51 2010 (r216513) +++ projects/graid/7/sbin/camcontrol/camcontrol.8 Sat Dec 18 06:51:48 2010 (r216514) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 21, 2006 +.Dd July 1, 2010 .Dt CAMCONTROL 8 .Os .Sh NAME @@ -59,6 +59,11 @@ .Op Fl S .Op Fl R .Nm +.Ic identify +.Op device id +.Op generic args +.Op Fl v +.Nm .Ic reportluns .Op device id .Op generic args @@ -116,10 +121,14 @@ .Ic cmd .Op device id .Op generic args +.Aq Fl a Ar cmd Op args .Aq Fl c Ar cmd Op args +.Op Fl d +.Op Fl f .Op Fl i Ar len Ar fmt .Bk -words .Op Fl o Ar len Ar fmt Op args +.Op Fl r Ar fmt .Ek .Nm .Ic debug @@ -143,6 +152,7 @@ .Op generic args .Op Fl c .Op Fl D Ar enable|disable +.Op Fl M Ar mode .Op Fl O Ar offset .Op Fl q .Op Fl R Ar syncrate @@ -159,6 +169,20 @@ .Op Fl w .Op Fl y .Nm +.Ic idle +.Op device id +.Op generic args +.Op Fl t Ar time +.Nm +.Ic standby +.Op device id +.Op generic args +.Op Fl t Ar time +.Nm +.Ic sleep +.Op device id +.Op generic args +.Nm .Ic help .Sh DESCRIPTION The @@ -283,6 +307,8 @@ This is to aid in script writing. .It Fl R Print out transfer rate information. .El +.It Ic identify +Send a ATA identify command (0xec) to a device. .It Ic reportluns Send the SCSI REPORT LUNS (0xA0) command to the given device. By default, @@ -480,26 +506,36 @@ Saved values .El .El .It Ic cmd -Allows the user to send an arbitrary SCSI CDB to any device. +Allows the user to send an arbitrary ATA or SCSI CDB to any device. The .Ic cmd function requires the .Fl c -argument to specify the CDB. +argument to specify SCSI CDB or the +.Fl a +argument to specify ATA Command Block registers values. Other arguments are optional, depending on the command type. The command and data specification syntax is documented in .Xr cam_cdbparse 3 . -NOTE: If the CDB specified causes data to be transfered to or from the +NOTE: If the CDB specified causes data to be transferred to or from the SCSI device in question, you MUST specify either .Fl i or .Fl o . .Bl -tag -width 17n +.It Fl a Ar cmd Op args +This specifies the content of 12 ATA Command Block registers (command, +features, lba_low, lba_mid, lba_high, device, lba_low_exp, lba_mid_exp. +lba_high_exp, features_exp, sector_count, sector_count_exp). .It Fl c Ar cmd Op args This specifies the SCSI CDB. -CDBs may be 6, 10, 12 or 16 bytes. +SCSI CDBs may be 6, 10, 12 or 16 bytes. +.It Fl d +Specifies DMA protocol to be used for ATA command. +.It Fl f +Specifies FPDMA (NCQ) protocol to be used for ATA command. .It Fl i Ar len Ar fmt This specifies the amount of data to read, and how it should be displayed. If the format is @@ -513,6 +549,13 @@ If the format is .Sq - , .Ar len bytes of data will be read from standard input and written to the device. +.It Fl r Ar fmt +This specifies that 11 result ATA Command Block registers should be displayed +(status, error, lba_low, lba_mid, lba_high, device, lba_low_exp, lba_mid_exp, +lba_high_exp, sector_count, sector_count_exp), and how. +If the format is +.Sq - , +11 result registers will be written to standard output in hex. .El .It Ic debug Turn on CAM debugging printfs in the kernel. @@ -670,6 +713,8 @@ Show or set current negotiation settings This is the default. .It Fl D Ar enable|disable Enable or disable disconnection. +.It Fl M Ar mode +Set ATA mode. .It Fl O Ar offset Set the command delay offset. .It Fl q @@ -800,6 +845,17 @@ The user will not be asked about the timeout if a timeout is specified on the command line. .El +.It Ic idle +Put ATA device into IDLE state. Optional parameter +.Pq Fl t +specifies automatic standby timer value in seconds. Value 0 disables timer. +.It Ic standby +Put ATA device into STANDBY state. Optional parameter +.Pq Fl t +specifies automatic standby timer value in seconds. Value 0 disables timer. +.It Ic sleep +Put ATA device into SLEEP state. Note that the only way get device out of +this state may be reset. .It Ic help Print out verbose usage information. .El Modified: projects/graid/7/sbin/camcontrol/camcontrol.c ============================================================================== --- projects/graid/7/sbin/camcontrol/camcontrol.c Sat Dec 18 02:54:51 2010 (r216513) +++ projects/graid/7/sbin/camcontrol/camcontrol.c Sat Dec 18 06:51:48 2010 (r216514) @@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -49,6 +50,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include "camcontrol.h" @@ -71,7 +73,11 @@ typedef enum { CAM_CMD_RATE = 0x0000000f, CAM_CMD_DETACH = 0x00000010, CAM_CMD_REPORTLUNS = 0x00000011, - CAM_CMD_READCAP = 0x00000012 + CAM_CMD_READCAP = 0x00000012, + CAM_CMD_IDENTIFY = 0x00000013, + CAM_CMD_IDLE = 0x00000014, + CAM_CMD_STANDBY = 0x00000015, + CAM_CMD_SLEEP = 0x00000016 } cam_cmdmask; typedef enum { @@ -110,22 +116,23 @@ typedef enum { } cam_argmask; struct camcontrol_opts { - const char *optname; + const char *optname; cam_cmdmask cmdnum; cam_argmask argnum; const char *subopt; }; #ifndef MINIMALISTIC -static const char scsicmd_opts[] = "c:i:o:"; +static const char scsicmd_opts[] = "a:c:dfi:o:r"; static const char readdefect_opts[] = "f:GP"; -static const char negotiate_opts[] = "acD:O:qR:T:UW:"; +static const char negotiate_opts[] = "acD:M:O:qR:T:UW:"; #endif struct camcontrol_opts option_table[] = { #ifndef MINIMALISTIC {"tur", CAM_CMD_TUR, CAM_ARG_NONE, NULL}, {"inquiry", CAM_CMD_INQUIRY, CAM_ARG_NONE, "DSR"}, + {"identify", CAM_CMD_IDENTIFY, CAM_ARG_NONE, NULL}, {"start", CAM_CMD_STARTSTOP, CAM_ARG_START_UNIT, NULL}, {"stop", CAM_CMD_STARTSTOP, CAM_ARG_NONE, NULL}, {"load", CAM_CMD_STARTSTOP, CAM_ARG_START_UNIT | CAM_ARG_EJECT, NULL}, @@ -150,6 +157,9 @@ struct camcontrol_opts option_table[] = {"rate", CAM_CMD_RATE, CAM_ARG_NONE, negotiate_opts}, {"debug", CAM_CMD_DEBUG, CAM_ARG_NONE, "IPTSXc"}, {"format", CAM_CMD_FORMAT, CAM_ARG_NONE, "qrwy"}, + {"idle", CAM_CMD_IDLE, CAM_ARG_NONE, "t:"}, + {"standby", CAM_CMD_STANDBY, CAM_ARG_NONE, "t:"}, + {"sleep", CAM_CMD_SLEEP, CAM_ARG_NONE, ""}, #endif /* MINIMALISTIC */ {"help", CAM_CMD_USAGE, CAM_ARG_NONE, NULL}, {"-?", CAM_CMD_USAGE, CAM_ARG_NONE, NULL}, @@ -182,7 +192,7 @@ static int scsidoinquiry(struct cam_devi char *combinedopt, int retry_count, int timeout); static int scsiinquiry(struct cam_device *device, int retry_count, int timeout); static int scsiserial(struct cam_device *device, int retry_count, int timeout); -static int scsixferrate(struct cam_device *device); +static int camxferrate(struct cam_device *device); #endif /* MINIMALISTIC */ static int parse_btl(char *tstr, int *bus, int *target, int *lun, cam_argmask *arglst); @@ -194,7 +204,7 @@ static int readdefects(struct cam_device char *combinedopt, int retry_count, int timeout); static void modepage(struct cam_device *device, int argc, char **argv, char *combinedopt, int retry_count, int timeout); -static int scsicmd(struct cam_device *device, int argc, char **argv, +static int scsicmd(struct cam_device *device, int argc, char **argv, char *combinedopt, int retry_count, int timeout); static int tagcontrol(struct cam_device *device, int argc, char **argv, char *combinedopt); @@ -202,6 +212,7 @@ static void cts_print(struct cam_device struct ccb_trans_settings *cts); static void cpi_print(struct ccb_pathinq *cpi); static int get_cpi(struct cam_device *device, struct ccb_pathinq *cpi); +static int get_cgd(struct cam_device *device, struct ccb_getdev *cgd); static int get_print_cts(struct cam_device *device, int user_settings, int quiet, struct ccb_trans_settings *cts); static int ratecontrol(struct cam_device *device, int retry_count, @@ -212,10 +223,18 @@ static int scsireportluns(struct cam_dev char *combinedopt, int retry_count, int timeout); static int scsireadcapacity(struct cam_device *device, int argc, char **argv, char *combinedopt, int retry_count, int timeout); +static int atapm(struct cam_device *device, int argc, char **argv, + char *combinedopt, int retry_count, int timeout); #endif /* MINIMALISTIC */ +#ifndef min +#define min(a,b) (((a)<(b))?(a):(b)) +#endif +#ifndef max +#define max(a,b) (((a)>(b))?(a):(b)) +#endif camcontrol_optret -getoption(char *arg, cam_cmdmask *cmdnum, cam_argmask *argnum, +getoption(char *arg, cam_cmdmask *cmdnum, cam_argmask *argnum, const char **subopt) { struct camcontrol_opts *opts; @@ -401,19 +420,35 @@ getdevtree(void) } else skip_device = 0; - cam_strvis(vendor, dev_result->inq_data.vendor, + if (dev_result->protocol == PROTO_SCSI) { + cam_strvis(vendor, dev_result->inq_data.vendor, sizeof(dev_result->inq_data.vendor), sizeof(vendor)); - cam_strvis(product, + cam_strvis(product, dev_result->inq_data.product, sizeof(dev_result->inq_data.product), sizeof(product)); - cam_strvis(revision, + cam_strvis(revision, dev_result->inq_data.revision, sizeof(dev_result->inq_data.revision), sizeof(revision)); - sprintf(tmpstr, "<%s %s %s>", vendor, product, + sprintf(tmpstr, "<%s %s %s>", vendor, product, + revision); + } else if (dev_result->protocol == PROTO_ATA || + dev_result->protocol == PROTO_SATAPM) { + cam_strvis(product, + dev_result->ident_data.model, + sizeof(dev_result->ident_data.model), + sizeof(product)); + cam_strvis(revision, + dev_result->ident_data.revision, + sizeof(dev_result->ident_data.revision), + sizeof(revision)); + sprintf(tmpstr, "<%s %s>", product, revision); + } else { + sprintf(tmpstr, "<>"); + } if (need_close) { fprintf(stdout, ")\n"); need_close = 0; @@ -587,7 +622,7 @@ scsistart(struct cam_device *device, int else fprintf(stdout, "Error received from stop unit command\n"); - + if (arglist & CAM_ARG_VERBOSE) { cam_error_print(device, ccb, CAM_ESF_ALL, CAM_EPF_ALL, stderr); @@ -642,7 +677,7 @@ scsidoinquiry(struct cam_device *device, return(error); if (arglist & CAM_ARG_GET_XFERRATE) - error = scsixferrate(device); + error = camxferrate(device); return(error); } @@ -653,7 +688,7 @@ scsiinquiry(struct cam_device *device, i union ccb *ccb; struct scsi_inquiry_data *inq_buf; int error = 0; - + ccb = cam_getccb(device); if (ccb == NULL) { @@ -686,13 +721,13 @@ scsiinquiry(struct cam_device *device, i * scsi_inquiry() will convert an inq_len (which is passed in as * a u_int32_t, but the field in the CDB is only 1 byte) of 256 * to 0. Evidently, very few devices meet the spec in that - * regard. Some devices, like many Seagate disks, take the 0 as + * regard. Some devices, like many Seagate disks, take the 0 as * 0, and don't return any data. One Pioneer DVD-R drive * returns more data than the command asked for. * * So, since there are numerous devices that just don't work * right with the full inquiry size, we don't send the full size. - * + * * - The second reason not to use the full inquiry data length is * that we don't need it here. The only reason we issue a * standard inquiry is to get the vendor name, device name, @@ -852,14 +887,18 @@ scsiserial(struct cam_device *device, in } static int -scsixferrate(struct cam_device *device) +camxferrate(struct cam_device *device) { + struct ccb_pathinq cpi; u_int32_t freq = 0; u_int32_t speed = 0; union ccb *ccb; u_int mb; int retval = 0; + if ((retval = get_cpi(device, &cpi)) != 0) + return (1); + ccb = cam_getccb(device); if (ccb == NULL) { @@ -892,6 +931,8 @@ scsixferrate(struct cam_device *device) } + speed = cpi.base_transfer_speed; + freq = 0; if (ccb->cts.transport == XPORT_SPI) { struct ccb_trans_settings_spi *spi = &ccb->cts.xport_specific.spi; @@ -900,26 +941,53 @@ scsixferrate(struct cam_device *device) freq = scsi_calc_syncsrate(spi->sync_period); speed = freq; } - - fprintf(stdout, "%s%d: ", device->device_name, - device->dev_unit_num); - if ((spi->valid & CTS_SPI_VALID_BUS_WIDTH) != 0) { speed *= (0x01 << spi->bus_width); } + } else if (ccb->cts.transport == XPORT_FC) { + struct ccb_trans_settings_fc *fc = + &ccb->cts.xport_specific.fc; + + if (fc->valid & CTS_FC_VALID_SPEED) + speed = fc->bitrate; + } else if (ccb->cts.transport == XPORT_SAS) { + struct ccb_trans_settings_sas *sas = + &ccb->cts.xport_specific.sas; + + if (sas->valid & CTS_SAS_VALID_SPEED) + speed = sas->bitrate; + } else if (ccb->cts.transport == XPORT_ATA) { + struct ccb_trans_settings_ata *ata = + &ccb->cts.xport_specific.ata; + + if (ata->valid & CTS_ATA_VALID_MODE) + speed = ata_mode2speed(ata->mode); + } else if (ccb->cts.transport == XPORT_SATA) { + struct ccb_trans_settings_sata *sata = + &ccb->cts.xport_specific.sata; + + if (sata->valid & CTS_SATA_VALID_REVISION) + speed = ata_revision2speed(sata->revision); + } + + mb = speed / 1000; + if (mb > 0) { + fprintf(stdout, "%s%d: %d.%03dMB/s transfers", + device->device_name, device->dev_unit_num, + mb, speed % 1000); + } else { + fprintf(stdout, "%s%d: %dKB/s transfers", + device->device_name, device->dev_unit_num, + speed); + } - mb = speed / 1000; - - if (mb > 0) - fprintf(stdout, "%d.%03dMB/s transfers ", - mb, speed % 1000); - else - fprintf(stdout, "%dKB/s transfers ", - speed); + if (ccb->cts.transport == XPORT_SPI) { + struct ccb_trans_settings_spi *spi = + &ccb->cts.xport_specific.spi; if (((spi->valid & CTS_SPI_VALID_SYNC_OFFSET) != 0) && (spi->sync_offset != 0)) - fprintf(stdout, "(%d.%03dMHz, offset %d", freq / 1000, + fprintf(stdout, " (%d.%03dMHz, offset %d", freq / 1000, freq % 1000, spi->sync_offset); if (((spi->valid & CTS_SPI_VALID_BUS_WIDTH) != 0) @@ -935,25 +1003,34 @@ scsixferrate(struct cam_device *device) && (spi->sync_offset != 0)) { fprintf(stdout, ")"); } - } else { - struct ccb_pathinq cpi; - - retval = get_cpi(device, &cpi); - - if (retval != 0) - goto xferrate_bailout; - - speed = cpi.base_transfer_speed; - freq = 0; - - mb = speed / 1000; - - if (mb > 0) - fprintf(stdout, "%d.%03dMB/s transfers ", - mb, speed % 1000); + } else if (ccb->cts.transport == XPORT_ATA) { + struct ccb_trans_settings_ata *ata = + &ccb->cts.xport_specific.ata; + + printf(" ("); + if (ata->valid & CTS_ATA_VALID_MODE) + printf("%s, ", ata_mode2string(ata->mode)); + if ((ata->valid & CTS_ATA_VALID_ATAPI) && ata->atapi != 0) + printf("ATAPI %dbytes, ", ata->atapi); + if (ata->valid & CTS_ATA_VALID_BYTECOUNT) + printf("PIO %dbytes", ata->bytecount); + printf(")"); + } else if (ccb->cts.transport == XPORT_SATA) { + struct ccb_trans_settings_sata *sata = + &ccb->cts.xport_specific.sata; + + printf(" ("); + if (sata->valid & CTS_SATA_VALID_REVISION) + printf("SATA %d.x, ", sata->revision); else - fprintf(stdout, "%dKB/s transfers ", - speed); + printf("SATA, "); + if (sata->valid & CTS_SATA_VALID_MODE) + printf("%s, ", ata_mode2string(sata->mode)); + if ((sata->valid & CTS_SATA_VALID_ATAPI) && sata->atapi != 0) + printf("ATAPI %dbytes, ", sata->atapi); + if (sata->valid & CTS_SATA_VALID_BYTECOUNT) + printf("PIO %dbytes", sata->bytecount); + printf(")"); } if (ccb->cts.protocol == PROTO_SCSI) { @@ -974,6 +1051,342 @@ xferrate_bailout: return(retval); } + +static void +atacapprint(struct ata_params *parm) +{ + u_int32_t lbasize = (u_int32_t)parm->lba_size_1 | + ((u_int32_t)parm->lba_size_2 << 16); + + u_int64_t lbasize48 = ((u_int64_t)parm->lba_size48_1) | + ((u_int64_t)parm->lba_size48_2 << 16) | + ((u_int64_t)parm->lba_size48_3 << 32) | + ((u_int64_t)parm->lba_size48_4 << 48); + + printf("\n"); + printf("protocol "); + printf("ATA/ATAPI-%d", ata_version(parm->version_major)); + if (parm->satacapabilities && parm->satacapabilities != 0xffff) { + if (parm->satacapabilities & ATA_SATA_GEN3) + printf(" SATA 3.x\n"); + else if (parm->satacapabilities & ATA_SATA_GEN2) + printf(" SATA 2.x\n"); + else if (parm->satacapabilities & ATA_SATA_GEN1) + printf(" SATA 1.x\n"); + else + printf(" SATA\n"); + } + else + printf("\n"); + printf("device model %.40s\n", parm->model); + printf("firmware revision %.8s\n", parm->revision); + printf("serial number %.20s\n", parm->serial); + if (parm->enabled.extension & ATA_SUPPORT_64BITWWN) { + printf("WWN %02x%02x%02x%02x\n", + parm->wwn[0], parm->wwn[1], parm->wwn[2], parm->wwn[3]); + } + if (parm->enabled.extension & ATA_SUPPORT_MEDIASN) { + printf("media serial number %.30s\n", + parm->media_serial); + } + + printf("cylinders %d\n", parm->cylinders); + printf("heads %d\n", parm->heads); + printf("sectors/track %d\n", parm->sectors); + printf("sector size logical %u, physical %lu, offset %lu\n", + ata_logical_sector_size(parm), + (unsigned long)ata_physical_sector_size(parm), + (unsigned long)ata_logical_sector_offset(parm)); + + if (parm->config == ATA_PROTO_CFA || + (parm->support.command2 & ATA_SUPPORT_CFA)) + printf("CFA supported\n"); + + printf("LBA%ssupported ", + parm->capabilities1 & ATA_SUPPORT_LBA ? " " : " not "); + if (lbasize) + printf("%d sectors\n", lbasize); + else + printf("\n"); + + printf("LBA48%ssupported ", + parm->support.command2 & ATA_SUPPORT_ADDRESS48 ? " " : " not "); + if (lbasize48) + printf("%ju sectors\n", (uintmax_t)lbasize48); + else + printf("\n"); + + printf("PIO supported PIO"); + switch (ata_max_pmode(parm)) { + case ATA_PIO4: + printf("4"); + break; + case ATA_PIO3: + printf("3"); + break; + case ATA_PIO2: + printf("2"); + break; + case ATA_PIO1: + printf("1"); + break; + default: + printf("0"); + } + if ((parm->capabilities1 & ATA_SUPPORT_IORDY) == 0) + printf(" w/o IORDY"); + printf("\n"); + + printf("DMA%ssupported ", + parm->capabilities1 & ATA_SUPPORT_DMA ? " " : " not "); + if (parm->capabilities1 & ATA_SUPPORT_DMA) { + if (parm->mwdmamodes & 0xff) { + printf("WDMA"); + if (parm->mwdmamodes & 0x04) + printf("2"); + else if (parm->mwdmamodes & 0x02) + printf("1"); + else if (parm->mwdmamodes & 0x01) + printf("0"); + printf(" "); + } + if ((parm->atavalid & ATA_FLAG_88) && + (parm->udmamodes & 0xff)) { + printf("UDMA"); + if (parm->udmamodes & 0x40) + printf("6"); + else if (parm->udmamodes & 0x20) + printf("5"); + else if (parm->udmamodes & 0x10) + printf("4"); + else if (parm->udmamodes & 0x08) + printf("3"); + else if (parm->udmamodes & 0x04) + printf("2"); + else if (parm->udmamodes & 0x02) + printf("1"); + else if (parm->udmamodes & 0x01) + printf("0"); + printf(" "); + } + } + printf("\n"); + + if (parm->media_rotation_rate == 1) { + printf("media RPM non-rotating\n"); + } else if (parm->media_rotation_rate >= 0x0401 && + parm->media_rotation_rate <= 0xFFFE) { + printf("media RPM %d\n", + parm->media_rotation_rate); + } + + printf("\nFeature " *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-projects@FreeBSD.ORG Sat Dec 18 19:04:21 2010 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DBA5E10656A4; Sat, 18 Dec 2010 19:04:21 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C6E1E8FC19; Sat, 18 Dec 2010 19:04:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBIJ4LFg024803; Sat, 18 Dec 2010 19:04:21 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBIJ4Lem024791; Sat, 18 Dec 2010 19:04:21 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201012181904.oBIJ4Lem024791@svn.freebsd.org> From: Alexander Motin Date: Sat, 18 Dec 2010 19:04:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216525 - in projects/graid/head: etc/mtree include sbin/geom/class sbin/geom/class/raid sys/conf sys/geom/raid sys/modules/geom sys/modules/geom/geom_raid X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Dec 2010 19:04:21 -0000 Author: mav Date: Sat Dec 18 19:04:21 2010 New Revision: 216525 URL: http://svn.freebsd.org/changeset/base/216525 Log: Initial commit of the geom_raid module, intended to replace ataraid(4) at GEOM level. At this moment code is able to read and write existing RAID0 and RAID1 Intel MatrixRAID volumes, but not yet able to create volumes or do any error handling/recovery/rebuilding/... Basic design description can be found here: http://people.freebsd.org/~mav/graid_design.h Sponsored by: Cisco Systems, Inc. Added: projects/graid/head/sbin/geom/class/raid/ projects/graid/head/sbin/geom/class/raid/Makefile (contents, props changed) projects/graid/head/sbin/geom/class/raid/geom_raid.c (contents, props changed) projects/graid/head/sbin/geom/class/raid/graid.8 (contents, props changed) projects/graid/head/sys/geom/raid/ projects/graid/head/sys/geom/raid/g_raid.c (contents, props changed) projects/graid/head/sys/geom/raid/g_raid.h (contents, props changed) projects/graid/head/sys/geom/raid/g_raid_ctl.c (contents, props changed) projects/graid/head/sys/geom/raid/g_raid_md_if.m (contents, props changed) projects/graid/head/sys/geom/raid/g_raid_tr_if.m (contents, props changed) projects/graid/head/sys/geom/raid/md_intel.c (contents, props changed) projects/graid/head/sys/geom/raid/tr_raid0.c (contents, props changed) projects/graid/head/sys/geom/raid/tr_raid1.c (contents, props changed) projects/graid/head/sys/modules/geom/geom_raid/ projects/graid/head/sys/modules/geom/geom_raid/Makefile (contents, props changed) Modified: projects/graid/head/etc/mtree/BSD.include.dist projects/graid/head/include/Makefile projects/graid/head/sbin/geom/class/Makefile projects/graid/head/sys/conf/NOTES projects/graid/head/sys/conf/files projects/graid/head/sys/conf/options projects/graid/head/sys/modules/geom/Makefile Modified: projects/graid/head/etc/mtree/BSD.include.dist ============================================================================== --- projects/graid/head/etc/mtree/BSD.include.dist Sat Dec 18 16:41:11 2010 (r216524) +++ projects/graid/head/etc/mtree/BSD.include.dist Sat Dec 18 19:04:21 2010 (r216525) @@ -188,6 +188,8 @@ .. nop .. + raid + .. raid3 .. shsec Modified: projects/graid/head/include/Makefile ============================================================================== --- projects/graid/head/include/Makefile Sat Dec 18 16:41:11 2010 (r216524) +++ projects/graid/head/include/Makefile Sat Dec 18 19:04:21 2010 (r216525) @@ -47,7 +47,7 @@ LSUBDIRS= cam/ata cam/scsi \ ${_fs_nwfs} fs/portalfs fs/procfs fs/smbfs fs/udf fs/unionfs \ geom/cache geom/concat geom/eli geom/gate geom/journal geom/label \ geom/mirror geom/mountver geom/multipath geom/nop \ - geom/raid3 geom/shsec geom/stripe geom/virstor \ + geom/raid geom/raid3 geom/shsec geom/stripe geom/virstor \ netgraph/atm netgraph/netflow \ security/audit \ security/mac_biba security/mac_bsdextended security/mac_lomac \ Modified: projects/graid/head/sbin/geom/class/Makefile ============================================================================== --- projects/graid/head/sbin/geom/class/Makefile Sat Dec 18 16:41:11 2010 (r216524) +++ projects/graid/head/sbin/geom/class/Makefile Sat Dec 18 19:04:21 2010 (r216525) @@ -14,6 +14,7 @@ SUBDIR+=mountver SUBDIR+=multipath SUBDIR+=nop SUBDIR+=part +SUBDIR+=raid SUBDIR+=raid3 SUBDIR+=sched SUBDIR+=shsec Added: projects/graid/head/sbin/geom/class/raid/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/graid/head/sbin/geom/class/raid/Makefile Sat Dec 18 19:04:21 2010 (r216525) @@ -0,0 +1,10 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../../misc + +CLASS= raid + +DPADD= ${LIBMD} +LDADD= -lmd + +.include Added: projects/graid/head/sbin/geom/class/raid/geom_raid.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/graid/head/sbin/geom/class/raid/geom_raid.c Sat Dec 18 19:04:21 2010 (r216525) @@ -0,0 +1,385 @@ +/*- + * Copyright (c) 2004-2009 Pawel Jakub Dawidek + * Copyright (c) 2010 Alexander Motin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHORS 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 AUTHORS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +uint32_t lib_version = G_LIB_VERSION; +uint32_t version = G_RAID_VERSION; + +#define GRAID_BALANCE "load" +#define GRAID_SLICE "4096" +#define GRAID_PRIORITY "0" + +static void raid_main(struct gctl_req *req, unsigned flags); +#if 0 +static void raid_activate(struct gctl_req *req); +static void raid_clear(struct gctl_req *req); +static void raid_dump(struct gctl_req *req); +static void raid_label(struct gctl_req *req); +#endif + +struct g_command class_commands[] = { + { "activate", G_FLAG_VERBOSE, raid_main, G_NULL_OPTS, + "[-v] name prov ..." + }, + { "clear", G_FLAG_VERBOSE, raid_main, G_NULL_OPTS, + "[-v] prov ..." + }, + { "configure", G_FLAG_VERBOSE, NULL, + { + { 'a', "autosync", NULL, G_TYPE_BOOL }, + { 'b', "balance", "", G_TYPE_STRING }, + { 'd', "dynamic", NULL, G_TYPE_BOOL }, + { 'f', "failsync", NULL, G_TYPE_BOOL }, + { 'F', "nofailsync", NULL, G_TYPE_BOOL }, + { 'h', "hardcode", NULL, G_TYPE_BOOL }, + { 'n', "noautosync", NULL, G_TYPE_BOOL }, + { 'p', "priority", "-1", G_TYPE_NUMBER }, + { 's', "slice", "-1", G_TYPE_NUMBER }, + G_OPT_SENTINEL + }, + "[-adfFhnv] [-b balance] [-s slice] name\n" + "[-v] -p priority name prov" + }, + { "deactivate", G_FLAG_VERBOSE, NULL, G_NULL_OPTS, + "[-v] name prov ..." + }, + { "dump", 0, raid_main, G_NULL_OPTS, + "prov ..." + }, + { "forget", G_FLAG_VERBOSE, NULL, G_NULL_OPTS, + "name ..." + }, + { "label", G_FLAG_VERBOSE, raid_main, + { + { 'b', "balance", GRAID_BALANCE, G_TYPE_STRING }, + { 'F', "nofailsync", NULL, G_TYPE_BOOL }, + { 'h', "hardcode", NULL, G_TYPE_BOOL }, + { 'n', "noautosync", NULL, G_TYPE_BOOL }, + { 's', "slice", GRAID_SLICE, G_TYPE_NUMBER }, + G_OPT_SENTINEL + }, + "[-Fhnv] [-b balance] [-s slice] name prov ..." + }, + { "insert", G_FLAG_VERBOSE, NULL, + { + { 'h', "hardcode", NULL, G_TYPE_BOOL }, + { 'i', "inactive", NULL, G_TYPE_BOOL }, + { 'p', "priority", GRAID_PRIORITY, G_TYPE_NUMBER }, + G_OPT_SENTINEL + }, + "[-hiv] [-p priority] name prov ..." + }, + { "rebuild", G_FLAG_VERBOSE, NULL, G_NULL_OPTS, + "[-v] name prov ..." + }, + { "remove", G_FLAG_VERBOSE, NULL, G_NULL_OPTS, + "[-v] name prov ..." + }, + { "stop", G_FLAG_VERBOSE, NULL, + { + { 'f', "force", NULL, G_TYPE_BOOL }, + G_OPT_SENTINEL + }, + "[-fv] name ..." + }, + G_CMD_SENTINEL +}; + +static int verbose = 0; + +static void +raid_main(struct gctl_req *req, unsigned flags) +{ + const char *name; + + if ((flags & G_FLAG_VERBOSE) != 0) + verbose = 1; + + name = gctl_get_ascii(req, "verb"); + if (name == NULL) { + gctl_error(req, "No '%s' argument.", "verb"); + return; + } +#if 0 + if (strcmp(name, "label") == 0) + raid_label(req); + else if (strcmp(name, "clear") == 0) + raid_clear(req); + else if (strcmp(name, "dump") == 0) + raid_dump(req); + else if (strcmp(name, "activate") == 0) + raid_activate(req); + else +#endif + gctl_error(req, "Unknown command: %s.", name); +} + +#if 0 +static void +raid_label(struct gctl_req *req) +{ + struct g_raid_metadata md; + u_char sector[512]; + const char *str; + unsigned sectorsize; + off_t mediasize; + intmax_t val; + int error, i, nargs, bal, hardcode; + + nargs = gctl_get_int(req, "nargs"); + if (nargs < 2) { + gctl_error(req, "Too few arguments."); + return; + } + + strlcpy(md.md_magic, G_RAID_MAGIC, sizeof(md.md_magic)); + md.md_version = G_RAID_VERSION; + str = gctl_get_ascii(req, "arg0"); + strlcpy(md.md_name, str, sizeof(md.md_name)); + md.md_mid = arc4random(); + md.md_all = nargs - 1; + md.md_mflags = 0; + md.md_dflags = 0; + md.md_genid = 0; + md.md_syncid = 1; + md.md_sync_offset = 0; + val = gctl_get_intmax(req, "slice"); + md.md_slice = val; + str = gctl_get_ascii(req, "balance"); + bal = balance_id(str); + if (bal == -1) { + gctl_error(req, "Invalid balance algorithm."); + return; + } + md.md_balance = bal; + if (gctl_get_int(req, "noautosync")) + md.md_mflags |= G_RAID_DEVICE_FLAG_NOAUTOSYNC; + if (gctl_get_int(req, "nofailsync")) + md.md_mflags |= G_RAID_DEVICE_FLAG_NOFAILSYNC; + hardcode = gctl_get_int(req, "hardcode"); + + /* + * Calculate sectorsize by finding least common multiple from + * sectorsizes of every disk and find the smallest mediasize. + */ + mediasize = 0; + sectorsize = 0; + for (i = 1; i < nargs; i++) { + unsigned ssize; + off_t msize; + + str = gctl_get_ascii(req, "arg%d", i); + msize = g_get_mediasize(str); + ssize = g_get_sectorsize(str); + if (msize == 0 || ssize == 0) { + gctl_error(req, "Can't get informations about %s: %s.", + str, strerror(errno)); + return; + } + msize -= ssize; + if (mediasize == 0 || (mediasize > 0 && msize < mediasize)) + mediasize = msize; + if (sectorsize == 0) + sectorsize = ssize; + else + sectorsize = g_lcm(sectorsize, ssize); + } + md.md_mediasize = mediasize; + md.md_sectorsize = sectorsize; + md.md_mediasize -= (md.md_mediasize % md.md_sectorsize); + + /* + * Clear last sector first, to spoil all components if device exists. + */ + for (i = 1; i < nargs; i++) { + str = gctl_get_ascii(req, "arg%d", i); + error = g_metadata_clear(str, NULL); + if (error != 0) { + gctl_error(req, "Can't store metadata on %s: %s.", str, + strerror(error)); + return; + } + } + + /* + * Ok, store metadata (use disk number as priority). + */ + for (i = 1; i < nargs; i++) { + str = gctl_get_ascii(req, "arg%d", i); + md.md_did = arc4random(); + md.md_priority = i - 1; + md.md_provsize = g_get_mediasize(str); + assert(md.md_provsize != 0); + if (!hardcode) + bzero(md.md_provider, sizeof(md.md_provider)); + else { + if (strncmp(str, _PATH_DEV, sizeof(_PATH_DEV) - 1) == 0) + str += sizeof(_PATH_DEV) - 1; + strlcpy(md.md_provider, str, sizeof(md.md_provider)); + } + raid_metadata_encode(&md, sector); + error = g_metadata_store(str, sector, sizeof(sector)); + if (error != 0) { + fprintf(stderr, "Can't store metadata on %s: %s.\n", + str, strerror(error)); + gctl_error(req, "Not fully done."); + continue; + } + if (verbose) + printf("Metadata value stored on %s.\n", str); + } +} + +static void +raid_clear(struct gctl_req *req) +{ + const char *name; + int error, i, nargs; + + nargs = gctl_get_int(req, "nargs"); + if (nargs < 1) { + gctl_error(req, "Too few arguments."); + return; + } + + for (i = 0; i < nargs; i++) { + name = gctl_get_ascii(req, "arg%d", i); + error = g_metadata_clear(name, G_RAID_MAGIC); + if (error != 0) { + fprintf(stderr, "Can't clear metadata on %s: %s.\n", + name, strerror(error)); + gctl_error(req, "Not fully done."); + continue; + } + if (verbose) + printf("Metadata cleared on %s.\n", name); + } +} + +static void +raid_dump(struct gctl_req *req) +{ + struct g_raid_metadata md, tmpmd; + const char *name; + int error, i, nargs; + + nargs = gctl_get_int(req, "nargs"); + if (nargs < 1) { + gctl_error(req, "Too few arguments."); + return; + } + + for (i = 0; i < nargs; i++) { + name = gctl_get_ascii(req, "arg%d", i); + error = g_metadata_read(name, (u_char *)&tmpmd, sizeof(tmpmd), + G_RAID_MAGIC); + if (error != 0) { + fprintf(stderr, "Can't read metadata from %s: %s.\n", + name, strerror(error)); + gctl_error(req, "Not fully done."); + continue; + } + if (raid_metadata_decode((u_char *)&tmpmd, &md) != 0) { + fprintf(stderr, "MD5 hash mismatch for %s, skipping.\n", + name); + gctl_error(req, "Not fully done."); + continue; + } + printf("Metadata on %s:\n", name); + raid_metadata_dump(&md); + printf("\n"); + } +} + +static void +raid_activate(struct gctl_req *req) +{ + struct g_raid_metadata md, tmpmd; + const char *name, *path; + int error, i, nargs; + + nargs = gctl_get_int(req, "nargs"); + if (nargs < 2) { + gctl_error(req, "Too few arguments."); + return; + } + name = gctl_get_ascii(req, "arg0"); + + for (i = 1; i < nargs; i++) { + path = gctl_get_ascii(req, "arg%d", i); + error = g_metadata_read(path, (u_char *)&tmpmd, sizeof(tmpmd), + G_RAID_MAGIC); + if (error != 0) { + fprintf(stderr, "Cannot read metadata from %s: %s.\n", + path, strerror(error)); + gctl_error(req, "Not fully done."); + continue; + } + if (raid_metadata_decode((u_char *)&tmpmd, &md) != 0) { + fprintf(stderr, + "MD5 hash mismatch for provider %s, skipping.\n", + path); + gctl_error(req, "Not fully done."); + continue; + } + if (strcmp(md.md_name, name) != 0) { + fprintf(stderr, + "Provider %s is not the raid %s component.\n", + path, name); + gctl_error(req, "Not fully done."); + continue; + } + md.md_dflags &= ~G_RAID_DISK_FLAG_INACTIVE; + raid_metadata_encode(&md, (u_char *)&tmpmd); + error = g_metadata_store(path, (u_char *)&tmpmd, sizeof(tmpmd)); + if (error != 0) { + fprintf(stderr, "Cannot write metadata from %s: %s.\n", + path, strerror(error)); + gctl_error(req, "Not fully done."); + continue; + } + if (verbose) + printf("Provider %s activated.\n", path); + } +} +#endif Added: projects/graid/head/sbin/geom/class/raid/graid.8 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/graid/head/sbin/geom/class/raid/graid.8 Sat Dec 18 19:04:21 2010 (r216525) @@ -0,0 +1,263 @@ +.\" Copyright (c) 2010 Alexander Motin +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS 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 AUTHORS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd December 18, 2010 +.Dt GRAID 8 +.Os +.Sh NAME +.Nm graid +.Nd "control utility for software RAID devices" +.Sh SYNOPSIS +.Nm +.Cm label +.Op Fl Fhnv +.Op Fl b Ar balance +.Op Fl s Ar slice +.Ar name +.Ar prov ... +.Nm +.Cm clear +.Op Fl v +.Ar prov ... +.Nm +.Cm configure +.Op Fl adfFhnv +.Op Fl b Ar balance +.Op Fl s Ar slice +.Ar name +.Nm +.Cm configure +.Op Fl v +.Fl p Ar priority +.Ar name +.Ar prov +.Nm +.Cm rebuild +.Op Fl v +.Ar name +.Ar prov ... +.Nm +.Cm insert +.Op Fl hiv +.Op Fl p Ar priority +.Ar name +.Ar prov ... +.Nm +.Cm remove +.Op Fl v +.Ar name +.Ar prov ... +.Nm +.Cm activate +.Op Fl v +.Ar name +.Ar prov ... +.Nm +.Cm deactivate +.Op Fl v +.Ar name +.Ar prov ... +.Nm +.Cm forget +.Op Fl v +.Ar name ... +.Nm +.Cm stop +.Op Fl fv +.Ar name ... +.Nm +.Cm dump +.Ar prov ... +.Nm +.Cm list +.Nm +.Cm status +.Nm +.Cm load +.Nm +.Cm unload +.Sh DESCRIPTION +The +.Nm +utility is used for software RAID configurations. +After a RAID's creation, all components are detected and configured +automatically. +All operations like failure detection, stale component detection, rebuild +of stale components, etc.\& are also done automatically. +The +.Nm +utility uses on-disk metadata to store all needed information. +.Pp +The first argument to +.Nm +indicates an action to be performed: +.Bl -tag -width ".Cm deactivate" +.It Cm label +Create a mirror. +The order of components is important, because a component's priority is based on its position +(starting from 0 to 255). +The component with the biggest priority is used by the +.Cm prefer +balance algorithm +and is also used as a master component when resynchronization is needed, +e.g.\& after a power failure when the device was open for writing. +.Pp +Additional options include: +.Bl -tag -width ".Fl b Ar balance" +.It Fl b Ar balance +Specifies balance algorithm to use, one of: +.Bl -tag -width ".Cm round-robin" +.It Cm load +Read from the component with the lowest load. +This is the default balance algorithm. +.It Cm prefer +Read from the component with the biggest priority. +.It Cm round-robin +Use round-robin algorithm when choosing component to read. +.It Cm split +Split read requests, which are bigger than or equal to slice size on N pieces, +where N is the number of active components. +.El +.It Fl F +Do not synchronize after a power failure or system crash. +Assumes device is in consistent state. +.It Fl h +Hardcode providers' names in metadata. +.It Fl n +Turn off autosynchronization of stale components. +.It Fl s Ar slice +When using the +.Cm split +balance algorithm and an I/O READ request is bigger than or equal to this value, +the I/O request will be split into N pieces, where N is the number of active +components. +Defaults to 4096 bytes. +.El +.It Cm clear +Clear metadata on the given providers. +.It Cm configure +Configure the given device. +.Pp +Additional options include: +.Bl -tag -width ".Fl p Ar priority" +.It Fl a +Turn on autosynchronization of stale components. +.It Fl b Ar balance +Specifies balance algorithm to use. +.It Fl d +Do not hardcode providers' names in metadata. +.It Fl f +Synchronize device after a power failure or system crash. +.It Fl F +Do not synchronize after a power failure or system crash. +Assumes device is in consistent state. +.It Fl h +Hardcode providers' names in metadata. +.It Fl n +Turn off autosynchronization of stale components. +.It Fl p Ar priority +Specifies priority for the given component +.Ar prov . +.It Fl s Ar slice +Specifies slice size for +.Cm split +balance algorithm. +.El +.It Cm rebuild +Rebuild the given mirror components forcibly. +If autosynchronization was not turned off for the given device, this command +should be unnecessary. +.It Cm insert +Add the given component(s) to the existing mirror. +.Pp +Additional options include: +.Bl -tag -width ".Fl p Ar priority" +.It Fl h +Hardcode providers' names in metadata. +.It Fl i +Mark component(s) as inactive immediately after insertion. +.It Fl p Ar priority +Specifies priority of the given component(s). +.El +.It Cm remove +Remove the given component(s) from the mirror and clear metadata on it. +.It Cm activate +Activate the given component(s), which were marked as inactive before. +.It Cm deactivate +Mark the given component(s) as inactive, so it will not be automatically +connected to the mirror. +.It Cm forget +Forget about components which are not connected. +This command is useful when a disk has failed and cannot be reconnected, preventing the +.Cm remove +command from being used to remove it. +.It Cm stop +Stop the given mirror. +.Pp +Additional options include: +.Bl -tag -width ".Fl f" +.It Fl f +Stop the given mirror even if it is opened. +.El +.It Cm dump +Dump metadata stored on the given providers. +.It Cm list +See +.Xr geom 8 . +.It Cm status +See +.Xr geom 8 . +.It Cm load +See +.Xr geom 8 . +.It Cm unload +See +.Xr geom 8 . +.El +.Pp +Additional options include: +.Bl -tag -width ".Fl v" +.It Fl v +Be more verbose. +.El +.Sh EXIT STATUS +Exit status is 0 on success, and 1 if the command fails. +.Sh SEE ALSO +.Xr geom 4 , +.Xr dumpon 8 , +.Xr geom 8 , +.Xr mount 8 , +.Xr newfs 8 , +.Xr savecore 8 , +.Xr umount 8 , +.Xr vinum 8 +.Sh HISTORY +The +.Nm +utility appeared in +.Fx 9.0 . +.Sh AUTHORS +.An Alexander Motin Aq mav@FreeBSD.org Modified: projects/graid/head/sys/conf/NOTES ============================================================================== --- projects/graid/head/sys/conf/NOTES Sat Dec 18 16:41:11 2010 (r216524) +++ projects/graid/head/sys/conf/NOTES Sat Dec 18 19:04:21 2010 (r216525) @@ -163,6 +163,7 @@ options GEOM_PART_MBR # MBR partitioni options GEOM_PART_PC98 # PC-9800 disk partitioning options GEOM_PART_VTOC8 # SMI VTOC8 disk label options GEOM_PC98 # NEC PC9800 partitioning +options GEOM_RAID # Soft RAID functionality. options GEOM_RAID3 # RAID3 functionality. options GEOM_SHSEC # Shared secret. options GEOM_STRIPE # Disk striping. Modified: projects/graid/head/sys/conf/files ============================================================================== --- projects/graid/head/sys/conf/files Sat Dec 18 16:41:11 2010 (r216524) +++ projects/graid/head/sys/conf/files Sat Dec 18 19:04:21 2010 (r216525) @@ -2067,6 +2067,13 @@ geom/part/g_part_gpt.c optional geom_pa geom/part/g_part_mbr.c optional geom_part_mbr geom/part/g_part_pc98.c optional geom_part_pc98 geom/part/g_part_vtoc8.c optional geom_part_vtoc8 +geom/raid/g_raid.c optional geom_raid +geom/raid/g_raid_ctl.c optional geom_raid +geom/raid/g_raid_md_if.m optional geom_raid +geom/raid/g_raid_tr_if.m optional geom_raid +geom/raid/md_intel.c optional geom_raid +geom/raid/tr_raid0.c optional geom_raid +geom/raid/tr_raid1.c optional geom_raid geom/raid3/g_raid3.c optional geom_raid3 geom/raid3/g_raid3_ctl.c optional geom_raid3 geom/shsec/g_shsec.c optional geom_shsec Modified: projects/graid/head/sys/conf/options ============================================================================== --- projects/graid/head/sys/conf/options Sat Dec 18 16:41:11 2010 (r216524) +++ projects/graid/head/sys/conf/options Sat Dec 18 19:04:21 2010 (r216525) @@ -101,6 +101,7 @@ GEOM_PART_MBR opt_geom.h GEOM_PART_PC98 opt_geom.h GEOM_PART_VTOC8 opt_geom.h GEOM_PC98 opt_geom.h +GEOM_RAID opt_geom.h GEOM_RAID3 opt_geom.h GEOM_SHSEC opt_geom.h GEOM_STRIPE opt_geom.h Added: projects/graid/head/sys/geom/raid/g_raid.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/graid/head/sys/geom/raid/g_raid.c Sat Dec 18 19:04:21 2010 (r216525) @@ -0,0 +1,1656 @@ +/*- + * Copyright (c) 2010 Alexander Motin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHORS 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 AUTHORS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "g_raid_md_if.h" +#include "g_raid_tr_if.h" + +static MALLOC_DEFINE(M_RAID, "raid_data", "GEOM_RAID Data"); + +SYSCTL_DECL(_kern_geom); +SYSCTL_NODE(_kern_geom, OID_AUTO, raid, CTLFLAG_RW, 0, "GEOM_RAID stuff"); +u_int g_raid_debug = 1000; +TUNABLE_INT("kern.geom.raid.debug", &g_raid_debug); +SYSCTL_UINT(_kern_geom_raid, OID_AUTO, debug, CTLFLAG_RW, &g_raid_debug, 0, + "Debug level"); +static u_int g_raid_start_timeout = 4; +TUNABLE_INT("kern.geom.raid.start_timeout", &g_raid_start_timeout); +SYSCTL_UINT(_kern_geom_raid, OID_AUTO, timeout, CTLFLAG_RW, &g_raid_start_timeout, + 0, "Time to wait on all mirror components"); +static u_int g_raid_idletime = 5; +TUNABLE_INT("kern.geom.raid.idletime", &g_raid_idletime); +SYSCTL_UINT(_kern_geom_raid, OID_AUTO, idletime, CTLFLAG_RW, + &g_raid_idletime, 0, "Mark components as clean when idling"); +static u_int g_raid_disconnect_on_failure = 1; +TUNABLE_INT("kern.geom.raid.disconnect_on_failure", + &g_raid_disconnect_on_failure); +SYSCTL_UINT(_kern_geom_raid, OID_AUTO, disconnect_on_failure, CTLFLAG_RW, + &g_raid_disconnect_on_failure, 0, "Disconnect component on I/O failure."); + +#define MSLEEP(ident, mtx, priority, wmesg, timeout) do { \ + G_RAID_DEBUG(4, "%s: Sleeping %p.", __func__, (ident)); \ + msleep((ident), (mtx), (priority), (wmesg), (timeout)); \ + G_RAID_DEBUG(4, "%s: Woken up %p.", __func__, (ident)); \ +} while (0) + +LIST_HEAD(, g_raid_md_class) g_raid_md_classes = + LIST_HEAD_INITIALIZER(g_raid_md_classes); + +LIST_HEAD(, g_raid_tr_class) g_raid_tr_classes = + LIST_HEAD_INITIALIZER(g_raid_tr_classes); + +//static eventhandler_tag g_raid_pre_sync = NULL; + +static int g_raid_destroy_geom(struct gctl_req *req, struct g_class *mp, + struct g_geom *gp); +static g_taste_t g_raid_taste; +static void g_raid_init(struct g_class *mp); +static void g_raid_fini(struct g_class *mp); + +struct g_class g_raid_class = { + .name = G_RAID_CLASS_NAME, + .version = G_VERSION, + .ctlreq = g_raid_config, + .taste = g_raid_taste, + .destroy_geom = g_raid_destroy_geom, + .init = g_raid_init, + .fini = g_raid_fini +}; + + +static void g_raid_destroy_provider(struct g_raid_volume *vol); +static int g_raid_update_disk(struct g_raid_disk *disk, u_int state); +static int g_raid_update_subdisk(struct g_raid_subdisk *subdisk, u_int state); +static int g_raid_update_volume(struct g_raid_volume *vol, u_int state); +static void g_raid_dumpconf(struct sbuf *sb, const char *indent, + struct g_geom *gp, struct g_consumer *cp, struct g_provider *pp); +static void g_raid_start_request(struct bio *bp); +static void g_raid_disk_done(struct bio *bp); + +static const char * +g_raid_disk_state2str(int state) +{ + + switch (state) { + case G_RAID_DISK_S_NONE: + return ("NONE"); + case G_RAID_DISK_S_ACTIVE: + return ("ACTIVE"); + case G_RAID_DISK_S_SPARE: + return ("SPARE"); + case G_RAID_DISK_S_OFFLINE: + return ("OFFLINE"); + default: + return ("INVALID"); + } +} + +static const char * +g_raid_disk_event2str(int event) +{ + + switch (event) { + case G_RAID_DISK_E_DISCONNECTED: + return ("DISCONNECTED"); + default: + return ("INVALID"); + } +} + +static const char * +g_raid_subdisk_state2str(int state) +{ + + switch (state) { + case G_RAID_SUBDISK_S_NONE: + return ("NONE"); + case G_RAID_SUBDISK_S_NEW: + return ("NEW"); + case G_RAID_SUBDISK_S_ACTIVE: + return ("ACTIVE"); + case G_RAID_SUBDISK_S_STALE: + return ("STALE"); + case G_RAID_SUBDISK_S_SYNCHRONIZING: + return ("SYNCHRONIZING"); + case G_RAID_SUBDISK_S_DISCONNECTED: + return ("DISCONNECTED"); + case G_RAID_SUBDISK_S_DESTROY: + return ("DESTROY"); + default: + return ("INVALID"); + } +} + +static const char * +g_raid_subdisk_event2str(int event) +{ + + switch (event) { + case G_RAID_SUBDISK_E_NEW: + return ("NEW"); + case G_RAID_SUBDISK_E_DISCONNECTED: + return ("DISCONNECTED"); + default: + return ("INVALID"); + } +} + +static const char * +g_raid_volume_state2str(int state) +{ + + switch (state) { + case G_RAID_VOLUME_S_STARTING: + return ("STARTING"); + case G_RAID_VOLUME_S_BROKEN: + return ("BROKEN"); + case G_RAID_VOLUME_S_DEGRADED: + return ("DEGRADED"); + case G_RAID_VOLUME_S_SUBOPTIMAL: + return ("SUBOPTIMAL"); + case G_RAID_VOLUME_S_OPTIMAL: + return ("OPTIMAL"); + case G_RAID_VOLUME_S_UNSUPPORTED: + return ("UNSUPPORTED"); + case G_RAID_VOLUME_S_STOPPED: + return ("STOPPED"); + default: + return ("INVALID"); + } +} + +static const char * +g_raid_volume_event2str(int event) +{ + + switch (event) { + case G_RAID_VOLUME_E_UP: + return ("UP"); + case G_RAID_VOLUME_E_DOWN: + return ("DOWN"); + case G_RAID_VOLUME_E_START: + return ("START"); + default: + return ("INVALID"); + } +} + +static const char * +g_raid_volume_level2str(int level, int qual) +{ + + switch (level) { + case G_RAID_VOLUME_RL_RAID0: + return ("RAID0"); + case G_RAID_VOLUME_RL_RAID1: + return ("RAID1"); + case G_RAID_VOLUME_RL_RAID3: + return ("RAID3"); + case G_RAID_VOLUME_RL_RAID4: + return ("RAID4"); + case G_RAID_VOLUME_RL_RAID5: + return ("RAID5"); + case G_RAID_VOLUME_RL_RAID6: + return ("RAID6"); + case G_RAID_VOLUME_RL_RAID10: + return ("RAID10"); + case G_RAID_VOLUME_RL_RAID1E: + return ("RAID1E"); + case G_RAID_VOLUME_RL_SINGLE: + return ("SINGLE"); + case G_RAID_VOLUME_RL_CONCAT: + return ("CONCAT"); + case G_RAID_VOLUME_RL_RAID5E: + return ("RAID5E"); + case G_RAID_VOLUME_RL_RAID5EE: + return ("RAID5EE"); + default: + return ("UNKNOWN"); + } +} + +static const char * +g_raid_get_diskname(struct g_raid_disk *disk) +{ + + if (disk->d_consumer == NULL || disk->d_consumer->provider == NULL) + return ("[unknown]"); + return (disk->d_consumer->provider->name); +} + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-projects@FreeBSD.ORG Sat Dec 18 20:14:48 2010 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 23F17106567A; Sat, 18 Dec 2010 20:14:48 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 102008FC16; Sat, 18 Dec 2010 20:14:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBIKElIm027773; Sat, 18 Dec 2010 20:14:47 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBIKElXA027764; Sat, 18 Dec 2010 20:14:47 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201012182014.oBIKElXA027764@svn.freebsd.org> From: Alexander Motin Date: Sat, 18 Dec 2010 20:14:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216534 - in projects/graid/8: . contrib/bsnmp/snmpd contrib/top contrib/xz etc/mtree etc/periodic/daily gnu/usr.bin include lib/libusb release/picobsd/floppy.tree/sbin sbin/geom/class ... X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Dec 2010 20:14:48 -0000 Author: mav Date: Sat Dec 18 20:14:47 2010 New Revision: 216534 URL: http://svn.freebsd.org/changeset/base/216534 Log: MFH r216525: Initial commit of the geom_raid module, intended to replace ataraid(4) at GEOM level. At this moment code is able to read and write existing RAID0 and RAID1 Intel MatrixRAID volumes, but not yet able to create volumes or do any error handling/recovery/rebuilding/... Basic design description can be found here: http://people.freebsd.org/~mav/graid_design.h Sponsored by: Cisco Systems, Inc. Added: projects/graid/8/sbin/geom/class/raid/ - copied from r216525, projects/graid/head/sbin/geom/class/raid/ projects/graid/8/sys/geom/raid/ - copied from r216525, projects/graid/head/sys/geom/raid/ projects/graid/8/sys/modules/geom/geom_raid/ - copied from r216525, projects/graid/head/sys/modules/geom/geom_raid/ Modified: projects/graid/8/etc/mtree/BSD.include.dist projects/graid/8/include/Makefile projects/graid/8/sbin/geom/class/Makefile projects/graid/8/sbin/geom/class/raid/geom_raid.c projects/graid/8/sys/conf/NOTES projects/graid/8/sys/conf/files projects/graid/8/sys/conf/options projects/graid/8/sys/modules/geom/Makefile Directory Properties: projects/graid/8/ (props changed) projects/graid/8/Makefile (props changed) projects/graid/8/Makefile.inc1 (props changed) projects/graid/8/ObsoleteFiles.inc (props changed) projects/graid/8/UPDATING (props changed) projects/graid/8/bin/ (props changed) projects/graid/8/bin/chio/ (props changed) projects/graid/8/bin/chmod/ (props changed) projects/graid/8/bin/cp/ (props changed) projects/graid/8/bin/csh/ (props changed) projects/graid/8/bin/date/ (props changed) projects/graid/8/bin/echo/ (props changed) projects/graid/8/bin/expr/ (props changed) projects/graid/8/bin/getfacl/ (props changed) projects/graid/8/bin/kill/ (props changed) projects/graid/8/bin/ln/ (props changed) projects/graid/8/bin/ls/ (props changed) projects/graid/8/bin/mv/ (props changed) projects/graid/8/bin/pax/ (props changed) projects/graid/8/bin/pkill/ (props changed) projects/graid/8/bin/ps/ (props changed) projects/graid/8/bin/pwait/ (props changed) projects/graid/8/bin/setfacl/ (props changed) projects/graid/8/bin/sh/ (props changed) projects/graid/8/bin/sleep/ (props changed) projects/graid/8/bin/test/ (props changed) projects/graid/8/cddl/compat/opensolaris/ (props changed) projects/graid/8/cddl/contrib/opensolaris/ (props changed) projects/graid/8/cddl/lib/ (props changed) projects/graid/8/cddl/lib/libnvpair/ (props changed) projects/graid/8/cddl/lib/libzpool/ (props changed) projects/graid/8/cddl/usr.bin/ (props changed) projects/graid/8/cddl/usr.sbin/ (props changed) projects/graid/8/contrib/ (props changed) projects/graid/8/contrib/bind9/ (props changed) projects/graid/8/contrib/binutils/ (props changed) projects/graid/8/contrib/bsnmp/ (props changed) projects/graid/8/contrib/bsnmp/snmpd/bsnmpd.1 (props changed) projects/graid/8/contrib/bzip2/ (props changed) projects/graid/8/contrib/com_err/ (props changed) projects/graid/8/contrib/csup/ (props changed) projects/graid/8/contrib/ee/ (props changed) projects/graid/8/contrib/expat/ (props changed) projects/graid/8/contrib/file/ (props changed) projects/graid/8/contrib/gcc/ (props changed) projects/graid/8/contrib/gdb/ (props changed) projects/graid/8/contrib/gdtoa/ (props changed) projects/graid/8/contrib/groff/ (props changed) projects/graid/8/contrib/ipfilter/ (props changed) projects/graid/8/contrib/less/ (props changed) projects/graid/8/contrib/libpcap/ (props changed) projects/graid/8/contrib/ncurses/ (props changed) projects/graid/8/contrib/netcat/ (props changed) projects/graid/8/contrib/ntp/ (props changed) projects/graid/8/contrib/nvi/ (props changed) projects/graid/8/contrib/one-true-awk/ (props changed) projects/graid/8/contrib/openbsm/ (props changed) projects/graid/8/contrib/openpam/ (props changed) projects/graid/8/contrib/pf/ (props changed) projects/graid/8/contrib/sendmail/ (props changed) projects/graid/8/contrib/tcp_wrappers/ (props changed) projects/graid/8/contrib/tcpdump/ (props changed) projects/graid/8/contrib/tcsh/ (props changed) projects/graid/8/contrib/telnet/ (props changed) projects/graid/8/contrib/top/ (props changed) projects/graid/8/contrib/top/install-sh (props changed) projects/graid/8/contrib/traceroute/ (props changed) projects/graid/8/contrib/wpa/ (props changed) projects/graid/8/contrib/xz/ (props changed) projects/graid/8/contrib/xz/AUTHORS (props changed) projects/graid/8/contrib/xz/COPYING (props changed) projects/graid/8/contrib/xz/ChangeLog (props changed) projects/graid/8/contrib/xz/FREEBSD-Xlist (props changed) projects/graid/8/contrib/xz/FREEBSD-upgrade (props changed) projects/graid/8/contrib/xz/README (props changed) projects/graid/8/contrib/xz/THANKS (props changed) projects/graid/8/contrib/xz/TODO (props changed) projects/graid/8/contrib/xz/po/ (props changed) projects/graid/8/contrib/xz/src/ (props changed) projects/graid/8/crypto/heimdal/ (props changed) projects/graid/8/crypto/openssh/ (props changed) projects/graid/8/crypto/openssl/ (props changed) projects/graid/8/etc/ (props changed) projects/graid/8/etc/periodic/daily/ (props changed) projects/graid/8/etc/periodic/daily/800.scrub-zfs (props changed) projects/graid/8/etc/periodic/security/ (props changed) projects/graid/8/games/factor/ (props changed) projects/graid/8/games/fortune/ (props changed) projects/graid/8/games/grdc/ (props changed) projects/graid/8/games/pom/ (props changed) projects/graid/8/gnu/lib/csu/ (props changed) projects/graid/8/gnu/lib/libgcc/ (props changed) projects/graid/8/gnu/lib/libstdc++/ (props changed) projects/graid/8/gnu/usr.bin/ (props changed) projects/graid/8/gnu/usr.bin/Makefile (props changed) projects/graid/8/gnu/usr.bin/dialog/ (props changed) projects/graid/8/gnu/usr.bin/gdb/ (props changed) projects/graid/8/gnu/usr.bin/gdb/kgdb/ (props changed) projects/graid/8/gnu/usr.bin/groff/ (props changed) projects/graid/8/gnu/usr.bin/patch/ (props changed) projects/graid/8/include/ (props changed) projects/graid/8/kerberos5/lib/libgssapi_krb5/ (props changed) projects/graid/8/kerberos5/lib/libgssapi_spnego/ (props changed) projects/graid/8/kerberos5/usr.bin/kdestroy/ (props changed) projects/graid/8/kerberos5/usr.bin/kpasswd/ (props changed) projects/graid/8/lib/ (props changed) projects/graid/8/lib/bind/ (props changed) projects/graid/8/lib/csu/ (props changed) projects/graid/8/lib/libarchive/ (props changed) projects/graid/8/lib/libbluetooth/ (props changed) projects/graid/8/lib/libc/ (props changed) projects/graid/8/lib/libc/locale/ (props changed) projects/graid/8/lib/libc/stdtime/ (props changed) projects/graid/8/lib/libc/sys/ (props changed) projects/graid/8/lib/libc_r/ (props changed) projects/graid/8/lib/libcam/ (props changed) projects/graid/8/lib/libcompat/ (props changed) projects/graid/8/lib/libdevinfo/ (props changed) projects/graid/8/lib/libdisk/ (props changed) projects/graid/8/lib/libedit/ (props changed) projects/graid/8/lib/libelf/ (props changed) projects/graid/8/lib/libexpat/ (props changed) projects/graid/8/lib/libfetch/ (props changed) projects/graid/8/lib/libgeom/ (props changed) projects/graid/8/lib/libgpib/ (props changed) projects/graid/8/lib/libgssapi/ (props changed) projects/graid/8/lib/libjail/ (props changed) projects/graid/8/lib/libkse/ (props changed) projects/graid/8/lib/libkvm/ (props changed) projects/graid/8/lib/liblzma/ (props changed) projects/graid/8/lib/libmagic/ (props changed) projects/graid/8/lib/libmemstat/ (props changed) projects/graid/8/lib/libpam/ (props changed) projects/graid/8/lib/libpmc/ (props changed) projects/graid/8/lib/libproc/ (props changed) projects/graid/8/lib/libradius/ (props changed) projects/graid/8/lib/librpcsec_gss/ (props changed) projects/graid/8/lib/librtld_db/ (props changed) projects/graid/8/lib/libsm/ (props changed) projects/graid/8/lib/libstand/ (props changed) projects/graid/8/lib/libtacplus/ (props changed) projects/graid/8/lib/libthr/ (props changed) projects/graid/8/lib/libthread_db/ (props changed) projects/graid/8/lib/libufs/ (props changed) projects/graid/8/lib/libugidfw/ (props changed) projects/graid/8/lib/libusb/ (props changed) projects/graid/8/lib/libusb/usb.h (props changed) projects/graid/8/lib/libusbhid/ (props changed) projects/graid/8/lib/libutil/ (props changed) projects/graid/8/lib/libz/ (props changed) projects/graid/8/lib/libz/contrib/ (props changed) projects/graid/8/lib/msun/ (props changed) projects/graid/8/libexec/ (props changed) projects/graid/8/libexec/ftpd/ (props changed) projects/graid/8/libexec/rtld-elf/ (props changed) projects/graid/8/libexec/tftpd/ (props changed) projects/graid/8/release/ (props changed) projects/graid/8/release/doc/en_US.ISO8859-1/hardware/ (props changed) projects/graid/8/release/picobsd/ (props changed) projects/graid/8/release/picobsd/floppy.tree/sbin/ (props changed) projects/graid/8/release/picobsd/floppy.tree/sbin/dhclient-script (props changed) projects/graid/8/release/picobsd/qemu/ (props changed) projects/graid/8/release/picobsd/tinyware/login/ (props changed) projects/graid/8/release/powerpc/ (props changed) projects/graid/8/sbin/ (props changed) projects/graid/8/sbin/atacontrol/ (props changed) projects/graid/8/sbin/bsdlabel/ (props changed) projects/graid/8/sbin/camcontrol/ (props changed) projects/graid/8/sbin/ddb/ (props changed) projects/graid/8/sbin/devd/ (props changed) projects/graid/8/sbin/devfs/ (props changed) projects/graid/8/sbin/dhclient/ (props changed) projects/graid/8/sbin/dump/ (props changed) projects/graid/8/sbin/dumpfs/ (props changed) projects/graid/8/sbin/fdisk/ (props changed) projects/graid/8/sbin/fsck/ (props changed) projects/graid/8/sbin/fsck_ffs/ (props changed) projects/graid/8/sbin/fsck_msdosfs/ (props changed) projects/graid/8/sbin/fsirand/ (props changed) projects/graid/8/sbin/geom/ (props changed) projects/graid/8/sbin/geom/class/multipath/ (props changed) projects/graid/8/sbin/geom/class/part/ (props changed) projects/graid/8/sbin/geom/class/sched/gsched.8 (props changed) projects/graid/8/sbin/geom/class/stripe/ (props changed) projects/graid/8/sbin/ggate/ (props changed) projects/graid/8/sbin/growfs/ (props changed) projects/graid/8/sbin/hastctl/ (props changed) projects/graid/8/sbin/hastd/ (props changed) projects/graid/8/sbin/ifconfig/ (props changed) projects/graid/8/sbin/ipfw/ (props changed) projects/graid/8/sbin/iscontrol/ (props changed) projects/graid/8/sbin/kldload/ (props changed) projects/graid/8/sbin/kldstat/ (props changed) projects/graid/8/sbin/mdconfig/ (props changed) projects/graid/8/sbin/mksnap_ffs/ (props changed) projects/graid/8/sbin/mount/ (props changed) projects/graid/8/sbin/mount_cd9660/ (props changed) projects/graid/8/sbin/mount_msdosfs/ (props changed) projects/graid/8/sbin/mount_nfs/ (props changed) projects/graid/8/sbin/natd/ (props changed) projects/graid/8/sbin/newfs/ (props changed) projects/graid/8/sbin/newfs_msdos/ (props changed) projects/graid/8/sbin/ping6/ (props changed) projects/graid/8/sbin/reboot/ (props changed) projects/graid/8/sbin/restore/ (props changed) projects/graid/8/sbin/routed/ (props changed) projects/graid/8/sbin/setkey/ (props changed) projects/graid/8/sbin/spppcontrol/ (props changed) projects/graid/8/sbin/sysctl/ (props changed) projects/graid/8/sbin/tunefs/ (props changed) projects/graid/8/sbin/umount/ (props changed) projects/graid/8/secure/ (props changed) projects/graid/8/secure/lib/libcrypto/ (props changed) projects/graid/8/secure/lib/libssl/ (props changed) projects/graid/8/secure/usr.bin/bdes/ (props changed) projects/graid/8/secure/usr.bin/openssl/ (props changed) projects/graid/8/share/dict/ (props changed) projects/graid/8/share/doc/papers/jail/ (props changed) projects/graid/8/share/doc/smm/01.setup/ (props changed) projects/graid/8/share/examples/ (props changed) projects/graid/8/share/examples/etc/ (props changed) projects/graid/8/share/examples/kld/syscall/ (props changed) projects/graid/8/share/man/ (props changed) projects/graid/8/share/man/man1/ (props changed) projects/graid/8/share/man/man3/ (props changed) projects/graid/8/share/man/man4/ (props changed) projects/graid/8/share/man/man5/ (props changed) projects/graid/8/share/man/man7/ (props changed) projects/graid/8/share/man/man8/ (props changed) projects/graid/8/share/man/man9/ (props changed) projects/graid/8/share/misc/ (props changed) projects/graid/8/share/mk/ (props changed) projects/graid/8/share/syscons/ (props changed) projects/graid/8/share/termcap/ (props changed) projects/graid/8/share/timedef/ (props changed) projects/graid/8/share/zoneinfo/ (props changed) projects/graid/8/sys/ (props changed) projects/graid/8/sys/amd64/include/xen/ (props changed) projects/graid/8/sys/cddl/contrib/opensolaris/ (props changed) projects/graid/8/sys/contrib/dev/acpica/ (props changed) projects/graid/8/sys/contrib/pf/ (props changed) projects/graid/8/tools/ (props changed) projects/graid/8/tools/build/mk/ (props changed) projects/graid/8/tools/build/options/ (props changed) projects/graid/8/tools/debugscripts/ (props changed) projects/graid/8/tools/kerneldoc/subsys/ (props changed) projects/graid/8/tools/regression/acltools/ (props changed) projects/graid/8/tools/regression/aio/aiotest/ (props changed) projects/graid/8/tools/regression/bin/ (props changed) projects/graid/8/tools/regression/bin/sh/ (props changed) projects/graid/8/tools/regression/fifo/ (props changed) projects/graid/8/tools/regression/geom/ (props changed) projects/graid/8/tools/regression/lib/libc/ (props changed) projects/graid/8/tools/regression/lib/msun/test-conj.t (props changed) projects/graid/8/tools/regression/mqueue/mqtest1/ (props changed) projects/graid/8/tools/regression/mqueue/mqtest2/ (props changed) projects/graid/8/tools/regression/mqueue/mqtest3/ (props changed) projects/graid/8/tools/regression/mqueue/mqtest4/ (props changed) projects/graid/8/tools/regression/mqueue/mqtest5/ (props changed) projects/graid/8/tools/regression/poll/ (props changed) projects/graid/8/tools/regression/posixsem/ (props changed) projects/graid/8/tools/regression/priv/ (props changed) projects/graid/8/tools/regression/sockets/unix_gc/ (props changed) projects/graid/8/tools/regression/usr.bin/ (props changed) projects/graid/8/tools/regression/usr.bin/pkill/pgrep-_g.t (props changed) projects/graid/8/tools/regression/usr.bin/pkill/pgrep-_s.t (props changed) projects/graid/8/tools/regression/usr.bin/pkill/pkill-_g.t (props changed) projects/graid/8/tools/regression/usr.bin/sed/ (props changed) projects/graid/8/tools/regression/usr.bin/tr/ (props changed) projects/graid/8/tools/test/ (props changed) projects/graid/8/tools/tools/ (props changed) projects/graid/8/tools/tools/ath/ (props changed) projects/graid/8/tools/tools/ath/common/dumpregs.h (props changed) projects/graid/8/tools/tools/ath/common/dumpregs_5210.c (props changed) projects/graid/8/tools/tools/ath/common/dumpregs_5211.c (props changed) projects/graid/8/tools/tools/ath/common/dumpregs_5212.c (props changed) projects/graid/8/tools/tools/ath/common/dumpregs_5416.c (props changed) projects/graid/8/tools/tools/nanobsd/ (props changed) projects/graid/8/tools/tools/netrate/ (props changed) projects/graid/8/tools/tools/netrate/tcpp/ (props changed) projects/graid/8/tools/tools/termcap/termcap.pl (props changed) projects/graid/8/tools/tools/umastat/ (props changed) projects/graid/8/tools/tools/vimage/ (props changed) projects/graid/8/usr.bin/ (props changed) projects/graid/8/usr.bin/apply/ (props changed) projects/graid/8/usr.bin/ar/ (props changed) projects/graid/8/usr.bin/awk/ (props changed) projects/graid/8/usr.bin/biff/ (props changed) projects/graid/8/usr.bin/c89/ (props changed) projects/graid/8/usr.bin/c99/ (props changed) projects/graid/8/usr.bin/calendar/ (props changed) projects/graid/8/usr.bin/catman/ (props changed) projects/graid/8/usr.bin/column/ (props changed) projects/graid/8/usr.bin/comm/ (props changed) projects/graid/8/usr.bin/cpio/ (props changed) projects/graid/8/usr.bin/csup/ (props changed) projects/graid/8/usr.bin/du/ (props changed) projects/graid/8/usr.bin/ee/ (props changed) projects/graid/8/usr.bin/enigma/ (props changed) projects/graid/8/usr.bin/fetch/ (props changed) projects/graid/8/usr.bin/find/ (props changed) projects/graid/8/usr.bin/finger/ (props changed) projects/graid/8/usr.bin/fold/ (props changed) projects/graid/8/usr.bin/fstat/ (props changed) projects/graid/8/usr.bin/gcore/ (props changed) projects/graid/8/usr.bin/getopt/ (props changed) projects/graid/8/usr.bin/gzip/ (props changed) projects/graid/8/usr.bin/hexdump/ (props changed) projects/graid/8/usr.bin/indent/ (props changed) projects/graid/8/usr.bin/jot/ (props changed) projects/graid/8/usr.bin/kdump/ (props changed) projects/graid/8/usr.bin/killall/ (props changed) projects/graid/8/usr.bin/ktrace/ (props changed) projects/graid/8/usr.bin/ldd/ (props changed) projects/graid/8/usr.bin/lex/ (props changed) projects/graid/8/usr.bin/locale/ (props changed) projects/graid/8/usr.bin/locate/ (props changed) projects/graid/8/usr.bin/lockf/ (props changed) projects/graid/8/usr.bin/look/ (props changed) projects/graid/8/usr.bin/mail/ (props changed) projects/graid/8/usr.bin/make/ (props changed) projects/graid/8/usr.bin/makewhatis/ (props changed) projects/graid/8/usr.bin/minigzip/ (props changed) projects/graid/8/usr.bin/ncal/ (props changed) projects/graid/8/usr.bin/netstat/ (props changed) projects/graid/8/usr.bin/pathchk/ (props changed) projects/graid/8/usr.bin/perror/ (props changed) projects/graid/8/usr.bin/procstat/ (props changed) projects/graid/8/usr.bin/rpcgen/ (props changed) projects/graid/8/usr.bin/ruptime/ (props changed) projects/graid/8/usr.bin/script/ (props changed) projects/graid/8/usr.bin/sed/ (props changed) projects/graid/8/usr.bin/sockstat/ (props changed) projects/graid/8/usr.bin/split/ (props changed) projects/graid/8/usr.bin/stat/ (props changed) projects/graid/8/usr.bin/systat/ (props changed) projects/graid/8/usr.bin/tar/ (props changed) projects/graid/8/usr.bin/tftp/ (props changed) projects/graid/8/usr.bin/top/ (props changed) projects/graid/8/usr.bin/touch/ (props changed) projects/graid/8/usr.bin/tr/ (props changed) projects/graid/8/usr.bin/truss/ (props changed) projects/graid/8/usr.bin/uname/ (props changed) projects/graid/8/usr.bin/unifdef/ (props changed) projects/graid/8/usr.bin/uniq/ (props changed) projects/graid/8/usr.bin/unzip/ (props changed) projects/graid/8/usr.bin/uudecode/ (props changed) projects/graid/8/usr.bin/vmstat/ (props changed) projects/graid/8/usr.bin/w/ (props changed) projects/graid/8/usr.bin/whois/ (props changed) projects/graid/8/usr.bin/xinstall/ (props changed) projects/graid/8/usr.bin/xlint/ (props changed) projects/graid/8/usr.bin/xz/ (props changed) projects/graid/8/usr.bin/yacc/ (props changed) projects/graid/8/usr.sbin/ (props changed) projects/graid/8/usr.sbin/Makefile (props changed) projects/graid/8/usr.sbin/acpi/ (props changed) projects/graid/8/usr.sbin/arp/ (props changed) projects/graid/8/usr.sbin/asf/ (props changed) projects/graid/8/usr.sbin/bluetooth/ (props changed) projects/graid/8/usr.sbin/bluetooth/bthidcontrol/ (props changed) projects/graid/8/usr.sbin/bluetooth/bthidd/ (props changed) projects/graid/8/usr.sbin/boot0cfg/ (props changed) projects/graid/8/usr.sbin/bsnmpd/ (props changed) projects/graid/8/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_processor_tbl.c (props changed) projects/graid/8/usr.sbin/burncd/ (props changed) projects/graid/8/usr.sbin/cdcontrol/ (props changed) projects/graid/8/usr.sbin/chown/ (props changed) projects/graid/8/usr.sbin/config/ (props changed) projects/graid/8/usr.sbin/config/SMM.doc/ (props changed) projects/graid/8/usr.sbin/cpucontrol/ (props changed) projects/graid/8/usr.sbin/crashinfo/ (props changed) projects/graid/8/usr.sbin/cron/ (props changed) projects/graid/8/usr.sbin/crunch/examples/ (props changed) projects/graid/8/usr.sbin/ctm/ (props changed) projects/graid/8/usr.sbin/cxgbtool/ (props changed) projects/graid/8/usr.sbin/devinfo/ (props changed) projects/graid/8/usr.sbin/diskinfo/ (props changed) projects/graid/8/usr.sbin/dumpcis/cardinfo.h (props changed) projects/graid/8/usr.sbin/dumpcis/cis.h (props changed) projects/graid/8/usr.sbin/faithd/ (props changed) projects/graid/8/usr.sbin/fdcontrol/ (props changed) projects/graid/8/usr.sbin/fdformat/ (props changed) projects/graid/8/usr.sbin/fdread/ (props changed) projects/graid/8/usr.sbin/fdwrite/ (props changed) projects/graid/8/usr.sbin/fifolog/ (props changed) projects/graid/8/usr.sbin/flowctl/ (props changed) projects/graid/8/usr.sbin/freebsd-update/ (props changed) projects/graid/8/usr.sbin/i2c/ (props changed) projects/graid/8/usr.sbin/inetd/ (props changed) projects/graid/8/usr.sbin/iostat/ (props changed) projects/graid/8/usr.sbin/jail/ (props changed) projects/graid/8/usr.sbin/jls/ (props changed) projects/graid/8/usr.sbin/lpr/ (props changed) projects/graid/8/usr.sbin/mailwrapper/ (props changed) projects/graid/8/usr.sbin/makefs/ffs/ffs_bswap.c (props changed) projects/graid/8/usr.sbin/makefs/ffs/ffs_subr.c (props changed) projects/graid/8/usr.sbin/makefs/ffs/ufs_bswap.h (props changed) projects/graid/8/usr.sbin/makefs/getid.c (props changed) projects/graid/8/usr.sbin/mergemaster/ (props changed) projects/graid/8/usr.sbin/mfiutil/ (props changed) projects/graid/8/usr.sbin/mountd/ (props changed) projects/graid/8/usr.sbin/moused/ (props changed) projects/graid/8/usr.sbin/mptutil/ (props changed) projects/graid/8/usr.sbin/mtest/ (props changed) projects/graid/8/usr.sbin/mtree/ (props changed) projects/graid/8/usr.sbin/named/ (props changed) projects/graid/8/usr.sbin/ndp/ (props changed) projects/graid/8/usr.sbin/newsyslog/ (props changed) projects/graid/8/usr.sbin/nfsdumpstate/ (props changed) projects/graid/8/usr.sbin/ntp/ (props changed) projects/graid/8/usr.sbin/pciconf/ (props changed) projects/graid/8/usr.sbin/periodic/ (props changed) projects/graid/8/usr.sbin/pkg_install/ (props changed) projects/graid/8/usr.sbin/pmcannotate/ (props changed) projects/graid/8/usr.sbin/pmccontrol/ (props changed) projects/graid/8/usr.sbin/pmcstat/ (props changed) projects/graid/8/usr.sbin/powerd/ (props changed) projects/graid/8/usr.sbin/ppp/ (props changed) projects/graid/8/usr.sbin/pppctl/ (props changed) projects/graid/8/usr.sbin/pstat/ (props changed) projects/graid/8/usr.sbin/rpc.lockd/ (props changed) projects/graid/8/usr.sbin/rpc.umntall/ (props changed) projects/graid/8/usr.sbin/rtadvd/ (props changed) projects/graid/8/usr.sbin/rtsold/ (props changed) projects/graid/8/usr.sbin/sade/ (props changed) projects/graid/8/usr.sbin/service/ (props changed) projects/graid/8/usr.sbin/services_mkdb/ (props changed) projects/graid/8/usr.sbin/setfmac/ (props changed) projects/graid/8/usr.sbin/setpmac/ (props changed) projects/graid/8/usr.sbin/smbmsg/ (props changed) projects/graid/8/usr.sbin/sysinstall/ (props changed) projects/graid/8/usr.sbin/syslogd/ (props changed) projects/graid/8/usr.sbin/traceroute/ (props changed) projects/graid/8/usr.sbin/traceroute6/ (props changed) projects/graid/8/usr.sbin/uathload/ (props changed) projects/graid/8/usr.sbin/ugidfw/ (props changed) projects/graid/8/usr.sbin/uhsoctl/ (props changed) projects/graid/8/usr.sbin/usbconfig/ (props changed) projects/graid/8/usr.sbin/vidcontrol/ (props changed) projects/graid/8/usr.sbin/watchdogd/ (props changed) projects/graid/8/usr.sbin/wpa/ (props changed) projects/graid/8/usr.sbin/ypserv/ (props changed) projects/graid/8/usr.sbin/zic/ (props changed) Modified: projects/graid/8/etc/mtree/BSD.include.dist ============================================================================== --- projects/graid/8/etc/mtree/BSD.include.dist Sat Dec 18 20:13:42 2010 (r216533) +++ projects/graid/8/etc/mtree/BSD.include.dist Sat Dec 18 20:14:47 2010 (r216534) @@ -178,6 +178,8 @@ .. nop .. + raid + .. raid3 .. shsec Modified: projects/graid/8/include/Makefile ============================================================================== --- projects/graid/8/include/Makefile Sat Dec 18 20:13:42 2010 (r216533) +++ projects/graid/8/include/Makefile Sat Dec 18 20:14:47 2010 (r216534) @@ -47,7 +47,7 @@ LSUBDIRS= cam/ata cam/scsi \ ${_fs_nwfs} fs/portalfs fs/procfs fs/smbfs fs/udf fs/unionfs \ geom/cache geom/concat geom/eli geom/gate geom/journal geom/label \ geom/mirror geom/multipath geom/nop \ - geom/raid3 geom/shsec geom/stripe geom/virstor \ + geom/raid geom/raid3 geom/shsec geom/stripe geom/virstor \ netgraph/atm netgraph/netflow \ security/audit \ security/mac_biba security/mac_bsdextended security/mac_lomac \ Modified: projects/graid/8/sbin/geom/class/Makefile ============================================================================== --- projects/graid/8/sbin/geom/class/Makefile Sat Dec 18 20:13:42 2010 (r216533) +++ projects/graid/8/sbin/geom/class/Makefile Sat Dec 18 20:14:47 2010 (r216534) @@ -13,6 +13,7 @@ SUBDIR+=mirror SUBDIR+=multipath SUBDIR+=nop SUBDIR+=part +SUBDIR+=raid SUBDIR+=raid3 SUBDIR+=sched SUBDIR+=shsec Modified: projects/graid/8/sbin/geom/class/raid/geom_raid.c ============================================================================== --- projects/graid/head/sbin/geom/class/raid/geom_raid.c Sat Dec 18 19:04:21 2010 (r216525) +++ projects/graid/8/sbin/geom/class/raid/geom_raid.c Sat Dec 18 20:14:47 2010 (r216534) @@ -49,8 +49,8 @@ uint32_t version = G_RAID_VERSION; #define GRAID_SLICE "4096" #define GRAID_PRIORITY "0" -static void raid_main(struct gctl_req *req, unsigned flags); #if 0 +static void raid_main(struct gctl_req *req, unsigned flags); static void raid_activate(struct gctl_req *req); static void raid_clear(struct gctl_req *req); static void raid_dump(struct gctl_req *req); @@ -58,6 +58,7 @@ static void raid_label(struct gctl_req * #endif struct g_command class_commands[] = { +/* { "activate", G_FLAG_VERBOSE, raid_main, G_NULL_OPTS, "[-v] name prov ..." }, @@ -122,9 +123,11 @@ struct g_command class_commands[] = { }, "[-fv] name ..." }, +*/ G_CMD_SENTINEL }; +#if 0 static int verbose = 0; static void @@ -154,7 +157,6 @@ raid_main(struct gctl_req *req, unsigned gctl_error(req, "Unknown command: %s.", name); } -#if 0 static void raid_label(struct gctl_req *req) { Modified: projects/graid/8/sys/conf/NOTES ============================================================================== --- projects/graid/8/sys/conf/NOTES Sat Dec 18 20:13:42 2010 (r216533) +++ projects/graid/8/sys/conf/NOTES Sat Dec 18 20:14:47 2010 (r216534) @@ -154,6 +154,7 @@ options GEOM_PART_MBR # MBR partitioni options GEOM_PART_PC98 # PC-9800 disk partitioning options GEOM_PART_VTOC8 # SMI VTOC8 disk label options GEOM_PC98 # NEC PC9800 partitioning +options GEOM_RAID # Soft RAID functionality. options GEOM_RAID3 # RAID3 functionality. options GEOM_SHSEC # Shared secret. options GEOM_STRIPE # Disk striping. Modified: projects/graid/8/sys/conf/files ============================================================================== --- projects/graid/8/sys/conf/files Sat Dec 18 20:13:42 2010 (r216533) +++ projects/graid/8/sys/conf/files Sat Dec 18 20:14:47 2010 (r216534) @@ -2014,6 +2014,13 @@ geom/part/g_part_gpt.c optional geom_pa geom/part/g_part_mbr.c optional geom_part_mbr geom/part/g_part_pc98.c optional geom_part_pc98 geom/part/g_part_vtoc8.c optional geom_part_vtoc8 +geom/raid/g_raid.c optional geom_raid +geom/raid/g_raid_ctl.c optional geom_raid +geom/raid/g_raid_md_if.m optional geom_raid +geom/raid/g_raid_tr_if.m optional geom_raid +geom/raid/md_intel.c optional geom_raid +geom/raid/tr_raid0.c optional geom_raid +geom/raid/tr_raid1.c optional geom_raid geom/raid3/g_raid3.c optional geom_raid3 geom/raid3/g_raid3_ctl.c optional geom_raid3 geom/shsec/g_shsec.c optional geom_shsec Modified: projects/graid/8/sys/conf/options ============================================================================== --- projects/graid/8/sys/conf/options Sat Dec 18 20:13:42 2010 (r216533) +++ projects/graid/8/sys/conf/options Sat Dec 18 20:14:47 2010 (r216534) @@ -100,6 +100,7 @@ GEOM_PART_MBR opt_geom.h GEOM_PART_PC98 opt_geom.h GEOM_PART_VTOC8 opt_geom.h GEOM_PC98 opt_geom.h +GEOM_RAID opt_geom.h GEOM_RAID3 opt_geom.h GEOM_SHSEC opt_geom.h GEOM_STRIPE opt_geom.h Modified: projects/graid/8/sys/modules/geom/Makefile ============================================================================== --- projects/graid/8/sys/modules/geom/Makefile Sat Dec 18 20:13:42 2010 (r216533) +++ projects/graid/8/sys/modules/geom/Makefile Sat Dec 18 20:14:47 2010 (r216534) @@ -17,6 +17,7 @@ SUBDIR= geom_bde \ geom_nop \ geom_part \ geom_pc98 \ + geom_raid \ geom_raid3 \ geom_sched \ geom_shsec \ From owner-svn-src-projects@FreeBSD.ORG Sat Dec 18 20:56:49 2010 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E8B5D106566B; Sat, 18 Dec 2010 20:56:49 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D4F0A8FC0A; Sat, 18 Dec 2010 20:56:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBIKun3e029774; Sat, 18 Dec 2010 20:56:49 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBIKunb9029764; Sat, 18 Dec 2010 20:56:49 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201012182056.oBIKunb9029764@svn.freebsd.org> From: Alexander Motin Date: Sat, 18 Dec 2010 20:56:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216543 - in projects/graid/7: . contrib/bsnmp/snmpd contrib/wpa_supplicant etc/mtree gnu/usr.bin/groff/tmac include sbin/geom/class sbin/geom/class/raid share/misc sys/conf sys/geom/ra... X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Dec 2010 20:56:50 -0000 Author: mav Date: Sat Dec 18 20:56:49 2010 New Revision: 216543 URL: http://svn.freebsd.org/changeset/base/216543 Log: MFH r216525: Initial commit of the geom_raid module, intended to replace ataraid(4) at GEOM level. At this moment code is able to read and write existing RAID0 and RAID1 Intel MatrixRAID volumes, but not yet able to create volumes or do any error handling/recovery/rebuilding/... Basic design description can be found here: http://people.freebsd.org/~mav/graid_design.h Sponsored by: Cisco Systems, Inc. Added: projects/graid/7/sbin/geom/class/raid/ - copied from r216525, projects/graid/head/sbin/geom/class/raid/ projects/graid/7/sys/geom/raid/ - copied from r216525, projects/graid/head/sys/geom/raid/ projects/graid/7/sys/modules/geom/geom_raid/ - copied from r216525, projects/graid/head/sys/modules/geom/geom_raid/ Modified: projects/graid/7/etc/mtree/BSD.include.dist projects/graid/7/include/Makefile projects/graid/7/sbin/geom/class/Makefile projects/graid/7/sbin/geom/class/raid/geom_raid.c projects/graid/7/sys/conf/NOTES projects/graid/7/sys/conf/files projects/graid/7/sys/conf/options projects/graid/7/sys/geom/raid/g_raid.c projects/graid/7/sys/modules/geom/Makefile Directory Properties: projects/graid/7/ (props changed) projects/graid/7/COPYRIGHT (props changed) projects/graid/7/Makefile (props changed) projects/graid/7/Makefile.inc1 (props changed) projects/graid/7/ObsoleteFiles.inc (props changed) projects/graid/7/UPDATING (props changed) projects/graid/7/bin/ (props changed) projects/graid/7/bin/chflags/ (props changed) projects/graid/7/bin/chio/ (props changed) projects/graid/7/bin/cp/ (props changed) projects/graid/7/bin/csh/ (props changed) projects/graid/7/bin/dd/ (props changed) projects/graid/7/bin/df/ (props changed) projects/graid/7/bin/echo/ (props changed) projects/graid/7/bin/expr/ (props changed) projects/graid/7/bin/kill/ (props changed) projects/graid/7/bin/ln/ (props changed) projects/graid/7/bin/ls/ (props changed) projects/graid/7/bin/pax/ (props changed) projects/graid/7/bin/ps/ (props changed) projects/graid/7/bin/rm/ (props changed) projects/graid/7/bin/sh/ (props changed) projects/graid/7/bin/test/ (props changed) projects/graid/7/cddl/contrib/opensolaris/ (props changed) projects/graid/7/cddl/lib/libzpool/ (props changed) projects/graid/7/contrib/bind9/ (props changed) projects/graid/7/contrib/binutils/ (props changed) projects/graid/7/contrib/bsnmp/ (props changed) projects/graid/7/contrib/bsnmp/snmpd/bsnmpd.1 (props changed) projects/graid/7/contrib/cpio/ (props changed) projects/graid/7/contrib/csup/ (props changed) projects/graid/7/contrib/expat/ (props changed) projects/graid/7/contrib/gcc/ (props changed) projects/graid/7/contrib/gdb/ (props changed) projects/graid/7/contrib/gdtoa/ (props changed) projects/graid/7/contrib/groff/ (props changed) projects/graid/7/contrib/ipfilter/ (props changed) projects/graid/7/contrib/less/ (props changed) projects/graid/7/contrib/libpcap/ (props changed) projects/graid/7/contrib/ncurses/ (props changed) projects/graid/7/contrib/netcat/ (props changed) projects/graid/7/contrib/ntp/ (props changed) projects/graid/7/contrib/nvi/ (props changed) projects/graid/7/contrib/pf/ (props changed) projects/graid/7/contrib/sendmail/ (props changed) projects/graid/7/contrib/smbfs/ (props changed) projects/graid/7/contrib/tcp_wrappers/ (props changed) projects/graid/7/contrib/tcsh/ (props changed) projects/graid/7/contrib/telnet/ (props changed) projects/graid/7/contrib/top/ (props changed) projects/graid/7/contrib/traceroute/ (props changed) projects/graid/7/contrib/wpa_supplicant/ (props changed) projects/graid/7/contrib/wpa_supplicant/wpa_supplicant.conf (props changed) projects/graid/7/crypto/openssh/ (props changed) projects/graid/7/crypto/openssl/ (props changed) projects/graid/7/etc/ (props changed) projects/graid/7/games/factor/ (props changed) projects/graid/7/games/fortune/ (props changed) projects/graid/7/games/grdc/ (props changed) projects/graid/7/gnu/ (props changed) projects/graid/7/gnu/lib/libstdc++/ (props changed) projects/graid/7/gnu/usr.bin/ (props changed) projects/graid/7/gnu/usr.bin/cc/ (props changed) projects/graid/7/gnu/usr.bin/cpio/ (props changed) projects/graid/7/gnu/usr.bin/cvs/ (props changed) projects/graid/7/gnu/usr.bin/gdb/ (props changed) projects/graid/7/gnu/usr.bin/gdb/kgdb/ (props changed) projects/graid/7/gnu/usr.bin/grep/ (props changed) projects/graid/7/gnu/usr.bin/groff/ (props changed) projects/graid/7/gnu/usr.bin/groff/tmac/mdoc.local (props changed) projects/graid/7/gnu/usr.bin/man/ (props changed) projects/graid/7/gnu/usr.bin/sort/ (props changed) projects/graid/7/include/ (props changed) projects/graid/7/kerberos5/ (props changed) projects/graid/7/lib/ (props changed) projects/graid/7/lib/bind/ (props changed) projects/graid/7/lib/csu/ (props changed) projects/graid/7/lib/libarchive/ (props changed) projects/graid/7/lib/libbluetooth/ (props changed) projects/graid/7/lib/libc/ (props changed) projects/graid/7/lib/libc/stdtime/ (props changed) projects/graid/7/lib/libc_r/ (props changed) projects/graid/7/lib/libcam/ (props changed) projects/graid/7/lib/libdisk/ (props changed) projects/graid/7/lib/libdwarf/ (props changed) projects/graid/7/lib/libelf/ (props changed) projects/graid/7/lib/libexpat/ (props changed) projects/graid/7/lib/libfetch/ (props changed) projects/graid/7/lib/libftpio/ (props changed) projects/graid/7/lib/libgeom/ (props changed) projects/graid/7/lib/libgssapi/ (props changed) projects/graid/7/lib/libkse/ (props changed) projects/graid/7/lib/libkvm/ (props changed) projects/graid/7/lib/libmagic/ (props changed) projects/graid/7/lib/libmemstat/ (props changed) projects/graid/7/lib/libpmc/ (props changed) projects/graid/7/lib/libradius/ (props changed) projects/graid/7/lib/libsm/ (props changed) projects/graid/7/lib/libstand/ (props changed) projects/graid/7/lib/libthr/ (props changed) projects/graid/7/lib/libthread_db/ (props changed) projects/graid/7/lib/libufs/ (props changed) projects/graid/7/lib/libutil/ (props changed) projects/graid/7/lib/msun/ (props changed) projects/graid/7/libexec/ (props changed) projects/graid/7/libexec/ftpd/ (props changed) projects/graid/7/libexec/rpc.rquotad/ (props changed) projects/graid/7/libexec/rpc.rstatd/ (props changed) projects/graid/7/libexec/rtld-elf/ (props changed) projects/graid/7/libexec/tftpd/ (props changed) projects/graid/7/release/ (props changed) projects/graid/7/release/doc/ (props changed) projects/graid/7/release/doc/en_US.ISO8859-1/hardware/ (props changed) projects/graid/7/release/picobsd/tinyware/login/ (props changed) projects/graid/7/rescue/ (props changed) projects/graid/7/sbin/ (props changed) projects/graid/7/sbin/atacontrol/ (props changed) projects/graid/7/sbin/bsdlabel/ (props changed) projects/graid/7/sbin/clri/ (props changed) projects/graid/7/sbin/ddb/ (props changed) projects/graid/7/sbin/devd/ (props changed) projects/graid/7/sbin/devfs/ (props changed) projects/graid/7/sbin/dhclient/ (props changed) projects/graid/7/sbin/dumpfs/ (props changed) projects/graid/7/sbin/fdisk/ (props changed) projects/graid/7/sbin/fdisk_pc98/ (props changed) projects/graid/7/sbin/fsck/ (props changed) projects/graid/7/sbin/fsck_ffs/ (props changed) projects/graid/7/sbin/fsck_msdosfs/ (props changed) projects/graid/7/sbin/geom/ (props changed) projects/graid/7/sbin/geom/class/label/ (props changed) projects/graid/7/sbin/geom/class/part/ (props changed) projects/graid/7/sbin/geom/class/stripe/ (props changed) projects/graid/7/sbin/geom/misc/ (props changed) projects/graid/7/sbin/growfs/ (props changed) projects/graid/7/sbin/ifconfig/ (props changed) projects/graid/7/sbin/init/ (props changed) projects/graid/7/sbin/ipf/ (props changed) projects/graid/7/sbin/ipfw/ (props changed) projects/graid/7/sbin/md5/ (props changed) projects/graid/7/sbin/mdconfig/ (props changed) projects/graid/7/sbin/mksnap_ffs/ (props changed) projects/graid/7/sbin/mount/ (props changed) projects/graid/7/sbin/mount_msdosfs/ (props changed) projects/graid/7/sbin/natd/ (props changed) projects/graid/7/sbin/newfs/ (props changed) projects/graid/7/sbin/newfs_msdos/ (props changed) projects/graid/7/sbin/ping6/ (props changed) projects/graid/7/sbin/reboot/ (props changed) projects/graid/7/sbin/restore/ (props changed) projects/graid/7/sbin/route/ (props changed) projects/graid/7/sbin/savecore/ (props changed) projects/graid/7/sbin/sconfig/ (props changed) projects/graid/7/sbin/shutdown/ (props changed) projects/graid/7/sbin/sysctl/ (props changed) projects/graid/7/sbin/tunefs/ (props changed) projects/graid/7/secure/lib/libcrypto/ (props changed) projects/graid/7/secure/lib/libssh/ (props changed) projects/graid/7/secure/lib/libssl/ (props changed) projects/graid/7/secure/libexec/sftp-server/ (props changed) projects/graid/7/secure/usr.bin/bdes/ (props changed) projects/graid/7/secure/usr.bin/openssl/ (props changed) projects/graid/7/secure/usr.bin/ssh/ (props changed) projects/graid/7/secure/usr.sbin/sshd/ (props changed) projects/graid/7/share/ (props changed) projects/graid/7/share/colldef/ (props changed) projects/graid/7/share/dict/ (props changed) projects/graid/7/share/doc/bind9/ (props changed) projects/graid/7/share/doc/papers/jail/ (props changed) projects/graid/7/share/doc/smm/01.setup/ (props changed) projects/graid/7/share/examples/ (props changed) projects/graid/7/share/man/ (props changed) projects/graid/7/share/man/man1/ (props changed) projects/graid/7/share/man/man3/ (props changed) projects/graid/7/share/man/man4/ (props changed) projects/graid/7/share/man/man5/ (props changed) projects/graid/7/share/man/man7/ (props changed) projects/graid/7/share/man/man8/ (props changed) projects/graid/7/share/man/man9/ (props changed) projects/graid/7/share/misc/ (props changed) projects/graid/7/share/misc/iso639 (props changed) projects/graid/7/share/misc/pci_vendors (props changed) projects/graid/7/share/mk/ (props changed) projects/graid/7/share/mklocale/ (props changed) projects/graid/7/share/monetdef/ (props changed) projects/graid/7/share/msgdef/ (props changed) projects/graid/7/share/numericdef/ (props changed) projects/graid/7/share/sendmail/ (props changed) projects/graid/7/share/syscons/ (props changed) projects/graid/7/share/syscons/keymaps/ (props changed) projects/graid/7/share/termcap/ (props changed) projects/graid/7/share/timedef/ (props changed) projects/graid/7/share/zoneinfo/ (props changed) projects/graid/7/sys/ (props changed) projects/graid/7/sys/cddl/contrib/opensolaris/ (props changed) projects/graid/7/sys/contrib/dev/acpica/ (props changed) projects/graid/7/sys/contrib/pf/ (props changed) projects/graid/7/tools/ (props changed) projects/graid/7/tools/build/ (props changed) projects/graid/7/tools/build/options/ (props changed) projects/graid/7/tools/debugscripts/ (props changed) projects/graid/7/tools/regression/atm/ (props changed) projects/graid/7/tools/regression/bin/ (props changed) projects/graid/7/tools/regression/bin/sh/ (props changed) projects/graid/7/tools/regression/file/ (props changed) projects/graid/7/tools/regression/file/flock/ (props changed) projects/graid/7/tools/regression/lib/libc/ (props changed) projects/graid/7/tools/regression/usr.bin/ (props changed) projects/graid/7/tools/regression/usr.bin/jot/ (props changed) projects/graid/7/tools/regression/usr.bin/tr/ (props changed) projects/graid/7/tools/sched/ (props changed) projects/graid/7/tools/test/ (props changed) projects/graid/7/tools/tools/ (props changed) projects/graid/7/tools/tools/aac/ (props changed) projects/graid/7/tools/tools/crypto/ (props changed) projects/graid/7/tools/tools/editing/ (props changed) projects/graid/7/tools/tools/nanobsd/ (props changed) projects/graid/7/tools/tools/nanobsd/FlashDevice.sub (props changed) projects/graid/7/tools/tools/nanobsd/nanobsd.sh (props changed) projects/graid/7/tools/tools/netrate/ (props changed) projects/graid/7/tools/tools/umastat/ (props changed) projects/graid/7/tools/tools/usb/ (props changed) projects/graid/7/usr.bin/ (props changed) projects/graid/7/usr.bin/basename/ (props changed) projects/graid/7/usr.bin/bluetooth/rfcomm_sppd/ (props changed) projects/graid/7/usr.bin/calendar/ (props changed) projects/graid/7/usr.bin/catman/ (props changed) projects/graid/7/usr.bin/cksum/ (props changed) projects/graid/7/usr.bin/comm/ (props changed) projects/graid/7/usr.bin/cpuset/ (props changed) projects/graid/7/usr.bin/csup/ (props changed) projects/graid/7/usr.bin/dirname/ (props changed) projects/graid/7/usr.bin/du/ (props changed) projects/graid/7/usr.bin/fetch/ (props changed) projects/graid/7/usr.bin/file/ (props changed) projects/graid/7/usr.bin/find/ (props changed) projects/graid/7/usr.bin/finger/ (props changed) projects/graid/7/usr.bin/fold/ (props changed) projects/graid/7/usr.bin/fstat/ (props changed) projects/graid/7/usr.bin/gcore/ (props changed) projects/graid/7/usr.bin/gprof/ (props changed) projects/graid/7/usr.bin/gzip/ (props changed) projects/graid/7/usr.bin/hexdump/ (props changed) projects/graid/7/usr.bin/id/ (props changed) projects/graid/7/usr.bin/indent/ (props changed) projects/graid/7/usr.bin/ipcrm/ (props changed) projects/graid/7/usr.bin/ipcs/ (props changed) projects/graid/7/usr.bin/jot/ (props changed) projects/graid/7/usr.bin/kdump/ (props changed) projects/graid/7/usr.bin/ktrace/ (props changed) projects/graid/7/usr.bin/ldd/ (props changed) projects/graid/7/usr.bin/less/ (props changed) projects/graid/7/usr.bin/locate/ (props changed) projects/graid/7/usr.bin/lockf/ (props changed) projects/graid/7/usr.bin/logger/ (props changed) projects/graid/7/usr.bin/make/ (props changed) projects/graid/7/usr.bin/ncal/ (props changed) projects/graid/7/usr.bin/netstat/ (props changed) projects/graid/7/usr.bin/newgrp/ (props changed) projects/graid/7/usr.bin/nsupdate/ (props changed) projects/graid/7/usr.bin/pkill/ (props changed) projects/graid/7/usr.bin/procstat/ (props changed) projects/graid/7/usr.bin/quota/ (props changed) projects/graid/7/usr.bin/rpcgen/ (props changed) projects/graid/7/usr.bin/ruptime/ (props changed) projects/graid/7/usr.bin/script/ (props changed) projects/graid/7/usr.bin/sed/ (props changed) projects/graid/7/usr.bin/shar/ (props changed) projects/graid/7/usr.bin/sockstat/ (props changed) projects/graid/7/usr.bin/stat/ (props changed) projects/graid/7/usr.bin/su/ (props changed) projects/graid/7/usr.bin/systat/ (props changed) projects/graid/7/usr.bin/tail/ (props changed) projects/graid/7/usr.bin/tar/ (props changed) projects/graid/7/usr.bin/tftp/ (props changed) projects/graid/7/usr.bin/tip/ (props changed) projects/graid/7/usr.bin/top/ (props changed) projects/graid/7/usr.bin/truncate/ (props changed) projects/graid/7/usr.bin/truss/ (props changed) projects/graid/7/usr.bin/uname/ (props changed) projects/graid/7/usr.bin/unifdef/ (props changed) projects/graid/7/usr.bin/units/ (props changed) projects/graid/7/usr.bin/uudecode/ (props changed) projects/graid/7/usr.bin/vmstat/ (props changed) projects/graid/7/usr.bin/w/ (props changed) projects/graid/7/usr.bin/wc/ (props changed) projects/graid/7/usr.bin/whereis/ (props changed) projects/graid/7/usr.bin/whois/ (props changed) projects/graid/7/usr.bin/window/ (props changed) projects/graid/7/usr.bin/xargs/ (props changed) projects/graid/7/usr.bin/ypcat/ (props changed) projects/graid/7/usr.bin/ypmatch/ (props changed) projects/graid/7/usr.bin/ypwhich/ (props changed) projects/graid/7/usr.sbin/ (props changed) projects/graid/7/usr.sbin/Makefile (props changed) projects/graid/7/usr.sbin/acpi/ (props changed) projects/graid/7/usr.sbin/adduser/ (props changed) projects/graid/7/usr.sbin/arp/ (props changed) projects/graid/7/usr.sbin/bluetooth/ (props changed) projects/graid/7/usr.sbin/bluetooth/btpand/ (props changed) projects/graid/7/usr.sbin/bluetooth/hcsecd/ (props changed) projects/graid/7/usr.sbin/bluetooth/hcseriald/ (props changed) projects/graid/7/usr.sbin/bluetooth/rfcomm_pppd/ (props changed) projects/graid/7/usr.sbin/bluetooth/sdpd/ (props changed) projects/graid/7/usr.sbin/boot0cfg/ (props changed) projects/graid/7/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_processor_tbl.c (props changed) projects/graid/7/usr.sbin/bsnmpd/modules/snmp_pf/ (props changed) projects/graid/7/usr.sbin/burncd/ (props changed) projects/graid/7/usr.sbin/cdcontrol/ (props changed) projects/graid/7/usr.sbin/chown/ (props changed) projects/graid/7/usr.sbin/chroot/ (props changed) projects/graid/7/usr.sbin/config/ (props changed) projects/graid/7/usr.sbin/config/SMM.doc/ (props changed) projects/graid/7/usr.sbin/cpucontrol/ (props changed) projects/graid/7/usr.sbin/crashinfo/ (props changed) projects/graid/7/usr.sbin/cron/ (props changed) projects/graid/7/usr.sbin/cron/cron/ (props changed) projects/graid/7/usr.sbin/crunch/ (props changed) projects/graid/7/usr.sbin/cxgbtool/ (props changed) projects/graid/7/usr.sbin/eeprom/ (props changed) projects/graid/7/usr.sbin/extattr/ (props changed) projects/graid/7/usr.sbin/faithd/ (props changed) projects/graid/7/usr.sbin/fdcontrol/ (props changed) projects/graid/7/usr.sbin/fdformat/ (props changed) projects/graid/7/usr.sbin/fdread/ (props changed) projects/graid/7/usr.sbin/fdwrite/ (props changed) projects/graid/7/usr.sbin/fifolog/ (props changed) projects/graid/7/usr.sbin/freebsd-update/ (props changed) projects/graid/7/usr.sbin/fwcontrol/ (props changed) projects/graid/7/usr.sbin/gstat/ (props changed) projects/graid/7/usr.sbin/iostat/ (props changed) projects/graid/7/usr.sbin/jail/ (props changed) projects/graid/7/usr.sbin/jexec/ (props changed) projects/graid/7/usr.sbin/jls/ (props changed) projects/graid/7/usr.sbin/lpr/ (props changed) projects/graid/7/usr.sbin/mailwrapper/ (props changed) projects/graid/7/usr.sbin/makefs/ (props changed) projects/graid/7/usr.sbin/makefs/ffs/ffs_bswap.c (props changed) projects/graid/7/usr.sbin/makefs/ffs/ffs_subr.c (props changed) projects/graid/7/usr.sbin/makefs/ffs/ufs_bswap.h (props changed) projects/graid/7/usr.sbin/makefs/getid.c (props changed) projects/graid/7/usr.sbin/mergemaster/ (props changed) projects/graid/7/usr.sbin/mfiutil/ (props changed) projects/graid/7/usr.sbin/mountd/ (props changed) projects/graid/7/usr.sbin/mptutil/ (props changed) projects/graid/7/usr.sbin/mtree/ (props changed) projects/graid/7/usr.sbin/ndiscvt/ (props changed) projects/graid/7/usr.sbin/ndp/ (props changed) projects/graid/7/usr.sbin/newsyslog/ (props changed) projects/graid/7/usr.sbin/nscd/ (props changed) projects/graid/7/usr.sbin/ntp/ (props changed) projects/graid/7/usr.sbin/pciconf/ (props changed) projects/graid/7/usr.sbin/pkg_install/ (props changed) projects/graid/7/usr.sbin/pmccontrol/ (props changed) projects/graid/7/usr.sbin/pmcstat/ (props changed) projects/graid/7/usr.sbin/portsnap/ (props changed) projects/graid/7/usr.sbin/powerd/ (props changed) projects/graid/7/usr.sbin/ppp/ (props changed) projects/graid/7/usr.sbin/pstat/ (props changed) projects/graid/7/usr.sbin/pw/ (props changed) projects/graid/7/usr.sbin/pwd_mkdb/ (props changed) projects/graid/7/usr.sbin/rpc.lockd/ (props changed) projects/graid/7/usr.sbin/rpc.statd/ (props changed) projects/graid/7/usr.sbin/rpc.yppasswdd/ (props changed) projects/graid/7/usr.sbin/rtadvd/ (props changed) projects/graid/7/usr.sbin/rtsold/ (props changed) projects/graid/7/usr.sbin/sade/ (props changed) projects/graid/7/usr.sbin/service/ (props changed) projects/graid/7/usr.sbin/setfib/ (props changed) projects/graid/7/usr.sbin/sysinstall/ (props changed) projects/graid/7/usr.sbin/syslogd/ (props changed) projects/graid/7/usr.sbin/traceroute/ (props changed) projects/graid/7/usr.sbin/traceroute6/ (props changed) projects/graid/7/usr.sbin/tzsetup/ (props changed) projects/graid/7/usr.sbin/ugidfw/ (props changed) projects/graid/7/usr.sbin/wpa/wpa_supplicant/ (props changed) projects/graid/7/usr.sbin/ypserv/ (props changed) projects/graid/7/usr.sbin/zic/ (props changed) Modified: projects/graid/7/etc/mtree/BSD.include.dist ============================================================================== --- projects/graid/7/etc/mtree/BSD.include.dist Sat Dec 18 20:43:18 2010 (r216542) +++ projects/graid/7/etc/mtree/BSD.include.dist Sat Dec 18 20:56:49 2010 (r216543) @@ -176,6 +176,8 @@ .. nop .. + raid + .. raid3 .. shsec Modified: projects/graid/7/include/Makefile ============================================================================== --- projects/graid/7/include/Makefile Sat Dec 18 20:43:18 2010 (r216542) +++ projects/graid/7/include/Makefile Sat Dec 18 20:56:49 2010 (r216543) @@ -50,7 +50,7 @@ LSUBDIRS= cam/ata cam/scsi \ ${_fs_nwfs} fs/portalfs fs/procfs fs/smbfs fs/udf fs/unionfs \ geom/cache geom/concat geom/eli geom/gate geom/journal geom/label \ geom/mirror geom/multipath geom/nop \ - geom/raid3 geom/shsec geom/stripe geom/virstor \ + geom/raid geom/raid3 geom/shsec geom/stripe geom/virstor \ netgraph/atm netgraph/netflow \ security/audit \ security/mac_biba security/mac_bsdextended security/mac_lomac \ Modified: projects/graid/7/sbin/geom/class/Makefile ============================================================================== --- projects/graid/7/sbin/geom/class/Makefile Sat Dec 18 20:43:18 2010 (r216542) +++ projects/graid/7/sbin/geom/class/Makefile Sat Dec 18 20:56:49 2010 (r216543) @@ -13,6 +13,7 @@ SUBDIR+=mirror SUBDIR+=multipath SUBDIR+=nop SUBDIR+=part +SUBDIR+=raid SUBDIR+=raid3 SUBDIR+=shsec SUBDIR+=stripe Modified: projects/graid/7/sbin/geom/class/raid/geom_raid.c ============================================================================== --- projects/graid/head/sbin/geom/class/raid/geom_raid.c Sat Dec 18 19:04:21 2010 (r216525) +++ projects/graid/7/sbin/geom/class/raid/geom_raid.c Sat Dec 18 20:56:49 2010 (r216543) @@ -49,8 +49,8 @@ uint32_t version = G_RAID_VERSION; #define GRAID_SLICE "4096" #define GRAID_PRIORITY "0" -static void raid_main(struct gctl_req *req, unsigned flags); #if 0 +static void raid_main(struct gctl_req *req, unsigned flags); static void raid_activate(struct gctl_req *req); static void raid_clear(struct gctl_req *req); static void raid_dump(struct gctl_req *req); @@ -58,6 +58,7 @@ static void raid_label(struct gctl_req * #endif struct g_command class_commands[] = { +/* { "activate", G_FLAG_VERBOSE, raid_main, G_NULL_OPTS, "[-v] name prov ..." }, @@ -122,9 +123,11 @@ struct g_command class_commands[] = { }, "[-fv] name ..." }, +*/ G_CMD_SENTINEL }; +#if 0 static int verbose = 0; static void @@ -154,7 +157,6 @@ raid_main(struct gctl_req *req, unsigned gctl_error(req, "Unknown command: %s.", name); } -#if 0 static void raid_label(struct gctl_req *req) { Modified: projects/graid/7/sys/conf/NOTES ============================================================================== --- projects/graid/7/sys/conf/NOTES Sat Dec 18 20:43:18 2010 (r216542) +++ projects/graid/7/sys/conf/NOTES Sat Dec 18 20:56:49 2010 (r216543) @@ -152,6 +152,7 @@ options GEOM_PART_GPT # GPT partitioni options GEOM_PART_MBR # MBR partitioning options GEOM_PART_VTOC8 # SMI VTOC8 disk label options GEOM_PC98 # NEC PC9800 partitioning +options GEOM_RAID # Soft RAID functionality. options GEOM_RAID3 # RAID3 functionality. options GEOM_SHSEC # Shared secret. options GEOM_STRIPE # Disk striping. Modified: projects/graid/7/sys/conf/files ============================================================================== --- projects/graid/7/sys/conf/files Sat Dec 18 20:43:18 2010 (r216542) +++ projects/graid/7/sys/conf/files Sat Dec 18 20:56:49 2010 (r216543) @@ -1525,6 +1525,13 @@ geom/part/g_part_bsd.c optional geom_pa geom/part/g_part_gpt.c optional geom_part_gpt geom/part/g_part_mbr.c optional geom_part_mbr geom/part/g_part_vtoc8.c optional geom_part_vtoc8 +geom/raid/g_raid.c optional geom_raid +geom/raid/g_raid_ctl.c optional geom_raid +geom/raid/g_raid_md_if.m optional geom_raid +geom/raid/g_raid_tr_if.m optional geom_raid +geom/raid/md_intel.c optional geom_raid +geom/raid/tr_raid0.c optional geom_raid +geom/raid/tr_raid1.c optional geom_raid geom/raid3/g_raid3.c optional geom_raid3 geom/raid3/g_raid3_ctl.c optional geom_raid3 geom/shsec/g_shsec.c optional geom_shsec Modified: projects/graid/7/sys/conf/options ============================================================================== --- projects/graid/7/sys/conf/options Sat Dec 18 20:43:18 2010 (r216542) +++ projects/graid/7/sys/conf/options Sat Dec 18 20:56:49 2010 (r216543) @@ -97,6 +97,7 @@ GEOM_PART_GPT opt_geom.h GEOM_PART_MBR opt_geom.h GEOM_PART_VTOC8 opt_geom.h GEOM_PC98 opt_geom.h +GEOM_RAID opt_geom.h GEOM_RAID3 opt_geom.h GEOM_SHSEC opt_geom.h GEOM_STRIPE opt_geom.h Modified: projects/graid/7/sys/geom/raid/g_raid.c ============================================================================== --- projects/graid/head/sys/geom/raid/g_raid.c Sat Dec 18 19:04:21 2010 (r216525) +++ projects/graid/7/sys/geom/raid/g_raid.c Sat Dec 18 20:56:49 2010 (r216543) @@ -1117,7 +1117,7 @@ g_raid_create_node(struct g_class *mp, TAILQ_INIT(&sc->sc_events); bioq_init(&sc->sc_queue); gp->softc = sc; - error = kproc_create(g_raid_worker, sc, &sc->sc_worker, 0, 0, + error = kthread_create(g_raid_worker, sc, &sc->sc_worker, 0, 0, "g_raid %s", name); if (error != 0) { G_RAID_DEBUG(1, "Cannot create kernel thread for %s.", name); @@ -1245,7 +1245,7 @@ g_raid_destroy_node(struct g_raid_softc free(sc, M_RAID); curthread->td_pflags &= ~TDP_GEOM; G_RAID_DEBUG(1, "Thread exiting."); - kproc_exit(0); + kthread_exit(0); } else { /* Wake up worker to make it selfdestruct. */ g_raid_event_send(sc, 0, 0); Modified: projects/graid/7/sys/modules/geom/Makefile ============================================================================== --- projects/graid/7/sys/modules/geom/Makefile Sat Dec 18 20:43:18 2010 (r216542) +++ projects/graid/7/sys/modules/geom/Makefile Sat Dec 18 20:56:49 2010 (r216543) @@ -17,6 +17,7 @@ SUBDIR= geom_bde \ geom_nop \ geom_part \ geom_pc98 \ + geom_raid \ geom_raid3 \ geom_shsec \ geom_stripe \