Revert "libc: Call pthread_exit in user-space by up_pthread_exit"

This reverts commit f4a0b7aedd.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
This commit is contained in:
Huang Qi
2022-01-25 17:22:17 +08:00
committed by Xiang Xiao
parent 6814b1416f
commit c0a0de97ce
89 changed files with 112 additions and 537 deletions
+2 -21
View File
@@ -589,8 +589,6 @@ void up_task_start(main_t taskentry, int argc, FAR char *argv[])
noreturn_function;
#endif
#if !defined(CONFIG_BUILD_FLAT) && defined(__KERNEL__) && \
!defined(CONFIG_DISABLE_PTHREAD)
/****************************************************************************
* Name: up_pthread_start
*
@@ -616,28 +614,11 @@ void up_task_start(main_t taskentry, int argc, FAR char *argv[])
*
****************************************************************************/
#if !defined(CONFIG_BUILD_FLAT) && defined(__KERNEL__) && \
!defined(CONFIG_DISABLE_PTHREAD)
void up_pthread_start(pthread_trampoline_t startup,
pthread_startroutine_t entrypt, pthread_addr_t arg)
noreturn_function;
/****************************************************************************
* Name: up_pthread_exit
*
* Description:
* In this kernel mode build, this function will be called to execute a
* pthread in user-space. This kernel-mode stub will then be called
* transfer control to the user-mode pthread_exit.
*
* Input Parameters:
* exit - The user-space pthread_exit function
* exit_value - The pointer of the pthread exit parameter
*
* Returned Value:
* None
****************************************************************************/
void up_pthread_exit(pthread_exitroutine_t exit, FAR void *exit_value)
noreturn_function;
#endif
/****************************************************************************
+1 -3
View File
@@ -140,7 +140,6 @@ EXTERN const pthread_attr_t g_default_pthread_attr;
* for the new thread
* entry - The new thread starts execution by invoking entry
* arg - It is passed as the sole argument of entry
* exit - The user-space pthread exit function
*
* Returned Value:
* OK (0) on success; a (non-negated) errno value on failure. The errno
@@ -150,8 +149,7 @@ EXTERN const pthread_attr_t g_default_pthread_attr;
int nx_pthread_create(pthread_trampoline_t trampoline, FAR pthread_t *thread,
FAR const pthread_attr_t *attr,
pthread_startroutine_t entry, pthread_addr_t arg,
pthread_exitroutine_t exit);
pthread_startroutine_t entry, pthread_addr_t arg);
/****************************************************************************
* Name: nx_pthread_exit
+1 -3
View File
@@ -96,8 +96,7 @@
#define TCB_FLAG_NONCANCELABLE (1 << 2) /* Bit 2: Pthread is non-cancelable */
#define TCB_FLAG_CANCEL_DEFERRED (1 << 3) /* Bit 3: Deferred (vs asynch) cancellation type */
#define TCB_FLAG_CANCEL_PENDING (1 << 4) /* Bit 4: Pthread cancel is pending */
#define TCB_FLAG_CANCEL_DOING (1 << 5) /* Bit 4: Pthread cancel/exit is doing */
#define TCB_FLAG_POLICY_SHIFT (6) /* Bit 5-6: Scheduling policy */
#define TCB_FLAG_POLICY_SHIFT (5) /* Bit 5-6: Scheduling policy */
#define TCB_FLAG_POLICY_MASK (3 << TCB_FLAG_POLICY_SHIFT)
# define TCB_FLAG_SCHED_FIFO (0 << TCB_FLAG_POLICY_SHIFT) /* FIFO scheding policy */
# define TCB_FLAG_SCHED_RR (1 << TCB_FLAG_POLICY_SHIFT) /* Round robin scheding policy */
@@ -754,7 +753,6 @@ struct pthread_tcb_s
pthread_trampoline_t trampoline; /* User-space pthread startup function */
pthread_addr_t arg; /* Startup argument */
pthread_exitroutine_t exit; /* User-space pthread exit function */
FAR void *joininfo; /* Detach-able info to support join */
};
#endif /* !CONFIG_DISABLE_PTHREAD */
-2
View File
@@ -210,8 +210,6 @@ typedef FAR void *pthread_addr_t;
typedef CODE pthread_addr_t (*pthread_startroutine_t)(pthread_addr_t);
typedef pthread_startroutine_t pthread_func_t;
typedef void (*pthread_exitroutine_t)(pthread_addr_t);
typedef void (*pthread_trampoline_t)(pthread_startroutine_t, pthread_addr_t);
struct pthread_attr_s
+1 -1
View File
@@ -307,7 +307,7 @@ SYSCALL_LOOKUP(futimens, 2)
SYSCALL_LOOKUP(pthread_cond_broadcast, 1)
SYSCALL_LOOKUP(pthread_cond_signal, 1)
SYSCALL_LOOKUP(pthread_cond_wait, 2)
SYSCALL_LOOKUP(nx_pthread_create, 6)
SYSCALL_LOOKUP(nx_pthread_create, 5)
SYSCALL_LOOKUP(pthread_detach, 1)
SYSCALL_LOOKUP(nx_pthread_exit, 1)
SYSCALL_LOOKUP(pthread_getschedparam, 3)