新增API注释

This commit is contained in:
sherecho 2024-10-10 17:35:28 +08:00
parent 9acf24a83e
commit 98aa34d99a
3 changed files with 51 additions and 11 deletions

View File

@ -68,11 +68,5 @@
#endif
#include <tos_global.h>
#include <tos_version.h>
// #ifndef portGET_TASK_LOCK()
// #define portGET_TASK_LOCK()
// #endif
// #ifndef portRELEASE_TASK_LOCK()
// #define portRELEASE_TASK_LOCK()
// #endif
#endif /* _TOS_K_H_ */

View File

@ -167,15 +167,61 @@ __API__ k_err_t tos_knl_sched_lock(void);
* @retval K_ERR_NONE return successfully.
*/
__API__ k_err_t tos_knl_sched_unlock(void);
/////////////////new for smp//////////////////////////////////////////
//new API for smp
#if (USE_SMP ==1u)
__API__ static void prvDisableInterruptsAndPortStartSchedulerOnCore( void );
__API__ void smp_init_core0(void);
__KNL__ static void prvDisableInterruptsAndPortStartSchedulerOnCore( void );
__KNL__ void smp_init_core0(void);
/**
* @brief init the kernels .
*
* @attention None
*
* @param None
*
* @return errcode
* @retval Non-#K_ERR_NONE return failed.
* @retval #K_ERR_NONE return successfully.
*/
__API__ k_err_t tos_knl_smp_init(void);
__KNL__ int knl_is_idle_pre(k_task_t *task);
/**
* @brief start the kernels .
*
* @attention None
*
* @param None
*
* @return errcode
* @retval Non-#K_ERR_NONE return failed.
* @retval #K_ERR_NONE return successfully.
*/
__API__ k_err_t tos_knl_start_smp(void);
#if ( configUSE_CORE_AFFINITY == 1u )
/**
* @brief Sets the core affinity mask for a task.
* It sets the cores on which a task can run. configUSE_CORE_AFFINITY must
be defined as 1 for this function to be available.
*
* @attention None
*
* @param[in] Task the task which is wanted to be affinited with the specific core
* CoreAffinityMask Define the core affinity mask
* Example usage:// on core 0 and core 2.
* uxCoreAffinityMask = ( ( 1 << 0 ) | ( 1 << 2 ) );
*
* @return None
*/
__API__ void tos_TaskCoreAffinitySet( k_task_t * Task, BaseType_t CoreAffinityMask );
/**
* @brief Gets the core affinity mask for a task.
*
* @attention None
*
* @param[in] Task the task you want to get CoreAffinityMask from
*
* @return return the CoreAffinityMask
*/
__API__ BaseType_t vTaskCoreAffinityGet( const k_task_t * Task );
#endif
#endif

View File

@ -19,7 +19,7 @@
#if (USE_SMP ==1u)
extern uint8_t ucPrimaryCoreNum ;
__API__ static void prvDisableInterruptsAndPortStartSchedulerOnCore( void )
__KNL__ static void prvDisableInterruptsAndPortStartSchedulerOnCore( void )
{
TOS_CPU_CPSR_ALLOC();
TOS_CPU_INT_DISABLE();
@ -27,7 +27,7 @@ __API__ static void prvDisableInterruptsAndPortStartSchedulerOnCore( void )
tos_knl_start();
}
__API__ void smp_init_core0(void){
__KNL__ void smp_init_core0(void){
/* No one else should use these! */
spin_lock_claim( configSMP_SPINLOCK_0 );
spin_lock_claim( configSMP_SPINLOCK_1 );