From 678306d300faa44b6cd099464bd978afb2c5c9a6 Mon Sep 17 00:00:00 2001 From: Meco Man <920369182@qq.com> Date: Mon, 8 Mar 2021 11:25:38 +0800 Subject: [kernel]auto formatted --- src/clock.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/clock.c') diff --git a/src/clock.c b/src/clock.c index 66923e5c00..0880d8d241 100644 --- a/src/clock.c +++ b/src/clock.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -111,7 +111,7 @@ rt_tick_t rt_tick_from_millisecond(rt_int32_t ms) tick = RT_TICK_PER_SECOND * (ms / 1000); tick += (RT_TICK_PER_SECOND * (ms % 1000) + 999) / 1000; } - + /* return the calculated tick */ return tick; } -- cgit v1.3.1 From 37960723b8fe6c91d14c7c4c1c30a97d17e0033b Mon Sep 17 00:00:00 2001 From: geniusgogo Date: Fri, 28 May 2021 09:43:06 +0800 Subject: fix rt_tick_increase critical code protection --- src/clock.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/clock.c') diff --git a/src/clock.c b/src/clock.c index 0880d8d241..8746d463c1 100644 --- a/src/clock.c +++ b/src/clock.c @@ -76,10 +76,14 @@ void rt_tick_increase(void) -- thread->remaining_tick; if (thread->remaining_tick == 0) { + rt_base_t level; + /* change to initialized tick */ thread->remaining_tick = thread->init_tick; + level = rt_hw_interrupt_disable(); thread->stat |= RT_THREAD_STAT_YIELD; + rt_hw_interrupt_enable(level); rt_schedule(); } -- cgit v1.3.1 From f34e9323b430813a6dbb62a609cfb3980aa645b0 Mon Sep 17 00:00:00 2001 From: Meco Man <920369182@qq.com> Date: Tue, 1 Jun 2021 11:42:47 +0800 Subject: 对rt_tick_increase临界区进行保护 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/clock.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'src/clock.c') diff --git a/src/clock.c b/src/clock.c index 8746d463c1..045555933d 100644 --- a/src/clock.c +++ b/src/clock.c @@ -62,6 +62,9 @@ void rt_tick_set(rt_tick_t tick) void rt_tick_increase(void) { struct rt_thread *thread; + rt_base_t level; + + level = rt_hw_interrupt_disable(); /* increase the global tick */ #ifdef RT_USING_SMP @@ -76,17 +79,17 @@ void rt_tick_increase(void) -- thread->remaining_tick; if (thread->remaining_tick == 0) { - rt_base_t level; - /* change to initialized tick */ thread->remaining_tick = thread->init_tick; - - level = rt_hw_interrupt_disable(); thread->stat |= RT_THREAD_STAT_YIELD; - rt_hw_interrupt_enable(level); + rt_hw_interrupt_enable(level); rt_schedule(); } + else + { + rt_hw_interrupt_enable(level); + } /* check timer */ rt_timer_check(); -- cgit v1.3.1 From 5a6bc9900689ba2d21850cc520c3621c57037025 Mon Sep 17 00:00:00 2001 From: Meco Man <920369182@qq.com> Date: Wed, 2 Jun 2021 15:30:32 +0800 Subject: [bug][kernel] 保持空闲任务钩子函数调用的原子性 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/clock.c | 3 ++- src/idle.c | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'src/clock.c') diff --git a/src/clock.c b/src/clock.c index 045555933d..191525411a 100644 --- a/src/clock.c +++ b/src/clock.c @@ -13,7 +13,8 @@ * 2010-07-13 Bernard fix rt_tick_from_millisecond issue found by kuronca * 2011-06-26 Bernard add rt_tick_set function. * 2018-11-22 Jesven add per cpu tick - * 2020-12-29 Meco Man add function rt_tick_get_millisecond() + * 2020-12-29 Meco Man implement rt_tick_get_millisecond() + * 2021-06-01 Meco Man add critical section projection for rt_tick_increase() */ #include diff --git a/src/idle.c b/src/idle.c index 59868352d8..e73a78be9c 100644 --- a/src/idle.c +++ b/src/idle.c @@ -202,12 +202,14 @@ static void rt_thread_idle_entry(void *parameter) { #ifdef RT_USING_IDLE_HOOK rt_size_t i; + void (*idle_hook)(void); for (i = 0; i < RT_IDLE_HOOK_LIST_SIZE; i++) { - if (idle_hook_list[i] != RT_NULL) + idle_hook = idle_hook_list[i]; + if (idle_hook != RT_NULL) { - idle_hook_list[i](); + idle_hook(); } } #endif -- cgit v1.3.1 From e0b66ccab87bd5142769e0f4fd3f2b5ac14796ba Mon Sep 17 00:00:00 2001 From: Meco Man <920369182@qq.com> Date: Thu, 3 Jun 2021 20:09:26 +0800 Subject: [kernel] 对rt_tick变量增加volatile修饰,防止编译器优化时出现问题 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/clock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/clock.c') diff --git a/src/clock.c b/src/clock.c index 045555933d..f02c524380 100644 --- a/src/clock.c +++ b/src/clock.c @@ -22,7 +22,7 @@ #ifdef RT_USING_SMP #define rt_tick rt_cpu_index(0)->tick #else -static rt_tick_t rt_tick = 0; +static volatile rt_tick_t rt_tick = 0; #endif /** -- cgit v1.3.1 From 24b4b6cbb9d4b646ed52f1fc996e90f638a7aba6 Mon Sep 17 00:00:00 2001 From: Meco Man <920369182@qq.com> Date: Wed, 9 Jun 2021 19:50:03 +0800 Subject: [kernel]补充endif后缀注释 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/clock.c | 6 +++--- src/components.c | 26 +++++++++++++------------- src/cpu.c | 2 +- src/device.c | 14 +++++++------- src/idle.c | 32 ++++++++++++++++---------------- 5 files changed, 40 insertions(+), 40 deletions(-) (limited to 'src/clock.c') diff --git a/src/clock.c b/src/clock.c index 7df13775b2..77516b3775 100644 --- a/src/clock.c +++ b/src/clock.c @@ -24,7 +24,7 @@ #define rt_tick rt_cpu_index(0)->tick #else static volatile rt_tick_t rt_tick = 0; -#endif +#endif /* RT_USING_SMP */ /** * @addtogroup Clock @@ -72,7 +72,7 @@ void rt_tick_increase(void) rt_cpu_self()->tick ++; #else ++ rt_tick; -#endif +#endif /* RT_USING_SMP */ /* check time slice */ thread = rt_thread_self(); @@ -138,7 +138,7 @@ RT_WEAK rt_tick_t rt_tick_get_millisecond(void) #warning "rt-thread cannot provide a correct 1ms-based tick any longer,\ please redefine this function in another file by using a high-precision hard-timer." return 0; -#endif +#endif /* 1000 % RT_TICK_PER_SECOND == 0u */ } /**@}*/ diff --git a/src/components.c b/src/components.c index 9709d0aae2..d684d5e6fd 100644 --- a/src/components.c +++ b/src/components.c @@ -23,11 +23,11 @@ #ifdef RT_USING_USER_MAIN #ifndef RT_MAIN_THREAD_STACK_SIZE #define RT_MAIN_THREAD_STACK_SIZE 2048 -#endif +#endif /* RT_MAIN_THREAD_STACK_SIZE */ #ifndef RT_MAIN_THREAD_PRIORITY #define RT_MAIN_THREAD_PRIORITY (RT_THREAD_PRIORITY_MAX / 3) -#endif -#endif +#endif /* RT_MAIN_THREAD_PRIORITY */ +#endif /* RT_USING_USER_MAIN */ #ifdef RT_USING_COMPONENTS_INIT /* @@ -98,7 +98,7 @@ void rt_components_board_init(void) { (*fn_ptr)(); } -#endif +#endif /* RT_DEBUG_INIT */ } /** @@ -124,9 +124,9 @@ void rt_components_init(void) { (*fn_ptr)(); } -#endif +#endif /* RT_DEBUG_INIT */ } -#endif /* RT_USING_COMPONENTS_INIT */ +#endif /* RT_USING_COMPONENTS_INIT */ #ifdef RT_USING_USER_MAIN @@ -167,7 +167,7 @@ int entry(void) ALIGN(8) static rt_uint8_t main_stack[RT_MAIN_THREAD_STACK_SIZE]; struct rt_thread main_thread; -#endif +#endif /* RT_USING_HEAP */ /* the system main thread */ void main_thread_entry(void *parameter) @@ -177,11 +177,11 @@ void main_thread_entry(void *parameter) #ifdef RT_USING_COMPONENTS_INIT /* RT-Thread components initialization */ rt_components_init(); -#endif +#endif /* RT_USING_COMPONENTS_INIT */ #ifdef RT_USING_SMP rt_hw_secondary_cpu_up(); -#endif +#endif /* RT_USING_SMP */ /* invoke system main function */ #if defined(__CC_ARM) || defined(__CLANG_ARM) { @@ -211,7 +211,7 @@ void rt_application_init(void) /* if not define RT_USING_HEAP, using to eliminate the warning */ (void)result; -#endif +#endif /* RT_USING_HEAP */ rt_thread_startup(tid); } @@ -237,7 +237,7 @@ int rtthread_startup(void) #ifdef RT_USING_SIGNALS /* signal system initialization */ rt_system_signal_init(); -#endif +#endif /* RT_USING_SIGNALS */ /* create init_thread */ rt_application_init(); @@ -250,7 +250,7 @@ int rtthread_startup(void) #ifdef RT_USING_SMP rt_hw_spin_lock(&_cpus_lock); -#endif /*RT_USING_SMP*/ +#endif /* RT_USING_SMP */ /* start scheduler */ rt_system_scheduler_start(); @@ -258,4 +258,4 @@ int rtthread_startup(void) /* never reach here */ return 0; } -#endif +#endif /* RT_USING_USER_MAIN */ diff --git a/src/cpu.c b/src/cpu.c index 48ddb12c46..a7d56ba999 100644 --- a/src/cpu.c +++ b/src/cpu.c @@ -185,4 +185,4 @@ void rt_cpus_lock_status_restore(struct rt_thread *thread) } RTM_EXPORT(rt_cpus_lock_status_restore); -#endif +#endif /* RT_USING_SMP */ diff --git a/src/device.c b/src/device.c index 50b83c7692..a9c244d306 100644 --- a/src/device.c +++ b/src/device.c @@ -16,9 +16,9 @@ */ #include -#if defined(RT_USING_POSIX) +#ifdef RT_USING_POSIX #include /* for wqueue_init */ -#endif +#endif /* RT_USING_POSIX */ #ifdef RT_USING_DEVICE @@ -36,7 +36,7 @@ #define device_read (dev->read) #define device_write (dev->write) #define device_control (dev->control) -#endif +#endif /* RT_USING_DEVICE_OPS */ /** * This function registers a device driver with specified name. @@ -62,10 +62,10 @@ rt_err_t rt_device_register(rt_device_t dev, dev->ref_count = 0; dev->open_flag = 0; -#if defined(RT_USING_POSIX) +#ifdef RT_USING_POSIX dev->fops = RT_NULL; rt_wqueue_init(&(dev->wait_queue)); -#endif +#endif /* RT_USING_POSIX */ return RT_EOK; } @@ -150,7 +150,7 @@ void rt_device_destroy(rt_device_t dev) rt_free(dev); } RTM_EXPORT(rt_device_destroy); -#endif +#endif /* RT_USING_HEAP */ /** * This function will initialize the specified device @@ -434,4 +434,4 @@ rt_device_set_tx_complete(rt_device_t dev, } RTM_EXPORT(rt_device_set_tx_complete); -#endif +#endif /* RT_USING_DEVICE */ diff --git a/src/idle.c b/src/idle.c index e73a78be9c..db256a6010 100644 --- a/src/idle.c +++ b/src/idle.c @@ -22,27 +22,27 @@ #ifdef RT_USING_MODULE #include -#endif +#endif /* RT_USING_MODULE */ -#if defined (RT_USING_HOOK) +#ifdef RT_USING_HOOK #ifndef RT_USING_IDLE_HOOK #define RT_USING_IDLE_HOOK -#endif -#endif +#endif /* RT_USING_IDLE_HOOK */ +#endif /* RT_USING_HOOK */ #ifndef IDLE_THREAD_STACK_SIZE #if defined (RT_USING_IDLE_HOOK) || defined(RT_USING_HEAP) #define IDLE_THREAD_STACK_SIZE 256 #else #define IDLE_THREAD_STACK_SIZE 128 -#endif -#endif +#endif /* (RT_USING_IDLE_HOOK) || defined(RT_USING_HEAP) */ +#endif /* IDLE_THREAD_STACK_SIZE */ #ifdef RT_USING_SMP #define _CPUS_NR RT_CPUS_NR #else #define _CPUS_NR 1 -#endif +#endif /* RT_USING_SMP */ extern rt_list_t rt_thread_defunct; @@ -53,7 +53,7 @@ static rt_uint8_t rt_thread_stack[_CPUS_NR][IDLE_THREAD_STACK_SIZE]; #ifdef RT_USING_IDLE_HOOK #ifndef RT_IDLE_HOOK_LIST_SIZE #define RT_IDLE_HOOK_LIST_SIZE 4 -#endif +#endif /* RT_IDLE_HOOK_LIST_SIZE */ static void (*idle_hook_list[RT_IDLE_HOOK_LIST_SIZE])(void); @@ -125,7 +125,7 @@ rt_err_t rt_thread_idle_delhook(void (*hook)(void)) return ret; } -#endif +#endif /* RT_USING_IDLE_HOOK */ #ifdef RT_USING_HEAP /* Return whether there is defunctional thread to be deleted. */ @@ -141,7 +141,7 @@ rt_inline int _has_defunct_thread(void) return l->next != l; } -#endif +#endif /* RT_USING_HEAP */ /** * @ingroup Thread @@ -182,7 +182,7 @@ void rt_thread_idle_excute(void) rt_object_delete((rt_object_t)thread); rt_hw_interrupt_enable(lock); } -#endif +#endif /* RT_USING_HEAP */ } extern void rt_system_power_manager(void); @@ -196,7 +196,7 @@ static void rt_thread_idle_entry(void *parameter) rt_hw_secondary_cpu_idle_exec(); } } -#endif +#endif /* RT_USING_SMP */ while (1) { @@ -212,12 +212,12 @@ static void rt_thread_idle_entry(void *parameter) idle_hook(); } } -#endif +#endif /* RT_USING_IDLE_HOOK */ rt_thread_idle_excute(); #ifdef RT_USING_PM rt_system_power_manager(); -#endif +#endif /* RT_USING_PM */ } } @@ -246,7 +246,7 @@ void rt_thread_idle_init(void) 32); #ifdef RT_USING_SMP rt_thread_control(&idle[i], RT_THREAD_CTRL_BIND_CPU, (void*)i); -#endif +#endif /* RT_USING_SMP */ /* startup */ rt_thread_startup(&idle[i]); } @@ -264,7 +264,7 @@ rt_thread_t rt_thread_idle_gethandler(void) register int id = rt_hw_cpu_id(); #else register int id = 0; -#endif +#endif /* RT_USING_SMP */ return (rt_thread_t)(&idle[id]); } -- cgit v1.3.1 From 921e6057aa11e52eafcbcdabbb5765359ba2f286 Mon Sep 17 00:00:00 2001 From: guozhanxin Date: Fri, 10 Sep 2021 15:50:15 +0800 Subject: [clock] Improve the code comment of the clock.c --- src/clock.c | 34 ++++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-) (limited to 'src/clock.c') diff --git a/src/clock.c b/src/clock.c index 77516b3775..3b35e98d34 100644 --- a/src/clock.c +++ b/src/clock.c @@ -33,9 +33,9 @@ static volatile rt_tick_t rt_tick = 0; /**@{*/ /** - * This function will return current tick from operating system startup + * @brief This function will return current tick from operating system startup * - * @return current tick + * @return Return current tick */ rt_tick_t rt_tick_get(void) { @@ -45,7 +45,9 @@ rt_tick_t rt_tick_get(void) RTM_EXPORT(rt_tick_get); /** - * This function will set current tick + * @brief This function will set current tick + * + * @param tick is the value that you will set. */ void rt_tick_set(rt_tick_t tick) { @@ -57,8 +59,8 @@ void rt_tick_set(rt_tick_t tick) } /** - * This function will notify kernel there is one tick passed. Normally, - * this function is invoked by clock ISR. + * @brief This function will notify kernel there is one tick passed. + * Normally, this function is invoked by clock ISR. */ void rt_tick_increase(void) { @@ -97,14 +99,14 @@ void rt_tick_increase(void) } /** - * This function will calculate the tick from millisecond. + * @brief This function will calculate the tick from millisecond. * - * @param ms the specified millisecond - * - Negative Number wait forever - * - Zero not wait - * - Max 0x7fffffff + * @param ms is the specified millisecond + * - Negative Number wait forever + * - Zero not wait + * - Max 0x7fffffff * - * @return the calculated tick + * @return Return the calculated tick */ rt_tick_t rt_tick_from_millisecond(rt_int32_t ms) { @@ -126,9 +128,13 @@ rt_tick_t rt_tick_from_millisecond(rt_int32_t ms) RTM_EXPORT(rt_tick_from_millisecond); /** - * This function will provide the passed millisecond from boot. - * - * @return passed millisecond from boot + * @brief This function will return the passed millisecond from boot. + * + * @note When the value of RT_TICK_PER_SECOND is lower than 1000 or + * is not an integral multiple of 1000, this function will not + * provide the correct 1ms-based tick. + * + * @return Return passed millisecond from boot */ RT_WEAK rt_tick_t rt_tick_get_millisecond(void) { -- cgit v1.3.1 From e562c6f24bf3f857f11aa0bd82d46a6b4767464a Mon Sep 17 00:00:00 2001 From: guozhanxin Date: Fri, 10 Sep 2021 16:31:29 +0800 Subject: [kernel] 裁剪尾随空格 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/clock.c | 6 +++--- src/components.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src/clock.c') diff --git a/src/clock.c b/src/clock.c index 3b35e98d34..e49df94aae 100644 --- a/src/clock.c +++ b/src/clock.c @@ -46,7 +46,7 @@ RTM_EXPORT(rt_tick_get); /** * @brief This function will set current tick - * + * * @param tick is the value that you will set. */ void rt_tick_set(rt_tick_t tick) @@ -129,11 +129,11 @@ RTM_EXPORT(rt_tick_from_millisecond); /** * @brief This function will return the passed millisecond from boot. - * + * * @note When the value of RT_TICK_PER_SECOND is lower than 1000 or * is not an integral multiple of 1000, this function will not * provide the correct 1ms-based tick. - * + * * @return Return passed millisecond from boot */ RT_WEAK rt_tick_t rt_tick_get_millisecond(void) diff --git a/src/components.c b/src/components.c index 2a4affdefb..87e76091f2 100644 --- a/src/components.c +++ b/src/components.c @@ -199,7 +199,7 @@ void main_thread_entry(void *parameter) /** * @brief This function will create and start the main thread, but this thread - * will not run until the scheduler starts. + * will not run until the scheduler starts. */ void rt_application_init(void) { -- cgit v1.3.1 From 6cb093aa272a0b1ef908cbd8e103cbd94120b3c6 Mon Sep 17 00:00:00 2001 From: guozhanxin Date: Sat, 11 Sep 2021 18:29:37 +0800 Subject: [kernel] Improve code comments. --- src/clock.c | 2 +- src/components.c | 9 +++++---- src/cpu.c | 1 - 3 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src/clock.c') diff --git a/src/clock.c b/src/clock.c index e49df94aae..fb7ee447d2 100644 --- a/src/clock.c +++ b/src/clock.c @@ -130,7 +130,7 @@ RTM_EXPORT(rt_tick_from_millisecond); /** * @brief This function will return the passed millisecond from boot. * - * @note When the value of RT_TICK_PER_SECOND is lower than 1000 or + * @note if the value of RT_TICK_PER_SECOND is lower than 1000 or * is not an integral multiple of 1000, this function will not * provide the correct 1ms-based tick. * diff --git a/src/components.c b/src/components.c index 87e76091f2..9433b7457c 100644 --- a/src/components.c +++ b/src/components.c @@ -78,7 +78,9 @@ static int rti_end(void) INIT_EXPORT(rti_end, "6.end"); /** - * @brief RT-Thread Components Initialization for board. + * @brief Onboard components initialization. In this function, the board-level + * initialization function will be called to complete the initialization + * of the on-board peripherals. */ void rt_components_board_init(void) { @@ -225,9 +227,8 @@ void rt_application_init(void) } /** - * @brief RT-Thread startup function. This function will call all levels of initialization - * functions to complete the initialization of the system, and finally start the - * scheduler. + * @brief This function will call all levels of initialization functions to complete + * the initialization of the system, and finally start the scheduler. */ int rtthread_startup(void) { diff --git a/src/cpu.c b/src/cpu.c index 5466a350ae..b689ecf2d7 100644 --- a/src/cpu.c +++ b/src/cpu.c @@ -69,7 +69,6 @@ static void _cpu_preempt_enable(void) * @brief Initialize a static spinlock object. * * @param lock is a pointer to the spinlock to initialize. - * It is assumed that storage for the spinlock will be allocated in your application. */ void rt_spin_lock_init(struct rt_spinlock *lock) { -- cgit v1.3.1 From d99737d8a99844bbf8056656b0e61b93c2343ade Mon Sep 17 00:00:00 2001 From: liukangcc Date: Sat, 18 Sep 2021 16:23:50 +0800 Subject: [update] functions annotation. --- src/clock.c | 12 ++++++------ src/ipc.c | 7 ------- src/kservice.c | 12 +++++++----- src/memheap.c | 2 +- src/signal.c | 2 ++ 5 files changed, 16 insertions(+), 19 deletions(-) (limited to 'src/clock.c') diff --git a/src/clock.c b/src/clock.c index fb7ee447d2..21be3a4203 100644 --- a/src/clock.c +++ b/src/clock.c @@ -33,9 +33,9 @@ static volatile rt_tick_t rt_tick = 0; /**@{*/ /** - * @brief This function will return current tick from operating system startup + * @brief This function will return current tick from operating system startup. * - * @return Return current tick + * @return Return current tick. */ rt_tick_t rt_tick_get(void) { @@ -45,7 +45,7 @@ rt_tick_t rt_tick_get(void) RTM_EXPORT(rt_tick_get); /** - * @brief This function will set current tick + * @brief This function will set current tick. * * @param tick is the value that you will set. */ @@ -101,12 +101,12 @@ void rt_tick_increase(void) /** * @brief This function will calculate the tick from millisecond. * - * @param ms is the specified millisecond + * @param ms is the specified millisecond. * - Negative Number wait forever * - Zero not wait * - Max 0x7fffffff * - * @return Return the calculated tick + * @return Return the calculated tick. */ rt_tick_t rt_tick_from_millisecond(rt_int32_t ms) { @@ -134,7 +134,7 @@ RTM_EXPORT(rt_tick_from_millisecond); * is not an integral multiple of 1000, this function will not * provide the correct 1ms-based tick. * - * @return Return passed millisecond from boot + * @return Return passed millisecond from boot. */ RT_WEAK rt_tick_t rt_tick_get_millisecond(void) { diff --git a/src/ipc.c b/src/ipc.c index 57ac453a68..a467c14151 100755 --- a/src/ipc.c +++ b/src/ipc.c @@ -1234,10 +1234,6 @@ RTM_EXPORT(rt_mutex_control); * * @param name is a pointer to the name that given to the event. * - * @param value is the initial value for the event. - * If want to share resources, you should initialize the value as the number of available resources. - * If want to signal the occurrence of an event, you should initialize the value as 0. - * * @param flag is the event flag, which determines the queuing way of how multiple threads wait * when the event is not available. * The event flag can be ONE of the following values: @@ -1741,9 +1737,6 @@ RTM_EXPORT(rt_event_control); * * @param name is a pointer to the name that given to the mailbox. * - * @param msgpoll is a pointer to the starting address of the memory space you allocated for the mailbox in advance. - * In other words, msgpoll is a pointer to the mailbox buffer of the starting address. - * * @param size is the maximum number of mails in the mailbox. * For example, when the mailbox buffer capacity is N, size is N/4. * diff --git a/src/kservice.c b/src/kservice.c index 25d34dfc47..41d81d8677 100644 --- a/src/kservice.c +++ b/src/kservice.c @@ -294,11 +294,11 @@ RTM_EXPORT(rt_memcpy); * address. If the destination memory does not overlap with the source memory, * the function is the same as memcpy(). * - * @param dst is the address of destination memory, points to the copied content. + * @param dest is the address of destination memory, points to the copied content. * * @param src is the address of source memory, point to the data source to be copied. * - * @param count is the copied length. + * @param n is the copied length. * * @return The address of destination memory. */ @@ -590,9 +590,11 @@ RTM_EXPORT(rt_show_version); /** * This function will duplicate a string. * - * @param s the string to be duplicated + * @param n is the string to be duplicated. + * + * @param base is support divide instructions value. * - * @return the duplicated string pointer + * @return the duplicated string pointer. */ rt_inline int divide(long long *n, int base) { @@ -1418,7 +1420,7 @@ void rt_assert_set_hook(void (*hook)(const char *ex, const char *func, rt_size_t /** * The RT_ASSERT function. * - * @param ex is the assertion condition string. + * @param ex_string is the assertion condition string. * * @param func is the function name when assertion. * diff --git a/src/memheap.c b/src/memheap.c index 8422b1d802..f9da3ac015 100644 --- a/src/memheap.c +++ b/src/memheap.c @@ -1058,7 +1058,7 @@ void rt_memory_info(rt_uint32_t *total, /** * @brief This function will print the used memheap infomation. * - * @param memheap is a pointer of the memheap object. + * @param mh is a pointer of the memheap object. */ void dump_used_memheap(struct rt_memheap *mh) { diff --git a/src/signal.c b/src/signal.c index e630c0dd97..14201ee948 100644 --- a/src/signal.c +++ b/src/signal.c @@ -217,6 +217,8 @@ void *rt_signal_check(void* context) * * @param signo is a specific signal value (range: 0 ~ RT_SIG_MAX). * + * @param handler is sets the processing of signal value. + * * @return Return the old processing function of this signal. ONLY When the * return value is SIG_ERR, the operation is failed. */ -- cgit v1.3.1