Commit 71b9d165 authored by Alberto Escolar Piedras's avatar Alberto Escolar Piedras Committed by Benjamin Cabé
Browse files

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: default avatarAlberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
parent 0f1d816c
Loading
Loading
Loading
Loading
+2 −2
Changes for scripts/native_simulator/Makefile: 2 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -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 −0
Changes for scripts/native_simulator/common/src/include/nsi_errno.h: 6 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -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 −0
Changes for scripts/native_simulator/common/src/nsi_errno.c: 12 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -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());
}