From: Sebastian Huber Date: Mon, 18 Jan 2021 06:23:46 +0000 (+0100) Subject: RTEMS: Fix libgomp build X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f61fbb53ecf775cd491794f14847c2f1ebc88951;p=thirdparty%2Fgcc.git RTEMS: Fix libgomp build libgomp/ * config/rtems/sem.h (gomp_sem_getcount): New function. (cherry picked from commit 0f951b3dd34b355579b4c9a9e287d32ac771bc67) --- diff --git a/libgomp/ChangeLog.omp b/libgomp/ChangeLog.omp index 632b86989c3a..bc500000af86 100644 --- a/libgomp/ChangeLog.omp +++ b/libgomp/ChangeLog.omp @@ -1,3 +1,10 @@ +2021-01-22 Kwok Cheung Yeung + + Backport from mainline + 2021-01-18 Sebastian Huber + + * config/rtems/sem.h (gomp_sem_getcount): New function. + 2021-01-22 Kwok Cheung Yeung Backport from mainline diff --git a/libgomp/config/rtems/sem.h b/libgomp/config/rtems/sem.h index cc7faa7ec1e8..5765560e26ba 100644 --- a/libgomp/config/rtems/sem.h +++ b/libgomp/config/rtems/sem.h @@ -47,6 +47,11 @@ static inline void gomp_sem_post (gomp_sem_t *sem) _Semaphore_Post (sem); } +static inline int gomp_sem_getcount (gomp_sem_t *sem) +{ + return (int) __atomic_load_n (&sem->_count, MEMMODEL_RELAXED); +} + static inline void gomp_sem_destroy (gomp_sem_t *sem) { _Semaphore_Destroy (sem);