Skip to content

Commit cfc133d

Browse files
aescolarThalley
authored andcommitted
native_simulator: Get latest from upstream
Align with native_simulator's upstream main 4641dad899979528e4083aa762651388a2a7ec7b Which includes: 4641dad common: nsi_internal.h: Use NSI_INLINE macros 7a1156c nsi_tasks: move header to include folder 6b7d76a nct: fix restarting sem_wait after signal 166516d nce: fix restarting sem_wait after signal Signed-off-by: Alberto Escolar Piedras <[email protected]>
1 parent 16f4d6c commit cfc133d

File tree

4 files changed

+5
-6
lines changed

4 files changed

+5
-6
lines changed
File renamed without changes.

scripts/native_simulator/common/src/nce.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ NSI_INLINE int nce_sem_rewait(sem_t *semaphore)
5252
{
5353
int ret;
5454

55-
while ((ret = sem_wait(semaphore)) == EINTR) {
55+
while (((ret = sem_wait(semaphore)) == -1) && (errno == EINTR)) {
5656
/* Restart wait if we were interrupted */
5757
}
5858
return ret;

scripts/native_simulator/common/src/nct.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ NSI_INLINE int nct_sem_rewait(sem_t *semaphore)
146146
{
147147
int ret;
148148

149-
while ((ret = sem_wait(semaphore)) == EINTR) {
149+
while (((ret = sem_wait(semaphore)) == -1) && (errno == EINTR)) {
150150
/* Restart wait if we were interrupted */
151151
}
152152
return ret;

scripts/native_simulator/common/src/nsi_internal.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#define NSI_COMMON_SRC_NSI_INTERNAL_H
99

1010
#include <stdint.h>
11+
#include "nsi_utils.h"
1112

1213
#ifdef __cplusplus
1314
extern "C" {
@@ -23,8 +24,7 @@ extern "C" {
2324
*
2425
* @return least significant bit set, 0 if @a op is 0
2526
*/
26-
27-
static inline unsigned int nsi_find_lsb_set(uint32_t op)
27+
NSI_INLINE unsigned int nsi_find_lsb_set(uint32_t op)
2828
{
2929
return __builtin_ffs(op);
3030
}
@@ -39,8 +39,7 @@ static inline unsigned int nsi_find_lsb_set(uint32_t op)
3939
*
4040
* @return least significant bit set, 0 if @a op is 0
4141
*/
42-
43-
static inline unsigned int nsi_find_lsb_set64(uint64_t op)
42+
NSI_INLINE unsigned int nsi_find_lsb_set64(uint64_t op)
4443
{
4544
return __builtin_ffsll(op);
4645
}

0 commit comments

Comments
 (0)