aboutsummaryrefslogtreecommitdiff
path: root/libgomp/config/rtems
AgeCommit message (Collapse)AuthorFilesLines
2022-01-03Update copyright years.Jakub Jelinek7-7/+7
2021-10-15openmp: Fix up strtoul and strtoull uses in libgompJakub Jelinek1-4/+7
Yesterday when working on numa_domains, I've noticed because of a bug in my patch a hang on a large NUMA machine. I've fixed the bug, but also discovered that the hang was a result of making wrong assumptions about strtoul/strtoull. All the uses were for portability setting errno = 0 before the calls and treating non-zero errno after the call as invalid input, but for the case where there are no valid digits at all strtoul may set errno to EINVAL, but doesn't have to and with glibc doesn't do that. So, this patch goes through all the strtoul calls and next to errno != 0 checks adds also endptr == startptr check. Haven't done it in places where we immediately reject strtoul returning 0 the same as we reject errno != 0, because strtoul must return 0 in the case where it sets endptr to the start pointer. In some spots the code was using errno = 0; x = strtoul (p, &p, 10); if (errno) { /*invalid*/ } and those spots had to be changed to errno = 0; x = strtoul (p, &end, 10); if (errno || end == p) { /*invalid*/ } p = end; 2021-10-15 Jakub Jelinek <jakub@redhat.com> * env.c (parse_schedule): For strtoul or strtoull calls which don't clearly reject return value 0 as invalid handle the case where end pointer is the same as first argument as invalid. (parse_unsigned_long_1): Likewise. (parse_one_place): Likewise. (parse_places_var): Likewise. (parse_stacksize): Likewise. (parse_spincount): Likewise. (parse_affinity): Likewise. (parse_gomp_openacc_dim): Likewise. Avoid strict aliasing violation. Make code valid C89. * config/linux/affinity.c (gomp_affinity_find_last_cache_level): For strtoul calls which don't clearly reject return value 0 as invalid handle the case where end pointer is the same as first argument as invalid. (gomp_affinity_init_level_1): Likewise. (gomp_affinity_init_numa_domains): Likewise. * config/rtems/proc.c (parse_thread_pools): Likewise.
2021-01-18RTEMS: Fix libgomp buildSebastian Huber1-0/+5
libgomp/ * config/rtems/sem.h (gomp_sem_getcount): New function.
2021-01-04Update copyright years.Jakub Jelinek7-7/+7
2020-01-01Update copyright years.Jakub Jelinek7-7/+7
From-SVN: r279813
2019-01-09libgomp: Reduce copy and paste for RTEMSSebastian Huber1-181/+2
libgomp/ * config/rtems/bar.c: Include "../linux/bar.c" and delete copy and paste code. From-SVN: r267752
2019-01-09libgomp: Avoid complex dependencies for RTEMSSebastian Huber1-0/+49
libgomp/ * config/rtems/affinity-fmt.c: New file. Include affinity-fmt.c, undefining HAVE_GETPID and HAVE_GETHOSTNAME, and mapping fwrite to write. From-SVN: r267751
2019-01-01Update copyright years.Jakub Jelinek6-6/+6
From-SVN: r267494
2018-01-03Update copyright years.Jakub Jelinek6-6/+6
From-SVN: r256169
2017-01-01Update copyright years.Jakub Jelinek6-6/+6
From-SVN: r243994
2016-12-02[RTEMS] Use spin lock for pool managementSebastian Huber2-6/+6
libgomp/ * libgomp/config/rtems/pool.h (gomp_thread_pool_reservoir): Use pthread_spinlock_t instead of gomp_mutex_t lock. (gomp_get_thread_pool): Likewise. (gomp_release_thread_pool): Likewise. * libgomp/config/rtems/proc.c (allocate_thread_pool_reservoir): Likewise. From-SVN: r243181
2016-12-02[RTEMS] Fix libgomp for nthreads == 1Sebastian Huber1-15/+11
libgomp/ * config/rtems/pool.h (gomp_get_thread_pool): Return proper thread pool in case nthreads == 1. From-SVN: r243179
2016-01-04Update copyright years.Jakub Jelinek6-6/+6
From-SVN: r232055
2015-09-03[gomp] Add thread attribute customizationSebastian Huber2-4/+48
libgomp/ChangeLog * config/posix/pool.h (gomp_adjust_thread_attr): New. * config/rtems/pool.h (gomp_adjust_thread_attr): Likewise. (gomp_thread_pool_reservoir): Add priority member. * confi/rtems/proc.c (allocate_thread_pool_reservoir): Add priority. (parse_thread_pools): Likewise. * team.c (gomp_team_start): Call configuration provided gomp_adjust_thread_attr(). Destroy thread attributes if necessary. * libgomp.texi: Document GOMP_RTEMS_THREAD_POOLS. From-SVN: r227442
2015-09-03[gomp] Thread pool managementSebastian Huber2-0/+273
libgomp/ChangeLog * config/posix/pool.h: New. * config/rtems/pool.h: Likewise. * config/rtems/proc.c: Likewise. * libgomp.h (gomp_thread_destructor): Declare. * team.c: Include configuration provided "pool.h". (gomp_get_thread_pool): Define in configuration. (gomp_team_end): Call configuration defined gomp_release_thread_pool(). From-SVN: r227441
2015-09-03[gomp] Add RTEMS configurationSebastian Huber6-0/+539
libgomp/ChangeLog * config/rtems/bar.c: New. * config/rtems/bar.h: Likewise. * config/rtems/mutex.c: Likewise. * config/rtems/mutex.h: Likewise. * config/rtems/sem.c: Likewise. * config/rtems/sem.h: Likewise. * configure.ac (*-*-rtems*): Check that Newlib provides a proper <sys/lock.h> header file. * configure.tgt (*-*-rtems*): Enable RTEMS configuration if supported by Newlib. * configure: Regenerate. From-SVN: r227440