Browse Source

native_simulator: Get latest from upstream

Align with native_simulator's upstream main
3ccb09ec00e291f699219c0e3f5b14b6b1c7ceb6

Which includes:
3ccb09e nsi_errno: Add new API to get the current host side errno
32eab87 Makefile: Ser a macro to distinguish build in runner context

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
pull/86754/head
Alberto Escolar Piedras 4 months ago committed by Benjamin Cabé
parent
commit
71b9d16558
  1. 4
      scripts/native_simulator/Makefile
  2. 6
      scripts/native_simulator/common/src/include/nsi_errno.h
  3. 12
      scripts/native_simulator/common/src/nsi_errno.c

4
scripts/native_simulator/Makefile

@ -68,8 +68,8 @@ NSI_CPPFLAGS?=-D_POSIX_C_SOURCE=200809L -D_XOPEN_SOURCE=600 -D_XOPEN_SOURCE_EXTE @@ -68,8 +68,8 @@ NSI_CPPFLAGS?=-D_POSIX_C_SOURCE=200809L -D_XOPEN_SOURCE=600 -D_XOPEN_SOURCE_EXTE
NO_PIE_CO:=-fno-pie -fno-pic
DEPENDFLAGS:=-MMD -MP
COMMON_BUILD_FLAGS:=${NSI_DEBUG} ${NSI_WARNINGS} ${NSI_OPT} ${NO_PIE_CO} -DNSI_N_CPUS=${NSI_N_CPUS}\
-ffunction-sections -fdata-sections ${DEPENDFLAGS} ${NSI_BUILD_OPTIONS}
COMMON_BUILD_FLAGS:=-DNSI_RUNNER_BUILD ${NSI_DEBUG} ${NSI_WARNINGS} ${NSI_OPT} ${NO_PIE_CO} \
-DNSI_N_CPUS=${NSI_N_CPUS} -ffunction-sections -fdata-sections ${DEPENDFLAGS} ${NSI_BUILD_OPTIONS}
CFLAGS:=-std=c11 ${COMMON_BUILD_FLAGS} ${NSI_BUILD_C_OPTIONS}
CXXFLAGS:=${COMMON_BUILD_FLAGS} ${NSI_BUILD_CXX_OPTIONS}
FINALLINK_FLAGS:=${NO_PIE_CO} -no-pie ${NSI_WARNINGS} \

6
scripts/native_simulator/common/src/include/nsi_errno.h

@ -103,7 +103,13 @@ @@ -103,7 +103,13 @@
#define NSI_ERRNO_MID_EOVERFLOW 139 /**< Value overflow */
#define NSI_ERRNO_MID_ECANCELED 140 /**< Operation canceled */
/* Convert a errno value to the intermediate represetation to pass it to the other side */
int nsi_errno_to_mid(int err);
/* Convert a errno value from the intermediate representation into the local libC value */
int nsi_errno_from_mid(int err);
/* Return the middleground representation of the current host libC errno */
int nsi_get_errno_in_mid(void);
/* Return the local representation of the current host libC errno */
int nsi_host_get_errno(void);
#endif /* NSI_COMMON_SRC_NSI_ERRNO_H */

12
scripts/native_simulator/common/src/nsi_errno.c

@ -128,3 +128,15 @@ int nsi_errno_from_mid(int err) @@ -128,3 +128,15 @@ int nsi_errno_from_mid(int err)
return err;
}
#if defined(NSI_RUNNER_BUILD)
int nsi_get_errno_in_mid(void)
{
return nsi_errno_to_mid(errno);
}
#endif
int nsi_host_get_errno(void)
{
return nsi_errno_from_mid(nsi_get_errno_in_mid());
}

Loading…
Cancel
Save