🎈 perf: perf rt_hw_interrupt_disable/enable (#8042)

Signed-off-by: Shell <smokewood@qq.com>
Co-authored-by: Shell <smokewood@qq.com>
This commit is contained in:
xqyjlj
2023-10-25 20:31:25 +08:00
committed by GitHub
parent 91fc52df36
commit 3283f54c7a
80 changed files with 2478 additions and 1962 deletions

View File

@@ -37,6 +37,7 @@
#ifdef ARCH_MM_MMU
#include "lwp_shm.h"
#include <locale.h>
#include "mmu.h"
#include "page.h"
#else
@@ -75,6 +76,12 @@ struct rt_lwp_notify
rt_slist_t list_node;
};
#ifdef RT_USING_MUSLLIBC
#define LWP_CREATE_STAT(exit_code) (((exit_code) & 0xff) << 8)
#else
#error "No compatible lwp set status provided for this libc"
#endif
struct rt_lwp
{
#ifdef ARCH_MM_MMU
@@ -98,7 +105,6 @@ struct rt_lwp
struct rt_lwp *sibling;
rt_list_t wait_list;
rt_bool_t finish;
rt_bool_t terminated;
rt_bool_t background;
int lwp_ret;
@@ -150,6 +156,8 @@ struct rt_lwp
typedef struct rt_lwp *rt_lwp_t;
struct rt_lwp *lwp_self(void);
rt_err_t lwp_children_register(struct rt_lwp *parent, struct rt_lwp *child);
rt_err_t lwp_children_unregister(struct rt_lwp *parent, struct rt_lwp *child);
enum lwp_exit_request_type
{
@@ -165,9 +173,25 @@ int lwp_check_exit_request(void);
void lwp_terminate(struct rt_lwp *lwp);
void lwp_wait_subthread_exit(void);
int lwp_tid_init(void);
int lwp_tid_get(void);
void lwp_tid_put(int tid);
rt_thread_t lwp_tid_get_thread(int tid);
/**
* @brief Automatically get a thread and increase a reference count
*
* @param tid queried thread ID
* @return rt_thread_t
*/
rt_thread_t lwp_tid_get_thread_and_inc_ref(int tid);
/**
* @brief Decrease a reference count
*
* @param thread target thread
*/
void lwp_tid_dec_ref(rt_thread_t thread);
void lwp_tid_set_thread(int tid, rt_thread_t thread);
int lwp_execve(char *filename, int debug, int argc, char **argv, char **envp);