diff options
author | attilio <attilio@FreeBSD.org> | 2011-06-04 22:05:20 +0000 |
---|---|---|
committer | attilio <attilio@FreeBSD.org> | 2011-06-04 22:05:20 +0000 |
commit | 8e66ca1ff16b21df31a40fa743f8df3844507305 (patch) | |
tree | 7235c316aab81a86e3bfc131b1abae5475040624 | |
parent | 91525e4ff96713dd3149a3477069cc7213d0abae (diff) | |
parent | 786c89f781c52e7423abdc562256ef0830f60be6 (diff) | |
download | FreeBSD-src-8e66ca1ff16b21df31a40fa743f8df3844507305.zip FreeBSD-src-8e66ca1ff16b21df31a40fa743f8df3844507305.tar.gz |
MFC
258 files changed, 2520 insertions, 854 deletions
diff --git a/bin/sh/alias.c b/bin/sh/alias.c index 4662519..929c68e 100644 --- a/bin/sh/alias.c +++ b/bin/sh/alias.c @@ -238,7 +238,7 @@ aliascmd(int argc, char **argv) while ((n = *++argv) != NULL) { if ((v = strchr(n+1, '=')) == NULL) /* n+1: funny ksh stuff */ if ((ap = lookupalias(n, 0)) == NULL) { - warning("%s not found", n); + warning("%s: not found", n); ret = 1; } else printalias(ap); diff --git a/bin/sh/eval.c b/bin/sh/eval.c index a50c53f..404de33 100644 --- a/bin/sh/eval.c +++ b/bin/sh/eval.c @@ -165,7 +165,7 @@ evalstring(char *s, int flags) setstackmark(&smark); setinputstring(s, 1); while ((n = parsecmd(0)) != NEOF) { - if (n != NULL) { + if (n != NULL && !nflag) { if (flags_exit && preadateof()) evaltree(n, flags | EV_EXIT); else diff --git a/bin/sh/input.c b/bin/sh/input.c index e7baed3..c8b1a45 100644 --- a/bin/sh/input.c +++ b/bin/sh/input.c @@ -403,7 +403,7 @@ setinputfile(const char *fname, int push) INTOFF; if ((fd = open(fname, O_RDONLY)) < 0) - error("Can't open %s: %s", fname, strerror(errno)); + error("cannot open %s: %s", fname, strerror(errno)); if (fd < 10) { fd2 = fcntl(fd, F_DUPFD, 10); close(fd); diff --git a/bin/sh/jobs.c b/bin/sh/jobs.c index f4f1dac..434af22 100644 --- a/bin/sh/jobs.c +++ b/bin/sh/jobs.c @@ -820,7 +820,7 @@ forkshell(struct job *jp, union node *n, int mode) ! fd0_redirected_p ()) { close(0); if (open(_PATH_DEVNULL, O_RDONLY) != 0) - error("Can't open %s: %s", + error("cannot open %s: %s", _PATH_DEVNULL, strerror(errno)); } } @@ -832,7 +832,7 @@ forkshell(struct job *jp, union node *n, int mode) ! fd0_redirected_p ()) { close(0); if (open(_PATH_DEVNULL, O_RDONLY) != 0) - error("Can't open %s: %s", + error("cannot open %s: %s", _PATH_DEVNULL, strerror(errno)); } } diff --git a/bin/sh/main.c b/bin/sh/main.c index 408d37c..9cef1b0 100644 --- a/bin/sh/main.c +++ b/bin/sh/main.c @@ -264,7 +264,7 @@ readcmdfile(const char *name) if ((fd = open(name, O_RDONLY)) >= 0) setinputfd(fd, 1); else - error("Can't open %s: %s", name, strerror(errno)); + error("cannot open %s: %s", name, strerror(errno)); INTON; cmdloop(0); popfile(); diff --git a/contrib/compiler-rt/CREDITS.TXT b/contrib/compiler-rt/CREDITS.TXT index 8b07b82..818f4fa 100644 --- a/contrib/compiler-rt/CREDITS.TXT +++ b/contrib/compiler-rt/CREDITS.TXT @@ -19,3 +19,6 @@ W: http://www.auroraux.org D: CMake'ify Compiler-RT build system D: Maintain Solaris & AuroraUX ports of Compiler-RT +N: Howard Hinnant +E: hhinnant@apple.com +D: Architect and primary author of compiler-rt diff --git a/contrib/compiler-rt/LICENSE.TXT b/contrib/compiler-rt/LICENSE.TXT index a5e1345..2552e8c 100644 --- a/contrib/compiler-rt/LICENSE.TXT +++ b/contrib/compiler-rt/LICENSE.TXT @@ -1,10 +1,21 @@ ============================================================================== -LLVM Release License +compiler_rt License ============================================================================== + +The compiler_rt library is dual licensed under both the University of Illinois +"BSD-Like" license and the MIT license. As a user of this code you may choose +to use it under either license. As a contributor, you agree to allow your code +to be used under both. + +Full text of the relevant licenses is included below. + +============================================================================== + University of Illinois/NCSA Open Source License -Copyright (c) 2003-2009 University of Illinois at Urbana-Champaign. +Copyright (c) 2009-2010 by the contributors listed in CREDITS.TXT + All rights reserved. Developed by: @@ -43,21 +54,23 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE SOFTWARE. ============================================================================== -Copyrights and Licenses for Third Party Software Distributed with LLVM: -============================================================================== -The LLVM software contains code written by third parties. Such software will -have its own individual LICENSE.TXT file in the directory in which it appears. -This file will describe the copyrights, license, and restrictions which apply -to that code. - -The disclaimer of warranty in the University of Illinois Open Source License -applies to all code in the LLVM Distribution, and nothing in any of the -other licenses gives permission to use the names of the LLVM Team or the -University of Illinois to endorse or promote products derived from this -Software. - -The following pieces of software have additional or alternate copyrights, -licenses, and/or restrictions: - -Program Directory -------- --------- + +Copyright (c) 2009-2010 by the contributors listed in CREDITS.TXT + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (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. diff --git a/contrib/compiler-rt/README.txt b/contrib/compiler-rt/README.txt index ab389d2..cbeb10c 100644 --- a/contrib/compiler-rt/README.txt +++ b/contrib/compiler-rt/README.txt @@ -77,8 +77,12 @@ ti_int __modti3 (ti_int a, ti_int b); // a % b signed su_int __umodsi3 (su_int a, su_int b); // a % b unsigned du_int __umoddi3 (du_int a, du_int b); // a % b unsigned tu_int __umodti3 (tu_int a, tu_int b); // a % b unsigned -du_int __udivmoddi4(du_int a, du_int b, du_int* rem); // a / b, *rem = a % b -tu_int __udivmodti4(tu_int a, tu_int b, tu_int* rem); // a / b, *rem = a % b +du_int __udivmoddi4(du_int a, du_int b, du_int* rem); // a / b, *rem = a % b unsigned +tu_int __udivmodti4(tu_int a, tu_int b, tu_int* rem); // a / b, *rem = a % b unsigned +su_int __udivmodsi4(su_int a, su_int b, su_int* rem); // a / b, *rem = a % b unsigned +si_int __divmodsi4(si_int a, si_int b, si_int* rem); // a / b, *rem = a % b signed + + // Integral arithmetic with trapping overflow diff --git a/contrib/compiler-rt/lib/abi.h b/contrib/compiler-rt/lib/abi.h new file mode 100644 index 0000000..2534317 --- /dev/null +++ b/contrib/compiler-rt/lib/abi.h @@ -0,0 +1,23 @@ +/* ===------ abi.h - configuration header for compiler-rt -----------------=== + * + * The LLVM Compiler Infrastructure + * + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. + * + * ===----------------------------------------------------------------------=== + * + * This file is a configuration header for compiler-rt. + * This file is not part of the interface of this library. + * + * ===----------------------------------------------------------------------=== + */ + +#if __ARM_EABI__ +# define ARM_EABI_FNALIAS(aeabi_name, name) \ + void __aeabi_##aeabi_name() __attribute__((alias("__" #name))); +# define COMPILER_RT_ABI __attribute__((pcs("aapcs"))) +#else +# define ARM_EABI_FNALIAS(aeabi_name, name) +# define COMPILER_RT_ABI +#endif diff --git a/contrib/compiler-rt/lib/absvdi2.c b/contrib/compiler-rt/lib/absvdi2.c index 919afd1..9c5d4a2 100644 --- a/contrib/compiler-rt/lib/absvdi2.c +++ b/contrib/compiler-rt/lib/absvdi2.c @@ -2,8 +2,8 @@ * * The LLVM Compiler Infrastructure * - * This file is distributed under the University of Illinois Open Source - * License. See LICENSE.TXT for details. + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. * *===----------------------------------------------------------------------=== * @@ -11,6 +11,7 @@ * *===----------------------------------------------------------------------=== */ +#include "abi.h" #include "int_lib.h" #include <stdlib.h> @@ -19,7 +20,7 @@ /* Effects: aborts if abs(x) < 0 */ -di_int +COMPILER_RT_ABI di_int __absvdi2(di_int a) { const int N = (int)(sizeof(di_int) * CHAR_BIT); diff --git a/contrib/compiler-rt/lib/absvsi2.c b/contrib/compiler-rt/lib/absvsi2.c index a2c8e3f..80a1a78 100644 --- a/contrib/compiler-rt/lib/absvsi2.c +++ b/contrib/compiler-rt/lib/absvsi2.c @@ -2,15 +2,16 @@ * * The LLVM Compiler Infrastructure * - * This file is distributed under the University of Illinois Open Source - * License. See LICENSE.TXT for details. + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. * * ===----------------------------------------------------------------------=== * * This file implements __absvsi2 for the compiler_rt library. * * ===----------------------------------------------------------------------=== - */ + */ +#include "abi.h" #include "int_lib.h" #include <stdlib.h> @@ -19,7 +20,7 @@ /* Effects: aborts if abs(x) < 0 */ -si_int +COMPILER_RT_ABI si_int __absvsi2(si_int a) { const int N = (int)(sizeof(si_int) * CHAR_BIT); diff --git a/contrib/compiler-rt/lib/absvti2.c b/contrib/compiler-rt/lib/absvti2.c index 0978122..9e73a26 100644 --- a/contrib/compiler-rt/lib/absvti2.c +++ b/contrib/compiler-rt/lib/absvti2.c @@ -2,8 +2,8 @@ * * The LLVM Compiler Infrastructure * - * This file is distributed under the University of Illinois Open Source - * License. See LICENSE.TXT for details. + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. * * ===----------------------------------------------------------------------=== * diff --git a/contrib/compiler-rt/lib/adddf3.c b/contrib/compiler-rt/lib/adddf3.c index 1ec43dc..3cc997b 100644 --- a/contrib/compiler-rt/lib/adddf3.c +++ b/contrib/compiler-rt/lib/adddf3.c @@ -1,21 +1,26 @@ -//===-- lib/adddf3.c - Double-precision addition and subtraction --*- C -*-===// +//===-- lib/adddf3.c - Double-precision addition ------------------*- C -*-===// // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // -// This file implements double-precision soft-float addition and subtraction -// with the IEEE-754 default rounding (to nearest, ties to even). +// This file implements double-precision soft-float addition with the IEEE-754 +// default rounding (to nearest, ties to even). // //===----------------------------------------------------------------------===// +#include "abi.h" + #define DOUBLE_PRECISION #include "fp_lib.h" -fp_t __adddf3(fp_t a, fp_t b) { +ARM_EABI_FNALIAS(dadd, adddf3); + +COMPILER_RT_ABI fp_t +__adddf3(fp_t a, fp_t b) { rep_t aRep = toRep(a); rep_t bRep = toRep(b); @@ -147,8 +152,3 @@ fp_t __adddf3(fp_t a, fp_t b) { if (roundGuardSticky == 0x4) result += result & 1; return fromRep(result); } - -// Subtraction; flip the sign bit of b and add. -fp_t __subdf3(fp_t a, fp_t b) { - return __adddf3(a, fromRep(toRep(b) ^ signBit)); -} diff --git a/contrib/compiler-rt/lib/addsf3.c b/contrib/compiler-rt/lib/addsf3.c index fec14e8..20610ef 100644 --- a/contrib/compiler-rt/lib/addsf3.c +++ b/contrib/compiler-rt/lib/addsf3.c @@ -1,20 +1,24 @@ -//===-- lib/addsf3.c - Single-precision addition and subtraction --*- C -*-===// +//===-- lib/addsf3.c - Single-precision addition ------------------*- C -*-===// // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // -// This file implements single-precision soft-float addition and subtraction -// with the IEEE-754 default rounding (to nearest, ties to even). +// This file implements single-precision soft-float addition with the IEEE-754 +// default rounding (to nearest, ties to even). // //===----------------------------------------------------------------------===// +#include "abi.h" + #define SINGLE_PRECISION #include "fp_lib.h" +ARM_EABI_FNALIAS(fadd, addsf3); + fp_t __addsf3(fp_t a, fp_t b) { rep_t aRep = toRep(a); @@ -147,18 +151,3 @@ fp_t __addsf3(fp_t a, fp_t b) { if (roundGuardSticky == 0x4) result += result & 1; return fromRep(result); } - -// Subtraction; flip the sign bit of b and add. -fp_t __subsf3(fp_t a, fp_t b) { - return __addsf3(a, fromRep(toRep(b) ^ signBit)); -} - - - - - - - - - - diff --git a/contrib/compiler-rt/lib/addvdi3.c b/contrib/compiler-rt/lib/addvdi3.c index 53ab102..51ad397 100644 --- a/contrib/compiler-rt/lib/addvdi3.c +++ b/contrib/compiler-rt/lib/addvdi3.c @@ -2,8 +2,8 @@ * * The LLVM Compiler Infrastructure * - * This file is distributed under the University of Illinois Open Source - * License. See LICENSE.TXT for details. + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. * * ===----------------------------------------------------------------------=== * @@ -11,6 +11,7 @@ * * ===----------------------------------------------------------------------=== */ +#include "abi.h" #include "int_lib.h" #include <stdlib.h> @@ -19,7 +20,7 @@ /* Effects: aborts if a + b overflows */ -di_int +COMPILER_RT_ABI di_int __addvdi3(di_int a, di_int b) { di_int s = a + b; diff --git a/contrib/compiler-rt/lib/addvsi3.c b/contrib/compiler-rt/lib/addvsi3.c index 22cd315..c18f7bd 100644 --- a/contrib/compiler-rt/lib/addvsi3.c +++ b/contrib/compiler-rt/lib/addvsi3.c @@ -2,8 +2,8 @@ * * The LLVM Compiler Infrastructure * - * This file is distributed under the University of Illinois Open Source - * License. See LICENSE.TXT for details. + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. * * ===----------------------------------------------------------------------=== * @@ -11,6 +11,7 @@ * * ===----------------------------------------------------------------------=== */ +#include "abi.h" #include "int_lib.h" #include <stdlib.h> @@ -19,7 +20,7 @@ /* Effects: aborts if a + b overflows */ -si_int +COMPILER_RT_ABI si_int __addvsi3(si_int a, si_int b) { si_int s = a + b; diff --git a/contrib/compiler-rt/lib/addvti3.c b/contrib/compiler-rt/lib/addvti3.c index 3df1a74..ba220f5 100644 --- a/contrib/compiler-rt/lib/addvti3.c +++ b/contrib/compiler-rt/lib/addvti3.c @@ -2,8 +2,8 @@ * * The LLVM Compiler Infrastructure * - * This file is distributed under the University of Illinois Open Source - * License. See LICENSE.TXT for details. + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. * * ===----------------------------------------------------------------------=== * diff --git a/contrib/compiler-rt/lib/apple_versioning.c b/contrib/compiler-rt/lib/apple_versioning.c index 0360026..e838d72 100644 --- a/contrib/compiler-rt/lib/apple_versioning.c +++ b/contrib/compiler-rt/lib/apple_versioning.c @@ -2,8 +2,8 @@ * * The LLVM Compiler Infrastructure * - * This file is distributed under the University of Illinois Open Source - * License. See LICENSE.TXT for details. + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. * * ===----------------------------------------------------------------------=== */ @@ -143,6 +143,147 @@ NOT_HERE_BEFORE_10_6(__gcc_qsub) NOT_HERE_BEFORE_10_6(__trampoline_setup) #endif /* __ppc__ */ +#if __arm__ && __DYNAMIC__ + #define NOT_HERE_UNTIL_AFTER_4_3(sym) \ + extern const char sym##_tmp1 __asm("$ld$hide$os3.0$_" #sym ); \ + __attribute__((visibility("default"))) const char sym##_tmp1 = 0; \ + extern const char sym##_tmp2 __asm("$ld$hide$os3.1$_" #sym ); \ + __attribute__((visibility("default"))) const char sym##_tmp2 = 0; \ + extern const char sym##_tmp3 __asm("$ld$hide$os3.2$_" #sym ); \ + __attribute__((visibility("default"))) const char sym##_tmp3 = 0; \ + extern const char sym##_tmp4 __asm("$ld$hide$os4.0$_" #sym ); \ + __attribute__((visibility("default"))) const char sym##_tmp4 = 0; \ + extern const char sym##_tmp5 __asm("$ld$hide$os4.1$_" #sym ); \ + __attribute__((visibility("default"))) const char sym##_tmp5 = 0; \ + extern const char sym##_tmp6 __asm("$ld$hide$os4.2$_" #sym ); \ + __attribute__((visibility("default"))) const char sym##_tmp6 = 0; \ + extern const char sym##_tmp7 __asm("$ld$hide$os4.3$_" #sym ); \ + __attribute__((visibility("default"))) const char sym##_tmp7 = 0; + +NOT_HERE_UNTIL_AFTER_4_3(__absvdi2) +NOT_HERE_UNTIL_AFTER_4_3(__absvsi2) +NOT_HERE_UNTIL_AFTER_4_3(__adddf3) +NOT_HERE_UNTIL_AFTER_4_3(__adddf3vfp) +NOT_HERE_UNTIL_AFTER_4_3(__addsf3) +NOT_HERE_UNTIL_AFTER_4_3(__addsf3vfp) +NOT_HERE_UNTIL_AFTER_4_3(__addvdi3) +NOT_HERE_UNTIL_AFTER_4_3(__addvsi3) +NOT_HERE_UNTIL_AFTER_4_3(__ashldi3) +NOT_HERE_UNTIL_AFTER_4_3(__ashrdi3) +NOT_HERE_UNTIL_AFTER_4_3(__bswapdi2) +NOT_HERE_UNTIL_AFTER_4_3(__bswapsi2) +NOT_HERE_UNTIL_AFTER_4_3(__clzdi2) +NOT_HERE_UNTIL_AFTER_4_3(__clzsi2) +NOT_HERE_UNTIL_AFTER_4_3(__cmpdi2) +NOT_HERE_UNTIL_AFTER_4_3(__ctzdi2) +NOT_HERE_UNTIL_AFTER_4_3(__ctzsi2) +NOT_HERE_UNTIL_AFTER_4_3(__divdc3) +NOT_HERE_UNTIL_AFTER_4_3(__divdf3) +NOT_HERE_UNTIL_AFTER_4_3(__divdf3vfp) +NOT_HERE_UNTIL_AFTER_4_3(__divdi3) +NOT_HERE_UNTIL_AFTER_4_3(__divsc3) +NOT_HERE_UNTIL_AFTER_4_3(__divsf3) +NOT_HERE_UNTIL_AFTER_4_3(__divsf3vfp) +NOT_HERE_UNTIL_AFTER_4_3(__divsi3) +NOT_HERE_UNTIL_AFTER_4_3(__eqdf2) +NOT_HERE_UNTIL_AFTER_4_3(__eqdf2vfp) +NOT_HERE_UNTIL_AFTER_4_3(__eqsf2) +NOT_HERE_UNTIL_AFTER_4_3(__eqsf2vfp) +NOT_HERE_UNTIL_AFTER_4_3(__extendsfdf2) +NOT_HERE_UNTIL_AFTER_4_3(__extendsfdf2vfp) +NOT_HERE_UNTIL_AFTER_4_3(__ffsdi2) +NOT_HERE_UNTIL_AFTER_4_3(__fixdfdi) +NOT_HERE_UNTIL_AFTER_4_3(__fixdfsi) +NOT_HERE_UNTIL_AFTER_4_3(__fixdfsivfp) +NOT_HERE_UNTIL_AFTER_4_3(__fixsfdi) +NOT_HERE_UNTIL_AFTER_4_3(__fixsfsi) +NOT_HERE_UNTIL_AFTER_4_3(__fixsfsivfp) +NOT_HERE_UNTIL_AFTER_4_3(__fixunsdfdi) +NOT_HERE_UNTIL_AFTER_4_3(__fixunsdfsi) +NOT_HERE_UNTIL_AFTER_4_3(__fixunsdfsivfp) +NOT_HERE_UNTIL_AFTER_4_3(__fixunssfdi) +NOT_HERE_UNTIL_AFTER_4_3(__fixunssfsi) +NOT_HERE_UNTIL_AFTER_4_3(__fixunssfsivfp) +NOT_HERE_UNTIL_AFTER_4_3(__floatdidf) +NOT_HERE_UNTIL_AFTER_4_3(__floatdisf) +NOT_HERE_UNTIL_AFTER_4_3(__floatsidf) +NOT_HERE_UNTIL_AFTER_4_3(__floatsidfvfp) +NOT_HERE_UNTIL_AFTER_4_3(__floatsisf) +NOT_HERE_UNTIL_AFTER_4_3(__floatsisfvfp) +NOT_HERE_UNTIL_AFTER_4_3(__floatundidf) +NOT_HERE_UNTIL_AFTER_4_3(__floatundisf) +NOT_HERE_UNTIL_AFTER_4_3(__floatunsidf) +NOT_HERE_UNTIL_AFTER_4_3(__floatunsisf) +NOT_HERE_UNTIL_AFTER_4_3(__floatunssidfvfp) +NOT_HERE_UNTIL_AFTER_4_3(__floatunssisfvfp) +NOT_HERE_UNTIL_AFTER_4_3(__gedf2) +NOT_HERE_UNTIL_AFTER_4_3(__gedf2vfp) +NOT_HERE_UNTIL_AFTER_4_3(__gesf2) +NOT_HERE_UNTIL_AFTER_4_3(__gesf2vfp) +NOT_HERE_UNTIL_AFTER_4_3(__gtdf2) +NOT_HERE_UNTIL_AFTER_4_3(__gtdf2vfp) +NOT_HERE_UNTIL_AFTER_4_3(__gtsf2) +NOT_HERE_UNTIL_AFTER_4_3(__gtsf2vfp) +NOT_HERE_UNTIL_AFTER_4_3(__ledf2) +NOT_HERE_UNTIL_AFTER_4_3(__ledf2vfp) +NOT_HERE_UNTIL_AFTER_4_3(__lesf2) +NOT_HERE_UNTIL_AFTER_4_3(__lesf2vfp) +NOT_HERE_UNTIL_AFTER_4_3(__lshrdi3) +NOT_HERE_UNTIL_AFTER_4_3(__ltdf2) +NOT_HERE_UNTIL_AFTER_4_3(__ltdf2vfp) +NOT_HERE_UNTIL_AFTER_4_3(__ltsf2) +NOT_HERE_UNTIL_AFTER_4_3(__ltsf2vfp) +NOT_HERE_UNTIL_AFTER_4_3(__moddi3) +NOT_HERE_UNTIL_AFTER_4_3(__modsi3) +NOT_HERE_UNTIL_AFTER_4_3(__muldc3) +NOT_HERE_UNTIL_AFTER_4_3(__muldf3) +NOT_HERE_UNTIL_AFTER_4_3(__muldf3vfp) +NOT_HERE_UNTIL_AFTER_4_3(__muldi3) +NOT_HERE_UNTIL_AFTER_4_3(__mulsc3) +NOT_HERE_UNTIL_AFTER_4_3(__mulsf3) +NOT_HERE_UNTIL_AFTER_4_3(__mulsf3vfp) +NOT_HERE_UNTIL_AFTER_4_3(__mulvdi3) +NOT_HERE_UNTIL_AFTER_4_3(__mulvsi3) +NOT_HERE_UNTIL_AFTER_4_3(__nedf2) +NOT_HERE_UNTIL_AFTER_4_3(__nedf2vfp) +NOT_HERE_UNTIL_AFTER_4_3(__negdi2) +NOT_HERE_UNTIL_AFTER_4_3(__negvdi2) +NOT_HERE_UNTIL_AFTER_4_3(__negvsi2) +NOT_HERE_UNTIL_AFTER_4_3(__nesf2) +NOT_HERE_UNTIL_AFTER_4_3(__nesf2vfp) +NOT_HERE_UNTIL_AFTER_4_3(__paritydi2) +NOT_HERE_UNTIL_AFTER_4_3(__paritysi2) +NOT_HERE_UNTIL_AFTER_4_3(__popcountdi2) +NOT_HERE_UNTIL_AFTER_4_3(__popcountsi2) +NOT_HERE_UNTIL_AFTER_4_3(__powidf2) +NOT_HERE_UNTIL_AFTER_4_3(__powisf2) +NOT_HERE_UNTIL_AFTER_4_3(__subdf3) +NOT_HERE_UNTIL_AFTER_4_3(__subdf3vfp) +NOT_HERE_UNTIL_AFTER_4_3(__subsf3) +NOT_HERE_UNTIL_AFTER_4_3(__subsf3vfp) +NOT_HERE_UNTIL_AFTER_4_3(__subvdi3) +NOT_HERE_UNTIL_AFTER_4_3(__subvsi3) +NOT_HERE_UNTIL_AFTER_4_3(__truncdfsf2) +NOT_HERE_UNTIL_AFTER_4_3(__truncdfsf2vfp) +NOT_HERE_UNTIL_AFTER_4_3(__ucmpdi2) +NOT_HERE_UNTIL_AFTER_4_3(__udivdi3) +NOT_HERE_UNTIL_AFTER_4_3(__udivmoddi4) +NOT_HERE_UNTIL_AFTER_4_3(__udivsi3) +NOT_HERE_UNTIL_AFTER_4_3(__umoddi3) +NOT_HERE_UNTIL_AFTER_4_3(__umodsi3) +NOT_HERE_UNTIL_AFTER_4_3(__unorddf2) +NOT_HERE_UNTIL_AFTER_4_3(__unorddf2vfp) +NOT_HERE_UNTIL_AFTER_4_3(__unordsf2) +NOT_HERE_UNTIL_AFTER_4_3(__unordsf2vfp) + +NOT_HERE_UNTIL_AFTER_4_3(__divmodsi4) +NOT_HERE_UNTIL_AFTER_4_3(__udivmodsi4) +#endif // __arm__ && __DYNAMIC__ + + + + + #else /* !__APPLE__ */ extern int avoid_empty_file; diff --git a/contrib/compiler-rt/lib/arm/adddf3vfp.S b/contrib/compiler-rt/lib/arm/adddf3vfp.S index 5e705e3..cced1e0 100644 --- a/contrib/compiler-rt/lib/arm/adddf3vfp.S +++ b/contrib/compiler-rt/lib/arm/adddf3vfp.S @@ -2,8 +2,8 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// diff --git a/contrib/compiler-rt/lib/arm/addsf3vfp.S b/contrib/compiler-rt/lib/arm/addsf3vfp.S index 36d509c..b747528 100644 --- a/contrib/compiler-rt/lib/arm/addsf3vfp.S +++ b/contrib/compiler-rt/lib/arm/addsf3vfp.S @@ -2,8 +2,8 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// diff --git a/contrib/compiler-rt/lib/arm/bswapdi2.S b/contrib/compiler-rt/lib/arm/bswapdi2.S index d3ca33a..a0283e1 100644 --- a/contrib/compiler-rt/lib/arm/bswapdi2.S +++ b/contrib/compiler-rt/lib/arm/bswapdi2.S @@ -2,8 +2,8 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// diff --git a/contrib/compiler-rt/lib/arm/bswapsi2.S b/contrib/compiler-rt/lib/arm/bswapsi2.S index 0a0c073..4c3af1f 100644 --- a/contrib/compiler-rt/lib/arm/bswapsi2.S +++ b/contrib/compiler-rt/lib/arm/bswapsi2.S @@ -2,8 +2,8 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// diff --git a/contrib/compiler-rt/lib/arm/comparesf2.S b/contrib/compiler-rt/lib/arm/comparesf2.S index f21e0bcd..ee18203 100644 --- a/contrib/compiler-rt/lib/arm/comparesf2.S +++ b/contrib/compiler-rt/lib/arm/comparesf2.S @@ -2,8 +2,8 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // diff --git a/contrib/compiler-rt/lib/arm/divdf3vfp.S b/contrib/compiler-rt/lib/arm/divdf3vfp.S index e43baa3..74ef0ea 100644 --- a/contrib/compiler-rt/lib/arm/divdf3vfp.S +++ b/contrib/compiler-rt/lib/arm/divdf3vfp.S @@ -2,8 +2,8 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// diff --git a/contrib/compiler-rt/lib/arm/divmodsi4.S b/contrib/compiler-rt/lib/arm/divmodsi4.S new file mode 100644 index 0000000..cec39a7 --- /dev/null +++ b/contrib/compiler-rt/lib/arm/divmodsi4.S @@ -0,0 +1,47 @@ +/*===-- divmodsi4.S - 32-bit signed integer divide and modulus ------------===// + * + * The LLVM Compiler Infrastructure + * + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. + * + *===----------------------------------------------------------------------===// + * + * This file implements the __divmodsi4 (32-bit signed integer divide and + * modulus) function for the ARM architecture. A naive digit-by-digit + * computation is employed for simplicity. + * + *===----------------------------------------------------------------------===*/ + +#include "../assembly.h" + +#define ESTABLISH_FRAME \ + push {r4-r7, lr} ;\ + add r7, sp, #12 +#define CLEAR_FRAME_AND_RETURN \ + pop {r4-r7, pc} + +.syntax unified +.align 3 +DEFINE_COMPILERRT_FUNCTION(__divmodsi4) + ESTABLISH_FRAME +// Set aside the sign of the quotient and modulus, and the address for the +// modulus. + eor r4, r0, r1 + mov r5, r0 + mov r6, r2 +// Take the absolute value of a and b via abs(x) = (x^(x >> 31)) - (x >> 31). + eor ip, r0, r0, asr #31 + eor lr, r1, r1, asr #31 + sub r0, ip, r0, asr #31 + sub r1, lr, r1, asr #31 +// Unsigned divmod: + bl SYMBOL_NAME(__udivmodsi4) +// Apply the sign of quotient and modulus + ldr r1, [r6] + eor r0, r0, r4, asr #31 + eor r1, r1, r5, asr #31 + sub r0, r0, r4, asr #31 + sub r1, r1, r5, asr #31 + str r1, [r6] + CLEAR_FRAME_AND_RETURN diff --git a/contrib/compiler-rt/lib/arm/divsf3vfp.S b/contrib/compiler-rt/lib/arm/divsf3vfp.S index d96c930..9eefcf31e 100644 --- a/contrib/compiler-rt/lib/arm/divsf3vfp.S +++ b/contrib/compiler-rt/lib/arm/divsf3vfp.S @@ -2,8 +2,8 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// diff --git a/contrib/compiler-rt/lib/arm/divsi3.S b/contrib/compiler-rt/lib/arm/divsi3.S new file mode 100644 index 0000000..00e6181 --- /dev/null +++ b/contrib/compiler-rt/lib/arm/divsi3.S @@ -0,0 +1,41 @@ +/*===-- divsi3.S - 32-bit signed integer divide ---------------------------===// + * + * The LLVM Compiler Infrastructure + * + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. + * + *===----------------------------------------------------------------------===// + * + * This file implements the __divsi3 (32-bit signed integer divide) function + * for the ARM architecture as a wrapper around the unsigned routine. + * + *===----------------------------------------------------------------------===*/ + +#include "../assembly.h" + +#define ESTABLISH_FRAME \ + push {r4, r7, lr} ;\ + add r7, sp, #4 +#define CLEAR_FRAME_AND_RETURN \ + pop {r4, r7, pc} + +.syntax unified +.align 3 +// Ok, APCS and AAPCS agree on 32 bit args, so it's safe to use the same routine. +DEFINE_AEABI_FUNCTION_ALIAS(__aeabi_idiv, __divsi3) +DEFINE_COMPILERRT_FUNCTION(__divsi3) + ESTABLISH_FRAME +// Set aside the sign of the quotient. + eor r4, r0, r1 +// Take absolute value of a and b via abs(x) = (x^(x >> 31)) - (x >> 31). + eor r2, r0, r0, asr #31 + eor r3, r1, r1, asr #31 + sub r0, r2, r0, asr #31 + sub r1, r3, r1, asr #31 +// abs(a) / abs(b) + bl SYMBOL_NAME(__udivsi3) +// Apply sign of quotient to result and return. + eor r0, r0, r4, asr #31 + sub r0, r0, r4, asr #31 + CLEAR_FRAME_AND_RETURN diff --git a/contrib/compiler-rt/lib/arm/eqdf2vfp.S b/contrib/compiler-rt/lib/arm/eqdf2vfp.S index d4384ec..2998a76 100644 --- a/contrib/compiler-rt/lib/arm/eqdf2vfp.S +++ b/contrib/compiler-rt/lib/arm/eqdf2vfp.S @@ -2,8 +2,8 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// diff --git a/contrib/compiler-rt/lib/arm/eqsf2vfp.S b/contrib/compiler-rt/lib/arm/eqsf2vfp.S index 07355a3..927566e 100644 --- a/contrib/compiler-rt/lib/arm/eqsf2vfp.S +++ b/contrib/compiler-rt/lib/arm/eqsf2vfp.S @@ -2,8 +2,8 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// diff --git a/contrib/compiler-rt/lib/arm/extendsfdf2vfp.S b/contrib/compiler-rt/lib/arm/extendsfdf2vfp.S index 4343a7e..b1aa88e 100644 --- a/contrib/compiler-rt/lib/arm/extendsfdf2vfp.S +++ b/contrib/compiler-rt/lib/arm/extendsfdf2vfp.S @@ -2,8 +2,8 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// diff --git a/contrib/compiler-rt/lib/arm/fixdfsivfp.S b/contrib/compiler-rt/lib/arm/fixdfsivfp.S index 30458cc..0285a17 100644 --- a/contrib/compiler-rt/lib/arm/fixdfsivfp.S +++ b/contrib/compiler-rt/lib/arm/fixdfsivfp.S @@ -2,8 +2,8 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// diff --git a/contrib/compiler-rt/lib/arm/fixsfsivfp.S b/contrib/compiler-rt/lib/arm/fixsfsivfp.S index ce6f18e..d05ba74 100644 --- a/contrib/compiler-rt/lib/arm/fixsfsivfp.S +++ b/contrib/compiler-rt/lib/arm/fixsfsivfp.S @@ -2,8 +2,8 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// diff --git a/contrib/compiler-rt/lib/arm/fixunsdfsivfp.S b/contrib/compiler-rt/lib/arm/fixunsdfsivfp.S index 7e766c0..ddb703c 100644 --- a/contrib/compiler-rt/lib/arm/fixunsdfsivfp.S +++ b/contrib/compiler-rt/lib/arm/fixunsdfsivfp.S @@ -2,8 +2,8 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// diff --git a/contrib/compiler-rt/lib/arm/fixunssfsivfp.S b/contrib/compiler-rt/lib/arm/fixunssfsivfp.S index ba2344f..afbb64f 100644 --- a/contrib/compiler-rt/lib/arm/fixunssfsivfp.S +++ b/contrib/compiler-rt/lib/arm/fixunssfsivfp.S @@ -2,8 +2,8 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// diff --git a/contrib/compiler-rt/lib/arm/floatsidfvfp.S b/contrib/compiler-rt/lib/arm/floatsidfvfp.S index 5ed4ace..fe3366a 100644 --- a/contrib/compiler-rt/lib/arm/floatsidfvfp.S +++ b/contrib/compiler-rt/lib/arm/floatsidfvfp.S @@ -2,8 +2,8 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// diff --git a/contrib/compiler-rt/lib/arm/floatsisfvfp.S b/contrib/compiler-rt/lib/arm/floatsisfvfp.S index 0114c78..5b41610 100644 --- a/contrib/compiler-rt/lib/arm/floatsisfvfp.S +++ b/contrib/compiler-rt/lib/arm/floatsisfvfp.S @@ -2,8 +2,8 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// diff --git a/contrib/compiler-rt/lib/arm/floatunssidfvfp.S b/contrib/compiler-rt/lib/arm/floatunssidfvfp.S index d1bfe3a..9b22a6f 100644 --- a/contrib/compiler-rt/lib/arm/floatunssidfvfp.S +++ b/contrib/compiler-rt/lib/arm/floatunssidfvfp.S @@ -2,8 +2,8 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// diff --git a/contrib/compiler-rt/lib/arm/floatunssisfvfp.S b/contrib/compiler-rt/lib/arm/floatunssisfvfp.S index 0b73577..44d5e93 100644 --- a/contrib/compiler-rt/lib/arm/floatunssisfvfp.S +++ b/contrib/compiler-rt/lib/arm/floatunssisfvfp.S @@ -2,8 +2,8 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// diff --git a/contrib/compiler-rt/lib/arm/gedf2vfp.S b/contrib/compiler-rt/lib/arm/gedf2vfp.S index 6ab856f..9993f52 100644 --- a/contrib/compiler-rt/lib/arm/gedf2vfp.S +++ b/contrib/compiler-rt/lib/arm/gedf2vfp.S @@ -2,8 +2,8 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// diff --git a/contrib/compiler-rt/lib/arm/gesf2vfp.S b/contrib/compiler-rt/lib/arm/gesf2vfp.S index b00d821..9ce1682 100644 --- a/contrib/compiler-rt/lib/arm/gesf2vfp.S +++ b/contrib/compiler-rt/lib/arm/gesf2vfp.S @@ -2,8 +2,8 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// diff --git a/contrib/compiler-rt/lib/arm/gtdf2vfp.S b/contrib/compiler-rt/lib/arm/gtdf2vfp.S index 65594c7..8a049c8 100644 --- a/contrib/compiler-rt/lib/arm/gtdf2vfp.S +++ b/contrib/compiler-rt/lib/arm/gtdf2vfp.S @@ -2,8 +2,8 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// diff --git a/contrib/compiler-rt/lib/arm/gtsf2vfp.S b/contrib/compiler-rt/lib/arm/gtsf2vfp.S index 53ef2a0..1ffe1ec 100644 --- a/contrib/compiler-rt/lib/arm/gtsf2vfp.S +++ b/contrib/compiler-rt/lib/arm/gtsf2vfp.S @@ -2,8 +2,8 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// diff --git a/contrib/compiler-rt/lib/arm/ledf2vfp.S b/contrib/compiler-rt/lib/arm/ledf2vfp.S index 327a7d5..a04d0f2 100644 --- a/contrib/compiler-rt/lib/arm/ledf2vfp.S +++ b/contrib/compiler-rt/lib/arm/ledf2vfp.S @@ -2,8 +2,8 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// diff --git a/contrib/compiler-rt/lib/arm/lesf2vfp.S b/contrib/compiler-rt/lib/arm/lesf2vfp.S index b7e05da..3011200 100644 --- a/contrib/compiler-rt/lib/arm/lesf2vfp.S +++ b/contrib/compiler-rt/lib/arm/lesf2vfp.S @@ -2,8 +2,8 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// diff --git a/contrib/compiler-rt/lib/arm/ltdf2vfp.S b/contrib/compiler-rt/lib/arm/ltdf2vfp.S index 55dfd80..87144a8 100644 --- a/contrib/compiler-rt/lib/arm/ltdf2vfp.S +++ b/contrib/compiler-rt/lib/arm/ltdf2vfp.S @@ -2,8 +2,8 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// diff --git a/contrib/compiler-rt/lib/arm/ltsf2vfp.S b/contrib/compiler-rt/lib/arm/ltsf2vfp.S index 3816a71..ca06ae2 100644 --- a/contrib/compiler-rt/lib/arm/ltsf2vfp.S +++ b/contrib/compiler-rt/lib/arm/ltsf2vfp.S @@ -2,8 +2,8 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// diff --git a/contrib/compiler-rt/lib/arm/modsi3.S b/contrib/compiler-rt/lib/arm/modsi3.S index 64a3afd..a4cd2ee 100644 --- a/contrib/compiler-rt/lib/arm/modsi3.S +++ b/contrib/compiler-rt/lib/arm/modsi3.S @@ -1,36 +1,39 @@ -//===-------- modsi3.S - Implement modsi3 ---------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// +/*===-- modsi3.S - 32-bit signed integer modulus --------------------------===// + * + * The LLVM Compiler Infrastructure + * + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. + * + *===----------------------------------------------------------------------===// + * + * This file implements the __modsi3 (32-bit signed integer modulus) function + * for the ARM architecture as a wrapper around the unsigned routine. + * + *===----------------------------------------------------------------------===*/ #include "../assembly.h" -// -// extern int32_t __modsi3(int32_t a, int32_t b); -// -// Returns the remainder when dividing two 32-bit signed integers. -// Conceptually, the function is: { return a - (a / b) * b; } -// But if you write that in C, llvm compiles it to a call to __modsi3... -// - .align 2 -DEFINE_COMPILERRT_FUNCTION(__modsi3) - push {r4, r5, r7, lr} - add r7, sp, #8 // set stack frame - mov r5, r0 // save a - mov r4, r1 // save b - bl ___divsi3 // compute a/b -#if __ARM_ARCH_7A__ - mls r0, r4, r0, r5 // mulitple result * b and subtract from a -#else - // before armv7, does not have "mls" instruction - mul r3, r0, r4 // multiple result * b - sub r0, r5, r3 // a - result -#endif - pop {r4, r5, r7, pc} - - +#define ESTABLISH_FRAME \ + push {r4, r7, lr} ;\ + add r7, sp, #4 +#define CLEAR_FRAME_AND_RETURN \ + pop {r4, r7, pc} +.syntax unified +.align 3 +DEFINE_COMPILERRT_FUNCTION(__modsi3) + ESTABLISH_FRAME + // Set aside the sign of the dividend. + mov r4, r0 + // Take absolute value of a and b via abs(x) = (x^(x >> 31)) - (x >> 31). + eor r2, r0, r0, asr #31 + eor r3, r1, r1, asr #31 + sub r0, r2, r0, asr #31 + sub r1, r3, r1, asr #31 + // abs(a) % abs(b) + bl SYMBOL_NAME(__umodsi3) + // Apply sign of dividend to result and return. + eor r0, r0, r4, asr #31 + sub r0, r0, r4, asr #31 + CLEAR_FRAME_AND_RETURN diff --git a/contrib/compiler-rt/lib/arm/muldf3vfp.S b/contrib/compiler-rt/lib/arm/muldf3vfp.S index cb503d3..96bba06 100644 --- a/contrib/compiler-rt/lib/arm/muldf3vfp.S +++ b/contrib/compiler-rt/lib/arm/muldf3vfp.S @@ -2,8 +2,8 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// diff --git a/contrib/compiler-rt/lib/arm/mulsf3vfp.S b/contrib/compiler-rt/lib/arm/mulsf3vfp.S index 49b4d1d..c56991d 100644 --- a/contrib/compiler-rt/lib/arm/mulsf3vfp.S +++ b/contrib/compiler-rt/lib/arm/mulsf3vfp.S @@ -2,8 +2,8 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// diff --git a/contrib/compiler-rt/lib/arm/nedf2vfp.S b/contrib/compiler-rt/lib/arm/nedf2vfp.S index 813864e..a02b09c 100644 --- a/contrib/compiler-rt/lib/arm/nedf2vfp.S +++ b/contrib/compiler-rt/lib/arm/nedf2vfp.S @@ -2,8 +2,8 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// diff --git a/contrib/compiler-rt/lib/arm/negdf2vfp.S b/contrib/compiler-rt/lib/arm/negdf2vfp.S index 80139754..100f4fd 100644 --- a/contrib/compiler-rt/lib/arm/negdf2vfp.S +++ b/contrib/compiler-rt/lib/arm/negdf2vfp.S @@ -2,8 +2,8 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// diff --git a/contrib/compiler-rt/lib/arm/negsf2vfp.S b/contrib/compiler-rt/lib/arm/negsf2vfp.S index 243c086..f96c8ad 100644 --- a/contrib/compiler-rt/lib/arm/negsf2vfp.S +++ b/contrib/compiler-rt/lib/arm/negsf2vfp.S @@ -2,8 +2,8 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// diff --git a/contrib/compiler-rt/lib/arm/nesf2vfp.S b/contrib/compiler-rt/lib/arm/nesf2vfp.S index d470afa..d620549 100644 --- a/contrib/compiler-rt/lib/arm/nesf2vfp.S +++ b/contrib/compiler-rt/lib/arm/nesf2vfp.S @@ -2,8 +2,8 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// diff --git a/contrib/compiler-rt/lib/arm/restore_vfp_d8_d15_regs.S b/contrib/compiler-rt/lib/arm/restore_vfp_d8_d15_regs.S index 25404cd..7f441db 100644 --- a/contrib/compiler-rt/lib/arm/restore_vfp_d8_d15_regs.S +++ b/contrib/compiler-rt/lib/arm/restore_vfp_d8_d15_regs.S @@ -2,8 +2,8 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// diff --git a/contrib/compiler-rt/lib/arm/save_vfp_d8_d15_regs.S b/contrib/compiler-rt/lib/arm/save_vfp_d8_d15_regs.S index 92de61b..fbd21ba 100644 --- a/contrib/compiler-rt/lib/arm/save_vfp_d8_d15_regs.S +++ b/contrib/compiler-rt/lib/arm/save_vfp_d8_d15_regs.S @@ -2,8 +2,8 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// diff --git a/contrib/compiler-rt/lib/arm/softfloat-alias.list b/contrib/compiler-rt/lib/arm/softfloat-alias.list new file mode 100644 index 0000000..cc6a4b3c --- /dev/null +++ b/contrib/compiler-rt/lib/arm/softfloat-alias.list @@ -0,0 +1,21 @@ +# +# These are soft float functions which can be +# aliased to the *vfp functions on arm processors +# that support floating point instructions. +# +___adddf3vfp ___adddf3 +___addsf3vfp ___addsf3 +___divdf3vfp ___divdf3 +___divsf3vfp ___divsf3 +___extendsfdf2vfp ___extendsfdf2 +___fixdfsivfp ___fixdfsi +___fixsfsivfp ___fixsfsi +___floatsidfvfp ___floatsidf +___floatsisfvfp ___floatsisf +___muldf3vfp ___muldf3 +___mulsf3vfp ___mulsf3 +___subdf3vfp ___subdf3 +___subsf3vfp ___subsf3 +___truncdfsf2vfp ___truncdfsf2 +___floatunssidfvfp ___floatunsidf +___floatunssisfvfp ___floatunsisf diff --git a/contrib/compiler-rt/lib/arm/subdf3vfp.S b/contrib/compiler-rt/lib/arm/subdf3vfp.S index 8841600..ff53b30 100644 --- a/contrib/compiler-rt/lib/arm/subdf3vfp.S +++ b/contrib/compiler-rt/lib/arm/subdf3vfp.S @@ -2,8 +2,8 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// diff --git a/contrib/compiler-rt/lib/arm/subsf3vfp.S b/contrib/compiler-rt/lib/arm/subsf3vfp.S index 4ead9c23..238f3f0 100644 --- a/contrib/compiler-rt/lib/arm/subsf3vfp.S +++ b/contrib/compiler-rt/lib/arm/subsf3vfp.S @@ -2,8 +2,8 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// diff --git a/contrib/compiler-rt/lib/arm/switch16.S b/contrib/compiler-rt/lib/arm/switch16.S index 05c7b98..e8f08c4 100644 --- a/contrib/compiler-rt/lib/arm/switch16.S +++ b/contrib/compiler-rt/lib/arm/switch16.S @@ -2,8 +2,8 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// diff --git a/contrib/compiler-rt/lib/arm/switch32.S b/contrib/compiler-rt/lib/arm/switch32.S index a127cb7..7008fcc 100644 --- a/contrib/compiler-rt/lib/arm/switch32.S +++ b/contrib/compiler-rt/lib/arm/switch32.S @@ -2,8 +2,8 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// diff --git a/contrib/compiler-rt/lib/arm/switch8.S b/contrib/compiler-rt/lib/arm/switch8.S index d05f6ac..e784b40 100644 --- a/contrib/compiler-rt/lib/arm/switch8.S +++ b/contrib/compiler-rt/lib/arm/switch8.S @@ -2,8 +2,8 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// diff --git a/contrib/compiler-rt/lib/arm/switchu8.S b/contrib/compiler-rt/lib/arm/switchu8.S index faffddb..19bed2f 100644 --- a/contrib/compiler-rt/lib/arm/switchu8.S +++ b/contrib/compiler-rt/lib/arm/switchu8.S @@ -2,8 +2,8 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// diff --git a/contrib/compiler-rt/lib/arm/sync_synchronize.S b/contrib/compiler-rt/lib/arm/sync_synchronize.S index 76fdab1..06dade9 100644 --- a/contrib/compiler-rt/lib/arm/sync_synchronize.S +++ b/contrib/compiler-rt/lib/arm/sync_synchronize.S @@ -2,8 +2,8 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// diff --git a/contrib/compiler-rt/lib/arm/truncdfsf2vfp.S b/contrib/compiler-rt/lib/arm/truncdfsf2vfp.S index 5725e25..6e55c7f 100644 --- a/contrib/compiler-rt/lib/arm/truncdfsf2vfp.S +++ b/contrib/compiler-rt/lib/arm/truncdfsf2vfp.S @@ -2,8 +2,8 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// diff --git a/contrib/compiler-rt/lib/arm/udivmodsi4.S b/contrib/compiler-rt/lib/arm/udivmodsi4.S new file mode 100644 index 0000000..d164a75 --- /dev/null +++ b/contrib/compiler-rt/lib/arm/udivmodsi4.S @@ -0,0 +1,80 @@ +/*===-- udivmodsi4.S - 32-bit unsigned integer divide and modulus ---------===// + * + * The LLVM Compiler Infrastructure + * + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. + * + *===----------------------------------------------------------------------===// + * + * This file implements the __udivmodsi4 (32-bit unsigned integer divide and + * modulus) function for the ARM architecture. A naive digit-by-digit + * computation is employed for simplicity. + * + *===----------------------------------------------------------------------===*/ + +#include "../assembly.h" + +#define ESTABLISH_FRAME \ + push {r4, r7, lr} ;\ + add r7, sp, #4 +#define CLEAR_FRAME_AND_RETURN \ + pop {r4, r7, pc} + +#define a r0 +#define b r1 +#define i r3 +#define r r4 +#define q ip +#define one lr + +.syntax unified +.align 3 +DEFINE_COMPILERRT_FUNCTION(__udivmodsi4) +// We use a simple digit by digit algorithm; before we get into the actual +// divide loop, we must calculate the left-shift amount necessary to align +// the MSB of the divisor with that of the dividend (If this shift is +// negative, then the result is zero, and we early out). We also conjure a +// bit mask of 1 to use in constructing the quotient, and initialize the +// quotient to zero. + ESTABLISH_FRAME + clz r4, a + tst b, b // detect divide-by-zero + clz r3, b + mov q, #0 + beq LOCAL_LABEL(return) // return 0 if b is zero. + mov one, #1 + subs i, r3, r4 + blt LOCAL_LABEL(return) // return 0 if MSB(a) < MSB(b) + +LOCAL_LABEL(mainLoop): +// This loop basically implements the following: +// +// do { +// if (a >= b << i) { +// a -= b << i; +// q |= 1 << i; +// if (a == 0) break; +// } +// } while (--i) +// +// Note that this does not perform the final iteration (i == 0); by doing it +// this way, we can merge the two branches which is a substantial win for +// such a tight loop on current ARM architectures. + subs r, a, b, lsl i + orrhs q, q,one, lsl i + movhs a, r + subsne i, i, #1 + bhi LOCAL_LABEL(mainLoop) + +// Do the final test subtraction and update of quotient (i == 0), as it is +// not performed in the main loop. + subs r, a, b + orrhs q, #1 + movhs a, r + +LOCAL_LABEL(return): +// Store the remainder, and move the quotient to r0, then return. + str a, [r2] + mov r0, q + CLEAR_FRAME_AND_RETURN diff --git a/contrib/compiler-rt/lib/arm/udivsi3.S b/contrib/compiler-rt/lib/arm/udivsi3.S new file mode 100644 index 0000000..6d89665 --- /dev/null +++ b/contrib/compiler-rt/lib/arm/udivsi3.S @@ -0,0 +1,80 @@ +/*===-- udivsi3.S - 32-bit unsigned integer divide ------------------------===// + * + * The LLVM Compiler Infrastructure + * + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. + * + *===----------------------------------------------------------------------===// + * + * This file implements the __udivsi3 (32-bit unsigned integer divide) + * function for the ARM architecture. A naive digit-by-digit computation is + * employed for simplicity. + * + *===----------------------------------------------------------------------===*/ + +#include "../assembly.h" + +#define ESTABLISH_FRAME \ + push {r7, lr} ;\ + mov r7, sp +#define CLEAR_FRAME_AND_RETURN \ + pop {r7, pc} + +#define a r0 +#define b r1 +#define r r2 +#define i r3 +#define q ip +#define one lr + +.syntax unified +.align 3 +// Ok, APCS and AAPCS agree on 32 bit args, so it's safe to use the same routine. +DEFINE_AEABI_FUNCTION_ALIAS(__aeabi_uidiv, __udivsi3) +DEFINE_COMPILERRT_FUNCTION(__udivsi3) +// We use a simple digit by digit algorithm; before we get into the actual +// divide loop, we must calculate the left-shift amount necessary to align +// the MSB of the divisor with that of the dividend (If this shift is +// negative, then the result is zero, and we early out). We also conjure a +// bit mask of 1 to use in constructing the quotient, and initialize the +// quotient to zero. + ESTABLISH_FRAME + clz r2, a + tst b, b // detect divide-by-zero + clz r3, b + mov q, #0 + beq LOCAL_LABEL(return) // return 0 if b is zero. + mov one, #1 + subs i, r3, r2 + blt LOCAL_LABEL(return) // return 0 if MSB(a) < MSB(b) + +LOCAL_LABEL(mainLoop): +// This loop basically implements the following: +// +// do { +// if (a >= b << i) { +// a -= b << i; +// q |= 1 << i; +// if (a == 0) break; +// } +// } while (--i) +// +// Note that this does not perform the final iteration (i == 0); by doing it +// this way, we can merge the two branches which is a substantial win for +// such a tight loop on current ARM architectures. + subs r, a, b, lsl i + orrhs q, q,one, lsl i + movhs a, r + subsne i, i, #1 + bhi LOCAL_LABEL(mainLoop) + +// Do the final test subtraction and update of quotient (i == 0), as it is +// not performed in the main loop. + subs r, a, b + orrhs q, #1 + +LOCAL_LABEL(return): +// Move the quotient to r0 and return. + mov r0, q + CLEAR_FRAME_AND_RETURN diff --git a/contrib/compiler-rt/lib/arm/umodsi3.S b/contrib/compiler-rt/lib/arm/umodsi3.S new file mode 100644 index 0000000..3a2ab2b --- /dev/null +++ b/contrib/compiler-rt/lib/arm/umodsi3.S @@ -0,0 +1,58 @@ +/*===-- umodsi3.S - 32-bit unsigned integer modulus -----------------------===// + * + * The LLVM Compiler Infrastructure + * + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. + * + *===----------------------------------------------------------------------===// + * + * This file implements the __umodsi3 (32-bit unsigned integer modulus) + * function for the ARM architecture. A naive digit-by-digit computation is + * employed for simplicity. + * + *===----------------------------------------------------------------------===*/ + +#include "../assembly.h" + +#define a r0 +#define b r1 +#define r r2 +#define i r3 + +.syntax unified +.align 3 +DEFINE_COMPILERRT_FUNCTION(__umodsi3) +// We use a simple digit by digit algorithm; before we get into the actual +// divide loop, we must calculate the left-shift amount necessary to align +// the MSB of the divisor with that of the dividend. + clz r2, a + tst b, b // detect b == 0 + clz r3, b + bxeq lr // return a if b == 0 + subs i, r3, r2 + bxlt lr // return a if MSB(a) < MSB(b) + +LOCAL_LABEL(mainLoop): +// This loop basically implements the following: +// +// do { +// if (a >= b << i) { +// a -= b << i; +// if (a == 0) break; +// } +// } while (--i) +// +// Note that this does not perform the final iteration (i == 0); by doing it +// this way, we can merge the two branches which is a substantial win for +// such a tight loop on current ARM architectures. + subs r, a, b, lsl i + movhs a, r + subsne i, i, #1 + bhi LOCAL_LABEL(mainLoop) + +// Do the final test subtraction and update of remainder (i == 0), as it is +// not performed in the main loop. + subs r, a, b + movhs a, r + bx lr diff --git a/contrib/compiler-rt/lib/arm/unorddf2vfp.S b/contrib/compiler-rt/lib/arm/unorddf2vfp.S index de00b07..9b52131 100644 --- a/contrib/compiler-rt/lib/arm/unorddf2vfp.S +++ b/contrib/compiler-rt/lib/arm/unorddf2vfp.S @@ -2,8 +2,8 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// diff --git a/contrib/compiler-rt/lib/arm/unordsf2vfp.S b/contrib/compiler-rt/lib/arm/unordsf2vfp.S index ab291a8..e486533 100644 --- a/contrib/compiler-rt/lib/arm/unordsf2vfp.S +++ b/contrib/compiler-rt/lib/arm/unordsf2vfp.S @@ -2,8 +2,8 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// diff --git a/contrib/compiler-rt/lib/ashldi3.c b/contrib/compiler-rt/lib/ashldi3.c index 993f71c..adce4e2 100644 --- a/contrib/compiler-rt/lib/ashldi3.c +++ b/contrib/compiler-rt/lib/ashldi3.c @@ -2,8 +2,8 @@ * * The LLVM Compiler Infrastructure * - * This file is distributed under the University of Illinois Open Source - * License. See LICENSE.TXT for details. + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. * * ===----------------------------------------------------------------------=== * @@ -11,6 +11,7 @@ * * ===----------------------------------------------------------------------=== */ +#include "abi.h" #include "int_lib.h" @@ -18,7 +19,9 @@ /* Precondition: 0 <= b < bits_in_dword */ -di_int +ARM_EABI_FNALIAS(llsl, ashldi3); + +COMPILER_RT_ABI di_int __ashldi3(di_int a, si_int b) { const int bits_in_word = (int)(sizeof(si_int) * CHAR_BIT); diff --git a/contrib/compiler-rt/lib/ashlti3.c b/contrib/compiler-rt/lib/ashlti3.c index 317de66..7042b53 100644 --- a/contrib/compiler-rt/lib/ashlti3.c +++ b/contrib/compiler-rt/lib/ashlti3.c @@ -2,8 +2,8 @@ * * The LLVM Compiler Infrastructure * - * This file is distributed under the University of Illinois Open Source - * License. See LICENSE.TXT for details. + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. * * ===----------------------------------------------------------------------=== * diff --git a/contrib/compiler-rt/lib/ashrdi3.c b/contrib/compiler-rt/lib/ashrdi3.c index 8e27a11..03692a3 100644 --- a/contrib/compiler-rt/lib/ashrdi3.c +++ b/contrib/compiler-rt/lib/ashrdi3.c @@ -2,8 +2,8 @@ * * The LLVM Compiler Infrastructure * - * This file is distributed under the University of Illinois Open Source - * License. See LICENSE.TXT for details. + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. * * ===----------------------------------------------------------------------=== * @@ -11,6 +11,7 @@ * * ===----------------------------------------------------------------------=== */ +#include "abi.h" #include "int_lib.h" @@ -18,7 +19,9 @@ /* Precondition: 0 <= b < bits_in_dword */ -di_int +ARM_EABI_FNALIAS(lasr, ashrdi3); + +COMPILER_RT_ABI di_int __ashrdi3(di_int a, si_int b) { const int bits_in_word = (int)(sizeof(si_int) * CHAR_BIT); diff --git a/contrib/compiler-rt/lib/ashrti3.c b/contrib/compiler-rt/lib/ashrti3.c index 4eab247..4d16230 100644 --- a/contrib/compiler-rt/lib/ashrti3.c +++ b/contrib/compiler-rt/lib/ashrti3.c @@ -2,8 +2,8 @@ * * The LLVM Compiler Infrastructure * - * This file is distributed under the University of Illinois Open Source - * License. See LICENSE.TXT for details. + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. * * ===----------------------------------------------------------------------=== * diff --git a/contrib/compiler-rt/lib/assembly.h b/contrib/compiler-rt/lib/assembly.h index c124e19..0ce83ac 100644 --- a/contrib/compiler-rt/lib/assembly.h +++ b/contrib/compiler-rt/lib/assembly.h @@ -2,8 +2,8 @@ * * The LLVM Compiler Infrastructure * - * This file is distributed under the University of Illinois Open Source - * License. See LICENSE.TXT for details. + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. * * ===----------------------------------------------------------------------=== * @@ -22,33 +22,48 @@ #define SEPARATOR ; #endif -/* We can't use __USER_LABEL_PREFIX__ here, it isn't possible to concatenate the - *values* of two macros. This is quite brittle, though. */ #if defined(__APPLE__) -#define SYMBOL_NAME(name) _##name +#define HIDDEN_DIRECTIVE .private_extern +#define LOCAL_LABEL(name) L_##name #else -#define SYMBOL_NAME(name) name +#define HIDDEN_DIRECTIVE .hidden +#define LOCAL_LABEL(name) .L_##name #endif +#define GLUE2(a, b) a ## b +#define GLUE(a, b) GLUE2(a, b) +#define SYMBOL_NAME(name) GLUE(__USER_LABEL_PREFIX__, name) + #ifdef VISIBILITY_HIDDEN -#define DEFINE_COMPILERRT_FUNCTION(name) \ - .globl SYMBOL_NAME(name) SEPARATOR \ - .hidden SYMBOL_NAME(name) SEPARATOR \ +#define DEFINE_COMPILERRT_FUNCTION(name) \ + .globl SYMBOL_NAME(name) SEPARATOR \ + HIDDEN_DIRECTIVE SYMBOL_NAME(name) SEPARATOR \ SYMBOL_NAME(name): #else -#define DEFINE_COMPILERRT_FUNCTION(name) \ - .globl SYMBOL_NAME(name) SEPARATOR \ +#define DEFINE_COMPILERRT_FUNCTION(name) \ + .globl SYMBOL_NAME(name) SEPARATOR \ SYMBOL_NAME(name): #endif -#define DEFINE_COMPILERRT_PRIVATE_FUNCTION(name) \ - .globl SYMBOL_NAME(name) SEPARATOR \ - .hidden SYMBOL_NAME(name) SEPARATOR \ +#define DEFINE_COMPILERRT_PRIVATE_FUNCTION(name) \ + .globl SYMBOL_NAME(name) SEPARATOR \ + HIDDEN_DIRECTIVE SYMBOL_NAME(name) SEPARATOR \ SYMBOL_NAME(name): #define DEFINE_COMPILERRT_PRIVATE_FUNCTION_UNMANGLED(name) \ - .globl name SEPARATOR \ - .hidden name SEPARATOR \ + .globl name SEPARATOR \ + HIDDEN_DIRECTIVE name SEPARATOR \ name: +#define DEFINE_COMPILERRT_FUNCTION_ALIAS(name, target) \ + .globl SYMBOL_NAME(name) SEPARATOR \ + .set SYMBOL_NAME(name), SYMBOL_NAME(target) SEPARATOR + +#if defined (__ARM_EABI__) +# define DEFINE_AEABI_FUNCTION_ALIAS(aeabi_name, name) \ + DEFINE_COMPILERRT_FUNCTION_ALIAS(aeabi_name, name) +#else +# define DEFINE_AEABI_FUNCTION_ALIAS(aeabi_name, name) +#endif + #endif /* COMPILERRT_ASSEMBLY_H */ diff --git a/contrib/compiler-rt/lib/clear_cache.c b/contrib/compiler-rt/lib/clear_cache.c index 43db37a..7b59a7f 100644 --- a/contrib/compiler-rt/lib/clear_cache.c +++ b/contrib/compiler-rt/lib/clear_cache.c @@ -2,8 +2,8 @@ * * The LLVM Compiler Infrastructure * - * This file is distributed under the University of Illinois Open Source - * License. See LICENSE.TXT for details. + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. * * ===----------------------------------------------------------------------=== */ diff --git a/contrib/compiler-rt/lib/clzdi2.c b/contrib/compiler-rt/lib/clzdi2.c index ea95396..c281945 100644 --- a/contrib/compiler-rt/lib/clzdi2.c +++ b/contrib/compiler-rt/lib/clzdi2.c @@ -1,9 +1,9 @@ /* ===-- clzdi2.c - Implement __clzdi2 -------------------------------------=== * - * The LLVM Compiler Infrastructure + * The LLVM Compiler Infrastructure * - * This file is distributed under the University of Illinois Open Source - * License. See LICENSE.TXT for details. + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. * * ===----------------------------------------------------------------------=== * @@ -11,6 +11,7 @@ * * ===----------------------------------------------------------------------=== */ +#include "abi.h" #include "int_lib.h" @@ -18,7 +19,7 @@ /* Precondition: a != 0 */ -si_int +COMPILER_RT_ABI si_int __clzdi2(di_int a) { dwords x; diff --git a/contrib/compiler-rt/lib/clzsi2.c b/contrib/compiler-rt/lib/clzsi2.c index 7e14af2..d0a6aea 100644 --- a/contrib/compiler-rt/lib/clzsi2.c +++ b/contrib/compiler-rt/lib/clzsi2.c @@ -1,9 +1,9 @@ /* ===-- clzsi2.c - Implement __clzsi2 -------------------------------------=== * - * The LLVM Compiler Infrastructure + * The LLVM Compiler Infrastructure * - * This file is distributed under the University of Illinois Open Source - * License. See LICENSE.TXT for details. + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. * * ===----------------------------------------------------------------------=== * @@ -11,6 +11,7 @@ * * ===----------------------------------------------------------------------=== */ +#include "abi.h" #include "int_lib.h" @@ -18,7 +19,7 @@ /* Precondition: a != 0 */ -si_int +COMPILER_RT_ABI si_int __clzsi2(si_int a) { su_int x = (su_int)a; diff --git a/contrib/compiler-rt/lib/clzti2.c b/contrib/compiler-rt/lib/clzti2.c index 805688f..7a650eb 100644 --- a/contrib/compiler-rt/lib/clzti2.c +++ b/contrib/compiler-rt/lib/clzti2.c @@ -2,8 +2,8 @@ * * The LLVM Compiler Infrastructure * - * This file is distributed under the University of Illinois Open Source - * License. See LICENSE.TXT for details. + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. * * ===----------------------------------------------------------------------=== * diff --git a/contrib/compiler-rt/lib/cmpdi2.c b/contrib/compiler-rt/lib/cmpdi2.c index 0b87352..999c3d2 100644 --- a/contrib/compiler-rt/lib/cmpdi2.c +++ b/contrib/compiler-rt/lib/cmpdi2.c @@ -2,24 +2,25 @@ * * The LLVM Compiler Infrastructure * - * This file is distributed under the University of Illinois Open Source - * License. See LICENSE.TXT for details. + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. * * ===----------------------------------------------------------------------=== - * + * * This file implements __cmpdi2 for the compiler_rt library. * * ===----------------------------------------------------------------------=== */ +#include "abi.h" #include "int_lib.h" -/* Returns: if (a < b) returns 0 +/* Returns: if (a < b) returns 0 * if (a == b) returns 1 * if (a > b) returns 2 */ -si_int +COMPILER_RT_ABI si_int __cmpdi2(di_int a, di_int b) { dwords x; diff --git a/contrib/compiler-rt/lib/cmpti2.c b/contrib/compiler-rt/lib/cmpti2.c index 90b3b75..b156fce 100644 --- a/contrib/compiler-rt/lib/cmpti2.c +++ b/contrib/compiler-rt/lib/cmpti2.c @@ -2,8 +2,8 @@ * * The LLVM Compiler Infrastructure * - * This file is distributed under the University of Illinois Open Source - * License. See LICENSE.TXT for details. + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. * * ===----------------------------------------------------------------------=== * diff --git a/contrib/compiler-rt/lib/comparedf2.c b/contrib/compiler-rt/lib/comparedf2.c index 5c5ee9d..fe35fd8 100644 --- a/contrib/compiler-rt/lib/comparedf2.c +++ b/contrib/compiler-rt/lib/comparedf2.c @@ -2,8 +2,8 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // diff --git a/contrib/compiler-rt/lib/comparesf2.c b/contrib/compiler-rt/lib/comparesf2.c index fd05724..3f2e358 100644 --- a/contrib/compiler-rt/lib/comparesf2.c +++ b/contrib/compiler-rt/lib/comparesf2.c @@ -2,8 +2,8 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // diff --git a/contrib/compiler-rt/lib/ctzdi2.c b/contrib/compiler-rt/lib/ctzdi2.c index b49f2c7..b3d37d0 100644 --- a/contrib/compiler-rt/lib/ctzdi2.c +++ b/contrib/compiler-rt/lib/ctzdi2.c @@ -2,8 +2,8 @@ * * The LLVM Compiler Infrastructure * - * This file is distributed under the University of Illinois Open Source - * License. See LICENSE.TXT for details. + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. * * ===----------------------------------------------------------------------=== * @@ -11,6 +11,7 @@ * * ===----------------------------------------------------------------------=== */ +#include "abi.h" #include "int_lib.h" @@ -18,7 +19,7 @@ /* Precondition: a != 0 */ -si_int +COMPILER_RT_ABI si_int __ctzdi2(di_int a) { dwords x; diff --git a/contrib/compiler-rt/lib/ctzsi2.c b/contrib/compiler-rt/lib/ctzsi2.c index 30d34c8..2ff0e5d 100644 --- a/contrib/compiler-rt/lib/ctzsi2.c +++ b/contrib/compiler-rt/lib/ctzsi2.c @@ -2,8 +2,8 @@ * * The LLVM Compiler Infrastructure * - * This file is distributed under the University of Illinois Open Source - * License. See LICENSE.TXT for details. + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. * * ===----------------------------------------------------------------------=== * @@ -11,6 +11,7 @@ * * ===----------------------------------------------------------------------=== */ +#include "abi.h" #include "int_lib.h" @@ -18,7 +19,7 @@ /* Precondition: a != 0 */ -si_int +COMPILER_RT_ABI si_int __ctzsi2(si_int a) { su_int x = (su_int)a; diff --git a/contrib/compiler-rt/lib/ctzti2.c b/contrib/compiler-rt/lib/ctzti2.c index f2d41fe..1c9508f 100644 --- a/contrib/compiler-rt/lib/ctzti2.c +++ b/contrib/compiler-rt/lib/ctzti2.c @@ -2,8 +2,8 @@ * * The LLVM Compiler Infrastructure * - * This file is distributed under the University of Illinois Open Source - * License. See LICENSE.TXT for details. + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. * * ===----------------------------------------------------------------------=== * diff --git a/contrib/compiler-rt/lib/divdc3.c b/contrib/compiler-rt/lib/divdc3.c index c96aefd..5f63298 100644 --- a/contrib/compiler-rt/lib/divdc3.c +++ b/contrib/compiler-rt/lib/divdc3.c @@ -2,8 +2,8 @@ * * The LLVM Compiler Infrastructure * - * This file is distributed under the University of Illinois Open Source - * License. See LICENSE.TXT for details. + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. * * ===----------------------------------------------------------------------=== * diff --git a/contrib/compiler-rt/lib/divdf3.c b/contrib/compiler-rt/lib/divdf3.c index 21b8f09..925abd5 100644 --- a/contrib/compiler-rt/lib/divdf3.c +++ b/contrib/compiler-rt/lib/divdf3.c @@ -2,8 +2,8 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // @@ -15,10 +15,13 @@ // underflow with correct rounding. // //===----------------------------------------------------------------------===// +#include "abi.h" #define DOUBLE_PRECISION #include "fp_lib.h" +ARM_EABI_FNALIAS(ddiv, divdf3); + fp_t __divdf3(fp_t a, fp_t b) { const unsigned int aExponent = toRep(a) >> significandBits & maxExponent; diff --git a/contrib/compiler-rt/lib/divdi3.c b/contrib/compiler-rt/lib/divdi3.c index fccfb8b..d62df56 100644 --- a/contrib/compiler-rt/lib/divdi3.c +++ b/contrib/compiler-rt/lib/divdi3.c @@ -2,8 +2,8 @@ * * The LLVM Compiler Infrastructure * - * This file is distributed under the University of Illinois Open Source - * License. See LICENSE.TXT for details. + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. * * ===----------------------------------------------------------------------=== * @@ -11,14 +11,15 @@ * * ===----------------------------------------------------------------------=== */ +#include "abi.h" #include "int_lib.h" -du_int __udivmoddi4(du_int a, du_int b, du_int* rem); +du_int COMPILER_RT_ABI __udivmoddi4(du_int a, du_int b, du_int* rem); /* Returns: a / b */ -di_int +COMPILER_RT_ABI di_int __divdi3(di_int a, di_int b) { const int bits_in_dword_m1 = (int)(sizeof(di_int) * CHAR_BIT) - 1; diff --git a/contrib/compiler-rt/lib/divmoddi4.c b/contrib/compiler-rt/lib/divmoddi4.c new file mode 100644 index 0000000..d3ca745 --- /dev/null +++ b/contrib/compiler-rt/lib/divmoddi4.c @@ -0,0 +1,30 @@ +/*===-- divmoddi4.c - Implement __divmoddi4 --------------------------------=== + * + * The LLVM Compiler Infrastructure + * + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. + * + * ===----------------------------------------------------------------------=== + * + * This file implements __divmoddi4 for the compiler_rt library. + * + * ===----------------------------------------------------------------------=== + */ +#include "abi.h" + +#include "int_lib.h" + +extern COMPILER_RT_ABI di_int __divdi3(di_int a, di_int b); + +ARM_EABI_FNALIAS(ldivmod, divmoddi4); + +/* Returns: a / b, *rem = a % b */ + +COMPILER_RT_ABI di_int +__divmoddi4(di_int a, di_int b, di_int* rem) +{ + di_int d = __divdi3(a,b); + *rem = a - (d*b); + return d; +} diff --git a/contrib/compiler-rt/lib/divmodsi4.c b/contrib/compiler-rt/lib/divmodsi4.c new file mode 100644 index 0000000..4dc1978 --- /dev/null +++ b/contrib/compiler-rt/lib/divmodsi4.c @@ -0,0 +1,31 @@ +/*===-- divmodsi4.c - Implement __divmodsi4 --------------------------------=== + * + * The LLVM Compiler Infrastructure + * + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. + * + * ===----------------------------------------------------------------------=== + * + * This file implements __divmodsi4 for the compiler_rt library. + * + * ===----------------------------------------------------------------------=== + */ +#include "abi.h" + +#include "int_lib.h" + +extern COMPILER_RT_ABI si_int __divsi3(si_int a, si_int b); + + +/* Returns: a / b, *rem = a % b */ + +COMPILER_RT_ABI si_int +__divmodsi4(si_int a, si_int b, si_int* rem) +{ + si_int d = __divsi3(a,b); + *rem = a - (d*b); + return d; +} + + diff --git a/contrib/compiler-rt/lib/divsc3.c b/contrib/compiler-rt/lib/divsc3.c index c38c863..a05f429 100644 --- a/contrib/compiler-rt/lib/divsc3.c +++ b/contrib/compiler-rt/lib/divsc3.c @@ -2,8 +2,8 @@ * * The LLVM Compiler Infrastructure * - * This file is distributed under the University of Illinois Open Source - * License. See LICENSE.TXT for details. + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. * * ===----------------------------------------------------------------------=== * diff --git a/contrib/compiler-rt/lib/divsf3.c b/contrib/compiler-rt/lib/divsf3.c index 03b7311..b733307 100644 --- a/contrib/compiler-rt/lib/divsf3.c +++ b/contrib/compiler-rt/lib/divsf3.c @@ -2,8 +2,8 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // @@ -15,10 +15,13 @@ // underflow with correct rounding. // //===----------------------------------------------------------------------===// +#include "abi.h" #define SINGLE_PRECISION #include "fp_lib.h" +ARM_EABI_FNALIAS(fdiv, divsf3); + fp_t __divsf3(fp_t a, fp_t b) { const unsigned int aExponent = toRep(a) >> significandBits & maxExponent; diff --git a/contrib/compiler-rt/lib/divsi3.c b/contrib/compiler-rt/lib/divsi3.c index 0eff6ef..01ef274 100644 --- a/contrib/compiler-rt/lib/divsi3.c +++ b/contrib/compiler-rt/lib/divsi3.c @@ -2,8 +2,8 @@ * * The LLVM Compiler Infrastructure * - * This file is distributed under the University of Illinois Open Source - * License. See LICENSE.TXT for details. + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. * * ===----------------------------------------------------------------------=== * @@ -11,14 +11,17 @@ * * ===----------------------------------------------------------------------=== */ +#include "abi.h" #include "int_lib.h" -su_int __udivsi3(su_int n, su_int d); +su_int COMPILER_RT_ABI __udivsi3(su_int n, su_int d); /* Returns: a / b */ -si_int +ARM_EABI_FNALIAS(idiv, divsi3); + +COMPILER_RT_ABI si_int __divsi3(si_int a, si_int b) { const int bits_in_word_m1 = (int)(sizeof(si_int) * CHAR_BIT) - 1; diff --git a/contrib/compiler-rt/lib/divti3.c b/contrib/compiler-rt/lib/divti3.c index c752f6c..4ec3fa3 100644 --- a/contrib/compiler-rt/lib/divti3.c +++ b/contrib/compiler-rt/lib/divti3.c @@ -2,8 +2,8 @@ * * The LLVM Compiler Infrastructure * - * This file is distributed under the University of Illinois Open Source - * License. See LICENSE.TXT for details. + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. * * ===----------------------------------------------------------------------=== * diff --git a/contrib/compiler-rt/lib/divxc3.c b/contrib/compiler-rt/lib/divxc3.c index 03357ae..f054d40 100644 --- a/contrib/compiler-rt/lib/divxc3.c +++ b/contrib/compiler-rt/lib/divxc3.c @@ -2,8 +2,8 @@ * * The LLVM Compiler Infrastructure * - * This file is distributed under the University of Illinois Open Source - * License. See LICENSE.TXT for details. + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. * * ===----------------------------------------------------------------------=== * diff --git a/contrib/compiler-rt/lib/enable_execute_stack.c b/contrib/compiler-rt/lib/enable_execute_stack.c index 193e7db..7ab8e8d 100644 --- a/contrib/compiler-rt/lib/enable_execute_stack.c +++ b/contrib/compiler-rt/lib/enable_execute_stack.c @@ -2,8 +2,8 @@ * * The LLVM Compiler Infrastructure * - * This file is distributed under the University of Illinois Open Source - * License. See LICENSE.TXT for details. + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. * * ===----------------------------------------------------------------------=== */ diff --git a/contrib/compiler-rt/lib/endianness.h b/contrib/compiler-rt/lib/endianness.h index 6d2587d..9b7e7c1 100644 --- a/contrib/compiler-rt/lib/endianness.h +++ b/contrib/compiler-rt/lib/endianness.h @@ -2,8 +2,8 @@ * * The LLVM Compiler Infrastructure * - * This file is distributed under the University of Illinois Open Source - * License. See LICENSE.TXT for details. + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. * * ===----------------------------------------------------------------------=== * diff --git a/contrib/compiler-rt/lib/eprintf.c b/contrib/compiler-rt/lib/eprintf.c index 786fe6a..7c79174 100644 --- a/contrib/compiler-rt/lib/eprintf.c +++ b/contrib/compiler-rt/lib/eprintf.c @@ -2,8 +2,8 @@ * * The LLVM Compiler Infrastructure * - * This file is distributed under the University of Illinois Open Source - * License. See LICENSE.TXT for details. + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. * * ===----------------------------------------------------------------------=== */ diff --git a/contrib/compiler-rt/lib/extendsfdf2.c b/contrib/compiler-rt/lib/extendsfdf2.c index 025eb95..c0b628d 100644 --- a/contrib/compiler-rt/lib/extendsfdf2.c +++ b/contrib/compiler-rt/lib/extendsfdf2.c @@ -2,8 +2,8 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // @@ -41,6 +41,8 @@ #include <stdint.h> #include <limits.h> +#include "abi.h" + typedef float src_t; typedef uint32_t src_rep_t; #define SRC_REP_C UINT32_C @@ -67,6 +69,8 @@ static inline dst_t dstFromRep(dst_rep_t x) { // End helper routines. Conversion implementation follows. +ARM_EABI_FNALIAS(f2d, extendsfdf2); + dst_t __extendsfdf2(src_t a) { // Various constants whose values follow from the type parameters. diff --git a/contrib/compiler-rt/lib/ffsdi2.c b/contrib/compiler-rt/lib/ffsdi2.c index 8c03d19..89f1b7b 100644 --- a/contrib/compiler-rt/lib/ffsdi2.c +++ b/contrib/compiler-rt/lib/ffsdi2.c @@ -2,8 +2,8 @@ * * The LLVM Compiler Infrastructure * - * This file is distributed under the University of Illinois Open Source - * License. See LICENSE.TXT for details. + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. * * ===----------------------------------------------------------------------=== * @@ -11,6 +11,7 @@ * * ===----------------------------------------------------------------------=== */ +#include "abi.h" #include "int_lib.h" @@ -18,7 +19,7 @@ * the value zero if a is zero. The least significant bit is index one. */ -si_int +COMPILER_RT_ABI si_int __ffsdi2(di_int a) { dwords x; diff --git a/contrib/compiler-rt/lib/ffsti2.c b/contrib/compiler-rt/lib/ffsti2.c index 0139eb1..948c696 100644 --- a/contrib/compiler-rt/lib/ffsti2.c +++ b/contrib/compiler-rt/lib/ffsti2.c @@ -2,8 +2,8 @@ * * The LLVM Compiler Infrastructure * - * This file is distributed under the University of Illinois Open Source - * License. See LICENSE.TXT for details. + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. * * ===----------------------------------------------------------------------=== * diff --git a/contrib/compiler-rt/lib/fixdfdi.c b/contrib/compiler-rt/lib/fixdfdi.c index 3d3116c..85a456d 100644 --- a/contrib/compiler-rt/lib/fixdfdi.c +++ b/contrib/compiler-rt/lib/fixdfdi.c @@ -2,8 +2,8 @@ * * The LLVM Compiler Infrastructure * - * This file is distributed under the University of Illinois Open Source - * License. See LICENSE.TXT for details. + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. * * ===----------------------------------------------------------------------=== * @@ -11,6 +11,7 @@ * * ===----------------------------------------------------------------------=== */ +#include "abi.h" #include "int_lib.h" @@ -23,6 +24,8 @@ /* seee eeee eeee mmmm mmmm mmmm mmmm mmmm | mmmm mmmm mmmm mmmm mmmm mmmm mmmm mmmm */ +ARM_EABI_FNALIAS(d2lz, fixdfdi); + di_int __fixdfdi(double a) { diff --git a/contrib/compiler-rt/lib/fixdfsi.c b/contrib/compiler-rt/lib/fixdfsi.c index 7d17aed..fbcf147 100644 --- a/contrib/compiler-rt/lib/fixdfsi.c +++ b/contrib/compiler-rt/lib/fixdfsi.c @@ -2,8 +2,8 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // @@ -12,10 +12,15 @@ // conversion is undefined for out of range values in the C standard. // //===----------------------------------------------------------------------===// +#include "abi.h" #define DOUBLE_PRECISION #include "fp_lib.h" +#include "int_lib.h" + +ARM_EABI_FNALIAS(d2iz, fixdfsi); + int __fixdfsi(fp_t a) { // Break a into sign, exponent, significand diff --git a/contrib/compiler-rt/lib/fixdfti.c b/contrib/compiler-rt/lib/fixdfti.c index 359b84e..4140d14 100644 --- a/contrib/compiler-rt/lib/fixdfti.c +++ b/contrib/compiler-rt/lib/fixdfti.c @@ -2,8 +2,8 @@ * * The LLVM Compiler Infrastructure * - * This file is distributed under the University of Illinois Open Source - * License. See LICENSE.TXT for details. + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. * * ===----------------------------------------------------------------------=== * diff --git a/contrib/compiler-rt/lib/fixsfdi.c b/contrib/compiler-rt/lib/fixsfdi.c index 08f1524..d80e33e 100644 --- a/contrib/compiler-rt/lib/fixsfdi.c +++ b/contrib/compiler-rt/lib/fixsfdi.c @@ -2,8 +2,8 @@ * * The LLVM Compiler Infrastructure * - * This file is distributed under the University of Illinois Open Source - * License. See LICENSE.TXT for details. + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. * * ===----------------------------------------------------------------------=== * @@ -11,6 +11,7 @@ * * ===----------------------------------------------------------------------=== */ +#include "abi.h" #include "int_lib.h" @@ -23,7 +24,9 @@ /* seee eeee emmm mmmm mmmm mmmm mmmm mmmm */ -di_int +ARM_EABI_FNALIAS(d2lz, fixsfdi); + +COMPILER_RT_ABI di_int __fixsfdi(float a) { float_bits fb; diff --git a/contrib/compiler-rt/lib/fixsfsi.c b/contrib/compiler-rt/lib/fixsfsi.c index ff79377..67749a5 100644 --- a/contrib/compiler-rt/lib/fixsfsi.c +++ b/contrib/compiler-rt/lib/fixsfsi.c @@ -2,8 +2,8 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // @@ -12,12 +12,15 @@ // conversion is undefined for out of range values in the C standard. // //===----------------------------------------------------------------------===// +#include "abi.h" #define SINGLE_PRECISION #include "fp_lib.h" -int __fixsfsi(fp_t a) { - +ARM_EABI_FNALIAS(f2iz, fixsfsi); + +COMPILER_RT_ABI int +__fixsfsi(fp_t a) { // Break a into sign, exponent, significand const rep_t aRep = toRep(a); const rep_t aAbs = aRep & absMask; diff --git a/contrib/compiler-rt/lib/fixsfti.c b/contrib/compiler-rt/lib/fixsfti.c index 95992fe..c64e5ae 100644 --- a/contrib/compiler-rt/lib/fixsfti.c +++ b/contrib/compiler-rt/lib/fixsfti.c @@ -2,8 +2,8 @@ * * The LLVM Compiler Infrastructure * - * This file is distributed under the University of Illinois Open Source - * License. See LICENSE.TXT for details. + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. * * ===----------------------------------------------------------------------=== * diff --git a/contrib/compiler-rt/lib/fixunsdfdi.c b/contrib/compiler-rt/lib/fixunsdfdi.c index bdcee13..d80b84a 100644 --- a/contrib/compiler-rt/lib/fixunsdfdi.c +++ b/contrib/compiler-rt/lib/fixunsdfdi.c @@ -2,8 +2,8 @@ * * The LLVM Compiler Infrastructure * - * This file is distributed under the University of Illinois Open Source - * License. See LICENSE.TXT for details. + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. * * ===----------------------------------------------------------------------=== * @@ -11,6 +11,7 @@ * * ===----------------------------------------------------------------------=== */ +#include "abi.h" #include "int_lib.h" @@ -26,7 +27,9 @@ /* seee eeee eeee mmmm mmmm mmmm mmmm mmmm | mmmm mmmm mmmm mmmm mmmm mmmm mmmm mmmm */ -du_int +ARM_EABI_FNALIAS(d2ulz, fixunsdfdi); + +COMPILER_RT_ABI du_int __fixunsdfdi(double a) { double_bits fb; diff --git a/contrib/compiler-rt/lib/fixunsdfsi.c b/contrib/compiler-rt/lib/fixunsdfsi.c index a0cba79..ecdfb5d 100644 --- a/contrib/compiler-rt/lib/fixunsdfsi.c +++ b/contrib/compiler-rt/lib/fixunsdfsi.c @@ -2,8 +2,8 @@ * * The LLVM Compiler Infrastructure * - * This file is distributed under the University of Illinois Open Source - * License. See LICENSE.TXT for details. + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. * * ===----------------------------------------------------------------------=== * @@ -11,6 +11,7 @@ * * ===----------------------------------------------------------------------=== */ +#include "abi.h" #include "int_lib.h" @@ -26,7 +27,9 @@ /* seee eeee eeee mmmm mmmm mmmm mmmm mmmm | mmmm mmmm mmmm mmmm mmmm mmmm mmmm mmmm */ -su_int +ARM_EABI_FNALIAS(d2uiz, fixunsdfsi); + +COMPILER_RT_ABI su_int __fixunsdfsi(double a) { double_bits fb; diff --git a/contrib/compiler-rt/lib/fixunsdfti.c b/contrib/compiler-rt/lib/fixunsdfti.c index c1cd72d..524a207 100644 --- a/contrib/compiler-rt/lib/fixunsdfti.c +++ b/contrib/compiler-rt/lib/fixunsdfti.c @@ -2,8 +2,8 @@ * * The LLVM Compiler Infrastructure * - * This file is distributed under the University of Illinois Open Source - * License. See LICENSE.TXT for details. + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. * * ===----------------------------------------------------------------------=== * diff --git a/contrib/compiler-rt/lib/fixunssfdi.c b/contrib/compiler-rt/lib/fixunssfdi.c index 3837bd8..1506420 100644 --- a/contrib/compiler-rt/lib/fixunssfdi.c +++ b/contrib/compiler-rt/lib/fixunssfdi.c @@ -2,8 +2,8 @@ * * The LLVM Compiler Infrastructure * - * This file is distributed under the University of Illinois Open Source - * License. See LICENSE.TXT for details. + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. * * ===----------------------------------------------------------------------=== * @@ -11,9 +11,9 @@ * * ===----------------------------------------------------------------------=== */ +#include "abi.h" #include "int_lib.h" - /* Returns: convert a to a unsigned long long, rounding toward zero. * Negative values all become zero. */ @@ -26,7 +26,9 @@ /* seee eeee emmm mmmm mmmm mmmm mmmm mmmm */ -du_int +ARM_EABI_FNALIAS(f2ulz, fixunssfdi); + +COMPILER_RT_ABI du_int __fixunssfdi(float a) { float_bits fb; diff --git a/contrib/compiler-rt/lib/fixunssfsi.c b/contrib/compiler-rt/lib/fixunssfsi.c index a001cd4..dbaa511 100644 --- a/contrib/compiler-rt/lib/fixunssfsi.c +++ b/contrib/compiler-rt/lib/fixunssfsi.c @@ -2,8 +2,8 @@ * * The LLVM Compiler Infrastructure * - * This file is distributed under the University of Illinois Open Source - * License. See LICENSE.TXT for details. + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. * * ===----------------------------------------------------------------------=== * @@ -11,6 +11,7 @@ * * ===----------------------------------------------------------------------=== */ +#include "abi.h" #include "int_lib.h" @@ -26,7 +27,9 @@ /* seee eeee emmm mmmm mmmm mmmm mmmm mmmm */ -su_int +ARM_EABI_FNALIAS(f2uiz, fixunssfsi); + +COMPILER_RT_ABI su_int __fixunssfsi(float a) { float_bits fb; diff --git a/contrib/compiler-rt/lib/fixunssfti.c b/contrib/compiler-rt/lib/fixunssfti.c index 20b7e76..b807910 100644 --- a/contrib/compiler-rt/lib/fixunssfti.c +++ b/contrib/compiler-rt/lib/fixunssfti.c @@ -2,8 +2,8 @@ * * The LLVM Compiler Infrastructure * - * This file is distributed under the University of Illinois Open Source - * License. See LICENSE.TXT for details. + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. * * ===----------------------------------------------------------------------=== * diff --git a/contrib/compiler-rt/lib/fixunsxfdi.c b/contrib/compiler-rt/lib/fixunsxfdi.c index 872727b..6c817d8e 100644 --- a/contrib/compiler-rt/lib/fixunsxfdi.c +++ b/contrib/compiler-rt/lib/fixunsxfdi.c @@ -2,8 +2,8 @@ * * The LLVM Compiler Infrastructure * - * This file is distributed under the University of Illinois Open Source - * License. See LICENSE.TXT for details. + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. * * ===----------------------------------------------------------------------=== * diff --git a/contrib/compiler-rt/lib/fixunsxfsi.c b/contrib/compiler-rt/lib/fixunsxfsi.c index c9a607a..b9da86c 100644 --- a/contrib/compiler-rt/lib/fixunsxfsi.c +++ b/contrib/compiler-rt/lib/fixunsxfsi.c @@ -2,8 +2,8 @@ * * The LLVM Compiler Infrastructure * - * This file is distributed under the University of Illinois Open Source - * License. See LICENSE.TXT for details. + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. * * ===----------------------------------------------------------------------=== * diff --git a/contrib/compiler-rt/lib/fixunsxfti.c b/contrib/compiler-rt/lib/fixunsxfti.c index d0bd512..f0e16db 100644 --- a/contrib/compiler-rt/lib/fixunsxfti.c +++ b/contrib/compiler-rt/lib/fixunsxfti.c @@ -2,8 +2,8 @@ * * The LLVM Compiler Infrastructure * - * This file is distributed under the University of Illinois Open Source - * License. See LICENSE.TXT for details. + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. * * ===----------------------------------------------------------------------=== * diff --git a/contrib/compiler-rt/lib/fixxfdi.c b/contrib/compiler-rt/lib/fixxfdi.c index de6f818..9592ce4 100644 --- a/contrib/compiler-rt/lib/fixxfdi.c +++ b/contrib/compiler-rt/lib/fixxfdi.c @@ -2,8 +2,8 @@ * * The LLVM Compiler Infrastructure * - * This file is distributed under the University of Illinois Open Source - * License. See LICENSE.TXT for details. + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. * * ===----------------------------------------------------------------------=== * diff --git a/contrib/compiler-rt/lib/fixxfti.c b/contrib/compiler-rt/lib/fixxfti.c index c224801..1022770 100644 --- a/contrib/compiler-rt/lib/fixxfti.c +++ b/contrib/compiler-rt/lib/fixxfti.c @@ -2,8 +2,8 @@ * * The LLVM Compiler Infrastructure * - * This file is distributed under the University of Illinois Open Source - * License. See LICENSE.TXT for details. + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. * * ===----------------------------------------------------------------------=== * diff --git a/contrib/compiler-rt/lib/floatdidf.c b/contrib/compiler-rt/lib/floatdidf.c index a0f501b..5ba9526 100644 --- a/contrib/compiler-rt/lib/floatdidf.c +++ b/contrib/compiler-rt/lib/floatdidf.c @@ -2,8 +2,8 @@ * * The LLVM Compiler Infrastructure * - * This file is distributed under the University of Illinois Open Source - * License. See LICENSE.TXT for details. + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. * *===----------------------------------------------------------------------=== * @@ -11,6 +11,7 @@ * *===----------------------------------------------------------------------=== */ +#include "abi.h" #include "int_lib.h" #include <float.h> @@ -23,13 +24,15 @@ /* seee eeee eeee mmmm mmmm mmmm mmmm mmmm | mmmm mmmm mmmm mmmm mmmm mmmm mmmm mmmm */ +ARM_EABI_FNALIAS(l2d, floatdidf); + #ifndef __SOFT_FP__ /* Support for systems that have hardware floating-point; we'll set the inexact flag * as a side-effect of this computation. */ #include <stdint.h> -double +COMPILER_RT_ABI double __floatdidf(di_int a) { static const double twop52 = 0x1.0p52; @@ -49,7 +52,7 @@ __floatdidf(di_int a) * set, and we don't want to code-gen to an unknown soft-float implementation. */ -double +COMPILER_RT_ABI double __floatdidf(di_int a) { if (a == 0) diff --git a/contrib/compiler-rt/lib/floatdisf.c b/contrib/compiler-rt/lib/floatdisf.c index 1925f15..4dc13ca 100644 --- a/contrib/compiler-rt/lib/floatdisf.c +++ b/contrib/compiler-rt/lib/floatdisf.c @@ -2,8 +2,8 @@ * * The LLVM Compiler Infrastructure * - * This file is distributed under the University of Illinois Open Source - * License. See LICENSE.TXT for details. + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. * *===----------------------------------------------------------------------=== * @@ -12,7 +12,7 @@ *===----------------------------------------------------------------------=== */ -#include "int_lib.h" +#include "abi.h" #include <float.h> /* Returns: convert a to a float, rounding toward even.*/ @@ -23,7 +23,11 @@ /* seee eeee emmm mmmm mmmm mmmm mmmm mmmm */ -float +#include "int_lib.h" + +ARM_EABI_FNALIAS(l2f, floatdisf); + +COMPILER_RT_ABI float __floatdisf(di_int a) { if (a == 0) diff --git a/contrib/compiler-rt/lib/floatdixf.c b/contrib/compiler-rt/lib/floatdixf.c index bfda367..ebf62db 100644 --- a/contrib/compiler-rt/lib/floatdixf.c +++ b/contrib/compiler-rt/lib/floatdixf.c @@ -2,8 +2,8 @@ * * The LLVM Compiler Infrastructure * - * This file is distributed under the University of Illinois Open Source - * License. See LICENSE.TXT for details. + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. * * ===----------------------------------------------------------------------=== * diff --git a/contrib/compiler-rt/lib/floatsidf.c b/contrib/compiler-rt/lib/floatsidf.c index a13ab8f..7227335 100644 --- a/contrib/compiler-rt/lib/floatsidf.c +++ b/contrib/compiler-rt/lib/floatsidf.c @@ -2,8 +2,8 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // @@ -12,10 +12,15 @@ // mode. // //===----------------------------------------------------------------------===// +#include "abi.h" #define DOUBLE_PRECISION #include "fp_lib.h" +#include "int_lib.h" + +ARM_EABI_FNALIAS(i2d, floatsidf); + fp_t __floatsidf(int a) { const int aWidth = sizeof a * CHAR_BIT; diff --git a/contrib/compiler-rt/lib/floatsisf.c b/contrib/compiler-rt/lib/floatsisf.c index 4a62975..e5250ff 100644 --- a/contrib/compiler-rt/lib/floatsisf.c +++ b/contrib/compiler-rt/lib/floatsisf.c @@ -2,8 +2,8 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // @@ -12,10 +12,15 @@ // mode. // //===----------------------------------------------------------------------===// +#include "abi.h" #define SINGLE_PRECISION #include "fp_lib.h" +#include "int_lib.h" + +ARM_EABI_FNALIAS(i2f, floatsisf); + fp_t __floatsisf(int a) { const int aWidth = sizeof a * CHAR_BIT; diff --git a/contrib/compiler-rt/lib/floattidf.c b/contrib/compiler-rt/lib/floattidf.c index 274f585..f61844d 100644 --- a/contrib/compiler-rt/lib/floattidf.c +++ b/contrib/compiler-rt/lib/floattidf.c @@ -2,8 +2,8 @@ * * The LLVM Compiler Infrastructure * - * This file is distributed under the University of Illinois Open Source - * License. See LICENSE.TXT for details. + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. * * ===----------------------------------------------------------------------=== * diff --git a/contrib/compiler-rt/lib/floattisf.c b/contrib/compiler-rt/lib/floattisf.c index 72f3748..7eb761d 100644 --- a/contrib/compiler-rt/lib/floattisf.c +++ b/contrib/compiler-rt/lib/floattisf.c @@ -2,8 +2,8 @@ * * The LLVM Compiler Infrastructure * - * This file is distributed under the University of Illinois Open Source - * License. See LICENSE.TXT for details. + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. * * ===----------------------------------------------------------------------=== * diff --git a/contrib/compiler-rt/lib/floattixf.c b/contrib/compiler-rt/lib/floattixf.c index 77d9060..e4bcb5f 100644 --- a/contrib/compiler-rt/lib/floattixf.c +++ b/contrib/compiler-rt/lib/floattixf.c @@ -2,8 +2,8 @@ * * The LLVM Compiler Infrastructure * - * This file is distributed under the University of Illinois Open Source - * License. See LICENSE.TXT for details. + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. * * ===----------------------------------------------------------------------=== * diff --git a/contrib/compiler-rt/lib/floatundidf.c b/contrib/compiler-rt/lib/floatundidf.c index 1f304c5..e74e9d8 100644 --- a/contrib/compiler-rt/lib/floatundidf.c +++ b/contrib/compiler-rt/lib/floatundidf.c @@ -2,8 +2,8 @@ * * The LLVM Compiler Infrastructure * - * This file is distributed under the University of Illinois Open Source - * License. See LICENSE.TXT for details. + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. * * ===----------------------------------------------------------------------=== * @@ -12,7 +12,7 @@ * ===----------------------------------------------------------------------=== */ -#include "int_lib.h" +#include "abi.h" #include <float.h> /* Returns: convert a to a double, rounding toward even. */ @@ -23,6 +23,10 @@ /* seee eeee eeee mmmm mmmm mmmm mmmm mmmm | mmmm mmmm mmmm mmmm mmmm mmmm mmmm mmmm */ +#include "int_lib.h" + +ARM_EABI_FNALIAS(ul2d, floatundidf); + #ifndef __SOFT_FP__ /* Support for systems that have hardware floating-point; we'll set the inexact flag * as a side-effect of this computation. @@ -30,7 +34,7 @@ #include <stdint.h> -double +COMPILER_RT_ABI double __floatundidf(du_int a) { static const double twop52 = 0x1.0p52; @@ -52,7 +56,7 @@ __floatundidf(du_int a) * set, and we don't want to code-gen to an unknown soft-float implementation. */ -double +COMPILER_RT_ABI double __floatundidf(du_int a) { if (a == 0) diff --git a/contrib/compiler-rt/lib/floatundisf.c b/contrib/compiler-rt/lib/floatundisf.c index 79b4b82..eea45a7 100644 --- a/contrib/compiler-rt/lib/floatundisf.c +++ b/contrib/compiler-rt/lib/floatundisf.c @@ -2,8 +2,8 @@ * * The LLVM Compiler Infrastructure * - * This file is distributed under the University of Illinois Open Source - * License. See LICENSE.TXT for details. + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. * * ===----------------------------------------------------------------------=== * @@ -12,7 +12,7 @@ *===----------------------------------------------------------------------=== */ -#include "int_lib.h" +#include "abi.h" #include <float.h> /* Returns: convert a to a float, rounding toward even. */ @@ -23,7 +23,11 @@ /* seee eeee emmm mmmm mmmm mmmm mmmm mmmm */ -float +#include "int_lib.h" + +ARM_EABI_FNALIAS(ul2f, floatundisf); + +COMPILER_RT_ABI float __floatundisf(du_int a) { if (a == 0) diff --git a/contrib/compiler-rt/lib/floatundixf.c b/contrib/compiler-rt/lib/floatundixf.c index bc9582f..64f7662 100644 --- a/contrib/compiler-rt/lib/floatundixf.c +++ b/contrib/compiler-rt/lib/floatundixf.c @@ -2,8 +2,8 @@ * * The LLVM Compiler Infrastructure * - * This file is distributed under the University of Illinois Open Source - * License. See LICENSE.TXT for details. + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. * * ===----------------------------------------------------------------------=== * diff --git a/contrib/compiler-rt/lib/floatunsidf.c b/contrib/compiler-rt/lib/floatunsidf.c index 05242c1..3756299 100644 --- a/contrib/compiler-rt/lib/floatunsidf.c +++ b/contrib/compiler-rt/lib/floatunsidf.c @@ -2,8 +2,8 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // @@ -12,10 +12,15 @@ // mode. // //===----------------------------------------------------------------------===// +#include "abi.h" #define DOUBLE_PRECISION #include "fp_lib.h" +#include "int_lib.h" + +ARM_EABI_FNALIAS(ui2d, floatunsidf); + fp_t __floatunsidf(unsigned int a) { const int aWidth = sizeof a * CHAR_BIT; diff --git a/contrib/compiler-rt/lib/floatunsisf.c b/contrib/compiler-rt/lib/floatunsisf.c index 31c0644..14ef103 100644 --- a/contrib/compiler-rt/lib/floatunsisf.c +++ b/contrib/compiler-rt/lib/floatunsisf.c @@ -2,8 +2,8 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // @@ -12,10 +12,15 @@ // mode. // //===----------------------------------------------------------------------===// +#include "abi.h" #define SINGLE_PRECISION #include "fp_lib.h" +#include "int_lib.h" + +ARM_EABI_FNALIAS(ui2f, floatunsisf); + fp_t __floatunsisf(unsigned int a) { const int aWidth = sizeof a * CHAR_BIT; diff --git a/contrib/compiler-rt/lib/floatuntidf.c b/contrib/compiler-rt/lib/floatuntidf.c index 51d8b28..bab7483 100644 --- a/contrib/compiler-rt/lib/floatuntidf.c +++ b/contrib/compiler-rt/lib/floatuntidf.c @@ -2,8 +2,8 @@ * * The LLVM Compiler Infrastructure * - * This file is distributed under the University of Illinois Open Source - * License. See LICENSE.TXT for details. + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. * * ===----------------------------------------------------------------------=== * diff --git a/contrib/compiler-rt/lib/floatuntisf.c b/contrib/compiler-rt/lib/floatuntisf.c index 328f39b..0ab6d7e 100644 --- a/contrib/compiler-rt/lib/floatuntisf.c +++ b/contrib/compiler-rt/lib/floatuntisf.c @@ -2,8 +2,8 @@ * * The LLVM Compiler Infrastructure * - * This file is distributed under the University of Illinois Open Source - * License. See LICENSE.TXT for details. + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. * * ===----------------------------------------------------------------------=== * diff --git a/contrib/compiler-rt/lib/floatuntixf.c b/contrib/compiler-rt/lib/floatuntixf.c index e82d0c1..a84709a 100644 --- a/contrib/compiler-rt/lib/floatuntixf.c +++ b/contrib/compiler-rt/lib/floatuntixf.c @@ -2,8 +2,8 @@ * * The LLVM Compiler Infrastructure * - * This file is distributed under the University of Illinois Open Source - * License. See LICENSE.TXT for details. + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. * * ===----------------------------------------------------------------------=== * diff --git a/contrib/compiler-rt/lib/fp_lib.h b/contrib/compiler-rt/lib/fp_lib.h index eac670d..6c9455a 100644 --- a/contrib/compiler-rt/lib/fp_lib.h +++ b/contrib/compiler-rt/lib/fp_lib.h @@ -2,8 +2,8 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // diff --git a/contrib/compiler-rt/lib/gcc_personality_v0.c b/contrib/compiler-rt/lib/gcc_personality_v0.c index 5940190..c840eef 100644 --- a/contrib/compiler-rt/lib/gcc_personality_v0.c +++ b/contrib/compiler-rt/lib/gcc_personality_v0.c @@ -2,8 +2,8 @@ * * The LLVM Compiler Infrastructure * - * This file is distributed under the University of Illinois Open Source - * License. See LICENSE.TXT for details. + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. * * ===----------------------------------------------------------------------=== * diff --git a/contrib/compiler-rt/lib/i386/ashldi3.S b/contrib/compiler-rt/lib/i386/ashldi3.S index af6f98b..5488ad6 100644 --- a/contrib/compiler-rt/lib/i386/ashldi3.S +++ b/contrib/compiler-rt/lib/i386/ashldi3.S @@ -1,5 +1,5 @@ -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. #include "../assembly.h" diff --git a/contrib/compiler-rt/lib/i386/ashrdi3.S b/contrib/compiler-rt/lib/i386/ashrdi3.S index 346f9b1..b1445dd 100644 --- a/contrib/compiler-rt/lib/i386/ashrdi3.S +++ b/contrib/compiler-rt/lib/i386/ashrdi3.S @@ -1,5 +1,5 @@ -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. #include "../assembly.h" diff --git a/contrib/compiler-rt/lib/i386/divdi3.S b/contrib/compiler-rt/lib/i386/divdi3.S index 5ad530c..69593e3 100644 --- a/contrib/compiler-rt/lib/i386/divdi3.S +++ b/contrib/compiler-rt/lib/i386/divdi3.S @@ -1,5 +1,5 @@ -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. #include "../assembly.h" diff --git a/contrib/compiler-rt/lib/i386/floatdidf.S b/contrib/compiler-rt/lib/i386/floatdidf.S index 3a526ea..a953d26 100644 --- a/contrib/compiler-rt/lib/i386/floatdidf.S +++ b/contrib/compiler-rt/lib/i386/floatdidf.S @@ -1,5 +1,5 @@ -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. #include "../assembly.h" diff --git a/contrib/compiler-rt/lib/i386/floatdisf.S b/contrib/compiler-rt/lib/i386/floatdisf.S index 741e4a6..a98a46e 100644 --- a/contrib/compiler-rt/lib/i386/floatdisf.S +++ b/contrib/compiler-rt/lib/i386/floatdisf.S @@ -1,5 +1,5 @@ -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. #include "../assembly.h" diff --git a/contrib/compiler-rt/lib/i386/floatdixf.S b/contrib/compiler-rt/lib/i386/floatdixf.S index f0271ab..412976f 100644 --- a/contrib/compiler-rt/lib/i386/floatdixf.S +++ b/contrib/compiler-rt/lib/i386/floatdixf.S @@ -1,5 +1,5 @@ -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. #include "../assembly.h" diff --git a/contrib/compiler-rt/lib/i386/floatundidf.S b/contrib/compiler-rt/lib/i386/floatundidf.S index 7186a35..6bba7e1 100644 --- a/contrib/compiler-rt/lib/i386/floatundidf.S +++ b/contrib/compiler-rt/lib/i386/floatundidf.S @@ -2,8 +2,8 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // diff --git a/contrib/compiler-rt/lib/i386/floatundisf.S b/contrib/compiler-rt/lib/i386/floatundisf.S index 070820c..1afd1d4 100644 --- a/contrib/compiler-rt/lib/i386/floatundisf.S +++ b/contrib/compiler-rt/lib/i386/floatundisf.S @@ -1,5 +1,5 @@ -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. #include "../assembly.h" diff --git a/contrib/compiler-rt/lib/i386/floatundixf.S b/contrib/compiler-rt/lib/i386/floatundixf.S index 2cf6d5c..6e6710b 100644 --- a/contrib/compiler-rt/lib/i386/floatundixf.S +++ b/contrib/compiler-rt/lib/i386/floatundixf.S @@ -1,5 +1,5 @@ -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. #include "../assembly.h" diff --git a/contrib/compiler-rt/lib/i386/lshrdi3.S b/contrib/compiler-rt/lib/i386/lshrdi3.S index 74937d2..cf411f2 100644 --- a/contrib/compiler-rt/lib/i386/lshrdi3.S +++ b/contrib/compiler-rt/lib/i386/lshrdi3.S @@ -1,5 +1,5 @@ -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. #include "../assembly.h" diff --git a/contrib/compiler-rt/lib/i386/moddi3.S b/contrib/compiler-rt/lib/i386/moddi3.S index 85f5b38..8839cfc 100644 --- a/contrib/compiler-rt/lib/i386/moddi3.S +++ b/contrib/compiler-rt/lib/i386/moddi3.S @@ -1,5 +1,5 @@ -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. #include "../assembly.h" diff --git a/contrib/compiler-rt/lib/i386/muldi3.S b/contrib/compiler-rt/lib/i386/muldi3.S index 5f99f6a..e56a355 100644 --- a/contrib/compiler-rt/lib/i386/muldi3.S +++ b/contrib/compiler-rt/lib/i386/muldi3.S @@ -1,5 +1,5 @@ -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. #include "../assembly.h" diff --git a/contrib/compiler-rt/lib/i386/udivdi3.S b/contrib/compiler-rt/lib/i386/udivdi3.S index 77936f8..5abeaea 100644 --- a/contrib/compiler-rt/lib/i386/udivdi3.S +++ b/contrib/compiler-rt/lib/i386/udivdi3.S @@ -1,5 +1,5 @@ -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. #include "../assembly.h" diff --git a/contrib/compiler-rt/lib/i386/umoddi3.S b/contrib/compiler-rt/lib/i386/umoddi3.S index 3cf8aeb..7fd8485 100644 --- a/contrib/compiler-rt/lib/i386/umoddi3.S +++ b/contrib/compiler-rt/lib/i386/umoddi3.S @@ -1,5 +1,5 @@ -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. #include "../assembly.h" diff --git a/contrib/compiler-rt/lib/int_lib.h b/contrib/compiler-rt/lib/int_lib.h index 912a12f..e1fd6b7 100644 --- a/contrib/compiler-rt/lib/int_lib.h +++ b/contrib/compiler-rt/lib/int_lib.h @@ -2,8 +2,8 @@ * * The LLVM Compiler Infrastructure * - * This file is distributed under the University of Illinois Open Source - * License. See LICENSE.TXT for details. + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. * * ===----------------------------------------------------------------------=== * @@ -20,6 +20,7 @@ /* Assumption: right shift of signed negative is arithmetic shift */ #include <limits.h> +#include <stdint.h> #include "endianness.h" #include <math.h> diff --git a/contrib/compiler-rt/lib/lshrdi3.c b/contrib/compiler-rt/lib/lshrdi3.c index 57484ee..911edb1 100644 --- a/contrib/compiler-rt/lib/lshrdi3.c +++ b/contrib/compiler-rt/lib/lshrdi3.c @@ -2,8 +2,8 @@ * * The LLVM Compiler Infrastructure * - * This file is distributed under the University of Illinois Open Source - * License. See LICENSE.TXT for details. + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. * * ===----------------------------------------------------------------------=== * @@ -11,6 +11,7 @@ * * ===----------------------------------------------------------------------=== */ +#include "abi.h" #include "int_lib.h" @@ -18,7 +19,9 @@ /* Precondition: 0 <= b < bits_in_dword */ -di_int +ARM_EABI_FNALIAS(llsr, lshrdi3); + +COMPILER_RT_ABI di_int __lshrdi3(di_int a, si_int b) { const int bits_in_word = (int)(sizeof(si_int) * CHAR_BIT); diff --git a/contrib/compiler-rt/lib/lshrti3.c b/contrib/compiler-rt/lib/lshrti3.c index 3272c9c..5fdd99e 100644 --- a/contrib/compiler-rt/lib/lshrti3.c +++ b/contrib/compiler-rt/lib/lshrti3.c @@ -2,8 +2,8 @@ * * The LLVM Compiler Infrastructure * - * This file is distributed under the University of Illinois Open Source - * License. See LICENSE.TXT for details. + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. * * ===----------------------------------------------------------------------=== * diff --git a/contrib/compiler-rt/lib/moddi3.c b/contrib/compiler-rt/lib/moddi3.c index 4533555..af0a8083 100644 --- a/contrib/compiler-rt/lib/moddi3.c +++ b/contrib/compiler-rt/lib/moddi3.c @@ -2,8 +2,8 @@ * * The LLVM Compiler Infrastructure * - * This file is distributed under the University of Illinois Open Source - * License. See LICENSE.TXT for details. + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. * * ===----------------------------------------------------------------------=== * @@ -11,14 +11,15 @@ * * ===----------------------------------------------------------------------=== */ +#include "abi.h" #include "int_lib.h" -du_int __udivmoddi4(du_int a, du_int b, du_int* rem); +COMPILER_RT_ABI du_int __udivmoddi4(du_int a, du_int b, du_int* rem); /* Returns: a % b */ -di_int +COMPILER_RT_ABI di_int __moddi3(di_int a, di_int b) { const int bits_in_dword_m1 = (int)(sizeof(di_int) * CHAR_BIT) - 1; diff --git a/contrib/compiler-rt/lib/modsi3.c b/contrib/compiler-rt/lib/modsi3.c index c9214a2..05ce806 100644 --- a/contrib/compiler-rt/lib/modsi3.c +++ b/contrib/compiler-rt/lib/modsi3.c @@ -2,8 +2,8 @@ * * The LLVM Compiler Infrastructure * - * This file is distributed under the University of Illinois Open Source - * License. See LICENSE.TXT for details. + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. * * ===----------------------------------------------------------------------=== * @@ -11,13 +11,16 @@ * * ===----------------------------------------------------------------------=== */ +#include "abi.h" #include "int_lib.h" +su_int COMPILER_RT_ABI __divsi3(si_int a, si_int b); + /* Returns: a % b */ -si_int +COMPILER_RT_ABI si_int __modsi3(si_int a, si_int b) { - return a - (a / b) * b; + return a - __divsi3(a, b) * b; } diff --git a/contrib/compiler-rt/lib/modti3.c b/contrib/compiler-rt/lib/modti3.c index 75d688e..dbe5e94 100644 --- a/contrib/compiler-rt/lib/modti3.c +++ b/contrib/compiler-rt/lib/modti3.c @@ -2,8 +2,8 @@ * * The LLVM Compiler Infrastructure * - * This file is distributed under the University of Illinois Open Source - * License. See LICENSE.TXT for details. + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. * * ===----------------------------------------------------------------------=== * diff --git a/contrib/compiler-rt/lib/muldc3.c b/contrib/compiler-rt/lib/muldc3.c index c048d84..9f9bd2a 100644 --- a/contrib/compiler-rt/lib/muldc3.c +++ b/contrib/compiler-rt/lib/muldc3.c @@ -2,8 +2,8 @@ * * The LLVM Compiler Infrastructure * - * This file is distributed under the University of Illinois Open Source - * License. See LICENSE.TXT for details. + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. * * ===----------------------------------------------------------------------=== * diff --git a/contrib/compiler-rt/lib/muldf3.c b/contrib/compiler-rt/lib/muldf3.c index 63a473e..f402cfb 100644 --- a/contrib/compiler-rt/lib/muldf3.c +++ b/contrib/compiler-rt/lib/muldf3.c @@ -2,8 +2,8 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // @@ -11,11 +11,15 @@ // with the IEEE-754 default rounding (to nearest, ties to even). // //===----------------------------------------------------------------------===// +#include "abi.h" #define DOUBLE_PRECISION #include "fp_lib.h" -fp_t __muldf3(fp_t a, fp_t b) { +ARM_EABI_FNALIAS(dmul, muldf3); + +COMPILER_RT_ABI fp_t +__muldf3(fp_t a, fp_t b) { const unsigned int aExponent = toRep(a) >> significandBits & maxExponent; const unsigned int bExponent = toRep(b) >> significandBits & maxExponent; diff --git a/contrib/compiler-rt/lib/muldi3.c b/contrib/compiler-rt/lib/muldi3.c index 38963b7..e6322bf 100644 --- a/contrib/compiler-rt/lib/muldi3.c +++ b/contrib/compiler-rt/lib/muldi3.c @@ -2,15 +2,16 @@ * * The LLVM Compiler Infrastructure * - * This file is distributed under the University of Illinois Open Source - * License. See LICENSE.TXT for details. + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. * * ===----------------------------------------------------------------------=== * * This file implements __muldi3 for the compiler_rt library. * * ===----------------------------------------------------------------------=== - */ + */ +#include "abi.h" #include "int_lib.h" @@ -40,7 +41,9 @@ __muldsi3(su_int a, su_int b) /* Returns: a * b */ -di_int +ARM_EABI_FNALIAS(lmul, muldi3); + +COMPILER_RT_ABI di_int __muldi3(di_int a, di_int b) { dwords x; diff --git a/contrib/compiler-rt/lib/mulsc3.c b/contrib/compiler-rt/lib/mulsc3.c index c7b9f64..a878ba1 100644 --- a/contrib/compiler-rt/lib/mulsc3.c +++ b/contrib/compiler-rt/lib/mulsc3.c @@ -2,8 +2,8 @@ * * The LLVM Compiler Infrastructure * - * This file is distributed under the University of Illinois Open Source - * License. See LICENSE.TXT for details. + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. * * ===----------------------------------------------------------------------=== * diff --git a/contrib/compiler-rt/lib/mulsf3.c b/contrib/compiler-rt/lib/mulsf3.c index 6bd2f9d..bf46e14 100644 --- a/contrib/compiler-rt/lib/mulsf3.c +++ b/contrib/compiler-rt/lib/mulsf3.c @@ -2,8 +2,8 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // @@ -11,11 +11,15 @@ // with the IEEE-754 default rounding (to nearest, ties to even). // //===----------------------------------------------------------------------===// +#include "abi.h" #define SINGLE_PRECISION #include "fp_lib.h" -fp_t __mulsf3(fp_t a, fp_t b) { +ARM_EABI_FNALIAS(fmul, mulsf3); + +COMPILER_RT_ABI fp_t +__mulsf3(fp_t a, fp_t b) { const unsigned int aExponent = toRep(a) >> significandBits & maxExponent; const unsigned int bExponent = toRep(b) >> significandBits & maxExponent; diff --git a/contrib/compiler-rt/lib/multi3.c b/contrib/compiler-rt/lib/multi3.c index 13a3867..ad8ab3f 100644 --- a/contrib/compiler-rt/lib/multi3.c +++ b/contrib/compiler-rt/lib/multi3.c @@ -2,8 +2,8 @@ * * The LLVM Compiler Infrastructure * - * This file is distributed under the University of Illinois Open Source - * License. See LICENSE.TXT for details. + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. * * ===----------------------------------------------------------------------=== diff --git a/contrib/compiler-rt/lib/mulvdi3.c b/contrib/compiler-rt/lib/mulvdi3.c index 295ae18..fcbb5b3 100644 --- a/contrib/compiler-rt/lib/mulvdi3.c +++ b/contrib/compiler-rt/lib/mulvdi3.c @@ -2,8 +2,8 @@ * * The LLVM Compiler Infrastructure * - * This file is distributed under the University of Illinois Open Source - * License. See LICENSE.TXT for details. + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. * * ===----------------------------------------------------------------------=== * diff --git a/contrib/compiler-rt/lib/mulvsi3.c b/contrib/compiler-rt/lib/mulvsi3.c index b4a509b..6271cd4 100644 --- a/contrib/compiler-rt/lib/mulvsi3.c +++ b/contrib/compiler-rt/lib/mulvsi3.c @@ -2,8 +2,8 @@ * * The LLVM Compiler Infrastructure * - * This file is distributed under the University of Illinois Open Source - * License. See LICENSE.TXT for details. + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. * * ===----------------------------------------------------------------------=== * diff --git a/contrib/compiler-rt/lib/mulvti3.c b/contrib/compiler-rt/lib/mulvti3.c index 778222e..7da9187 100644 --- a/contrib/compiler-rt/lib/mulvti3.c +++ b/contrib/compiler-rt/lib/mulvti3.c @@ -2,8 +2,8 @@ * * The LLVM Compiler Infrastructure * - * This file is distributed under the University of Illinois Open Source - * License. See LICENSE.TXT for details. + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. * * ===----------------------------------------------------------------------=== * diff --git a/contrib/compiler-rt/lib/mulxc3.c b/contrib/compiler-rt/lib/mulxc3.c index 94895f2..b5ae865 100644 --- a/contrib/compiler-rt/lib/mulxc3.c +++ b/contrib/compiler-rt/lib/mulxc3.c @@ -2,8 +2,8 @@ * * The LLVM Compiler Infrastructure * - * This file is distributed under the University of Illinois Open Source - * License. See LICENSE.TXT for details. + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. * * ===----------------------------------------------------------------------=== * diff --git a/contrib/compiler-rt/lib/negdf2.c b/contrib/compiler-rt/lib/negdf2.c index 527b068..b47f397 100644 --- a/contrib/compiler-rt/lib/negdf2.c +++ b/contrib/compiler-rt/lib/negdf2.c @@ -2,18 +2,21 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file implements double-precision soft-float negation. // //===----------------------------------------------------------------------===// +#include "abi.h" #define DOUBLE_PRECISION #include "fp_lib.h" +ARM_EABI_FNALIAS(dneg, negdf2); + fp_t __negdf2(fp_t a) { return fromRep(toRep(a) ^ signBit); } diff --git a/contrib/compiler-rt/lib/negdi2.c b/contrib/compiler-rt/lib/negdi2.c index 707b0dd..b000dda 100644 --- a/contrib/compiler-rt/lib/negdi2.c +++ b/contrib/compiler-rt/lib/negdi2.c @@ -2,8 +2,8 @@ * * The LLVM Compiler Infrastructure * - * This file is distributed under the University of Illinois Open Source - * License. See LICENSE.TXT for details. + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. * * ===----------------------------------------------------------------------=== * diff --git a/contrib/compiler-rt/lib/negsf2.c b/contrib/compiler-rt/lib/negsf2.c index 5e91e87..98f9fc0 100644 --- a/contrib/compiler-rt/lib/negsf2.c +++ b/contrib/compiler-rt/lib/negsf2.c @@ -2,18 +2,22 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file implements single-precision soft-float negation. // //===----------------------------------------------------------------------===// +#include "abi.h" #define SINGLE_PRECISION #include "fp_lib.h" -fp_t __negsf2(fp_t a) { +ARM_EABI_FNALIAS(fneg, negsf2); + +COMPILER_RT_ABI fp_t +__negsf2(fp_t a) { return fromRep(toRep(a) ^ signBit); } diff --git a/contrib/compiler-rt/lib/negti2.c b/contrib/compiler-rt/lib/negti2.c index 6ce6a04..774e808 100644 --- a/contrib/compiler-rt/lib/negti2.c +++ b/contrib/compiler-rt/lib/negti2.c @@ -2,8 +2,8 @@ * * The LLVM Compiler Infrastructure * - * This file is distributed under the University of Illinois Open Source - * License. See LICENSE.TXT for details. + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. * * ===----------------------------------------------------------------------=== * diff --git a/contrib/compiler-rt/lib/negvdi2.c b/contrib/compiler-rt/lib/negvdi2.c index 0baf377..aafaa9d 100644 --- a/contrib/compiler-rt/lib/negvdi2.c +++ b/contrib/compiler-rt/lib/negvdi2.c @@ -2,8 +2,8 @@ * * The LLVM Compiler Infrastructure * - * This file is distributed under the University of Illinois Open Source - * License. See LICENSE.TXT for details. + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. * * ===----------------------------------------------------------------------=== * @@ -11,6 +11,7 @@ * * ===----------------------------------------------------------------------=== */ +#include "abi.h" #include "int_lib.h" #include <stdlib.h> @@ -19,7 +20,7 @@ /* Effects: aborts if -a overflows */ -di_int +COMPILER_RT_ABI di_int __negvdi2(di_int a) { const di_int MIN = (di_int)1 << ((int)(sizeof(di_int) * CHAR_BIT)-1); diff --git a/contrib/compiler-rt/lib/negvsi2.c b/contrib/compiler-rt/lib/negvsi2.c index e5a36a5..559ea18 100644 --- a/contrib/compiler-rt/lib/negvsi2.c +++ b/contrib/compiler-rt/lib/negvsi2.c @@ -2,8 +2,8 @@ * * The LLVM Compiler Infrastructure * - * This file is distributed under the University of Illinois Open Source - * License. See LICENSE.TXT for details. + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. * * ===----------------------------------------------------------------------=== * @@ -11,6 +11,7 @@ * * ===----------------------------------------------------------------------=== */ +#include "abi.h" #include "int_lib.h" #include <stdlib.h> @@ -19,7 +20,7 @@ /* Effects: aborts if -a overflows */ -si_int +COMPILER_RT_ABI si_int __negvsi2(si_int a) { const si_int MIN = (si_int)1 << ((int)(sizeof(si_int) * CHAR_BIT)-1); diff --git a/contrib/compiler-rt/lib/negvti2.c b/contrib/compiler-rt/lib/negvti2.c index d56e1e3..d931305 100644 --- a/contrib/compiler-rt/lib/negvti2.c +++ b/contrib/compiler-rt/lib/negvti2.c @@ -2,8 +2,8 @@ * * The LLVM Compiler Infrastructure * - * This file is distributed under the University of Illinois Open Source - * License. See LICENSE.TXT for details. + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. * *===----------------------------------------------------------------------=== * diff --git a/contrib/compiler-rt/lib/paritydi2.c b/contrib/compiler-rt/lib/paritydi2.c index 90e5559..e7bebf6 100644 --- a/contrib/compiler-rt/lib/paritydi2.c +++ b/contrib/compiler-rt/lib/paritydi2.c @@ -2,8 +2,8 @@ * * The LLVM Compiler Infrastructure * - * This file is distributed under the University of Illinois Open Source - * License. See LICENSE.TXT for details. + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. * * ===----------------------------------------------------------------------=== * @@ -11,14 +11,15 @@ * * ===----------------------------------------------------------------------=== */ +#include "abi.h" #include "int_lib.h" /* Returns: 1 if number of bits is odd else returns 0 */ -si_int __paritysi2(si_int a); +si_int COMPILER_RT_ABI __paritysi2(si_int a); -si_int +COMPILER_RT_ABI si_int __paritydi2(di_int a) { dwords x; diff --git a/contrib/compiler-rt/lib/paritysi2.c b/contrib/compiler-rt/lib/paritysi2.c index ba05782..64d509f 100644 --- a/contrib/compiler-rt/lib/paritysi2.c +++ b/contrib/compiler-rt/lib/paritysi2.c @@ -2,8 +2,8 @@ * * The LLVM Compiler Infrastructure * - * This file is distributed under the University of Illinois Open Source - * License. See LICENSE.TXT for details. + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. * * ===----------------------------------------------------------------------=== * @@ -11,12 +11,13 @@ * * ===----------------------------------------------------------------------=== */ +#include "abi.h" #include "int_lib.h" /* Returns: 1 if number of bits is odd else returns 0 */ -si_int +COMPILER_RT_ABI si_int __paritysi2(si_int a) { su_int x = (su_int)a; diff --git a/contrib/compiler-rt/lib/parityti2.c b/contrib/compiler-rt/lib/parityti2.c index 650d417..8f85745 100644 --- a/contrib/compiler-rt/lib/parityti2.c +++ b/contrib/compiler-rt/lib/parityti2.c @@ -2,8 +2,8 @@ * * The LLVM Compiler Infrastructure * - * This file is distributed under the University of Illinois Open Source - * License. See LICENSE.TXT for details. + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. * * ===----------------------------------------------------------------------=== * diff --git a/contrib/compiler-rt/lib/popcountdi2.c b/contrib/compiler-rt/lib/popcountdi2.c index 78b6d88..136fc04 100644 --- a/contrib/compiler-rt/lib/popcountdi2.c +++ b/contrib/compiler-rt/lib/popcountdi2.c @@ -2,8 +2,8 @@ * * The LLVM Compiler Infrastructure * - * This file is distributed under the University of Illinois Open Source - * License. See LICENSE.TXT for details. + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. * * ===----------------------------------------------------------------------=== * @@ -11,12 +11,13 @@ * * ===----------------------------------------------------------------------=== */ +#include "abi.h" #include "int_lib.h" /* Returns: count of 1 bits */ -si_int +COMPILER_RT_ABI si_int __popcountdi2(di_int a) { du_int x2 = (du_int)a; diff --git a/contrib/compiler-rt/lib/popcountsi2.c b/contrib/compiler-rt/lib/popcountsi2.c index 4f092ee..bfaa3ff 100644 --- a/contrib/compiler-rt/lib/popcountsi2.c +++ b/contrib/compiler-rt/lib/popcountsi2.c @@ -2,8 +2,8 @@ * * The LLVM Compiler Infrastructure * - * This file is distributed under the University of Illinois Open Source - * License. See LICENSE.TXT for details. + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. * * ===----------------------------------------------------------------------=== * @@ -11,12 +11,13 @@ * * ===----------------------------------------------------------------------=== */ +#include "abi.h" #include "int_lib.h" /* Returns: count of 1 bits */ -si_int +COMPILER_RT_ABI si_int __popcountsi2(si_int a) { su_int x = (su_int)a; diff --git a/contrib/compiler-rt/lib/popcountti2.c b/contrib/compiler-rt/lib/popcountti2.c index 16f89b7..68d9427 100644 --- a/contrib/compiler-rt/lib/popcountti2.c +++ b/contrib/compiler-rt/lib/popcountti2.c @@ -2,8 +2,8 @@ * * The LLVM Compiler Infrastructure * - * This file is distributed under the University of Illinois Open Source - * License. See LICENSE.TXT for details. + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. * * ===----------------------------------------------------------------------=== * diff --git a/contrib/compiler-rt/lib/powidf2.c b/contrib/compiler-rt/lib/powidf2.c index 37972b6..2e211eb 100644 --- a/contrib/compiler-rt/lib/powidf2.c +++ b/contrib/compiler-rt/lib/powidf2.c @@ -2,8 +2,8 @@ * * The LLVM Compiler Infrastructure * - * This file is distributed under the University of Illinois Open Source - * License. See LICENSE.TXT for details. + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. * * ===----------------------------------------------------------------------=== * @@ -11,12 +11,13 @@ * * ===----------------------------------------------------------------------=== */ +#include "abi.h" #include "int_lib.h" /* Returns: a ^ b */ -double +COMPILER_RT_ABI double __powidf2(double a, si_int b) { const int recip = b < 0; diff --git a/contrib/compiler-rt/lib/powisf2.c b/contrib/compiler-rt/lib/powisf2.c index ace08c2..e6b43b3 100644 --- a/contrib/compiler-rt/lib/powisf2.c +++ b/contrib/compiler-rt/lib/powisf2.c @@ -2,8 +2,8 @@ * * The LLVM Compiler Infrastructure * - * This file is distributed under the University of Illinois Open Source - * License. See LICENSE.TXT for details. + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. * * ===----------------------------------------------------------------------=== * @@ -11,12 +11,13 @@ * * ===----------------------------------------------------------------------=== */ +#include "abi.h" #include "int_lib.h" /* Returns: a ^ b */ -float +COMPILER_RT_ABI float __powisf2(float a, si_int b) { const int recip = b < 0; diff --git a/contrib/compiler-rt/lib/powitf2.c b/contrib/compiler-rt/lib/powitf2.c index 3dacbf6..189632c 100644 --- a/contrib/compiler-rt/lib/powitf2.c +++ b/contrib/compiler-rt/lib/powitf2.c @@ -2,8 +2,8 @@ * * The LLVM Compiler Infrastructure * - * This file is distributed under the University of Illinois Open Source - * License. See LICENSE.TXT for details. + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. * * ===----------------------------------------------------------------------=== * diff --git a/contrib/compiler-rt/lib/powixf2.c b/contrib/compiler-rt/lib/powixf2.c index 1a816e9..f050964 100644 --- a/contrib/compiler-rt/lib/powixf2.c +++ b/contrib/compiler-rt/lib/powixf2.c @@ -2,8 +2,8 @@ * * The LLVM Compiler Infrastructure * - * This file is distributed under the University of Illinois Open Source - * License. See LICENSE.TXT for details. + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. * * ===----------------------------------------------------------------------=== * diff --git a/contrib/compiler-rt/lib/ppc/restFP.S b/contrib/compiler-rt/lib/ppc/restFP.S index 00919c8..9503289 100644 --- a/contrib/compiler-rt/lib/ppc/restFP.S +++ b/contrib/compiler-rt/lib/ppc/restFP.S @@ -2,8 +2,8 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// diff --git a/contrib/compiler-rt/lib/ppc/saveFP.S b/contrib/compiler-rt/lib/ppc/saveFP.S index 302da6e..72bd459 100644 --- a/contrib/compiler-rt/lib/ppc/saveFP.S +++ b/contrib/compiler-rt/lib/ppc/saveFP.S @@ -2,8 +2,8 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// diff --git a/contrib/compiler-rt/lib/subdf3.c b/contrib/compiler-rt/lib/subdf3.c new file mode 100644 index 0000000..825e3c6 --- /dev/null +++ b/contrib/compiler-rt/lib/subdf3.c @@ -0,0 +1,30 @@ +//===-- lib/adddf3.c - Double-precision subtraction ---------------*- C -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file implements double-precision soft-float subtraction with the +// IEEE-754 default rounding (to nearest, ties to even). +// +//===----------------------------------------------------------------------===// +#include "abi.h" + +#define DOUBLE_PRECISION +#include "fp_lib.h" + +fp_t COMPILER_RT_ABI __adddf3(fp_t a, fp_t b); + + +ARM_EABI_FNALIAS(dsub, subdf3); + +// Subtraction; flip the sign bit of b and add. +COMPILER_RT_ABI fp_t +__subdf3(fp_t a, fp_t b) { + return __adddf3(a, fromRep(toRep(b) ^ signBit)); +} + +/* FIXME: rsub for ARM EABI */ diff --git a/contrib/compiler-rt/lib/subsf3.c b/contrib/compiler-rt/lib/subsf3.c new file mode 100644 index 0000000..625376a --- /dev/null +++ b/contrib/compiler-rt/lib/subsf3.c @@ -0,0 +1,29 @@ +//===-- lib/subsf3.c - Single-precision subtraction ---------------*- C -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file implements single-precision soft-float subtraction with the +// IEEE-754 default rounding (to nearest, ties to even). +// +//===----------------------------------------------------------------------===// +#include "abi.h" + +#define SINGLE_PRECISION +#include "fp_lib.h" + +fp_t COMPILER_RT_ABI __addsf3(fp_t a, fp_t b); + +ARM_EABI_FNALIAS(fsub, subsf3); + +// Subtraction; flip the sign bit of b and add. +COMPILER_RT_ABI fp_t +__subsf3(fp_t a, fp_t b) { + return __addsf3(a, fromRep(toRep(b) ^ signBit)); +} + +/* FIXME: rsub for ARM EABI */ diff --git a/contrib/compiler-rt/lib/subvdi3.c b/contrib/compiler-rt/lib/subvdi3.c index e4926b8..36b51ad 100644 --- a/contrib/compiler-rt/lib/subvdi3.c +++ b/contrib/compiler-rt/lib/subvdi3.c @@ -1,9 +1,9 @@ /* ===-- subvdi3.c - Implement __subvdi3 -----------------------------------=== * - * The LLVM Compiler Infrastructure + * The LLVM Compiler Infrastructure * - * This file is distributed under the University of Illinois Open Source - * License. See LICENSE.TXT for details. + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. * * ===----------------------------------------------------------------------=== * @@ -11,6 +11,7 @@ * * ===----------------------------------------------------------------------=== */ +#include "abi.h" #include "int_lib.h" #include <stdlib.h> @@ -19,7 +20,7 @@ /* Effects: aborts if a - b overflows */ -di_int +COMPILER_RT_ABI di_int __subvdi3(di_int a, di_int b) { di_int s = a - b; diff --git a/contrib/compiler-rt/lib/subvsi3.c b/contrib/compiler-rt/lib/subvsi3.c index ce39c81..03983f7 100644 --- a/contrib/compiler-rt/lib/subvsi3.c +++ b/contrib/compiler-rt/lib/subvsi3.c @@ -1,9 +1,9 @@ /* ===-- subvsi3.c - Implement __subvsi3 -----------------------------------=== * - * The LLVM Compiler Infrastructure + * The LLVM Compiler Infrastructure * - * This file is distributed under the University of Illinois Open Source - * License. See LICENSE.TXT for details. + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. * * ===----------------------------------------------------------------------=== * @@ -11,6 +11,7 @@ * * ===----------------------------------------------------------------------=== */ +#include "abi.h" #include "int_lib.h" #include <stdlib.h> @@ -19,7 +20,7 @@ /* Effects: aborts if a - b overflows */ -si_int +COMPILER_RT_ABI si_int __subvsi3(si_int a, si_int b) { si_int s = a - b; diff --git a/contrib/compiler-rt/lib/subvti3.c b/contrib/compiler-rt/lib/subvti3.c index 55b7925..5d693dc 100644 --- a/contrib/compiler-rt/lib/subvti3.c +++ b/contrib/compiler-rt/lib/subvti3.c @@ -2,8 +2,8 @@ * * The LLVM Compiler Infrastructure * - * This file is distributed under the University of Illinois Open Source - * License. See LICENSE.TXT for details. + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. * * ===----------------------------------------------------------------------=== * diff --git a/contrib/compiler-rt/lib/trampoline_setup.c b/contrib/compiler-rt/lib/trampoline_setup.c index a2f49a4..a22199e 100644 --- a/contrib/compiler-rt/lib/trampoline_setup.c +++ b/contrib/compiler-rt/lib/trampoline_setup.c @@ -2,8 +2,8 @@ * * The LLVM Compiler Infrastructure * - * This file is distributed under the University of Illinois Open Source - * License. See LICENSE.TXT for details. + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. * * ===----------------------------------------------------------------------=== */ diff --git a/contrib/compiler-rt/lib/truncdfsf2.c b/contrib/compiler-rt/lib/truncdfsf2.c index d289cb9..1dbf02f 100644 --- a/contrib/compiler-rt/lib/truncdfsf2.c +++ b/contrib/compiler-rt/lib/truncdfsf2.c @@ -2,8 +2,8 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // @@ -41,6 +41,8 @@ #include <limits.h> #include <stdbool.h> +#include "abi.h" + typedef double src_t; typedef uint64_t src_rep_t; #define SRC_REP_C UINT64_C @@ -66,7 +68,10 @@ static inline dst_t dstFromRep(dst_rep_t x) { // End helper routines. Conversion implementation follows. -dst_t __truncdfsf2(src_t a) { +ARM_EABI_FNALIAS(d2f, truncdfsf2); + +COMPILER_RT_ABI dst_t +__truncdfsf2(src_t a) { // Various constants whose values follow from the type parameters. // Any reasonable optimizer will fold and propagate all of these. diff --git a/contrib/compiler-rt/lib/ucmpdi2.c b/contrib/compiler-rt/lib/ucmpdi2.c index d2900ca..f2d3f99 100644 --- a/contrib/compiler-rt/lib/ucmpdi2.c +++ b/contrib/compiler-rt/lib/ucmpdi2.c @@ -2,8 +2,8 @@ * * The LLVM Compiler Infrastructure * - * This file is distributed under the University of Illinois Open Source - * License. See LICENSE.TXT for details. + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. * * ===----------------------------------------------------------------------=== * @@ -11,6 +11,7 @@ * * ===----------------------------------------------------------------------=== */ +#include "abi.h" #include "int_lib.h" @@ -19,7 +20,7 @@ * if (a > b) returns 2 */ -si_int +COMPILER_RT_ABI si_int __ucmpdi2(du_int a, du_int b) { udwords x; diff --git a/contrib/compiler-rt/lib/ucmpti2.c b/contrib/compiler-rt/lib/ucmpti2.c index 0e7eea3..11137c5 100644 --- a/contrib/compiler-rt/lib/ucmpti2.c +++ b/contrib/compiler-rt/lib/ucmpti2.c @@ -2,8 +2,8 @@ * * The LLVM Compiler Infrastructure * - * This file is distributed under the University of Illinois Open Source - * License. See LICENSE.TXT for details. + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. * * ===----------------------------------------------------------------------=== * diff --git a/contrib/compiler-rt/lib/udivdi3.c b/contrib/compiler-rt/lib/udivdi3.c index 25d1df6..bbd551a 100644 --- a/contrib/compiler-rt/lib/udivdi3.c +++ b/contrib/compiler-rt/lib/udivdi3.c @@ -2,8 +2,8 @@ * * The LLVM Compiler Infrastructure * - * This file is distributed under the University of Illinois Open Source - * License. See LICENSE.TXT for details. + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. * * ===----------------------------------------------------------------------=== * @@ -11,14 +11,15 @@ * * ===----------------------------------------------------------------------=== */ +#include "abi.h" #include "int_lib.h" -du_int __udivmoddi4(du_int a, du_int b, du_int* rem); +du_int COMPILER_RT_ABI __udivmoddi4(du_int a, du_int b, du_int* rem); /* Returns: a / b */ -du_int +COMPILER_RT_ABI du_int __udivdi3(du_int a, du_int b) { return __udivmoddi4(a, b, 0); diff --git a/contrib/compiler-rt/lib/udivmoddi4.c b/contrib/compiler-rt/lib/udivmoddi4.c index 9274230..c5db21c 100644 --- a/contrib/compiler-rt/lib/udivmoddi4.c +++ b/contrib/compiler-rt/lib/udivmoddi4.c @@ -2,8 +2,8 @@ * * The LLVM Compiler Infrastructure * - * This file is distributed under the University of Illinois Open Source - * License. See LICENSE.TXT for details. + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. * * ===----------------------------------------------------------------------=== * @@ -11,6 +11,7 @@ * * ===----------------------------------------------------------------------=== */ +#include "abi.h" #include "int_lib.h" @@ -20,7 +21,9 @@ /* Translated from Figure 3-40 of The PowerPC Compiler Writer's Guide */ -du_int +ARM_EABI_FNALIAS(uldivmod, udivmoddi4); + +COMPILER_RT_ABI du_int __udivmoddi4(du_int a, du_int b, du_int* rem) { const unsigned n_uword_bits = sizeof(su_int) * CHAR_BIT; diff --git a/contrib/compiler-rt/lib/udivmodsi4.c b/contrib/compiler-rt/lib/udivmodsi4.c new file mode 100644 index 0000000..2a3ee27 --- /dev/null +++ b/contrib/compiler-rt/lib/udivmodsi4.c @@ -0,0 +1,31 @@ +/*===-- udivmodsi4.c - Implement __udivmodsi4 ------------------------------=== + * + * The LLVM Compiler Infrastructure + * + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. + * + * ===----------------------------------------------------------------------=== + * + * This file implements __udivmodsi4 for the compiler_rt library. + * + * ===----------------------------------------------------------------------=== + */ +#include "abi.h" + +#include "int_lib.h" + +extern su_int COMPILER_RT_ABI __udivsi3(su_int n, su_int d); + + +/* Returns: a / b, *rem = a % b */ + +COMPILER_RT_ABI su_int +__udivmodsi4(su_int a, su_int b, su_int* rem) +{ + si_int d = __udivsi3(a,b); + *rem = a - (d*b); + return d; +} + + diff --git a/contrib/compiler-rt/lib/udivmodti4.c b/contrib/compiler-rt/lib/udivmodti4.c index 53b4072..d1e19ed 100644 --- a/contrib/compiler-rt/lib/udivmodti4.c +++ b/contrib/compiler-rt/lib/udivmodti4.c @@ -2,8 +2,8 @@ * * The LLVM Compiler Infrastructure * - * This file is distributed under the University of Illinois Open Source - * License. See LICENSE.TXT for details. + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. * * ===----------------------------------------------------------------------=== * diff --git a/contrib/compiler-rt/lib/udivsi3.c b/contrib/compiler-rt/lib/udivsi3.c index 70528b6..721ae89 100644 --- a/contrib/compiler-rt/lib/udivsi3.c +++ b/contrib/compiler-rt/lib/udivsi3.c @@ -2,8 +2,8 @@ * * The LLVM Compiler Infrastructure * - * This file is distributed under the University of Illinois Open Source - * License. See LICENSE.TXT for details. + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. * * ===----------------------------------------------------------------------=== * @@ -11,6 +11,7 @@ * * ===----------------------------------------------------------------------=== */ +#include "abi.h" #include "int_lib.h" @@ -18,7 +19,9 @@ /* Translated from Figure 3-40 of The PowerPC Compiler Writer's Guide */ -su_int +ARM_EABI_FNALIAS(uidiv, udivsi3); + +COMPILER_RT_ABI su_int __udivsi3(su_int n, su_int d) { const unsigned n_uword_bits = sizeof(su_int) * CHAR_BIT; diff --git a/contrib/compiler-rt/lib/udivti3.c b/contrib/compiler-rt/lib/udivti3.c index fb810fd..7405a0f 100644 --- a/contrib/compiler-rt/lib/udivti3.c +++ b/contrib/compiler-rt/lib/udivti3.c @@ -2,8 +2,8 @@ * * The LLVM Compiler Infrastructure * - * This file is distributed under the University of Illinois Open Source - * License. See LICENSE.TXT for details. + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. * * ===----------------------------------------------------------------------=== * diff --git a/contrib/compiler-rt/lib/umoddi3.c b/contrib/compiler-rt/lib/umoddi3.c index 807bb5ce..9de1a64 100644 --- a/contrib/compiler-rt/lib/umoddi3.c +++ b/contrib/compiler-rt/lib/umoddi3.c @@ -2,8 +2,8 @@ * * The LLVM Compiler Infrastructure * - * This file is distributed under the University of Illinois Open Source - * License. See LICENSE.TXT for details. + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. * * ===----------------------------------------------------------------------=== * @@ -11,14 +11,15 @@ * * ===----------------------------------------------------------------------=== */ +#include "abi.h" #include "int_lib.h" -du_int __udivmoddi4(du_int a, du_int b, du_int* rem); +du_int COMPILER_RT_ABI __udivmoddi4(du_int a, du_int b, du_int* rem); /* Returns: a % b */ -du_int +COMPILER_RT_ABI du_int __umoddi3(du_int a, du_int b) { du_int r; diff --git a/contrib/compiler-rt/lib/umodsi3.c b/contrib/compiler-rt/lib/umodsi3.c index ead7737..569b7fc 100644 --- a/contrib/compiler-rt/lib/umodsi3.c +++ b/contrib/compiler-rt/lib/umodsi3.c @@ -2,8 +2,8 @@ * * The LLVM Compiler Infrastructure * - * This file is distributed under the University of Illinois Open Source - * License. See LICENSE.TXT for details. + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. * * ===----------------------------------------------------------------------=== * @@ -11,14 +11,15 @@ * * ===----------------------------------------------------------------------=== */ +#include "abi.h" #include "int_lib.h" /* Returns: a % b */ -su_int __udivsi3(su_int a, su_int b); +su_int COMPILER_RT_ABI __udivsi3(su_int a, su_int b); -su_int +COMPILER_RT_ABI su_int __umodsi3(su_int a, su_int b) { return a - __udivsi3(a, b) * b; diff --git a/contrib/compiler-rt/lib/umodti3.c b/contrib/compiler-rt/lib/umodti3.c index 6c8a758..8f20c5f 100644 --- a/contrib/compiler-rt/lib/umodti3.c +++ b/contrib/compiler-rt/lib/umodti3.c @@ -2,8 +2,8 @@ * * The LLVM Compiler Infrastructure * - * This file is distributed under the University of Illinois Open Source - * License. See LICENSE.TXT for details. + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. * * ===----------------------------------------------------------------------=== * diff --git a/contrib/compiler-rt/lib/x86_64/floatundidf.S b/contrib/compiler-rt/lib/x86_64/floatundidf.S index 6e684b2..1be553b 100644 --- a/contrib/compiler-rt/lib/x86_64/floatundidf.S +++ b/contrib/compiler-rt/lib/x86_64/floatundidf.S @@ -2,8 +2,8 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // diff --git a/contrib/compiler-rt/lib/x86_64/floatundisf.S b/contrib/compiler-rt/lib/x86_64/floatundisf.S index fe20963..89d3f07 100644 --- a/contrib/compiler-rt/lib/x86_64/floatundisf.S +++ b/contrib/compiler-rt/lib/x86_64/floatundisf.S @@ -1,5 +1,5 @@ -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. #include "../assembly.h" diff --git a/contrib/compiler-rt/lib/x86_64/floatundixf.S b/contrib/compiler-rt/lib/x86_64/floatundixf.S index 246f026..a7243f2 100644 --- a/contrib/compiler-rt/lib/x86_64/floatundixf.S +++ b/contrib/compiler-rt/lib/x86_64/floatundixf.S @@ -1,5 +1,5 @@ -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. #include "../assembly.h" diff --git a/lib/libcompiler_rt/Makefile b/lib/libcompiler_rt/Makefile index dcfcf74..3a501f5 100644 --- a/lib/libcompiler_rt/Makefile +++ b/lib/libcompiler_rt/Makefile @@ -41,6 +41,8 @@ SRCF= absvdi2 \ ctzti2 \ divdc3 \ divdi3 \ + divmoddi4 \ + divmodsi4 \ divsc3 \ divti3 \ divxc3 \ @@ -114,6 +116,7 @@ SRCF= absvdi2 \ ucmpti2 \ udivdi3 \ udivmoddi4 \ + udivmodsi4 \ udivmodti4 \ udivti3 \ umoddi3 \ @@ -134,6 +137,8 @@ SRCF+= adddf3 \ modsi3 \ muldf3 \ mulsf3 \ + subdf3 \ + subsf3 \ truncdfsf2 \ udivsi3 \ umodsi3 diff --git a/sbin/hastd/proto_common.c b/sbin/hastd/proto_common.c index 183b4e4..1f541da 100644 --- a/sbin/hastd/proto_common.c +++ b/sbin/hastd/proto_common.c @@ -194,6 +194,8 @@ int proto_common_recv(int sock, unsigned char *data, size_t size, int *fdp) { ssize_t done; + size_t total_done, recvsize; + unsigned char *dp; PJDLOG_ASSERT(sock >= 0); @@ -210,9 +212,19 @@ proto_common_recv(int sock, unsigned char *data, size_t size, int *fdp) PJDLOG_ASSERT(data != NULL); PJDLOG_ASSERT(size > 0); + total_done = 0; + dp = data; do { - done = recv(sock, data, size, MSG_WAITALL); - } while (done == -1 && errno == EINTR); + recvsize = size - total_done; + recvsize = recvsize < MAX_SEND_SIZE ? recvsize : MAX_SEND_SIZE; + done = recv(sock, dp, recvsize, MSG_WAITALL); + if (done == -1 && errno == EINTR) + continue; + if (done <= 0) + break; + total_done += done; + dp += done; + } while (total_done < size); if (done == 0) { return (ENOTCONN); } else if (done < 0) { diff --git a/share/man/man4/Makefile b/share/man/man4/Makefile index a94d828..7ccccfb 100644 --- a/share/man/man4/Makefile +++ b/share/man/man4/Makefile @@ -475,7 +475,7 @@ MAN= aac.4 \ ukbd.4 \ ulpt.4 \ umass.4 \ - umcs7840.4 \ + umcs.4 \ umct.4 \ umodem.4 \ ums.4 \ diff --git a/share/man/man4/ucom.4 b/share/man/man4/ucom.4 index ee9c517..8898872 100644 --- a/share/man/man4/ucom.4 +++ b/share/man/man4/ucom.4 @@ -78,7 +78,7 @@ multiple external ports. .Xr uark 4 , .Xr uchcom 4 , .Xr uftdi 4 , -.Xr umcs7840 4 , +.Xr umcs 4 , .Xr umct 4 , .Xr umodem 4 , .Xr uplcom 4 , diff --git a/share/man/man4/umcs7840.4 b/share/man/man4/umcs.4 index f44d5cc..f57b084 100644 --- a/share/man/man4/umcs7840.4 +++ b/share/man/man4/umcs.4 @@ -29,24 +29,24 @@ .\" $FreeBSD$ .\" .Dd December 10, 2010 -.Dt UMCS7840 4 +.Dt UMCS 4 .Os .Sh NAME -.Nm umcs7840 +.Nm umcs .Nd USB support for serial adapters based on the MCS7820 and MCS7840 chips .Sh SYNOPSIS To compile this driver into the kernel, place the following lines in your kernel configuration file: .Bd -ragged -offset indent -.Cd "device umcs7840" +.Cd "device umcs" .Ed .Pp Alternatively, to load the driver as a module at boot time, place the following line in .Xr loader.conf 5 : .Bd -literal -offset indent -umcs7840_load="YES" +umcs_load="YES" .Ed .Sh DESCRIPTION The @@ -80,6 +80,9 @@ ST Lab U-400 four-port serial USB adapter .Xr tty 4 , .Xr ucom 4 , .Xr usb 4 +.Sh BUGS +This driver doesn't support access to any fine tunes of +chip, like RS522/RS485 mode, non-standard baudrates, etc. .Sh HISTORY The .Nm @@ -92,6 +95,3 @@ The driver was written by .An Lev Serebryakov .Aq lev@FreeBSD.org . -.Sh BUGS -This driver doesn't support access to any fine tunes of -chip, like RS522/RS485 mode, non-standard baudrates, etc. diff --git a/sys/cddl/compat/opensolaris/kern/opensolaris.c b/sys/cddl/compat/opensolaris/kern/opensolaris.c index 54118eb..640b2f3 100644 --- a/sys/cddl/compat/opensolaris/kern/opensolaris.c +++ b/sys/cddl/compat/opensolaris/kern/opensolaris.c @@ -40,6 +40,7 @@ cpu_core_t cpu_core[MAXCPU]; kmutex_t cpu_lock; solaris_cpu_t solaris_cpu[MAXCPU]; +int nsec_per_tick; /* * OpenSolaris subsystem initialisation. @@ -60,6 +61,8 @@ opensolaris_load(void *dummy) } mutex_init(&cpu_lock, "OpenSolaris CPU lock", MUTEX_DEFAULT, NULL); + + nsec_per_tick = NANOSEC / hz; } SYSINIT(opensolaris_register, SI_SUB_OPENSOLARIS, SI_ORDER_FIRST, opensolaris_load, NULL); diff --git a/sys/cddl/compat/opensolaris/sys/time.h b/sys/cddl/compat/opensolaris/sys/time.h index 05db50e..8e8a99d 100644 --- a/sys/cddl/compat/opensolaris/sys/time.h +++ b/sys/cddl/compat/opensolaris/sys/time.h @@ -62,8 +62,21 @@ gethrtime(void) { #define gethrestime(ts) getnanotime(ts) #define gethrtime_waitfree() gethrtime() -#define ddi_get_lbolt() ((gethrtime() * hz) / NANOSEC) -#define ddi_get_lbolt64() (int64_t)((gethrtime() * hz) / NANOSEC) +extern int nsec_per_tick; /* nanoseconds per clock tick */ + +static __inline int64_t +ddi_get_lbolt64(void) +{ + + return (gethrtime() / nsec_per_tick); +} + +static __inline clock_t +ddi_get_lbolt(void) +{ + + return (ddi_get_lbolt64()); +} #else diff --git a/sys/conf/files b/sys/conf/files index 0f5c512..59286a5 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -1958,7 +1958,7 @@ dev/usb/serial/uftdi.c optional uftdi dev/usb/serial/ugensa.c optional ugensa dev/usb/serial/uipaq.c optional uipaq dev/usb/serial/ulpt.c optional ulpt -dev/usb/serial/umcs7840.c optional umcs7840 +dev/usb/serial/umcs.c optional umcs dev/usb/serial/umct.c optional umct dev/usb/serial/umodem.c optional umodem dev/usb/serial/umoscom.c optional umoscom @@ -1968,7 +1968,7 @@ dev/usb/serial/uvisor.c optional uvisor dev/usb/serial/uvscom.c optional uvscom dev/usb/serial/usb_serial.c optional ucom | u3g | uark | ubsa | ubser | \ uchcom | ucycom | ufoma | uftdi | \ - ugensa | uipaq | umcs7840 | umct | \ + ugensa | uipaq | umcs | umct | \ umodem | umoscom | uplcom | uslcom | \ uvisor | uvscom # diff --git a/sys/conf/files.powerpc b/sys/conf/files.powerpc index 9dcc867..7226c8f 100644 --- a/sys/conf/files.powerpc +++ b/sys/conf/files.powerpc @@ -162,6 +162,7 @@ powerpc/powermac/smusat.c optional powermac smu powerpc/powermac/uninorth.c optional powermac powerpc/powermac/uninorthpci.c optional powermac pci powerpc/powermac/vcoregpio.c optional powermac +powerpc/powermac/windtunnel.c optional powermac windtunnel powerpc/powerpc/altivec.c optional aim powerpc/powerpc/atomic.S standard powerpc/powerpc/autoconf.c standard diff --git a/sys/contrib/pf/net/pf.c b/sys/contrib/pf/net/pf.c index 2ce254f..135d734 100644 --- a/sys/contrib/pf/net/pf.c +++ b/sys/contrib/pf/net/pf.c @@ -3034,6 +3034,10 @@ pf_socket_lookup(int direction, struct pf_pdesc *pd) #ifdef INET case AF_INET: #ifdef __FreeBSD__ + /* + * XXXRW: would be nice if we had an mbuf here so that we + * could use in_pcblookup_mbuf(). + */ inp = in_pcblookup(pi, saddr->v4, sport, daddr->v4, dport, INPLOOKUP_RLOCKPCB, NULL); if (inp == NULL) { @@ -3056,6 +3060,10 @@ pf_socket_lookup(int direction, struct pf_pdesc *pd) #ifdef INET6 case AF_INET6: #ifdef __FreeBSD__ + /* + * XXXRW: would be nice if we had an mbuf here so that we + * could use in6_pcblookup_mbuf(). + */ inp = in6_pcblookup(pi, &saddr->v6, sport, &daddr->v6, dport, INPLOOKUP_RLOCKPCB, NULL); if (inp == NULL) { diff --git a/sys/dev/ath/ath_dfs/null/dfs_null.c b/sys/dev/ath/ath_dfs/null/dfs_null.c index 781e93d..2f050a4 100644 --- a/sys/dev/ath/ath_dfs/null/dfs_null.c +++ b/sys/dev/ath/ath_dfs/null/dfs_null.c @@ -107,7 +107,7 @@ ath_dfs_radar_enable(struct ath_softc *sc, struct ieee80211_channel *chan) * Process DFS related PHY errors */ void -ath_dfs_process_phy_err(struct ath_softc *sc, struct ath_desc *ds, +ath_dfs_process_phy_err(struct ath_softc *sc, const char *buf, uint64_t tsf, struct ath_rx_status *rxstat) { diff --git a/sys/dev/ath/if_ath.c b/sys/dev/ath/if_ath.c index 45bd9ed..451bbeaf 100644 --- a/sys/dev/ath/if_ath.c +++ b/sys/dev/ath/if_ath.c @@ -1261,6 +1261,10 @@ ath_resume(struct ath_softc *sc) sc->sc_curchan != NULL ? sc->sc_curchan : ic->ic_curchan, AH_FALSE, &status); ath_reset_keycache(sc); + + /* Let DFS at it in case it's a DFS channel */ + ath_dfs_radar_enable(sc, ic->ic_curchan); + if (sc->sc_resume_up) { if (ic->ic_opmode == IEEE80211_M_STA) { ath_init(sc); @@ -2013,6 +2017,10 @@ ath_calcrxfilter(struct ath_softc *sc) if (ic->ic_opmode == IEEE80211_M_MONITOR) rfilt |= HAL_RX_FILTER_CONTROL; + if (sc->sc_dodfs) { + rfilt |= HAL_RX_FILTER_PHYRADAR; + } + /* * Enable RX of compressed BAR frames only when doing * 802.11n. Required for A-MPDU. @@ -3465,7 +3473,7 @@ ath_rx_proc(void *arg, int npending) if (rs->rs_status & HAL_RXERR_PHY) { sc->sc_stats.ast_rx_phyerr++; /* Process DFS radar events */ - ath_dfs_process_phy_err(sc, ds, tsf, rs); + ath_dfs_process_phy_err(sc, mtod(m, char *), tsf, rs); /* Be suitably paranoid about receiving phy errors out of the stats array bounds */ if (rs->rs_phyerr < 64) diff --git a/sys/dev/ath/if_athdfs.h b/sys/dev/ath/if_athdfs.h index 057e926..88ee7fc 100644 --- a/sys/dev/ath/if_athdfs.h +++ b/sys/dev/ath/if_athdfs.h @@ -35,7 +35,7 @@ extern int ath_dfs_attach(struct ath_softc *sc); extern int ath_dfs_detach(struct ath_softc *sc); extern void ath_dfs_radar_enable(struct ath_softc *, struct ieee80211_channel *chan); -extern void ath_dfs_process_phy_err(struct ath_softc *sc, struct ath_desc *ds, +extern void ath_dfs_process_phy_err(struct ath_softc *sc, const char *buf, uint64_t tsf, struct ath_rx_status *rxstat); extern int ath_dfs_process_radar_event(struct ath_softc *sc, struct ieee80211_channel *chan); diff --git a/sys/dev/ath/if_athvar.h b/sys/dev/ath/if_athvar.h index 786494e..97666c5 100644 --- a/sys/dev/ath/if_athvar.h +++ b/sys/dev/ath/if_athvar.h @@ -360,6 +360,7 @@ struct ath_softc { /* DFS related state */ void *sc_dfs; /* Used by an optional DFS module */ + int sc_dodfs; /* Whether to enable DFS rx filter bits */ struct task sc_dfstask; /* DFS processing task */ }; diff --git a/sys/dev/iicbus/ds1775.c b/sys/dev/iicbus/ds1775.c index faa4a1a..23ad6f4 100644 --- a/sys/dev/iicbus/ds1775.c +++ b/sys/dev/iicbus/ds1775.c @@ -51,8 +51,6 @@ __FBSDID("$FreeBSD$"); #include <dev/ofw/ofw_bus.h> #include <powerpc/powermac/powermac_thermal.h> -#define FCU_ZERO_C_TO_K 2732 - /* Drivebay sensor: LM75/DS1775. */ #define DS1775_TEMP 0x0 @@ -95,20 +93,28 @@ static int ds1775_read_2(device_t dev, uint32_t addr, uint8_t reg, uint16_t *data) { uint8_t buf[4]; + int err, try = 0; struct iic_msg msg[2] = { { addr, IIC_M_WR | IIC_M_NOSTOP, 1, ® }, { addr, IIC_M_RD, 2, buf }, }; - if (iicbus_transfer(dev, msg, 2) != 0) { - device_printf(dev, "iicbus read failed\n"); - return (EIO); + for (;;) + { + err = iicbus_transfer(dev, msg, 2); + if (err != 0) + goto retry; + + *data = *((uint16_t*)buf); + return (0); + retry: + if (++try > 5) { + device_printf(dev, "iicbus read failed\n"); + return (-1); + } + pause("ds1775_read_2", hz); } - - *data = *((uint16_t*)buf); - - return (0); } static int @@ -182,7 +188,10 @@ ds1775_start(void *xdev) ctx = device_get_sysctl_ctx(dev); sensroot_oid = device_get_sysctl_tree(dev); - OF_getprop(child, "hwsensor-zone", &sc->sc_sensor.zone, sizeof(int)); + if (OF_getprop(child, "hwsensor-zone", &sc->sc_sensor.zone, + sizeof(int)) < 0) + sc->sc_sensor.zone = 0; + plen = OF_getprop(child, "hwsensor-location", sc->sc_sensor.name, sizeof(sc->sc_sensor.name)); units = "C"; @@ -199,8 +208,14 @@ ds1775_start(void *xdev) } /* Make up target temperatures. These are low, for the drive bay. */ - sc->sc_sensor.target_temp = 300 + FCU_ZERO_C_TO_K; - sc->sc_sensor.max_temp = 600 + FCU_ZERO_C_TO_K; + if (sc->sc_sensor.zone == 0) { + sc->sc_sensor.target_temp = 500 + ZERO_C_TO_K; + sc->sc_sensor.max_temp = 600 + ZERO_C_TO_K; + } + else { + sc->sc_sensor.target_temp = 300 + ZERO_C_TO_K; + sc->sc_sensor.max_temp = 600 + ZERO_C_TO_K; + } sc->sc_sensor.read = (int (*)(struct pmac_therm *sc))(ds1775_sensor_read); @@ -220,15 +235,18 @@ ds1775_sensor_read(struct ds1775_softc *sc) { uint16_t buf[2]; uint16_t read; + int err; - ds1775_read_2(sc->sc_dev, sc->sc_addr, DS1775_TEMP, buf); + err = ds1775_read_2(sc->sc_dev, sc->sc_addr, DS1775_TEMP, buf); + if (err < 0) + return (-1); read = *((int16_t *)buf); /* The default mode of the ADC is 9 bit, the resolution is 0.5 C per bit. The temperature is in tenth kelvin. */ - return (((int16_t)(read) >> 7) * 5 + FCU_ZERO_C_TO_K); + return (((int16_t)(read) >> 7) * 5 + ZERO_C_TO_K); } static int @@ -243,6 +261,8 @@ ds1775_sensor_sysctl(SYSCTL_HANDLER_ARGS) sc = device_get_softc(dev); temp = ds1775_sensor_read(sc); + if (temp < 0) + return (EIO); error = sysctl_handle_int(oidp, &temp, 0, req); diff --git a/sys/dev/iicbus/max6690.c b/sys/dev/iicbus/max6690.c index 39275b2..83f3b50 100644 --- a/sys/dev/iicbus/max6690.c +++ b/sys/dev/iicbus/max6690.c @@ -51,12 +51,11 @@ __FBSDID("$FreeBSD$"); #include <dev/ofw/ofw_bus.h> #include <powerpc/powermac/powermac_thermal.h> -#define FCU_ZERO_C_TO_K 2732 - /* Inlet, Backside, U3 Heatsink sensor: MAX6690. */ #define MAX6690_INT_TEMP 0x0 #define MAX6690_EXT_TEMP 0x1 +#define MAX6690_RSL_STATUS 0x2 #define MAX6690_EEXT_TEMP 0x10 #define MAX6690_IEXT_TEMP 0x11 #define MAX6690_TEMP_MASK 0xe0 @@ -76,8 +75,8 @@ static int max6690_attach(device_t); static int max6690_sensor_read(struct max6690_sensor *sens); static int max6690_sensor_sysctl(SYSCTL_HANDLER_ARGS); static void max6690_start(void *xdev); -static int max6690_read_1(device_t dev, uint32_t addr, uint8_t reg, - uint8_t *data); +static int max6690_read(device_t dev, uint32_t addr, uint8_t reg, + uint8_t *data); struct max6690_softc { device_t sc_dev; @@ -105,23 +104,43 @@ DRIVER_MODULE(max6690, iicbus, max6690_driver, max6690_devclass, 0, 0); MALLOC_DEFINE(M_MAX6690, "max6690", "Temp-Monitor MAX6690"); static int -max6690_read_1(device_t dev, uint32_t addr, uint8_t reg, uint8_t *data) +max6690_read(device_t dev, uint32_t addr, uint8_t reg, uint8_t *data) { uint8_t buf[4]; - - struct iic_msg msg[2] = { + uint8_t busy[1], rsl; + int err, try = 0; + + /* Busy register RSL. */ + rsl = MAX6690_RSL_STATUS; + /* first read the status register, 0x2. If busy, retry. */ + struct iic_msg msg[4] = { + { addr, IIC_M_WR | IIC_M_NOSTOP, 1, &rsl }, + { addr, IIC_M_RD, 1, busy }, { addr, IIC_M_WR | IIC_M_NOSTOP, 1, ® }, { addr, IIC_M_RD, 1, buf }, }; - if (iicbus_transfer(dev, msg, 2) != 0) { - device_printf(dev, "iicbus read failed\n"); - return (EIO); + for (;;) + { + err = iicbus_transfer(dev, msg, 4); + if (err != 0) + goto retry; + if (busy[0] & 0x80) + goto retry; + /* Check for invalid value and retry. */ + if (buf[0] == 0xff) + goto retry; + + *data = *((uint8_t*)buf); + return (0); + + retry: + if (++try > 5) { + device_printf(dev, "iicbus read failed\n"); + return (-1); + } + pause("max6690_read", hz); } - - *data = *((uint8_t*)buf); - - return (0); } static int @@ -193,8 +212,8 @@ max6690_fill_sensor_prop(device_t dev) for (j = 0; j < i; j++) { sc->sc_sensors[j].dev = dev; - sc->sc_sensors[j].therm.target_temp = 400 + 2732; - sc->sc_sensors[j].therm.max_temp = 800 + 2732; + sc->sc_sensors[j].therm.target_temp = 400 + ZERO_C_TO_K; + sc->sc_sensors[j].therm.max_temp = 800 + ZERO_C_TO_K; sc->sc_sensors[j].therm.read = (int (*)(struct pmac_therm *))(max6690_sensor_read); @@ -302,14 +321,15 @@ static int max6690_sensor_read(struct max6690_sensor *sens) { uint8_t reg_int = 0, reg_ext = 0; - uint8_t integer; - uint8_t fraction; - int temp; + uint8_t integer = 0; + uint8_t fraction = 0; + int err, temp; + struct max6690_softc *sc; sc = device_get_softc(sens->dev); - /* The internal sensor id's are even, the external ar odd. */ + /* The internal sensor id's are even, the external are odd. */ if ((sens->id % 2) == 0) { reg_int = MAX6690_INT_TEMP; reg_ext = MAX6690_IEXT_TEMP; @@ -318,9 +338,11 @@ max6690_sensor_read(struct max6690_sensor *sens) reg_ext = MAX6690_EEXT_TEMP; } - max6690_read_1(sc->sc_dev, sc->sc_addr, reg_int, &integer); + err = max6690_read(sc->sc_dev, sc->sc_addr, reg_int, &integer); + err = max6690_read(sc->sc_dev, sc->sc_addr, reg_ext, &fraction); - max6690_read_1(sc->sc_dev, sc->sc_addr, reg_ext, &fraction); + if (err < 0) + return (-1); fraction &= MAX6690_TEMP_MASK; @@ -329,7 +351,7 @@ max6690_sensor_read(struct max6690_sensor *sens) */ temp = (integer * 10) + (fraction >> 5) * 10 / 8; - return (temp + FCU_ZERO_C_TO_K); + return (temp + ZERO_C_TO_K); } static int diff --git a/sys/dev/iwn/if_iwn.c b/sys/dev/iwn/if_iwn.c index 67e1a44..f905311 100644 --- a/sys/dev/iwn/if_iwn.c +++ b/sys/dev/iwn/if_iwn.c @@ -567,6 +567,7 @@ iwn_attach(device_t dev) ic->ic_caps = IEEE80211_C_STA /* station mode supported */ | IEEE80211_C_MONITOR /* monitor mode supported */ + | IEEE80211_C_BGSCAN /* background scanning */ | IEEE80211_C_TXPMGT /* tx power management */ | IEEE80211_C_SHSLOT /* short slot time supported */ | IEEE80211_C_WPA @@ -576,8 +577,6 @@ iwn_attach(device_t dev) #endif | IEEE80211_C_WME /* WME */ ; - if (sc->hw_type != IWN_HW_REV_TYPE_4965) - ic->ic_caps |= IEEE80211_C_BGSCAN; /* background scanning */ /* Read MAC address, channels, etc from EEPROM. */ if ((error = iwn_read_eeprom(sc, macaddr)) != 0) { @@ -607,9 +606,9 @@ iwn_attach(device_t dev) ic->ic_htcaps = IEEE80211_HTCAP_SMPS_OFF /* SMPS mode disabled */ | IEEE80211_HTCAP_SHORTGI20 /* short GI in 20MHz */ -#ifdef notyet | IEEE80211_HTCAP_CHWIDTH40 /* 40MHz channel width*/ | IEEE80211_HTCAP_SHORTGI40 /* short GI in 40MHz */ +#ifdef notyet | IEEE80211_HTCAP_GREENFIELD #if IWN_RBUF_SIZE == 8192 | IEEE80211_HTCAP_MAXAMSDU_7935 /* max A-MSDU length */ @@ -3315,7 +3314,8 @@ iwn_tx_data(struct iwn_softc *sc, struct mbuf *m, struct ieee80211_node *ni) } ac = M_WME_GETAC(m); - if (IEEE80211_AMPDU_RUNNING(&ni->ni_tx_ampdu[ac])) { + if (IEEE80211_QOS_HAS_SEQ(wh) && + IEEE80211_AMPDU_RUNNING(&ni->ni_tx_ampdu[ac])) { struct ieee80211_tx_ampdu *tap = &ni->ni_tx_ampdu[ac]; ring = &sc->txq[*(int *)tap->txa_private]; @@ -5161,7 +5161,7 @@ iwn_scan(struct iwn_softc *sc) if (IEEE80211_IS_CHAN_A(ic->ic_curchan) && sc->hw_type == IWN_HW_REV_TYPE_4965) { /* Ant A must be avoided in 5GHz because of an HW bug. */ - rxchain |= IWN_RXCHAIN_FORCE_SEL(IWN_ANT_BC); + rxchain |= IWN_RXCHAIN_FORCE_SEL(IWN_ANT_B); } else /* Use all available RX antennas. */ rxchain |= IWN_RXCHAIN_FORCE_SEL(sc->rxchainmask); hdr->rxchain = htole16(rxchain); @@ -5172,14 +5172,19 @@ iwn_scan(struct iwn_softc *sc) tx->id = sc->broadcast_id; tx->lifetime = htole32(IWN_LIFETIME_INFINITE); - if (IEEE80211_IS_CHAN_A(ic->ic_curchan)) { + if (IEEE80211_IS_CHAN_5GHZ(ic->ic_curchan)) { /* Send probe requests at 6Mbps. */ tx->rate = htole32(0xd); rs = &ic->ic_sup_rates[IEEE80211_MODE_11A]; } else { hdr->flags = htole32(IWN_RXON_24GHZ | IWN_RXON_AUTO); - /* Send probe requests at 1Mbps. */ - tx->rate = htole32(10 | IWN_RFLAG_CCK); + if (sc->hw_type == IWN_HW_REV_TYPE_4965 && + sc->rxon.associd && sc->rxon.chan > 14) + tx->rate = htole32(0xd); + else { + /* Send probe requests at 1Mbps. */ + tx->rate = htole32(10 | IWN_RFLAG_CCK); + } rs = &ic->ic_sup_rates[IEEE80211_MODE_11G]; } /* Use the first valid TX antenna. */ diff --git a/sys/dev/puc/pucdata.c b/sys/dev/puc/pucdata.c index 3869786..a56971e 100644 --- a/sys/dev/puc/pucdata.c +++ b/sys/dev/puc/pucdata.c @@ -48,8 +48,8 @@ __FBSDID("$FreeBSD$"); #include <dev/puc/puc_bfe.h> static puc_config_f puc_config_amc; -static puc_config_f puc_config_cronyx; static puc_config_f puc_config_diva; +static puc_config_f puc_config_exar; static puc_config_f puc_config_icbook; static puc_config_f puc_config_quatech; static puc_config_f puc_config_syba; @@ -548,11 +548,25 @@ const struct puc_cfg puc_pci_devices[] = { PUC_PORT_8S, 0x18, 0, 8, }, + { 0x13a8, 0x0152, 0xffff, 0, + "Exar XR17C/D152", + DEFAULT_RCLK * 8, + PUC_PORT_2S, 0x10, 0, -1, + .config_function = puc_config_exar + }, + + { 0x13a8, 0x0154, 0xffff, 0, + "Exar XR17C154", + DEFAULT_RCLK * 8, + PUC_PORT_4S, 0x10, 0, -1, + .config_function = puc_config_exar + }, + { 0x13a8, 0x0158, 0xffff, 0, - "Cronyx Omega2-PCI", + "Exar XR17C158", DEFAULT_RCLK * 8, PUC_PORT_8S, 0x10, 0, -1, - .config_function = puc_config_cronyx + .config_function = puc_config_exar }, { 0x13a8, 0x0258, 0xffff, 0, @@ -1014,28 +1028,28 @@ puc_config_amc(struct puc_softc *sc, enum puc_cfg_cmd cmd, int port, } static int -puc_config_cronyx(struct puc_softc *sc, enum puc_cfg_cmd cmd, int port, +puc_config_diva(struct puc_softc *sc, enum puc_cfg_cmd cmd, int port, intptr_t *res) { + const struct puc_cfg *cfg = sc->sc_cfg; + if (cmd == PUC_CFG_GET_OFS) { - *res = port * 0x200; + if (cfg->subdevice == 0x1282) /* Everest SP */ + port <<= 1; + else if (cfg->subdevice == 0x104b) /* Maestro SP2 */ + port = (port == 3) ? 4 : port; + *res = port * 8 + ((port > 2) ? 0x18 : 0); return (0); } return (ENXIO); } static int -puc_config_diva(struct puc_softc *sc, enum puc_cfg_cmd cmd, int port, +puc_config_exar(struct puc_softc *sc, enum puc_cfg_cmd cmd, int port, intptr_t *res) { - const struct puc_cfg *cfg = sc->sc_cfg; - if (cmd == PUC_CFG_GET_OFS) { - if (cfg->subdevice == 0x1282) /* Everest SP */ - port <<= 1; - else if (cfg->subdevice == 0x104b) /* Maestro SP2 */ - port = (port == 3) ? 4 : port; - *res = port * 8 + ((port > 2) ? 0x18 : 0); + *res = port * 0x200; return (0); } return (ENXIO); diff --git a/sys/dev/usb/serial/umcs7840.c b/sys/dev/usb/serial/umcs.c index 34b68a1..c74044e 100644 --- a/sys/dev/usb/serial/umcs7840.c +++ b/sys/dev/usb/serial/umcs.c @@ -66,21 +66,21 @@ __FBSDID("$FreeBSD$"); #include <dev/usb/usb_cdc.h> #include "usbdevs.h" -#define USB_DEBUG_VAR umcs7840_debug +#define USB_DEBUG_VAR umcs_debug #include <dev/usb/usb_debug.h> #include <dev/usb/usb_process.h> #include <dev/usb/serial/usb_serial.h> -#include <dev/usb/serial/umcs7840.h> +#include <dev/usb/serial/umcs.h> #define UMCS7840_MODVER 1 #ifdef USB_DEBUG -static int umcs7840_debug = 0; +static int umcs_debug = 0; -SYSCTL_NODE(_hw_usb, OID_AUTO, umcs7840, CTLFLAG_RW, 0, "USB umcs7840 quadport serial adapter"); -SYSCTL_INT(_hw_usb_umcs7840, OID_AUTO, debug, CTLFLAG_RW, &umcs7840_debug, 0, "Debug level"); +SYSCTL_NODE(_hw_usb, OID_AUTO, umcs, CTLFLAG_RW, 0, "USB umcs quadport serial adapter"); +SYSCTL_INT(_hw_usb_umcs, OID_AUTO, debug, CTLFLAG_RW, &umcs_debug, 0, "Debug level"); #endif /* USB_DEBUG */ diff --git a/sys/dev/usb/serial/umcs7840.h b/sys/dev/usb/serial/umcs.h index 310b4af..310b4af 100644 --- a/sys/dev/usb/serial/umcs7840.h +++ b/sys/dev/usb/serial/umcs.h diff --git a/sys/fs/nfsserver/nfs_nfsdport.c b/sys/fs/nfsserver/nfs_nfsdport.c index d62be99..5b96729 100644 --- a/sys/fs/nfsserver/nfs_nfsdport.c +++ b/sys/fs/nfsserver/nfs_nfsdport.c @@ -2592,6 +2592,36 @@ nfsvno_pathconf(struct vnode *vp, int flag, register_t *retf, int error; error = VOP_PATHCONF(vp, flag, retf); + if (error == EOPNOTSUPP || error == EINVAL) { + /* + * Some file systems return EINVAL for name arguments not + * supported and some return EOPNOTSUPP for this case. + * So the NFSv3 Pathconf RPC doesn't fail for these cases, + * just fake them. + */ + switch (flag) { + case _PC_LINK_MAX: + *retf = LINK_MAX; + break; + case _PC_NAME_MAX: + *retf = NAME_MAX; + break; + case _PC_CHOWN_RESTRICTED: + *retf = 1; + break; + case _PC_NO_TRUNC: + *retf = 1; + break; + default: + /* + * Only happens if a _PC_xxx is added to the server, + * but this isn't updated. + */ + *retf = 0; + printf("nfsrvd pathconf flag=%d not supp\n", flag); + }; + error = 0; + } return (error); } diff --git a/sys/mips/cavium/octeon_ebt3000_cf.c b/sys/mips/cavium/octeon_ebt3000_cf.c index 7955d19..f5a44c4 100644 --- a/sys/mips/cavium/octeon_ebt3000_cf.c +++ b/sys/mips/cavium/octeon_ebt3000_cf.c @@ -104,12 +104,40 @@ __FBSDID("$FreeBSD$"); extern cvmx_bootinfo_t *octeon_bootinfo; /* Globals */ -int bus_width; +/* + * There's three bus types supported by this driver. + * + * CF_8 -- Traditional PC Card IDE interface on an 8-bit wide bus. We assume + * the bool loader has configure attribute memory properly. We then access + * the device like old-school 8-bit IDE card (which is all a traditional PC Card + * interface really is). + * CF_16 -- Traditional PC Card IDE interface on a 16-bit wide bus. Registers on + * this bus are 16-bits wide too. When accessing registers in the task file, you + * have to do it in 16-bit chunks, and worry about masking out what you don't want + * or ORing together the traditional 8-bit values. We assume the bootloader does + * the right attribute memory initialization dance. + * CF_TRUE_IDE_8 - CF Card wired to True IDE mode. There's no Attribute memory + * space at all. Instead all the traditional 8-bit registers are there, but + * on a 16-bit bus where addr0 isn't wired. This means we need to read/write them + * 16-bit chunks, but only the lower 8 bits are valid. We do not (and can not) + * access this like CF_16 with the comingled registers. Yet we can't access + * this like CF_8 because of the register offset. Except the TF_DATA register + * appears to be full width? + */ void *base_addr; +int bus_type; +#define CF_8 1 /* 8-bit bus, no offsets - PC Card */ +#define CF_16 2 /* 16-bit bus, registers shared - PC Card */ +#define CF_TRUE_IDE_8 3 /* 16-bit bus, only lower 8-bits, TrueIDE */ +const char *const cf_type[] = { + "impossible type", + "CF 8-bit", + "CF 16-bit", + "True IDE" +}; /* Device softc */ struct cf_priv { - device_t dev; struct drive_param *drive_param; @@ -230,9 +258,65 @@ static void cf_start (struct bio *bp) static int cf_ioctl (struct g_provider *pp, u_long cmd, void *data, int fflag, struct thread *td) { - return (0); + return (0); +} + + +static uint8_t cf_inb_8(int port) +{ + /* + * Traditional 8-bit PC Card/CF bus access. + */ + if (bus_type == CF_8) { + volatile uint8_t *task_file = (volatile uint8_t *)base_addr; + return task_file[port]; + } + + /* + * True IDE access. lower 8 bits on a 16-bit bus (see above). + */ + volatile uint16_t *task_file = (volatile uint16_t *)base_addr; + return task_file[port] & 0xff; +} + +static void cf_outb_8(int port, uint8_t val) +{ + /* + * Traditional 8-bit PC Card/CF bus access. + */ + if (bus_type == CF_8) { + volatile uint8_t *task_file = (volatile uint8_t *)base_addr; + task_file[port] = val; + } + + /* + * True IDE access. lower 8 bits on a 16-bit bus (see above). + */ + volatile uint16_t *task_file = (volatile uint16_t *)base_addr; + task_file[port] = val & 0xff; +} + +static uint8_t cf_inb_16(int port) +{ + volatile uint16_t *task_file = (volatile uint16_t *)base_addr; + uint16_t val = task_file[port / 2]; + if (port & 1) + return (val >> 8) & 0xff; + return val & 0xff; } +static uint16_t cf_inw_16(int port) +{ + volatile uint16_t *task_file = (volatile uint16_t *)base_addr; + uint16_t val = task_file[port / 2]; + return val; +} + +static void cf_outw_16(int port, uint16_t val) +{ + volatile uint16_t *task_file = (volatile uint16_t *)base_addr; + task_file[port / 2] = val; +} /* ------------------------------------------------------------------- * * cf_cmd_read() * @@ -264,25 +348,29 @@ static int cf_cmd_read (uint32_t nr_sectors, uint32_t start_sector, void *buf) return (error); } - if (bus_width == 8) { - volatile uint8_t *task_file = (volatile uint8_t*)base_addr; - volatile uint8_t dummy; + switch (bus_type) + { + case CF_8: for (count = 0; count < SECTOR_SIZE; count++) { - *ptr_8++ = task_file[TF_DATA]; - if ((count & 0xf) == 0) dummy = task_file[TF_STATUS]; + *ptr_8++ = cf_inb_8(TF_DATA); + if ((count & 0xf) == 0) + (void)cf_inb_8(TF_STATUS); } - } else { - volatile uint16_t *task_file = (volatile uint16_t*)base_addr; - volatile uint16_t dummy; + break; + case CF_TRUE_IDE_8: + case CF_16: + default: for (count = 0; count < SECTOR_SIZE; count+=2) { uint16_t temp; - temp = task_file[TF_DATA]; + temp = cf_inw_16(TF_DATA); *ptr_16++ = SWAP_SHORT(temp); - if ((count & 0xf) == 0) dummy = task_file[TF_STATUS/2]; + if ((count & 0xf) == 0) + (void)cf_inb_16(TF_STATUS); } + break; } - lba ++; + lba++; } #ifdef OCTEON_VISUAL_CF_0 octeon_led_write_char(0, ' '); @@ -320,28 +408,28 @@ static int cf_cmd_write (uint32_t nr_sectors, uint32_t start_sector, void *buf) return (error); } - if (bus_width == 8) { - volatile uint8_t *task_file; - volatile uint8_t dummy; - - task_file = (volatile uint8_t *) base_addr; + switch (bus_type) + { + case CF_8: for (count = 0; count < SECTOR_SIZE; count++) { - task_file[TF_DATA] = *ptr_8++; - if ((count & 0xf) == 0) dummy = task_file[TF_STATUS]; + cf_outb_8(TF_DATA, *ptr_8++); + if ((count & 0xf) == 0) + (void)cf_inb_8(TF_STATUS); } - } else { - volatile uint16_t *task_file; - volatile uint16_t dummy; - - task_file = (volatile uint16_t *) base_addr; + break; + case CF_TRUE_IDE_8: + case CF_16: + default: for (count = 0; count < SECTOR_SIZE; count+=2) { uint16_t temp = *ptr_16++; - task_file[TF_DATA] = SWAP_SHORT(temp); - if ((count & 0xf) == 0) dummy = task_file[TF_STATUS/2]; + cf_outw_16(TF_DATA, SWAP_SHORT(temp)); + if ((count & 0xf) == 0) + (void)cf_inb_16(TF_STATUS); } + break; } - lba ++; + lba++; } #ifdef OCTEON_VISUAL_CF_1 octeon_led_write_char(1, ' '); @@ -361,59 +449,32 @@ static int cf_cmd_write (uint32_t nr_sectors, uint32_t start_sector, void *buf) static int cf_cmd_identify (void) { int count; - uint8_t status; int error; - if (bus_width == 8) { - volatile uint8_t *task_file; - - task_file = (volatile uint8_t *) base_addr; - - while ((status = task_file[TF_STATUS]) & STATUS_BSY) { - DELAY(WAIT_DELAY); - } - - task_file[TF_SECTOR_COUNT] = 0; - task_file[TF_SECTOR_NUMBER] = 0; - task_file[TF_CYL_LSB] = 0; - task_file[TF_CYL_MSB] = 0; - task_file[TF_DRV_HEAD] = 0; - task_file[TF_COMMAND] = CMD_IDENTIFY; - - error = cf_wait_busy(); - if (error == 0) { - for (count = 0; count < SECTOR_SIZE; count++) - drive_param.u.buf[count] = task_file[TF_DATA]; - } - } else { - volatile uint16_t *task_file; - - task_file = (volatile uint16_t *) base_addr; - - while ((status = (task_file[TF_STATUS/2]>>8)) & STATUS_BSY) { - DELAY(WAIT_DELAY); - } - - task_file[TF_SECTOR_COUNT/2] = 0; /* this includes TF_SECTOR_NUMBER */ - task_file[TF_CYL_LSB/2] = 0; /* this includes TF_CYL_MSB */ - task_file[TF_DRV_HEAD/2] = 0 | (CMD_IDENTIFY<<8); /* this includes TF_COMMAND */ - - error = cf_wait_busy(); - if (error == 0) { - for (count = 0; count < SECTOR_SIZE; count+=2) { - uint16_t temp; - temp = task_file[TF_DATA]; - - /* endianess will be swapped below */ - drive_param.u.buf[count] = (temp & 0xff); - drive_param.u.buf[count+1] = (temp & 0xff00)>>8; - } - } - } + error = cf_send_cmd(0, CMD_IDENTIFY); if (error != 0) { printf("%s: identify failed: %d\n", __func__, error); return (error); } + switch (bus_type) + { + case CF_8: + for (count = 0; count < SECTOR_SIZE; count++) + drive_param.u.buf[count] = cf_inb_8(TF_DATA); + break; + case CF_TRUE_IDE_8: + case CF_16: + default: + for (count = 0; count < SECTOR_SIZE; count += 2) { + uint16_t temp; + temp = cf_inw_16(TF_DATA); + + /* endianess will be swapped below */ + drive_param.u.buf[count] = (temp & 0xff); + drive_param.u.buf[count + 1] = (temp & 0xff00) >> 8; + } + break; + } cf_swap_ascii(drive_param.u.driveid.model, drive_param.model); @@ -423,6 +484,7 @@ static int cf_cmd_identify (void) drive_param.sec_track = SWAP_SHORT (drive_param.u.driveid.current_sectors); drive_param.nr_sectors = (uint32_t)SWAP_SHORT (drive_param.u.driveid.lba_size_1) | ((uint32_t)SWAP_SHORT (drive_param.u.driveid.lba_size_2)); + printf("cf0: <%s> %lld sectors\n", drive_param.model, (long long)drive_param.nr_sectors); return (0); } @@ -437,37 +499,27 @@ static int cf_cmd_identify (void) */ static int cf_send_cmd (uint32_t lba, uint8_t cmd) { - uint8_t status; - - if (bus_width == 8) { - volatile uint8_t *task_file; - - task_file = (volatile uint8_t *) base_addr; - - while ( (status = task_file[TF_STATUS]) & STATUS_BSY) { + switch (bus_type) + { + case CF_8: + case CF_TRUE_IDE_8: + while (cf_inb_8(TF_STATUS) & STATUS_BSY) DELAY(WAIT_DELAY); - } - - task_file[TF_SECTOR_COUNT] = 1; - task_file[TF_SECTOR_NUMBER] = (lba & 0xff); - task_file[TF_CYL_LSB] = ((lba >> 8) & 0xff); - task_file[TF_CYL_MSB] = ((lba >> 16) & 0xff); - task_file[TF_DRV_HEAD] = ((lba >> 24) & 0xff) | 0xe0; - task_file[TF_COMMAND] = cmd; - - } else { - volatile uint16_t *task_file; - - task_file = (volatile uint16_t *) base_addr; - - while ( (status = (task_file[TF_STATUS/2]>>8)) & STATUS_BSY) { + cf_outb_8(TF_SECTOR_COUNT, 1); + cf_outb_8(TF_SECTOR_NUMBER, lba & 0xff); + cf_outb_8(TF_CYL_LSB, (lba >> 8) & 0xff); + cf_outb_8(TF_CYL_MSB, (lba >> 16) & 0xff); + cf_outb_8(TF_DRV_HEAD, ((lba >> 24) & 0xff) | 0xe0); + cf_outb_8(TF_COMMAND, cmd); + break; + case CF_16: + default: + while (cf_inb_16(TF_STATUS) & STATUS_BSY) DELAY(WAIT_DELAY); - } - - task_file[TF_SECTOR_COUNT/2] = 1 | ((lba & 0xff) << 8); - task_file[TF_CYL_LSB/2] = ((lba >> 8) & 0xff) | (((lba >> 16) & 0xff) << 8); - task_file[TF_DRV_HEAD/2] = (((lba >> 24) & 0xff) | 0xe0) | (cmd << 8); - + cf_outw_16(TF_SECTOR_COUNT, 1 | ((lba & 0xff) << 8)); + cf_outw_16(TF_CYL_LSB, ((lba >> 8) & 0xff) | (((lba >> 16) & 0xff) << 8)); + cf_outw_16(TF_DRV_HEAD, (((lba >> 24) & 0xff) | 0xe0) | (cmd << 8)); + break; } return (cf_wait_busy()); @@ -499,32 +551,32 @@ static int cf_wait_busy (void) octeon_led_run_wheel(&where0, 2); #endif - if (bus_width == 8) { - volatile uint8_t *task_file; - task_file = (volatile uint8_t *)base_addr; - - status = task_file[TF_STATUS]; + switch (bus_type) + { + case CF_8: + case CF_TRUE_IDE_8: + status = cf_inb_8(TF_STATUS); while ((status & STATUS_BSY) == STATUS_BSY) { if ((status & STATUS_DF) != 0) { printf("%s: device fault (status=%x)\n", __func__, status); return (EIO); } DELAY(WAIT_DELAY); - status = task_file[TF_STATUS]; + status = cf_inb_8(TF_STATUS); } - } else { - volatile uint16_t *task_file; - task_file = (volatile uint16_t *)base_addr; - - status = task_file[TF_STATUS/2]>>8; + break; + case CF_16: + default: + status = cf_inb_16(TF_STATUS); while ((status & STATUS_BSY) == STATUS_BSY) { if ((status & STATUS_DF) != 0) { printf("%s: device fault (status=%x)\n", __func__, status); return (EIO); } DELAY(WAIT_DELAY); - status = (uint8_t)(task_file[TF_STATUS/2]>>8); + status = cf_inb_16(TF_STATUS); } + break; } if ((status & STATUS_DRQ) == 0) { printf("%s: device not ready (status=%x)\n", __func__, status); @@ -550,9 +602,8 @@ static void cf_swap_ascii (unsigned char str1[], char str2[]) { int i; - for(i = 0; i < MODEL_STR_SIZE; i++) { - str2[i] = str1[i^1]; - } + for(i = 0; i < MODEL_STR_SIZE; i++) + str2[i] = str1[i ^ 1]; } @@ -562,7 +613,8 @@ static void cf_swap_ascii (unsigned char str1[], char str2[]) static int cf_probe (device_t dev) { - if (octeon_is_simulation()) return 1; + if (octeon_is_simulation()) + return (ENXIO); if (device_get_unit(dev) != 0) { panic("can't attach more devices\n"); @@ -582,9 +634,9 @@ static int cf_probe (device_t dev) * inserted. * */ +typedef unsigned long long llu; static void cf_identify (driver_t *drv, device_t parent) { - uint8_t status; int bus_region; int count = 0; cvmx_mio_boot_reg_cfgx_t cfg; @@ -599,34 +651,39 @@ static void cf_identify (driver_t *drv, device_t parent) cfg.u64 = cvmx_read_csr(CVMX_MIO_BOOT_REG_CFGX(bus_region)); if (cfg.s.base == octeon_bootinfo->compact_flash_common_base_addr >> 16) { - bus_width = (cfg.s.width) ? 16: 8; - printf("Compact flash found in bootbus region %d (%d bit).\n", bus_region, bus_width); + if (octeon_bootinfo->compact_flash_attribute_base_addr == 0) + bus_type = CF_TRUE_IDE_8; + else + bus_type = (cfg.s.width) ? CF_16 : CF_8; + printf("Compact flash found in bootbus region %d (%s).\n", bus_region, cf_type[bus_type]); break; } } - if (bus_width == 8) { - volatile uint8_t *task_file; - task_file = (volatile uint8_t *) base_addr; + switch (bus_type) + { + case CF_8: + case CF_TRUE_IDE_8: /* Check if CF is inserted */ - while ( (status = task_file[TF_STATUS]) & STATUS_BSY){ - if ((count++) == NR_TRIES ) { + while (cf_inb_8(TF_STATUS) & STATUS_BSY) { + if ((count++) == NR_TRIES ) { printf("Compact Flash not present\n"); return; } DELAY(WAIT_DELAY); } - } else { - volatile uint16_t *task_file; - task_file = (volatile uint16_t *) base_addr; + break; + case CF_16: + default: /* Check if CF is inserted */ - while ( (status = (task_file[TF_STATUS/2]>>8)) & STATUS_BSY){ - if ((count++) == NR_TRIES ) { + while (cf_inb_16(TF_STATUS) & STATUS_BSY) { + if ((count++) == NR_TRIES ) { printf("Compact Flash not present\n"); return; } DELAY(WAIT_DELAY); } + break; } BUS_ADD_CHILD(parent, 0, "cf", 0); @@ -655,7 +712,7 @@ static int cf_attach_geom (void *arg, int flag) * ------------------------------------------------------------------- */ static void cf_attach_geom_proxy (void *arg, int flag) { - cf_attach_geom(arg, flag); + cf_attach_geom(arg, flag); } @@ -668,7 +725,8 @@ static int cf_attach (device_t dev) { struct cf_priv *cf_priv; - if (octeon_is_simulation()) return 1; + if (octeon_is_simulation()) + return (ENXIO); cf_priv = device_get_softc(dev); cf_priv->dev = dev; @@ -701,4 +759,3 @@ static driver_t cf_driver = { static devclass_t cf_devclass; DRIVER_MODULE(cf, nexus, cf_driver, cf_devclass, 0, 0); - diff --git a/sys/modules/usb/Makefile b/sys/modules/usb/Makefile index ddff357..6288d66 100644 --- a/sys/modules/usb/Makefile +++ b/sys/modules/usb/Makefile @@ -30,7 +30,7 @@ SUBDIR += ehci musb ohci uhci xhci uss820dci ${_at91dci} ${_atmegadci} SUBDIR += rum run uath upgt ural zyd ${_urtw} SUBDIR += atp uhid ukbd ums udbp ufm uep SUBDIR += ucom u3g uark ubsa ubser uchcom ucycom ufoma uftdi ugensa uipaq ulpt \ - umct umcs7840 umodem umoscom uplcom uslcom uvisor uvscom + umct umcs umodem umoscom uplcom uslcom uvisor uvscom SUBDIR += uether aue axe cdce cue kue mos rue udav uhso ipheth SUBDIR += usfs umass urio SUBDIR += quirk template diff --git a/sys/modules/usb/umcs7840/Makefile b/sys/modules/usb/umcs/Makefile index fa03a9e..be75fb5 100644 --- a/sys/modules/usb/umcs7840/Makefile +++ b/sys/modules/usb/umcs/Makefile @@ -29,8 +29,8 @@ S= ${.CURDIR}/../../.. .PATH: $S/dev/usb/serial -KMOD= umcs7840 +KMOD= umcs SRCS= opt_bus.h opt_usb.h device_if.h bus_if.h usb_if.h usbdevs.h \ - umcs7840.c + umcs.c .include <bsd.kmod.mk> diff --git a/sys/net80211/ieee80211_ht.c b/sys/net80211/ieee80211_ht.c index 8c4d7d3..c9d8448 100644 --- a/sys/net80211/ieee80211_ht.c +++ b/sys/net80211/ieee80211_ht.c @@ -2520,6 +2520,7 @@ ieee80211_add_htcap_body(uint8_t *frm, struct ieee80211_node *ni) frm[1] = (v) >> 8; \ frm += 2; \ } while (0) + struct ieee80211com *ic = ni->ni_ic; struct ieee80211vap *vap = ni->ni_vap; uint16_t caps, extcaps; int rxmax, density; @@ -2543,6 +2544,17 @@ ieee80211_add_htcap_body(uint8_t *frm, struct ieee80211_node *ni) /* use advertised setting (XXX locally constraint) */ rxmax = MS(ni->ni_htparam, IEEE80211_HTCAP_MAXRXAMPDU); density = MS(ni->ni_htparam, IEEE80211_HTCAP_MPDUDENSITY); + + /* + * NB: Hardware might support HT40 on some but not all + * channels. We can't determine this earlier because only + * after association the channel is upgraded to HT based + * on the negotiated capabilities. + */ + if (ni->ni_chan != IEEE80211_CHAN_ANYC && + findhtchan(ic, ni->ni_chan, IEEE80211_CHAN_HT40U) == NULL && + findhtchan(ic, ni->ni_chan, IEEE80211_CHAN_HT40D) == NULL) + caps &= ~IEEE80211_HTCAP_CHWIDTH40; } else { /* override 20/40 use based on current channel */ if (IEEE80211_IS_CHAN_HT40(ni->ni_chan)) diff --git a/sys/net80211/ieee80211_output.c b/sys/net80211/ieee80211_output.c index b689310..6020144 100644 --- a/sys/net80211/ieee80211_output.c +++ b/sys/net80211/ieee80211_output.c @@ -516,6 +516,7 @@ ieee80211_send_setup( { #define WH4(wh) ((struct ieee80211_frame_addr4 *)wh) struct ieee80211vap *vap = ni->ni_vap; + struct ieee80211_tx_ampdu *tap; struct ieee80211_frame *wh = mtod(m, struct ieee80211_frame *); ieee80211_seq seqno; @@ -583,9 +584,15 @@ ieee80211_send_setup( } *(uint16_t *)&wh->i_dur[0] = 0; - seqno = ni->ni_txseqs[tid]++; - *(uint16_t *)&wh->i_seq[0] = htole16(seqno << IEEE80211_SEQ_SEQ_SHIFT); - M_SEQNO_SET(m, seqno); + tap = &ni->ni_tx_ampdu[TID_TO_WME_AC(tid)]; + if (tid != IEEE80211_NONQOS_TID && IEEE80211_AMPDU_RUNNING(tap)) + m->m_flags |= M_AMPDU_MPDU; + else { + seqno = ni->ni_txseqs[tid]++; + *(uint16_t *)&wh->i_seq[0] = + htole16(seqno << IEEE80211_SEQ_SEQ_SHIFT); + M_SEQNO_SET(m, seqno); + } if (IEEE80211_IS_MULTICAST(wh->i_addr1)) m->m_flags |= M_MCAST; diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c index 4357b66..4aa998f 100644 --- a/sys/netinet/in_pcb.c +++ b/sys/netinet/in_pcb.c @@ -621,7 +621,8 @@ in_pcbbind_setup(struct inpcb *inp, struct sockaddr *nam, in_addr_t *laddrp, * then pick one. */ int -in_pcbconnect(struct inpcb *inp, struct sockaddr *nam, struct ucred *cred) +in_pcbconnect_mbuf(struct inpcb *inp, struct sockaddr *nam, + struct ucred *cred, struct mbuf *m) { u_short lport, fport; in_addr_t laddr, faddr; @@ -654,13 +655,20 @@ in_pcbconnect(struct inpcb *inp, struct sockaddr *nam, struct ucred *cred) inp->inp_laddr.s_addr = laddr; inp->inp_faddr.s_addr = faddr; inp->inp_fport = fport; - in_pcbrehash(inp); + in_pcbrehash_mbuf(inp, m); if (anonport) inp->inp_flags |= INP_ANONPORT; return (0); } +int +in_pcbconnect(struct inpcb *inp, struct sockaddr *nam, struct ucred *cred) +{ + + return (in_pcbconnect_mbuf(inp, nam, cred, NULL)); +} + /* * Do proper source address selection on an unbound socket in case * of connect. Take jails into account as well. @@ -1626,7 +1634,8 @@ in_pcblookup_hash(struct inpcbinfo *pcbinfo, struct in_addr faddr, } /* - * Public inpcb lookup routines, accepting a 4-tuple. + * Public inpcb lookup routines, accepting a 4-tuple, and optionally, an mbuf + * from which a pre-calculated hash value may be extracted. */ struct inpcb * in_pcblookup(struct inpcbinfo *pcbinfo, struct in_addr faddr, u_int fport, @@ -1641,6 +1650,21 @@ in_pcblookup(struct inpcbinfo *pcbinfo, struct in_addr faddr, u_int fport, return (in_pcblookup_hash(pcbinfo, faddr, fport, laddr, lport, lookupflags, ifp)); } + +struct inpcb * +in_pcblookup_mbuf(struct inpcbinfo *pcbinfo, struct in_addr faddr, + u_int fport, struct in_addr laddr, u_int lport, int lookupflags, + struct ifnet *ifp, struct mbuf *m) +{ + + KASSERT((lookupflags & ~INPLOOKUP_MASK) == 0, + ("%s: invalid lookup flags %d", __func__, lookupflags)); + KASSERT((lookupflags & (INPLOOKUP_RLOCKPCB | INPLOOKUP_WLOCKPCB)) != 0, + ("%s: LOCKPCB not set", __func__)); + + return (in_pcblookup_hash(pcbinfo, faddr, fport, laddr, lport, + lookupflags, ifp)); +} #endif /* INET */ /* @@ -1707,7 +1731,7 @@ in_pcbinshash(struct inpcb *inp) * not change after in_pcbinshash() has been called. */ void -in_pcbrehash(struct inpcb *inp) +in_pcbrehash_mbuf(struct inpcb *inp, struct mbuf *m) { struct inpcbinfo *pcbinfo = inp->inp_pcbinfo; struct inpcbhead *head; @@ -1733,6 +1757,13 @@ in_pcbrehash(struct inpcb *inp) LIST_INSERT_HEAD(head, inp, inp_hash); } +void +in_pcbrehash(struct inpcb *inp) +{ + + in_pcbrehash_mbuf(inp, NULL); +} + /* * Remove PCB from various lists. */ diff --git a/sys/netinet/in_pcb.h b/sys/netinet/in_pcb.h index bde9e8d..809bc05 100644 --- a/sys/netinet/in_pcb.h +++ b/sys/netinet/in_pcb.h @@ -541,6 +541,8 @@ int in_pcb_lport(struct inpcb *, struct in_addr *, u_short *, int in_pcbbind_setup(struct inpcb *, struct sockaddr *, in_addr_t *, u_short *, struct ucred *); int in_pcbconnect(struct inpcb *, struct sockaddr *, struct ucred *); +int in_pcbconnect_mbuf(struct inpcb *, struct sockaddr *, struct ucred *, + struct mbuf *); int in_pcbconnect_setup(struct inpcb *, struct sockaddr *, in_addr_t *, u_short *, in_addr_t *, u_short *, struct inpcb **, struct ucred *); @@ -555,10 +557,14 @@ struct inpcb * struct inpcb * in_pcblookup(struct inpcbinfo *, struct in_addr, u_int, struct in_addr, u_int, int, struct ifnet *); +struct inpcb * + in_pcblookup_mbuf(struct inpcbinfo *, struct in_addr, u_int, + struct in_addr, u_int, int, struct ifnet *, struct mbuf *); void in_pcbnotifyall(struct inpcbinfo *pcbinfo, struct in_addr, int, struct inpcb *(*)(struct inpcb *, int)); void in_pcbref(struct inpcb *); void in_pcbrehash(struct inpcb *); +void in_pcbrehash_mbuf(struct inpcb *, struct mbuf *); int in_pcbrele(struct inpcb *); int in_pcbrele_rlocked(struct inpcb *); int in_pcbrele_wlocked(struct inpcb *); diff --git a/sys/netinet/ip_divert.c b/sys/netinet/ip_divert.c index 9f0e31c..6f5bce7 100644 --- a/sys/netinet/ip_divert.c +++ b/sys/netinet/ip_divert.c @@ -530,7 +530,9 @@ div_bind(struct socket *so, struct sockaddr *nam, struct thread *td) ((struct sockaddr_in *)nam)->sin_addr.s_addr = INADDR_ANY; INP_INFO_WLOCK(&V_divcbinfo); INP_WLOCK(inp); + INP_HASH_WLOCK(&V_divcbinfo); error = in_pcbbind(inp, nam, td->td_ucred); + INP_HASH_WUNLOCK(&V_divcbinfo); INP_WUNLOCK(inp); INP_INFO_WUNLOCK(&V_divcbinfo); return error; diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index 080b4da..e3e9aa6 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -791,12 +791,14 @@ findpcb: * Transparently forwarded. Pretend to be the destination. * already got one like this? */ - inp = in_pcblookup(&V_tcbinfo, ip->ip_src, th->th_sport, + inp = in_pcblookup_mbuf(&V_tcbinfo, ip->ip_src, th->th_sport, ip->ip_dst, th->th_dport, INPLOOKUP_WLOCKPCB, - m->m_pkthdr.rcvif); + m->m_pkthdr.rcvif, m); if (!inp) { /* * It's new. Try to find the ambushing socket. + * Because we've rewritten the destination address, + * any hardware-generated hash is ignored. */ inp = in_pcblookup(&V_tcbinfo, ip->ip_src, th->th_sport, next_hop->sin_addr, @@ -812,19 +814,19 @@ findpcb: { #ifdef INET6 if (isipv6) - inp = in6_pcblookup(&V_tcbinfo, &ip6->ip6_src, + inp = in6_pcblookup_mbuf(&V_tcbinfo, &ip6->ip6_src, th->th_sport, &ip6->ip6_dst, th->th_dport, INPLOOKUP_WILDCARD | INPLOOKUP_WLOCKPCB, - m->m_pkthdr.rcvif); + m->m_pkthdr.rcvif, m); #endif #if defined(INET) && defined(INET6) else #endif #ifdef INET - inp = in_pcblookup(&V_tcbinfo, ip->ip_src, + inp = in_pcblookup_mbuf(&V_tcbinfo, ip->ip_src, th->th_sport, ip->ip_dst, th->th_dport, INPLOOKUP_WILDCARD | INPLOOKUP_WLOCKPCB, - m->m_pkthdr.rcvif); + m->m_pkthdr.rcvif, m); #endif } diff --git a/sys/netinet/tcp_syncache.c b/sys/netinet/tcp_syncache.c index 533de4b..5125134 100644 --- a/sys/netinet/tcp_syncache.c +++ b/sys/netinet/tcp_syncache.c @@ -730,8 +730,8 @@ syncache_socket(struct syncache *sc, struct socket *lso, struct mbuf *m) laddr6 = inp->in6p_laddr; if (IN6_IS_ADDR_UNSPECIFIED(&inp->in6p_laddr)) inp->in6p_laddr = sc->sc_inc.inc6_laddr; - if ((error = in6_pcbconnect(inp, (struct sockaddr *)&sin6, - thread0.td_ucred)) != 0) { + if ((error = in6_pcbconnect_mbuf(inp, (struct sockaddr *)&sin6, + thread0.td_ucred, m)) != 0) { inp->in6p_laddr = laddr6; if ((s = tcp_log_addrs(&sc->sc_inc, NULL, NULL, NULL))) { log(LOG_DEBUG, "%s; %s: in6_pcbconnect failed " @@ -770,8 +770,8 @@ syncache_socket(struct syncache *sc, struct socket *lso, struct mbuf *m) laddr = inp->inp_laddr; if (inp->inp_laddr.s_addr == INADDR_ANY) inp->inp_laddr = sc->sc_inc.inc_laddr; - if ((error = in_pcbconnect(inp, (struct sockaddr *)&sin, - thread0.td_ucred)) != 0) { + if ((error = in_pcbconnect_mbuf(inp, (struct sockaddr *)&sin, + thread0.td_ucred, m)) != 0) { inp->inp_laddr = laddr; if ((s = tcp_log_addrs(&sc->sc_inc, NULL, NULL, NULL))) { log(LOG_DEBUG, "%s; %s: in_pcbconnect failed " diff --git a/sys/netinet/udp_usrreq.c b/sys/netinet/udp_usrreq.c index 5f2d7c3..fd864c0 100644 --- a/sys/netinet/udp_usrreq.c +++ b/sys/netinet/udp_usrreq.c @@ -567,9 +567,9 @@ udp_input(struct mbuf *m, int off) /* * Locate pcb for datagram. */ - inp = in_pcblookup(&V_udbinfo, ip->ip_src, uh->uh_sport, + inp = in_pcblookup_mbuf(&V_udbinfo, ip->ip_src, uh->uh_sport, ip->ip_dst, uh->uh_dport, INPLOOKUP_WILDCARD | INPLOOKUP_RLOCKPCB, - ifp); + ifp, m); if (inp == NULL) { if (udp_log_in_vain) { char buf[4*sizeof "123"]; diff --git a/sys/netinet6/in6_pcb.c b/sys/netinet6/in6_pcb.c index 17fb953..da73f21 100644 --- a/sys/netinet6/in6_pcb.c +++ b/sys/netinet6/in6_pcb.c @@ -364,8 +364,8 @@ in6_pcbladdr(register struct inpcb *inp, struct sockaddr *nam, * then pick one. */ int -in6_pcbconnect(register struct inpcb *inp, struct sockaddr *nam, - struct ucred *cred) +in6_pcbconnect_mbuf(register struct inpcb *inp, struct sockaddr *nam, + struct ucred *cred, struct mbuf *m) { struct inpcbinfo *pcbinfo = inp->inp_pcbinfo; register struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)nam; @@ -405,11 +405,18 @@ in6_pcbconnect(register struct inpcb *inp, struct sockaddr *nam, inp->inp_flow |= (htonl(ip6_randomflowlabel()) & IPV6_FLOWLABEL_MASK); - in_pcbrehash(inp); + in_pcbrehash_mbuf(inp, m); return (0); } +int +in6_pcbconnect(struct inpcb *inp, struct sockaddr *nam, struct ucred *cred) +{ + + return (in6_pcbconnect_mbuf(inp, nam, cred, NULL)); +} + void in6_pcbdisconnect(struct inpcb *inp) { @@ -974,13 +981,27 @@ in6_pcblookup_hash(struct inpcbinfo *pcbinfo, struct in6_addr *faddr, } /* - * Public inpcb lookup routines, accepting a 4-tuple. + * Public inpcb lookup routines, accepting a 4-tuple, and optionally, an mbuf + * from which a pre-calculated hash value may be extracted. */ struct inpcb * in6_pcblookup(struct inpcbinfo *pcbinfo, struct in6_addr *faddr, u_int fport, struct in6_addr *laddr, u_int lport, int lookupflags, struct ifnet *ifp) { + KASSERT((lookupflags & ~INPLOOKUP_MASK) == 0, + ("%s: invalid lookup flags %d", __func__, lookupflags)); + KASSERT((lookupflags & (INPLOOKUP_RLOCKPCB | INPLOOKUP_WLOCKPCB)) != 0, + ("%s: LOCKPCB not set", __func__)); + return (in6_pcblookup_hash(pcbinfo, faddr, fport, laddr, lport, + lookupflags, ifp)); +} + +struct inpcb * +in6_pcblookup_mbuf(struct inpcbinfo *pcbinfo, struct in6_addr *faddr, + u_int fport, struct in6_addr *laddr, u_int lport, int lookupflags, + struct ifnet *ifp, struct mbuf *m) +{ KASSERT((lookupflags & ~INPLOOKUP_MASK) == 0, ("%s: invalid lookup flags %d", __func__, lookupflags)); KASSERT((lookupflags & (INPLOOKUP_RLOCKPCB | INPLOOKUP_WLOCKPCB)) != 0, diff --git a/sys/netinet6/in6_pcb.h b/sys/netinet6/in6_pcb.h index bce5ee3..cf24704 100644 --- a/sys/netinet6/in6_pcb.h +++ b/sys/netinet6/in6_pcb.h @@ -73,6 +73,8 @@ void in6_pcbpurgeif0 __P((struct inpcbinfo *, struct ifnet *)); void in6_losing __P((struct inpcb *)); int in6_pcbbind __P((struct inpcb *, struct sockaddr *, struct ucred *)); int in6_pcbconnect __P((struct inpcb *, struct sockaddr *, struct ucred *)); +int in6_pcbconnect_mbuf __P((struct inpcb *, struct sockaddr *, + struct ucred *, struct mbuf *)); void in6_pcbdisconnect __P((struct inpcb *)); int in6_pcbladdr(struct inpcb *, struct sockaddr *, struct in6_addr *); struct inpcb * @@ -87,6 +89,10 @@ struct inpcb * in6_pcblookup_hash_locked __P((struct inpcbinfo *, struct in6_addr *, u_int, struct in6_addr *, u_int, int, struct ifnet *)); +struct inpcb * + in6_pcblookup_mbuf __P((struct inpcbinfo *, struct in6_addr *, + u_int, struct in6_addr *, u_int, int, + struct ifnet *ifp, struct mbuf *)); void in6_pcbnotify __P((struct inpcbinfo *, struct sockaddr *, u_int, const struct sockaddr *, u_int, int, void *, struct inpcb *(*)(struct inpcb *, int))); diff --git a/sys/netinet6/udp6_usrreq.c b/sys/netinet6/udp6_usrreq.c index 75145d7..6723007 100644 --- a/sys/netinet6/udp6_usrreq.c +++ b/sys/netinet6/udp6_usrreq.c @@ -377,9 +377,9 @@ udp6_input(struct mbuf **mp, int *offp, int proto) /* * Locate pcb for datagram. */ - inp = in6_pcblookup(&V_udbinfo, &ip6->ip6_src, uh->uh_sport, + inp = in6_pcblookup_mbuf(&V_udbinfo, &ip6->ip6_src, uh->uh_sport, &ip6->ip6_dst, uh->uh_dport, INPLOOKUP_WILDCARD | - INPLOOKUP_RLOCKPCB, m->m_pkthdr.rcvif); + INPLOOKUP_RLOCKPCB, m->m_pkthdr.rcvif, m); if (inp == NULL) { if (udp_log_in_vain) { char ip6bufs[INET6_ADDRSTRLEN]; diff --git a/sys/powerpc/aim/mmu_oea64.c b/sys/powerpc/aim/mmu_oea64.c index 84e8ecd..291d89b 100644 --- a/sys/powerpc/aim/mmu_oea64.c +++ b/sys/powerpc/aim/mmu_oea64.c @@ -2569,8 +2569,8 @@ moea64_sync_icache(mmu_t mmu, pmap_t pm, vm_offset_t va, vm_size_t sz) lim = round_page(va); len = MIN(lim - va, sz); pvo = moea64_pvo_find_va(pm, va & ~ADDR_POFF); - if (pvo != NULL) { - pa = (pvo->pvo_pte.pte.pte_lo & LPTE_RPGN) | + if (pvo != NULL && !(pvo->pvo_pte.lpte.pte_lo & LPTE_I)) { + pa = (pvo->pvo_pte.lpte.pte_lo & LPTE_RPGN) | (va & ADDR_POFF); moea64_syncicache(mmu, pm, va, pa, len); } diff --git a/sys/powerpc/conf/GENERIC b/sys/powerpc/conf/GENERIC index af4b19a..54d4639 100644 --- a/sys/powerpc/conf/GENERIC +++ b/sys/powerpc/conf/GENERIC @@ -180,6 +180,7 @@ device fcu # Apple Fan Control Unit device max6690 # PowerMac7,2 temperature sensor device powermac_nvram # Open Firmware configuration NVRAM device smu # Apple System Management Unit +device windtunnel # Apple G4 MDD fan controller # ADB support device adb diff --git a/sys/powerpc/conf/NOTES b/sys/powerpc/conf/NOTES index 374106d..0045763 100644 --- a/sys/powerpc/conf/NOTES +++ b/sys/powerpc/conf/NOTES @@ -47,6 +47,7 @@ device pmu # Apple Power Management Unit device smu # Apple System Management Unit device snd_ai2s # Apple I2S Audio device snd_davbus # Apple Davbus Audio +device windtunnel # Apple G4 MDD fan controller ##################################################################### diff --git a/sys/powerpc/ofw/ofw_machdep.c b/sys/powerpc/ofw/ofw_machdep.c index 2f1e770..fcdc953 100644 --- a/sys/powerpc/ofw/ofw_machdep.c +++ b/sys/powerpc/ofw/ofw_machdep.c @@ -60,18 +60,15 @@ __FBSDID("$FreeBSD$"); #include <machine/platform.h> #include <machine/ofw_machdep.h> -#define OFMEM_REGIONS 32 -static struct mem_region OFmem[OFMEM_REGIONS + 1], OFavail[OFMEM_REGIONS + 3]; -static struct mem_region OFfree[OFMEM_REGIONS + 3]; -static int nOFmem; +static struct mem_region OFmem[PHYS_AVAIL_SZ], OFavail[PHYS_AVAIL_SZ]; +static struct mem_region OFfree[PHYS_AVAIL_SZ]; extern register_t ofmsr[5]; -int ofwcall(void *); extern void *openfirmware_entry; static void *fdt; int ofw_real_mode; -int ofw_32bit_mode_entry(void *); +int ofwcall(void *); static void ofw_quiesce(void); static int openfirmware(void *args); @@ -135,11 +132,32 @@ memr_merge(struct mem_region *from, struct mem_region *to) to->mr_size = end - to->mr_start; } +/* + * Quick sort callout for comparing memory regions. + */ +static int mr_cmp(const void *a, const void *b); + +static int +mr_cmp(const void *a, const void *b) +{ + const struct mem_region *regiona; + const struct mem_region *regionb; + + regiona = a; + regionb = b; + if (regiona->mr_start < regionb->mr_start) + return (-1); + else if (regiona->mr_start > regionb->mr_start) + return (1); + else + return (0); +} + static int parse_ofw_memory(phandle_t node, const char *prop, struct mem_region *output) { cell_t address_cells, size_cells; - cell_t OFmem[4*(OFMEM_REGIONS + 1)]; + cell_t OFmem[4 * PHYS_AVAIL_SZ]; int sz, i, j; int apple_hack_mode; phandle_t phandle; @@ -175,8 +193,8 @@ parse_ofw_memory(phandle_t node, const char *prop, struct mem_region *output) /* * Get memory. */ - if ((node == -1) || (sz = OF_getprop(node, prop, - OFmem, sizeof(OFmem[0]) * 4 * OFMEM_REGIONS)) <= 0) + if (node == -1 || (sz = OF_getprop(node, prop, + OFmem, sizeof(OFmem))) <= 0) panic("Physical memory map not found"); i = 0; @@ -226,7 +244,7 @@ parse_ofw_memory(phandle_t node, const char *prop, struct mem_region *output) #ifdef __powerpc64__ if (apple_hack_mode) { /* Add in regions above 4 GB to the available list */ - struct mem_region himem[OFMEM_REGIONS]; + struct mem_region himem[16]; int hisz; hisz = parse_ofw_memory(node, "reg", himem); @@ -244,6 +262,81 @@ parse_ofw_memory(phandle_t node, const char *prop, struct mem_region *output) return (sz); } +static int +parse_drconf_memory(int *msz, int *asz, struct mem_region *ofmem, + struct mem_region *ofavail) +{ + phandle_t phandle; + vm_offset_t base; + int i, idx, len, lasz, lmsz, res; + uint32_t lmb_size[2]; + unsigned long *dmem, flags; + + lmsz = *msz; + lasz = *asz; + + phandle = OF_finddevice("/ibm,dynamic-reconfiguration-memory"); + if (phandle == -1) + /* No drconf node, return. */ + return (0); + + res = OF_getprop(phandle, "ibm,lmb-size", lmb_size, sizeof(lmb_size)); + if (res == -1) + return (0); + + /* Parse the /ibm,dynamic-memory. + The first position gives the # of entries. The next two words + reflect the address of the memory block. The next four words are + the DRC index, reserved, list index and flags. + (see PAPR C.6.6.2 ibm,dynamic-reconfiguration-memory) + + #el Addr DRC-idx res list-idx flags + ------------------------------------------------- + | 4 | 8 | 4 | 4 | 4 | 4 |.... + ------------------------------------------------- + */ + + len = OF_getproplen(phandle, "ibm,dynamic-memory"); + if (len > 0) { + + /* We have to use a variable length array on the stack + since we have very limited stack space. + */ + cell_t arr[len/sizeof(cell_t)]; + + res = OF_getprop(phandle, "ibm,dynamic-memory", &arr, + sizeof(arr)); + if (res == -1) + return (0); + + /* Number of elements */ + idx = arr[0]; + + /* First address. */ + dmem = (void*)&arr[1]; + + for (i = 0; i < idx; i++) { + base = *dmem; + dmem += 2; + flags = *dmem; + /* Use region only if available and not reserved. */ + if ((flags & 0x8) && !(flags & 0x80)) { + ofmem[lmsz].mr_start = base; + ofmem[lmsz].mr_size = (vm_size_t)lmb_size[1]; + ofavail[lasz].mr_start = base; + ofavail[lasz].mr_size = (vm_size_t)lmb_size[1]; + lmsz++; + lasz++; + } + dmem++; + } + } + + *msz = lmsz; + *asz = lasz; + + return (1); +} /* * This is called during powerpc_init, before the system is really initialized. * It shall provide the total and the available regions of RAM. @@ -256,31 +349,62 @@ ofw_mem_regions(struct mem_region **memp, int *memsz, struct mem_region **availp, int *availsz) { phandle_t phandle; + vm_offset_t maxphysaddr; int asz, msz, fsz; - int i, j; + int i, j, res; int still_merging; + char name[31]; asz = msz = 0; /* - * Get memory. + * Get memory from all the /memory nodes. */ - phandle = OF_finddevice("/memory"); - if (phandle == -1) - phandle = OF_finddevice("/memory@0"); + for (phandle = OF_child(OF_peer(0)); phandle != 0; + phandle = OF_peer(phandle)) { + if (OF_getprop(phandle, "name", name, sizeof(name)) <= 0) + continue; + if (strncmp(name, "memory", sizeof(name)) != 0) + continue; + + res = parse_ofw_memory(phandle, "reg", &OFmem[msz]); + msz += res/sizeof(struct mem_region); + if (OF_getproplen(phandle, "available") >= 0) + res = parse_ofw_memory(phandle, "available", + &OFavail[asz]); + else + res = parse_ofw_memory(phandle, "reg", &OFavail[asz]); + asz += res/sizeof(struct mem_region); + } + + /* Check for memory in ibm,dynamic-reconfiguration-memory */ + parse_drconf_memory(&msz, &asz, OFmem, OFavail); - msz = parse_ofw_memory(phandle, "reg", OFmem); - nOFmem = msz / sizeof(struct mem_region); - asz = parse_ofw_memory(phandle, "available", OFavail); + qsort(OFmem, msz, sizeof(*OFmem), mr_cmp); + qsort(OFavail, asz, sizeof(*OFavail), mr_cmp); *memp = OFmem; - *memsz = nOFmem; - + *memsz = msz; + + /* + * On some firmwares (SLOF), some memory may be marked available that + * doesn't actually exist. This manifests as an extension of the last + * available segment past the end of physical memory, so truncate that + * one. + */ + maxphysaddr = 0; + for (i = 0; i < msz; i++) + if (OFmem[i].mr_start + OFmem[i].mr_size > maxphysaddr) + maxphysaddr = OFmem[i].mr_start + OFmem[i].mr_size; + + if (OFavail[asz - 1].mr_start + OFavail[asz - 1].mr_size > maxphysaddr) + OFavail[asz - 1].mr_size = maxphysaddr - + OFavail[asz - 1].mr_start; + /* * OFavail may have overlapping regions - collapse these * and copy out remaining regions to OFfree */ - asz /= sizeof(struct mem_region); do { still_merging = FALSE; for (i = 0; i < asz; i++) { @@ -469,12 +593,7 @@ openfirmware(void *args) int result; #ifdef SMP struct ofw_rv_args rv_args; - #endif - if (pmap_bootstrapped && ofw_real_mode) - args = (void *)pmap_kextract((vm_offset_t)args); - - #ifdef SMP rv_args.args = args; rv_args.in_progress = 1; smp_rendezvous(smp_no_rendevous_barrier, ofw_rendezvous_dispatch, diff --git a/sys/powerpc/powermac/fcu.c b/sys/powerpc/powermac/fcu.c index 51dd96b..7ac9b1b 100644 --- a/sys/powerpc/powermac/fcu.c +++ b/sys/powerpc/powermac/fcu.c @@ -138,6 +138,8 @@ fcu_write(device_t dev, uint32_t addr, uint8_t reg, uint8_t *buff, int len) { unsigned char buf[4]; + int try = 0; + struct iic_msg msg[] = { { addr, IIC_M_WR, 0, buf } }; @@ -145,33 +147,46 @@ fcu_write(device_t dev, uint32_t addr, uint8_t reg, uint8_t *buff, msg[0].len = len + 1; buf[0] = reg; memcpy(buf + 1, buff, len); - if (iicbus_transfer(dev, msg, 1) != 0) { - device_printf(dev, "iicbus write failed\n"); - return (EIO); - } - return (0); + for (;;) + { + if (iicbus_transfer(dev, msg, 1) == 0) + return (0); + if (++try > 5) { + device_printf(dev, "iicbus write failed\n"); + return (-1); + } + pause("fcu_write", hz); + } } static int fcu_read_1(device_t dev, uint32_t addr, uint8_t reg, uint8_t *data) { uint8_t buf[4]; + int err, try = 0; struct iic_msg msg[2] = { { addr, IIC_M_WR | IIC_M_NOSTOP, 1, ® }, { addr, IIC_M_RD, 1, buf }, }; - if (iicbus_transfer(dev, msg, 2) != 0) { - device_printf(dev, "iicbus read failed\n"); - return (EIO); + for (;;) + { + err = iicbus_transfer(dev, msg, 2); + if (err != 0) + goto retry; + + *data = *((uint8_t*)buf); + return (0); + retry: + if (++try > 5) { + device_printf(dev, "iicbus read failed\n"); + return (-1); + } + pause("fcu_read_1", hz); } - - *data = *((uint8_t*)buf); - - return (0); } static int @@ -267,13 +282,14 @@ fcu_fan_set_rpm(struct fcu_fan *fan, int rpm) fan->setpoint = rpm; } else { device_printf(fan->dev, "Unknown fan type: %d\n", fan->type); - return (EIO); + return (-1); } buf[0] = rpm >> (8 - fcu_rpm_shift); buf[1] = rpm << fcu_rpm_shift; - fcu_write(sc->sc_dev, sc->sc_addr, reg, buf, 2); + if (fcu_write(sc->sc_dev, sc->sc_addr, reg, buf, 2) < 0) + return (-1); return (0); } @@ -292,7 +308,8 @@ fcu_fan_get_rpm(struct fcu_fan *fan) if (fan->type == FCU_FAN_RPM) { /* Check if the fan is available. */ reg = FCU_RPM_AVAILABLE; - fcu_read_1(sc->sc_dev, sc->sc_addr, reg, &avail); + if (fcu_read_1(sc->sc_dev, sc->sc_addr, reg, &avail) < 0) + return (-1); if ((avail & (1 << fan->id)) == 0) { device_printf(fan->dev, "RPM Fan not available ID: %d\n", fan->id); @@ -300,7 +317,8 @@ fcu_fan_get_rpm(struct fcu_fan *fan) } /* Check if we have a failed fan. */ reg = FCU_RPM_FAIL; - fcu_read_1(sc->sc_dev, sc->sc_addr, reg, &fail); + if (fcu_read_1(sc->sc_dev, sc->sc_addr, reg, &fail) < 0) + return (-1); if ((fail & (1 << fan->id)) != 0) { device_printf(fan->dev, "RPM Fan failed ID: %d\n", fan->id); @@ -308,7 +326,8 @@ fcu_fan_get_rpm(struct fcu_fan *fan) } /* Check if fan is active. */ reg = FCU_RPM_ACTIVE; - fcu_read_1(sc->sc_dev, sc->sc_addr, reg, &active); + if (fcu_read_1(sc->sc_dev, sc->sc_addr, reg, &active) < 0) + return (-1); if ((active & (1 << fan->id)) == 0) { device_printf(fan->dev, "RPM Fan not active ID: %d\n", fan->id); @@ -322,7 +341,8 @@ fcu_fan_get_rpm(struct fcu_fan *fan) } /* It seems that we can read the fans rpm. */ - fcu_read_1(sc->sc_dev, sc->sc_addr, reg, buff); + if (fcu_read_1(sc->sc_dev, sc->sc_addr, reg, buff) < 0) + return (-1); rpm = (buff[0] << (8 - fcu_rpm_shift)) | buff[1] >> fcu_rpm_shift; @@ -356,8 +376,8 @@ fcu_fan_set_pwm(struct fcu_fan *fan, int pwm) buf[0] = (pwm * 2550) / 1000; - fcu_write(sc->sc_dev, sc->sc_addr, reg, buf, 1); - + if (fcu_write(sc->sc_dev, sc->sc_addr, reg, buf, 1) < 0) + return (-1); return (0); } @@ -374,26 +394,29 @@ fcu_fan_get_pwm(device_t dev, struct fcu_fan *fan, int *pwm, int *rpm) if (fan->type == FCU_FAN_PWM) { /* Check if the fan is available. */ reg = FCU_PWM_AVAILABLE; - fcu_read_1(sc->sc_dev, sc->sc_addr, reg, &avail); + if (fcu_read_1(sc->sc_dev, sc->sc_addr, reg, &avail) < 0) + return (-1); if ((avail & (1 << fan->id)) == 0) { device_printf(dev, "PWM Fan not available ID: %d\n", fan->id); - return (EIO); + return (-1); } /* Check if we have a failed fan. */ reg = FCU_PWM_FAIL; - fcu_read_1(sc->sc_dev, sc->sc_addr, reg, &fail); + if (fcu_read_1(sc->sc_dev, sc->sc_addr, reg, &fail) < 0) + return (-1); if ((fail & (1 << fan->id)) != 0) { device_printf(dev, "PWM Fan failed ID: %d\n", fan->id); - return (EIO); + return (-1); } /* Check if fan is active. */ reg = FCU_PWM_ACTIVE; - fcu_read_1(sc->sc_dev, sc->sc_addr, reg, &active); + if (fcu_read_1(sc->sc_dev, sc->sc_addr, reg, &active) < 0) + return (-1); if ((active & (1 << fan->id)) == 0) { device_printf(dev, "PWM Fan not active ID: %d\n", fan->id); - return (ENXIO); + return (-1); } reg = FCU_PWM_SGET(fan->id); } else { @@ -402,13 +425,16 @@ fcu_fan_get_pwm(device_t dev, struct fcu_fan *fan, int *pwm, int *rpm) } /* It seems that we can read the fans pwm. */ - fcu_read_1(sc->sc_dev, sc->sc_addr, reg, buf); + if (fcu_read_1(sc->sc_dev, sc->sc_addr, reg, buf) < 0) + return (-1); *pwm = (buf[0] * 1000) / 2550; /* Now read the rpm. */ reg = FCU_PWM_RPM(fan->id); - fcu_read_1(sc->sc_dev, sc->sc_addr, reg, buf); + if (fcu_read_1(sc->sc_dev, sc->sc_addr, reg, buf) < 0) + return (-1); + *rpm = (buf[0] << (8 - fcu_rpm_shift)) | buf[1] >> fcu_rpm_shift; return (0); @@ -502,16 +528,20 @@ fcu_fanrpm_sysctl(SYSCTL_HANDLER_ARGS) device_t fcu; struct fcu_softc *sc; struct fcu_fan *fan; - int rpm = 0, pwm = 0, error; + int rpm = 0, pwm = 0, error = 0; fcu = arg1; sc = device_get_softc(fcu); fan = &sc->sc_fans[arg2 & 0x00ff]; if (fan->type == FCU_FAN_RPM) { rpm = fcu_fan_get_rpm(fan); + if (rpm < 0) + return (-1); error = sysctl_handle_int(oidp, &rpm, 0, req); } else { - fcu_fan_get_pwm(fcu, fan, &pwm, &rpm); + error = fcu_fan_get_pwm(fcu, fan, &pwm, &rpm); + if (error < 0) + return (-1); switch (arg2 & 0xff00) { case FCU_PWM_SYSCTL_PWM: diff --git a/sys/powerpc/powermac/powermac_thermal.c b/sys/powerpc/powermac/powermac_thermal.c index 1b03072..9c1f59d 100644 --- a/sys/powerpc/powermac/powermac_thermal.c +++ b/sys/powerpc/powermac/powermac_thermal.c @@ -109,9 +109,10 @@ pmac_therm_manage_fans(void) printf("WARNING: Current temperature (%s: %d.%d C) " "exceeds critical temperature (%d.%d C)! " "Shutting down!\n", sensor->sensor->name, - sensor->last_val / 10, sensor->last_val % 10, - sensor->sensor->max_temp / 10, - sensor->sensor->max_temp % 10); + (sensor->last_val - ZERO_C_TO_K) / 10, + (sensor->last_val - ZERO_C_TO_K) % 10, + (sensor->sensor->max_temp - ZERO_C_TO_K) / 10, + (sensor->sensor->max_temp - ZERO_C_TO_K) % 10); shutdown_nice(RB_POWEROFF); } } diff --git a/sys/powerpc/powermac/powermac_thermal.h b/sys/powerpc/powermac/powermac_thermal.h index 43bd629..424c612 100644 --- a/sys/powerpc/powermac/powermac_thermal.h +++ b/sys/powerpc/powermac/powermac_thermal.h @@ -29,6 +29,8 @@ #ifndef _POWERPC_POWERMAC_POWERMAC_THERMAL_H #define _POWERPC_POWERMAC_POWERMAC_THERMAL_H +#define ZERO_C_TO_K 2732 + struct pmac_fan { int min_rpm, max_rpm, default_rpm; diff --git a/sys/powerpc/powermac/windtunnel.c b/sys/powerpc/powermac/windtunnel.c new file mode 100644 index 0000000..b4aeca3 --- /dev/null +++ b/sys/powerpc/powermac/windtunnel.c @@ -0,0 +1,216 @@ +/*- + * Copyright (c) 2011 Justin Hibbits + * Copyright (c) 2010 Andreas Tobler + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include <sys/cdefs.h> +__FBSDID("$FreeBSD$"); + +#include <sys/param.h> +#include <sys/bus.h> +#include <sys/systm.h> +#include <sys/module.h> +#include <sys/callout.h> +#include <sys/conf.h> +#include <sys/cpu.h> +#include <sys/ctype.h> +#include <sys/kernel.h> +#include <sys/kthread.h> +#include <sys/limits.h> +#include <sys/reboot.h> +#include <sys/rman.h> +#include <sys/sysctl.h> +#include <sys/unistd.h> + +#include <machine/bus.h> +#include <machine/md_var.h> + +#include <dev/iicbus/iicbus.h> +#include <dev/iicbus/iiconf.h> + +#include <dev/ofw/openfirm.h> +#include <dev/ofw/ofw_bus.h> +#include <powerpc/powermac/powermac_thermal.h> + +struct adm1030_softc { + struct pmac_fan fan; + device_t sc_dev; + struct intr_config_hook enum_hook; + uint32_t sc_addr; + phandle_t sc_thermostat_phandle; + device_t sc_thermostat_dev; +}; + +/* Regular bus attachment functions */ +static int adm1030_probe(device_t); +static int adm1030_attach(device_t); + +/* Utility functions */ +static void adm1030_start(void *xdev); +static int adm1030_write_byte(device_t dev, uint32_t addr, uint8_t reg, uint8_t buf); +static int adm1030_set(struct adm1030_softc *fan, int pwm); + +static device_method_t adm1030_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, adm1030_probe), + DEVMETHOD(device_attach, adm1030_attach), + {0, 0}, +}; + +static driver_t adm1030_driver = { + "adm1030", + adm1030_methods, + sizeof(struct adm1030_softc) +}; + +static devclass_t adm1030_devclass; + +DRIVER_MODULE(adm1030, iicbus, adm1030_driver, adm1030_devclass, 0, 0); + +static int +adm1030_write_byte(device_t dev, uint32_t addr, uint8_t reg, uint8_t byte) +{ + unsigned char buf[4]; + int try = 0; + + struct iic_msg msg[] = { + {addr, IIC_M_WR, 0, buf} + }; + + msg[0].len = 2; + buf[0] = reg; + buf[1] = byte; + + for (;;) + { + if (iicbus_transfer(dev, msg, 1) == 0) + return (0); + + if (++try > 5) { + device_printf(dev, "iicbus write failed\n"); + return (-1); + } + pause("adm1030_write_byte", hz); + } +} + +static int +adm1030_probe(device_t dev) +{ + const char *name, *compatible; + struct adm1030_softc *sc; + phandle_t handle; + phandle_t thermostat; + + name = ofw_bus_get_name(dev); + compatible = ofw_bus_get_compat(dev); + handle = ofw_bus_get_node(dev); + + if (!name) + return (ENXIO); + + if (strcmp(name, "fan") != 0 || strcmp(compatible, "adm1030") != 0) + return (ENXIO); + + /* This driver can only be used if there's an associated temp sensor. */ + if (OF_getprop(handle, "platform-getTemp", &thermostat, sizeof(thermostat)) < 0) + return (ENXIO); + + sc = device_get_softc(dev); + sc->sc_dev = dev; + sc->sc_addr = iicbus_get_addr(dev); + + device_set_desc(dev, "G4 MDD Fan driver"); + + return (0); +} + +static int +adm1030_attach(device_t dev) +{ + struct adm1030_softc *sc; + + sc = device_get_softc(dev); + + sc->enum_hook.ich_func = adm1030_start; + sc->enum_hook.ich_arg = dev; + + /* + * We have to wait until interrupts are enabled. I2C read and write + * only works if the interrupts are available. The unin/i2c is + * controlled by the htpic on unin. But this is not the master. The + * openpic on mac-io is controlling the htpic. This one gets attached + * after the mac-io probing and then the interrupts will be + * available. + */ + + if (config_intrhook_establish(&sc->enum_hook) != 0) + return (ENOMEM); + + return (0); +} + +static void +adm1030_start(void *xdev) +{ + struct adm1030_softc *sc; + + device_t dev = (device_t) xdev; + + sc = device_get_softc(dev); + + /* Start the adm1030 device. */ + adm1030_write_byte(sc->sc_dev, sc->sc_addr, 0x1, 0x1); + adm1030_write_byte(sc->sc_dev, sc->sc_addr, 0x0, 0x95); + adm1030_write_byte(sc->sc_dev, sc->sc_addr, 0x23, 0x91); + + /* Use the RPM fields as PWM duty cycles. */ + sc->fan.min_rpm = 0; + sc->fan.max_rpm = 15; + sc->fan.default_rpm = 2; + + strcpy(sc->fan.name, "MDD Case fan"); + sc->fan.zone = 0; + sc->fan.read = NULL; + sc->fan.set = (int (*)(struct pmac_fan *, int))adm1030_set; + config_intrhook_disestablish(&sc->enum_hook); + + pmac_thermal_fan_register(&sc->fan); +} + +static int adm1030_set(struct adm1030_softc *fan, int pwm) +{ + /* Clamp the PWM to 0-0xF, one nibble. */ + if (pwm > 0xF) + pwm = 0xF; + if (pwm < 0) + pwm = 0; + + if (adm1030_write_byte(fan->sc_dev, fan->sc_addr, 0x22, pwm) < 0) + return (-1); + + return (0); +} + diff --git a/tools/regression/bin/sh/builtins/alias.1.stderr b/tools/regression/bin/sh/builtins/alias.1.stderr index 5ea01d5..c9f4011 100644 --- a/tools/regression/bin/sh/builtins/alias.1.stderr +++ b/tools/regression/bin/sh/builtins/alias.1.stderr @@ -1 +1 @@ -alias: foo not found +alias: foo: not found diff --git a/tools/regression/bin/sh/execution/set-n1.0 b/tools/regression/bin/sh/execution/set-n1.0 new file mode 100644 index 0000000..14c9b93 --- /dev/null +++ b/tools/regression/bin/sh/execution/set-n1.0 @@ -0,0 +1,7 @@ +# $FreeBSD$ + +v=$( ($SH -n <<'EOF' +for +EOF +) 2>&1 >/dev/null) +[ $? -ne 0 ] && [ -n "$v" ] diff --git a/tools/regression/bin/sh/execution/set-n2.0 b/tools/regression/bin/sh/execution/set-n2.0 new file mode 100644 index 0000000..c7f3162 --- /dev/null +++ b/tools/regression/bin/sh/execution/set-n2.0 @@ -0,0 +1,5 @@ +# $FreeBSD$ + +$SH -n <<'EOF' +echo bad +EOF diff --git a/tools/regression/bin/sh/execution/set-n3.0 b/tools/regression/bin/sh/execution/set-n3.0 new file mode 100644 index 0000000..24a9159 --- /dev/null +++ b/tools/regression/bin/sh/execution/set-n3.0 @@ -0,0 +1,4 @@ +# $FreeBSD$ + +v=$( ($SH -nc 'for') 2>&1 >/dev/null) +[ $? -ne 0 ] && [ -n "$v" ] diff --git a/tools/regression/bin/sh/execution/set-n4.0 b/tools/regression/bin/sh/execution/set-n4.0 new file mode 100644 index 0000000..3698508 --- /dev/null +++ b/tools/regression/bin/sh/execution/set-n4.0 @@ -0,0 +1,3 @@ +# $FreeBSD$ + +$SH -nc 'echo bad' diff --git a/tools/regression/netinet/ipdivert/Makefile b/tools/regression/netinet/ipdivert/Makefile new file mode 100644 index 0000000..385620b --- /dev/null +++ b/tools/regression/netinet/ipdivert/Makefile @@ -0,0 +1,11 @@ +# +# $FreeBSD$ +# + +PROG= ipdivert +SRCS= ipdivert.c +NO_MAN= + +WARNS?= 2 + +.include <bsd.prog.mk> diff --git a/tools/regression/netinet/ipdivert/ipdivert.c b/tools/regression/netinet/ipdivert/ipdivert.c new file mode 100644 index 0000000..0d58491 --- /dev/null +++ b/tools/regression/netinet/ipdivert/ipdivert.c @@ -0,0 +1,166 @@ +/*- + * Copyright (c) 2010-2011 Juniper Networks, Inc. + * All rights reserved. + * + * This software was developed by Robert N. M. Watson under contract + * to Juniper Networks, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +/* + * This is a test tool for IP divert sockets. For the time being, it just + * exercise creation and binding of sockets, rather than their divert + * behaviour. It would be highly desirable to broaden this test tool to + * include packet injection and diversion. + */ + +#include <sys/types.h> +#include <sys/socket.h> + +#include <netinet/in.h> + +#include <err.h> +#include <errno.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <unistd.h> + +static void +ok(const char *test) +{ + + fprintf(stderr, "%s: OK\n", test); +} + +static void +fail(const char *test, const char *note) +{ + + fprintf(stderr, "%s - %s: FAIL (%s)\n", test, note, strerror(errno)); + exit(1); +} + +static void +failx(const char *test, const char *note) +{ + + fprintf(stderr, "%s - %s: FAIL\n", test, note); + exit(1); +} + +static int +ipdivert_create(const char *test) +{ + int s; + + s = socket(PF_INET, SOCK_RAW, IPPROTO_DIVERT); + if (s < 0) + fail(test, "socket"); + return (s); +} + +static void +ipdivert_close(const char *test, int s) +{ + + if (close(s) < 0) + fail(test, "close"); +} + +static void +ipdivert_bind(const char *test, int s, u_short port, int expect) +{ + struct sockaddr_in sin; + int err; + + bzero(&sin, sizeof(sin)); + sin.sin_family = AF_INET; + sin.sin_addr.s_addr = htonl(INADDR_ANY); + sin.sin_port = htons(port); + + err = bind(s, (struct sockaddr *)&sin, sizeof(sin)); + if (err < 0) { + if (expect == 0) + fail(test, "bind"); + if (errno != expect) + fail(test, "bind"); + } else { + if (expect != 0) + failx(test, "bind"); + } +} + +int +main(int argc, char *argv[]) +{ + const char *test; + int s1, s2; + + /* + * First test: create and close an IP divert socket. + */ + test = "create_close"; + s1 = ipdivert_create(test); + ipdivert_close(test, s1); + ok(test); + + /* + * Second test: create, bind, and close an IP divert socket. + */ + test = "create_bind_close"; + s1 = ipdivert_create(test); + ipdivert_bind(test, s1, 1000, 0); + ipdivert_close(test, s1); + ok(test); + + /* + * Third test: create two sockets, bind to different ports, and close. + * This should succeed due to non-conflict on the port numbers. + */ + test = "create2_bind2_close2"; + s1 = ipdivert_create(test); + s2 = ipdivert_create(test); + ipdivert_bind(test, s1, 1000, 0); + ipdivert_bind(test, s2, 1001, 0); + ipdivert_close(test, s1); + ipdivert_close(test, s2); + ok(test); + + /* + * Fourth test: create two sockets, bind to the *same* port, and + * close. This should fail due to conflicting port numbers. + */ + test = "create2_bind2_conflict_close2"; + s1 = ipdivert_create(test); + s2 = ipdivert_create(test); + ipdivert_bind(test, s1, 1000, 0); + ipdivert_bind(test, s2, 1000, EADDRINUSE); + ipdivert_close(test, s1); + ipdivert_close(test, s2); + ok(test); + + return (0); +} diff --git a/usr.bin/find/main.c b/usr.bin/find/main.c index 2c11936..d901623 100644 --- a/usr.bin/find/main.c +++ b/usr.bin/find/main.c @@ -120,7 +120,7 @@ main(int argc, char *argv[]) break; case '?': default: - break; + usage(); } argc -= optind; diff --git a/usr.sbin/bsdinstall/scripts/netconfig b/usr.sbin/bsdinstall/scripts/netconfig index 37fe8c6..b78e330 100755 --- a/usr.sbin/bsdinstall/scripts/netconfig +++ b/usr.sbin/bsdinstall/scripts/netconfig @@ -173,8 +173,7 @@ exec 3>&- echo ${RESOLV} | tr ' ' '\n' | \ awk ' BEGIN { - search=1 - printf "search "; + search=-1; } { if (/^[[:space:]]+$/) { @@ -185,8 +184,13 @@ BEGIN { search=0; next; } + if (search == -1) { + printf "search "; + search=1; + } if (search > 0) { - printf "%s%s", (search > 1) ? "," : "", $1; + printf "%s%s", (search > 1) ? " " : "", $1; + search++; next; } printf "nameserver %s\n", $1; |