Browse Source

init

linux
penguin 1 year ago
commit
f992961f02
100 changed files with 17993 additions and 0 deletions
  1. +0
    -0
      README.md
  2. BIN
      arm-none-eabi-toolchain/arm-none-eabi/bin/ar
  3. BIN
      arm-none-eabi-toolchain/arm-none-eabi/bin/as
  4. BIN
      arm-none-eabi-toolchain/arm-none-eabi/bin/ld
  5. BIN
      arm-none-eabi-toolchain/arm-none-eabi/bin/ld.bfd
  6. BIN
      arm-none-eabi-toolchain/arm-none-eabi/bin/nm
  7. BIN
      arm-none-eabi-toolchain/arm-none-eabi/bin/objcopy
  8. BIN
      arm-none-eabi-toolchain/arm-none-eabi/bin/objdump
  9. BIN
      arm-none-eabi-toolchain/arm-none-eabi/bin/ranlib
  10. BIN
      arm-none-eabi-toolchain/arm-none-eabi/bin/readelf
  11. BIN
      arm-none-eabi-toolchain/arm-none-eabi/bin/strip
  12. +140
    -0
      arm-none-eabi-toolchain/arm-none-eabi/include/_ansi.h
  13. +12
    -0
      arm-none-eabi-toolchain/arm-none-eabi/include/_newlib_version.h
  14. +40
    -0
      arm-none-eabi-toolchain/arm-none-eabi/include/_syslist.h
  15. +21
    -0
      arm-none-eabi-toolchain/arm-none-eabi/include/alloca.h
  16. +69
    -0
      arm-none-eabi-toolchain/arm-none-eabi/include/ar.h
  17. +33
    -0
      arm-none-eabi-toolchain/arm-none-eabi/include/argz.h
  18. +50
    -0
      arm-none-eabi-toolchain/arm-none-eabi/include/assert.h
  19. +68
    -0
      arm-none-eabi-toolchain/arm-none-eabi/include/c++/6.3.1/algorithm
  20. +40
    -0
      arm-none-eabi-toolchain/arm-none-eabi/include/c++/6.3.1/arm-none-eabi/bits/atomic_word.h
  21. +130
    -0
      arm-none-eabi-toolchain/arm-none-eabi/include/c++/6.3.1/arm-none-eabi/bits/basic_file.h
  22. +55
    -0
      arm-none-eabi-toolchain/arm-none-eabi/include/c++/6.3.1/arm-none-eabi/bits/c++allocator.h
  23. +1902
    -0
      arm-none-eabi-toolchain/arm-none-eabi/include/c++/6.3.1/arm-none-eabi/bits/c++config.h
  24. +50
    -0
      arm-none-eabi-toolchain/arm-none-eabi/include/c++/6.3.1/arm-none-eabi/bits/c++io.h
  25. +92
    -0
      arm-none-eabi-toolchain/arm-none-eabi/include/c++/6.3.1/arm-none-eabi/bits/c++locale.h
  26. +40
    -0
      arm-none-eabi-toolchain/arm-none-eabi/include/c++/6.3.1/arm-none-eabi/bits/cpu_defines.h
  27. +61
    -0
      arm-none-eabi-toolchain/arm-none-eabi/include/c++/6.3.1/arm-none-eabi/bits/ctype_base.h
  28. +74
    -0
      arm-none-eabi-toolchain/arm-none-eabi/include/c++/6.3.1/arm-none-eabi/bits/ctype_inline.h
  29. +82
    -0
      arm-none-eabi-toolchain/arm-none-eabi/include/c++/6.3.1/arm-none-eabi/bits/cxxabi_tweaks.h
  30. +178
    -0
      arm-none-eabi-toolchain/arm-none-eabi/include/c++/6.3.1/arm-none-eabi/bits/error_constants.h
  31. +84
    -0
      arm-none-eabi-toolchain/arm-none-eabi/include/c++/6.3.1/arm-none-eabi/bits/extc++.h
  32. +298
    -0
      arm-none-eabi-toolchain/arm-none-eabi/include/c++/6.3.1/arm-none-eabi/bits/gthr-default.h
  33. +889
    -0
      arm-none-eabi-toolchain/arm-none-eabi/include/c++/6.3.1/arm-none-eabi/bits/gthr-posix.h
  34. +298
    -0
      arm-none-eabi-toolchain/arm-none-eabi/include/c++/6.3.1/arm-none-eabi/bits/gthr-single.h
  35. +154
    -0
      arm-none-eabi-toolchain/arm-none-eabi/include/c++/6.3.1/arm-none-eabi/bits/gthr.h
  36. +92
    -0
      arm-none-eabi-toolchain/arm-none-eabi/include/c++/6.3.1/arm-none-eabi/bits/messages_members.h
  37. +38
    -0
      arm-none-eabi-toolchain/arm-none-eabi/include/c++/6.3.1/arm-none-eabi/bits/opt_random.h
  38. +61
    -0
      arm-none-eabi-toolchain/arm-none-eabi/include/c++/6.3.1/arm-none-eabi/bits/os_defines.h
  39. +123
    -0
      arm-none-eabi-toolchain/arm-none-eabi/include/c++/6.3.1/arm-none-eabi/bits/stdc++.h
  40. +53
    -0
      arm-none-eabi-toolchain/arm-none-eabi/include/c++/6.3.1/arm-none-eabi/bits/stdtr1c++.h
  41. +92
    -0
      arm-none-eabi-toolchain/arm-none-eabi/include/c++/6.3.1/arm-none-eabi/bits/time_members.h
  42. +38
    -0
      arm-none-eabi-toolchain/arm-none-eabi/include/c++/6.3.1/arm-none-eabi/ext/opt_random.h
  43. +40
    -0
      arm-none-eabi-toolchain/arm-none-eabi/include/c++/6.3.1/arm-none-eabi/hard/bits/atomic_word.h
  44. +130
    -0
      arm-none-eabi-toolchain/arm-none-eabi/include/c++/6.3.1/arm-none-eabi/hard/bits/basic_file.h
  45. +55
    -0
      arm-none-eabi-toolchain/arm-none-eabi/include/c++/6.3.1/arm-none-eabi/hard/bits/c++allocator.h
  46. +1902
    -0
      arm-none-eabi-toolchain/arm-none-eabi/include/c++/6.3.1/arm-none-eabi/hard/bits/c++config.h
  47. +50
    -0
      arm-none-eabi-toolchain/arm-none-eabi/include/c++/6.3.1/arm-none-eabi/hard/bits/c++io.h
  48. +92
    -0
      arm-none-eabi-toolchain/arm-none-eabi/include/c++/6.3.1/arm-none-eabi/hard/bits/c++locale.h
  49. +40
    -0
      arm-none-eabi-toolchain/arm-none-eabi/include/c++/6.3.1/arm-none-eabi/hard/bits/cpu_defines.h
  50. +61
    -0
      arm-none-eabi-toolchain/arm-none-eabi/include/c++/6.3.1/arm-none-eabi/hard/bits/ctype_base.h
  51. +74
    -0
      arm-none-eabi-toolchain/arm-none-eabi/include/c++/6.3.1/arm-none-eabi/hard/bits/ctype_inline.h
  52. +82
    -0
      arm-none-eabi-toolchain/arm-none-eabi/include/c++/6.3.1/arm-none-eabi/hard/bits/cxxabi_tweaks.h
  53. +178
    -0
      arm-none-eabi-toolchain/arm-none-eabi/include/c++/6.3.1/arm-none-eabi/hard/bits/error_constants.h
  54. +84
    -0
      arm-none-eabi-toolchain/arm-none-eabi/include/c++/6.3.1/arm-none-eabi/hard/bits/extc++.h
  55. +298
    -0
      arm-none-eabi-toolchain/arm-none-eabi/include/c++/6.3.1/arm-none-eabi/hard/bits/gthr-default.h
  56. +889
    -0
      arm-none-eabi-toolchain/arm-none-eabi/include/c++/6.3.1/arm-none-eabi/hard/bits/gthr-posix.h
  57. +298
    -0
      arm-none-eabi-toolchain/arm-none-eabi/include/c++/6.3.1/arm-none-eabi/hard/bits/gthr-single.h
  58. +154
    -0
      arm-none-eabi-toolchain/arm-none-eabi/include/c++/6.3.1/arm-none-eabi/hard/bits/gthr.h
  59. +92
    -0
      arm-none-eabi-toolchain/arm-none-eabi/include/c++/6.3.1/arm-none-eabi/hard/bits/messages_members.h
  60. +38
    -0
      arm-none-eabi-toolchain/arm-none-eabi/include/c++/6.3.1/arm-none-eabi/hard/bits/opt_random.h
  61. +61
    -0
      arm-none-eabi-toolchain/arm-none-eabi/include/c++/6.3.1/arm-none-eabi/hard/bits/os_defines.h
  62. +123
    -0
      arm-none-eabi-toolchain/arm-none-eabi/include/c++/6.3.1/arm-none-eabi/hard/bits/stdc++.h
  63. +53
    -0
      arm-none-eabi-toolchain/arm-none-eabi/include/c++/6.3.1/arm-none-eabi/hard/bits/stdtr1c++.h
  64. +92
    -0
      arm-none-eabi-toolchain/arm-none-eabi/include/c++/6.3.1/arm-none-eabi/hard/bits/time_members.h
  65. +38
    -0
      arm-none-eabi-toolchain/arm-none-eabi/include/c++/6.3.1/arm-none-eabi/hard/ext/opt_random.h
  66. +40
    -0
      arm-none-eabi-toolchain/arm-none-eabi/include/c++/6.3.1/arm-none-eabi/thumb/bits/atomic_word.h
  67. +130
    -0
      arm-none-eabi-toolchain/arm-none-eabi/include/c++/6.3.1/arm-none-eabi/thumb/bits/basic_file.h
  68. +55
    -0
      arm-none-eabi-toolchain/arm-none-eabi/include/c++/6.3.1/arm-none-eabi/thumb/bits/c++allocator.h
  69. +1902
    -0
      arm-none-eabi-toolchain/arm-none-eabi/include/c++/6.3.1/arm-none-eabi/thumb/bits/c++config.h
  70. +50
    -0
      arm-none-eabi-toolchain/arm-none-eabi/include/c++/6.3.1/arm-none-eabi/thumb/bits/c++io.h
  71. +92
    -0
      arm-none-eabi-toolchain/arm-none-eabi/include/c++/6.3.1/arm-none-eabi/thumb/bits/c++locale.h
  72. +40
    -0
      arm-none-eabi-toolchain/arm-none-eabi/include/c++/6.3.1/arm-none-eabi/thumb/bits/cpu_defines.h
  73. +61
    -0
      arm-none-eabi-toolchain/arm-none-eabi/include/c++/6.3.1/arm-none-eabi/thumb/bits/ctype_base.h
  74. +74
    -0
      arm-none-eabi-toolchain/arm-none-eabi/include/c++/6.3.1/arm-none-eabi/thumb/bits/ctype_inline.h
  75. +82
    -0
      arm-none-eabi-toolchain/arm-none-eabi/include/c++/6.3.1/arm-none-eabi/thumb/bits/cxxabi_tweaks.h
  76. +178
    -0
      arm-none-eabi-toolchain/arm-none-eabi/include/c++/6.3.1/arm-none-eabi/thumb/bits/error_constants.h
  77. +84
    -0
      arm-none-eabi-toolchain/arm-none-eabi/include/c++/6.3.1/arm-none-eabi/thumb/bits/extc++.h
  78. +298
    -0
      arm-none-eabi-toolchain/arm-none-eabi/include/c++/6.3.1/arm-none-eabi/thumb/bits/gthr-default.h
  79. +889
    -0
      arm-none-eabi-toolchain/arm-none-eabi/include/c++/6.3.1/arm-none-eabi/thumb/bits/gthr-posix.h
  80. +298
    -0
      arm-none-eabi-toolchain/arm-none-eabi/include/c++/6.3.1/arm-none-eabi/thumb/bits/gthr-single.h
  81. +154
    -0
      arm-none-eabi-toolchain/arm-none-eabi/include/c++/6.3.1/arm-none-eabi/thumb/bits/gthr.h
  82. +92
    -0
      arm-none-eabi-toolchain/arm-none-eabi/include/c++/6.3.1/arm-none-eabi/thumb/bits/messages_members.h
  83. +38
    -0
      arm-none-eabi-toolchain/arm-none-eabi/include/c++/6.3.1/arm-none-eabi/thumb/bits/opt_random.h
  84. +61
    -0
      arm-none-eabi-toolchain/arm-none-eabi/include/c++/6.3.1/arm-none-eabi/thumb/bits/os_defines.h
  85. +123
    -0
      arm-none-eabi-toolchain/arm-none-eabi/include/c++/6.3.1/arm-none-eabi/thumb/bits/stdc++.h
  86. +53
    -0
      arm-none-eabi-toolchain/arm-none-eabi/include/c++/6.3.1/arm-none-eabi/thumb/bits/stdtr1c++.h
  87. +92
    -0
      arm-none-eabi-toolchain/arm-none-eabi/include/c++/6.3.1/arm-none-eabi/thumb/bits/time_members.h
  88. +38
    -0
      arm-none-eabi-toolchain/arm-none-eabi/include/c++/6.3.1/arm-none-eabi/thumb/ext/opt_random.h
  89. +40
    -0
      arm-none-eabi-toolchain/arm-none-eabi/include/c++/6.3.1/arm-none-eabi/thumb/v6-m/bits/atomic_word.h
  90. +130
    -0
      arm-none-eabi-toolchain/arm-none-eabi/include/c++/6.3.1/arm-none-eabi/thumb/v6-m/bits/basic_file.h
  91. +55
    -0
      arm-none-eabi-toolchain/arm-none-eabi/include/c++/6.3.1/arm-none-eabi/thumb/v6-m/bits/c++allocator.h
  92. +1902
    -0
      arm-none-eabi-toolchain/arm-none-eabi/include/c++/6.3.1/arm-none-eabi/thumb/v6-m/bits/c++config.h
  93. +50
    -0
      arm-none-eabi-toolchain/arm-none-eabi/include/c++/6.3.1/arm-none-eabi/thumb/v6-m/bits/c++io.h
  94. +92
    -0
      arm-none-eabi-toolchain/arm-none-eabi/include/c++/6.3.1/arm-none-eabi/thumb/v6-m/bits/c++locale.h
  95. +40
    -0
      arm-none-eabi-toolchain/arm-none-eabi/include/c++/6.3.1/arm-none-eabi/thumb/v6-m/bits/cpu_defines.h
  96. +61
    -0
      arm-none-eabi-toolchain/arm-none-eabi/include/c++/6.3.1/arm-none-eabi/thumb/v6-m/bits/ctype_base.h
  97. +74
    -0
      arm-none-eabi-toolchain/arm-none-eabi/include/c++/6.3.1/arm-none-eabi/thumb/v6-m/bits/ctype_inline.h
  98. +82
    -0
      arm-none-eabi-toolchain/arm-none-eabi/include/c++/6.3.1/arm-none-eabi/thumb/v6-m/bits/cxxabi_tweaks.h
  99. +178
    -0
      arm-none-eabi-toolchain/arm-none-eabi/include/c++/6.3.1/arm-none-eabi/thumb/v6-m/bits/error_constants.h
  100. +84
    -0
      arm-none-eabi-toolchain/arm-none-eabi/include/c++/6.3.1/arm-none-eabi/thumb/v6-m/bits/extc++.h

+ 0
- 0
README.md View File


BIN
arm-none-eabi-toolchain/arm-none-eabi/bin/ar View File


BIN
arm-none-eabi-toolchain/arm-none-eabi/bin/as View File


BIN
arm-none-eabi-toolchain/arm-none-eabi/bin/ld View File


BIN
arm-none-eabi-toolchain/arm-none-eabi/bin/ld.bfd View File


BIN
arm-none-eabi-toolchain/arm-none-eabi/bin/nm View File


BIN
arm-none-eabi-toolchain/arm-none-eabi/bin/objcopy View File


BIN
arm-none-eabi-toolchain/arm-none-eabi/bin/objdump View File


BIN
arm-none-eabi-toolchain/arm-none-eabi/bin/ranlib View File


BIN
arm-none-eabi-toolchain/arm-none-eabi/bin/readelf View File


BIN
arm-none-eabi-toolchain/arm-none-eabi/bin/strip View File


+ 140
- 0
arm-none-eabi-toolchain/arm-none-eabi/include/_ansi.h View File

@@ -0,0 +1,140 @@
/* Provide support for both ANSI and non-ANSI environments. */

/* Some ANSI environments are "broken" in the sense that __STDC__ cannot be
relied upon to have it's intended meaning. Therefore we must use our own
concoction: _HAVE_STDC. Always use _HAVE_STDC instead of __STDC__ in newlib
sources!

To get a strict ANSI C environment, define macro __STRICT_ANSI__. This will
"comment out" the non-ANSI parts of the ANSI header files (non-ANSI header
files aren't affected). */

#ifndef _ANSIDECL_H_
#define _ANSIDECL_H_

#include <newlib.h>
#include <sys/config.h>

/* First try to figure out whether we really are in an ANSI C environment. */
/* FIXME: This probably needs some work. Perhaps sys/config.h can be
prevailed upon to give us a clue. */

#ifdef __STDC__
#define _HAVE_STDC
#endif

/* ISO C++. */

#ifdef __cplusplus
#if !(defined(_BEGIN_STD_C) && defined(_END_STD_C))
#ifdef _HAVE_STD_CXX
#define _BEGIN_STD_C namespace std { extern "C" {
#define _END_STD_C } }
#else
#define _BEGIN_STD_C extern "C" {
#define _END_STD_C }
#endif
#if __GNUC_PREREQ (3, 3)
#define _NOTHROW __attribute__ ((__nothrow__))
#else
#define _NOTHROW throw()
#endif
#endif
#else
#define _BEGIN_STD_C
#define _END_STD_C
#define _NOTHROW
#endif

#ifdef _HAVE_STDC
#define _PTR void *
#define _AND ,
#define _NOARGS void
#define _CONST const
#define _VOLATILE volatile
#define _SIGNED signed
#define _DOTS , ...
#define _VOID void
#ifdef __CYGWIN__
#define _EXFUN_NOTHROW(name, proto) __cdecl name proto _NOTHROW
#define _EXFUN(name, proto) __cdecl name proto
#define _EXPARM(name, proto) (* __cdecl name) proto
#define _EXFNPTR(name, proto) (__cdecl * name) proto
#else
#define _EXFUN_NOTHROW(name, proto) name proto _NOTHROW
#define _EXFUN(name, proto) name proto
#define _EXPARM(name, proto) (* name) proto
#define _EXFNPTR(name, proto) (* name) proto
#endif
#define _DEFUN(name, arglist, args) name(args)
#define _DEFUN_VOID(name) name(_NOARGS)
#define _CAST_VOID (void)
#ifndef _LONG_DOUBLE
#define _LONG_DOUBLE long double
#endif
#ifndef _PARAMS
#define _PARAMS(paramlist) paramlist
#endif
#else
#define _PTR char *
#define _AND ;
#define _NOARGS
#define _CONST
#define _VOLATILE
#define _SIGNED
#define _DOTS
#define _VOID void
#define _EXFUN(name, proto) name()
#define _EXFUN_NOTHROW(name, proto) name()
#define _DEFUN(name, arglist, args) name arglist args;
#define _DEFUN_VOID(name) name()
#define _CAST_VOID
#define _LONG_DOUBLE double
#ifndef _PARAMS
#define _PARAMS(paramlist) ()
#endif
#endif

/* Support gcc's __attribute__ facility. */

#ifdef __GNUC__
#define _ATTRIBUTE(attrs) __attribute__ (attrs)
#else
#define _ATTRIBUTE(attrs)
#endif

/* The traditional meaning of 'extern inline' for GCC is not
to emit the function body unless the address is explicitly
taken. However this behaviour is changing to match the C99
standard, which uses 'extern inline' to indicate that the
function body *must* be emitted. Likewise, a function declared
without either 'extern' or 'static' defaults to extern linkage
(C99 6.2.2p5), and the compiler may choose whether to use the
inline version or call the extern linkage version (6.7.4p6).
If we are using GCC, but do not have the new behaviour, we need
to use extern inline; if we are using a new GCC with the
C99-compatible behaviour, or a non-GCC compiler (which we will
have to hope is C99, since there is no other way to achieve the
effect of omitting the function if it isn't referenced) we use
'static inline', which c99 defines to mean more-or-less the same
as the Gnu C 'extern inline'. */
#if defined(__GNUC__) && !defined(__GNUC_STDC_INLINE__)
/* We're using GCC, but without the new C99-compatible behaviour. */
#define _ELIDABLE_INLINE extern __inline__ _ATTRIBUTE ((__always_inline__))
#else
/* We're using GCC in C99 mode, or an unknown compiler which
we just have to hope obeys the C99 semantics of inline. */
#define _ELIDABLE_INLINE static __inline__
#endif

#if __GNUC_PREREQ (3, 1)
#define _NOINLINE __attribute__ ((__noinline__))
#define _NOINLINE_STATIC _NOINLINE static
#else
/* On non-GNU compilers and GCC prior to version 3.1 the compiler can't be
trusted not to inline if it is static. */
#define _NOINLINE
#define _NOINLINE_STATIC
#endif

#endif /* _ANSIDECL_H_ */

+ 12
- 0
arm-none-eabi-toolchain/arm-none-eabi/include/_newlib_version.h View File

@@ -0,0 +1,12 @@
/* _newlib_version.h. Generated from _newlib_version.hin by configure. */
/* Version macros for internal and downstream use. */
#ifndef _NEWLIB_VERSION_H__
#define _NEWLIB_VERSION_H__ 1

#define _NEWLIB_VERSION "2.5.0"
#define __NEWLIB__ 2
#define __NEWLIB_MINOR__ 5
#define __NEWLIB_PATCHLEVEL__ 0

#endif /* !_NEWLIB_VERSION_H__ */


+ 40
- 0
arm-none-eabi-toolchain/arm-none-eabi/include/_syslist.h View File

@@ -0,0 +1,40 @@
/* internal use only -- mapping of "system calls" for libraries that lose
and only provide C names, so that we end up in violation of ANSI */
#ifndef __SYSLIST_H
#define __SYSLIST_H

#ifdef MISSING_SYSCALL_NAMES
#define _close close
#define _execve execve
#define _fcntl fcntl
#define _fork fork
#define _fstat fstat
#define _getpid getpid
#define _gettimeofday gettimeofday
#define _isatty isatty
#define _kill kill
#define _link link
#define _lseek lseek
#define _mkdir mkdir
#define _open open
#define _read read
#define _sbrk sbrk
#define _stat stat
#define _times times
#define _unlink unlink
#define _wait wait
#define _write write
#endif /* MISSING_SYSCALL_NAMES */

#if defined MISSING_SYSCALL_NAMES || !defined HAVE_OPENDIR
/* If the system call interface is missing opendir, readdir, and
closedir, there is an implementation of these functions in
libc/posix that is implemented using open, getdents, and close.
Note, these functions are currently not in the libc/syscalls
directory. */
#define _opendir opendir
#define _readdir readdir
#define _closedir closedir
#endif /* MISSING_SYSCALL_NAMES || !HAVE_OPENDIR */

#endif /* !__SYSLIST_H_ */

+ 21
- 0
arm-none-eabi-toolchain/arm-none-eabi/include/alloca.h View File

@@ -0,0 +1,21 @@
/* libc/include/alloca.h - Allocate memory on stack */

/* Written 2000 by Werner Almesberger */
/* Rearranged for general inclusion by stdlib.h.
2001, Corinna Vinschen <vinschen@redhat.com> */

#ifndef _NEWLIB_ALLOCA_H
#define _NEWLIB_ALLOCA_H

#include "_ansi.h"
#include <sys/reent.h>

#undef alloca

#ifdef __GNUC__
#define alloca(size) __builtin_alloca(size)
#else
void * _EXFUN(alloca,(size_t));
#endif

#endif

+ 69
- 0
arm-none-eabi-toolchain/arm-none-eabi/include/ar.h View File

@@ -0,0 +1,69 @@
/* $NetBSD: ar.h,v 1.4 1994/10/26 00:55:43 cgd Exp $ */

/*-
* Copyright (c) 1991, 1993
* The Regents of the University of California. All rights reserved.
* (c) UNIX System Laboratories, Inc.
* All or some portions of this file are derived from material licensed
* to the University of California by American Telephone and Telegraph
* Co. or Unix System Laboratories, Inc. and are reproduced herein with
* the permission of UNIX System Laboratories, Inc.
*
* This code is derived from software contributed to Berkeley by
* Hugh Smith at The University of Guelph.
*
* 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.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)ar.h 8.2 (Berkeley) 1/21/94
*/

#ifndef _AR_H_
#define _AR_H_

/* Pre-4BSD archives had these magic numbers in them. */
#define OARMAG1 0177555
#define OARMAG2 0177545

#define ARMAG "!<arch>\n" /* ar "magic number" */
#define SARMAG 8 /* strlen(ARMAG); */

#define AR_EFMT1 "#1/" /* extended format #1 */

struct ar_hdr {
char ar_name[16]; /* name */
char ar_date[12]; /* modification time */
char ar_uid[6]; /* user id */
char ar_gid[6]; /* group id */
char ar_mode[8]; /* octal file permissions */
char ar_size[10]; /* size in bytes */
#define ARFMAG "`\n"
char ar_fmag[2]; /* consistency check */
};

#endif /* !_AR_H_ */

+ 33
- 0
arm-none-eabi-toolchain/arm-none-eabi/include/argz.h View File

@@ -0,0 +1,33 @@
/* Copyright (C) 2002 by Red Hat, Incorporated. All rights reserved.
*
* Permission to use, copy, modify, and distribute this software
* is freely granted, provided that this notice is preserved.
*/

#ifndef _ARGZ_H_
#define _ARGZ_H_

#include <errno.h>
#include <sys/types.h>

#include "_ansi.h"

_BEGIN_STD_C

/* The newlib implementation of these functions assumes that sizeof(char) == 1. */
error_t argz_create (char *const argv[], char **argz, size_t *argz_len);
error_t argz_create_sep (const char *string, int sep, char **argz, size_t *argz_len);
size_t argz_count (const char *argz, size_t argz_len);
void argz_extract (char *argz, size_t argz_len, char **argv);
void argz_stringify (char *argz, size_t argz_len, int sep);
error_t argz_add (char **argz, size_t *argz_len, const char *str);
error_t argz_add_sep (char **argz, size_t *argz_len, const char *str, int sep);
error_t argz_append (char **argz, size_t *argz_len, const char *buf, size_t buf_len);
error_t argz_delete (char **argz, size_t *argz_len, char *entry);
error_t argz_insert (char **argz, size_t *argz_len, char *before, const char *entry);
char * argz_next (char *argz, size_t argz_len, const char *entry);
error_t argz_replace (char **argz, size_t *argz_len, const char *str, const char *with, unsigned *replace_count);

_END_STD_C

#endif /* _ARGZ_H_ */

+ 50
- 0
arm-none-eabi-toolchain/arm-none-eabi/include/assert.h View File

@@ -0,0 +1,50 @@
/*
assert.h
*/

#ifdef __cplusplus
extern "C" {
#endif

#include "_ansi.h"

#undef assert

#ifdef NDEBUG /* required by ANSI standard */
# define assert(__e) ((void)0)
#else
# define assert(__e) ((__e) ? (void)0 : __assert_func (__FILE__, __LINE__, \
__ASSERT_FUNC, #__e))

# ifndef __ASSERT_FUNC
/* Use g++'s demangled names in C++. */
# if defined __cplusplus && defined __GNUC__
# define __ASSERT_FUNC __PRETTY_FUNCTION__

/* C99 requires the use of __func__. */
# elif __STDC_VERSION__ >= 199901L
# define __ASSERT_FUNC __func__

/* Older versions of gcc don't have __func__ but can use __FUNCTION__. */
# elif __GNUC__ >= 2
# define __ASSERT_FUNC __FUNCTION__

/* failed to detect __func__ support. */
# else
# define __ASSERT_FUNC ((char *) 0)
# endif
# endif /* !__ASSERT_FUNC */
#endif /* !NDEBUG */

void _EXFUN(__assert, (const char *, int, const char *)
_ATTRIBUTE ((__noreturn__)));
void _EXFUN(__assert_func, (const char *, int, const char *, const char *)
_ATTRIBUTE ((__noreturn__)));

#if __STDC_VERSION__ >= 201112L && !defined __cplusplus
# define static_assert _Static_assert
#endif

#ifdef __cplusplus
}
#endif

+ 68
- 0
arm-none-eabi-toolchain/arm-none-eabi/include/c++/6.3.1/algorithm View File

@@ -0,0 +1,68 @@
// <algorithm> -*- C++ -*-

// Copyright (C) 2001-2016 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.

// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.

// Under Section 7 of GPL version 3, you are granted additional
// permissions described in the GCC Runtime Library Exception, version
// 3.1, as published by the Free Software Foundation.

// You should have received a copy of the GNU General Public License and
// a copy of the GCC Runtime Library Exception along with this program;
// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
// <http://www.gnu.org/licenses/>.

/*
*
* Copyright (c) 1994
* Hewlett-Packard Company
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Hewlett-Packard Company makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*
*
* Copyright (c) 1996,1997
* Silicon Graphics Computer Systems, Inc.
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Silicon Graphics makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*/

/** @file include/algorithm
* This is a Standard C++ Library header.
*/

#ifndef _GLIBCXX_ALGORITHM
#define _GLIBCXX_ALGORITHM 1

#pragma GCC system_header

#include <utility> // UK-300.
#include <bits/stl_algobase.h>
#include <bits/stl_algo.h>

#ifdef _GLIBCXX_PARALLEL
# include <parallel/algorithm>
#endif

#endif /* _GLIBCXX_ALGORITHM */

+ 40
- 0
arm-none-eabi-toolchain/arm-none-eabi/include/c++/6.3.1/arm-none-eabi/bits/atomic_word.h View File

@@ -0,0 +1,40 @@
// Low-level type for atomic operations -*- C++ -*-

// Copyright (C) 2004-2016 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.

// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.

// Under Section 7 of GPL version 3, you are granted additional
// permissions described in the GCC Runtime Library Exception, version
// 3.1, as published by the Free Software Foundation.

// You should have received a copy of the GNU General Public License and
// a copy of the GCC Runtime Library Exception along with this program;
// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
// <http://www.gnu.org/licenses/>.

/** @file atomic_word.h
* This file is a GNU extension to the Standard C++ Library.
*/

#ifndef _GLIBCXX_ATOMIC_WORD_H
#define _GLIBCXX_ATOMIC_WORD_H 1

typedef int _Atomic_word;


// This is a memory order acquire fence.
#define _GLIBCXX_READ_MEM_BARRIER __atomic_thread_fence (__ATOMIC_ACQUIRE)
// This is a memory order release fence.
#define _GLIBCXX_WRITE_MEM_BARRIER __atomic_thread_fence (__ATOMIC_RELEASE)

#endif

+ 130
- 0
arm-none-eabi-toolchain/arm-none-eabi/include/c++/6.3.1/arm-none-eabi/bits/basic_file.h View File

@@ -0,0 +1,130 @@
// Wrapper of C-language FILE struct -*- C++ -*-

// Copyright (C) 2000-2016 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.

// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.

// Under Section 7 of GPL version 3, you are granted additional
// permissions described in the GCC Runtime Library Exception, version
// 3.1, as published by the Free Software Foundation.

// You should have received a copy of the GNU General Public License and
// a copy of the GCC Runtime Library Exception along with this program;
// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
// <http://www.gnu.org/licenses/>.

//
// ISO C++ 14882: 27.8 File-based streams
//

/** @file bits/basic_file.h
* This is an internal header file, included by other library headers.
* Do not attempt to use it directly. @headername{ios}
*/

#ifndef _GLIBCXX_BASIC_FILE_STDIO_H
#define _GLIBCXX_BASIC_FILE_STDIO_H 1

#pragma GCC system_header

#include <bits/c++config.h>
#include <bits/c++io.h> // for __c_lock and __c_file
#include <bits/move.h> // for swap
#include <ios>

namespace std _GLIBCXX_VISIBILITY(default)
{
_GLIBCXX_BEGIN_NAMESPACE_VERSION

// Generic declaration.
template<typename _CharT>
class __basic_file;

// Specialization.
template<>
class __basic_file<char>
{
// Underlying data source/sink.
__c_file* _M_cfile;

// True iff we opened _M_cfile, and thus must close it ourselves.
bool _M_cfile_created;

public:
__basic_file(__c_lock* __lock = 0) throw ();

#if __cplusplus >= 201103L
__basic_file(__basic_file&& __rv, __c_lock* __lock = 0) noexcept
: _M_cfile(__rv._M_cfile), _M_cfile_created(__rv._M_cfile_created)
{
__rv._M_cfile = nullptr;
__rv._M_cfile_created = false;
}

__basic_file& operator=(const __basic_file&) = delete;
__basic_file& operator=(__basic_file&&) = delete;

void
swap(__basic_file& __f) noexcept
{
std::swap(_M_cfile, __f._M_cfile);
std::swap(_M_cfile_created, __f._M_cfile_created);
}
#endif

__basic_file*
open(const char* __name, ios_base::openmode __mode, int __prot = 0664);

__basic_file*
sys_open(__c_file* __file, ios_base::openmode);

__basic_file*
sys_open(int __fd, ios_base::openmode __mode) throw ();

__basic_file*
close();

_GLIBCXX_PURE bool
is_open() const throw ();

_GLIBCXX_PURE int
fd() throw ();

_GLIBCXX_PURE __c_file*
file() throw ();

~__basic_file();

streamsize
xsputn(const char* __s, streamsize __n);

streamsize
xsputn_2(const char* __s1, streamsize __n1,
const char* __s2, streamsize __n2);

streamsize
xsgetn(char* __s, streamsize __n);

streamoff
seekoff(streamoff __off, ios_base::seekdir __way) throw ();

int
sync();

streamsize
showmanyc();
};

_GLIBCXX_END_NAMESPACE_VERSION
} // namespace

#endif

+ 55
- 0
arm-none-eabi-toolchain/arm-none-eabi/include/c++/6.3.1/arm-none-eabi/bits/c++allocator.h View File

@@ -0,0 +1,55 @@
// Base to std::allocator -*- C++ -*-

// Copyright (C) 2004-2016 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.

// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.

// Under Section 7 of GPL version 3, you are granted additional
// permissions described in the GCC Runtime Library Exception, version
// 3.1, as published by the Free Software Foundation.

// You should have received a copy of the GNU General Public License and
// a copy of the GCC Runtime Library Exception along with this program;
// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
// <http://www.gnu.org/licenses/>.

/** @file bits/c++allocator.h
* This is an internal header file, included by other library headers.
* Do not attempt to use it directly. @headername{memory}
*/

#ifndef _GLIBCXX_CXX_ALLOCATOR_H
#define _GLIBCXX_CXX_ALLOCATOR_H 1

#include <ext/new_allocator.h>

#if __cplusplus >= 201103L
namespace std
{
/**
* @brief An alias to the base class for std::allocator.
* @ingroup allocators
*
* Used to set the std::allocator base class to
* __gnu_cxx::new_allocator.
*
* @tparam _Tp Type of allocated object.
*/
template<typename _Tp>
using __allocator_base = __gnu_cxx::new_allocator<_Tp>;
}
#else
// Define new_allocator as the base class to std::allocator.
# define __allocator_base __gnu_cxx::new_allocator
#endif

#endif

+ 1902
- 0
arm-none-eabi-toolchain/arm-none-eabi/include/c++/6.3.1/arm-none-eabi/bits/c++config.h
File diff suppressed because it is too large
View File


+ 50
- 0
arm-none-eabi-toolchain/arm-none-eabi/include/c++/6.3.1/arm-none-eabi/bits/c++io.h View File

@@ -0,0 +1,50 @@
// Underlying io library details -*- C++ -*-

// Copyright (C) 2000-2016 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.

// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.

// Under Section 7 of GPL version 3, you are granted additional
// permissions described in the GCC Runtime Library Exception, version
// 3.1, as published by the Free Software Foundation.

// You should have received a copy of the GNU General Public License and
// a copy of the GCC Runtime Library Exception along with this program;
// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
// <http://www.gnu.org/licenses/>.

/** @file bits/c++io.h
* This is an internal header file, included by other library headers.
* Do not attempt to use it directly. @headername{ios}
*/

// c_io_stdio.h - Defines for using "C" stdio.h

#ifndef _GLIBCXX_CXX_IO_H
#define _GLIBCXX_CXX_IO_H 1

#include <cstdio>
#include <bits/gthr.h>

namespace std _GLIBCXX_VISIBILITY(default)
{
_GLIBCXX_BEGIN_NAMESPACE_VERSION

typedef __gthread_mutex_t __c_lock;

// for basic_file.h
typedef FILE __c_file;

_GLIBCXX_END_NAMESPACE_VERSION
} // namespace

#endif

+ 92
- 0
arm-none-eabi-toolchain/arm-none-eabi/include/c++/6.3.1/arm-none-eabi/bits/c++locale.h View File

@@ -0,0 +1,92 @@
// Wrapper for underlying C-language localization -*- C++ -*-

// Copyright (C) 2001-2016 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.

// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.

// Under Section 7 of GPL version 3, you are granted additional
// permissions described in the GCC Runtime Library Exception, version
// 3.1, as published by the Free Software Foundation.

// You should have received a copy of the GNU General Public License and
// a copy of the GCC Runtime Library Exception along with this program;
// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
// <http://www.gnu.org/licenses/>.

/** @file bits/c++locale.h
* This is an internal header file, included by other library headers.
* Do not attempt to use it directly. @headername{locale}
*/

//
// ISO C++ 14882: 22.8 Standard locale categories.
//

// Written by Benjamin Kosnik <bkoz@redhat.com>

#ifndef _GLIBCXX_CXX_LOCALE_H
#define _GLIBCXX_CXX_LOCALE_H 1

#pragma GCC system_header

#include <clocale>

#define _GLIBCXX_NUM_CATEGORIES 0

namespace std _GLIBCXX_VISIBILITY(default)
{
_GLIBCXX_BEGIN_NAMESPACE_VERSION

typedef int* __c_locale;

// Convert numeric value of type double and long double to string and
// return length of string. If vsnprintf is available use it, otherwise
// fall back to the unsafe vsprintf which, in general, can be dangerous
// and should be avoided.
inline int
__convert_from_v(const __c_locale&, char* __out,
const int __size __attribute__((__unused__)),
const char* __fmt, ...)
{
char* __old = std::setlocale(LC_NUMERIC, 0);
char* __sav = 0;
if (__builtin_strcmp(__old, "C"))
{
const size_t __len = __builtin_strlen(__old) + 1;
__sav = new char[__len];
__builtin_memcpy(__sav, __old, __len);
std::setlocale(LC_NUMERIC, "C");
}

__builtin_va_list __args;
__builtin_va_start(__args, __fmt);

#if _GLIBCXX_USE_C99_STDIO
const int __ret = __builtin_vsnprintf(__out, __size, __fmt, __args);
#else
const int __ret = __builtin_vsprintf(__out, __fmt, __args);
#endif

__builtin_va_end(__args);

if (__sav)
{
std::setlocale(LC_NUMERIC, __sav);
delete [] __sav;
}
return __ret;
}

_GLIBCXX_END_NAMESPACE_VERSION
} // namespace

#endif

+ 40
- 0
arm-none-eabi-toolchain/arm-none-eabi/include/c++/6.3.1/arm-none-eabi/bits/cpu_defines.h View File

@@ -0,0 +1,40 @@
// Specific definitions for generic platforms -*- C++ -*-

// Copyright (C) 2015-2016 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.

// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.

// Under Section 7 of GPL version 3, you are granted additional
// permissions described in the GCC Runtime Library Exception, version
// 3.1, as published by the Free Software Foundation.

// You should have received a copy of the GNU General Public License and
// a copy of the GCC Runtime Library Exception along with this program;
// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
// <http://www.gnu.org/licenses/>.

/** @file bits/cpu_defines.h
* This is an internal header file, included by other library headers.
* Do not attempt to use it directly. @headername{iosfwd}
*/

#ifndef _GLIBCXX_CPU_DEFINES
#define _GLIBCXX_CPU_DEFINES 1

// Integer divide instructions don't trap on ARM.
#ifdef __ARM_ARCH_EXT_IDIV__
#define __glibcxx_integral_traps false
#else
#define __glibcxx_integral_traps true
#endif

#endif

+ 61
- 0
arm-none-eabi-toolchain/arm-none-eabi/include/c++/6.3.1/arm-none-eabi/bits/ctype_base.h View File

@@ -0,0 +1,61 @@
// Locale support -*- C++ -*-

// Copyright (C) 2000-2016 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.

// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.

// Under Section 7 of GPL version 3, you are granted additional
// permissions described in the GCC Runtime Library Exception, version
// 3.1, as published by the Free Software Foundation.

// You should have received a copy of the GNU General Public License and
// a copy of the GCC Runtime Library Exception along with this program;
// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
// <http://www.gnu.org/licenses/>.

//
// ISO C++ 14882: 22.1 Locales
//
// Information as gleaned from /usr/include/ctype.h

namespace std _GLIBCXX_VISIBILITY(default)
{
_GLIBCXX_BEGIN_NAMESPACE_VERSION

/// @brief Base class for ctype.
struct ctype_base
{
// Non-standard typedefs.
typedef const int* __to_type;

// NB: Offsets into ctype<char>::_M_table force a particular size
// on the mask type. Because of this, we don't use an enum.
typedef char mask;
static const mask upper = _U;
static const mask lower = _L;
static const mask alpha = _U | _L;
static const mask digit = _N;
static const mask xdigit = _X | _N;
static const mask space = _S;
static const mask print = _P | _U | _L | _N | _B;
static const mask graph = _P | _U | _L | _N;
static const mask cntrl = _C;
static const mask punct = _P;
static const mask alnum = _U | _L | _N;
#if __cplusplus >= 201103L
static const mask blank = space;
#endif
};

_GLIBCXX_END_NAMESPACE_VERSION
} // namespace

+ 74
- 0
arm-none-eabi-toolchain/arm-none-eabi/include/c++/6.3.1/arm-none-eabi/bits/ctype_inline.h View File

@@ -0,0 +1,74 @@
// Locale support -*- C++ -*-

// Copyright (C) 2000-2016 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.

// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.

// Under Section 7 of GPL version 3, you are granted additional
// permissions described in the GCC Runtime Library Exception, version
// 3.1, as published by the Free Software Foundation.

// You should have received a copy of the GNU General Public License and
// a copy of the GCC Runtime Library Exception along with this program;
// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
// <http://www.gnu.org/licenses/>.

/** @file bits/ctype_inline.h
* This is an internal header file, included by other library headers.
* Do not attempt to use it directly. @headername{locale}
*/

//
// ISO C++ 14882: 22.1 Locales
//

// ctype bits to be inlined go here. Non-inlinable (ie virtual do_*)
// functions go in ctype.cc

namespace std _GLIBCXX_VISIBILITY(default)
{
_GLIBCXX_BEGIN_NAMESPACE_VERSION

bool
ctype<char>::
is(mask __m, char __c) const
{ return _M_table[static_cast<unsigned char>(__c)] & __m; }

const char*
ctype<char>::
is(const char* __low, const char* __high, mask* __vec) const
{
while (__low < __high)
*__vec++ = _M_table[static_cast<unsigned char>(*__low++)];
return __high;
}

const char*
ctype<char>::
scan_is(mask __m, const char* __low, const char* __high) const
{
while (__low < __high && !this->is(__m, *__low))
++__low;
return __low;
}

const char*
ctype<char>::
scan_not(mask __m, const char* __low, const char* __high) const
{
while (__low < __high && this->is(__m, *__low) != 0)
++__low;
return __low;
}

_GLIBCXX_END_NAMESPACE_VERSION
} // namespace

+ 82
- 0
arm-none-eabi-toolchain/arm-none-eabi/include/c++/6.3.1/arm-none-eabi/bits/cxxabi_tweaks.h View File

@@ -0,0 +1,82 @@
// Control various target specific ABI tweaks. ARM version.

// Copyright (C) 2004-2016 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.

// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.

// Under Section 7 of GPL version 3, you are granted additional
// permissions described in the GCC Runtime Library Exception, version
// 3.1, as published by the Free Software Foundation.

// You should have received a copy of the GNU General Public License and
// a copy of the GCC Runtime Library Exception along with this program;
// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
// <http://www.gnu.org/licenses/>.

/** @file bits/cxxabi_tweaks.h
* This is an internal header file, included by other library headers.
* Do not attempt to use it directly. @headername{cxxabi.h}
*/

#ifndef _CXXABI_TWEAKS_H
#define _CXXABI_TWEAKS_H 1

#ifdef __cplusplus
namespace __cxxabiv1
{
extern "C"
{
#endif

#ifdef __ARM_EABI__
// The ARM EABI uses the least significant bit of a 32-bit
// guard variable. */
#define _GLIBCXX_GUARD_TEST(x) ((*(x) & 1) != 0)
#define _GLIBCXX_GUARD_SET(x) *(x) = 1
#define _GLIBCXX_GUARD_BIT 1
#define _GLIBCXX_GUARD_PENDING_BIT __guard_test_bit (1, 1)
#define _GLIBCXX_GUARD_WAITING_BIT __guard_test_bit (2, 1)
typedef int __guard;

// We also want the element size in array cookies.
#define _GLIBCXX_ELTSIZE_IN_COOKIE 1
// __cxa_vec_ctor should return a pointer to the array.
typedef void * __cxa_vec_ctor_return_type;
#define _GLIBCXX_CXA_VEC_CTOR_RETURN(x) return x
// Constructors and destructors return the "this" pointer.
typedef void * __cxa_cdtor_return_type;

#else // __ARM_EABI__

// The generic ABI uses the first byte of a 64-bit guard variable.
#define _GLIBCXX_GUARD_TEST(x) (*(char *) (x) != 0)
#define _GLIBCXX_GUARD_SET(x) *(char *) (x) = 1
#define _GLIBCXX_GUARD_BIT __guard_test_bit (0, 1)
#define _GLIBCXX_GUARD_PENDING_BIT __guard_test_bit (1, 1)
#define _GLIBCXX_GUARD_WAITING_BIT __guard_test_bit (2, 1)
__extension__ typedef int __guard __attribute__((mode (__DI__)));

// __cxa_vec_ctor has void return type.
typedef void __cxa_vec_ctor_return_type;
#define _GLIBCXX_CXA_VEC_CTOR_RETURN(x) return
// Constructors and destructors do not return a value.
typedef void __cxa_cdtor_return_type;

#endif //!__ARM_EABI__

#ifdef __cplusplus
}
} // namespace __cxxabiv1
#endif

#endif

+ 178
- 0
arm-none-eabi-toolchain/arm-none-eabi/include/c++/6.3.1/arm-none-eabi/bits/error_constants.h View File

@@ -0,0 +1,178 @@
// Specific definitions for generic platforms -*- C++ -*-

// Copyright (C) 2007-2016 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.

// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.

// Under Section 7 of GPL version 3, you are granted additional
// permissions described in the GCC Runtime Library Exception, version
// 3.1, as published by the Free Software Foundation.

// You should have received a copy of the GNU General Public License and
// a copy of the GCC Runtime Library Exception along with this program;
// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
// <http://www.gnu.org/licenses/>.

/** @file bits/error_constants.h
* This is an internal header file, included by other library headers.
* Do not attempt to use it directly. @headername{system_error}
*/

#ifndef _GLIBCXX_ERROR_CONSTANTS
#define _GLIBCXX_ERROR_CONSTANTS 1

#include <bits/c++config.h>
#include <cerrno>

namespace std _GLIBCXX_VISIBILITY(default)
{
_GLIBCXX_BEGIN_NAMESPACE_VERSION

enum class errc
{
address_family_not_supported = EAFNOSUPPORT,
address_in_use = EADDRINUSE,
address_not_available = EADDRNOTAVAIL,
already_connected = EISCONN,
argument_list_too_long = E2BIG,
argument_out_of_domain = EDOM,
bad_address = EFAULT,
bad_file_descriptor = EBADF,

#ifdef _GLIBCXX_HAVE_EBADMSG
bad_message = EBADMSG,
#endif

broken_pipe = EPIPE,
connection_aborted = ECONNABORTED,
connection_already_in_progress = EALREADY,
connection_refused = ECONNREFUSED,
connection_reset = ECONNRESET,
cross_device_link = EXDEV,
destination_address_required = EDESTADDRREQ,
device_or_resource_busy = EBUSY,
directory_not_empty = ENOTEMPTY,
executable_format_error = ENOEXEC,
file_exists = EEXIST,
file_too_large = EFBIG,
filename_too_long = ENAMETOOLONG,
function_not_supported = ENOSYS,
host_unreachable = EHOSTUNREACH,

#ifdef _GLIBCXX_HAVE_EIDRM
identifier_removed = EIDRM,
#endif

illegal_byte_sequence = EILSEQ,
inappropriate_io_control_operation = ENOTTY,
interrupted = EINTR,
invalid_argument = EINVAL,
invalid_seek = ESPIPE,
io_error = EIO,
is_a_directory = EISDIR,
message_size = EMSGSIZE,
network_down = ENETDOWN,
network_reset = ENETRESET,
network_unreachable = ENETUNREACH,
no_buffer_space = ENOBUFS,
no_child_process = ECHILD,

#ifdef _GLIBCXX_HAVE_ENOLINK
no_link = ENOLINK,
#endif

no_lock_available = ENOLCK,

#ifdef _GLIBCXX_HAVE_ENODATA
no_message_available = ENODATA,
#endif

no_message = ENOMSG,
no_protocol_option = ENOPROTOOPT,
no_space_on_device = ENOSPC,

#ifdef _GLIBCXX_HAVE_ENOSR
no_stream_resources = ENOSR,
#endif

no_such_device_or_address = ENXIO,
no_such_device = ENODEV,
no_such_file_or_directory = ENOENT,
no_such_process = ESRCH,
not_a_directory = ENOTDIR,
not_a_socket = ENOTSOCK,

#ifdef _GLIBCXX_HAVE_ENOSTR
not_a_stream = ENOSTR,
#endif

not_connected = ENOTCONN,
not_enough_memory = ENOMEM,

#ifdef _GLIBCXX_HAVE_ENOTSUP
not_supported = ENOTSUP,
#endif

#ifdef _GLIBCXX_HAVE_ECANCELED
operation_canceled = ECANCELED,
#endif

operation_in_progress = EINPROGRESS,
operation_not_permitted = EPERM,
operation_not_supported = EOPNOTSUPP,
operation_would_block = EWOULDBLOCK,

#ifdef _GLIBCXX_HAVE_EOWNERDEAD
owner_dead = EOWNERDEAD,
#endif

permission_denied = EACCES,

#ifdef _GLIBCXX_HAVE_EPROTO
protocol_error = EPROTO,
#endif

protocol_not_supported = EPROTONOSUPPORT,
read_only_file_system = EROFS,
resource_deadlock_would_occur = EDEADLK,
resource_unavailable_try_again = EAGAIN,
result_out_of_range = ERANGE,

#ifdef _GLIBCXX_HAVE_ENOTRECOVERABLE
state_not_recoverable = ENOTRECOVERABLE,
#endif

#ifdef _GLIBCXX_HAVE_ETIME
stream_timeout = ETIME,
#endif

#ifdef _GLIBCXX_HAVE_ETXTBSY
text_file_busy = ETXTBSY,
#endif

timed_out = ETIMEDOUT,
too_many_files_open_in_system = ENFILE,
too_many_files_open = EMFILE,
too_many_links = EMLINK,
too_many_symbolic_link_levels = ELOOP,

#ifdef _GLIBCXX_HAVE_EOVERFLOW
value_too_large = EOVERFLOW,
#endif

wrong_protocol_type = EPROTOTYPE
};

_GLIBCXX_END_NAMESPACE_VERSION
} // namespace

#endif

+ 84
- 0
arm-none-eabi-toolchain/arm-none-eabi/include/c++/6.3.1/arm-none-eabi/bits/extc++.h View File

@@ -0,0 +1,84 @@
// C++ includes used for precompiling extensions -*- C++ -*-

// Copyright (C) 2006-2016 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.

// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.

// Under Section 7 of GPL version 3, you are granted additional
// permissions described in the GCC Runtime Library Exception, version
// 3.1, as published by the Free Software Foundation.

// You should have received a copy of the GNU General Public License and
// a copy of the GCC Runtime Library Exception along with this program;
// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
// <http://www.gnu.org/licenses/>.

/** @file extc++.h
* This is an implementation file for a precompiled header.
*/

#if __cplusplus < 201103L
#include <bits/stdtr1c++.h>
#else
#include <bits/stdc++.h>
#endif

#include <ext/algorithm>
#if __cplusplus >= 201103L
# include <ext/aligned_buffer.h>
#endif
#include <ext/alloc_traits.h>
#include <ext/array_allocator.h>
#include <ext/atomicity.h>
#include <ext/bitmap_allocator.h>
#include <ext/cast.h>
#if __cplusplus >= 201103L
# include <ext/cmath>
#endif
#include <ext/concurrence.h>
#include <ext/debug_allocator.h>
#include <ext/extptr_allocator.h>
#include <ext/functional>
#include <ext/iterator>
#include <ext/malloc_allocator.h>
#include <ext/memory>
#include <ext/mt_allocator.h>
#include <ext/new_allocator.h>
#include <ext/numeric>
#include <ext/numeric_traits.h>
#include <ext/pod_char_traits.h>
#include <ext/pointer.h>
#include <ext/pool_allocator.h>
#if __cplusplus >= 201103L
# include <ext/random>
#endif
#include <ext/rb_tree>
#include <ext/rope>
#include <ext/slist>
#include <ext/stdio_filebuf.h>
#include <ext/stdio_sync_filebuf.h>
#include <ext/throw_allocator.h>
#include <ext/typelist.h>
#include <ext/type_traits.h>
#include <ext/vstring.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/priority_queue.hpp>
#include <ext/pb_ds/exception.hpp>
#include <ext/pb_ds/hash_policy.hpp>
#include <ext/pb_ds/list_update_policy.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/trie_policy.hpp>

#ifdef _GLIBCXX_HAVE_ICONV
#include <ext/codecvt_specializations.h>
#include <ext/enc_filebuf.h>
#endif

+ 298
- 0
arm-none-eabi-toolchain/arm-none-eabi/include/c++/6.3.1/arm-none-eabi/bits/gthr-default.h View File

@@ -0,0 +1,298 @@
/* Threads compatibility routines for libgcc2 and libobjc. */
/* Compile this one with gcc. */
/* Copyright (C) 1997-2016 Free Software Foundation, Inc.

This file is part of GCC.

GCC is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation; either version 3, or (at your option) any later
version.

GCC is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.

Under Section 7 of GPL version 3, you are granted additional
permissions described in the GCC Runtime Library Exception, version
3.1, as published by the Free Software Foundation.

You should have received a copy of the GNU General Public License and
a copy of the GCC Runtime Library Exception along with this program;
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
<http://www.gnu.org/licenses/>. */

#ifndef _GLIBCXX_GCC_GTHR_SINGLE_H
#define _GLIBCXX_GCC_GTHR_SINGLE_H

/* Just provide compatibility for mutex handling. */

typedef int __gthread_key_t;
typedef int __gthread_once_t;
typedef int __gthread_mutex_t;
typedef int __gthread_recursive_mutex_t;

#define __GTHREAD_ONCE_INIT 0
#define __GTHREAD_MUTEX_INIT 0
#define __GTHREAD_MUTEX_INIT_FUNCTION(mx) do {} while (0)
#define __GTHREAD_RECURSIVE_MUTEX_INIT 0

#define _GLIBCXX_UNUSED __attribute__((__unused__))

#ifdef _LIBOBJC

/* Thread local storage for a single thread */
static void *thread_local_storage = NULL;

/* Backend initialization functions */

/* Initialize the threads subsystem. */
static inline int
__gthread_objc_init_thread_system (void)
{
/* No thread support available */
return -1;
}

/* Close the threads subsystem. */
static inline int
__gthread_objc_close_thread_system (void)
{
/* No thread support available */
return -1;
}

/* Backend thread functions */

/* Create a new thread of execution. */
static inline objc_thread_t
__gthread_objc_thread_detach (void (* func)(void *), void * arg _GLIBCXX_UNUSED)
{
/* No thread support available */
return NULL;
}

/* Set the current thread's priority. */
static inline int
__gthread_objc_thread_set_priority (int priority _GLIBCXX_UNUSED)
{
/* No thread support available */
return -1;
}

/* Return the current thread's priority. */
static inline int
__gthread_objc_thread_get_priority (void)
{
return OBJC_THREAD_INTERACTIVE_PRIORITY;
}

/* Yield our process time to another thread. */
static inline void
__gthread_objc_thread_yield (void)
{
return;
}

/* Terminate the current thread. */
static inline int
__gthread_objc_thread_exit (void)
{
/* No thread support available */
/* Should we really exit the program */
/* exit (&__objc_thread_exit_status); */
return -1;
}

/* Returns an integer value which uniquely describes a thread. */
static inline objc_thread_t
__gthread_objc_thread_id (void)
{
/* No thread support, use 1. */
return (objc_thread_t) 1;
}

/* Sets the thread's local storage pointer. */
static inline int
__gthread_objc_thread_set_data (void *value)
{
thread_local_storage = value;
return 0;
}

/* Returns the thread's local storage pointer. */
static inline void *
__gthread_objc_thread_get_data (void)
{
return thread_local_storage;
}

/* Backend mutex functions */

/* Allocate a mutex. */
static inline int
__gthread_objc_mutex_allocate (objc_mutex_t mutex _GLIBCXX_UNUSED)
{
return 0;
}

/* Deallocate a mutex. */
static inline int
__gthread_objc_mutex_deallocate (objc_mutex_t mutex _GLIBCXX_UNUSED)
{
return 0;
}

/* Grab a lock on a mutex. */
static inline int
__gthread_objc_mutex_lock (objc_mutex_t mutex _GLIBCXX_UNUSED)
{
/* There can only be one thread, so we always get the lock */
return 0;
}

/* Try to grab a lock on a mutex. */
static inline int
__gthread_objc_mutex_trylock (objc_mutex_t mutex _GLIBCXX_UNUSED)
{
/* There can only be one thread, so we always get the lock */
return 0;
}

/* Unlock the mutex */
static inline int
__gthread_objc_mutex_unlock (objc_mutex_t mutex _GLIBCXX_UNUSED)
{
return 0;
}

/* Backend condition mutex functions */

/* Allocate a condition. */
static inline int
__gthread_objc_condition_allocate (objc_condition_t condition _GLIBCXX_UNUSED)
{
return 0;
}

/* Deallocate a condition. */
static inline int
__gthread_objc_condition_deallocate (objc_condition_t condition _GLIBCXX_UNUSED)
{
return 0;
}

/* Wait on the condition */
static inline int
__gthread_objc_condition_wait (objc_condition_t condition _GLIBCXX_UNUSED,
objc_mutex_t mutex _GLIBCXX_UNUSED)
{
return 0;
}

/* Wake up all threads waiting on this condition. */
static inline int
__gthread_objc_condition_broadcast (objc_condition_t condition _GLIBCXX_UNUSED)
{
return 0;
}

/* Wake up one thread waiting on this condition. */
static inline int
__gthread_objc_condition_signal (objc_condition_t condition _GLIBCXX_UNUSED)
{
return 0;
}

#else /* _LIBOBJC */

static inline int
__gthread_active_p (void)
{
return 0;
}

static inline int
__gthread_once (__gthread_once_t *__once _GLIBCXX_UNUSED, void (*__func) (void) _GLIBCXX_UNUSED)
{
return 0;
}

static inline int _GLIBCXX_UNUSED
__gthread_key_create (__gthread_key_t *__key _GLIBCXX_UNUSED, void (*__func) (void *) _GLIBCXX_UNUSED)
{
return 0;
}

static int _GLIBCXX_UNUSED
__gthread_key_delete (__gthread_key_t __key _GLIBCXX_UNUSED)
{
return 0;
}

static inline void *
__gthread_getspecific (__gthread_key_t __key _GLIBCXX_UNUSED)
{
return 0;
}

static inline int
__gthread_setspecific (__gthread_key_t __key _GLIBCXX_UNUSED, const void *__v _GLIBCXX_UNUSED)
{
return 0;
}

static inline int
__gthread_mutex_destroy (__gthread_mutex_t *__mutex _GLIBCXX_UNUSED)
{
return 0;
}

static inline int
__gthread_mutex_lock (__gthread_mutex_t *__mutex _GLIBCXX_UNUSED)
{
return 0;
}

static inline int
__gthread_mutex_trylock (__gthread_mutex_t *__mutex _GLIBCXX_UNUSED)
{
return 0;
}

static inline int
__gthread_mutex_unlock (__gthread_mutex_t *__mutex _GLIBCXX_UNUSED)
{
return 0;
}

static inline int
__gthread_recursive_mutex_lock (__gthread_recursive_mutex_t *__mutex)
{
return __gthread_mutex_lock (__mutex);
}

static inline int
__gthread_recursive_mutex_trylock (__gthread_recursive_mutex_t *__mutex)
{
return __gthread_mutex_trylock (__mutex);
}

static inline int
__gthread_recursive_mutex_unlock (__gthread_recursive_mutex_t *__mutex)
{
return __gthread_mutex_unlock (__mutex);
}

static inline int
__gthread_recursive_mutex_destroy (__gthread_recursive_mutex_t *__mutex)
{
return __gthread_mutex_destroy (__mutex);
}

#endif /* _LIBOBJC */

#undef _GLIBCXX_UNUSED

#endif /* ! _GLIBCXX_GCC_GTHR_SINGLE_H */

+ 889
- 0
arm-none-eabi-toolchain/arm-none-eabi/include/c++/6.3.1/arm-none-eabi/bits/gthr-posix.h View File

@@ -0,0 +1,889 @@
/* Threads compatibility routines for libgcc2 and libobjc. */
/* Compile this one with gcc. */
/* Copyright (C) 1997-2016 Free Software Foundation, Inc.

This file is part of GCC.

GCC is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation; either version 3, or (at your option) any later
version.

GCC is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.

Under Section 7 of GPL version 3, you are granted additional
permissions described in the GCC Runtime Library Exception, version
3.1, as published by the Free Software Foundation.

You should have received a copy of the GNU General Public License and
a copy of the GCC Runtime Library Exception along with this program;
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
<http://www.gnu.org/licenses/>. */

#ifndef _GLIBCXX_GCC_GTHR_POSIX_H
#define _GLIBCXX_GCC_GTHR_POSIX_H

/* POSIX threads specific definitions.
Easy, since the interface is just one-to-one mapping. */

#define __GTHREADS 1
#define __GTHREADS_CXX0X 1

#include <pthread.h>

#if ((defined(_LIBOBJC) || defined(_LIBOBJC_WEAK)) \
|| !defined(_GTHREAD_USE_MUTEX_TIMEDLOCK))
# include <unistd.h>
# if defined(_POSIX_TIMEOUTS) && _POSIX_TIMEOUTS >= 0
# define _GTHREAD_USE_MUTEX_TIMEDLOCK 1
# else
# define _GTHREAD_USE_MUTEX_TIMEDLOCK 0
# endif
#endif

typedef pthread_t __gthread_t;
typedef pthread_key_t __gthread_key_t;
typedef pthread_once_t __gthread_once_t;
typedef pthread_mutex_t __gthread_mutex_t;
typedef pthread_mutex_t __gthread_recursive_mutex_t;
typedef pthread_cond_t __gthread_cond_t;
typedef struct timespec __gthread_time_t;

/* POSIX like conditional variables are supported. Please look at comments
in gthr.h for details. */
#define __GTHREAD_HAS_COND 1

#define __GTHREAD_MUTEX_INIT PTHREAD_MUTEX_INITIALIZER
#define __GTHREAD_MUTEX_INIT_FUNCTION __gthread_mutex_init_function
#define __GTHREAD_ONCE_INIT PTHREAD_ONCE_INIT
#if defined(PTHREAD_RECURSIVE_MUTEX_INITIALIZER)
#define __GTHREAD_RECURSIVE_MUTEX_INIT PTHREAD_RECURSIVE_MUTEX_INITIALIZER
#elif defined(PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP)
#define __GTHREAD_RECURSIVE_MUTEX_INIT PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP
#else
#define __GTHREAD_RECURSIVE_MUTEX_INIT_FUNCTION __gthread_recursive_mutex_init_function
#endif
#define __GTHREAD_COND_INIT PTHREAD_COND_INITIALIZER
#define __GTHREAD_TIME_INIT {0,0}

#ifdef _GTHREAD_USE_MUTEX_INIT_FUNC
# undef __GTHREAD_MUTEX_INIT
#endif
#ifdef _GTHREAD_USE_RECURSIVE_MUTEX_INIT_FUNC
# undef __GTHREAD_RECURSIVE_MUTEX_INIT
# undef __GTHREAD_RECURSIVE_MUTEX_INIT_FUNCTION
# define __GTHREAD_RECURSIVE_MUTEX_INIT_FUNCTION __gthread_recursive_mutex_init_function
#endif
#ifdef _GTHREAD_USE_COND_INIT_FUNC
# undef __GTHREAD_COND_INIT
# define __GTHREAD_COND_INIT_FUNCTION __gthread_cond_init_function
#endif

#if __GXX_WEAK__ && _GLIBCXX_GTHREAD_USE_WEAK
# ifndef __gthrw_pragma
# define __gthrw_pragma(pragma)
# endif
# define __gthrw2(name,name2,type) \
static __typeof(type) name __attribute__ ((__weakref__(#name2))); \
__gthrw_pragma(weak type)
# define __gthrw_(name) __gthrw_ ## name
#else
# define __gthrw2(name,name2,type)
# define __gthrw_(name) name
#endif

/* Typically, __gthrw_foo is a weak reference to symbol foo. */
#define __gthrw(name) __gthrw2(__gthrw_ ## name,name,name)

__gthrw(pthread_once)
__gthrw(pthread_getspecific)
__gthrw(pthread_setspecific)

__gthrw(pthread_create)
__gthrw(pthread_join)
__gthrw(pthread_equal)
__gthrw(pthread_self)
__gthrw(pthread_detach)
#ifndef __BIONIC__
__gthrw(pthread_cancel)
#endif
__gthrw(sched_yield)

__gthrw(pthread_mutex_lock)
__gthrw(pthread_mutex_trylock)
#if _GTHREAD_USE_MUTEX_TIMEDLOCK
__gthrw(pthread_mutex_timedlock)
#endif
__gthrw(pthread_mutex_unlock)
__gthrw(pthread_mutex_init)
__gthrw(pthread_mutex_destroy)

__gthrw(pthread_cond_init)
__gthrw(pthread_cond_broadcast)
__gthrw(pthread_cond_signal)
__gthrw(pthread_cond_wait)
__gthrw(pthread_cond_timedwait)
__gthrw(pthread_cond_destroy)

__gthrw(pthread_key_create)
__gthrw(pthread_key_delete)
__gthrw(pthread_mutexattr_init)
__gthrw(pthread_mutexattr_settype)
__gthrw(pthread_mutexattr_destroy)


#if defined(_LIBOBJC) || defined(_LIBOBJC_WEAK)
/* Objective-C. */
__gthrw(pthread_exit)
#ifdef _POSIX_PRIORITY_SCHEDULING
#ifdef _POSIX_THREAD_PRIORITY_SCHEDULING
__gthrw(sched_get_priority_max)
__gthrw(sched_get_priority_min)
#endif /* _POSIX_THREAD_PRIORITY_SCHEDULING */
#endif /* _POSIX_PRIORITY_SCHEDULING */
__gthrw(pthread_attr_destroy)
__gthrw(pthread_attr_init)
__gthrw(pthread_attr_setdetachstate)
#ifdef _POSIX_THREAD_PRIORITY_SCHEDULING
__gthrw(pthread_getschedparam)
__gthrw(pthread_setschedparam)
#endif /* _POSIX_THREAD_PRIORITY_SCHEDULING */
#endif /* _LIBOBJC || _LIBOBJC_WEAK */

#if __GXX_WEAK__ && _GLIBCXX_GTHREAD_USE_WEAK

/* On Solaris 2.6 up to 9, the libc exposes a POSIX threads interface even if
-pthreads is not specified. The functions are dummies and most return an
error value. However pthread_once returns 0 without invoking the routine
it is passed so we cannot pretend that the interface is active if -pthreads
is not specified. On Solaris 2.5.1, the interface is not exposed at all so
we need to play the usual game with weak symbols. On Solaris 10 and up, a
working interface is always exposed. On FreeBSD 6 and later, libc also
exposes a dummy POSIX threads interface, similar to what Solaris 2.6 up
to 9 does. FreeBSD >= 700014 even provides a pthread_cancel stub in libc,
which means the alternate __gthread_active_p below cannot be used there. */

#if defined(__FreeBSD__) || (defined(__sun) && defined(__svr4__))

static volatile int __gthread_active = -1;

static void
__gthread_trigger (void)
{
__gthread_active = 1;
}

static inline int
__gthread_active_p (void)
{
static pthread_mutex_t __gthread_active_mutex = PTHREAD_MUTEX_INITIALIZER;
static pthread_once_t __gthread_active_once = PTHREAD_ONCE_INIT;

/* Avoid reading __gthread_active twice on the main code path. */
int __gthread_active_latest_value = __gthread_active;

/* This test is not protected to avoid taking a lock on the main code
path so every update of __gthread_active in a threaded program must
be atomic with regard to the result of the test. */
if (__builtin_expect (__gthread_active_latest_value < 0, 0))
{
if (__gthrw_(pthread_once))
{
/* If this really is a threaded program, then we must ensure that
__gthread_active has been set to 1 before exiting this block. */
__gthrw_(pthread_mutex_lock) (&__gthread_active_mutex);
__gthrw_(pthread_once) (&__gthread_active_once, __gthread_trigger);
__gthrw_(pthread_mutex_unlock) (&__gthread_active_mutex);
}

/* Make sure we'll never enter this block again. */
if (__gthread_active < 0)
__gthread_active = 0;

__gthread_active_latest_value = __gthread_active;
}

return __gthread_active_latest_value != 0;
}

#else /* neither FreeBSD nor Solaris */

/* For a program to be multi-threaded the only thing that it certainly must
be using is pthread_create. However, there may be other libraries that
intercept pthread_create with their own definitions to wrap pthreads
functionality for some purpose. In those cases, pthread_create being
defined might not necessarily mean that libpthread is actually linked
in.

For the GNU C library, we can use a known internal name. This is always
available in the ABI, but no other library would define it. That is
ideal, since any public pthread function might be intercepted just as
pthread_create might be. __pthread_key_create is an "internal"
implementation symbol, but it is part of the public exported ABI. Also,
it's among the symbols that the static libpthread.a always links in
whenever pthread_create is used, so there is no danger of a false
negative result in any statically-linked, multi-threaded program.

For others, we choose pthread_cancel as a function that seems unlikely
to be redefined by an interceptor library. The bionic (Android) C
library does not provide pthread_cancel, so we do use pthread_create
there (and interceptor libraries lose). */

#ifdef __GLIBC__
__gthrw2(__gthrw_(__pthread_key_create),
__pthread_key_create,
pthread_key_create)
# define GTHR_ACTIVE_PROXY __gthrw_(__pthread_key_create)
#elif defined (__BIONIC__)
# define GTHR_ACTIVE_PROXY __gthrw_(pthread_create)
#else
# define GTHR_ACTIVE_PROXY __gthrw_(pthread_cancel)
#endif

static inline int
__gthread_active_p (void)
{
static void *const __gthread_active_ptr
= __extension__ (void *) &GTHR_ACTIVE_PROXY;
return __gthread_active_ptr != 0;
}

#endif /* FreeBSD or Solaris */

#else /* not __GXX_WEAK__ */

/* Similar to Solaris, HP-UX 11 for PA-RISC provides stubs for pthread
calls in shared flavors of the HP-UX C library. Most of the stubs
have no functionality. The details are described in the "libc cumulative
patch" for each subversion of HP-UX 11. There are two special interfaces
provided for checking whether an application is linked to a shared pthread
library or not. However, these interfaces aren't available in early
libpthread libraries. We also need a test that works for archive
libraries. We can't use pthread_once as some libc versions call the
init function. We also can't use pthread_create or pthread_attr_init
as these create a thread and thereby prevent changing the default stack
size. The function pthread_default_stacksize_np is available in both
the archive and shared versions of libpthread. It can be used to
determine the default pthread stack size. There is a stub in some
shared libc versions which returns a zero size if pthreads are not
active. We provide an equivalent stub to handle cases where libc
doesn't provide one. */

#if defined(__hppa__) && defined(__hpux__)

static volatile int __gthread_active = -1;

static inline int
__gthread_active_p (void)
{
/* Avoid reading __gthread_active twice on the main code path. */
int __gthread_active_latest_value = __gthread_active;
size_t __s;

if (__builtin_expect (__gthread_active_latest_value < 0, 0))
{
pthread_default_stacksize_np (0, &__s);
__gthread_active = __s ? 1 : 0;
__gthread_active_latest_value = __gthread_active;
}

return __gthread_active_latest_value != 0;
}

#else /* not hppa-hpux */

static inline int
__gthread_active_p (void)
{
return 1;
}

#endif /* hppa-hpux */

#endif /* __GXX_WEAK__ */

#ifdef _LIBOBJC

/* This is the config.h file in libobjc/ */
#include <config.h>

#ifdef HAVE_SCHED_H
# include <sched.h>
#endif

/* Key structure for maintaining thread specific storage */
static pthread_key_t _objc_thread_storage;
static pthread_attr_t _objc_thread_attribs;

/* Thread local storage for a single thread */
static void *thread_local_storage = NULL;

/* Backend initialization functions */

/* Initialize the threads subsystem. */
static inline int
__gthread_objc_init_thread_system (void)
{
if (__gthread_active_p ())
{
/* Initialize the thread storage key. */
if (__gthrw_(pthread_key_create) (&_objc_thread_storage, NULL) == 0)
{
/* The normal default detach state for threads is
* PTHREAD_CREATE_JOINABLE which causes threads to not die
* when you think they should. */
if (__gthrw_(pthread_attr_init) (&_objc_thread_attribs) == 0
&& __gthrw_(pthread_attr_setdetachstate) (&_objc_thread_attribs,
PTHREAD_CREATE_DETACHED) == 0)
return 0;
}
}

return -1;
}

/* Close the threads subsystem. */
static inline int
__gthread_objc_close_thread_system (void)
{
if (__gthread_active_p ()
&& __gthrw_(pthread_key_delete) (_objc_thread_storage) == 0
&& __gthrw_(pthread_attr_destroy) (&_objc_thread_attribs) == 0)
return 0;

return -1;
}

/* Backend thread functions */

/* Create a new thread of execution. */
static inline objc_thread_t
__gthread_objc_thread_detach (void (*func)(void *), void *arg)
{
objc_thread_t thread_id;
pthread_t new_thread_handle;

if (!__gthread_active_p ())
return NULL;

if (!(__gthrw_(pthread_create) (&new_thread_handle, &_objc_thread_attribs,
(void *) func, arg)))
thread_id = (objc_thread_t) new_thread_handle;
else
thread_id = NULL;

return thread_id;