[rt-smart] 弱化 RT_USING_LWP,使用 RT_USING_SMART 作为宏配置 (#6740)

* [dfs] sync cromfs

* [rt-smart]Weaken RT_USING_LWP, use RT_USING_SMART as macro configuration

* [format] fix some format issue.
This commit is contained in:
guo
2022-12-16 18:38:28 +08:00
committed by GitHub
parent 3ea5166376
commit 68ca9f07a6
95 changed files with 322 additions and 336 deletions
+9
View File
@@ -21,6 +21,15 @@ config RT_USING_SMART
bool "Enable RT-Thread Smart (microkernel on kernel/userland)"
default n
select RT_USING_LWP
select RT_USING_DFS
select RT_USING_LIBC
select RT_USING_POSIX_CLOCKTIME
select RT_USING_TTY
select RT_USING_NULL
select RT_USING_ZERO
select RT_USING_RANDOM
select RT_USING_RTC
depends on ARCH_ARM_CORTEX_M || ARCH_ARM_ARM9 || ARCH_ARM_CORTEX_A || ARCH_RISCV64
help
RT-Thread Smart is a microkernel based operating system on RT-Thread.
+2 -2
View File
@@ -10,7 +10,7 @@
#include <rthw.h>
#include <rtthread.h>
#ifdef RT_USING_USERSPACE
#ifdef RT_USING_SMART
#include <lwp.h>
#endif
@@ -246,7 +246,7 @@ void rt_cpus_lock_status_restore(struct rt_thread *thread)
{
struct rt_cpu* pcpu = rt_cpu_self();
#ifdef RT_USING_USERSPACE
#if defined(ARCH_MM_MMU) && defined(RT_USING_SMART)
lwp_mmu_switch(thread);
#endif
pcpu->current_thread = thread;
+7 -7
View File
@@ -32,7 +32,7 @@
#include <dlmodule.h>
#endif /* RT_USING_MODULE */
#ifdef RT_USING_LWP
#ifdef RT_USING_SMART
#include <lwp.h>
#include <lwp_user_mm.h>
#include <console.h>
@@ -420,7 +420,7 @@ char *rt_strstr(const char *s1, const char *s2)
l2 = rt_strlen(s2);
if (!l2)
{
return (char *)s1;
return (char *)s1;
}
l1 = rt_strlen(s1);
@@ -429,7 +429,7 @@ char *rt_strstr(const char *s1, const char *s2)
l1 --;
if (!rt_memcmp(s1, s2, l2))
{
return (char *)s1;
return (char *)s1;
}
s1 ++;
@@ -495,7 +495,7 @@ char *rt_strncpy(char *dst, const char *src, rt_size_t n)
/* NUL pad the remaining n-1 bytes */
while (--n != 0)
{
*d++ = 0;
*d++ = 0;
}
break;
@@ -554,7 +554,7 @@ rt_int32_t rt_strncmp(const char *cs, const char *ct, rt_size_t count)
{
if ((__res = *cs - *ct++) != 0 || !*cs++)
{
break;
break;
}
count --;
@@ -648,7 +648,7 @@ char *rt_strdup(const char *s)
if (!tmp)
{
return RT_NULL;
return RT_NULL;
}
rt_memcpy(tmp, s, len);
@@ -1256,7 +1256,7 @@ RTM_EXPORT(rt_console_get_device);
*/
rt_device_t rt_console_set_device(const char *name)
{
#ifdef RT_USING_LWP
#ifdef RT_USING_SMART
rt_device_t new_iodev = RT_NULL, old_iodev = RT_NULL;
extern void console_init();
console_init(); /*add line discipline*/
+3 -3
View File
@@ -23,7 +23,7 @@
#include <dlmodule.h>
#endif /* RT_USING_MODULE */
#ifdef RT_USING_LWP
#ifdef RT_USING_SMART
#include <lwp.h>
#endif
@@ -71,7 +71,7 @@ enum rt_object_info_type
#ifdef RT_USING_HEAP
RT_Object_Info_Memory, /**< The object is a memory. */
#endif
#ifdef RT_USING_LWP
#ifdef RT_USING_SMART
RT_Object_Info_Channel, /**< The object is a IPC channel */
#endif
#ifdef RT_USING_HEAP
@@ -129,7 +129,7 @@ static struct rt_object_information _object_container[RT_Object_Info_Unknown] =
/* initialize object container - small memory */
{RT_Object_Class_Memory, _OBJ_CONTAINER_LIST_INIT(RT_Object_Info_Memory), sizeof(struct rt_memory)},
#endif
#ifdef RT_USING_LWP
#ifdef RT_USING_SMART
/* initialize object container - module */
{RT_Object_Class_Channel, _OBJ_CONTAINER_LIST_INIT(RT_Object_Info_Channel), sizeof(struct rt_channel)},
{RT_Object_Class_Custom, _OBJ_CONTAINER_LIST_INIT(RT_Object_Info_Custom), sizeof(struct rt_custom_object)},
+6 -6
View File
@@ -33,9 +33,9 @@
#include <rtthread.h>
#include <rthw.h>
#ifdef RT_USING_LWP
#ifdef RT_USING_SMART
#include <lwp.h>
#endif /* RT_USING_LWP */
#endif /* RT_USING_SMART */
rt_list_t rt_thread_priority_table[RT_THREAD_PRIORITY_MAX];
rt_uint32_t rt_thread_ready_priority_group;
@@ -98,7 +98,7 @@ static void _scheduler_stack_check(struct rt_thread *thread)
{
RT_ASSERT(thread != RT_NULL);
#ifdef RT_USING_LWP
#ifdef RT_USING_SMART
#ifndef ARCH_MM_MMU
struct rt_lwp *lwp = thread ? (struct rt_lwp *)thread->lwp : 0;
@@ -109,7 +109,7 @@ static void _scheduler_stack_check(struct rt_thread *thread)
return;
}
#endif /* not defined ARCH_MM_MMU */
#endif /* RT_USING_LWP */
#endif /* RT_USING_SMART */
#ifdef ARCH_CPU_STACK_GROWS_UPWARD
if (*((rt_uint8_t *)((rt_ubase_t)thread->stack_addr + thread->stack_size - 1)) != '#' ||
@@ -345,7 +345,7 @@ void rt_schedule(void)
if ((current_thread->stat & RT_THREAD_STAT_SIGNAL_MASK) & RT_THREAD_STAT_SIGNAL_PENDING)
{
#ifdef RT_USING_LWP
#ifdef RT_USING_SMART
rt_thread_wakeup(current_thread);
#else
rt_thread_resume(current_thread);
@@ -600,7 +600,7 @@ void rt_scheduler_do_irq_switch(void *context)
if ((current_thread->stat & RT_THREAD_STAT_SIGNAL_MASK) & RT_THREAD_STAT_SIGNAL_PENDING)
{
#ifdef RT_USING_LWP
#ifdef RT_USING_SMART
rt_thread_wakeup(current_thread);
#else
rt_thread_resume(current_thread);
+1 -1
View File
@@ -105,7 +105,7 @@ static void _signal_deliver(rt_thread_t tid)
if ((tid->stat & RT_THREAD_SUSPEND_MASK) == RT_THREAD_SUSPEND_MASK)
{
/* resume thread to handle signal */
#ifdef RT_USING_LWP
#ifdef RT_USING_SMART
rt_thread_wakeup(tid);
#else
rt_thread_resume(tid);
+7 -7
View File
@@ -167,7 +167,7 @@ static rt_err_t _thread_init(struct rt_thread *thread,
/* init thread list */
rt_list_init(&(thread->tlist));
#ifdef RT_USING_LWP
#ifdef RT_USING_SMART
thread->wakeup.func = RT_NULL;
#endif
@@ -255,7 +255,7 @@ static rt_err_t _thread_init(struct rt_thread *thread,
thread->si_list = RT_NULL;
#endif /* RT_USING_SIGNALS */
#ifdef RT_USING_LWP
#ifdef RT_USING_SMART
thread->lwp = RT_NULL;
rt_list_init(&(thread->sibling));
rt_memset(&thread->signal, 0, sizeof(lwp_sigset_t));
@@ -642,7 +642,7 @@ rt_err_t rt_thread_sleep(rt_tick_t tick)
rt_hw_interrupt_enable(level);
thread->error = -RT_EINTR;
rt_schedule();
/* clear error number of this thread to RT_EOK */
@@ -930,7 +930,7 @@ rt_err_t rt_thread_control(rt_thread_t thread, int cmd, void *arg)
}
RTM_EXPORT(rt_thread_control);
#ifdef RT_USING_LWP
#ifdef RT_USING_SMART
int lwp_suspend_sigcheck(rt_thread_t thread, int suspend_flag);
#endif
@@ -998,7 +998,7 @@ rt_err_t rt_thread_suspend_with_flag(rt_thread_t thread, int suspend_flag)
/* not suspend running status thread on other core */
RT_ASSERT(thread == rt_thread_self());
}
#ifdef RT_USING_LWP
#ifdef RT_USING_SMART
if (lwp_suspend_sigcheck(thread, suspend_flag) == 0)
{
/* not to suspend */
@@ -1063,7 +1063,7 @@ rt_err_t rt_thread_resume(rt_thread_t thread)
rt_timer_stop(&thread->thread_timer);
#ifdef RT_USING_LWP
#ifdef RT_USING_SMART
thread->wakeup.func = RT_NULL;
#endif
@@ -1078,7 +1078,7 @@ rt_err_t rt_thread_resume(rt_thread_t thread)
}
RTM_EXPORT(rt_thread_resume);
#ifdef RT_USING_LWP
#ifdef RT_USING_SMART
/**
* This function will wakeup a thread with customized operation.
*