summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* arc: Rework default exception handlers for ARC EM and HSAnton Kolesov2016-05-251-73/+34
| | | | | | | | | | | | | | | | | | | | | | Initially crt0.S used a special function, declared as weak as a default exception handler in interrupt vector table. To let user override individual handlers, this function had multiple names - one for each IVT entry, which, however, was terribly confusing for the debugger and user - because it wasn't clear which symbol will be used as a function name in debugger. Defining multiple separate functions - one for each handler, would resolve the mess, but would increase code size of crt0.o. To clean this up, this patch defines exception handlers as weak symbols as well, but those are defined as just symbols, not functions, hence there would be less confusion over what is what. At the same time, users still can redefine exception handlers symbol by creating functions with respective names. libgloss/ 2016-05-24 Anton Kolesov <Anton.Kolesov@synopsys.com> * arc/crt0.S: Convert memory_error and friends to non-function symbols.
* TZ: Replace unreliable isupper calls on wcharsCorinna Vinschen2016-05-251-2/+4
| | | | | | | | | In case the TZ variable is empty, Cygwin fetches timezone info from Windows. Extracting the timezone short name uses isupper on wide chars. Replace with explicit check for A <= character <= Z to be independent of undefined behaviour. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Git is Git, not GITAdam Dinwoodie2016-05-242-3/+3
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Fix typo and wrong URL in winsup/READMECorinna Vinschen2016-05-241-3/+3
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Feature test macros: ctermid, cuseridYaakov Selkowitz2016-05-232-3/+13
| | | | | | | | | | The proper location for these functions has always been <stdio.h>, however XPG4 and SUSv2 did mandate a duplicate declaration in <unistd.h>. cuserid was dropped in SUSv3 (it was marked legacy since XPG4) and the ctermid declaration in <unistd.h> was made optional and obsolete in SUSv4. Fixes: https://cygwin.com/ml/cygwin/2016-05/msg00002.html Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
* Add release message for previous mmap fixCorinna Vinschen2016-05-201-0/+3
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* mmap: Fix size restriction of maps due to using 32 bit size typeCorinna Vinschen2016-05-202-35/+36
| | | | | | | | | Throughout mmap, size-related variables and parameters are still using DWORD as type, which disallows mapping ranges > 4Gigs. Fix this by using SIZE_T throughout for those vars and parameters. Also, drop unused off parameter from 1st variant of mmap_record::map_pages. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Add release message for scheduler fixesCorinna Vinschen2016-05-201-0/+3
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Fix thread priority handlingCorinna Vinschen2016-05-201-9/+11
| | | | | | | | | | | | | | | So far pthread::postcreate() only sets the thread priority at all, only if the inherit-scheduler attribute is PTHREAD_EXPLICIT_SCHED. This completely ignores the PTHREAD_INHERIT_SCHED case, since in contrast to POSIX, a thread does not inherit its priority from the creating thread, but always starts with THREAD_PRIORITY_NORMAL. pthread_getschedparam() only returns what's stored in the thread attributes, not the actual thread priority. This patch fixes both problems. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Rewrite scheduler functions getting and setting process and thread priorityCorinna Vinschen2016-05-202-172/+173
| | | | | | | | | | | | | | | | So far the scheduler priority handling is not POSIX compatible. The priorities use a range of -14 up to +15, which means it's not clear if the POSIX-required return value of -1 in case of an error is *really* an error or just the valid priority value -1. Even more confusing, -14 is the *max* value and 15 is the *min* value. Last but not least this range doesn't match the POSIX requirement of at least 32 priority values. This patch cleans up scheduler priority handling and moves the valid priority range to 1 (min) - 32 (max). It also adds a function sched_get_thread_priority() which will help to make thread priority more POSIX-like. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* libgloss/ft32: fix whitespace in MakefileYaakov Selkowitz2016-05-201-29/+29
| | | | Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
* Miscellaneous style cleanup, whitespace only.John Hood2016-05-201-2/+2
|
* Improve and simplify select().John Hood2016-05-202-49/+15
| | | | | | | | | * select.h: Eliminate redundant select_stuff::select_loop state. * select.cc (select): Eliminate redundant select_stuff::select_loop state. Eliminate redundant code for zero timeout. Do not return early on early timer return. (select_stuff::wait): Eliminate redundant select_stuff::select_loop state.
* Use high-resolution timebases for select().John Hood2016-05-202-70/+114
| | | | | | | | | | | * select.h: Change prototype for select_stuff::wait() for larger microsecond timeouts. * select.cc (pselect): Convert from old cygwin_select(). Implement microsecond timeouts. (cygwin_select): Rewrite as a wrapper on pselect(). (select): Implement microsecond timeouts. (select_stuff::wait): Implement microsecond timeouts with a timer object.
* Sync toplevel configure with upstream GCC.Anton Kolesov2016-05-202-46/+24
| | | | | | | | | | | | | | | | | | | | This fixes a problem, where libgloss wouldn't be built for ARC processors, even though it is actually supported. The original patch that introduced support for ARC in libgloss hasn't been submitted to GCC maillist, hence when top-level configure has been synced with GCC - this libgloss patch has been effectively reverted. Libgloss support for ARC has been accepted in GCC: https://gcc.gnu.org/ml/gcc-patches/2016-05/msg01148.html ChangeLog 2016-05-17 Anton Kolesov <Anton.Kolesov@synopsys.com> * configure.ac: Sync with upstream GCC. * configure: Regenerate. Signed-off-by: Anton Kolesov <Anton.Kolesov@synopsys.com>
* Add rawmemchrWilco Dijkstra2016-05-204-2/+118
| | | | | | | | | | | | | | | | | | | | | | | Marcus Shawcroft wrote: > This patch appears to have been munged by the mail system, can you > repost as an attachment please. Sure, I've attached the patch. Wilco Add a simple rawmemchr implementation. Use strlen for rawmemchr(s, '\0') as it is the fastest way to search for '\0', and use memchr with an infinite size for other cases. This is 3x faster for large sizes. ChangeLog: 2016-04-22 Wilco Dijkstra <wdijkstr@arm.com> * newlib/libc/machine/aarch64/Makefile.in: Add rawmemchr.S and rawmemchr-stub.c. * newlib/libc/machine/aarch64/Makefile.am: Likewise. * newlib/libc/machine/aarch64/rawmemchr.S (rawmemchr): Add rawmemchr. * newlib/libc/machine/aarch64/rawmemchr-stub.c (rawmemchr): Likewise.
* Bump Cygwin DLL version to 2.5.2Corinna Vinschen2016-05-182-1/+14
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Make sure to have full configuration info in sys/_types.h.Corinna Vinschen2016-05-181-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | The following testcase: $ cat > test.c <<EOF #include <sys/select.h> #include <sys/time.h> EOF $ gcc -c test.c emits the following error: /usr/include/sys/reent.h:276:3: error: expected specifier-qualifier-list befor e ‘_fpos64_t’ _fpos64_t _EXFNPTR(_seek64, (struct _reent *, _PTR, _fpos64_t, int)); ^ The reason is that the load order from sys/select.h includes sys/_types.h before sys/config.h has been included from anywhere else. sys/_types.h defines _fpos64_t only if __LARGE64_FILES is defined, but it never is in this scenario. So sys/_types.h has to make sure to get the configuration info by itself. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Fix strlen using Thumb-2 with -Os -marmJeff Johnston2016-05-112-4/+10
| | | | | | | | | 2016-04-18 Thomas Preud'homme <thomas.preudhomme@arm.com> * libc/machine/arm/strlen-stub.c: Check capabilities of architecture to decide which Thumb implementation to use and fall back to C implementation for architecture not supporting Thumb mode. * libc/machine/arm/strlen.S: Likewise.
* Fix libgloss arc nsim specs file.Jeff Johnston2016-05-111-1/+1
|
* Add port for Phoenix-RTOS in common configure files.Jeff Johnston2016-05-094-0/+40
|
* Allow autoconf link-time tests to detect arc4random for RTEMS.Jeff Johnston2016-05-091-0/+5
|
* Add Phoenix-RTOS port for ARM.Jeff Johnston2016-05-06142-0/+29608
| | | | Port contributed by Jakub Sejdak <jakub.sejdak@phoesys.com>
* Fix libgloss/arc/nano.specs file.Jeff Johnston2016-05-061-2/+2
|
* Fix white-space in libgloss/arc/Makefile.in.Jeff Johnston2016-05-051-3/+3
|
* Add _Thread_queue_Queue::_owner for RTEMSJeff Johnston2016-05-031-3/+3
| | | | | | | | Add _Thread_queue_Queue::_owner which will be used for the upcomming priority inheritance implementation and an O(m) independence-preserving protocol (OMIP) implementation. Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
* Move _Thread_queue_Queue::_Lock for RTEMSJeff Johnston2016-05-031-3/+3
| | | | | | | | | | Move _Thread_queue_Queue::_Lock to begin of the structure. On RTEMS, the presence of a lock component in the thread queue structures actually depends on the build-time RTEMS_SMP configuration option. A move of this part to the begin of the structure allows an implementation re-use for the other parts. Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
* Always assign return value to passed pointer in time function.Jeff Johnston2016-05-021-7/+6
| | | | | | | | | | | | If the passed t pointer is not a null pointer, always assign the return value to the object it points to, regardless of whether the return value is an error. This is what the GNU C Library does, and this is also the expected behavior according to the latest draft of the C programming language standard (C11 ISO/IEC 9899:201x WG14 N1570, dated 2011-04-12): Signed-off-by: Benoît Thébaudeau <benoit@wsystem.com>
* Don't run UTF-8.exp test if newlib is not built with multibyte support.Jeff Johnston2016-05-021-0/+12
| | | | | | | | | | | | | | Submitted on behalf of Yuriy Kolerov. newlib/ChangeLog 2016-04-29 Yuriy Kolerov <yuriy.kolerov@synopsys.com> testsuite/newlib.locale/UTF-8.exp: Don't run if multibyte support is disabled. Signed-off-by: Yuriy Kolerov <yuriy.kolerov@synopsys.com> Signed-off-by: Anton Kolesov <anton.kolesov@synopsys.com>
* Fix support ARC processors without barrel-shifterJeff Johnston2016-05-021-1/+6
| | | | | | | | | | | | | | | | | crt0.S for ARC used to use instruction "asr.f lp_count, r3, 2" for all cores except ARC601. However instructions which shift more than 1 bit are optional, so this crt0.S didn't worked for all ARC cores. Luckily this is a shift just by 2 bits on all occassions, so fix is trivial - use two single-bit shifts. libgloss/ChangeLog 2016-04-29 Anton Kolesov <anton.kolesov@synopsys.com> * arc/crt0.S: Fix support for processors without barrel-shifter. Signed-off-by: Anton Kolesov <Anton.Kolesov@synopsys.com>
* Update crt0.S for ARC.Jeff Johnston2016-05-021-9/+23
| | | | | | | | | | | | | | | | | | | | | | | | | This is similar to commit 06537f05d4b6a0d2db01c6afda1d2a0ea2588126 to the newlib for ARC. GCC for ARC has been updated to provide consistent naming of preprocessor definitions for different optional architecture features: * __ARC_BARREL_SHIFTER__ instead of __Xbarrel_shifter for -mbarrel-shifter * __ARCEM__ instead of __EM__ for ARC EM cores * __ARCHS__ instead of __HS__ for ARC HS cores * etc (not used in libgloss) This patch updates crt0.S for ARC to use new definitions instead of a deprecated ones. To ensure compatibility with older compiler new definitions are also defined in crt0.S if needed, based on presence of deprecated preprocessor definitions. libgloss/ChangeLog 2016-04-29 Anton Kolesov <Anton.Kolesov@synopsys.com> * arc/crt0.S: Use new GCC defines to detect processor features.
* Add necessary infrastructure to support "nano" build of newlib.Jeff Johnston2016-04-293-3/+35
| | | | | | | | | | ARC aproach to this feature is similiar to ARM's one here. 2016-04-29 Anton Kolesov <anton.kolesov@synopsys.com> * arc/nano.specs: New file. * arc/Makefile.in: Support nano.specs. * arc/nsim.specs: Likewise.
* Provide FreeBSD types for <sys/types.h> on RTEMScygwin-2_5_1-releaseSebastian Huber2016-04-212-0/+80
| | | | | | | | | | | | | | | | | | | | Provide the following types via <sys/types.h> on RTEMS for FreeBSD compatibility if __BSD_VISIBLE * accmode_t, * cap_rights_t, * c_caddr_t, * cpulevel_t, * fixpt_t, * lwpid_t, * uintfptr_t, * vm_offset_t, * vm_ooffset_t, * vm_paddr_t, * vm_pindex_t, and * vm_size_t. Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
* Always provide register_t via <sys/types.h>Sebastian Huber2016-04-212-9/+2
| | | | | | | | Always provide register_t via <sys/types.h> for glibc and BSD compatibility. Define __BIT_TYPES_DEFINED__ to 1 like glibc for legacy header files. Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
* Simplify guard against defining pthread types on CygwinCorinna Vinschen2016-04-211-9/+9
| | | | | | | * libc/include/sys/types.h: Fix a comment about Cygwin. Simplify guarding pthread types against inclusion on Cygwin. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Remove cygwin/types.hCorinna Vinschen2016-04-211-22/+0
|
* Resurrect <machine/types.h> for <sys/types.h>Sebastian Huber2016-04-215-143/+152
| | | | | | | | | | | Resurrect <machine/_user_types.h> for use in <sys/types.h>. Newlib targets may provide an own version of <machine/types.h> in their machine directory to add custom user types for <sys/types.h>. Check the _SYS_TYPES_H header guard to prevent a direct include of <machine/types.h>, since the <machine/types.h> file is a Newlib speciality. Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
* Fixed semihosting for ARM when heapinfo not provided by debugger.David Hoover2016-04-211-1/+3
|
* Remove duplicate int*_t definitionsSebastian Huber2016-04-201-4/+0
| | | | | | | Types are already available via <sys/_stdint.h> included some lines above. Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
* Remove duplicate u_int*_t definitionsSebastian Huber2016-04-201-4/+0
| | | | Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
* Add release message for commit 9409c53Corinna Vinschen2016-04-201-0/+4
|
* Don't test pthread objects for being already initialized at init timeCorinna Vinschen2016-04-201-12/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | For all pthread init functions, POSIX says Results are undefined if pthread_FOO_init() is called specifying an already initialized pthread_FOO object. So far our pthread init functions tested the incoming object if it's already an initialized object and, if so, returned EBUSY. That's ok *iff* the object was already initialized. However, as the example in https://cygwin.com/ml/cygwin/2016-04/msg00473.html shows, an uninitialized pthread object could also accidentally look like an initialized object and then returning EBUSY is not ok. Consequentially, all those tests are dangerous. Per POSIX, an application has to know what its doing when calling any of the pthread init functions anyway, and re-initializing the object is just as well as undefined behaviour as is returning EBUSY on already initialized objects. * thread.cc (pthread_attr_init): Drop check for already initialized object. (pthread_condattr_init): Ditto. (pthread_rwlockattr_init): Ditto. (pthread_mutexattr_init): Ditto. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Add RTEMS support for GCC libatomicSebastian Huber2016-04-202-1/+54
| | | | Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
* Add __ssize_t to <sys/_types.h>Sebastian Huber2016-04-191-0/+2
| | | | | | Add __ssize_t to <sys/_types.h> for BSD compatibility. Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
* Add RTEMS-specific types for BSD compatibilitySebastian Huber2016-04-191-0/+6
| | | | Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
* Provide in_port_t via <sys/types.h>Sebastian Huber2016-04-192-1/+9
| | | | | | | Provide in_port_t via <sys/types.h> if __BSD_VISIBLE for BSD compatibility. Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
* Provide in_addr_t via <sys/types.h>Sebastian Huber2016-04-192-1/+10
| | | | | | | Provide in_addr_t via <sys/types.h> if __BSD_VISIBLE for BSD compatibility. Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
* Introduce __sa_family_t for BSD compatibiliySebastian Huber2016-04-193-1/+8
| | | | Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
* Introduce __socklen_t for BSD compatibilitySebastian Huber2016-04-193-5/+11
| | | | Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
* BSD compatibility for <machine/endian.h>Sebastian Huber2016-04-196-48/+161
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduce <machine/_endian.h> to let target based customization of <machine/endian.h> via * _LITTLE_ENDIAN, * _BIG_ENDIAN, * _PDP_ENDIAN, and * _BYTE_ORDER. defines. Add definitions expected by FreeBSD to <machine/endian.h> like * _QUAD_HIGHWORD, * _QUAD_LOWWORD, * __bswap16(), * __bswap32(), * __bswap64(), * __htonl(), * __htons(), * __ntohl(), and * __ntohs(). Also, if __BSD_VISIBLE * LITTLE_ENDIAN, * BIG_ENDIAN, * PDP_ENDIAN, and * BYTE_ORDER. Targets that define __machine_host_to_from_network_defined in <machine/_endian.h> must provide their own implementation of * __htonl(), * __htons(), * __ntohl(), and * __ntohs(), otherwise a default implementation is provided by <machine/endian.h>. In case of GCC defines to builtins are used. Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>