summaryrefslogtreecommitdiffstats
path: root/cpukit/libcsupport (follow)
Commit message (Collapse)AuthorAgeFilesLines
* cpukit: Change _COMPILING_NEWLIB to _LIBC for helper functions declsChris Johns2022-06-152-3/+3
| | | | Updates #4662
* Synchronize all file descriptors in sync()Sebastian Huber2022-05-171-72/+12
| | | | | | | Synchronize all file descriptors and not just the ones associated with a FILE object. Close #4656.
* error.c: Add file header and licenseRyan Long2022-05-041-2/+28
| | | | | This file had no header, copyright, or license. Based on git history, added appropriate copyright and license.
* __getpid: Add file headers and licensesRyan Long2022-05-041-0/+28
| | | | | This file had no header, copyright, or license. Based on git history, added appropriate copyright and license.
* cpukit/libcsupport: Adding file headers and licensesRyan Long2022-05-0425-10/+734
| | | | | These files had no file header, copyright, or license. Based on git history, added appropriate copyright and license.
* Update email address of Fernando Ruiz Casas to <fruizcasas@gmail.com>Joel Sherrill2022-04-056-10/+10
| | | | This was requested to be executed prior to relicensing to BSD-2.
* cpukit/libcsupport/src/_*: Change license to BSD-2Joel Sherrill2022-04-018-24/+176
| | | | Updates #3053.
* cpukit/libcsupport/src/[g-r]*: Change license to BSD-2Joel Sherrill2022-04-0151-157/+1132
| | | | Updates #3053.
* cpukit/libcsupport/src/[s-z]*: Change license to BSD-2Joel Sherrill2022-04-0140-127/+893
| | | | Updates #3053.
* cpukit/libcsupport/src/[a-f]*: Change license to BSD-2Joel Sherrill2022-04-0138-117/+841
| | | | Updates #3053.
* libcsupport: Use _fwalk_reent()Sebastian Huber2022-04-011-19/+10
| | | | | Use _fwalk_reent() instead of _fwalk(), since _fwalk() was removed from Newlib. Include <sys/reent.h> and remove local declarations.
* cpukit/: Update Eric Norum contact info and normalize file headersJoel Sherrill2022-03-246-22/+12
|
* cpukit/: Scripted embedded brains header file clean upJoel Sherrill2022-03-1029-173/+1
| | | | Updates #4625.
* termios: Pass number of sent chars to l_startChristian Mauderer2022-02-101-2/+3
| | | | | | | | | | | | | At the moment the line discipline start function (l_start) has no possibility to get feedback about the number of characters that have been sent. This patch passes that information via an additional parameter. The change might trigger a warning on existing code because of a pointer mismatch but it shouldn't break it. An existing function with the old API will just ignore the additional parameter. Update #4493
* Remove obsolete rtems_gxx_*() implementationSebastian Huber2022-01-271-261/+0
| | | | | | | | | | | GCC versions prior to 6.1 used a RTEMS thread model based on rtems_gxx_*() functions. GCC version 6.1 or later uses the self-contained synchronization objects of Newlib <sys/lock.h> for the RTEMS thread model. Remove the obsolete implementation. Close #3143.
* libc: Optimize malloc() initializationSebastian Huber2021-11-302-82/+1
| | | | | | | | | | | | | | | | The BSPs provide memory for the separate C Program Heap initialization via _Memory_Get(). Most BSPs provide exactly one memory area. Only two BSPs provide more than one memory area (arm/altera-cyclone-v and bsps/powerpc/mpc55xxevb). Only if more than one memory area is provided, there is a need to use _Heap_Extend(). Provide two implementations to initialize the separate C Program Heap and let the BSP select one of the implementations based on the number of provided memory areas. This gets rid of a dependency on _Heap_Extend(). It also avoids dead code sections for most BSPs. Change licence to BSD-2-Clause according to file history. Update #3053.
* rtems: Fix rate monotonic statisticsSebastian Huber2021-10-251-1/+2
| | | | | | | | | | | | | | | The rate monotonic period statistics were affected by rtems_cpu_usage_reset(). The logic to detect and work around a CPU usage reset was broken. The Thread_Contol::cpu_time_used is changed to contain the processor time used throughout the entire lifetime of the thread. The new member Thread_Contol::cpu_time_used_at_last_reset is added to contain the processor time used at the time of the last reset through rtems_cpu_usage_reset(). This decouples the resets of the CPU usage and the rate monotonic period statistics. Update #4528.
* pxcdevctl: Adjust for standardRyan Long2021-09-201-8/+72
| | | | | | | | psxdevctl is supposed to return the value in errno. Before, it was returning -1 and setting errno. Changed the tests to reflect these changes. Added code from RRADE's posix_devctl.c. Closes #4506
* rtems: Generate <rtems/bspIo.h>Sebastian Huber2021-08-027-14/+28
| | | | | | | | | | | | Change license to BSD-2-Clause according to file histories and documentation re-licensing agreement. Place the group into the I/O Manager group. Add all source files to the group. Update #3899. Update #3993. Update #4482.
* libcsupport: Consistent rtems_putc() outputSebastian Huber2021-07-281-16/+34
| | | | | | | | | Use the same function to output the '\r\n' combination produced by rtems_putc(). Fix the format. Change licence according to file history. Update #3053.
* libcsupport: Fix TOCTOU in getchark()Sebastian Huber2021-07-281-8/+13
| | | | | | | Use the same function pointer value to check against NULL and call the function (if non-NULL). Fix format, add Doxygen comments, and reduce includes.
* futimens.c, utime.c: Remove unnecessary include of <sys/stat.h>.Joel Sherrill2021-06-092-2/+0
|
* Change filesystem utime_h handler to utimens_hRyan Long2021-05-283-13/+30
| | | | | | | Also updated licenses. Closes #4400 Updates #3899
* libcsupport: Implement utimes() in terms of utimensat()Ryan Long2021-05-281-14/+49
| | | | | | | | | utimes() now calls utimensat() to update file access and modification timestamps. Updated license. Closes #4398
* libcsupport: Implement utime() in terms of utimensat()Ryan Long2021-05-281-32/+40
| | | | | | | | | utime() now calls utimensat() to update file access and modification timestamps. Updated license. Closes #4397
* libcsupport: Added futimens() and utimensat()Ryan Long2021-05-282-0/+312
| | | | | | | | | | Created futimens.c and utimensat.c to add support for the POSIX methods futimens() and utimensat(). utime() and utimes() are considered obsolote by POSIX, but RTEMS will continue to support them. Closes #4396
* sysinit: Do not open console when just referencing reentrancy structure.Joel Sherrill2021-05-251-6/+0
| | | | | | | | | This change eliminates a system initialization dependentcy which resulted in an application without a file system or console referencing errno being forced to include the code to open(/dev/console), close(), atexit(), and the unmount infrastructure. Closes #4439.
* Check the alignment in posix_memalign() earlierSebastian Huber2021-05-071-4/+4
| | | | | | | Make sure all conditions to do a proper memory allocation are satisfied before a zero size memory allocation is performed. Update #4390.
* Return NULL for zero size allocationsSebastian Huber2021-05-067-8/+30
| | | | | | | | | | | | | | | In POSIX, zero size memory allocations are implementation-defined behaviour. The implementation has two options: https://pubs.opengroup.org/onlinepubs/9699919799/functions/malloc.html https://pubs.opengroup.org/onlinepubs/9699919799/functions/posix_memalign.html Linux and FreeBSD return a unique pointer for zero size memory allocations. Return NULL on RTEMS to more likely catch the use of a zero size memory area by erroneous applications. Update #4390.
* libc: Reimplement posix_memlign()Sebastian Huber2021-05-061-7/+22
| | | | | | | | Move all error checks into posix_memalign() so that the returned memory pointer is set to NULL under all error conditions except memptr == NULL. Use parameter names of POSIX documentation.
* Make zero size allocation result consistentSebastian Huber2021-05-043-14/+4
| | | | | | | | | | | | | | | | | | The zero size allocations had no consistent behaviour in RTEMS. For example, malloc( 0 ) returned NULL and posix_memalign( &p, align, 0 ) returned in p a unique pointer (or NULL if no memory is available). In POSIX, zero size memory allocations are implementation-defined behaviour. The implementation has two options: https://pubs.opengroup.org/onlinepubs/9699919799/functions/malloc.html https://pubs.opengroup.org/onlinepubs/9699919799/functions/posix_memalign.html Linux and FreeBSD return a unique pointer for zero size memory allocations. Use this approach for RTEMS as well throughout the memory allocation directives Close #4390.
* pwdgrp.c: Removed unused variableRyan Long2021-04-291-2/+0
| | | | | | | The 'sc' variable was originally storing the return value of mkdir(). This was causing an issue, so it was changed to make it to where we ignored the return value with (void). The 'sc' variable was left in by mistake.
* Fix calloc() behaviour in case of overflowSebastian Huber2021-04-202-2/+20
| | | | | | | The multiplication to calculate the length of the memory area to allocate may overflow. Return NULL in case of an overflow. Close #4389.
* malloc: Hide RTEMS_Malloc_Sbrk_amountSebastian Huber2021-04-201-1/+6
| | | | | | Move RTEMS_Malloc_Sbrk_amount to the only implementation file which uses it and make it private to hide implementation-details from an API header.
* libcsupport: Move rtems_calloc()Sebastian Huber2021-04-202-15/+57
| | | | | | | | | Move rtems_calloc() since it only depends on rtems_malloc(). This may make it easier to customize the heap allocator. Change licence to BSD-2-Clause according to file history. Update #3053.
* Remove superfluous <rtems/score/wkspace.h> includesSebastian Huber2021-04-201-1/+0
|
* pwdgrp.c: Change to simply ignore return value from mkdir(/etc)Joel Sherrill2021-03-271-3/+1
| | | | | | | | | | | At this point in time, /etc can be created in multiple ways. There is a discussion (#4354) that would define a mechanism for instantiating a base file system with some flexibility for the set of directories included. For now, this particular mkdir() call can fail because /etc could already have been created by at least an initial filesystem image, the shell, or libbsd. closes #4382.
* pwdgrp.c: Remove _Assert. /etc may already existRyan Long2021-03-231-1/+5
| | | | | | | | Removed the _Assert_unused_variable_equals macro due to /etc having already been created by the network stack initialization or an initial filesystem image. Closes #4282
* pwdgrp.c: Fix Unchecked return value from library (CID #1255518)Ryan Long2021-03-081-1/+5
| | | | | | CID 1255518: Unchecked return value from library in pwdgrp_init(). Closes #4282
* getgrent.c, record-client.c: Add missing includes for assert.hVijay Kumar Banerjee2021-02-271-0/+1
|
* getgrent.c: Fix Unchecked return value error (CID #1459004)Ryan Long2021-02-261-1/+3
| | | | | | CID 1459004: Unchecked return value in endgrent(). Closes #4261
* printertask.c: Fix Unchecked return value (CID #1399710)Ryan Long2021-02-261-3/+8
| | | | | | | CID 1399710: Unchecked return value in printer_task(). CID 1472764: Unchecked return value in rtems_print_printer_task(). Closes #4258
* consolesimpletask.c: Fix Two Unchecked Return Values (CID #1437625 and #1472765)Ryan Long2021-02-121-2/+5
| | | | | | | CID 1437625: Unchecked return value from call to rtems_task_create(). CID 1472765: Unchecked return value from call to rtems_task_start(). Closes #4237.
* libcsupport: Add sbrk greedy support to consume all sbrk memoryChris Johns2021-02-102-12/+70
| | | | | | | | | - Move the heap sbrk code into a separate routnine. - Update heap and workspace greedy allocators to use the common sbrk greedy support. Closes #3982
* libcsupport: Have greedy allocations use consume extended memoryChris Johns2021-02-081-0/+13
| | | | | | | - Call the heap extend handler until all memory has been requested. Closes #3982
* libcsupport: Add no_regular_file_mknod as a mount option to the mount tableChris Johns2021-02-081-5/+8
| | | | | | | | | | | | | - Add the bool flag no_regular_file_mknod to the mount table so a file system can indicate creating regular files is not done by use the mknod handler. The file system will handle creating a file node in the open handler. - Note, the mount option is an enum which means there is only one exclusive option supported. As a result no encapsulation is provided and file systems need to set no_regular_file_mknod directly. Closes #4222
* Decouple the C Program Heap initializationSebastian Huber2020-10-012-44/+90
| | | | | | | Before this patch RTEMS_Malloc_Initialize() had a fixed dependency on _Workspace_Area. Introduce _Workspace_Malloc_initializer to have this dependency only if CONFIGURE_UNIFIED_WORK_AREAS is defined by the application configuration.
* config: Add zero file descriptor data structuresSebastian Huber2020-08-311-0/+46
| | | | | Fix linker errors in the minimum test program on some BSPs introduced by ced28f2cfcee6d32ad7bb72e16b235212eb2eaaf.
* termios: Make rtems_termios_ttyMutex privateSebastian Huber2020-08-042-2/+3
| | | | This mutex is used to maintain termios internal data structures.
* malloc: Make deferred free support optionalSebastian Huber2020-07-243-39/+46
| | | | | | | | | | | | | | | | | | | | Only include the deferred free support if free() is actually used by the application. The free() implementation in RTEMS supports that allocated memory is freed in interrupt context. Since the heap is protected by a mutex, the frees issued in interrupt context cannot immediately be freed to the heap, instead they are placed on a deferred free list. This list is emptied by the core allocation function rtems_heap_allocate_aligned_with_boundary(). This adds a dependency to free() in rtems_heap_allocate_aligned_with_boundary(). In order to better support applications which only allocate memory and never free it, this dependency should be avoided. Provide a weak default implementation of _Malloc_Process_deferred_frees() for rtems_heap_allocate_aligned_with_boundary(). In the free() module provide the strong implementation. Close #4032.