summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Add support for Hygon Dhyana processorJinke Fan2019-06-032-2/+4
| | | | | | | | | | | | | | | | | | | -Add vendor identification -Support in get_cpu_cache Background: Chengdu Haiguang IC Design Co., Ltd (Hygon) is a Joint Venture between AMD and Haiguang Information Technology Co.,Ltd., aims at providing high performance x86 processor for China server market. Its first generation processor codename is Dhyana, which originates from AMD technology and shares most of the architecture with AMD's family 17h, but with different CPU Vendor ID("HygonGenuine")/Family series number(Family 18h). Related Hygon kernel patch can be found on: http://lkml.kernel.org/r/5ce86123a7b9dad925ac583d88d2f921040e859b.1538583282.git.puwen@hygon.cn Signed-off-by: Jinke Fan <fanjinke@hygon.cn>
* Fix <sys/_types.h> issues with <stddef.h>Sebastian Huber2019-06-032-5/+3
| | | | | | | | | | | | | | | | | | | | A commit from 2016 tried to address this GCC provided <stddef.h> issue #if (defined (__FreeBSD__) && (__FreeBSD__ >= 5)) \ || defined(__DragonFly__) \ || defined(__FreeBSD_kernel__) /* __size_t is a typedef on FreeBSD 5, must not trash it. */ #elif defined (__VMS__) /* __size_t is also a typedef on VMS. */ #else #define __size_t #endif with an include of <stddef.h> before <sys/_types.h> in <sys/types.h>. Is is not robust enough. Do the include of <stddef.h> in <sys/_types.h> directly and request only the necessary types. Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
* Avoid <sys/cdefs.h> dependency in <sys/_types.h>Sebastian Huber2019-06-031-2/+7
| | | | | | Including <sys/cdefs.h> could result in cyclic header dependencies. Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
* Avoid cyclic header dependenciesSebastian Huber2019-06-032-5/+5
| | | | | | | | | | | | RTEMS uses a considerable part of FreeBSD kernel and user space sources. These sources are compiled with a __FreeBSD__ define. On 2018-06-26 Gerald Pfeifer changed the GCC provided <stddef.h> so that it includes <sys/_types.h> if __FreeBSD__ is defined. The Newlib <sys/_types.h> included <sys/lock.h> which includes <sys/cdefs.h> on RTEMS which includes <stddef.h>. To get rid of this cyclic dependency move the optional _flock_t definition to <sys/reent.h>. Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
* Cygwin: FIFO: respect the O_CLOEXEC flagKen Brown2019-05-281-2/+3
| | | | | | Set the inheritance of the Windows pipe handles according to the O_CLOEXEC flag. Previously the pipe was always created and opened with OBJ_INHERIT.
* Cygwin: FIFO: Open only one handle to NPFSKen Brown2019-05-231-1/+1
| | | | | Make npfs_handle a static member function of fhandler_fifo, as in fhandler_socket_unix.
* RISC-V: Add _LITE_EXIT in crt0.S.Jim Wilson2019-05-221-0/+13
| | | | | | This patch adds _LITE_EXIT in crt0.S to enable "lite exit" technique in RISC-V. The changes have been tested in riscv/riscv-gnu-toolchain by riscv-dejagnu with riscv-sim.exp/riscv-sim-nano.exp.
* RISC-V: Add size optimized memcpy, memmove, memset and strcmp.Jim Wilson2019-05-228-2/+146
| | | | | | | This patch adds implementations of memcpy, memmove, memset and strcmp optimized for size. The changes have been tested in riscv/riscv-gnu-toolchain by riscv-dejagnu with riscv-sim.exp/riscv-sim-nano.exp.
* Make .data section placement coincide with _fdata symbolFaraz Shahbazker2019-05-1522-0/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The _fdata symbol in MIPS linker scripts is aligned to a 16-byte boundary. The ALIGN function does not implicitly update current location counter. If sections positioned after the assignment do not have the same natural alignment as the ALIGN function then the start of the section group will not coincide with the value of the symbol. Given the linker command sequence: symbol = ALIGN (NN); (.section*) where the idiom implies a desire to mark the beginning of .section with symbol, there must be an assignment to the location counter between the assignment to symbol and the .section pattern. libgloss/ * mips/array.ld: Update the location counter to match _fdata. * mips/cfe.ld: Likewise. * mips/ddb-kseg0.ld: Likewise. * mips/ddb.ld: Likewise. * mips/dve.ld: Likewise. * mips/idt.ld: Likewise. * mips/idt32.ld: Likewise. * mips/idt64.ld: Likewise. * mips/idtecoff.ld: Likewise. * mips/jmr3904app-java.ld: Likewise. * mips/jmr3904app.ld: Likewise. * mips/jmr3904dram-java.ld: Likewise. * mips/jmr3904dram.ld: Likewise. * mips/lsi.ld: Likewise. * mips/mti32.ld: Likewise. * mips/mti64.ld: Likewise. * mips/mti64_64.ld: Likewise. * mips/mti64_n32.ld: Likewise. * mips/nullmon.ld: Likewise. * mips/pmon.ld: Likewise. * mips/sde32.ld: Likewise. * mips/sde64.ld: Likewise.
* Cygwin: FIFO: code simplifications.Ken Brown2019-05-091-11/+2
| | | | | | | | | | There's no longer a need to consider the connect_evt after fork/exec. After stopping the listen_client thread, all client handlers should be in the fc_connected or fc_invalid states, so their connect_evt members won't be used again. Also remove code in fhandler_fifo::dup that just repeats things already done in stop_listen_client.
* Cygwin: FIFO: make read_ready an auto-reset eventKen Brown2019-05-091-1/+1
| | | | | There's no point in allowing a writer to attempt to open until we've created a pipe instance.
* Cygwin: FIFO: improve the check for the listen_client threadKen Brown2019-05-092-2/+33
| | | | | | Add a method fhandler_fifo::check_listen_client_thread that checks whether the thread is running. Use it in raw_read instead of just testing the handle listen_client_thr.
* Cygwin: FIFO: set client handler flags more accuratelyKen Brown2019-05-091-1/+3
| | | | | Reflect the fact that client handlers are only used for reading and that, after connection, they are always nonblocking.
* Cygwin: FIFO: don't leave a pending listen requestKen Brown2019-05-092-53/+59
| | | | | | | | | | | | | On exit from the listen_client thread, make sure there's no pending FSCTL_PIPE_LISTEN request. Otherwise we might get a client connection after restarting the thread, and we won't have a handle for communicating with that client. Remove the retry loop in the case of STATUS_PIPE_LISTENING; that case shouldn't occur. Remove the now-unused fc_connecting value from fifo_client_connect_state.
* Cygwin: FIFO: add a HANDLE parameter to open_pipeKen Brown2019-05-092-9/+9
| | | | | | | | It's now up to the caller to pass a handle to open_pipe and, if desired, to call set_handle on return. This will be useful for a future commit, in which we will open a client connection without setting an io_handle.
* Cygwin: FIFO: re-implement duplexersKen Brown2019-05-092-34/+11
| | | | | | | | | | | | | | | | When opening a duplexer, open a client connection to the first client handler. Previously we gave the duplexer a bogus write handle, which was just a duplicate of the first client handler's handle. This meant that we had a pipe server with no clients connected, and all I/O attempts failed with STATUS_PIPE_LISTENING. Extend the last fcntl change to duplexers. Remove a now unused fifo_client_handler constructor, as well as the long unusued method fifo_client_handler::connect. Don't create the pipe in duplex mode; the server handle will only be used for reading.
* Cygwin: FIFO: add 'record_connection' methodKen Brown2019-05-092-9/+15
| | | | | Future commits will have to re-use the code for recording a client connection. For convenience, factor out this code into a new method.
* Cygwin: FIFO: remove incorrect duplexer codeKen Brown2019-05-091-15/+8
| | | | | raw_read had some code that was based on an incorrect implementation of duplexers.
* Revert "Cygwin: check for STATUS_PENDING in fhandler_base::raw_read"Ken Brown2019-05-091-13/+1
| | | | | This reverts commit 10bf30bebf7feebbc3e376cbcac62a242cc240f3. It was made because an incorrect implementation of duplex FIFOs.
* Cygwin: dll_list: drop unused read_fbi methodMichael Haubenwallner2019-05-052-24/+0
|
* Cygwin: Add release info for 3.0.7Corinna Vinschen2019-04-302-0/+21
| | | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de> (cherry picked from commit 01c253a4c58b6c1da01615431bdc4c88fcba48ea)
* Cygwin: dll_list: query dll file id at load timeMichael Haubenwallner2019-04-302-4/+2
| | | | | | | NtQueryVirtualMemory for MemorySectionName does not reliable return the changed dll file name when another process does move the file around, and we may end up creating forkable hardlinks to wrong dll files. So query the file id when loading the dll rather than before fork.
* Cygwin: dll_list: stat_real_file_once as dll methodMichael Haubenwallner2019-04-302-10/+13
| | | | | | Make stat_real_file_once a method of struct dll, to be more flexible on where to use. Also, debug print memory section name queried for a dll. This is a preparation to query the file id when loading the dll.
* Cygwin: dll_list: drop FILE_BASIC_INFORMATIONMichael Haubenwallner2019-04-303-6/+3
| | | | | Querying FILE_BASIC_INFORMATION is needless since using win pid+threadid for forkables dirname rather than newest last write time.
* Cygwin: update era and message locale dataCorinna Vinschen2019-04-302-317/+341
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Fix order of eh_frame sections in linker scriptsFaraz Shahbazker2019-04-2918-18/+118
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The compiler driver positions the linker script at the end of the linker command-line, after crtend.o. As a result, any INPUT objects and archive GROUPs introduced by the linker script are placed after crtend.o and the end-of-frame marker provided by crtend.o ends up in between .eh_frames instead of being at the end. This has always been a problem, but a binutils update to clean-up redundant NULL markers in .eh_frame exposes it as a execution failure in exception-handling tests. This patch re-orders .eh_frames in all MIPS linker scripts so that the one from crtend.o is always placed last. libgloss/ * mips/array.ld: Re-order to place .eh_frame from crtend.o after all other .eh_frame sections. * mips/cfe.ld: Likewise. * mips/ddb-kseg0.ld: Likewise. * mips/ddb.ld: Likewise. * mips/dve.ld: Likewise. * mips/idt.ld: Likewise. * mips/idt32.ld: Likewise. * mips/idt64.ld: Likewise. * mips/jmr3904app.ld: Likewise. * mips/lsi.ld: Likewise. * mips/mti32.ld: Likewise. * mips/mti64.ld: Likewise. * mips/mti64_64.ld: Likewise. * mips/mti64_n32.ld: Likewise. * mips/nullmon.ld: Likewise. * mips/pmon.ld: Likewise. * mips/sde32.ld: Likewise. * mips/sde64.ld: Likewise.
* Cygwin: FIFO: synchronize the blocking mode of a writer's pipeKen Brown2019-04-262-0/+17
| | | | | | | The blocking mode of the Windows pipe underlying a writer is set to match that of the writer itself when the latter is opened. Define fhandler_fifo::fcntl to keep the pipe and the writer in sync if the blocking mode is changed via fcntl.
* Cygwin: define MSG_EOR and refuse in send(2)Corinna Vinschen2019-04-253-0/+13
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Minor improvements to socket error handling:Erik M. Bray2019-04-231-1/+4
| | | | | | | | | * Change default fallback for failed winsock error -> POSIX error mappings to EACCES, which is a valid errno for more socket-related syscalls. * Added a few previously missing entries to the wsock_errmap table that have obvious POSIX errno.h analogues.
* Cygwin: FIFO: restart listen_client thread after fork/execKen Brown2019-04-221-7/+5
| | | | | This allows writers to connect immediately. Previously the lct wasn't restarted until the reader attempted to read.
* Cygwin: FIFO: stop the listen_client thread before fork/execKen Brown2019-04-202-2/+16
| | | | | | | Add methods need_fixup_before, init_fixup_before, and fixup_before_fork_exec to accomplish this. Stopping the thread makes sure that the client handler lists of the parent and child remain in sync while the forking/execing is in progress.
* Cygwin: FIFO: close connect_evt handles as soon as possibleKen Brown2019-04-201-7/+10
| | | | | Keeping them open too long can cause an attempt to close them twice after a fork or exec.
* Cygwin: FIFO: avoid WFMO error in listen_client_threadKen Brown2019-04-201-5/+7
| | | | | | Don't set lct_termination_evt to NULL too early in fhandler_fifo::stop_listen_client. Doing so leads to an "Invalid Handle" error in WFMO.
* Cygwin: FIFO: duplicate the i/o handle when opening a duplexerKen Brown2019-04-201-1/+8
| | | | | | Don't use the same i/o handle for the first client handler as is used for the fhandler itself; this can lead to a later attempt to close the same handle twice. Instead use a duplicate.
* Cygwin: FIFO: stop the listen_client thread on an opening errorKen Brown2019-04-201-1/+1
| | | | Don't just close the thread handle.
* Cygwin: drop unsupported Windows 10 versionsCorinna Vinschen2019-04-191-31/+1
| | | | | | | * Pre-release version still reporting kernel version 6.4. * Windows 10 1511 is out of support since 2017-10-10. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: FIFO: avoid hang after execKen Brown2019-04-182-0/+10
| | | | | | | Define fhandler:fifo::fixup_after_exec, which sets listen_client_thr and lct_termination_evt to NULL. This forces the listen_client thread to restart on the first attempt to read after an exec. Previously the exec'd process could hang in fhandler_fifo::raw_read.
* MSP430: Make the inclusion of run_*_array fns depend on defined assembler ↵Jozef Lawrynowicz2019-04-183-22/+74
| | | | | | | | | | | | | | | | | | | | | | symbols Many of the MSP430 crt functions (e.g. to initialize bss) are linked "dynamically", based on symbols defined in the program. The GNU assembler defines the symbols corresponding to the crt functions by examining the section names in the input file. If GCC has been configured with --enable-initfini-array, then .init_array and .fini_array will hold pointers to global constructors/destructors. These sections can also hold functions that need to be executed for other purposes. The attached patch puts the __crt0_run_{preinit,init,fini}_array and __crt0_run_array functions in their own object files, so they will only be linked when needed. Successfully regtested the DejaGNU GCC testsuite using the binutils and newlib changes together with GCC trunk configured with --enable-initfini-array.
* Fix incorrect assembly code in _msp430_run_arrayJozef Lawrynowicz2019-04-161-2/+2
|
* Cygwin: FIFO: fix and simplify listen_client_threadKen Brown2019-04-162-153/+109
| | | | | | | | | | | | | | | | | | | | | | | | | | Remove fifo_client_handler::connect and move its code into listen_client_thread. That way we can check the return status when a client handler's connect_evt is signaled. Previously we incorrectly assumed there was a successful connection. Also simplify listen_client_thread in the following ways: - Replace fhandler_fifo::disconnect_and_reconnect by a new delete_client_handler method. Now we just delete invalid client handlers rather than trying to re-use them. - Try to maintain a client handler list that consists of connected client handlers and exactly one that is listening for a connection. This allows us to call WaitForMultipleObjects with only two wait objects. - Remove 'dummy_evt' from the fifo_client_handler struct; it is no longer needed. - On exit from listen_client_thread, delete the "extra" (listening) client handler. Otherwise there could be a connection that doesn't get recorded in the client handler list. This could happen when a file descriptor is being duplicated.
* Cygwin: FIFO: improve raw_writeKen Brown2019-04-163-20/+80
| | | | | | | | | | | | | | | Don't set the write end of the pipe to non-blocking mode if the FIFO is opened in blocking mode. In fhandler_fifo::raw_write in blocking mode, wait for the write to complete rather than returning -1 with EAGAIN. If the amount to write is large, write in smaller chunks (of size determined by a new data member max_atomic_write), as in fhandler_base_overlapped. For convenience, add two new NTSTATUS codes, STATUS_THREAD_SIGNALED and STATUS_THREAD_CANCELED, to ntdll.h.
* Cygwin: FIFO: start the listen_client thread when duping a readerKen Brown2019-04-161-9/+13
| | | | | Otherwise it doesn't get started until the dup'd fd tries to read, which delays client connections.
* Cygwin: FIFO: fix cloneKen Brown2019-04-162-5/+21
| | | | | | | | | | | | | | | After copyto is called, make the new fhandler's pipe_name point to the new fhandler's pipe_name_buf, which is a *copy* of the old fhandler's pipe_name_buf. Previously, get_pipe_name would return the wrong result after a clone/dup, causing create_pipe_instance and open_pipe to fail. Also, stop the listen_client thread when cloning. Otherwise the thread can keep accepting connections that the cloned fhandler won't know about. Do this via a new method fhandler_fifo::stop_listen_client, extracted from fhandler_fifo::close.
* Cygwin: FIFO: use a retry loop when opening a writerKen Brown2019-04-161-21/+31
| | | | | There may be short periods when there's no pipe instance available. Keep trying.
* Cygwin: FIFO: fix the use of the read_ready eventKen Brown2019-04-161-35/+16
| | | | | | | | | | Make read_ready a manual reset event. It should always be set shortly after startup of the listen_client thread and remain set until the thread terminates. (We don't want writers to connect without being recorded in the client handler list.) Remove the unnecessary code that checks for read_ready when a reader is opening.
* Cygwin: FIFO: fix fifo_client_handler::closeKen Brown2019-04-161-1/+4
| | | | | | Make sure that fhandler_base::close rather than fhandler_fifo::close is called on the fhandler. Also, delete the fhandler, since we allocated it.
* Cygwin: FIFO: code simplification: don't overload get_handleKen Brown2019-04-162-4/+5
| | | | | Rename fhandler_fifo::get_handle(int) to get_fc_handle(int), and remove fhandler_fifo::get_handle(void).
* Cygwin: check for STATUS_PENDING in fhandler_base::raw_readKen Brown2019-04-161-1/+13
| | | | | | If NtReadFile returns STATUS_PENDING, wait for the read to complete. This can happen, for instance, in the case of a FIFO opened with O_RDRW.
* Cygwin: FIFO: fix the error checking in raw_readKen Brown2019-04-161-8/+5
| | | | | If the pipe is empty, we can get either ERROR_NO_DATA or ERROR_PIPE_LISTENING.
* Cygwin: FIFO: fix a thinko in listen_client_threadKen Brown2019-04-161-1/+4
|