From owner-svn-src-projects@FreeBSD.ORG Thu Nov 18 18:30:04 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 0D4D8106564A; Thu, 18 Nov 2010 18:30:04 +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 E541D8FC08; Thu, 18 Nov 2010 18:30:03 +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 oAIIU3Ok041073; Thu, 18 Nov 2010 18:30:03 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAIIU3tM041040; Thu, 18 Nov 2010 18:30:03 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201011181830.oAIIU3tM041040@svn.freebsd.org> From: Dimitry Andric Date: Thu, 18 Nov 2010 18:30:03 +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: r215464 - in projects/binutils-2.17: . cddl contrib/gcc contrib/gcc/config contrib/gcc/config/ia64 contrib/ipfilter/man contrib/top gnu/usr.bin/binutils/ld gnu/usr.bin/cc/cc_tools lib/l... 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: Thu, 18 Nov 2010 18:30:04 -0000 Author: dim Date: Thu Nov 18 18:30:03 2010 New Revision: 215464 URL: http://svn.freebsd.org/changeset/base/215464 Log: Sync: merge r215396 through r215463 from ^/head. Deleted: projects/binutils-2.17/lib/libautofs/ projects/binutils-2.17/sbin/mount_autofs/ Modified: projects/binutils-2.17/Makefile.inc1 projects/binutils-2.17/cddl/Makefile.inc projects/binutils-2.17/contrib/gcc/cgraphunit.c projects/binutils-2.17/contrib/gcc/config/elfos.h projects/binutils-2.17/contrib/gcc/config/ia64/hpux.h projects/binutils-2.17/contrib/gcc/config/ia64/ia64.c projects/binutils-2.17/contrib/gcc/output.h projects/binutils-2.17/contrib/gcc/toplev.c projects/binutils-2.17/contrib/gcc/varasm.c projects/binutils-2.17/contrib/ipfilter/man/ipnat.8 projects/binutils-2.17/contrib/ipfilter/man/mkfilters.1 projects/binutils-2.17/gnu/usr.bin/binutils/ld/Makefile.amd64 projects/binutils-2.17/gnu/usr.bin/cc/cc_tools/Makefile projects/binutils-2.17/lib/libusb/libusb.3 projects/binutils-2.17/share/man/man4/ata.4 projects/binutils-2.17/share/mk/Makefile projects/binutils-2.17/share/mk/bsd.crunchgen.mk projects/binutils-2.17/sys/amd64/amd64/amd64_mem.c projects/binutils-2.17/sys/boot/ofw/libofw/ofw_copy.c projects/binutils-2.17/sys/boot/ofw/libofw/ofw_net.c projects/binutils-2.17/sys/boot/ofw/libofw/openfirm.c projects/binutils-2.17/sys/boot/ofw/libofw/openfirm.h projects/binutils-2.17/sys/boot/powerpc/ofw/start.c projects/binutils-2.17/sys/cam/ata/ata_xpt.c projects/binutils-2.17/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c projects/binutils-2.17/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c projects/binutils-2.17/sys/compat/ndis/ntoskrnl_var.h projects/binutils-2.17/sys/compat/ndis/subr_ntoskrnl.c projects/binutils-2.17/sys/crypto/aesni/aesni_wrap.c projects/binutils-2.17/sys/dev/ata/ata-pci.h projects/binutils-2.17/sys/dev/ata/ata-sata.c projects/binutils-2.17/sys/dev/ata/chipsets/ata-via.c projects/binutils-2.17/sys/dev/mii/atphy.c projects/binutils-2.17/sys/dev/nfe/if_nfe.c projects/binutils-2.17/sys/i386/i386/i686_mem.c projects/binutils-2.17/sys/kern/kern_rmlock.c projects/binutils-2.17/sys/kern/subr_bus.c projects/binutils-2.17/sys/netinet/sctp.h projects/binutils-2.17/sys/netinet/sctp_uio.h projects/binutils-2.17/sys/netinet/sctp_usrreq.c projects/binutils-2.17/sys/netinet/tcp.h projects/binutils-2.17/sys/netinet/tcp_output.c projects/binutils-2.17/sys/netinet/tcp_reass.c projects/binutils-2.17/sys/netinet/tcp_usrreq.c projects/binutils-2.17/sys/netinet/tcp_var.h projects/binutils-2.17/sys/netinet6/nd6.c projects/binutils-2.17/sys/sys/bus.h projects/binutils-2.17/sys/x86/cpufreq/hwpstate.c projects/binutils-2.17/tools/tools/mctest/mctest.cc projects/binutils-2.17/usr.bin/netstat/inet.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.sbin/iostat/iostat.8 projects/binutils-2.17/usr.sbin/iostat/iostat.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/pf/ (props changed) projects/binutils-2.17/sys/contrib/x86emu/ (props changed) projects/binutils-2.17/sys/dev/xen/xenpci/ (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.inc1 ============================================================================== --- projects/binutils-2.17/Makefile.inc1 Thu Nov 18 18:22:58 2010 (r215463) +++ projects/binutils-2.17/Makefile.inc1 Thu Nov 18 18:30:03 2010 (r215464) @@ -322,7 +322,7 @@ LIB32WMAKEENV+= MAKEOBJDIRPREFIX=${OBJTR LIB32WMAKE= ${LIB32WMAKEENV} ${MAKE} -DNO_CPU_CFLAGS -DCOMPAT_32BIT \ -DWITHOUT_BIND -DWITHOUT_MAN -DWITHOUT_INFO \ - -DWITHOUT_HTML -DNO_CTF DESTDIR=${LIB32TMP} + -DWITHOUT_HTML -DNO_CTF -DNO_LINT DESTDIR=${LIB32TMP} LIB32IMAKE= ${LIB32WMAKE:NINSTALL=*:NDESTDIR=*} -DNO_INCS .endif Modified: projects/binutils-2.17/cddl/Makefile.inc ============================================================================== --- projects/binutils-2.17/cddl/Makefile.inc Thu Nov 18 18:22:58 2010 (r215463) +++ projects/binutils-2.17/cddl/Makefile.inc Thu Nov 18 18:30:03 2010 (r215464) @@ -9,3 +9,8 @@ CFLAGS+= -DNEED_SOLARIS_BOOLEAN WARNS?= 6 CSTD?= gnu89 + +# Do not lint the CDDL stuff. It is all externally maintained and +# lint output is wasteful noise here. + +NO_LINT= Modified: projects/binutils-2.17/contrib/gcc/cgraphunit.c ============================================================================== --- projects/binutils-2.17/contrib/gcc/cgraphunit.c Thu Nov 18 18:22:58 2010 (r215463) +++ projects/binutils-2.17/contrib/gcc/cgraphunit.c Thu Nov 18 18:30:03 2010 (r215464) @@ -1536,8 +1536,6 @@ cgraph_optimize (void) return; } - process_pending_assemble_externals (); - /* Frontend may output common variables after the unit has been finalized. It is safe to deal with them here as they are always zero initialized. */ cgraph_varpool_analyze_pending_decls (); Modified: projects/binutils-2.17/contrib/gcc/config/elfos.h ============================================================================== --- projects/binutils-2.17/contrib/gcc/config/elfos.h Thu Nov 18 18:22:58 2010 (r215463) +++ projects/binutils-2.17/contrib/gcc/config/elfos.h Thu Nov 18 18:30:03 2010 (r215464) @@ -496,3 +496,13 @@ Boston, MA 02110-1301, USA. */ fprintf ((FILE), "\"\n"); \ } \ while (0) + +/* A C statement (sans semicolon) to output to the stdio stream STREAM + any text necessary for declaring the name of an external symbol + named NAME whch is referenced in this compilation but not defined. + It is needed to properly support non-default visibility. */ + +#ifndef ASM_OUTPUT_EXTERNAL +#define ASM_OUTPUT_EXTERNAL(FILE, DECL, NAME) \ + default_elf_asm_output_external (FILE, DECL, NAME) +#endif Modified: projects/binutils-2.17/contrib/gcc/config/ia64/hpux.h ============================================================================== --- projects/binutils-2.17/contrib/gcc/config/ia64/hpux.h Thu Nov 18 18:22:58 2010 (r215463) +++ projects/binutils-2.17/contrib/gcc/config/ia64/hpux.h Thu Nov 18 18:30:03 2010 (r215464) @@ -144,10 +144,6 @@ do { \ definitions, so do not use them in gthr-posix.h. */ #define GTHREAD_USE_WEAK 0 -/* Put out the needed function declarations at the end. */ - -#define TARGET_ASM_FILE_END ia64_hpux_file_end - #undef CTORS_SECTION_ASM_OP #define CTORS_SECTION_ASM_OP "\t.section\t.init_array,\t\"aw\",\"init_array\"" Modified: projects/binutils-2.17/contrib/gcc/config/ia64/ia64.c ============================================================================== --- projects/binutils-2.17/contrib/gcc/config/ia64/ia64.c Thu Nov 18 18:22:58 2010 (r215463) +++ projects/binutils-2.17/contrib/gcc/config/ia64/ia64.c Thu Nov 18 18:30:03 2010 (r215464) @@ -250,10 +250,6 @@ static section *ia64_select_rtx_section static void ia64_output_dwarf_dtprel (FILE *, int, rtx) ATTRIBUTE_UNUSED; static unsigned int ia64_section_type_flags (tree, const char *, int); -static void ia64_hpux_add_extern_decl (tree decl) - ATTRIBUTE_UNUSED; -static void ia64_hpux_file_end (void) - ATTRIBUTE_UNUSED; static void ia64_init_libfuncs (void) ATTRIBUTE_UNUSED; static void ia64_hpux_init_libfuncs (void) @@ -5015,49 +5011,6 @@ ia64_secondary_reload_class (enum reg_cl } -/* Emit text to declare externally defined variables and functions, because - the Intel assembler does not support undefined externals. */ - -void -ia64_asm_output_external (FILE *file, tree decl, const char *name) -{ - int save_referenced; - - /* GNU as does not need anything here, but the HP linker does need - something for external functions. */ - - if (TARGET_GNU_AS - && (!TARGET_HPUX_LD - || TREE_CODE (decl) != FUNCTION_DECL - || strstr (name, "__builtin_") == name)) - return; - - /* ??? The Intel assembler creates a reference that needs to be satisfied by - the linker when we do this, so we need to be careful not to do this for - builtin functions which have no library equivalent. Unfortunately, we - can't tell here whether or not a function will actually be called by - expand_expr, so we pull in library functions even if we may not need - them later. */ - if (! strcmp (name, "__builtin_next_arg") - || ! strcmp (name, "alloca") - || ! strcmp (name, "__builtin_constant_p") - || ! strcmp (name, "__builtin_args_info")) - return; - - if (TARGET_HPUX_LD) - ia64_hpux_add_extern_decl (decl); - else - { - /* assemble_name will set TREE_SYMBOL_REFERENCED, so we must save and - restore it. */ - save_referenced = TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (decl)); - if (TREE_CODE (decl) == FUNCTION_DECL) - ASM_OUTPUT_TYPE_DIRECTIVE (file, name, "function"); - (*targetm.asm_out.globalize_label) (file, name); - TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (decl)) = save_referenced; - } -} - /* Parse the -mfixed-range= option string. */ static void @@ -9223,55 +9176,33 @@ ia64_hpux_function_arg_padding (enum mac return DEFAULT_FUNCTION_ARG_PADDING (mode, type); } -/* Linked list of all external functions that are to be emitted by GCC. - We output the name if and only if TREE_SYMBOL_REFERENCED is set in - order to avoid putting out names that are never really used. */ - -struct extern_func_list GTY(()) -{ - struct extern_func_list *next; - tree decl; -}; - -static GTY(()) struct extern_func_list *extern_func_head; - -static void -ia64_hpux_add_extern_decl (tree decl) -{ - struct extern_func_list *p = ggc_alloc (sizeof (struct extern_func_list)); - - p->decl = decl; - p->next = extern_func_head; - extern_func_head = p; -} - -/* Print out the list of used global functions. */ +/* Emit text to declare externally defined variables and functions, because + the Intel assembler does not support undefined externals. */ -static void -ia64_hpux_file_end (void) +void +ia64_asm_output_external (FILE *file, tree decl, const char *name) { - struct extern_func_list *p; - - for (p = extern_func_head; p; p = p->next) - { - tree decl = p->decl; - tree id = DECL_ASSEMBLER_NAME (decl); - - gcc_assert (id); - - if (!TREE_ASM_WRITTEN (decl) && TREE_SYMBOL_REFERENCED (id)) - { - const char *name = XSTR (XEXP (DECL_RTL (decl), 0), 0); - - TREE_ASM_WRITTEN (decl) = 1; - (*targetm.asm_out.globalize_label) (asm_out_file, name); - fputs (TYPE_ASM_OP, asm_out_file); - assemble_name (asm_out_file, name); - fprintf (asm_out_file, "," TYPE_OPERAND_FMT "\n", "function"); - } + /* We output the name if and only if TREE_SYMBOL_REFERENCED is + set in order to avoid putting out names that are never really + used. */ + if (TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (decl))) + { + /* maybe_assemble_visibility will return 1 if the assembler + visibility directive is outputed. */ + int need_visibility = ((*targetm.binds_local_p) (decl) + && maybe_assemble_visibility (decl)); + + /* GNU as does not need anything here, but the HP linker does + need something for external functions. */ + if ((TARGET_HPUX_LD || !TARGET_GNU_AS) + && TREE_CODE (decl) == FUNCTION_DECL) + { + ASM_OUTPUT_TYPE_DIRECTIVE (file, name, "function"); + (*targetm.asm_out.globalize_label) (file, name); + } + else if (need_visibility && !TARGET_GNU_AS) + (*targetm.asm_out.globalize_label) (file, name); } - - extern_func_head = 0; } /* Set SImode div/mod functions, init_integral_libfuncs only initializes Modified: projects/binutils-2.17/contrib/gcc/output.h ============================================================================== --- projects/binutils-2.17/contrib/gcc/output.h Thu Nov 18 18:22:58 2010 (r215463) +++ projects/binutils-2.17/contrib/gcc/output.h Thu Nov 18 18:30:03 2010 (r215464) @@ -200,9 +200,9 @@ extern void assemble_variable (tree, int DONT_OUTPUT_DATA is from assemble_variable. */ extern void align_variable (tree decl, bool dont_output_data); -/* Output something to declare an external symbol to the assembler. - (Most assemblers don't need this, so we normally output nothing.) - Do nothing if DECL is not external. */ +/* Queue for outputing something to declare an external symbol to the + assembler. (Most assemblers don't need this, so we normally output + nothing.) Do nothing if DECL is not external. */ extern void assemble_external (tree); /* Assemble code to leave SIZE bytes of zeros. */ @@ -607,6 +607,10 @@ extern void default_file_start (void); extern void file_end_indicate_exec_stack (void); extern bool default_valid_pointer_mode (enum machine_mode); +extern void default_elf_asm_output_external (FILE *file, tree, + const char *); +extern int maybe_assemble_visibility (tree); + extern int default_address_cost (rtx); /* dbxout helper functions */ Modified: projects/binutils-2.17/contrib/gcc/toplev.c ============================================================================== --- projects/binutils-2.17/contrib/gcc/toplev.c Thu Nov 18 18:22:58 2010 (r215463) +++ projects/binutils-2.17/contrib/gcc/toplev.c Thu Nov 18 18:30:03 2010 (r215464) @@ -1080,9 +1080,7 @@ compile_file (void) dw2_output_indirect_constants (); - /* Flush any pending external directives. cgraph did this for - assemble_external calls from the front end, but the RTL - expander can also generate them. */ + /* Flush any pending external directives. */ process_pending_assemble_externals (); /* Attach a special .ident directive to the end of the file to identify Modified: projects/binutils-2.17/contrib/gcc/varasm.c ============================================================================== --- projects/binutils-2.17/contrib/gcc/varasm.c Thu Nov 18 18:22:58 2010 (r215463) +++ projects/binutils-2.17/contrib/gcc/varasm.c Thu Nov 18 18:30:03 2010 (r215464) @@ -126,7 +126,6 @@ static unsigned HOST_WIDE_INT array_size static unsigned min_align (unsigned, unsigned); static void output_constructor (tree, unsigned HOST_WIDE_INT, unsigned int); static void globalize_decl (tree); -static void maybe_assemble_visibility (tree); #ifdef BSS_SECTION_ASM_OP #ifdef ASM_OUTPUT_BSS static void asm_output_bss (FILE *, tree, const char *, @@ -1957,11 +1956,10 @@ assemble_external (tree decl ATTRIBUTE_U if (!DECL_P (decl) || !DECL_EXTERNAL (decl) || !TREE_PUBLIC (decl)) return; - if (flag_unit_at_a_time) - pending_assemble_externals = tree_cons (0, decl, - pending_assemble_externals); - else - assemble_external_real (decl); + /* We want to output external symbols at very last to check if they + are references or not. */ + pending_assemble_externals = tree_cons (0, decl, + pending_assemble_externals); #endif } @@ -5064,13 +5062,18 @@ default_assemble_visibility (tree decl, /* A helper function to call assemble_visibility when needed for a decl. */ -static void +int maybe_assemble_visibility (tree decl) { enum symbol_visibility vis = DECL_VISIBILITY (decl); if (vis != VISIBILITY_DEFAULT) - targetm.asm_out.visibility (decl, vis); + { + targetm.asm_out.visibility (decl, vis); + return 1; + } + else + return 0; } /* Returns 1 if the target configuration supports defining public symbols @@ -6224,4 +6227,19 @@ output_object_blocks (void) htab_traverse (object_block_htab, output_object_block_htab, NULL); } +/* Emit text to declare externally defined symbols. It is needed to + properly support non-default visibility. */ +void +default_elf_asm_output_external (FILE *file ATTRIBUTE_UNUSED, + tree decl, + const char *name ATTRIBUTE_UNUSED) +{ + /* We output the name if and only if TREE_SYMBOL_REFERENCED is + set in order to avoid putting out names that are never really + used. */ + if (TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (decl)) + && targetm.binds_local_p (decl)) + maybe_assemble_visibility (decl); +} + #include "gt-varasm.h" Modified: projects/binutils-2.17/contrib/ipfilter/man/ipnat.8 ============================================================================== --- projects/binutils-2.17/contrib/ipfilter/man/ipnat.8 Thu Nov 18 18:22:58 2010 (r215463) +++ projects/binutils-2.17/contrib/ipfilter/man/ipnat.8 Thu Nov 18 18:30:03 2010 (r215464) @@ -66,6 +66,6 @@ and active rules/table entries. .SH FILES /dev/ipnat .br -/usr/share/examples/ipf Directory with examples. +/usr/share/examples/ipfilter Directory with examples. .SH SEE ALSO ipnat(5), ipf(8), ipfstat(8) Modified: projects/binutils-2.17/contrib/ipfilter/man/mkfilters.1 ============================================================================== --- projects/binutils-2.17/contrib/ipfilter/man/mkfilters.1 Thu Nov 18 18:22:58 2010 (r215463) +++ projects/binutils-2.17/contrib/ipfilter/man/mkfilters.1 Thu Nov 18 18:30:03 2010 (r215464) @@ -6,7 +6,7 @@ mkfilters \- generate a minimal firewall .SH SYNOPSIS .B mkfilters .SH FILES -/usr/share/examples/ipf/mkfilters +/usr/share/examples/ipfilter/mkfilters .SH DESCRIPTION .PP \fBmkfilters\fP is a perl script that generates a minimal filter rule set for Modified: projects/binutils-2.17/gnu/usr.bin/binutils/ld/Makefile.amd64 ============================================================================== --- projects/binutils-2.17/gnu/usr.bin/binutils/ld/Makefile.amd64 Thu Nov 18 18:22:58 2010 (r215463) +++ projects/binutils-2.17/gnu/usr.bin/binutils/ld/Makefile.amd64 Thu Nov 18 18:30:03 2010 (r215464) @@ -12,7 +12,7 @@ e${NATIVE_EMULATION}.c: emulparams/${NAT ${NATIVE_EMULATION} "" no ${NATIVE_EMULATION} ${TARGET_TUPLE} X86_EMULATION= elf_i386_fbsd -_i386_path= \"${TOOLS_PREFIX}/usr/lib/i386\" +_i386_path= \"${TOOLS_PREFIX}/usr/lib32\" EMS+= ${X86_EMULATION} .for ext in ${ELF_SCR_EXT} LDSCRIPTS+= ${X86_EMULATION}.${ext} Modified: projects/binutils-2.17/gnu/usr.bin/cc/cc_tools/Makefile ============================================================================== --- projects/binutils-2.17/gnu/usr.bin/cc/cc_tools/Makefile Thu Nov 18 18:22:58 2010 (r215463) +++ projects/binutils-2.17/gnu/usr.bin/cc/cc_tools/Makefile Thu Nov 18 18:30:03 2010 (r215464) @@ -307,7 +307,7 @@ GENSRCS+= gcov-iov.h # Multilib config file multilib.h: -.if ${TARGET_ARCH} == "powerpc64" +.if ${TARGET_ARCH} == "powerpc64" || ${TARGET_ARCH} == "amd64" echo 'static const char *const multilib_raw[] = { \ ". !m64 !m32;", \ "64:../lib m64 !m32;", \ Modified: projects/binutils-2.17/lib/libusb/libusb.3 ============================================================================== --- projects/binutils-2.17/lib/libusb/libusb.3 Thu Nov 18 18:22:58 2010 (r215463) +++ projects/binutils-2.17/lib/libusb/libusb.3 Thu Nov 18 18:30:03 2010 (r215464) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 14, 2010 +.Dd November 18, 2010 .Dt LIBUSB 3 .Os .Sh NAME @@ -380,10 +380,15 @@ LIBUSB_ERROR code on failure. .Pp .Ft int .Fn libusb_control_transfer "libusb_device_handle *devh" "uint8_t bmRequestType" "uint8_t bRequest" "uint16_t wValue" "uint16_t wIndex" "unsigned char *data" "uint16_t wLength" "unsigned int timeout" -Perform a USB control transfer. Returns 0 on success, LIBUSB_ERROR_TIMEOUT -if the transfer timeout, LIBUSB_ERROR_PIPE if the control request was not -supported, LIBUSB_ERROR_NO_DEVICE if the device has been disconnected and -LIBUSB_ERROR code on other failure. +Perform a USB control transfer. Returns the actual number of bytes +transferred on success in the range from and including zero until and +including +.Xa wLength . +On error a libusb error code is returned, for example +LIBUSB_ERROR_TIMEOUT if the transfer timeout, LIBUSB_ERROR_PIPE if the +control request was not supported, LIBUSB_ERROR_NO_DEVICE if the +device has been disconnected or another LIBUSB_ERROR code on other failures. +The libusb error codes are always negative. . .Pp .Ft int Modified: projects/binutils-2.17/share/man/man4/ata.4 ============================================================================== --- projects/binutils-2.17/share/man/man4/ata.4 Thu Nov 18 18:22:58 2010 (r215463) +++ projects/binutils-2.17/share/man/man4/ata.4 Thu Nov 18 18:30:03 2010 (r215464) @@ -183,7 +183,7 @@ SIS963, SIS964, SIS965. .It VIA: VT6410, VT6420, VT6421, VT82C586, VT82C586B, VT82C596, VT82C596B, VT82C686, VT82C686A, VT82C686B, VT8231, VT8233, VT8233A, VT8233C, VT8235, VT8237, -VT8237A, VT8237S, VT8251, CX700, VX800, VX855. +VT8237A, VT8237S, VT8251, CX700, VX800, VX855, VX900. .El .Pp Unknown ATA chipsets are supported in PIO modes, and if the standard Modified: projects/binutils-2.17/share/mk/Makefile ============================================================================== --- projects/binutils-2.17/share/mk/Makefile Thu Nov 18 18:22:58 2010 (r215463) +++ projects/binutils-2.17/share/mk/Makefile Thu Nov 18 18:30:03 2010 (r215464) @@ -5,7 +5,7 @@ FILES= bsd.README FILES+= bsd.arch.inc.mk FILES+= bsd.compat.mk bsd.cpu.mk bsd.dep.mk bsd.doc.mk bsd.dtrace.mk FILES+= bsd.endian.mk -FILES+= bsd.files.mk bsd.incs.mk bsd.info.mk bsd.init.mk +FILES+= bsd.files.mk bsd.crunchgen.mk bsd.incs.mk bsd.info.mk bsd.init.mk FILES+= bsd.kmod.mk FILES+= bsd.lib.mk bsd.libnames.mk bsd.links.mk bsd.man.mk bsd.nls.mk FILES+= bsd.obj.mk bsd.own.mk Modified: projects/binutils-2.17/share/mk/bsd.crunchgen.mk ============================================================================== --- projects/binutils-2.17/share/mk/bsd.crunchgen.mk Thu Nov 18 18:22:58 2010 (r215463) +++ projects/binutils-2.17/share/mk/bsd.crunchgen.mk Thu Nov 18 18:30:03 2010 (r215464) @@ -51,17 +51,14 @@ $(OUTPUTS): $(CRUNCH_SRCDIR_${P})/Makefi .else $(OUTPUTS): $(.CURDIR)/../../$(D)/$(P)/Makefile .endif -# Disable building links for bsdbox - whatever is installing the binaries into -# the embedded system should (for now) do the linking there. This may change -# in the future. -adrian -#.ifndef CRUNCH_SUPPRESS_LINK_${P} -#LINKS+= $(BINDIR)/$(PROG) $(BINDIR)/$(P) -#.endif -#.for A in $(CRUNCH_ALIAS_$(P)) -#.ifndef CRUNCH_SUPPRESS_LINK_${A} -#LINKS+= $(BINDIR)/$(PROG) $(BINDIR)/$(A) -#.endif -#.endfor +.ifndef CRUNCH_SUPPRESS_LINK_${P} +LINKS+= $(BINDIR)/$(PROG) $(BINDIR)/$(P) +.endif +.for A in $(CRUNCH_ALIAS_$(P)) +.ifndef CRUNCH_SUPPRESS_LINK_${A} +LINKS+= $(BINDIR)/$(PROG) $(BINDIR)/$(A) +.endif +.endfor .endfor .endfor Modified: projects/binutils-2.17/sys/amd64/amd64/amd64_mem.c ============================================================================== --- projects/binutils-2.17/sys/amd64/amd64/amd64_mem.c Thu Nov 18 18:22:58 2010 (r215463) +++ projects/binutils-2.17/sys/amd64/amd64/amd64_mem.c Thu Nov 18 18:30:03 2010 (r215464) @@ -307,20 +307,21 @@ amd64_mrstoreone(void *arg) struct mem_range_desc *mrd; u_int64_t omsrv, msrv; int i, j, msr; - u_int cr4save; + u_long cr0, cr4; mrd = sc->mr_desc; /* Disable PGE. */ - cr4save = rcr4(); - if (cr4save & CR4_PGE) - load_cr4(cr4save & ~CR4_PGE); + cr4 = rcr4(); + load_cr4(cr4 & ~CR4_PGE); /* Disable caches (CD = 1, NW = 0). */ - load_cr0((rcr0() & ~CR0_NW) | CR0_CD); + cr0 = rcr0(); + load_cr0((cr0 & ~CR0_NW) | CR0_CD); /* Flushes caches and TLBs. */ wbinvd(); + invltlb(); /* Disable MTRRs (E = 0). */ wrmsr(MSR_MTRRdefType, rdmsr(MSR_MTRRdefType) & ~MTRR_DEF_ENABLE); @@ -388,17 +389,16 @@ amd64_mrstoreone(void *arg) wrmsr(msr + 1, msrv); } - /* Flush caches, TLBs. */ + /* Flush caches and TLBs. */ wbinvd(); + invltlb(); /* Enable MTRRs. */ wrmsr(MSR_MTRRdefType, rdmsr(MSR_MTRRdefType) | MTRR_DEF_ENABLE); - /* Enable caches (CD = 0, NW = 0). */ - load_cr0(rcr0() & ~(CR0_CD | CR0_NW)); - - /* Restore PGE. */ - load_cr4(cr4save); + /* Restore caches and PGE. */ + load_cr0(cr0); + load_cr4(cr4); } /* Modified: projects/binutils-2.17/sys/boot/ofw/libofw/ofw_copy.c ============================================================================== --- projects/binutils-2.17/sys/boot/ofw/libofw/ofw_copy.c Thu Nov 18 18:22:58 2010 (r215463) +++ projects/binutils-2.17/sys/boot/ofw/libofw/ofw_copy.c Thu Nov 18 18:30:03 2010 (r215464) @@ -91,16 +91,22 @@ ofw_mapmem(vm_offset_t dest, const size_ return (ENOMEM); } - if (OF_call_method("claim", mmu, 3, 1, destp, dlen, 0, &addr) == -1) { - printf("ofw_mapmem: virtual claim failed\n"); - return (ENOMEM); - } - - if (OF_call_method("map", mmu, 4, 0, destp, destp, dlen, 0) == -1) { - printf("ofw_mapmem: map failed\n"); - return (ENOMEM); - } + /* + * We only do virtual memory management when real_mode is false. + */ + if (real_mode == 0) { + if (OF_call_method("claim", mmu, 3, 1, destp, dlen, 0, &addr) + == -1) { + printf("ofw_mapmem: virtual claim failed\n"); + return (ENOMEM); + } + if (OF_call_method("map", mmu, 4, 0, destp, destp, dlen, 0) + == -1) { + printf("ofw_mapmem: map failed\n"); + return (ENOMEM); + } + } last_dest = (vm_offset_t) destp; last_len = dlen; Modified: projects/binutils-2.17/sys/boot/ofw/libofw/ofw_net.c ============================================================================== --- projects/binutils-2.17/sys/boot/ofw/libofw/ofw_net.c Thu Nov 18 18:22:58 2010 (r215463) +++ projects/binutils-2.17/sys/boot/ofw/libofw/ofw_net.c Thu Nov 18 18:30:03 2010 (r215464) @@ -90,11 +90,11 @@ ofwn_probe(struct netif *nif, void *mach static int ofwn_put(struct iodesc *desc, void *pkt, size_t len) { - struct ether_header *eh; size_t sendlen; ssize_t rv; #if defined(NETIF_DEBUG) + struct ether_header *eh; printf("netif_put: desc=0x%x pkt=0x%x len=%d\n", desc, pkt, len); eh = pkt; printf("dst: %s ", ether_sprintf(eh->ether_dhost)); Modified: projects/binutils-2.17/sys/boot/ofw/libofw/openfirm.c ============================================================================== --- projects/binutils-2.17/sys/boot/ofw/libofw/openfirm.c Thu Nov 18 18:22:58 2010 (r215463) +++ projects/binutils-2.17/sys/boot/ofw/libofw/openfirm.c Thu Nov 18 18:30:03 2010 (r215464) @@ -69,12 +69,15 @@ int (*openfirmware)(void *); phandle_t chosen; ihandle_t mmu; ihandle_t memory; +int real_mode = 0; /* Initialiser */ void OF_init(int (*openfirm)(void *)) { + phandle_t options; + char mode[8]; openfirmware = openfirm; @@ -89,6 +92,15 @@ OF_init(int (*openfirm)(void *)) } if (OF_getprop(chosen, "mmu", &mmu, sizeof(mmu)) == -1) OF_exit(); + + /* + * Check if we run in real mode. If so, we do not need to map + * memory later on. + */ + options = OF_finddevice("/options"); + OF_getprop(options, "real-mode?", mode, sizeof(mode)); + if (strncmp(mode, "true", 4) == 0) + real_mode = 1; } /* Modified: projects/binutils-2.17/sys/boot/ofw/libofw/openfirm.h ============================================================================== --- projects/binutils-2.17/sys/boot/ofw/libofw/openfirm.h Thu Nov 18 18:22:58 2010 (r215463) +++ projects/binutils-2.17/sys/boot/ofw/libofw/openfirm.h Thu Nov 18 18:30:03 2010 (r215464) @@ -72,6 +72,7 @@ typedef unsigned long int cell_t; extern int (*openfirmware)(void *); extern phandle_t chosen; extern ihandle_t memory, mmu; +extern int real_mode; /* * This isn't actually an Open Firmware function, but it seemed like the right Modified: projects/binutils-2.17/sys/boot/powerpc/ofw/start.c ============================================================================== --- projects/binutils-2.17/sys/boot/powerpc/ofw/start.c Thu Nov 18 18:22:58 2010 (r215463) +++ projects/binutils-2.17/sys/boot/powerpc/ofw/start.c Thu Nov 18 18:30:03 2010 (r215464) @@ -50,7 +50,20 @@ _start: \n\ addi %r1,%r1,stack@l \n\ addi %r1,%r1,8192 \n\ \n\ - b startup \n\ + /* Clear the .bss!!! */ \n\ + li %r0,0 \n\ + lis %r8,_edata@ha \n\ + addi %r8,%r8,_edata@l\n\ + lis %r9,_end@ha \n\ + addi %r9,%r9,_end@l \n\ + \n\ +1: cmpw 0,%r8,%r9 \n\ + bge 2f \n\ + stw %r0,0(%r8) \n\ + addi %r8,%r8,4 \n\ + b 1b \n\ + \n\ +2: b startup \n\ "); void Modified: projects/binutils-2.17/sys/cam/ata/ata_xpt.c ============================================================================== --- projects/binutils-2.17/sys/cam/ata/ata_xpt.c Thu Nov 18 18:22:58 2010 (r215463) +++ projects/binutils-2.17/sys/cam/ata/ata_xpt.c Thu Nov 18 18:30:03 2010 (r215464) @@ -963,6 +963,8 @@ noerror: xpt_action((union ccb *)&cts); if (cts.xport_specific.sata.valid & CTS_SATA_VALID_CAPS) caps &= cts.xport_specific.sata.caps; + else + caps = 0; /* Store result to SIM. */ bzero(&cts, sizeof(cts)); xpt_setup_ccb(&cts.ccb_h, path, CAM_PRIORITY_NONE); @@ -1103,6 +1105,8 @@ notsata: xpt_action((union ccb *)&cts); if (cts.xport_specific.sata.valid & CTS_SATA_VALID_CAPS) caps &= cts.xport_specific.sata.caps; + else + caps = 0; /* Store result to SIM. */ bzero(&cts, sizeof(cts)); xpt_setup_ccb(&cts.ccb_h, path, CAM_PRIORITY_NONE); Modified: projects/binutils-2.17/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c ============================================================================== --- projects/binutils-2.17/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Thu Nov 18 18:22:58 2010 (r215463) +++ projects/binutils-2.17/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Thu Nov 18 18:30:03 2010 (r215464) @@ -1557,7 +1557,7 @@ zfs_vget(vfs_t *vfsp, ino_t ino, int fla int err; /* - * zfs_zget() can't operate on virtual entires like .zfs/ or + * zfs_zget() can't operate on virtual entries like .zfs/ or * .zfs/snapshot/ directories, that's why we return EOPNOTSUPP. * This will make NFS to switch to LOOKUP instead of using VGET. */ Modified: projects/binutils-2.17/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- projects/binutils-2.17/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Thu Nov 18 18:22:58 2010 (r215463) +++ projects/binutils-2.17/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Thu Nov 18 18:30:03 2010 (r215464) @@ -67,6 +67,7 @@ #include #include #include +#include /* * Programming rules. @@ -481,7 +482,7 @@ again: uiomove_fromphys(&m, off, bytes, uio); VM_OBJECT_LOCK(obj); vm_page_wakeup(m); - } else if (m != NULL && uio->uio_segflg == UIO_NOCOPY) { + } else if (uio->uio_segflg == UIO_NOCOPY) { /* * The code below is here to make sendfile(2) work * correctly with ZFS. As pointed out by ups@ @@ -491,7 +492,7 @@ again: */ KASSERT(off == 0, ("unexpected offset in mappedread for sendfile")); - if ((m->oflags & VPO_BUSY) != 0) { + if (m != NULL && (m->oflags & VPO_BUSY) != 0) { /* * Reference the page before unlocking and * sleeping so that the page daemon is less @@ -501,8 +502,17 @@ again: vm_page_flag_set(m, PG_REFERENCED); vm_page_sleep(m, "zfsmrb"); goto again; + } else if (m == NULL) { + m = vm_page_alloc(obj, OFF_TO_IDX(start), + VM_ALLOC_NOBUSY | VM_ALLOC_NORMAL); + if (m == NULL) { + VM_OBJECT_UNLOCK(obj); + VM_WAIT; + VM_OBJECT_LOCK(obj); + goto again; + } } - vm_page_busy(m); + vm_page_io_start(m); VM_OBJECT_UNLOCK(obj); if (dirbytes > 0) { error = dmu_read_uio(os, zp->z_id, uio, @@ -520,7 +530,7 @@ again: VM_OBJECT_LOCK(obj); if (error == 0) m->valid = VM_PAGE_BITS_ALL; - vm_page_wakeup(m); + vm_page_io_finish(m); if (error == 0) { uio->uio_resid -= bytes; uio->uio_offset += bytes; Modified: projects/binutils-2.17/sys/compat/ndis/ntoskrnl_var.h ============================================================================== --- projects/binutils-2.17/sys/compat/ndis/ntoskrnl_var.h Thu Nov 18 18:22:58 2010 (r215463) +++ projects/binutils-2.17/sys/compat/ndis/ntoskrnl_var.h Thu Nov 18 18:30:03 2010 (r215464) @@ -162,6 +162,16 @@ typedef struct mdl mdl, ndis_buffer; #define WDM_MINOR_WINXP 0x20 #define WDM_MINOR_WIN2003 0x30 +enum nt_caching_type { + MmNonCached = 0, + MmCached = 1, + MmWriteCombined = 2, + MmHardwareCoherentCached = 3, + MmNonCachedUnordered = 4, + MmUSWCCached = 5, + MmMaximumCacheType = 6 +}; + /*- * The ndis_kspin_lock type is called KSPIN_LOCK in MS-Windows. * According to the Windows DDK header files, KSPIN_LOCK is defined like this: Modified: projects/binutils-2.17/sys/compat/ndis/subr_ntoskrnl.c ============================================================================== --- projects/binutils-2.17/sys/compat/ndis/subr_ntoskrnl.c Thu Nov 18 18:22:58 2010 (r215463) +++ projects/binutils-2.17/sys/compat/ndis/subr_ntoskrnl.c Thu Nov 18 18:30:03 2010 (r215464) @@ -68,6 +68,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -197,9 +198,10 @@ static uint32_t InterlockedDecrement(vol static void ExInterlockedAddLargeStatistic(uint64_t *, uint32_t); static void *MmAllocateContiguousMemory(uint32_t, uint64_t); static void *MmAllocateContiguousMemorySpecifyCache(uint32_t, - uint64_t, uint64_t, uint64_t, uint32_t); + uint64_t, uint64_t, uint64_t, enum nt_caching_type); static void MmFreeContiguousMemory(void *); -static void MmFreeContiguousMemorySpecifyCache(void *, uint32_t, uint32_t); +static void MmFreeContiguousMemorySpecifyCache(void *, uint32_t, + enum nt_caching_type); static uint32_t MmSizeOfMdl(void *, size_t); static void *MmMapLockedPages(mdl *, uint8_t); static void *MmMapLockedPagesSpecifyCache(mdl *, @@ -2424,11 +2426,34 @@ MmAllocateContiguousMemorySpecifyCache(s uint64_t lowest; uint64_t highest; uint64_t boundary; - uint32_t cachetype; + enum nt_caching_type cachetype; { + vm_memattr_t memattr; + void *ret; - return (contigmalloc(size, M_DEVBUF, M_ZERO|M_NOWAIT, lowest, - highest, PAGE_SIZE, boundary)); + switch (cachetype) { + case MmNonCached: + memattr = VM_MEMATTR_UNCACHEABLE; + break; + case MmWriteCombined: + memattr = VM_MEMATTR_WRITE_COMBINING; + break; + case MmNonCachedUnordered: + memattr = VM_MEMATTR_UNCACHEABLE; + break; + case MmCached: + case MmHardwareCoherentCached: + case MmUSWCCached: + default: + memattr = VM_MEMATTR_DEFAULT; + break; + } + + ret = (void *)kmem_alloc_contig(kernel_map, size, M_ZERO | M_NOWAIT, + lowest, highest, PAGE_SIZE, boundary, memattr); + if (ret != NULL) + malloc_type_allocated(M_DEVBUF, round_page(size)); + return (ret); } static void @@ -2442,7 +2467,7 @@ static void MmFreeContiguousMemorySpecifyCache(base, size, cachetype) void *base; uint32_t size; - uint32_t cachetype; + enum nt_caching_type cachetype; { contigfree(base, size, M_DEVBUF); } @@ -4212,8 +4237,8 @@ image_patch_table ntoskrnl_functbl[] = { IMPORT_FFUNC(ExInterlockedAddLargeStatistic, 2), IMPORT_SFUNC(IoAllocateMdl, 5), IMPORT_SFUNC(IoFreeMdl, 1), - IMPORT_SFUNC(MmAllocateContiguousMemory, 2), - IMPORT_SFUNC(MmAllocateContiguousMemorySpecifyCache, 5), + IMPORT_SFUNC(MmAllocateContiguousMemory, 2 + 1), + IMPORT_SFUNC(MmAllocateContiguousMemorySpecifyCache, 5 + 3), IMPORT_SFUNC(MmFreeContiguousMemory, 1), IMPORT_SFUNC(MmFreeContiguousMemorySpecifyCache, 3), IMPORT_SFUNC_MAP(MmGetPhysicalAddress, pmap_kextract, 1), Modified: projects/binutils-2.17/sys/crypto/aesni/aesni_wrap.c ============================================================================== --- projects/binutils-2.17/sys/crypto/aesni/aesni_wrap.c Thu Nov 18 18:22:58 2010 (r215463) +++ projects/binutils-2.17/sys/crypto/aesni/aesni_wrap.c Thu Nov 18 18:30:03 2010 (r215464) @@ -246,14 +246,21 @@ int aesni_cipher_setup(struct aesni_session *ses, struct cryptoini *encini) { struct thread *td; - int error; + int error, saved_ctx; td = curthread; - error = fpu_kern_enter(td, &ses->fpu_ctx, FPU_KERN_NORMAL); + if (!is_fpu_kern_thread(0)) { + error = fpu_kern_enter(td, &ses->fpu_ctx, FPU_KERN_NORMAL); + saved_ctx = 1; + } else { + error = 0; + saved_ctx = 0; + } if (error == 0) { error = aesni_cipher_setup_common(ses, encini->cri_key, encini->cri_klen); - fpu_kern_leave(td, &ses->fpu_ctx); + if (saved_ctx) + fpu_kern_leave(td, &ses->fpu_ctx); } return (error); } @@ -264,16 +271,22 @@ aesni_cipher_process(struct aesni_sessio { struct thread *td; uint8_t *buf; - int error, allocated; + int error, allocated, saved_ctx; buf = aesni_cipher_alloc(enccrd, crp, &allocated); if (buf == NULL) return (ENOMEM); td = curthread; - error = fpu_kern_enter(td, &ses->fpu_ctx, FPU_KERN_NORMAL); - if (error != 0) - goto out; + if (!is_fpu_kern_thread(0)) { + error = fpu_kern_enter(td, &ses->fpu_ctx, FPU_KERN_NORMAL); + if (error != 0) + goto out; + saved_ctx = 1; + } else { + saved_ctx = 0; + error = 0; + } if ((enccrd->crd_flags & CRD_F_KEY_EXPLICIT) != 0) { error = aesni_cipher_setup_common(ses, enccrd->crd_key, @@ -311,7 +324,8 @@ aesni_cipher_process(struct aesni_sessio ses->iv); } } - fpu_kern_leave(td, &ses->fpu_ctx); + if (saved_ctx) + fpu_kern_leave(td, &ses->fpu_ctx); if (allocated) crypto_copyback(crp->crp_flags, crp->crp_buf, enccrd->crd_skip, enccrd->crd_len, buf); Modified: projects/binutils-2.17/sys/dev/ata/ata-pci.h ============================================================================== --- projects/binutils-2.17/sys/dev/ata/ata-pci.h Thu Nov 18 18:22:58 2010 (r215463) +++ projects/binutils-2.17/sys/dev/ata/ata-pci.h Thu Nov 18 18:30:03 2010 (r215464) @@ -512,7 +512,10 @@ struct ata_pci_controller { #define ATA_VIACX700 0x83241106 #define ATA_VIASATAIDE 0x53241106 #define ATA_VIAVX800 0x83531106 +#define ATA_VIASATAIDE2 0xc4091106 #define ATA_VIAVX855 0x84091106 +#define ATA_VIASATAIDE3 0x90011106 +#define ATA_VIAVX900 0x84101106 /* global prototypes ata-pci.c */ int ata_pci_probe(device_t dev); Modified: projects/binutils-2.17/sys/dev/ata/ata-sata.c ============================================================================== --- projects/binutils-2.17/sys/dev/ata/ata-sata.c Thu Nov 18 18:22:58 2010 (r215463) +++ projects/binutils-2.17/sys/dev/ata/ata-sata.c Thu Nov 18 18:30:03 2010 (r215464) @@ -153,8 +153,12 @@ ata_sata_phy_reset(device_t dev, int por if (quick) { if (ata_sata_scr_read(ch, port, ATA_SCONTROL, &val)) return (0); - if ((val & ATA_SC_DET_MASK) == ATA_SC_DET_IDLE) + if ((val & ATA_SC_DET_MASK) == ATA_SC_DET_IDLE) { + ata_sata_scr_write(ch, port, ATA_SCONTROL, + ATA_SC_DET_IDLE | ((ch->pm_level > 0) ? 0 : + ATA_SC_IPM_DIS_PARTIAL | ATA_SC_IPM_DIS_SLUMBER)); return ata_sata_connect(ch, port, quick); + } } if (bootverbose) { Modified: projects/binutils-2.17/sys/dev/ata/chipsets/ata-via.c ============================================================================== --- projects/binutils-2.17/sys/dev/ata/chipsets/ata-via.c Thu Nov 18 18:22:58 2010 (r215463) +++ projects/binutils-2.17/sys/dev/ata/chipsets/ata-via.c Thu Nov 18 18:30:03 2010 (r215464) @@ -63,6 +63,12 @@ static int ata_via_new_setmode(device_t static int ata_via_sata_ch_attach(device_t dev); static int ata_via_sata_getrev(device_t dev, int target); static int ata_via_sata_setmode(device_t dev, int target, int mode); +static void ata_via_sata_reset(device_t dev); +static int ata_via_sata_scr_read(device_t dev, int port, int reg, + u_int32_t *result); +static int ata_via_sata_scr_write(device_t dev, int port, int reg, + u_int32_t value); +static int ata_via_sata_status(device_t dev); /* misc defines */ #define VIA33 0 @@ -106,6 +112,7 @@ ata_via_probe(device_t dev) { ATA_VIACX700, 0x00, VIA133, VIASATA, ATA_SA150, "CX700" }, { ATA_VIAVX800, 0x00, VIA133, VIASATA, ATA_SA150, "VX800" }, { ATA_VIAVX855, 0x00, VIA133, 0x00, ATA_UDMA6, "VX855" }, + { ATA_VIAVX900, 0x00, VIA133, VIASATA, ATA_SA300, "VX900" }, { 0, 0, 0, 0, 0, 0 }}; static struct ata_chip_id new_ids[] = {{ ATA_VIA6410, 0x00, 0, 0x00, ATA_UDMA6, "6410" }, @@ -123,7 +130,9 @@ ata_via_probe(device_t dev) if (pci_get_devid(dev) == ATA_VIA82C571 || pci_get_devid(dev) == ATA_VIACX700IDE || - pci_get_devid(dev) == ATA_VIASATAIDE) { + pci_get_devid(dev) == ATA_VIASATAIDE || + pci_get_devid(dev) == ATA_VIASATAIDE2 || + pci_get_devid(dev) == ATA_VIASATAIDE3) { if (!(ctlr->chip = ata_find_chip(dev, ids, -99))) return ENXIO; } @@ -150,11 +159,12 @@ ata_via_chipinit(device_t dev) if (ata_ahci_chipinit(dev) != ENXIO) return (0); } - /* 2 SATA without SATA registers on first channel + 1 PATA on second */ + /* 2 SATA with "SATA registers" at PCI config space + PATA on secondary */ if (ctlr->chip->cfg2 & VIASATA) { ctlr->ch_attach = ata_via_sata_ch_attach; ctlr->setmode = ata_via_sata_setmode; ctlr->getrev = ata_via_sata_getrev; + ctlr->reset = ata_via_sata_reset; return 0; } /* Legacy SATA/SATA+PATA with SATA registers in BAR(5). */ @@ -402,18 +412,30 @@ ata_via_sata_ch_attach(device_t dev) if (ata_pci_ch_attach(dev)) return ENXIO; - if (ch->unit == 0) + if (ch->unit == 0) { + ch->hw.status = ata_via_sata_status; + ch->hw.pm_read = ata_via_sata_scr_read; + ch->hw.pm_write = ata_via_sata_scr_write; + ch->flags |= ATA_PERIODIC_POLL; ch->flags |= ATA_SATA; + ata_sata_scr_write(ch, 0, ATA_SERROR, 0xffffffff); + ata_sata_scr_write(ch, 1, ATA_SERROR, 0xffffffff); + } return (0); } static int ata_via_sata_getrev(device_t dev, int target) { + device_t parent = device_get_parent(dev); struct ata_channel *ch = device_get_softc(dev); - if (ch->unit == 0) - return (1); + if (ch->unit == 0) { + if (pci_read_config(parent, 0xa0 + target, 1) & 0x10) + return (2); + else + return (1); + } return (0); } @@ -427,5 +449,112 @@ ata_via_sata_setmode(device_t dev, int t return (ata_via_old_setmode(dev, target, mode)); } +static void +ata_via_sata_reset(device_t dev) +{ + struct ata_channel *ch = device_get_softc(dev); + int devs; + + if (ch->unit == 0) { + devs = ata_sata_phy_reset(dev, 0, 0); + DELAY(10000); + devs += ata_sata_phy_reset(dev, 1, 0); + } else + devs = 1; + if (devs) + ata_generic_reset(dev); + else + ch->devices = 0; +} + +static int +ata_via_sata_scr_read(device_t dev, int port, int reg, u_int32_t *result) +{ + struct ata_channel *ch; + device_t parent; + uint32_t val; + + parent = device_get_parent(dev); + ch = device_get_softc(dev); + port = (port == 1) ? 1 : 0; + switch (reg) { + case ATA_SSTATUS: *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***