summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* or1k: Allow exception nestingJeff Johnston2015-08-074-39/+149
| | | | | | | | | | | | | | | | | | | Allow exceptions to be nested, which is especially useful with urgent interrupts while processing an exception. The implementation counts up the nesting level with each call to an exception. In the outer exception (level 1), the exception stack is started. All nested exceptions just reserve the redzone (scratch memory that may be used by compiler) and exception context on the stack, but then process on the same scratch. Restriction: Impure pointers are shared among all exceptions. This may be solved by creating an impure data structure in the stack frame with each nested exception. * or1k/crt0.S: Add exception nesting * or1k/exceptions-asm.S: ditto * or1k/util.c: ditto
* or1k: Fix critical handling in malloc locksJeff Johnston2015-08-072-2/+8
| | | | | | | Only on first call to the recursive malloc lock the restore value of exception enable fields is stored. * libc/sys/or1k/mlock.c: Fix exception enable saving
* or1k: Make heap end globally visibleJeff Johnston2015-08-072-1/+5
| | | | | | Boards may change the initial value from _end to another value. * or1k/sbrk.c: Make heap end globally visible
* Improve FAQ answer on debugging CygwinJon TURNEY2015-08-052-4/+26
| | | | | | | | | | | Improve FAQ answer on debugging Cygwin to mention the cygwin-debuginfo package and the gdb command 'set cygwin-exceptions on'. 2015-08-03 Jon Turney <jon.turney@dronecode.org.uk> * faq-programming.xml: Improve debugging-cygwin answer. Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
* This is part of a larger fix for RL78 complex relocs - they need an absolute ↵Nick Clifton2015-08-043-0/+9
| | | | | | | symbol at address 0 that is not part of the *ABS* section. * rl78/rl78-sim.ld: Provide a value for __rl78_abs__. * rl78/rl78.ld: Likewise.
* Fix wscanf family positional parameter handling in %lc, %ls, %l[]Shoichi Sakon2015-08-032-7/+15
| | | | | | | | * libc/stdio/vfwscanf.c (__SVFWSCANF_R): Convert wrong usage of va_arg to GET_ARG in %lc, %ls nad %l[] cases. Fix unterminated string in %l[] case. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Bump Cygwin DLL minor number.Corinna Vinschen2015-08-032-1/+5
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* strace: Handle ofile descriptor more carefully.cygwin-2_2_0-releaseCorinna Vinschen2015-08-032-6/+13
| | | | | | | | | Fix coverity CIDs 128250 - 128252 * strace.cc (main2): Don't call setvbuf on NULL descriptor. Explicitely fclose ofile. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Don't include stdio64 functions in reentrant syscalls menu when not bulding ↵Jon TURNEY2015-08-031-0/+8
| | | | | | | | | | stdio64. Fix documentation build since 6c2b1842 by not including stdio64 functions in the reent syscalls menu if the node itself isn't going to be included because it's under the STDIO64 flag. Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
* Fix typo in <sys/lock.h>Sebastian Huber2015-07-312-1/+6
| | | | | | | | | | | Sorry, there was a typo in <sys/lock.h> which leads to memory corruption since not enough space is reserved for the lock object. newlib/ChangeLog 2015-07-30 Sebastian Huber <sebastian.huber@embedded-brains.de> * libc/sys/rtems/include/sys/lock.h (__LOCK_INIT_RECURSIVE): Use proper type.
* [AArch64] Rewrite optimized memset.Wilco Dijkstra2015-07-302-191/+188
| | | | | | | | | | | This is an optimized memset for AArch64. Memset is split into 4 main cases: small sets of up to 16 bytes, medium of 16..96 bytes which are fully unrolled. Large memsets of more than 96 bytes align the destination and use an unrolled loop processing 64 bytes per iteration. Memsets of zero of more than 256 use the dc zva instruction, and there are faster versions for the common ZVA sizes 64 or 128. STP of Q registers is used to reduce codesize without loss of performance.
* Cygwin: Fix x86_64 memcpy/memset for n > 2GBCorinna Vinschen2015-07-293-19/+183
| | | | | | | | | | | | | | | | https://cygwin.com/ml/cygwin/2015-07/msg00344.html: RtlFillMemory and RtlCopyMemory only work for size values up to 2GB. Fix this problem by using NetBSD code for memset and memcpy. Add entry points for memmove, wmemset, wmemmove, wmemcpy. Thanks to Roman Petrovski <RPetrovski@illumina.com> for pointing this out. * miscfuncs.cc (memset): x86_64 only: Implement in assembler. (memmove,memcpy): x86_64 only: Ditto. (wmemmove,wmemcpy): x86_64 only: Ditto. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Move header filesSebastian Huber2015-07-299-5/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | During libgcc build the first include search path for <...> is "../newlib/libc/sys/rtems/include". Move all RTEMS specific header files to "libc/sys/rtems/include" so that they can be found. Later during libc build the header files in the previous location were somehow present, but for libgcc build they were invisible. This change is necessary to use <pthread.h> for the GCC thread model implementation. newlib/ChangeLog 2015-07-27 Sebastian Huber <sebastian.huber@embedded-brains.de> libc/sys/rtems/machine/_types.h: Move to ... libc/sys/rtems/include/machine/_types.h: ... here. libc/sys/rtems/machine/limits.h: Move to ... libc/sys/rtems/include/machine/limits.h: ... here. libc/sys/rtems/machine/param.h: Move to ... libc/sys/rtems/include/machine/param.h: ... here. libc/sys/rtems/sys/cpuset.h: Move to ... libc/sys/rtems/include/sys/cpuset.h: ... here. libc/sys/rtems/sys/dirent.h: Move to ... libc/sys/rtems/include/sys/dirent.h: ... here. libc/sys/rtems/sys/param.h: Move to ... libc/sys/rtems/include/sys/param.h: ... here. libc/sys/rtems/sys/syslimits.h: Move to ... libc/sys/rtems/include/sys/syslimits.h: ... here. libc/sys/rtems/sys/utime.h: Move to ... libc/sys/rtems/include/sys/utime.h: ... here.
* newlib/ChangeLog: Left out of previous commit.Joel Sherrill2015-07-291-0/+4
|
* Add <sys/lock.h>Sebastian Huber2015-07-291-0/+235
| | | | | | | | | | | | | | | | | | | | | | | | Provide self-contained synchronization objects for RTEMS. The API was designed to be able to use it for the Newlib internal locks, the C11 threads support, the GCC thread model support and the libgomp operating system configuration in combination with <pthread.h>. References: https://lists.rtems.org/pipermail/devel/2015-July/011989.html https://lists.rtems.org/pipermail/devel/2015-July/012000.html Tickets: https://devel.rtems.org/ticket/1247 https://devel.rtems.org/ticket/2274. v2: Fix typo in _Condition_Wait_recursive_timed() declaration. newlib/ChangeLog 2015-07-28 Sebastian Huber <sebastian.huber@embedded-brains.de> * libc/sys/rtems/include/sys/lock.h: New.
* cygwin: Fix copyright datesCorinna Vinschen2015-07-2917-18/+17
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* cygwin: Fix crashes under AllocationPreference=0x100000 conditionCorinna Vinschen2015-07-298-13/+55
| | | | | | | | | | | | | * cygtls.h: Include cygtls_padsize.h and define CYGTLS_PADSIZE there. * cygtls_padsize.h: New file. Define CYGTLS_PADSIZE. * environ.cc (parse_options): Fix NULL pointer access. * init.cc (threadfunc_fe): Do not force stack align on x86_64. * strace.cc (main2): Rename from main. (main): Make room for _cygtls area on stack and just call main2. Add comment to explain why. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Remove workaround for texinfo bug with underscores in filenames from ↵newlib-snapshot-20150723Jon TURNEY2015-07-241-116/+28
| | | | | | | | | | | | mothballed mathfp/ This got removed everywhere else in commit 139f923b, so I'm assuming whatever ancient bug this was has been fixed long since. There are plenty of other uses of texinfo with a filename containing an underscore now. Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
* Remove a stray sentence fragment in iconv.texJon TURNEY2015-07-241-1/+0
| | | | | | I can't work out any meaning for this random sentence fragment, so remove it. Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
* Fix a typo in iconv.texJon TURNEY2015-07-241-1/+1
| | | | Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
* Fix SYNPOSIS prototypes for iconv functionsJon TURNEY2015-07-241-4/+4
| | | | | | Terminate all protoypes with a semicolon. Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
* Use makedoc generated texinfo documentation for reentrant syscallsJon TURNEY2015-07-241-139/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | We use texinfo nodes beginning with an underscore in several other places, so revert this ancient workaround for a no longer existing bug, and use the makedoc generated texinfo for reentrant versions of syscalls, rather than handwritten documentation. Also alphabetically sort these functions. Also add documentation for _execve_r, _getpid_r, _kill_r and _times_r functions, whose non-reentrant versions are documented as stubs v2: Keep _open64_r, _lseek64_r and _fstat64_r functions under texinfo conditional STDIO64 Add _stat64_r function likewise. Notes: 1. The handwritten prototypes give the reentrancy structure pointer as of type void *, rather than the presumably more correct struct __reent * 2. The fcntl, gettimeofday, mkdir and rename functions are not documented as stubs, so I haven't added the reentrant versions either Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
* Add missing NEWPAGE commands to makedoc markup in reent/Jon TURNEY2015-07-242-0/+3
| | | | | | | | | | makedoc requires a NEWPAGE command to preceed the second and subsequent FUNCTION commands in a file in order to produce the correct texinfo output. Add missing NEWPAGE commands needed in reent/execr.c. and reent/signalr.c, which contain makedoc markup for multiple functions. Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
* Improve cygwin 2.2.0 release textCorinna Vinschen2015-07-231-0/+1
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Fix potential buffer overflow in makecontext trampolineCorinna Vinschen2015-07-232-1/+13
| | | | | | | | | | | | | | glibc's tst-makecontext2 testcase uncovered a bug in __cont_link_context. If the function misses to reserve shadow space for the calls to setcontext/cygwin_exit, both functions could overwrite memory beyond the stack configured in uc_stack. * exceptions.cc (__cont_link_context): x86_64: align stack and reserve shadow space for subsequent function calls, otherwise suffer potential buffer overflow. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Ignore non-absolute $HOME when started from native processCorinna Vinschen2015-07-233-2/+17
| | | | | | | * uinfo.cc (cygheap_user::ontherange): Ignore $HOME if it's not starting with a slash (aka, absolute POSIX Path). Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: Implement siglongjmp and sigsetjmp functions.Corinna Vinschen2015-07-219-25/+148
| | | | | | | | | | | | | | | | | | | | | | | * libc/include/machine/setjmp.h (siglongjmp): Declare as function on Cygwin. (sigsetjmp): Ditto. (_longjmp): Mark as noreturn function on Cygwin. * common.din (siglongjmp): Export. (sigsetjmp): Export. * gendef: Change formatting of some comments. (sigsetjmp): Implement. (siglongjmp): Implement. (__setjmpex): x86_64 only: Drop entry point. (setjmp): x86_64 only: Store tls stackptr in Frame now, store MXCSR and FPUCW registers in Spare, as MSVCRT does. (longjmp): x86_64 only: Restore tls stackptr from Frame now, restore MXCSR and FPUCW registers from Spare. * include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump. * new-features.xml (ov-new2.2): Document sigsetjmp, siglongjmp. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Add previous ldd fix to release fileCorinna Vinschen2015-07-201-0/+2
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Fix potential hang in ldd if DLL encounters missing entry pointCorinna Vinschen2015-07-202-4/+11
| | | | | | | * ldd.cc (STATUS_DLL_NOT_FOUND): Drop definition. (report): Handle STATUS_ENTRYPOINT_NOT_FOUND exception. Explain why. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Lower Cygwin's MINSIGSTKSZ and SIGSTKSZCorinna Vinschen2015-07-192-6/+9
| | | | | | | * include/cygwin/signal.h (MINSIGSTKSZ): Define as 8K, unconditionally. (SIGSTKSZ): Define as 32K, unconditionally. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Reduce stack pressure throughout CygwinCorinna Vinschen2015-07-1910-85/+141
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * dcrt0.cc (initial_env): Reduce size of local path buffers to PATH_MAX. Allocate debugger_command from process heap. (init_windows_system_directory): Very early initialize new global variable global_progname. * dll_init.cc (dll_list::alloc): Make path buffer static. Explain why. (dll_list::populate_deps): Use tmp_pathbuf for local path buffer. * exceptions.cc (debugger_command): Convert to PWCHAR. (error_start_init): Allocate debugger_command and fill with wide char strings. Only allocate if NULL. (try_to_debug): Just check if debugger_command is a NULL pointer to return. Drop conversion from char to WCHAR and drop local variable dbg_cmd. * globals.cc (global_progname): New global variable to store Windows application path. * pinfo.cc (pinfo_basic::pinfo_basic): Just copy progname over from global_progname. (pinfo::status_exit): Let path_conv create the POSIX path to avoid local buffer. * pseudo_reloc.cc (__report_error): Utilize global_progname, drop local buffer. * smallprint.cc (__small_vsprintf): Just utilize global_progname for %P format specifier. (__small_vswprintf): Ditto. * strace.cc (PROTECT): Change to reflect x being a pointer. Reformat. (CHECK): Ditto. Reformat. (strace::activate): Utilize global_progname, drop local buffer. Fix formatting. (strace::vsprntf): Reduce size of local progname buffer to NAME_MAX. Copy and, if necessary, convert only the last path component to progname. (strace_buf_guard): New muto. (buf): New static pointer. (strace::vprntf): Use buf under strace_buf_guard lock only. Allocate buffer space for buf on Windows heap. * wow64.cc (wow64_respawn_process): Utilize global_progname, drop local path buffer. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Remove x86_64 __sjfault/__ljfaultCorinna Vinschen2015-07-182-65/+5
| | | | | | * gendef: Remove unused 64 bit versions of __sjfault and __ljfault. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Rearrange makecontext and add lots of commentsCorinna Vinschen2015-07-182-12/+42
| | | | | | | * exceptions.cc (makecontext): Rearrange order of initialization and document at great length. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Fix ucontext creation in call_signal handlerCorinna Vinschen2015-07-172-4/+21
| | | | | | | | * exceptions.cc (__unwind_single_frame): Define empty macro on i686. (_cygtls::call_signal_handler): Try to make sure signal context makes sense in case we're generating context here. Add comment to explain. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Comment fixupCorinna Vinschen2015-07-172-6/+13
| | | | | | | | | * exceptions.cc (getcontext/x86_64): Drop comment on RtlCaptureContext. (swapcontext/x86_64): Fix comment yet again. (getcontext/i686): Move comment from x86_64 getcontext, slightly rearranged, to preceeding comment. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Reuse __unwind_single_frame where appropriateCorinna Vinschen2015-07-172-58/+42
| | | | | | | | | | | | * exceptions.cc (__unwind_single_frame): Move up in file to be accessible from other places. Move comment to getcontext. (stack_info::walk): Call __unwind_single_frame in 64 bit case. Fix preceeding comment. (myfault_altstack_handler): Call __unwind_single_frame. (getcontext): Give comment from __unwind_single_frame a new home. (swapcontext): Fix comment. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Implement getcontext, setcontext, makecontext, swapcontextCorinna Vinschen2015-07-1710-2/+301
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * common.din (getcontext): Export. (makecontext): Export. (setcontext): Export. (swapcontext): Export. * exceptions.cc (__unwind_single_frame): New static functions, 64 bit only. (setcontext): New function. (getcontext): New function. (swapcontext): New function. (__cont_link_context): New function. (makecontext): New function. * include/cygwin/version.h (CYGWIN_VERSION_DLL_MAJOR): Bump to 2002. (CYGWIN_VERSION_API_MINOR): Bump. * include/ucontext.h (getcontext): Add prototype. (setcontext): Ditto. (swapcontext): Ditto. (makecontext): Ditto. * ntdll.h (NtContinue): Ditto. * new-features.xml (ov-new2.2): Add new section. Document getcontext, setcontext, makecontext, swapcontext. * posix.xml (std-deprec): Add getcontext, setcontext, makecontext, swapcontext. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Document the fact that we forgot to bump for sigaltstack and sethostnameCorinna Vinschen2015-07-172-1/+7
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* [AArch64] Reverting recent optimized memset().Marcus Shawcroft2015-07-152-184/+196
|
* Change to nano.specs to add nano's include dircygwin-2_1_0-releaseAndre Simoes Dias Vieira2015-07-142-0/+9
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* exceptions.cc: Reenable code only disabled for debug purposesCorinna Vinschen2015-07-132-2/+5
| | | | | | | * exceptions.cc (exception::handle): Reenable code only disabled for debug purposes. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* [AArch64] Optimized memset.Wilco Dijkstra2015-07-132-191/+189
| | | | | | | | | | | This is an optimized memset for AArch64. Memset is split into 4 main cases: small sets of up to 16 bytes, medium of 16..96 bytes which are fully unrolled. Large memsets of more than 96 bytes align the destination and use an unrolled loop processing 64 bytes per iteration. Memsets of zero of more than 256 use the dc zva instruction, and there are faster versions for the common ZVA sizes 64 or 128. STP of Q registers is used to reduce codesize without loss of performance.
* Fix ChangeLog entry for previous two commits.Marcus Shawcroft2015-07-131-2/+2
|
* [AArch64] Optimized memcpy.Wilco Dijkstra2015-07-132-134/+166
| | | | | | | | | | This is an optimized memcpy for AArch64. Copies are split into 3 main cases: small copies of up to 16 bytes, medium copies of 17..96 bytes which are fully unrolled. Large copies of more than 96 bytes align the destination and use an unrolled loop processing 64 bytes per iteration. In order to share code with memmove, small and medium copies read all data before writing, allowing any kind of overlap. On a random copy test memcpy is 40.8% faster on A57 and 28.4% on A53.
* [AArch64] Optimized memmove.Wilco Dijkstra2015-07-132-282/+113
| | | | | | | This is an optimized memmove for AArch64. All copies of up to 96 bytes and all backward copies are done by the new memcpy. The only remaining case is large forward copies which are done in the same way as the memcpy loop, but copying from the end rather than the start.
* Fix typo in README.Jeff Johnston2015-07-101-1/+1
|
* tzset: Check timezone and country case-insensitiveCorinna Vinschen2015-07-083-2/+10
| | | | | | * tzset.c (main): Check timezone and country case-insensitive. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Add accidentally missing ChangeLog entry for previous patchCorinna Vinschen2015-07-071-0/+16
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* x86_64: Handle myfault exceptions when running on alternate signal stackCorinna Vinschen2015-07-075-2/+71
| | | | | | | | | | | | | | | | | | x86_64 only: * cygtls.cc (san::leave): Restore _my_tls.andreas. * cygtls.h (class san): Add _clemente as in 32 bit case. Add ret and frame members. (san::san): Handle _my_tls.andreas as on 32 bit. Take parameter and write it to new member ret. Store current stack pointer in frame. (san::~san): New destructor to restore _my_tls.andreas. (__try): Use __l_except address as parameter to san::san. * dcrt0.cc (dll_crt0_0): Add myfault_altstack_handler as vectored continuation handler. * exception.h (myfault_altstack_handler): Declare. * exceptions.cc (myfault_altstack_handler): New function. Explain what it's good for. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Simplify stack allocation code in child after forkCorinna Vinschen2015-07-073-69/+68
| | | | | | | | | | | | | * child_info.h (CURR_CHILD_INFO_MAGIC): Update. (child_info_fork::alloc_stack_hard_way): Drop declaration. * dcrt0.cc (child_info_fork::alloc_stack_hard_way): Fold into child_info_fork::alloc_stack. (getstack): Remove. (child_info_fork::alloc_stack): Simplify check for application-provided stack in "hard way" code. Don't call getstack for each page, just reallocate stack immediately as required. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>