This is an automated email from the ASF dual-hosted git repository.
xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git
The following commit(s) were added to refs/heads/master by this push:
new 2719869ab2 Move _assert to kernel space.
2719869ab2 is described below
commit 2719869ab2e6c9517e182445581494e7d9ac2ea3
Author: 田昕 <[email protected]>
AuthorDate: Tue Dec 6 14:33:13 2022 +0800
Move _assert to kernel space.
Signed-off-by: 田昕 <[email protected]>
---
include/sys/syscall_lookup.h | 2 +-
libs/libc/assert/Make.defs | 2 --
sched/Makefile | 1 +
{libs/libc/assert => sched/misc}/Make.defs | 13 +++++--------
libs/libc/assert/lib_assert.c => sched/misc/assert.c | 2 +-
syscall/syscall.csv | 2 +-
6 files changed, 9 insertions(+), 13 deletions(-)
diff --git a/include/sys/syscall_lookup.h b/include/sys/syscall_lookup.h
index c751b902e7..0fcae2aa97 100644
--- a/include/sys/syscall_lookup.h
+++ b/include/sys/syscall_lookup.h
@@ -25,6 +25,7 @@
*/
SYSCALL_LOOKUP1(_exit, 1)
+SYSCALL_LOOKUP(_assert, 2)
SYSCALL_LOOKUP(getpid, 0)
SYSCALL_LOOKUP(gettid, 0)
SYSCALL_LOOKUP(prctl, 2)
@@ -99,7 +100,6 @@ SYSCALL_LOOKUP(sem_wait, 1)
#endif
SYSCALL_LOOKUP(task_setcancelstate, 2)
-SYSCALL_LOOKUP(up_assert, 2)
#ifdef CONFIG_CANCELLATION_POINTS
SYSCALL_LOOKUP(task_setcanceltype, 2)
diff --git a/libs/libc/assert/Make.defs b/libs/libc/assert/Make.defs
index dfe45759d4..0b1f03f408 100644
--- a/libs/libc/assert/Make.defs
+++ b/libs/libc/assert/Make.defs
@@ -18,8 +18,6 @@
#
############################################################################
-CSRCS += lib_assert.c
-
ifeq ($(CONFIG_STACK_CANARIES),y)
CSRCS += lib_stackchk.c
endif
diff --git a/sched/Makefile b/sched/Makefile
index efe74efc5b..2e7c19282a 100644
--- a/sched/Makefile
+++ b/sched/Makefile
@@ -25,6 +25,7 @@ include environ/Make.defs
include group/Make.defs
include init/Make.defs
include irq/Make.defs
+include misc/Make.defs
include mqueue/Make.defs
include module/Make.defs
include paging/Make.defs
diff --git a/libs/libc/assert/Make.defs b/sched/misc/Make.defs
similarity index 82%
copy from libs/libc/assert/Make.defs
copy to sched/misc/Make.defs
index dfe45759d4..82436c8e52 100644
--- a/libs/libc/assert/Make.defs
+++ b/sched/misc/Make.defs
@@ -1,5 +1,5 @@
############################################################################
-# libs/libc/assert/Make.defs
+# sched/misc/Make.defs
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
@@ -18,13 +18,10 @@
#
############################################################################
-CSRCS += lib_assert.c
+CSRCS += assert.c
-ifeq ($(CONFIG_STACK_CANARIES),y)
-CSRCS += lib_stackchk.c
-endif
+# Include init build support
-# Add the assert directory to the build
+DEPPATH += --dep-path misc
+VPATH += :misc
-DEPPATH += --dep-path assert
-VPATH += :assert
diff --git a/libs/libc/assert/lib_assert.c b/sched/misc/assert.c
similarity index 97%
rename from libs/libc/assert/lib_assert.c
rename to sched/misc/assert.c
index fa3e18e2b3..f1d9999849 100644
--- a/libs/libc/assert/lib_assert.c
+++ b/sched/misc/assert.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * libs/libc/assert/lib_assert.c
+ * sched/misc/assert.c
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
diff --git a/syscall/syscall.csv b/syscall/syscall.csv
index 613de8463a..13f31bc984 100644
--- a/syscall/syscall.csv
+++ b/syscall/syscall.csv
@@ -1,4 +1,5 @@
"_exit","unistd.h","","noreturn","int"
+"_assert","assert.h","","noreturn","FAR const char *","int"
"accept","sys/socket.h","defined(CONFIG_NET)","int","int","FAR struct sockaddr
*","FAR socklen_t *"
"adjtime","sys/time.h","defined(CONFIG_CLOCK_TIMEKEEPING)","int","FAR const
struct timeval *","FAR struct timeval *"
"aio_cancel","aio.h","defined(CONFIG_FS_AIO)","int","int","FAR struct aiocb *"
@@ -183,7 +184,6 @@
"umount2","sys/mount.h","!defined(CONFIG_DISABLE_MOUNTPOINT)","int","FAR const
char *","unsigned int"
"unlink","unistd.h","!defined(CONFIG_DISABLE_MOUNTPOINT)","int","FAR const
char *"
"unsetenv","stdlib.h","!defined(CONFIG_DISABLE_ENVIRON)","int","FAR const char
*"
-"up_assert","nuttx/arch.h","","void","FAR const char *","int"
"utimens","sys/stat.h","","int","FAR const char *","const struct timespec
[2]|FAR const struct timespec *"
"vfork","unistd.h","defined(CONFIG_SCHED_WAITPID) &&
defined(CONFIG_ARCH_HAVE_VFORK)","pid_t"
"wait","sys/wait.h","defined(CONFIG_SCHED_WAITPID) &&
defined(CONFIG_SCHED_HAVE_PARENT)","pid_t","FAR int *"