Description: refactor
Reviewed-by: likailong
This commit is contained in:
544
kernel/include/los_config.h
Executable file → Normal file
544
kernel/include/los_config.h
Executable file → Normal file
@@ -38,6 +38,7 @@
|
||||
#define _LOS_CONFIG_H
|
||||
|
||||
#include "target_config.h"
|
||||
#include "los_compiler.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
@@ -53,15 +54,7 @@ extern "C" {
|
||||
* System clock (unit: HZ)
|
||||
*/
|
||||
#ifndef OS_SYS_CLOCK
|
||||
#define OS_SYS_CLOCK 100000000UL
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @ingroup los_config
|
||||
* timer1 clock (unit: HZ)
|
||||
*/
|
||||
#ifndef OS_TIME_TIMER_CLOCK
|
||||
#define OS_TIME_TIMER_CLOCK OS_SYS_CLOCK
|
||||
#error "OS_SYS_CLOCK is system clock rate which should be defined in target_config.h"
|
||||
#endif
|
||||
|
||||
/**
|
||||
@@ -69,7 +62,7 @@ extern "C" {
|
||||
* Number of Ticks in one second
|
||||
*/
|
||||
#ifndef LOSCFG_BASE_CORE_TICK_PER_SECOND
|
||||
#define LOSCFG_BASE_CORE_TICK_PER_SECOND 1000UL
|
||||
#define LOSCFG_BASE_CORE_TICK_PER_SECOND (100UL)
|
||||
#endif
|
||||
|
||||
#if defined(LOSCFG_BASE_CORE_TICK_PER_SECOND) && \
|
||||
@@ -106,35 +99,10 @@ extern "C" {
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @ingroup los_config
|
||||
* External configuration item for timer tailoring
|
||||
*/
|
||||
#ifndef LOSCFG_BASE_CORE_TICK_HW_TIME1
|
||||
#define LOSCFG_BASE_CORE_TICK_HW_TIME1 YES
|
||||
#endif
|
||||
|
||||
#ifndef LOSCFG_BASE_CORE_TICK_HW_TIME
|
||||
#define LOSCFG_BASE_CORE_TICK_HW_TIME NO
|
||||
#define LOSCFG_BASE_CORE_TICK_HW_TIME 0
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @ingroup los_config
|
||||
* Configuration liteos kernel tickless
|
||||
*/
|
||||
#ifndef LOSCFG_KERNEL_TICKLESS
|
||||
#define LOSCFG_KERNEL_TICKLESS NO
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @ingroup los_config
|
||||
* External configuration item for timer interrupt number
|
||||
*/
|
||||
#ifndef LOSCFG_BASE_TIMER_INT_NUM
|
||||
#define LOSCFG_BASE_TIMER_INT_NUM 15
|
||||
#endif
|
||||
|
||||
|
||||
/* =============================================================================
|
||||
Hardware interrupt module configuration
|
||||
============================================================================= */
|
||||
@@ -143,7 +111,7 @@ extern "C" {
|
||||
* Configuration item for hardware interrupt tailoring
|
||||
*/
|
||||
#ifndef LOSCFG_PLATFORM_HWI
|
||||
#define LOSCFG_PLATFORM_HWI YES
|
||||
#define LOSCFG_PLATFORM_HWI 1
|
||||
#endif
|
||||
|
||||
/**
|
||||
@@ -154,7 +122,6 @@ extern "C" {
|
||||
#define LOSCFG_PLATFORM_HWI_LIMIT 32
|
||||
#endif
|
||||
|
||||
|
||||
/* =============================================================================
|
||||
Task module configuration
|
||||
============================================================================= */
|
||||
@@ -205,7 +172,7 @@ extern "C" {
|
||||
* Configuration item for task Robin tailoring
|
||||
*/
|
||||
#ifndef LOSCFG_BASE_CORE_TIMESLICE
|
||||
#define LOSCFG_BASE_CORE_TIMESLICE YES
|
||||
#define LOSCFG_BASE_CORE_TIMESLICE 1
|
||||
#endif
|
||||
|
||||
/**
|
||||
@@ -221,7 +188,7 @@ extern "C" {
|
||||
* Configuration item for task (stack) monitoring module tailoring
|
||||
*/
|
||||
#ifndef LOSCFG_BASE_CORE_TSK_MONITOR
|
||||
#define LOSCFG_BASE_CORE_TSK_MONITOR NO
|
||||
#define LOSCFG_BASE_CORE_TSK_MONITOR 0
|
||||
#endif
|
||||
|
||||
/**
|
||||
@@ -229,7 +196,7 @@ extern "C" {
|
||||
* Configuration item for task perf task filter hook
|
||||
*/
|
||||
#ifndef LOSCFG_BASE_CORE_EXC_TSK_SWITCH
|
||||
#define LOSCFG_BASE_CORE_EXC_TSK_SWITCH NO
|
||||
#define LOSCFG_BASE_CORE_EXC_TSK_SWITCH 0
|
||||
#endif
|
||||
|
||||
/**
|
||||
@@ -253,7 +220,7 @@ extern "C" {
|
||||
* Configuration item for task stack independent
|
||||
*/
|
||||
#ifndef LOSCFG_BASE_CORE_TASKSTACK_INDEPENDENT
|
||||
#define LOSCFG_BASE_CORE_TASKSTACK_INDEPENDENT NO
|
||||
#define LOSCFG_BASE_CORE_TASKSTACK_INDEPENDENT 0
|
||||
#endif
|
||||
|
||||
/**
|
||||
@@ -272,7 +239,7 @@ extern "C" {
|
||||
* Configuration item for semaphore module tailoring
|
||||
*/
|
||||
#ifndef LOSCFG_BASE_IPC_SEM
|
||||
#define LOSCFG_BASE_IPC_SEM YES
|
||||
#define LOSCFG_BASE_IPC_SEM 1
|
||||
#endif
|
||||
|
||||
/**
|
||||
@@ -291,7 +258,7 @@ extern "C" {
|
||||
* Configuration item for mutex module tailoring
|
||||
*/
|
||||
#ifndef LOSCFG_BASE_IPC_MUX
|
||||
#define LOSCFG_BASE_IPC_MUX YES
|
||||
#define LOSCFG_BASE_IPC_MUX 1
|
||||
#endif
|
||||
|
||||
/**
|
||||
@@ -310,7 +277,7 @@ extern "C" {
|
||||
* Configuration item for queue module tailoring
|
||||
*/
|
||||
#ifndef LOSCFG_BASE_IPC_QUEUE
|
||||
#define LOSCFG_BASE_IPC_QUEUE YES
|
||||
#define LOSCFG_BASE_IPC_QUEUE 1
|
||||
#endif
|
||||
|
||||
/**
|
||||
@@ -330,7 +297,7 @@ extern "C" {
|
||||
* Configuration item for software timer module tailoring
|
||||
*/
|
||||
#ifndef LOSCFG_BASE_CORE_SWTMR
|
||||
#define LOSCFG_BASE_CORE_SWTMR YES
|
||||
#define LOSCFG_BASE_CORE_SWTMR 1
|
||||
#endif
|
||||
|
||||
/**
|
||||
@@ -349,24 +316,18 @@ extern "C" {
|
||||
#define LOSCFG_BASE_CORE_TSK_SWTMR_STACK_SIZE LOSCFG_BASE_CORE_TSK_DEFAULT_STACK_SIZE
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @ingroup los_config
|
||||
* Configurate item for handling software timer interrupt in task tailoring
|
||||
*/
|
||||
#ifndef LOSCFG_BASE_CORE_SWTMR_TASK
|
||||
#define LOSCFG_BASE_CORE_SWTMR_TASK YES
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @ingroup los_config
|
||||
* Configurate item for software timer align tailoring
|
||||
*/
|
||||
#ifndef LOSCFG_BASE_CORE_SWTMR_ALIGN
|
||||
#define LOSCFG_BASE_CORE_SWTMR_ALIGN NO
|
||||
#define LOSCFG_BASE_CORE_SWTMR_ALIGN 0
|
||||
#endif
|
||||
|
||||
#if((LOSCFG_BASE_CORE_SWTMR == NO) && (LOSCFG_BASE_CORE_SWTMR_ALIGN == YES))
|
||||
#error "swtmr align first need support swmtr, should make LOSCFG_BASE_CORE_SWTMR = YES"
|
||||
#if (LOSCFG_BASE_CORE_SWTMR_ALIGN == 1)
|
||||
#if (LOSCFG_BASE_CORE_SWTMR == 0)
|
||||
#error "if LOSCFG_BASE_CORE_SWTMR_ALIGN is set to 1, then LOSCFG_BASE_CORE_SWTMR must alse be set to 1"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/**
|
||||
@@ -374,7 +335,7 @@ extern "C" {
|
||||
* Max number of software timers ID
|
||||
*/
|
||||
#ifndef OS_SWTMR_MAX_TIMERID
|
||||
#define OS_SWTMR_MAX_TIMERID ((65535 / LOSCFG_BASE_CORE_SWTMR_LIMIT) * LOSCFG_BASE_CORE_SWTMR_LIMIT)
|
||||
#define OS_SWTMR_MAX_TIMERID ((65535 / LOSCFG_BASE_CORE_SWTMR_LIMIT) * LOSCFG_BASE_CORE_SWTMR_LIMIT)
|
||||
#endif
|
||||
|
||||
/**
|
||||
@@ -390,14 +351,16 @@ extern "C" {
|
||||
* Minimum divisor of software timer multiple alignment
|
||||
*/
|
||||
#ifndef LOS_COMMON_DIVISOR
|
||||
#define LOS_COMMON_DIVISOR 10
|
||||
#define LOS_COMMON_DIVISOR 10
|
||||
#endif
|
||||
|
||||
#if ((LOSCFG_BASE_IPC_QUEUE == NO) && (LOSCFG_BASE_CORE_SWTMR == YES))
|
||||
#error "queue moudle is closed, don't support swtmr"
|
||||
#if (LOSCFG_BASE_CORE_SWTMR == 1)
|
||||
#if (LOSCFG_BASE_IPC_QUEUE == 0)
|
||||
#error "if LOSCFG_BASE_CORE_SWTMR is set to 1, then LOSCFG_BASE_IPC_QUEUE must alse be set to 1"
|
||||
#endif
|
||||
#endif
|
||||
/* =============================================================================
|
||||
Memory module configuration
|
||||
Memory module configuration ---- to be refactored
|
||||
============================================================================= */
|
||||
extern UINT8 *m_aucSysMem0;
|
||||
|
||||
@@ -423,7 +386,6 @@ extern UINT8 *m_aucSysMem0;
|
||||
*/
|
||||
extern UINT32 g_sysMemAddrEnd;
|
||||
|
||||
|
||||
/**
|
||||
* @ingroup los_config
|
||||
* Memory size
|
||||
@@ -433,7 +395,7 @@ extern UINT32 g_sysMemAddrEnd;
|
||||
#endif
|
||||
|
||||
#ifndef LOSCFG_MEMORY_BESTFIT
|
||||
#define LOSCFG_MEMORY_BESTFIT YES
|
||||
#define LOSCFG_MEMORY_BESTFIT 1
|
||||
#endif
|
||||
|
||||
/**
|
||||
@@ -441,15 +403,7 @@ extern UINT32 g_sysMemAddrEnd;
|
||||
* Configuration module tailoring of more mempry pool checking
|
||||
*/
|
||||
#ifndef LOSCFG_MEM_MUL_POOL
|
||||
#define LOSCFG_MEM_MUL_POOL YES
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @ingroup los_config
|
||||
* Configuration module tailoring of slab memory
|
||||
*/
|
||||
#ifndef LOSCFG_KERNEL_MEM_SLAB
|
||||
#define LOSCFG_KERNEL_MEM_SLAB YES
|
||||
#define LOSCFG_MEM_MUL_POOL 1
|
||||
#endif
|
||||
|
||||
/**
|
||||
@@ -457,7 +411,7 @@ extern UINT32 g_sysMemAddrEnd;
|
||||
* Configuration module tailoring of mem node integrity checking
|
||||
*/
|
||||
#ifndef LOSCFG_BASE_MEM_NODE_INTEGRITY_CHECK
|
||||
#define LOSCFG_BASE_MEM_NODE_INTEGRITY_CHECK NO
|
||||
#define LOSCFG_BASE_MEM_NODE_INTEGRITY_CHECK 0
|
||||
#endif
|
||||
|
||||
/**
|
||||
@@ -465,7 +419,7 @@ extern UINT32 g_sysMemAddrEnd;
|
||||
* Configuration module tailoring of mem node size checking
|
||||
*/
|
||||
#ifndef LOSCFG_BASE_MEM_NODE_SIZE_CHECK
|
||||
#define LOSCFG_BASE_MEM_NODE_SIZE_CHECK YES
|
||||
#define LOSCFG_BASE_MEM_NODE_SIZE_CHECK 0
|
||||
#endif
|
||||
|
||||
/**
|
||||
@@ -473,7 +427,7 @@ extern UINT32 g_sysMemAddrEnd;
|
||||
* Configuration of memory statistics
|
||||
*/
|
||||
#ifndef LOSCFG_KERNEL_MEM_STATISTICS
|
||||
#define LOSCFG_KERNEL_MEM_STATISTICS NO
|
||||
#define LOSCFG_KERNEL_MEM_STATISTICS 0
|
||||
#endif
|
||||
|
||||
/**
|
||||
@@ -489,7 +443,7 @@ extern UINT32 g_sysMemAddrEnd;
|
||||
* Configuration heap memory peak statistics
|
||||
*/
|
||||
#ifndef LOSCFG_HEAP_MEMORY_PEAK_STATISTICS
|
||||
#define LOSCFG_HEAP_MEMORY_PEAK_STATISTICS YES
|
||||
#define LOSCFG_HEAP_MEMORY_PEAK_STATISTICS 1
|
||||
#endif
|
||||
|
||||
/**
|
||||
@@ -508,7 +462,6 @@ extern UINT32 g_sysMemAddrEnd;
|
||||
#define OS_SYS_NOCACHEMEM_ADDR (&g_sysNoCacheMem0[0])
|
||||
#endif
|
||||
|
||||
|
||||
/* =============================================================================
|
||||
Exception module configuration
|
||||
============================================================================= */
|
||||
@@ -517,7 +470,7 @@ extern UINT32 g_sysMemAddrEnd;
|
||||
* Configuration item for exception tailoring
|
||||
*/
|
||||
#ifndef LOSCFG_PLATFORM_EXC
|
||||
#define LOSCFG_PLATFORM_EXC NO
|
||||
#define LOSCFG_PLATFORM_EXC 0
|
||||
#endif
|
||||
|
||||
/**
|
||||
@@ -525,71 +478,9 @@ extern UINT32 g_sysMemAddrEnd;
|
||||
* Configuration of hardware stack protection
|
||||
*/
|
||||
#ifndef LOSCFG_EXC_HRADWARE_STACK_PROTECTION
|
||||
#define LOSCFG_EXC_HRADWARE_STACK_PROTECTION NO
|
||||
#define LOSCFG_EXC_HRADWARE_STACK_PROTECTION 0
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @ingroup los_config
|
||||
* Configuration of userspace support
|
||||
*/
|
||||
#ifndef LOSCFG_KERNEL_USERSPACE
|
||||
#define LOSCFG_KERNEL_USERSPACE NO
|
||||
#endif
|
||||
|
||||
/* =============================================================================
|
||||
MPU module configuration
|
||||
============================================================================= */
|
||||
/**
|
||||
* @ingroup los_config
|
||||
* Configuration item for MPU
|
||||
*/
|
||||
#ifndef LOSCFG_BASE_CORE_MPU
|
||||
#define LOSCFG_BASE_CORE_MPU NO
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @ingroup los_config
|
||||
* MPU support number : MPU maximum number of region support(According to the cotex-m4 authority Guide)
|
||||
*/
|
||||
#ifndef LOSCFG_MPU_MAX_SUPPORT
|
||||
#define LOSCFG_MPU_MAX_SUPPORT 8
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @ingroup los_config
|
||||
* MPU support address range : from LOSCFG_MPU_MIN_ADDRESS to LOSCFG_MPU_MAX_ADDRESS
|
||||
*/
|
||||
#ifndef LOSCFG_MPU_MIN_ADDRESS
|
||||
#define LOSCFG_MPU_MIN_ADDRESS 0x0UL // Minimum protected address
|
||||
#endif
|
||||
|
||||
#ifndef LOSCFG_MPU_MAX_ADDRESS
|
||||
#define LOSCFG_MPU_MAX_ADDRESS 0xFFFFFFFFUL // Maximum protected address
|
||||
#endif
|
||||
|
||||
/* =============================================================================
|
||||
Runstop module configuration
|
||||
============================================================================= */
|
||||
/**
|
||||
* @ingroup los_config
|
||||
* Configuration item for runstop module tailoring
|
||||
*/
|
||||
#ifndef LOSCFG_KERNEL_RUNSTOP
|
||||
#define LOSCFG_KERNEL_RUNSTOP NO
|
||||
#endif
|
||||
|
||||
/* =============================================================================
|
||||
Perf module configuration
|
||||
============================================================================= */
|
||||
/**
|
||||
* @ingroup los_config
|
||||
* Configuration item for performance moniter unit
|
||||
*/
|
||||
#ifndef OS_INCLUDE_PERF
|
||||
#define OS_INCLUDE_PERF NO
|
||||
#endif
|
||||
|
||||
|
||||
/* =============================================================================
|
||||
CPUP configuration
|
||||
============================================================================= */
|
||||
@@ -598,34 +489,9 @@ extern UINT32 g_sysMemAddrEnd;
|
||||
* Configuration item for CPU usage tailoring
|
||||
*/
|
||||
#ifndef LOSCFG_BASE_CORE_CPUP
|
||||
#define LOSCFG_BASE_CORE_CPUP NO
|
||||
#define LOSCFG_BASE_CORE_CPUP 0
|
||||
#endif
|
||||
|
||||
|
||||
/* =============================================================================
|
||||
fw Interface configuration
|
||||
============================================================================= */
|
||||
/**
|
||||
* @ingroup los_config
|
||||
* Configuration item for the monitoring of task communication
|
||||
*/
|
||||
#ifndef LOSCFG_COMPAT_CMSIS_FW
|
||||
#define LOSCFG_COMPAT_CMSIS_FW NO
|
||||
#endif
|
||||
|
||||
|
||||
/* =============================================================================
|
||||
Shell module configuration
|
||||
============================================================================= */
|
||||
/**
|
||||
* @ingroup los_config
|
||||
* Configuration item for shell module tailoring
|
||||
*/
|
||||
#ifndef OS_INCLUDE_SHELL
|
||||
#define OS_INCLUDE_SHELL NO
|
||||
#endif
|
||||
|
||||
|
||||
/* =============================================================================
|
||||
Test module configuration
|
||||
============================================================================= */
|
||||
@@ -650,350 +516,10 @@ extern UINT32 g_sysMemAddrEnd;
|
||||
* Configuration liteos trace
|
||||
*/
|
||||
#ifndef LOSCFG_KERNEL_TRACE
|
||||
#define LOSCFG_KERNEL_TRACE NO
|
||||
#define LOSCFG_KERNEL_TRACE 0
|
||||
#endif
|
||||
|
||||
|
||||
/* =============================================================================
|
||||
Declaration of Huawei LiteOS module initialization functions
|
||||
============================================================================= */
|
||||
/**
|
||||
* @ingroup los_config
|
||||
* @brief: Task init function.
|
||||
*
|
||||
* @par Description:
|
||||
* This API is used to initialize task module.
|
||||
*
|
||||
* @attention:
|
||||
* <ul><li>None.</li></ul>
|
||||
*
|
||||
* @param: None.
|
||||
*
|
||||
* @retval #LOS_ERRNO_TSK_NO_MEMORY 0x03000200:Insufficient memory for task creation.
|
||||
* @retval #LOS_OK 0:Task initialization success.
|
||||
*
|
||||
* @par Dependency:
|
||||
* <ul><li>los_config.h: the header file that contains the API declaration.</li></ul>
|
||||
* @see None.
|
||||
*/
|
||||
extern UINT32 OsTaskInit(VOID);
|
||||
|
||||
|
||||
/**
|
||||
* @ingroup los_config
|
||||
* @brief: hardware interrupt init function.
|
||||
*
|
||||
* @par Description:
|
||||
* This API is used to initialize hardware interrupt module.
|
||||
*
|
||||
* @attention:
|
||||
* <ul><li>None.</li></ul>
|
||||
*
|
||||
* @param: None.
|
||||
*
|
||||
* @retval #LOS_OK 0:Hardware interrupt initialization success.
|
||||
*
|
||||
* @par Dependency:
|
||||
* <ul><li>los_config.h: the header file that contains the API declaration.</li></ul>
|
||||
* @see None.
|
||||
*/
|
||||
extern VOID OsHwiInit(VOID);
|
||||
|
||||
|
||||
/**
|
||||
* @ingroup los_config
|
||||
* @brief: Semaphore init function.
|
||||
*
|
||||
* @par Description:
|
||||
* This API is used to initialize Semaphore module.
|
||||
*
|
||||
* @attention:
|
||||
* <ul><li>None.</li></ul>
|
||||
*
|
||||
* @param: None.
|
||||
*
|
||||
* @retval #LOS_ERRNO_SEM_NO_MEMORY 0x02000700:The memory is insufficient.
|
||||
* @retval #LOS_OK 0:Semaphore initialization success.
|
||||
*
|
||||
* @par Dependency:
|
||||
* <ul><li>los_config.h: the header file that contains the API declaration.</li></ul>
|
||||
* @see None.
|
||||
*/
|
||||
extern UINT32 OsSemInit(VOID);
|
||||
|
||||
|
||||
/**
|
||||
* @ingroup los_config
|
||||
* @brief: Mutex init function.
|
||||
*
|
||||
* @par Description:
|
||||
* This API is used to initialize mutex module.
|
||||
*
|
||||
* @attention:
|
||||
* <ul><li>None.</li></ul>
|
||||
*
|
||||
* @param: None.
|
||||
*
|
||||
* @retval #LOS_ERRNO_MUX_NO_MEMORY 0x02001d00:The memory request fails.
|
||||
* @retval #LOS_OK 0:Mutex initialization success.
|
||||
*
|
||||
* @par Dependency:
|
||||
* <ul><li>los_config.h: the header file that contains the API declaration.</li></ul>
|
||||
* @see None.
|
||||
*/
|
||||
extern UINT32 OsMuxInit(VOID);
|
||||
|
||||
|
||||
/**
|
||||
* @ingroup los_config
|
||||
* @brief: Queue init function.
|
||||
*
|
||||
* @par Description:
|
||||
* This API is used to initialize Queue module.
|
||||
*
|
||||
* @attention:
|
||||
* <ul><li>None.</li></ul>
|
||||
*
|
||||
* @param: None.
|
||||
*
|
||||
* @retval #LOS_ERRNO_QUEUE_MAXNUM_ZERO 0x02000600:The maximum number of queue resources is configured to 0.
|
||||
* @retval #LOS_ERRNO_QUEUE_NO_MEMORY 0x02000601:The queue block memory fails to be initialized.
|
||||
* @retval #LOS_OK 0:Queue initialization success.
|
||||
*
|
||||
* @par Dependency:
|
||||
* <ul><li>los_config.h: the header file that contains the API declaration.</li></ul>
|
||||
* @see None.
|
||||
*/
|
||||
extern UINT32 OsQueueInit(VOID);
|
||||
|
||||
|
||||
/**
|
||||
* @ingroup los_config
|
||||
* @brief: Software Timers init function.
|
||||
*
|
||||
* @par Description:
|
||||
* This API is used to initialize Software Timers module.
|
||||
*
|
||||
* @attention:
|
||||
* <ul><li>None.</li></ul>
|
||||
*
|
||||
* @param: None.
|
||||
*
|
||||
* @retval #LOS_ERRNO_SWTMR_MAXSIZE_INVALID 0x02000308:Invalid configured number of software timers.
|
||||
* @retval #LOS_ERRNO_SWTMR_NO_MEMORY 0x02000307:Insufficient memory for software timer linked list creation.
|
||||
* @retval #LOS_ERRNO_SWTMR_HANDLER_POOL_NO_MEM 0x0200030a:Insufficient memory allocated by membox.
|
||||
* @retval #LOS_ERRNO_SWTMR_QUEUE_CREATE_FAILED 0x0200030b:The software timer queue fails to be created.
|
||||
* @retval #LOS_ERRNO_SWTMR_TASK_CREATE_FAILED 0x0200030c:The software timer task fails to be created.
|
||||
* @retval #LOS_OK 0:Software Timers initialization success.
|
||||
*
|
||||
* @par Dependency:
|
||||
* <ul><li>los_config.h: the header file that contains the API declaration.</li></ul>
|
||||
* @see None.
|
||||
*/
|
||||
extern UINT32 OsSwtmrInit(VOID);
|
||||
|
||||
|
||||
/**
|
||||
* @ingroup los_config
|
||||
* @brief: Task start running function.
|
||||
*
|
||||
* @par Description:
|
||||
* This API is used to start a task.
|
||||
*
|
||||
* @attention:
|
||||
* <ul><li>None.</li></ul>
|
||||
*
|
||||
* @param: None.
|
||||
*
|
||||
* @retval None.
|
||||
*
|
||||
* @par Dependency:
|
||||
* <ul><li>los_config.h: the header file that contains the API declaration.</li></ul>
|
||||
* @see None.
|
||||
*/
|
||||
extern VOID LOS_StartToRun(VOID);
|
||||
|
||||
|
||||
/**
|
||||
* @ingroup los_config
|
||||
* @brief: Test Task init function.
|
||||
*
|
||||
* @par Description:
|
||||
* This API is used to initialize Test Task.
|
||||
*
|
||||
* @attention:
|
||||
* <ul><li>None.</li></ul>
|
||||
*
|
||||
* @param: None.
|
||||
*
|
||||
* @retval #LOS_OK 0:App_Task initialization success.
|
||||
*
|
||||
* @par Dependency:
|
||||
* <ul><li>los_config.h: the header file that contains the API declaration.</li></ul>
|
||||
* @see None.
|
||||
*/
|
||||
extern UINT32 los_TestInit(VOID);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @ingroup los_config
|
||||
* @brief: Task start function.
|
||||
*
|
||||
* @par Description:
|
||||
* This API is used to start all tasks.
|
||||
*
|
||||
* @attention:
|
||||
* <ul><li>None.</li></ul>
|
||||
*
|
||||
* @param: None.
|
||||
*
|
||||
* @retval None.
|
||||
*
|
||||
* @par Dependency:
|
||||
* <ul><li>los_config.h: the header file that contains the API declaration.</li></ul>
|
||||
* @see None.
|
||||
*/
|
||||
extern VOID OsStart(VOID);
|
||||
|
||||
|
||||
/**
|
||||
* @ingroup los_config
|
||||
* @brief: Hardware init function.
|
||||
*
|
||||
* @par Description:
|
||||
* This API is used to initialize Hardware module.
|
||||
*
|
||||
* @attention:
|
||||
* <ul><li>None.</li></ul>
|
||||
*
|
||||
* @param: None.
|
||||
*
|
||||
* @retval None.
|
||||
*
|
||||
* @par Dependency:
|
||||
* <ul><li>los_config.h: the header file that contains the API declaration.</li></ul>
|
||||
* @see None.
|
||||
*/
|
||||
extern VOID OsHwInit(VOID);
|
||||
|
||||
|
||||
/**
|
||||
* @ingroup los_config
|
||||
* @brief Configure Tick Interrupt Start.
|
||||
*
|
||||
* @par Description:
|
||||
* This API is used to configure Tick Interrupt Start while macro LOSCFG_BASE_CORE_TICK_HW_TIME is No.
|
||||
*
|
||||
* @attention
|
||||
* <ul>
|
||||
* <li>None.</li>
|
||||
* </ul>
|
||||
*
|
||||
* @param: None.
|
||||
*
|
||||
* @retval #LOS_OK 0:configure Tick Interrupt success.
|
||||
* @retval #LOS_ERRNO_TICK_CFG_INVALID 0x02000400:configure Tick Interrupt failed.
|
||||
*
|
||||
* @par Dependency:
|
||||
* <ul><li>los_config.h: the header file that contains the API declaration.</li></ul>
|
||||
* @see
|
||||
*/
|
||||
extern UINT32 OsTickStart(VOID);
|
||||
|
||||
/**
|
||||
* @ingroup los_config
|
||||
* @brief Scheduling initialization.
|
||||
*
|
||||
* @par Description:
|
||||
* <ul>
|
||||
* <li>This API is used to initialize scheduling that is used for later task scheduling.</li>
|
||||
* </ul>
|
||||
* @attention
|
||||
* <ul>
|
||||
* <li>None.</li>
|
||||
* </ul>
|
||||
*
|
||||
* @param: None.
|
||||
*
|
||||
* @retval: None.
|
||||
* @par Dependency:
|
||||
* <ul><li>los_config.h: the header file that contains the API declaration.</li></ul>
|
||||
* @see
|
||||
*/
|
||||
extern VOID OsTimesliceInit(VOID);
|
||||
|
||||
|
||||
/**
|
||||
* @ingroup los_config
|
||||
* @brief: System memory init function.
|
||||
*
|
||||
* @par Description:
|
||||
* This API is used to initialize system memory module.
|
||||
*
|
||||
* @attention:
|
||||
* <ul><li>None.</li></ul>
|
||||
*
|
||||
* @param: None.
|
||||
*
|
||||
* @retval #LOS_OK 0:System memory initialization success.
|
||||
* @retval #OS_ERROR (UINT32)(-1):System memory initialization failed.
|
||||
*
|
||||
* @par Dependency:
|
||||
* <ul><li>los_config.h: the header file that contains the API declaration.</li></ul>
|
||||
* @see None.
|
||||
*/
|
||||
extern LITE_OS_SEC_TEXT_INIT UINT32 OsMemSystemInit(VOID);
|
||||
|
||||
|
||||
/**
|
||||
* @ingroup los_config
|
||||
* @brief: Task Monitor init function.
|
||||
*
|
||||
* @par Description:
|
||||
* This API is used to initialize Task Monitor module.
|
||||
*
|
||||
* @attention:
|
||||
* <ul><li>None.</li></ul>
|
||||
*
|
||||
* @param: None.
|
||||
*
|
||||
* @retval #LOS_OK 0:Task Monitor initialization success.
|
||||
*
|
||||
* @par Dependency:
|
||||
* <ul><li>los_config.h: the header file that contains the API declaration.</li></ul>
|
||||
* @see None.
|
||||
*/
|
||||
extern VOID OsTaskMonInit(VOID);
|
||||
|
||||
|
||||
/**
|
||||
* @ingroup los_config
|
||||
* @brief: CPUP init function.
|
||||
*
|
||||
* @par Description:
|
||||
* This API is used to initialize CPUP module.
|
||||
*
|
||||
* @attention:
|
||||
* <ul><li>None.</li></ul>
|
||||
*
|
||||
* @param: None.
|
||||
*
|
||||
* @retval #LOS_ERRNO_CPUP_NO_MEMORY 0x02001e00:The request for memory fails.
|
||||
* @retval #LOS_OK 0:CPUP initialization success.
|
||||
*
|
||||
* @par Dependency:
|
||||
* <ul><li>los_config.h: the header file that contains the API declaration.</li></ul>
|
||||
* @see None.
|
||||
*/
|
||||
extern UINT32 OsCpupInit(VOID);
|
||||
|
||||
|
||||
extern LITE_OS_SEC_TEXT_INIT UINT32 LOS_Start(VOID);
|
||||
|
||||
extern LITE_OS_SEC_TEXT_INIT INT32 main(VOID);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
}
|
||||
|
||||
0
kernel/include/los_event.h
Executable file → Normal file
0
kernel/include/los_event.h
Executable file → Normal file
4
kernel/include/los_membox.h
Executable file → Normal file
4
kernel/include/los_membox.h
Executable file → Normal file
@@ -32,7 +32,7 @@
|
||||
#ifndef _LOS_MEMBOX_H
|
||||
#define _LOS_MEMBOX_H
|
||||
|
||||
#if (LOSCFG_PLATFORM_EXC == YES)
|
||||
#if (LOSCFG_PLATFORM_EXC == 1)
|
||||
#include "los_memory.h"
|
||||
#endif
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
* @ingroup los_membox
|
||||
* Define whether to check the address validity
|
||||
*/
|
||||
#if (LOSCFG_PLATFORM_EXC == YES)
|
||||
#if (LOSCFG_PLATFORM_EXC == 0)
|
||||
#define LOS_MEMBOX_CHECK
|
||||
extern UINT8 g_memMang[];
|
||||
#endif
|
||||
|
||||
996
kernel/include/los_memory.h
Executable file → Normal file
996
kernel/include/los_memory.h
Executable file → Normal file
File diff suppressed because it is too large
Load Diff
0
kernel/include/los_mux.h
Executable file → Normal file
0
kernel/include/los_mux.h
Executable file → Normal file
0
kernel/include/los_queue.h
Executable file → Normal file
0
kernel/include/los_queue.h
Executable file → Normal file
0
kernel/include/los_sem.h
Executable file → Normal file
0
kernel/include/los_sem.h
Executable file → Normal file
6
kernel/include/los_swtmr.h
Executable file → Normal file
6
kernel/include/los_swtmr.h
Executable file → Normal file
@@ -211,7 +211,7 @@ extern "C" {
|
||||
*/
|
||||
#define LOS_ERRNO_SWTMR_TICK_PTR_NULL LOS_ERRNO_OS_ERROR(LOS_MOD_SWTMR, 0x10)
|
||||
|
||||
#if (LOSCFG_BASE_CORE_SWTMR_ALIGN == YES)
|
||||
#if (LOSCFG_BASE_CORE_SWTMR_ALIGN == 1)
|
||||
#define OS_ERRNO_SWTMR_ROUSES_INVALID LOS_ERRNO_OS_ERROR(LOS_MOD_SWTMR, 0x11)
|
||||
#define OS_ERRNO_SWTMR_ALIGN_INVALID LOS_ERRNO_OS_ERROR(LOS_MOD_SWTMR, 0x12)
|
||||
|
||||
@@ -269,7 +269,7 @@ typedef struct tagSwTmrCtrl {
|
||||
struct tagSwTmrCtrl *pstNext; /* Pointer to the next software timer */
|
||||
UINT8 ucState; /* Software timer state */
|
||||
UINT8 ucMode; /* Software timer mode */
|
||||
#if (LOSCFG_BASE_CORE_SWTMR_ALIGN == YES)
|
||||
#if (LOSCFG_BASE_CORE_SWTMR_ALIGN == 1)
|
||||
UINT8 ucRouses; /* wake up enable */
|
||||
UINT8 ucSensitive; /* align enable */
|
||||
#endif
|
||||
@@ -391,7 +391,7 @@ extern UINT32 LOS_SwtmrTimeGet(UINT16 swtmrID, UINT32 *tick);
|
||||
* <ul><li>los_swtmr.h: the header file that contains the API declaration.</li></ul>
|
||||
* @see LOS_SwtmrDelete
|
||||
*/
|
||||
#if (LOSCFG_BASE_CORE_SWTMR_ALIGN == YES)
|
||||
#if (LOSCFG_BASE_CORE_SWTMR_ALIGN == 1)
|
||||
extern UINT32 LOS_SwtmrCreate(UINT32 interval,
|
||||
UINT8 mode,
|
||||
SWTMR_PROC_FUNC handler,
|
||||
|
||||
82
kernel/include/los_task.h
Executable file → Normal file
82
kernel/include/los_task.h
Executable file → Normal file
@@ -500,6 +500,9 @@ extern VOID LOS_Msleep(UINT32 mSecs);
|
||||
* @see
|
||||
*/
|
||||
extern UINT32 LOS_Start(VOID);
|
||||
extern VOID LOS_Reboot(VOID);
|
||||
extern VOID LOS_Panic(const CHAR *fmt, ...);
|
||||
|
||||
|
||||
/**
|
||||
* @ingroup los_base
|
||||
@@ -1081,24 +1084,6 @@ extern UINT32 LOS_NewTaskIDGet(VOID);
|
||||
*/
|
||||
extern CHAR* LOS_TaskNameGet(UINT32 taskID);
|
||||
|
||||
/* *
|
||||
* @ingroup los_hw
|
||||
* @brief: Task scheduling Function.
|
||||
*
|
||||
* @par Description:
|
||||
* This API is used to scheduling task.
|
||||
*
|
||||
* @attention:
|
||||
* <ul><li>None.</li></ul>
|
||||
*
|
||||
* @param None.
|
||||
*
|
||||
* @retval: None.
|
||||
* @par Dependency:
|
||||
* <ul><li>los_hw.h: the header file that contains the API declaration.</li></ul>
|
||||
* @see None.
|
||||
*/
|
||||
extern VOID OsSchedule(VOID);
|
||||
|
||||
/* *
|
||||
* @ingroup los_hw
|
||||
@@ -1676,6 +1661,13 @@ extern LosTask g_losTask;
|
||||
*/
|
||||
extern UINT16 g_losTaskLock;
|
||||
|
||||
/* *
|
||||
* @ingroup los_hw
|
||||
* Check task schedule.
|
||||
*/
|
||||
#define LOS_CHECK_SCHEDULE ((!g_losTaskLock))
|
||||
|
||||
|
||||
/**
|
||||
* @ingroup los_task
|
||||
* Maximum number of tasks.
|
||||
@@ -1718,12 +1710,6 @@ extern LOS_DL_LIST g_losFreeTask;
|
||||
*/
|
||||
extern LOS_DL_LIST g_taskRecyleList;
|
||||
|
||||
/**
|
||||
* @ingroup los_task
|
||||
* @brief the block status of task
|
||||
*/
|
||||
extern VOID OsTaskSchedule(VOID);
|
||||
|
||||
/**
|
||||
* @ingroup los_task
|
||||
* @brief Modify the priority of task.
|
||||
@@ -2025,14 +2011,52 @@ extern VOID OsTimerListDelete(LosTaskCB *taskCB);
|
||||
*/
|
||||
extern UINT32 OsGetAllTskInfo(VOID);
|
||||
|
||||
|
||||
extern VOID *OsTskUserStackInit(VOID* stackPtr, VOID* userSP, UINT32 userStackSize);
|
||||
|
||||
extern VOID *OsTskStackInit(UINT32 taskID, UINT32 stackSize, VOID *topStack);
|
||||
/**
|
||||
* @ingroup los_timeslice
|
||||
* @brief Initialize time slices.
|
||||
*
|
||||
* @par Description:
|
||||
* <ul>
|
||||
* <li>This API is used to initialize time slices that defines the cycle of time slices according to
|
||||
LOSCFG_BASE_CORE_TIMESLICE_TIMEOUT.</li>
|
||||
* </ul>
|
||||
* @attention
|
||||
* <ul>
|
||||
* <li>None.</li>
|
||||
* </ul>
|
||||
*
|
||||
* @param None.
|
||||
*
|
||||
* @retval None.
|
||||
* @par Dependency:
|
||||
* <ul><li>los_timeslice_pri.h: the header file that contains the API declaration.</li></ul>
|
||||
* @see None.
|
||||
*/
|
||||
extern VOID OsTimesliceInit(VOID);
|
||||
|
||||
extern VOID OsSchedule(VOID);
|
||||
|
||||
extern VOID osTaskSchedule(VOID);
|
||||
/**
|
||||
* @ingroup los_timeslice
|
||||
* @brief Check time slices.
|
||||
*
|
||||
* @par Description:
|
||||
* <ul>
|
||||
* <li>This API is used to check time slices. If the number of Ticks equals to the time for task switch, tasks are switched. Otherwise, the Tick counting continues.</li>
|
||||
* </ul>
|
||||
* @attention
|
||||
* <ul>
|
||||
* <li>None.</li>
|
||||
* </ul>
|
||||
*
|
||||
* @param None.
|
||||
*
|
||||
* @retval None.
|
||||
* @par Dependency:
|
||||
* <ul><li>los_timeslice_pri.h: the header file that contains the API declaration.</li></ul>
|
||||
* @see None.
|
||||
*/
|
||||
extern VOID OsTimesliceCheck(VOID);
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
|
||||
110
kernel/include/los_tick.h
Executable file → Normal file
110
kernel/include/los_tick.h
Executable file → Normal file
@@ -98,44 +98,7 @@ extern "C" {
|
||||
* */
|
||||
extern UINT32 LOS_SysClockGet(VOID);
|
||||
|
||||
/**
|
||||
* @ingroup los_tickless
|
||||
* @brief enable the tickless mode.
|
||||
*
|
||||
* @par Description:
|
||||
* This API is used to enable the tickless mode. System can change from periodic clock mode to dynamic clock mode.
|
||||
*
|
||||
* @attention
|
||||
* <ul>
|
||||
* </ul>
|
||||
*
|
||||
* @param None.
|
||||
*
|
||||
* @retval None.
|
||||
* @par Dependency:
|
||||
* <ul><li>los_tickless.h: the header file that contains the API declaration.</li></ul>
|
||||
* @see LOS_TicklessDisable
|
||||
*/
|
||||
extern VOID LOS_TicklessEnable(VOID);
|
||||
/**
|
||||
* @ingroup los_tickless
|
||||
* @brief disable the tickless mode.
|
||||
*
|
||||
* @par Description:
|
||||
* This API is used to diable the tickless mode. System will not change from periodic clock mode to dynamic clock mode.
|
||||
*
|
||||
* @attention
|
||||
* <ul>
|
||||
* </ul>
|
||||
*
|
||||
* @param None.
|
||||
*
|
||||
* @retval None.
|
||||
* @par Dependency:
|
||||
* <ul><li>los_tickless.h: the header file that contains the API declaration.</li></ul>
|
||||
* @see LOS_TicklessEnable
|
||||
*/
|
||||
extern VOID LOS_TicklessDisable(VOID);
|
||||
|
||||
|
||||
/**
|
||||
* @ingroup los_sys
|
||||
@@ -345,77 +308,6 @@ extern UINT32 g_sysClock;
|
||||
*/
|
||||
extern VOID OsTickHandler(VOID);
|
||||
|
||||
#if (LOSCFG_KERNEL_TICKLESS == YES)
|
||||
LITE_OS_SEC_TEXT VOID OsTickHandlerLoop(UINT32 elapseTicks);
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @ingroup los_tick
|
||||
* @brief tick modul init.
|
||||
*
|
||||
* @par Description:
|
||||
* This API is called when the system initializating.
|
||||
*
|
||||
* @attention
|
||||
* <ul>
|
||||
* <li>None.</li>
|
||||
* </ul>
|
||||
*
|
||||
* @param systemClock [IN] Type #UINT32 SystemClock.
|
||||
* @param tickPerSecond [IN] Type #UINT32 TickPerSecond.
|
||||
*
|
||||
* @retval None.
|
||||
* @par Dependency:
|
||||
* <ul><li>los_tick_pri.h: the header file that contains the API declaration.</li></ul>
|
||||
* @see None.
|
||||
*/
|
||||
extern UINT32 OsTickInit(UINT32 systemClock, UINT32 tickPerSecond);
|
||||
|
||||
/**
|
||||
* @ingroup los_timeslice
|
||||
* @brief Initialize time slices.
|
||||
*
|
||||
* @par Description:
|
||||
* <ul>
|
||||
* <li>This API is used to initialize time slices that defines the cycle of time slices according to
|
||||
LOSCFG_BASE_CORE_TIMESLICE_TIMEOUT.</li>
|
||||
* </ul>
|
||||
* @attention
|
||||
* <ul>
|
||||
* <li>None.</li>
|
||||
* </ul>
|
||||
*
|
||||
* @param None.
|
||||
*
|
||||
* @retval None.
|
||||
* @par Dependency:
|
||||
* <ul><li>los_timeslice_pri.h: the header file that contains the API declaration.</li></ul>
|
||||
* @see None.
|
||||
*/
|
||||
extern VOID OsTimesliceInit(VOID);
|
||||
|
||||
/**
|
||||
* @ingroup los_timeslice
|
||||
* @brief Check time slices.
|
||||
*
|
||||
* @par Description:
|
||||
* <ul>
|
||||
* <li>This API is used to check time slices. If the number of Ticks equals to the time for task switch, tasks are switched. Otherwise, the Tick counting continues.</li>
|
||||
* </ul>
|
||||
* @attention
|
||||
* <ul>
|
||||
* <li>None.</li>
|
||||
* </ul>
|
||||
*
|
||||
* @param None.
|
||||
*
|
||||
* @retval None.
|
||||
* @par Dependency:
|
||||
* <ul><li>los_timeslice_pri.h: the header file that contains the API declaration.</li></ul>
|
||||
* @see None.
|
||||
*/
|
||||
extern VOID OsTimesliceCheck(VOID);
|
||||
|
||||
/**
|
||||
* @ingroup los_base
|
||||
* Define the CPU Tick structure.
|
||||
|
||||
Reference in New Issue
Block a user