]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
RTEMS: Fix libgomp build
authorSebastian Huber <sebastian.huber@embedded-brains.de>
Mon, 18 Jan 2021 06:23:46 +0000 (07:23 +0100)
committerKwok Cheung Yeung <kcy@codesourcery.com>
Fri, 22 Jan 2021 16:19:05 +0000 (08:19 -0800)
libgomp/

* config/rtems/sem.h (gomp_sem_getcount): New function.

(cherry picked from commit 0f951b3dd34b355579b4c9a9e287d32ac771bc67)

libgomp/ChangeLog.omp
libgomp/config/rtems/sem.h

index 632b86989c3a45c7873302f430ab92a44a3f9945..bc500000af86060d8f0be2209db6b3e899459f56 100644 (file)
@@ -1,3 +1,10 @@
+2021-01-22  Kwok Cheung Yeung  <kcy@codesourcery.com>
+
+       Backport from mainline
+       2021-01-18  Sebastian Huber <sebastian.huber@embedded-brains.de>
+
+       * config/rtems/sem.h (gomp_sem_getcount): New function.
+
 2021-01-22  Kwok Cheung Yeung  <kcy@codesourcery.com>
 
        Backport from mainline
index cc7faa7ec1e8bfb02f57b90519d1172de16e102c..5765560e26ba090e3c36ad298c00d8745a0fb6d4 100644 (file)
@@ -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);