refactor: 对LiteOS_a内核中menuconfig开关的宏使用#ifdef/#ifndef做预编译处理

LiteOS_a中有部分配置宏进行了重复冗余定义,导致当头文件未被包含时,极易引入错误,
故对menuconfig配置宏进行统一处理,均使用#ifdef/#ifndef作为预编译判断方式

Close #I3YEGS

Change-Id: Ife6db770cc66de1d6199a4f3ba3950e9bfd0e71a
Signed-off-by: boxi <lewis.liulei@huawei.com>
This commit is contained in:
boxi
2021-06-29 19:34:16 +08:00
parent 5db839acef
commit 4e4f2d6d7e
265 changed files with 526 additions and 557 deletions

View File

@@ -99,7 +99,7 @@ VOID ItSuiteExtendCpup(VOID)
ItExtendCpup010();
#endif
#if (LOSCFG_KERNEL_SMP == YES)
#ifdef LOSCFG_KERNEL_SMP
ItSmpExtendCpup001();
ItSmpExtendCpup002();
#ifdef LOSCFG_CPUP_INCLUDE_IRQ

View File

@@ -116,7 +116,7 @@ VOID ItExtendCpup009(VOID);
VOID ItExtendCpup010(VOID);
#endif
#if (LOSCFG_KERNEL_SMP == YES)
#ifdef LOSCFG_KERNEL_SMP
VOID ItSmpExtendCpup001(VOID);
VOID ItSmpExtendCpup002(VOID);
#ifdef LOSCFG_CPUP_INCLUDE_IRQ

View File

@@ -70,7 +70,7 @@ static UINT32 TaskF01(VOID)
task1.pcName = "TestCpupTsk2";
task1.usTaskPrio = TASK_PRIO_TEST - 1; // 1, used to calculate the task priority.
task1.uwResved = TASK_STATUS_UNDETACHED;
#if (LOSCFG_KERNEL_SMP == YES)
#ifdef LOSCFG_KERNEL_SMP
task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid());
#endif
ICUNIT_ASSERT_EQUAL(g_cpupTestCount, 0, g_cpupTestCount);
@@ -104,7 +104,7 @@ static UINT32 Testcase(VOID)
task1.pcName = "TestCpupTsk1";
task1.usTaskPrio = TASK_PRIO_TEST - 2; // 2, used to calculate the task priority.
task1.uwResved = TASK_STATUS_UNDETACHED;
#if (LOSCFG_KERNEL_SMP == YES)
#ifdef LOSCFG_KERNEL_SMP
task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid());
#endif
g_cpupTestCount = 0;

View File

@@ -77,7 +77,7 @@ static UINT32 Testcase(VOID)
task1.pcName = "TskTst1";
task1.usTaskPrio = TASK_PRIO_TEST - 1; // 1, used to calculate the task priority.
task1.uwResved = TASK_STATUS_UNDETACHED;
#if (LOSCFG_KERNEL_SMP == YES)
#ifdef LOSCFG_KERNEL_SMP
task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid());
#endif
g_cpupTestCount = 0;

View File

@@ -71,7 +71,7 @@ static VOID TaskF01(VOID)
task1.pcName = "TskTst2";
task1.usTaskPrio = TASK_PRIO_TEST - 1; // 1, used to calculate the task priority.
task1.uwResved = TASK_STATUS_UNDETACHED;
#if (LOSCFG_KERNEL_SMP == YES)
#ifdef LOSCFG_KERNEL_SMP
task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid());
#endif
ICUNIT_ASSERT_EQUAL_VOID(g_cpupTestCount, 0, g_cpupTestCount);
@@ -114,7 +114,7 @@ static UINT32 Testcase(VOID)
task1.pcName = "TskTst1";
task1.usTaskPrio = TASK_PRIO_TEST - 2; // 2, used to calculate the task priority.
task1.uwResved = TASK_STATUS_UNDETACHED;
#if (LOSCFG_KERNEL_SMP == YES)
#ifdef LOSCFG_KERNEL_SMP
task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid());
#endif
g_cpupTestCount = 0;

View File

@@ -72,7 +72,7 @@ static UINT32 Testcase(VOID)
task1.pcName = "TestCpupTsk1";
task1.usTaskPrio = TASK_PRIO_TEST - 2; // 2, used to calculate the task priority.
task1.uwResved = TASK_STATUS_UNDETACHED;
#if (LOSCFG_KERNEL_SMP == YES)
#ifdef LOSCFG_KERNEL_SMP
task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid());
#endif
g_cpupTestCount = 0;

View File

@@ -76,7 +76,7 @@ static UINT32 Testcase(VOID)
taskInitParam.uwStackSize = LOSCFG_BASE_CORE_TSK_DEFAULT_STACK_SIZE;
taskInitParam.pcName = "SmpCpup001_task01";
taskInitParam.usTaskPrio = TASK_PRIO_TEST - 2; // 2, used to calculate the task priority.
#if (LOSCFG_KERNEL_SMP == YES)
#ifdef LOSCFG_KERNEL_SMP
/* make sure that created test task is definitely on another core */
UINT32 currCpuid = (ArchCurrCpuid() + 1) % LOSCFG_KERNEL_CORE_NUM;
taskInitParam.usCpuAffiMask = CPUID_TO_AFFI_MASK(currCpuid);
@@ -89,7 +89,7 @@ static UINT32 Testcase(VOID)
taskInitParam.uwStackSize = LOSCFG_BASE_CORE_TSK_DEFAULT_STACK_SIZE;
taskInitParam.pcName = "SmpCpup001_task02";
taskInitParam.usTaskPrio = TASK_PRIO_TEST - 1; // 1, used to calculate the task priority.
#if (LOSCFG_KERNEL_SMP == YES)
#ifdef LOSCFG_KERNEL_SMP
taskInitParam.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid());
#endif
ret = LOS_TaskCreate(&g_testSmpCpupTaskID02, &taskInitParam);

View File

@@ -68,7 +68,7 @@ static UINT32 Testcase(VOID)
taskInitParam.uwStackSize = LOSCFG_BASE_CORE_TSK_DEFAULT_STACK_SIZE;
taskInitParam.pcName = "SmpCpup002_task01";
taskInitParam.usTaskPrio = TASK_PRIO_TEST - 1; // 1, used to calculate the task priority.
#if (LOSCFG_KERNEL_SMP == YES)
#ifdef LOSCFG_KERNEL_SMP
taskInitParam.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid());
#endif
ret = LOS_TaskCreate(&g_testSmpCpupTaskID01, &taskInitParam);

View File

@@ -99,7 +99,7 @@ static UINT32 Testcase(VOID)
taskInitParam.uwStackSize = LOSCFG_BASE_CORE_TSK_DEFAULT_STACK_SIZE;
taskInitParam.pcName = "SmpCpup003_task01";
taskInitParam.usTaskPrio = TASK_PRIO_TEST - 2; // 2, used to calculate the task priority.
#if (LOSCFG_KERNEL_SMP == YES)
#ifdef LOSCFG_KERNEL_SMP
/* make sure that created test task is definitely on another core */
UINT32 currCpuid = (ArchCurrCpuid() + 1) % LOSCFG_KERNEL_CORE_NUM;
taskInitParam.usCpuAffiMask = CPUID_TO_AFFI_MASK(currCpuid);
@@ -112,7 +112,7 @@ static UINT32 Testcase(VOID)
taskInitParam.uwStackSize = LOSCFG_BASE_CORE_TSK_DEFAULT_STACK_SIZE;
taskInitParam.pcName = "SmpCpup003_task02";
taskInitParam.usTaskPrio = TASK_PRIO_TEST - 1; // 1, used to calculate the task priority.
#if (LOSCFG_KERNEL_SMP == YES)
#ifdef LOSCFG_KERNEL_SMP
taskInitParam.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid());
#endif
ret = LOS_TaskCreate(&g_testSmpCpupTaskID02, &taskInitParam);

View File

@@ -119,7 +119,7 @@ static UINT32 Testcase(VOID)
taskInitParam.uwStackSize = LOSCFG_BASE_CORE_TSK_DEFAULT_STACK_SIZE;
taskInitParam.pcName = "SmpCpup004_task01";
taskInitParam.usTaskPrio = TASK_PRIO_TEST - 2; // 2, used to calculate the task priority.
#if (LOSCFG_KERNEL_SMP == YES)
#ifdef LOSCFG_KERNEL_SMP
/* make sure that created test task is definitely on another core */
UINT32 currCpuid = (ArchCurrCpuid() + 1) % LOSCFG_KERNEL_CORE_NUM;
taskInitParam.usCpuAffiMask = CPUID_TO_AFFI_MASK(currCpuid);
@@ -132,7 +132,7 @@ static UINT32 Testcase(VOID)
taskInitParam.uwStackSize = LOSCFG_BASE_CORE_TSK_DEFAULT_STACK_SIZE;
taskInitParam.pcName = "SmpCpup004_task02";
taskInitParam.usTaskPrio = TASK_PRIO_TEST - 1; // 1, used to calculate the task priority.
#if (LOSCFG_KERNEL_SMP == YES)
#ifdef LOSCFG_KERNEL_SMP
taskInitParam.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid());
#endif
ret = LOS_TaskCreate(&g_testSmpCpupTaskID02, &taskInitParam);

View File

@@ -68,7 +68,7 @@ static void Task01(void)
taskInitParam.uwStackSize = LOSCFG_BASE_CORE_TSK_DEFAULT_STACK_SIZE;
taskInitParam.pcName = "SmpCpup005_task03";
taskInitParam.usTaskPrio = TASK_PRIO_TEST - 2; // 2, used to calculate the task priority.
#if (LOSCFG_KERNEL_SMP == YES)
#ifdef LOSCFG_KERNEL_SMP
taskInitParam.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid());
#endif
ret = LOS_TaskCreate(&g_testSmpCpupTaskID03, &taskInitParam);
@@ -79,7 +79,7 @@ static void Task01(void)
taskInitParam.uwStackSize = LOSCFG_BASE_CORE_TSK_DEFAULT_STACK_SIZE;
taskInitParam.pcName = "SmpCpup005_task04";
taskInitParam.usTaskPrio = TASK_PRIO_TEST - 2; // 2, used to calculate the task priority.
#if (LOSCFG_KERNEL_SMP == YES)
#ifdef LOSCFG_KERNEL_SMP
taskInitParam.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid());
#endif
ret = LOS_TaskCreate(&g_testSmpCpupTaskID04, &taskInitParam);
@@ -142,7 +142,7 @@ static UINT32 Testcase(VOID)
taskInitParam.uwStackSize = LOSCFG_BASE_CORE_TSK_DEFAULT_STACK_SIZE;
taskInitParam.pcName = "SmpCpup005_task01";
taskInitParam.usTaskPrio = TASK_PRIO_TEST - 2; // 2, used to calculate the task priority.
#if (LOSCFG_KERNEL_SMP == YES)
#ifdef LOSCFG_KERNEL_SMP
/* make sure that created test task is definitely on another core */
UINT32 currCpuid = (ArchCurrCpuid() + 1) % LOSCFG_KERNEL_CORE_NUM;
taskInitParam.usCpuAffiMask = CPUID_TO_AFFI_MASK(currCpuid);
@@ -155,7 +155,7 @@ static UINT32 Testcase(VOID)
taskInitParam.uwStackSize = LOSCFG_BASE_CORE_TSK_DEFAULT_STACK_SIZE;
taskInitParam.pcName = "SmpCpup005_task02";
taskInitParam.usTaskPrio = TASK_PRIO_TEST - 1; // 1, used to calculate the task priority.
#if (LOSCFG_KERNEL_SMP == YES)
#ifdef LOSCFG_KERNEL_SMP
taskInitParam.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid());
#endif
ret = LOS_TaskCreate(&g_testSmpCpupTaskID02, &taskInitParam);

View File

@@ -73,7 +73,7 @@ static UINT32 Testcase(VOID)
taskInitParam.pcName = "SmpCpup007_task01";
taskInitParam.usTaskPrio = TASK_PRIO_TEST - 2; // 2, used to calculate the task priority.
taskInitParam.uwResved = LOS_TASK_STATUS_DETACHED;
#if (LOSCFG_KERNEL_SMP == YES)
#ifdef LOSCFG_KERNEL_SMP
/* make sure that created test task is definitely on another core */
UINT32 currCpuid = (ArchCurrCpuid() + 1) % LOSCFG_KERNEL_CORE_NUM;
taskInitParam.usCpuAffiMask = CPUID_TO_AFFI_MASK(currCpuid);
@@ -86,7 +86,7 @@ static UINT32 Testcase(VOID)
taskInitParam.uwStackSize = LOSCFG_BASE_CORE_TSK_DEFAULT_STACK_SIZE;
taskInitParam.pcName = "SmpCpup007_task02";
taskInitParam.usTaskPrio = TASK_PRIO_TEST - 1;
#if (LOSCFG_KERNEL_SMP == YES)
#ifdef LOSCFG_KERNEL_SMP
taskInitParam.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid());
#endif
ret = LOS_TaskCreate(&g_testSmpCpupTaskID02, &taskInitParam);

View File

@@ -72,7 +72,7 @@ static UINT32 Testcase(VOID)
taskInitParam.uwStackSize = LOSCFG_BASE_CORE_TSK_DEFAULT_STACK_SIZE;
taskInitParam.pcName = "SmpCpup008_task01";
taskInitParam.usTaskPrio = TASK_PRIO_TEST - 2; // 2, used to calculate the task priority.
#if (LOSCFG_KERNEL_SMP == YES)
#ifdef LOSCFG_KERNEL_SMP
/* make sure that created test task is definitely on another core */
UINT32 currCpuid = (ArchCurrCpuid() + 1) % LOSCFG_KERNEL_CORE_NUM;
taskInitParam.usCpuAffiMask = CPUID_TO_AFFI_MASK(currCpuid);
@@ -85,7 +85,7 @@ static UINT32 Testcase(VOID)
taskInitParam.uwStackSize = LOSCFG_BASE_CORE_TSK_DEFAULT_STACK_SIZE;
taskInitParam.pcName = "SmpCpup008_task02";
taskInitParam.usTaskPrio = TASK_PRIO_TEST - 1; // 1, used to calculate the task priority.
#if (LOSCFG_KERNEL_SMP == YES)
#ifdef LOSCFG_KERNEL_SMP
taskInitParam.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid());
#endif
ret = LOS_TaskCreate(&g_testSmpCpupTaskID02, &taskInitParam);

View File

@@ -56,7 +56,7 @@ static void Task01(void)
taskInitParam.pcName = "SmpCpup009_task03";
taskInitParam.usTaskPrio = TASK_PRIO_TEST - 2; // 2, used to calculate the task priority.
taskInitParam.uwResved = LOS_TASK_STATUS_DETACHED;
#if (LOSCFG_KERNEL_SMP == YES)
#ifdef LOSCFG_KERNEL_SMP
taskInitParam.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid());
#endif
ret = LOS_TaskCreate(&g_testSmpCpupTaskID03, &taskInitParam);
@@ -96,7 +96,7 @@ static UINT32 Testcase(VOID)
taskInitParam.pcName = "SmpCpup009_task01";
taskInitParam.usTaskPrio = TASK_PRIO_TEST - 2; // 2, used to calculate the task priority.
taskInitParam.uwResved = LOS_TASK_STATUS_DETACHED;
#if (LOSCFG_KERNEL_SMP == YES)
#ifdef LOSCFG_KERNEL_SMP
/* make sure that created test task is definitely on another core */
UINT32 currCpuid = (ArchCurrCpuid() + 1) % LOSCFG_KERNEL_CORE_NUM;
taskInitParam.usCpuAffiMask = CPUID_TO_AFFI_MASK(currCpuid);
@@ -109,7 +109,7 @@ static UINT32 Testcase(VOID)
taskInitParam.uwStackSize = LOSCFG_BASE_CORE_TSK_DEFAULT_STACK_SIZE;
taskInitParam.pcName = "SmpCpup009_task02";
taskInitParam.usTaskPrio = TASK_PRIO_TEST - 1; // 1, used to calculate the task priority.
#if (LOSCFG_KERNEL_SMP == YES)
#ifdef LOSCFG_KERNEL_SMP
taskInitParam.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid());
#endif
ret = LOS_TaskCreate(&g_testSmpCpupTaskID02, &taskInitParam);

View File

@@ -75,7 +75,7 @@ static UINT32 Testcase(VOID)
taskInitParam.pcName = "SmpCpup001_task01";
taskInitParam.usTaskPrio = TASK_PRIO_TEST - 2; // 2, used to calculate the task priority.
taskInitParam.uwResved = LOS_TASK_STATUS_DETACHED;
#if (LOSCFG_KERNEL_SMP == YES)
#ifdef LOSCFG_KERNEL_SMP
/* make sure that created test task is definitely on another core */
UINT32 currCpuid = (ArchCurrCpuid() + 1) % LOSCFG_KERNEL_CORE_NUM;
taskInitParam.usCpuAffiMask = CPUID_TO_AFFI_MASK(currCpuid);
@@ -88,7 +88,7 @@ static UINT32 Testcase(VOID)
taskInitParam.uwStackSize = LOSCFG_BASE_CORE_TSK_DEFAULT_STACK_SIZE;
taskInitParam.pcName = "SmpCpup001_task02";
taskInitParam.usTaskPrio = TASK_PRIO_TEST - 1; // 1, used to calculate the task priority.
#if (LOSCFG_KERNEL_SMP == YES)
#ifdef LOSCFG_KERNEL_SMP
taskInitParam.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid());
#endif
ret = LOS_TaskCreate(&g_testSmpCpupTaskID02, &taskInitParam);

View File

@@ -95,7 +95,7 @@ static UINT32 Testcase(VOID)
taskInitParam.uwStackSize = LOSCFG_BASE_CORE_TSK_DEFAULT_STACK_SIZE;
taskInitParam.pcName = "SmpCpup001_task01";
taskInitParam.usTaskPrio = TASK_PRIO_TEST - 2; // 2, used to calculate the task priority.
#if (LOSCFG_KERNEL_SMP == YES)
#ifdef LOSCFG_KERNEL_SMP
/* make sure that created test task is definitely on another core */
UINT32 currCpuid = (ArchCurrCpuid() + 1) % LOSCFG_KERNEL_CORE_NUM;
taskInitParam.usCpuAffiMask = CPUID_TO_AFFI_MASK(currCpuid);
@@ -108,7 +108,7 @@ static UINT32 Testcase(VOID)
taskInitParam.uwStackSize = LOSCFG_BASE_CORE_TSK_DEFAULT_STACK_SIZE;
taskInitParam.pcName = "SmpCpup001_task02";
taskInitParam.usTaskPrio = TASK_PRIO_TEST - 1; // 1, used to calculate the task priority.
#if (LOSCFG_KERNEL_SMP == YES)
#ifdef LOSCFG_KERNEL_SMP
taskInitParam.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid());
#endif
ret = LOS_TaskCreate(&g_testSmpCpupTaskID02, &taskInitParam);

View File

@@ -78,7 +78,7 @@ static UINT32 Testcase(VOID)
taskInitParam.uwStackSize = LOSCFG_BASE_CORE_TSK_DEFAULT_STACK_SIZE;
taskInitParam.pcName = "SmpCpup001_task01";
taskInitParam.usTaskPrio = TASK_PRIO_TEST - 2; // 2, used to calculate the task priority.
#if (LOSCFG_KERNEL_SMP == YES)
#ifdef LOSCFG_KERNEL_SMP
/* make sure that created test task is definitely on another core */
UINT32 currCpuid = (ArchCurrCpuid() + 1) % LOSCFG_KERNEL_CORE_NUM;
taskInitParam.usCpuAffiMask = CPUID_TO_AFFI_MASK(currCpuid);
@@ -91,7 +91,7 @@ static UINT32 Testcase(VOID)
taskInitParam.uwStackSize = LOSCFG_BASE_CORE_TSK_DEFAULT_STACK_SIZE;
taskInitParam.pcName = "SmpCpup001_task02";
taskInitParam.usTaskPrio = TASK_PRIO_TEST - 1; // 1, used to calculate the task priority.
#if (LOSCFG_KERNEL_SMP == YES)
#ifdef LOSCFG_KERNEL_SMP
taskInitParam.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid());
#endif
ret = LOS_TaskCreate(&g_testSmpCpupTaskID02, &taskInitParam);